]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/include/WinDefs.h
Upgraded to version 1.39 of Scintilla, and upated wxStyledTextCtrl
[wxWidgets.git] / src / stc / scintilla / include / WinDefs.h
1 // Scintilla source code edit control
2 /** @file WinDefs.h
3 ** The subset of definitions from Windows needed by Scintilla for GTK+.
4 **/
5 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
7
8 #ifndef WINDEFS_H
9 #define WINDEFS_H
10
11 /* Running GTK version on win32 */
12 #if PLAT_GTK_WIN32
13 #include "Windows.h"
14 #include "Richedit.h"
15
16 /* Name conflicts */
17 #undef DrawText
18 #undef FindText
19 #else
20
21 #define WORD short
22 #define WPARAM unsigned long
23 #define LPARAM long
24 #define LRESULT long
25 #define DWORD long
26
27 #define UINT unsigned int
28 #define LPSTR char *
29 #define LONG long
30
31 //#if 0
32 /* RTF control */
33 #define EM_CANPASTE (1074)
34 #define EM_CANUNDO (198)
35 #define EM_CHARFROMPOS (215)
36 #define EM_EMPTYUNDOBUFFER (205)
37 #define EM_EXGETSEL (1076)
38 #define EM_EXLINEFROMCHAR (1078)
39 #define EM_EXSETSEL (1079)
40 #define EM_FINDTEXT (1080)
41 #define EM_FINDTEXTEX (1103)
42 #define EM_FORMATRANGE (1081)
43 #define EM_GETFIRSTVISIBLELINE (206)
44 #define EM_GETLINE (196)
45 #define EM_GETLINECOUNT (186)
46 #define EM_GETMARGINS (212)
47 #define EM_GETMODIFY (184)
48 #define EM_GETRECT (178)
49 #define EM_GETSEL (176)
50 #define EM_GETSELTEXT (1086)
51 #define EM_GETTEXTRANGE (1099)
52 #define EM_HIDESELECTION (1087)
53 #define EM_LINEFROMCHAR (201)
54 #define EM_LINEINDEX (187)
55 #define EM_LINELENGTH (193)
56 #define EM_LINESCROLL (182)
57 #define EM_POSFROMCHAR (214)
58 #define EM_REPLACESEL (194)
59 #define EM_SCROLLCARET (183)
60 #define EM_SELECTIONTYPE (1090)
61 #define EM_SETMARGINS (211)
62 #define EM_SETREADONLY (207)
63 #define EM_SETSEL (177)
64 #define EM_UNDO (199)
65
66 #define WM_NULL (0)
67 #define WM_CLEAR (771)
68 #define WM_COPY (769)
69 #define WM_CUT (768)
70 #define WM_GETTEXT (13)
71 #define WM_GETTEXTLENGTH (14)
72 #define WM_PASTE (770)
73 #define WM_SETTEXT (12)
74 #define WM_UNDO (772)
75
76 #define EN_CHANGE (768)
77 #define EN_KILLFOCUS (512)
78 #define EN_SETFOCUS (256)
79
80 #define EC_LEFTMARGIN 1
81 #define EC_RIGHTMARGIN 2
82 #define EC_USEFONTINFO 0xffff
83
84 //#endif
85
86 #if 0
87 #if PLAT_GTK
88 #define VK_DOWN GDK_Down
89 #define VK_UP GDK_Up
90 #define VK_LEFT GDK_Left
91 #define VK_RIGHT GDK_Right
92 #define VK_HOME GDK_Home
93 #define VK_END GDK_End
94 #define VK_PRIOR GDK_Page_Up
95 #define VK_NEXT GDK_Page_Down
96 #define VK_DELETE GDK_Delete
97 #define VK_INSERT GDK_Insert
98 #define VK_ESCAPE GDK_Escape
99 #define VK_BACK GDK_BackSpace
100 #define VK_TAB GDK_Tab
101 #define VK_RETURN GDK_Return
102 #define VK_ADD GDK_KP_Add
103 #define VK_SUBTRACT GDK_KP_Subtract
104 #define VK_DIVIDE GDK_KP_Divide
105 #endif
106
107 #if PLAT_WX
108 #define VK_DOWN WXK_DOWN
109 #define VK_UP WXK_UP
110 #define VK_LEFT WXK_LEFT
111 #define VK_RIGHT WXK_RIGHT
112 #define VK_HOME WXK_HOME
113 #define VK_END WXK_END
114 #define VK_PRIOR WXK_PRIOR
115 #define VK_NEXT WXK_NEXT
116 #define VK_DELETE WXK_DELETE
117 #define VK_INSERT WXK_INSERT
118 #define VK_ESCAPE WXK_ESCAPE
119 #define VK_BACK WXK_BACK
120 #define VK_TAB WXK_TAB
121 #define VK_RETURN WXK_RETURN
122 #define VK_ADD WXK_ADD
123 #define VK_SUBTRACT WXK_SUBTRACT
124 //TODO:
125 #define VK_DIVIDE WXK_DIVIDE
126 #endif
127
128 #define SHIFT_PRESSED 1
129 #define LEFT_CTRL_PRESSED 2
130 #define LEFT_ALT_PRESSED 4
131
132 // Are these needed any more
133 #define LPSTR char *
134 #define LONG long
135 #define LPDWORD (long *)
136
137 /* SELCHANGE structure */
138 #define SEL_EMPTY (0)
139 #define SEL_TEXT (1)
140 #define SEL_OBJECT (2)
141 #define SEL_MULTICHAR (4)
142 #define SEL_MULTIOBJECT (8)
143
144 struct RECT {
145 LONG left;
146 LONG top;
147 LONG right;
148 LONG bottom;
149 };
150
151 /* FINDREPLACE structure */
152
153 #define FR_MATCHCASE (0x4)
154 #define FR_WHOLEWORD (0x2)
155 #define FR_DOWN (0x1)
156
157 #endif
158
159 #if 0
160 struct CHARRANGE {
161 LONG cpMin;
162 LONG cpMax;
163 };
164
165 struct TEXTRANGE {
166 CHARRANGE chrg;
167 LPSTR lpstrText;
168 };
169
170 struct FINDTEXTEX {
171 CHARRANGE chrg;
172 LPSTR lpstrText;
173 CHARRANGE chrgText;
174 };
175
176 struct NMHDR {
177 WindowID hwndFrom;
178 UINT idFrom;
179 UINT code;
180 };
181
182 struct FORMATRANGE {
183 SurfaceID hdc;
184 SurfaceID hdcTarget;
185 RECT rc;
186 RECT rcPage;
187 CHARRANGE chrg;
188 };
189 #endif
190
191 //#define MAKELONG(a, b) ((a) | ((b) << 16))
192 //#define LOWORD(x) (x & 0xffff)
193 //#define HIWORD(x) (x >> 16)
194
195 #endif /* !_MSC_VER */
196
197 #endif