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.windef;
32 private static import core.sys.windows.winnt;
33 private static import npp_api.PowerEditor.MISC.PluginsManager.PluginInterface;
34 private static import npp_api.scintilla.Scintilla;
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 		return core.sys.windows.windef.TRUE;
58 	}
59 
60 pragma(mangle, "getName")
61 extern (C)
62 pure nothrow @safe @nogc
63 export const (core.sys.windows.winnt.WCHAR)* getName()
64 
65 	do
66 	{
67 		return &("BetterC test1\0"w[0]);
68 	}
69 
70 pragma(mangle, "getFuncsArray")
71 extern (C)
72 nothrow @nogc
73 export const (npp_api.PowerEditor.MISC.PluginsManager.PluginInterface.FuncItem)* getFuncsArray(int* nbF)
74 
75 	do
76 	{
77 		if (nbF == null) {
78 			return null;
79 		}
80 
81 		*nbF = 1;
82 
83 		return &.main_menu;
84 	}
85 
86 pragma(mangle, "isUnicode")
87 extern (C)
88 pure nothrow @safe @nogc
89 export core.sys.windows.windef.BOOL isUnicode()
90 
91 	do
92 	{
93 		return core.sys.windows.windef.TRUE;
94 	}
95 
96 pragma(mangle, "setInfo")
97 extern (C)
98 nothrow @nogc
99 export void setInfo(npp_api.PowerEditor.MISC.PluginsManager.PluginInterface.NppData notpadPlusData)
100 
101 	do
102 	{
103 		.nppData = notpadPlusData;
104 		.main_menu._itemName = "dummy menu\0"w;
105 		.main_menu._pFunc = &dummy_func;
106 		.main_menu._cmdID = 0;
107 		.main_menu._init2Check = false;
108 		.main_menu._pShKey = null;
109 	}
110 
111 pragma(mangle, "beNotified")
112 extern (C)
113 pure nothrow @safe @nogc
114 export void beNotified(npp_api.scintilla.Scintilla.SCNotification* notifyCode)
115 
116 	do
117 	{
118 	}
119 
120 pragma(mangle, "messageProc")
121 extern (C)
122 pure nothrow @safe @nogc
123 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)
124 
125 	do
126 	{
127 		return core.sys.windows.windef.TRUE;
128 	}