1 // This file is part of Notepad++ project
2 // Copyright (C)2003 Don HO <don.h@free.fr>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either
7 // version 2 of the License, or (at your option) any later version.
8 //
9 // Note that the GPL places important restrictions on "derived works", yet
10 // it does not provide a detailed definition of that term.  To avoid
11 // misunderstandings, we consider an application to constitute a
12 // "derivative work" for the purpose of this license if it does any of the
13 // following:
14 // 1. Integrates source code from Notepad++.
15 // 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
16 //    installer, such as those produced by InstallShield.
17 // 3. Links to a library or executes a program that does any of the above.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 /**
28  *
29  *
30  * License: GPL-2.0 or later
31  */
32 module npp_api.powereditor.misc.pluginsmanager.plugininterface;
33 
34 
35 version (Windows):
36 
37 private static import core.sys.windows.windef;
38 private static import core.sys.windows.winnt;
39 private static import npp_api.scintilla.scintilla;
40 
41 extern (C):
42 
43 enum size_t nbChar = 64;
44 
45 alias PFUNCGETNAME = extern (C) nothrow const (core.sys.windows.winnt.WCHAR)* function();
46 
47 struct NppData
48 {
49 	static import core.sys.windows.windef;
50 
51 	core.sys.windows.windef.HWND _nppHandle;
52 	core.sys.windows.windef.HWND _scintillaMainHandle;
53 	core.sys.windows.windef.HWND _scintillaSecondHandle;
54 }
55 
56 alias PFUNCSETINFO = extern (C) nothrow void function(.NppData);
57 alias PFUNCPLUGINCMD = extern (C) nothrow void function();
58 alias PBENOTIFIED = extern (C) nothrow void function(npp_api.scintilla.scintilla.SCNotification*);
59 
60 extern (C)
61 nothrow
62 /* __gshared */ core.sys.windows.windef.LRESULT function(core.sys.windows.windef.UINT Message, core.sys.windows.windef.WPARAM wParam, core.sys.windows.windef.LPARAM lParam) PMESSAGEPROC;
63 
64 struct ShortcutKey
65 {
66 	static import core.sys.windows.winnt;
67 
68 	bool _isCtrl = false;
69 	bool _isAlt = false;
70 	bool _isShift = false;
71 	core.sys.windows.winnt.UCHAR _key = 0;
72 }
73 
74 struct FuncItem
75 {
76 	static import core.sys.windows.winnt;
77 
78 	/**
79 	 *
80 	 */
81 	core.sys.windows.winnt.WCHAR[.nbChar] _itemName = 0;
82 
83 	/**
84 	 *
85 	 */
86 	.PFUNCPLUGINCMD _pFunc = null;
87 
88 	/**
89 	 * Notepad++ allocate this
90 	 */
91 	int _cmdID = 0;
92 
93 	/**
94 	 *
95 	 */
96 	bool _init2Check = false;
97 
98 	/**
99 	 *
100 	 */
101 	.ShortcutKey* _pShKey = null;
102 }
103 
104 alias PFUNCGETFUNCSARRAY = extern (C) nothrow .FuncItem* function(int*);