1 //this file is part of notepad++
2 //Copyright (C)2003 Don HO <donho@altern.org>
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 //This program is distributed in the hope that it will be useful,
10 //but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //GNU General Public License for more details.
13 //
14 //You should have received a copy of the GNU General Public License
15 //along with this program; if not, write to the Free Software
16 //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 /**
18  * BetterC test1
19  *
20  * Author: dokutoku, https://twitter.com/dokutoku3
21  * License: GPL-2.0 or later
22  */
23 module nppplugintemplate.better_c_test1;
24 
25 
26 version (Windows):
27 version (D_BetterC):
28 version (betterC_test1):
29 
30 private static import core.sys.windows.basetsd;
31 private static import core.sys.windows.winnt;
32 private static import core.sys.windows.windef;
33 private static import npp_api.scintilla.scintilla;
34 private static import npp_api.powereditor.misc.pluginsmanager.plugininterface;
35 
36 pragma(mangle, "nppData")
37 extern (C)
38 npp_api.powereditor.misc.pluginsmanager.plugininterface.NppData nppData;
39 
40 npp_api.powereditor.misc.pluginsmanager.plugininterface.FuncItem main_menu;
41 
42 extern (C)
43 pure nothrow @safe @nogc
44 void dummy_func()
45 
46 	do
47 	{
48 	}
49 
50 pragma(mangle, "DllMain")
51 extern (Windows)
52 pure nothrow @safe @nogc
53 core.sys.windows.windef.BOOL DllMain(core.sys.windows.basetsd.HANDLE hModule, core.sys.windows.windef.DWORD reasonForCall, core.sys.windows.winnt.LPVOID lpReserved)
54 
55 	do
56 	{
57 		static import core.sys.windows.windef;
58 
59 		return core.sys.windows.windef.TRUE;
60 	}
61 
62 pragma(mangle, "getName")
63 extern (C)
64 pure nothrow @safe @nogc
65 export const (core.sys.windows.winnt.WCHAR)* getName()
66 
67 	do
68 	{
69 		return &("BetterC test1\0"w[0]);
70 	}
71 
72 pragma(mangle, "getFuncsArray")
73 extern (C)
74 nothrow @nogc
75 export const (npp_api.powereditor.misc.pluginsmanager.plugininterface.FuncItem)* getFuncsArray(int* nbF)
76 
77 	do
78 	{
79 		if (nbF == null) {
80 			return null;
81 		}
82 
83 		*nbF = 1;
84 
85 		return &.main_menu;
86 	}
87 
88 pragma(mangle, "isUnicode")
89 extern (C)
90 pure nothrow @safe @nogc
91 export core.sys.windows.windef.BOOL isUnicode()
92 
93 	do
94 	{
95 		static import core.sys.windows.windef;
96 
97 		return core.sys.windows.windef.TRUE;
98 	}
99 
100 pragma(mangle, "setInfo")
101 extern (C)
102 nothrow @nogc
103 export void setInfo(npp_api.powereditor.misc.pluginsmanager.plugininterface.NppData notpadPlusData)
104 
105 	do
106 	{
107 		.nppData = notpadPlusData;
108 		.main_menu._itemName = "dummy menu\0"w;
109 		.main_menu._pFunc = &dummy_func;
110 		.main_menu._cmdID = 0;
111 		.main_menu._init2Check = false;
112 		.main_menu._pShKey = null;
113 	}
114 
115 pragma(mangle, "beNotified")
116 extern (C)
117 pure nothrow @safe @nogc
118 export void beNotified(npp_api.scintilla.scintilla.SCNotification* notifyCode)
119 
120 	do
121 	{
122 	}
123 
124 pragma(mangle, "messageProc")
125 extern (C)
126 pure nothrow @safe @nogc
127 export core.sys.windows.windef.LRESULT messageProc(core.sys.windows.windef.UINT Message, core.sys.windows.windef.WPARAM wParam, core.sys.windows.windef.LPARAM lParam)
128 
129 	do
130 	{
131 		static import core.sys.windows.windef;
132 
133 		return core.sys.windows.windef.TRUE;
134 	}