1 // This file is part of Notepad++ project
2 // Copyright (C)2020 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 	core.sys.windows.windef.HWND _nppHandle;
50 	core.sys.windows.windef.HWND _scintillaMainHandle;
51 	core.sys.windows.windef.HWND _scintillaSecondHandle;
52 }
53 
54 alias PFUNCSETINFO = extern (C) nothrow void function(.NppData);
55 alias PFUNCPLUGINCMD = extern (C) nothrow void function();
56 alias PBENOTIFIED = extern (C) nothrow void function(npp_api.scintilla.Scintilla.SCNotification*);
57 
58 extern (C)
59 nothrow
60 /* __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;
61 
62 struct ShortcutKey
63 {
64 	bool _isCtrl = false;
65 	bool _isAlt = false;
66 	bool _isShift = false;
67 	core.sys.windows.winnt.UCHAR _key = 0;
68 }
69 
70 struct FuncItem
71 {
72 	/**
73 	 *
74 	 */
75 	core.sys.windows.winnt.WCHAR[.nbChar] _itemName = 0;
76 
77 	/**
78 	 *
79 	 */
80 	.PFUNCPLUGINCMD _pFunc = null;
81 
82 	/**
83 	 * Notepad++ allocate this
84 	 */
85 	int _cmdID = 0;
86 
87 	/**
88 	 *
89 	 */
90 	bool _init2Check = false;
91 
92 	/**
93 	 *
94 	 */
95 	.ShortcutKey* _pShKey = null;
96 }
97 
98 alias PFUNCGETFUNCSARRAY = extern (C) nothrow .FuncItem* function(int*);