forked from vladk1973/npp.connections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NppPluginInclude.pas
61 lines (53 loc) · 1.31 KB
/
NppPluginInclude.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
procedure DLLEntryPoint(dwReason: Integer);
begin
case dwReason of
DLL_PROCESS_ATTACH:
begin
// create the main object
Easy.diaplugin.Npp := TdiaPlugin.Create;
end;
DLL_PROCESS_DETACH:
begin
if (Assigned(Easy.diaplugin.Npp)) then Easy.diaplugin.Npp.Destroy;
end;
end;
end;
procedure setInfo(NppData: TNppData); cdecl; export;
begin
Easy.diaplugin.Npp.SetInfo(NppData);
end;
function getName: nppPchar; cdecl; export;
begin
Result := Easy.diaplugin.Npp.GetName;
end;
function getFuncsArray(var nFuncs:integer):Pointer;cdecl; export;
begin
Result := Easy.diaplugin.Npp.GetFuncsArray(nFuncs);
end;
procedure beNotified(sn: PSCNotification); cdecl; export;
begin
Easy.diaplugin.Npp.BeNotified(sn);
end;
function messageProc(msg: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; cdecl; export;
var
Message:TMessage;
begin
Message.Msg := msg;
Message.WParam := wParam;
Message.LParam := lParam;
Message.Result := 0;
Easy.diaplugin.Npp.MessageProc(Message);
Result := Message.Result;
end;
{$IFDEF NPPUNICODE}
function isUnicode : Boolean; cdecl; export;
begin
Result := true;
end;
{$ENDIF}
exports
setInfo, getName, getFuncsArray, beNotified, messageProc;
{$IFDEF NPPUNICODE}
exports
isUnicode;
{$ENDIF}