]> git.saurik.com Git - wxWidgets.git/blame - src/stc/scintilla/include/WinDefs.h
fixed client area origin handling in wxGTK
[wxWidgets.git] / src / stc / scintilla / include / WinDefs.h
CommitLineData
9ce192d4 1// Scintilla source code edit control
65ec6247
RD
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>
9ce192d4
RD
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
65ec6247
RD
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
9ce192d4
RD
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
d134f170 31//#if 0
9ce192d4
RD
32/* RTF control */
33#define EM_CANPASTE (1074)
34#define EM_CANUNDO (198)
35#define EM_CHARFROMPOS (215)
9ce192d4
RD
36#define EM_EMPTYUNDOBUFFER (205)
37#define EM_EXGETSEL (1076)
9ce192d4
RD
38#define EM_EXLINEFROMCHAR (1078)
39#define EM_EXSETSEL (1079)
40#define EM_FINDTEXT (1080)
41#define EM_FINDTEXTEX (1103)
9ce192d4 42#define EM_FORMATRANGE (1081)
9ce192d4 43#define EM_GETFIRSTVISIBLELINE (206)
9ce192d4
RD
44#define EM_GETLINE (196)
45#define EM_GETLINECOUNT (186)
46#define EM_GETMARGINS (212)
47#define EM_GETMODIFY (184)
9ce192d4
RD
48#define EM_GETRECT (178)
49#define EM_GETSEL (176)
50#define EM_GETSELTEXT (1086)
51#define EM_GETTEXTRANGE (1099)
9ce192d4 52#define EM_HIDESELECTION (1087)
9ce192d4
RD
53#define EM_LINEFROMCHAR (201)
54#define EM_LINEINDEX (187)
55#define EM_LINELENGTH (193)
56#define EM_LINESCROLL (182)
9ce192d4
RD
57#define EM_POSFROMCHAR (214)
58#define EM_REPLACESEL (194)
9ce192d4
RD
59#define EM_SCROLLCARET (183)
60#define EM_SELECTIONTYPE (1090)
9ce192d4 61#define EM_SETMARGINS (211)
9ce192d4 62#define EM_SETREADONLY (207)
9ce192d4 63#define EM_SETSEL (177)
9ce192d4
RD
64#define EM_UNDO (199)
65
66#define WM_NULL (0)
67#define WM_CLEAR (771)
9ce192d4
RD
68#define WM_COPY (769)
69#define WM_CUT (768)
70#define WM_GETTEXT (13)
71#define WM_GETTEXTLENGTH (14)
9ce192d4
RD
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
d134f170
RD
84//#endif
85
86#if 0
9ce192d4
RD
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
f6bcfd97 104#define VK_DIVIDE GDK_KP_Divide
9ce192d4
RD
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
f6bcfd97
BP
124//TODO:
125#define VK_DIVIDE WXK_DIVIDE
d134f170
RD
126#endif
127
128#define SHIFT_PRESSED 1
129#define LEFT_CTRL_PRESSED 2
130#define LEFT_ALT_PRESSED 4
9ce192d4
RD
131
132// Are these needed any more
133#define LPSTR char *
134#define LONG long
135#define LPDWORD (long *)
9ce192d4
RD
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
9ce192d4
RD
144struct RECT {
145 LONG left;
146 LONG top;
147 LONG right;
148 LONG bottom;
149};
150
d134f170
RD
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
9ce192d4
RD
160struct CHARRANGE {
161 LONG cpMin;
162 LONG cpMax;
163};
164
165struct TEXTRANGE {
166 CHARRANGE chrg;
167 LPSTR lpstrText;
168};
169
170struct FINDTEXTEX {
171 CHARRANGE chrg;
172 LPSTR lpstrText;
173 CHARRANGE chrgText;
174};
175
176struct NMHDR {
177 WindowID hwndFrom;
178 UINT idFrom;
179 UINT code;
180};
181
182struct FORMATRANGE {
183 SurfaceID hdc;
184 SurfaceID hdcTarget;
185 RECT rc;
186 RECT rcPage;
187 CHARRANGE chrg;
188};
d134f170 189#endif
9ce192d4 190
d134f170
RD
191//#define MAKELONG(a, b) ((a) | ((b) << 16))
192//#define LOWORD(x) (x & 0xffff)
193//#define HIWORD(x) (x >> 16)
9ce192d4 194
65ec6247
RD
195#endif /* !_MSC_VER */
196
9ce192d4 197#endif