Debian Codegraph @

sdk/extension.h

raw
1 #include "common.h"
2
3 /* dialog messages */
4 #define DM_FIRST 0
5 #define DM_CLOSE DM_FIRST+1 /* A signal that the dialog is about to close */
6 #define DM_ENABLE DM_FIRST+2
7 #define DM_GETDLGDATA DM_FIRST+3
8 #define DM_GETDLGBOUNDS DM_FIRST+4
9 #define DM_GETITEMBOUNDS DM_FIRST+5
10 #define DM_GETTEXT DM_FIRST+6 /* Retrieve the text of an edit string or the caption of an item */
11 #define DM_KEYDOWN DM_FIRST+7
12 #define DM_KEYUP DM_FIRST+8
13 #define DM_SETDLGDATA DM_FIRST+9
14 #define DM_SETFOCUS DM_FIRST+10 /* Set the keyboard focus to the given dialog item */
15 #define DM_REDRAW DM_FIRST+11 /* Redraw the whole dialog */
16 #define DM_SETTEXT DM_FIRST+12 /* Set a new string value for an edit line or a new caption for an item */
17 #define DM_SETMAXTEXTLENGTH DM_FIRST+13 /* Set the maximum length of an edit string */
18 #define DM_SHOWDIALOG DM_FIRST+14 /* Show/hide the dialog window */
19 #define DM_SHOWITEM DM_FIRST+15 /* Show/hide a dialog item */
20 #define DM_GETCHECK DM_FIRST+16 /* Retrieve the state of TCheckBox or TRadioButton items */
21 #define DM_SETCHECK DM_FIRST+17 /* Change the state of TCheckBox and TRadioButton items */
22 #define DM_LISTGETITEM DM_FIRST+18 /* Retrieve a list item */
23 #define DM_LISTGETITEMINDEX DM_FIRST+19 /* Get current item index in a list */
24 #define DM_LISTSETITEMINDEX DM_FIRST+20 /* Set current item index in a list */
25 #define DM_LISTDELETE DM_FIRST+21
26 #define DM_LISTADD DM_FIRST+22
27 #define DM_LISTADDSTR DM_FIRST+23
28 #define DM_LISTUPDATE DM_FIRST+24
29 #define DM_LISTINSERT DM_FIRST+25
30 #define DM_LISTINDEXOF DM_FIRST+26
31 #define DM_LISTGETCOUNT DM_FIRST+27
32 #define DM_LISTGETDATA DM_FIRST+28
33 #define DM_LISTSETDATA DM_FIRST+29
34 #define DM_SETDLGBOUNDS DM_FIRST+30
35 #define DM_SETITEMBOUNDS DM_FIRST+31
36 #define DM_GETDROPPEDDOWN DM_FIRST+32
37 #define DM_SETDROPPEDDOWN DM_FIRST+33
38 #define DM_GETITEMDATA DM_FIRST+34
39 #define DM_SETITEMDATA DM_FIRST+35
40 #define DM_LISTSET DM_FIRST+36
41 #define DM_SETPROGRESSVALUE DM_FIRST+37
42 #define DM_SETPROGRESSSTYLE DM_FIRST+38
43 #define DM_SETPASSWORDCHAR DM_FIRST+39
44 #define DM_LISTCLEAR DM_FIRST+40
45 #define DM_TIMERSETINTERVAL DM_FIRST+41
46
47 /* events messages */
48 #define DN_FIRST 0x1000
49 #define DN_CLICK DN_FIRST+1 /* Sent after mouse click */
50 #define DN_DBLCLICK DN_FIRST+2 /* Sent after mouse double click */
51 #define DN_CHANGE DN_FIRST+3 /* Sent after the dialog item is changed */
52 #define DN_GOTFOCUS DN_FIRST+4 /* Sent when the dialog item gets input focus */
53 #define DN_INITDIALOG DN_FIRST+5 /* Sent before showing the dialog */
54 #define DN_KILLFOCUS DN_FIRST+6 /* Sent before a dialog item loses the input focus */
55 #define DN_TIMER DN_FIRST+7 /* Sent when a timer expires */
56
57 #define DN_KEYDOWN DM_KEYDOWN
58 #define DN_KEYUP DM_KEYUP
59 #define DN_CLOSE DM_CLOSE /* Sent before the dialog is closed */
60
61 #define DM_USER 0x4000 /* Starting value for user defined messages */
62
63 // MessageBox: To indicate the buttons displayed in the message box,
64 // specify one of the following values.
65 #define MB_OK 0x00000000
66 #define MB_OKCANCEL 0x00000001
67 #define MB_ABORTRETRYIGNORE 0x00000002
68 #define MB_YESNOCANCEL 0x00000003
69 #define MB_YESNO 0x00000004
70 #define MB_RETRYCANCEL 0x00000005
71 #define MB_ICONHAND 0x00000010
72 #define MB_ICONQUESTION 0x00000020
73 #define MB_ICONEXCLAMATION 0x00000030
74 #define MB_ICONASTERICK 0x00000040
75 #define MB_ICONWARNING MB_ICONEXCLAMATION
76 #define MB_ICONERROR MB_ICONHAND
77 #define MB_ICONSTOP MB_ICONHAND
78 #define MB_ICONINFORMATION MB_ICONASTERICK
79 // MessageBox: To indicate the default button, specify one of the following values.
80 #define MB_DEFBUTTON1 0x00000000
81 #define MB_DEFBUTTON2 0x00000100
82 #define MB_DEFBUTTON3 0x00000200
83 #define MB_DEFBUTTON4 0x00000300
84 // MessageBox: Return values
85 #define ID_OK 1
86 #define ID_CANCEL 2
87 #define ID_ABORT 3
88 #define ID_RETRY 4
89 #define ID_IGNORE 5
90 #define ID_YES 6
91 #define ID_NO 7
92 #define ID_CLOSE 8
93 #define ID_HELP 9
94 // DialogBoxParam: Flags
95 #define DB_LFM 0 // Data contains a form in the LFM format
96 #define DB_LRS 1 // Data contains a form in the LRS format
97 #define DB_FILENAME 2 // Data contains a form file name (*.lfm)
98
99 /* other */
100 #define EXT_MAX_PATH 16384 /* 16 Kb */
101
102 /* Dialog window callback function */
103 typedef intptr_t (DCPCALL *tDlgProc)(uintptr_t pDlg, char* DlgItemName, intptr_t Msg, intptr_t wParam, intptr_t lParam);
104 /* Definition of callback functions called by the DLL */
105 typedef BOOL (DCPCALL *tInputBoxProc)(char* Caption, char* Prompt, BOOL MaskInput, char* Value, int ValueMaxLen);
106 typedef int (DCPCALL *tMessageBoxProc)(char* Text, char* Caption, long Flags);
107 typedef int (DCPCALL *tMsgChoiceBoxProc)(char* Text, char* Caption, char** Buttons, int BtnDef, int BtnEsc);
108 typedef BOOL (DCPCALL *tDialogBoxLFMProc)(intptr_t LFMData, unsigned long DataSize, tDlgProc DlgProc);
109 typedef BOOL (DCPCALL *tDialogBoxLRSProc)(intptr_t LRSData, unsigned long DataSize, tDlgProc DlgProc);
110 typedef BOOL (DCPCALL *tDialogBoxLFMFileProc)(char* LFMFileName, tDlgProc DlgProc);
111 typedef uintptr_t (DCPCALL *tDialogBoxParamProc)(void* Data, uint32_t DataSize, tDlgProc DlgProc, uint32_t Flags, void *UserData, void* Reserved);
112 typedef int (DCPCALL *tTranslateStringProc)(void *Translation, const char *Identifier, const char *Original, char *Output, int OutLen);
113
114 #pragma pack(push)
115 #pragma pack(1)
116 typedef struct {
117 uint32_t StructSize;
118 char PluginDir[EXT_MAX_PATH];
119 char PluginConfDir[EXT_MAX_PATH];
120 tInputBoxProc InputBox;
121 tMessageBoxProc MessageBox;
122 tDialogBoxLFMProc DialogBoxLFM;
123 tDialogBoxLRSProc DialogBoxLRS;
124 tDialogBoxLFMFileProc DialogBoxLFMFile;
125 tDlgProc SendDlgMsg;
126 void *Translation;
127 tTranslateStringProc TranslateString;
128 uintptr_t VersionAPI;
129 tMsgChoiceBoxProc MsgChoiceBox;
130 tDialogBoxParamProc DialogBoxParam;
131 unsigned char Reserved[4091 * sizeof(void *)];
132 } tExtensionStartupInfo;
133 #pragma pack(pop)
134
135 typedef void (DCPCALL tExtensionInitializeProc)(tExtensionStartupInfo* StartupInfo);
136 typedef void (DCPCALL tExtensionFinalizeProc)(void* Reserved);
137
138 /* Plugin must implement this function for working with Extension API
139
140 void DCPCALL ExtensionInitialize(tExtensionStartupInfo* StartupInfo);
141
142 void DCPCALL ExtensionFinalize(void* Reserved);
143
144 */