Mercurial > dwindows
annotate dw.h @ 25:f9fd7238635c
Added EMX makefile.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 17 Aug 2001 11:50:44 +0000 |
parents | d9e87e8bcf1d |
children | f3bf96c2786d |
rev | line source |
---|---|
3 | 1 /* $Id$ */ |
2 | |
3 #ifndef _H_DW | |
4 #define _H_DW | |
5 | |
15
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
6 /* Dynamic Windows version numbers */ |
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
7 #define DW_MAJOR_VERSION 0 |
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
8 #define DW_MINOR_VERSION 5 |
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
9 #define DW_SUB_VERSION 0 |
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
10 |
3 | 11 #if defined(__OS2__) || defined(__WIN32__) || defined(WINNT) || defined(__EMX__) |
12 /* OS/2 or Windows */ | |
13 | |
14 /* Used internally */ | |
15 #define TYPEBOX 0 | |
16 #define TYPEITEM 1 | |
17 | |
18 #define SIZESTATIC 0 | |
19 #define SIZEEXPAND 1 | |
20 | |
21 #define SPLITBAR_WIDTH 3 | |
22 #define BUBBLE_HELP_MAX 256 | |
23 | |
24 #if defined(__OS2__) || defined(__EMX__) | |
25 #define INCL_DOS | |
26 #define INCL_WIN | |
27 #define INCL_GPI | |
28 | |
29 #include <os2.h> | |
30 | |
31 /* Lets make some platform independent defines :) */ | |
32 #define DW_DT_LEFT DT_LEFT | |
33 #define DW_DT_QUERYEXTENT DT_QUERYEXTENT | |
34 #define DW_DT_UNDERSCORE DT_UNDERSCORE | |
35 #define DW_DT_STRIKEOUT DT_STRIKEOUT | |
36 #define DW_DT_TEXTATTRS DT_TEXTATTRS | |
37 #define DW_DT_EXTERNALLEADING DT_EXTERNALLEADING | |
38 #define DW_DT_CENTER DT_CENTER | |
39 #define DW_DT_RIGHT DT_RIGHT | |
40 #define DW_DT_TOP DT_TOP | |
41 #define DW_DT_VCENTER DT_VCENTER | |
42 #define DW_DT_BOTTOM DT_BOTTOM | |
43 #define DW_DT_HALFTONE DT_HALFTONE | |
44 #define DW_DT_MNEMONIC DT_MNEMONIC | |
45 #define DW_DT_WORDBREAK DT_WORDBREAK | |
46 #define DW_DT_ERASERECT DT_ERASERECT | |
47 | |
48 #define DW_CLR_WHITE 16 | |
49 #define DW_CLR_BLACK 17 | |
50 #define DW_CLR_BLUE CLR_BLUE | |
51 #define DW_CLR_RED CLR_RED | |
52 #define DW_CLR_PINK CLR_PINK | |
53 #define DW_CLR_GREEN CLR_GREEN | |
54 #define DW_CLR_CYAN CLR_CYAN | |
55 #define DW_CLR_YELLOW CLR_YELLOW | |
56 #define DW_CLR_DARKGRAY CLR_DARKGRAY | |
57 #define DW_CLR_DARKBLUE CLR_DARKBLUE | |
58 #define DW_CLR_DARKRED CLR_DARKRED | |
59 #define DW_CLR_DARKPINK CLR_DARKPINK | |
60 #define DW_CLR_DARKGREEN CLR_DARKGREEN | |
61 #define DW_CLR_DARKCYAN CLR_DARKCYAN | |
62 #define DW_CLR_BROWN CLR_BROWN | |
63 #define DW_CLR_PALEGRAY CLR_PALEGRAY | |
64 | |
65 #define DW_FCF_TITLEBAR FCF_TITLEBAR | |
66 #define DW_FCF_SYSMENU FCF_SYSMENU | |
67 #define DW_FCF_MENU FCF_MENU | |
68 #define DW_FCF_SIZEBORDER FCF_SIZEBORDER | |
69 #define DW_FCF_MINBUTTON FCF_MINBUTTON | |
70 #define DW_FCF_MAXBUTTON FCF_MAXBUTTON | |
71 #define DW_FCF_MINMAX FCF_MINMAX | |
72 #define DW_FCF_VERTSCROLL FCF_VERTSCROLL | |
73 #define DW_FCF_HORZSCROLL FCF_HORZSCROLL | |
74 #define DW_FCF_DLGBORDER FCF_DLGBORDER | |
75 #define DW_FCF_BORDER FCF_BORDER | |
76 #define DW_FCF_SHELLPOSITION FCF_SHELLPOSITION | |
77 #define DW_FCF_TASKLIST FCF_TASKLIST | |
78 #define DW_FCF_NOBYTEALIGN FCF_NOBYTEALIGN | |
79 #define DW_FCF_NOMOVEWITHOWNER FCF_NOMOVEWITHOWNER | |
80 #define DW_FCF_SYSMODAL FCF_SYSMODAL | |
81 #define DW_FCF_HIDEBUTTON FCF_HIDEBUTTON | |
82 #define DW_FCF_HIDEMAX FCF_HIDEMAX | |
83 #define DW_FCF_AUTOICON FCF_AUTOICON | |
84 | |
85 #define DW_CFA_BITMAPORICON CFA_BITMAPORICON | |
86 #define DW_CFA_STRING CFA_STRING | |
87 #define DW_CFA_ULONG CFA_ULONG | |
88 #define DW_CFA_TIME CFA_TIME | |
89 #define DW_CFA_DATE CFA_DATE | |
90 #define DW_CFA_CENTER CFA_CENTER | |
91 #define DW_CFA_LEFT CFA_LEFT | |
92 #define DW_CFA_RIGHT CFA_RIGHT | |
93 #define DW_CFA_HORZSEPARATOR CFA_HORZSEPARATOR | |
94 #define DW_CFA_SEPARATOR CFA_SEPARATOR | |
95 | |
96 #define DW_CA_DETAILSVIEWTITLES CA_DETAILSVIEWTITLES | |
97 #define DW_CV_MINI CV_MINI | |
98 #define DW_CV_DETAIL CV_DETAIL | |
99 | |
100 #define DW_SLS_READONLY SLS_READONLY | |
101 #define DW_SLS_RIBBONSTRIP SLS_RIBBONSTRIP | |
102 | |
103 #define DW_CCS_SINGLESEL CCS_SINGLESEL | |
104 #define DW_CCS_EXTENDSEL CCS_EXTENDSEL | |
105 | |
106 #define DW_LS_MULTIPLESEL LS_MULTIPLESEL | |
107 | |
108 #define DW_LIT_NONE -1 | |
109 | |
110 #define DW_MLE_CASESENSITIVE MLFSEARCH_CASESENSITIVE | |
111 | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
112 #define DW_POINTER_ARROW SPTR_ARROW |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
113 #define DW_POINTER_CLOCK SPTR_WAIT |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
114 |
3 | 115 typedef struct _hpixmap { |
116 unsigned long width, height; | |
117 HDC hdc; | |
118 HPS hps; | |
119 HBITMAP hbm; | |
120 HWND handle; | |
121 } *HPIXMAP; | |
122 | |
123 typedef struct _hmenui { | |
124 HWND menu; | |
125 } *HMENUI; | |
126 | |
127 extern HAB dwhab; | |
128 extern HMQ dwhmq; | |
129 #endif | |
130 | |
131 #if defined(__WIN32__) || defined(WINNT) | |
132 #include <windows.h> | |
133 #include <commctrl.h> | |
134 | |
135 /* Cygwin doesn't seem to have these... */ | |
136 #if defined(__CYGWIN32__) | |
137 #define LVS_EX_GRIDLINES 0x00000001 | |
138 #define LVS_EX_FULLROWSELECT 0x00000020 | |
139 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54) | |
140 #define ListView_SetExtendedListViewStyle(hwndLV, dw) (DWORD)SendMessage((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw) | |
141 #endif | |
142 #ifndef UDM_SETPOS32 | |
143 #define UDM_SETPOS32 (WM_USER+113) | |
144 #endif | |
145 #ifndef UDM_GETPOS32 | |
146 #define UDM_GETPOS32 (WM_USER+114) | |
147 #endif | |
148 | |
149 /* Lets make some platform independent defines :) */ | |
150 #define DW_DT_LEFT SS_LEFT | |
151 #define DW_DT_QUERYEXTENT 0 | |
152 #define DW_DT_UNDERSCORE 0 | |
153 #define DW_DT_STRIKEOUT 0 | |
154 #define DW_DT_TEXTATTRS 0 | |
155 #define DW_DT_EXTERNALLEADING 0 | |
156 #define DW_DT_CENTER SS_CENTER | |
157 #define DW_DT_RIGHT SS_RIGHT | |
158 #define DW_DT_TOP 0 | |
159 #define DW_DT_VCENTER 0 | |
160 #define DW_DT_BOTTOM 0 | |
161 #define DW_DT_HALFTONE 0 | |
162 #define DW_DT_MNEMONIC 0 | |
163 #define DW_DT_WORDBREAK 0 | |
164 #define DW_DT_ERASERECT 0 | |
165 | |
166 /* These corespond to the entries in the color | |
167 * arrays in the Win32 dw.c, they are also the | |
168 * same as DOS ANSI colors. | |
169 */ | |
170 #define DW_CLR_BLACK 0 | |
171 #define DW_CLR_DARKRED 1 | |
172 #define DW_CLR_DARKGREEN 2 | |
173 #define DW_CLR_BROWN 3 | |
174 #define DW_CLR_DARKBLUE 4 | |
175 #define DW_CLR_DARKPINK 5 | |
176 #define DW_CLR_DARKCYAN 6 | |
177 #define DW_CLR_PALEGRAY 7 | |
178 #define DW_CLR_DARKGRAY 8 | |
179 #define DW_CLR_RED 9 | |
180 #define DW_CLR_GREEN 10 | |
181 #define DW_CLR_YELLOW 11 | |
182 #define DW_CLR_BLUE 12 | |
183 #define DW_CLR_PINK 13 | |
184 #define DW_CLR_CYAN 14 | |
185 #define DW_CLR_WHITE 15 | |
186 | |
187 #define DW_FCF_TITLEBAR WS_CAPTION | |
188 #define DW_FCF_SYSMENU WS_SYSMENU | |
189 #define DW_FCF_MENU 0 | |
190 #define DW_FCF_SIZEBORDER WS_THICKFRAME | |
191 #define DW_FCF_MINBUTTON WS_MINIMIZEBOX | |
192 #define DW_FCF_MAXBUTTON WS_MAXIMIZEBOX | |
193 #define DW_FCF_MINMAX (WS_MINIMIZEBOX|WS_MAXIMIZEBOX) | |
194 #define DW_FCF_VERTSCROLL WS_VSCROLL | |
195 #define DW_FCF_HORZSCROLL WS_HSCROLL | |
196 #define DW_FCF_DLGBORDER WS_DLGFRAME | |
197 #define DW_FCF_BORDER WS_BORDER | |
198 #define DW_FCF_SHELLPOSITION 0 | |
199 #define DW_FCF_TASKLIST WS_VSCROLL | |
200 #define DW_FCF_NOBYTEALIGN 0 | |
201 #define DW_FCF_NOMOVEWITHOWNER 0 | |
202 #define DW_FCF_SYSMODAL 0 | |
203 #define DW_FCF_HIDEBUTTON WS_MINIMIZEBOX | |
204 #define DW_FCF_HIDEMAX 0 | |
205 #define DW_FCF_AUTOICON 0 | |
206 | |
207 #define DW_CFA_BITMAPORICON 1 | |
208 #define DW_CFA_STRING 1 << 2 | |
209 #define DW_CFA_ULONG 1 << 3 | |
210 #define DW_CFA_TIME 1 << 4 | |
211 #define DW_CFA_DATE 1 << 5 | |
212 #define DW_CFA_CENTER 1 << 6 | |
213 #define DW_CFA_LEFT 1 << 7 | |
214 #define DW_CFA_RIGHT 1 << 8 | |
215 #define DW_CFA_HORZSEPARATOR 0 | |
216 #define DW_CFA_SEPARATOR 0 | |
217 | |
218 #define DW_CA_DETAILSVIEWTITLES 0 | |
219 #define DW_CV_MINI 0 | |
220 #define DW_CV_DETAIL 0 | |
221 | |
222 #define DW_SLS_READONLY 0 | |
223 #define DW_SLS_RIBBONSTRIP 0 | |
224 | |
225 #define DW_CCS_SINGLESEL 0 | |
226 #define DW_CCS_EXTENDSEL 0 | |
227 | |
228 #define DW_LS_MULTIPLESEL LBS_MULTIPLESEL | |
229 | |
230 #define DW_LIT_NONE -1 | |
231 | |
232 #define DW_MLE_CASESENSITIVE 1 | |
233 | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
234 #define DW_POINTER_ARROW 32512 |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
235 #define DW_POINTER_CLOCK 32514 |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
236 |
3 | 237 #define STATICCLASSNAME "STATIC" |
238 #define COMBOBOXCLASSNAME "COMBOBOX" | |
239 #define LISTBOXCLASSNAME "LISTBOX" | |
240 #define BUTTONCLASSNAME "BUTTON" | |
241 #define POPUPMENUCLASSNAME "POPUPMENU" | |
242 #define EDITCLASSNAME "EDIT" | |
243 #define FRAMECLASSNAME "FRAME" | |
244 | |
245 #define ClassName "dynamicwindows" | |
246 #define SplitbarClassName "dwsplitbar" | |
247 #define ObjectClassName "dwobjectclass" | |
248 #define DefaultFont NULL | |
249 | |
250 typedef struct _color { | |
251 int fore; | |
252 int back; | |
253 HWND buddy; | |
254 int user; | |
255 HBRUSH hbrush; | |
256 char fontname[128]; | |
257 WNDPROC pOldProc; | |
258 } ColorInfo; | |
259 | |
260 typedef struct _notebookpage { | |
261 ColorInfo cinfo; | |
262 TC_ITEM item; | |
263 HWND hwnd; | |
264 int realid; | |
265 } NotebookPage; | |
266 | |
267 typedef unsigned long HAB; | |
268 typedef HANDLE HMTX; | |
269 typedef HANDLE HEV; | |
270 | |
271 typedef struct _container { | |
272 ColorInfo cinfo; | |
273 ULONG *flags; | |
274 WNDPROC pOldProc; | |
275 } ContainerInfo; | |
276 | |
277 typedef struct _hpixmap { | |
278 unsigned long width, height; | |
279 HBITMAP hbm; | |
280 HDC hdc; | |
281 HWND handle; | |
282 void *bits; | |
283 } *HPIXMAP; | |
284 | |
285 typedef struct _hmenui { | |
286 HMENU menu; | |
287 HWND hwnd; | |
288 } *HMENUI; | |
289 | |
290 #endif | |
291 | |
292 typedef struct _item { | |
293 /* Item type - Box or Item */ | |
294 int type; | |
295 /* Handle to Frame or Window */ | |
296 HWND hwnd; | |
297 /* Width and Height of static size */ | |
298 int width, height, origwidth, origheight; | |
299 /* Size Type - Static or Expand */ | |
300 int hsize, vsize; | |
301 /* Padding */ | |
302 int pad; | |
303 /* Ratio of current item */ | |
304 float xratio, yratio; | |
305 } Item; | |
306 | |
307 typedef struct _box { | |
308 #if defined(__WIN32__) || defined(WINNT) | |
309 ColorInfo cinfo; | |
24
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
22
diff
changeset
|
310 #elif defined(__OS2__) || defined(__EMX__) |
3 | 311 PFNWP oldproc; |
312 #endif | |
313 /* Number of items in the box */ | |
314 int count; | |
315 /* Box type - horizontal or vertical */ | |
316 int type; | |
317 /* Padding */ | |
318 int pad, parentpad; | |
319 /* Groupbox */ | |
320 HWND grouphwnd; | |
321 /* Used as temporary storage in the calculation stage */ | |
322 int upx, upy, minheight, minwidth; | |
323 /* Ratio in this box */ | |
324 float xratio, yratio, parentxratio, parentyratio; | |
325 /* Used for calculating individual item ratios */ | |
7
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
326 int width, height; |
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
327 /* Any combinations of flags describing the box */ |
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
328 unsigned long flags; |
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
329 /* Array of item structures */ |
3 | 330 struct _item *items; |
331 } Box; | |
332 | |
333 typedef struct _bubblebutton { | |
334 #if defined(__WIN32__) || defined(WINNT) | |
335 ColorInfo cinfo; | |
336 #endif | |
337 unsigned long id; | |
338 char bubbletext[BUBBLE_HELP_MAX]; | |
339 #if defined(__OS2__) || defined(__EMX__) | |
340 PFNWP pOldProc; | |
341 #else | |
342 WNDPROC pOldProc; | |
343 #endif | |
344 } BubbleButton; | |
345 | |
346 void dw_box_pack_start_stub(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); | |
347 void dw_box_pack_end_stub(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); | |
348 #else | |
349 /* GTK */ | |
350 #include <gtk/gtk.h> | |
351 #include <gdk/gdkx.h> | |
352 #include <gdk/gdkprivate.h> | |
353 #include <pthread.h> | |
354 | |
355 /* Lets make some platform independent defines :) */ | |
356 #define DW_DT_LEFT 1 | |
357 #define DW_DT_UNDERSCORE (1 << 1) | |
358 #define DW_DT_STRIKEOUT (1 << 2) | |
359 #define DW_DT_CENTER (1 << 3) | |
360 #define DW_DT_RIGHT (1 << 4) | |
361 #define DW_DT_TOP (1 << 5) | |
362 #define DW_DT_VCENTER (1 << 6) | |
363 #define DW_DT_BOTTOM (1 << 7) | |
364 #define DW_DT_HALFTONE (1 << 8) | |
365 #define DW_DT_MNEMONIC (1 << 9) | |
366 #define DW_DT_WORDBREAK (1 << 10) | |
367 #define DW_DT_ERASERECT (1 << 11) | |
368 | |
369 #define DW_CLR_BLACK 0 | |
370 #define DW_CLR_DARKRED 1 | |
371 #define DW_CLR_DARKGREEN 2 | |
372 #define DW_CLR_BROWN 3 | |
373 #define DW_CLR_DARKBLUE 4 | |
374 #define DW_CLR_DARKPINK 5 | |
375 #define DW_CLR_DARKCYAN 6 | |
376 #define DW_CLR_PALEGRAY 7 | |
377 #define DW_CLR_DARKGRAY 8 | |
378 #define DW_CLR_RED 9 | |
379 #define DW_CLR_GREEN 10 | |
380 #define DW_CLR_YELLOW 11 | |
381 #define DW_CLR_BLUE 12 | |
382 #define DW_CLR_PINK 13 | |
383 #define DW_CLR_CYAN 14 | |
384 #define DW_CLR_WHITE 15 | |
385 | |
386 #define DW_FCF_TITLEBAR 1 | |
387 #define DW_FCF_SYSMENU (1 << 1) | |
388 #define DW_FCF_MENU (1 << 2) | |
389 #define DW_FCF_SIZEBORDER (1 << 3) | |
390 #define DW_FCF_MINBUTTON (1 << 4) | |
391 #define DW_FCF_MAXBUTTON (1 << 5) | |
392 #define DW_FCF_MINMAX (1 << 6) | |
393 #define DW_FCF_VERTSCROLL (1 << 7) | |
394 #define DW_FCF_HORZSCROLL (1 << 8) | |
395 #define DW_FCF_DLGBORDER (1 << 9) | |
396 #define DW_FCF_BORDER (1 << 10) | |
397 #define DW_FCF_SHELLPOSITION (1 << 11) | |
398 #define DW_FCF_TASKLIST (1 << 12) | |
399 #define DW_FCF_NOBYTEALIGN (1 << 13) | |
400 #define DW_FCF_NOMOVEWITHOWNER (1 << 14) | |
401 #define DW_FCF_SYSMODAL (1 << 15) | |
402 #define DW_FCF_HIDEBUTTON (1 << 16) | |
403 #define DW_FCF_HIDEMAX (1 << 17) | |
404 #define DW_FCF_AUTOICON (1 << 18) | |
405 | |
406 #define DW_CFA_BITMAPORICON 1 | |
407 #define DW_CFA_STRING (1 << 1) | |
408 #define DW_CFA_ULONG (1 << 2) | |
409 #define DW_CFA_TIME (1 << 3) | |
410 #define DW_CFA_DATE (1 << 4) | |
411 #define DW_CFA_CENTER (1 << 5) | |
412 #define DW_CFA_LEFT (1 << 6) | |
413 #define DW_CFA_RIGHT (1 << 7) | |
414 #define DW_CFA_HORZSEPARATOR (1 << 8) | |
415 #define DW_CFA_SEPARATOR (1 << 9) | |
416 | |
417 #define DW_CA_DETAILSVIEWTITLES 1 | |
418 #define DW_CV_MINI (1 << 1) | |
419 #define DW_CV_DETAIL (1 << 2) | |
420 | |
421 #define DW_SLS_READONLY 1 | |
422 #define DW_SLS_RIBBONSTRIP (1 << 1) | |
423 | |
424 #define DW_CCS_SINGLESEL 1 | |
425 #define DW_CCS_EXTENDSEL (1 << 1) | |
426 | |
427 #define DW_LS_MULTIPLESEL 1 | |
428 | |
429 #define DW_LIT_NONE -1 | |
430 | |
431 #define DW_MLE_CASESENSITIVE 1 | |
432 | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
433 #define DW_POINTER_ARROW GDK_ARROW |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
434 #define DW_POINTER_CLOCK GDK_CLOCK |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
435 |
3 | 436 #define DW_DESKTOP ((HWND)0) |
437 #define HWND_DESKTOP ((HWND)0) | |
438 | |
439 typedef GtkWidget *HWND; | |
440 typedef void *HAB; | |
441 typedef unsigned long ULONG; | |
442 typedef unsigned char UCHAR; | |
443 typedef long LONG; | |
444 typedef unsigned short USHORT; | |
445 typedef short SHORT; | |
446 typedef pthread_mutex_t HMTX; | |
447 typedef struct _dw_unix_event { | |
448 pthread_mutex_t mutex; | |
449 pthread_cond_t event; | |
450 pthread_t thread; | |
451 int alive; | |
452 int posted; | |
453 } *HEV; | |
454 typedef pthread_t DWTID; | |
455 | |
456 typedef struct _hpixmap { | |
457 unsigned long width, height; | |
458 GdkPixmap *pixmap; | |
459 HWND handle; | |
460 } *HPIXMAP; | |
461 | |
462 typedef struct _hmenui { | |
463 GtkWidget *menu; | |
464 } *HMENUI; | |
465 | |
466 typedef struct _resource_struct { | |
467 long resource_max, *resource_id; | |
468 char **resource_data; | |
469 } DWResources; | |
470 | |
471 #if !defined(DW_RESOURCES) || defined(BUILD_DLL) | |
472 static DWResources _resources = { 0, 0, 0 }; | |
473 #else | |
474 extern DWResources _resources; | |
475 #endif | |
476 | |
477 #endif | |
478 | |
479 #if !defined(__OS2__) && !defined(__EMX__) | |
480 typedef struct _CDATE | |
481 { | |
482 UCHAR day; | |
483 UCHAR month; | |
484 USHORT year; | |
485 } CDATE; | |
486 typedef CDATE *PCDATE; | |
487 | |
488 typedef struct _CTIME | |
489 { | |
490 UCHAR hours; | |
491 UCHAR minutes; | |
492 UCHAR seconds; | |
493 UCHAR ucReserved; | |
494 } CTIME; | |
495 typedef CTIME *PCTIME; | |
496 #endif | |
497 | |
498 #if defined(__OS2__) || defined(__WIN32__) || defined(WINNT) || defined(__EMX__) | |
499 typedef unsigned long DWTID; | |
500 #endif | |
501 | |
502 typedef struct _dwenv { | |
15
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
503 /* Operating System Name and DW Build Date/Time */ |
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
504 char osName[30], buildDate[30], buildTime[30]; |
3 | 505 /* Versions and builds */ |
506 short MajorVersion, MinorVersion, MajorBuild, MinorBuild; | |
15
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
507 /* Dynamic Window version */ |
81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
14
diff
changeset
|
508 short DWMajorVersion, DWMinorVersion, DWSubVersion; |
3 | 509 } DWEnv; |
510 | |
511 | |
512 typedef struct _dwexpose { | |
513 int x, y; | |
514 int width, height; | |
515 } DWExpose; | |
516 | |
517 typedef struct _dwdialog { | |
518 HEV eve; | |
519 int done; | |
520 void *data, *result; | |
521 } DWDialog; | |
522 | |
523 #define DW_SIGNAL_FUNC(a) ((void *)a) | |
524 | |
7
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
525 #define DW_MINIMIZED 1 |
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
526 |
3 | 527 #define DW_BUTTON1_MASK 1 |
528 #define DW_BUTTON2_MASK (1 << 1) | |
529 #define DW_BUTTON3_MASK (1 << 2) | |
530 | |
531 #define DW_EXEC_CON 0 | |
532 #define DW_EXEC_GUI 1 | |
533 | |
534 #define DW_FILE_OPEN 0 | |
535 #define DW_FILE_SAVE 1 | |
536 | |
537 #define BOXHORZ 0 | |
538 #define BOXVERT 1 | |
539 | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
540 #define DW_SCROLL_UP 0 |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
541 #define DW_SCROLL_DOWN 1 |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
542 #define DW_SCROLL_TOP 2 |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
543 #define DW_SCROLL_BOTTOM 3 |
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
544 |
3 | 545 #define DW_PIXMAP_WIDTH(x) (x ? x->width : 0) |
546 #define DW_PIXMAP_HEIGHT(x) (x ? x->height : 0) | |
547 | |
548 #define DW_RGB_COLOR (0xFF000000) | |
549 #define DW_RGB_MASK (0x00FFFFFF) | |
550 #define DW_RED_MASK (0x000000FF) | |
551 #define DW_GREEN_MASK (0x0000FF00) | |
552 #define DW_BLUE_MASK (0x00FF0000) | |
553 #define DW_RED_VALUE(a) (a & DW_RED_MASK) | |
554 #define DW_GREEN_VALUE(a) ((a & DW_GREEN_MASK) >> 8) | |
555 #define DW_BLUE_VALUE(a) ((a & DW_BLUE_MASK) >> 16) | |
556 #define DW_RGB(a, b, c) (0xFF000000 | a | b << 8 | c << 16) | |
557 | |
24
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
22
diff
changeset
|
558 #if defined(__OS2__) || defined(__EMX__) |
3 | 559 #define DW_OS2_RGB(a) ((DW_RED_VALUE(a) << 16) | (DW_GREEN_VALUE(a) << 8) | DW_BLUE_VALUE(a)) |
560 #endif | |
561 | |
562 /* Public function prototypes */ | |
563 void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); | |
564 void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); | |
24
d9e87e8bcf1d
Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
22
diff
changeset
|
565 #if !defined(__OS2__) && !defined(__WIN32__) && !defined(__EMX__) |
14
176cee043f1b
Lots of Windows and Unix bug fixes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
13
diff
changeset
|
566 int dw_int_init(DWResources *res, int newthread, int argc, char *argv[]); |
176cee043f1b
Lots of Windows and Unix bug fixes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
13
diff
changeset
|
567 #define dw_init(a, b, c) dw_int_init(&_resources, a, b, c) |
3 | 568 #else |
14
176cee043f1b
Lots of Windows and Unix bug fixes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
13
diff
changeset
|
569 int dw_init(int newthread, int argc, char *argv[]); |
3 | 570 #endif |
571 void dw_main(HAB currenthab, void *filterfunc); | |
572 void dw_free(void *ptr); | |
573 int dw_window_show(HWND handle); | |
574 int dw_window_hide(HWND handle); | |
14
176cee043f1b
Lots of Windows and Unix bug fixes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
13
diff
changeset
|
575 int dw_window_minimize(HWND handle); |
3 | 576 int dw_window_destroy(HWND handle); |
577 int dw_window_set_font(HWND handle, char *fontname); | |
578 int dw_window_set_color(HWND handle, unsigned long fore, unsigned long back); | |
579 HWND dw_window_new(HWND hwndOwner, char *title, unsigned long flStyle); | |
580 HWND dw_box_new(int type, int pad); | |
581 HWND dw_groupbox_new(int type, int pad, char *title); | |
14
176cee043f1b
Lots of Windows and Unix bug fixes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
13
diff
changeset
|
582 HWND dw_mdi_new(unsigned long id); |
3 | 583 HWND dw_bitmap_new(unsigned long id); |
584 HWND dw_bitmapbutton_new(char *text, unsigned long id); | |
585 HWND dw_container_new(unsigned long id); | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
586 HWND dw_tree_new(unsigned long id); |
3 | 587 HWND dw_text_new(char *text, unsigned long id); |
7
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
588 HWND dw_status_text_new(char *text, unsigned long id); |
3 | 589 HWND dw_mle_new(unsigned long id); |
590 HWND dw_entryfield_new(char *text, unsigned long id); | |
591 HWND dw_entryfield_password_new(char *text, ULONG id); | |
592 HWND dw_combobox_new(char *text, unsigned long id); | |
593 HWND dw_button_new(char *text, unsigned long id); | |
594 HWND dw_spinbutton_new(char *text, unsigned long id); | |
595 HWND dw_radiobutton_new(char *text, ULONG id); | |
596 HWND dw_slider_new(unsigned long id); | |
597 HWND dw_checkbox_new(char *text, unsigned long id); | |
598 HWND dw_listbox_new(unsigned long id, int multi); | |
599 void dw_listbox_append(HWND handle, char *text); | |
600 void dw_listbox_clear(HWND handle); | |
601 int dw_listbox_count(HWND handle); | |
602 void dw_listbox_set_top(HWND handle, int top); | |
603 void dw_listbox_select(HWND handle, int index, int state); | |
604 void dw_listbox_delete(HWND handle, int index); | |
605 void dw_listbox_query_text(HWND handle, unsigned int index, char *buffer, unsigned int length); | |
606 void dw_listbox_set_text(HWND handle, unsigned int index, char *buffer); | |
607 unsigned int dw_listbox_selected(HWND handle); | |
608 int dw_listbox_selected_multi(HWND handle, int where); | |
609 unsigned int dw_slider_query_range(HWND handle); | |
610 void dw_slider_set_pos(HWND handle, unsigned int position); | |
611 void dw_window_set_pos(HWND handle, unsigned long x, unsigned long y); | |
612 void dw_window_set_usize(HWND handle, unsigned long width, unsigned long height); | |
613 void dw_window_set_pos_size(HWND handle, unsigned long x, unsigned long y, unsigned long width, unsigned long height); | |
614 void dw_window_get_pos_size(HWND handle, unsigned long *x, unsigned long *y, unsigned long *width, unsigned long *height); | |
615 void dw_window_set_style(HWND handle, unsigned long style, unsigned long mask); | |
616 void dw_window_set_icon(HWND handle, unsigned long id); | |
617 void dw_window_set_bitmap(HWND handle, unsigned long id); | |
618 char *dw_window_get_text(HWND handle); | |
619 void dw_window_set_text(HWND handle, char *text); | |
620 int dw_window_set_border(HWND handle, int border); | |
621 void dw_window_disable(HWND handle); | |
622 void dw_window_enable(HWND handle); | |
623 void dw_window_capture(HWND handle); | |
624 void dw_window_release(void); | |
625 void dw_window_reparent(HWND handle, HWND newparent); | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
626 void dw_window_pointer(HWND handle, int pointertype); |
3 | 627 unsigned int dw_mle_import(HWND handle, char *buffer, int startpoint); |
628 void dw_mle_export(HWND handle, char *buffer, int startpoint, int length); | |
629 void dw_mle_query(HWND handle, unsigned long *bytes, unsigned long *lines); | |
630 void dw_mle_delete(HWND handle, int startpoint, int length); | |
631 void dw_mle_clear(HWND handle); | |
632 void dw_mle_freeze(HWND handle); | |
633 void dw_mle_thaw(HWND handle); | |
634 void dw_mle_set(HWND handle, int point); | |
635 void dw_mle_set_visible(HWND handle, int line); | |
7
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
636 void dw_mle_set_editable(HWND handle, int state); |
005fa766e8c2
Updates to latest build.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
3
diff
changeset
|
637 void dw_mle_set_word_wrap(HWND handle, int state); |
3 | 638 int dw_mle_search(HWND handle, char *text, int point, unsigned long flags); |
639 void dw_spinbutton_set_pos(HWND handle, long position); | |
640 void dw_spinbutton_set_limits(HWND handle, long upper, long lower); | |
641 void dw_entryfield_set_limit(HWND handle, ULONG limit); | |
642 long dw_spinbutton_query(HWND handle); | |
643 int dw_checkbox_query(HWND handle); | |
644 void dw_checkbox_set(HWND handle, int value); | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
645 HWND dw_tree_insert(HWND handle, char *title, unsigned long icon, HWND parent); |
3 | 646 int dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator); |
647 unsigned long dw_icon_load(unsigned long module, unsigned long id); | |
648 void dw_icon_free(unsigned long handle); | |
649 void *dw_container_alloc(HWND handle, int rowcount); | |
650 void dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data); | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
651 void dw_container_set_column_width(HWND handle, int column, int width); |
3 | 652 void dw_container_set_row_title(void *pointer, int row, char *title); |
653 void dw_container_insert(HWND handle, void *pointer, int rowcount); | |
654 void dw_container_clear(HWND handle); | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
655 void dw_container_delete(HWND handle, int rowcount); |
3 | 656 void dw_container_set_view(HWND handle, unsigned long flags, int iconwidth, int iconheight); |
657 char *dw_container_query_start(HWND handle, unsigned long flags); | |
658 char *dw_container_query_next(HWND handle, unsigned long flags); | |
22
6a246b3bb14f
Added tree widgets, fixed some delete event processing, fixed a layout bug
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
15
diff
changeset
|
659 void dw_container_scroll(HWND handle, int direction, long rows); |
3 | 660 int dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count); |
661 void dw_filesystem_set_item(HWND handle, void *pointer, int column, int row, void *data); | |
662 void dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon); | |
663 int dw_screen_width(void); | |
664 int dw_screen_height(void); | |
665 unsigned long dw_color_depth(void); | |
666 HWND dw_notebook_new(unsigned long id, int top); | |
667 unsigned long dw_notebook_page_new(HWND handle, unsigned long flags, int front); | |
668 void dw_notebook_page_destroy(HWND handle, unsigned int pageid); | |
669 void dw_notebook_page_set_text(HWND handle, unsigned long pageid, char *text); | |
670 void dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, char *text); | |
671 void dw_notebook_page_set(HWND handle, unsigned int pageid); | |
672 unsigned int dw_notebook_page_query(HWND handle); | |
673 void dw_notebook_pack(HWND handle, unsigned long pageid, HWND page); | |
674 void dw_box_pack_splitbar_start(HWND box); | |
675 void dw_box_pack_splitbar_end(HWND box); | |
676 HMENUI dw_menu_new(unsigned long id); | |
677 HMENUI dw_menubar_new(HWND location); | |
678 HWND dw_menu_append_item(HMENUI menu, char *title, unsigned long id, unsigned long flags, int end, int check, HMENUI submenu); | |
13
156281539fb3
Fixed misdeclaration in dw_menu_item_set_check(), id was int should be
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
7
diff
changeset
|
679 void dw_menu_item_set_check(HMENUI menu, unsigned long id, int check); |
3 | 680 void dw_menu_popup(HMENUI *menu, HWND parent, int x, int y); |
681 void dw_menu_destroy(HMENUI *menu); | |
682 void dw_pointer_query_pos(long *x, long *y); | |
683 void dw_pointer_set_pos(long x, long y); | |
684 void dw_window_function(HWND handle, void *function, void *data); | |
685 HWND dw_window_from_id(HWND handle, int id); | |
686 HMTX dw_mutex_new(void); | |
687 void dw_mutex_close(HMTX mutex); | |
688 void dw_mutex_lock(HMTX mutex); | |
689 void dw_mutex_unlock(HMTX mutex); | |
690 HEV dw_event_new(void); | |
691 int dw_event_reset(HEV eve); | |
692 int dw_event_post(HEV eve); | |
693 int dw_event_wait(HEV eve, unsigned long timeout); | |
694 int dw_event_close (HEV *eve); | |
695 DWTID dw_thread_new(void *func, void *data, int stack); | |
696 void dw_thread_end(void); | |
697 DWTID dw_thread_id(void); | |
698 void dw_exit(int exitcode); | |
699 HWND dw_render_new(unsigned long id); | |
700 void dw_color_foreground_set(unsigned long value); | |
701 void dw_color_background_set(unsigned long value); | |
702 void dw_draw_point(HWND handle, HPIXMAP pixmap, int x, int y); | |
703 void dw_draw_line(HWND handle, HPIXMAP pixmap, int x1, int y1, int x2, int y2); | |
704 void dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height); | |
705 void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text); | |
706 void dw_flush(void); | |
707 void dw_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc); | |
708 HPIXMAP dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth); | |
709 HPIXMAP dw_pixmap_grab(HWND handle, ULONG id); | |
710 void dw_pixmap_destroy(HPIXMAP pixmap); | |
711 void dw_beep(int freq, int dur); | |
712 int dw_messagebox(char *title, char *format, ...); | |
713 int dw_yesno(char *title, char *text); | |
714 void dw_environment_query(DWEnv *env); | |
715 int dw_exec(char *program, int type, char **params); | |
716 int dw_browse(char *url); | |
717 char *dw_file_browse(char *title, char *defpath, char *ext, int flags); | |
718 char *dw_user_dir(void); | |
719 DWDialog *dw_dialog_new(void *data); | |
720 int dw_dialog_dismiss(DWDialog *dialog, void *result); | |
721 void *dw_dialog_wait(DWDialog *dialog); | |
722 #ifndef NO_SIGNALS | |
723 void dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data); | |
724 void dw_signal_disconnect_by_window(HWND window); | |
725 void dw_signal_disconnect_by_data(HWND window, void *data); | |
726 void dw_signal_disconnect_by_name(HWND window, char *signame); | |
727 #endif | |
728 | |
729 #endif |