forked from m417z/RAEditC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathData.h
276 lines (250 loc) · 7.15 KB
/
Data.h
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#pragma once
#include <windows.h>
#include <commctrl.h>
#include "RegisterTypes.h"
#include "include/RAEdit.h"
#define MAXLINEMEM (8*1024)
#define MAXCHARMEM (24*1024)
//#define MAXCHARMEM (32*1024)
#define MAXUNDOMEM (24*1024)
#define MAXWORDMEM (8*1024)
//#define MAXFREE 32
#define MAXFREE 256
#define MAXSTREAM (32*1024)
#define BTNWT 14
#define BTNHT 6
#define SELWT 26
#define LNRWT 28
#define UNDO_INSERT 1
#define UNDO_OVERWRITE 2
#define UNDO_DELETE 3
#define UNDO_BACKDELETE 4
#define UNDO_INSERTBLOCK 5
#define UNDO_DELETEBLOCK 6
typedef int CALLBACK (* BOOKMARK_PAINT_CALLBACK)(HWND hWnd, DWORD line);
struct tagTIMER {
HWND hwnd;
UINT umsg;
LPARAM lparam;
WPARAM wparam;
};
typedef struct tagTIMER TIMER;
struct tagRABRUSH {
HBRUSH hBrBck; // Back color brush
HBRUSH hBrSelBck; // Sel back color brush
HBRUSH hBrHilite1; // Line hilite 1
HBRUSH hBrHilite2; // Line hilite 2
HBRUSH hBrHilite3; // Line hilite 3
HBRUSH hBrSelBar; // Selection bar
HBRUSH hPenSelbar; // Selection bar pen
};
typedef struct tagRABRUSH RABRUSH;
struct tagWORDINFO {
DWORD len; // Length
DWORD rpprev; // Relative pointer to previous
DWORD color; // Color (high byte is font 0-3)
DWORD fend; // End flag
};
typedef struct tagWORDINFO WORDINFO;
struct tagRAFONTINFO {
BYTE charset; // Character set
BYTE fDBCS; // Use double byte characters
DWORD fntwt; // Font width
DWORD fntht; // Font height
DWORD spcwt; // Space width
DWORD tabwt; // Tab width
DWORD italic; // Height shift
BOOL monospace; // Font is monospaced
DWORD linespace; // Extra line spacing
};
typedef struct tagRAFONTINFO RAFONTINFO;
struct tagLINE {
DWORD rpChars; // Relative pointer to CHARS
};
typedef struct tagLINE LINE;
struct tagCHARS {
DWORD len; // Actual String len
DWORD max; // Max String len
DWORD state; // Line state
DWORD bmid; // Bookmark ID
DWORD errid; // Error ID
};
typedef struct tagCHARS CHARS;
struct tagRAUNDO {
DWORD rpPrev; // Relative pointer to previous
DWORD undoid; // Undo ID
DWORD cp; // Character position
DWORD cb; // Size in bytes
BYTE fun; // Function
};
typedef struct tagRAUNDO RAUNDO;
struct tagRAEDT {
HWND hwnd; // Handle of edit a or b
HWND hvscroll; // Handle of scroll bar
DWORD cpxmax; // Last cursor pos x
DWORD cpy; // Scroll position
DWORD cp; // Character position
RECT rc; // Edit a or b rect
DWORD topyp; // First visible lines Y position
DWORD topln; // First visible lines linenumber
DWORD topcp; // First visible lines character position
};
typedef struct tagRAEDT RAEDT;
struct tagEDIT {
HWND hwnd; // Handle of main window
DWORD fstyle; // Window style
LONG_PTR ID; // Window ID
HWND hpar; // Handle of parent window
RAEDT edta;
RAEDT edtb;
HWND hhscroll; // Handle of horizontal scrollbar
HWND hgrip; // Handle of sizegrip
HWND hnogrip; // Handle of nosizegrip
HWND hsbtn; // Handle of splitt button
HWND hlin; // Handle of linenumber button
HWND hexp; // Handle of expand button
HWND hcol; // Handle of collapse button
HWND hlock; // Handle of lock button
HWND hsta; // Handle of state window
HWND htt; // Handle of tooltip
DWORD fresize; // Resize in action flag
DWORD fsplitt; // Splitt factor
DWORD nsplitt; // Splitt height
HANDLE hHeap; // Handle of heap
HANDLE hLine; // Handle of line pointer mem
ULONG_PTR cbLine; // Size of line pointer mem
DWORD rpLine; // Relative pointer into line pointer mem
DWORD rpLineFree; // Pointer to free line pointer
HANDLE hChars; // Handle of character mem
ULONG_PTR cbChars; // Size of character mem
DWORD rpChars; // Relative pointer into character mem
DWORD rpCharsFree; // Relative pointer to free character
HANDLE hUndo; // Handle of undo memory
ULONG_PTR cbUndo; // Size of undo memory
DWORD rpUndo; // Relative pointer to free (last)
DWORD line; // Linenumber
DWORD cpLine; // Character position for start of line
RECT rc; // Main rect
DWORD selbarwt; // Width of selection bar
DWORD nlinenrwt; // Initial width of linenumber bar
DWORD linenrwt; // Width of linenumber bar
DWORD nScroll; // Mouse wheel scroll lines
DWORD nPageBreak; // Page break
DWORD cpMin; // Selection min
DWORD cpMax; // Selection max
BOOL fOvr; // Insert / Overwrite
DWORD nHidden; // Number of hidden lines
DWORD cpx; // Scroll position
HANDLE focus; // Handle of edit having focus
BOOL fCaretHide; // Caret is hidden
BOOL fChanged; // Content changed
BOOL fHideSel; // Hide selection
BOOL fIndent; // Auto indent
RACOLOR clr;
RABRUSH br;
DWORD nTab; // Tab size
RAFONT fnt;
RAFONTINFO fntinfo;
BOOKMARK_PAINT_CALLBACK lpBmCB; // Bookmark paint callback
DWORD nchange; // Used by EN_SELCHANGE
DWORD nlastchange; // Used by EN_SELCHANGE
DWORD nWordGroup; // Hilite word group
BOOL fExpandTab; // TRUE/FALSE Epand tabs to spaces
CHARRANGE savesel;
HWND htlt; // Scroll tooltip
DWORD nMode; // Block selection
BLOCKRANGE blrg;
DWORD lockundoid;
DWORD ccmntblocks;
DWORD cpbrst; // bracket start
DWORD cpbren; // bracket end
DWORD cpselbar;
BOOL fLock;
DWORD nCursorWordType;
DWORD fstyleex;
BOOL funicode;
DWORD fhilite;
DWORD lastline;
};
typedef struct tagEDIT EDIT;
#define IDB_RAEDITBUTTON 100
#define IDC_HSPLITTCUR 101
#define IDB_BOOKMARK 102
#define IDC_SELECTCUR 103
#define IDB_LINENUMBER 104
#define IDB_EXPAND 105
#define IDB_COLLAPSE 106
#define IDB_LOCK 107
// .const
extern char *szScrollBar;
extern char *szStatic;
extern char *szButton;
extern char *szToolTips;
extern char *szToolTip;
extern char *szSplitterBar;
extern char *szLineNumber;
extern char *szExpand;
extern char *szCollapse;
extern char *szLock;
extern char *szChanged;
extern char *szX;
extern char *szW;
extern char *szI;
extern char *szSpace;
extern char *szTab;
extern char *szComment;
extern char *szInclude;
extern char *szIncludelib;
extern char *szMemFailLine;
extern char *szMemFailChar;
extern char *szMemFailUndo;
extern char *szMemFailSyntax;
extern char *szGlobalFail;
extern char *szHeapFail;
extern char *szRAEditClass;
extern char *szEditClassName;
// .data
extern BYTE CharTabInit[];
extern BYTE CharTab[];
extern BYTE CaseTab[];
extern char szLine[32];
// data?
extern HINSTANCE hInstance;
extern HBITMAP hBmpLnr;
extern HBITMAP hBmpExp;
extern HBITMAP hBmpCol;
extern HBITMAP hBmpLck;
extern HCURSOR hHSCur;
extern HCURSOR hSelCur;
extern HIMAGELIST hIml;
extern HBRUSH hBrTlt;
extern DWORD SBWT; // Scroll bar width, GetSystemMetrics(SM_CXVSCROLL)
extern WNDPROC OldStateProc;
extern WNDPROC OldSplittBtnProc;
extern WNDPROC OldFakeToolTipProc;
extern HANDLE hWrdMem;
extern ULONG_PTR cbWrdMem;
extern DWORD rpWrdFree;
extern DWORD fSelState;
extern DWORD iYp;
extern BOOL fOnBM;
extern DWORD fOnSel;
extern DWORD nBmid; // Bookmark id
extern DWORD nUndoid;
extern BOOL fSize;
extern UINT_PTR TimerID;
extern TIMER tmr1;
extern TIMER tmr2;
extern POINT ptDrag;
extern HWND hDragWin;
extern EDIT *hDragSourceMem;
extern CHARRANGE cpDragSource;
extern DWORD peff; // Drop effect
extern DWORD MpX;
extern DWORD MpY;
extern DWORD fTlln;
extern BYTE blockdefs[4096];
extern BYTE bracketstart[16];
extern BYTE bracketend[16];
extern BYTE bracketcont[16];
extern BOOL fNoSaveUndo;