comparison dw.h @ 224:e6571c4e4d3b

Use the same DW_CLR_* values on all platforms including OS/2... so I added a lookup table to convert.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 05 Feb 2003 03:50:47 +0000
parents 098ed34d41fb
children 5592cdeb29cf
comparison
equal deleted inserted replaced
223:2581c8b2754f 224:e6571c4e4d3b
5 5
6 /* Dynamic Windows version numbers */ 6 /* Dynamic Windows version numbers */
7 #define DW_MAJOR_VERSION 1 7 #define DW_MAJOR_VERSION 1
8 #define DW_MINOR_VERSION 0 8 #define DW_MINOR_VERSION 0
9 #define DW_SUB_VERSION 0 9 #define DW_SUB_VERSION 0
10
11 #if defined(__OS2__) || defined(__WIN32__) || defined(WINNT) || defined(__EMX__)
12 /* OS/2 or Windows */
13
14 #if defined(__IBMC__) && !defined(API)
15 #define API _System
16 #endif
17
18 /* Used internally */
19 #define TYPEBOX 0
20 #define TYPEITEM 1
21
22 #define SIZESTATIC 0
23 #define SIZEEXPAND 1
24
25 #define SPLITBAR_WIDTH 4
26 #define BUBBLE_HELP_MAX 256
27
28 typedef struct _user_data
29 {
30 struct _user_data *next;
31 void *data;
32 char *varname;
33 } UserData;
34
35 #if defined(__OS2__) || defined(__EMX__)
36 #define INCL_DOS
37 #define INCL_WIN
38 #define INCL_GPI
39
40 #include <os2.h>
41
42 /* Lets make some platform independent defines :) */
43 #define DW_DT_LEFT DT_LEFT
44 #define DW_DT_QUERYEXTENT DT_QUERYEXTENT
45 #define DW_DT_UNDERSCORE DT_UNDERSCORE
46 #define DW_DT_STRIKEOUT DT_STRIKEOUT
47 #define DW_DT_TEXTATTRS DT_TEXTATTRS
48 #define DW_DT_EXTERNALLEADING DT_EXTERNALLEADING
49 #define DW_DT_CENTER DT_CENTER
50 #define DW_DT_RIGHT DT_RIGHT
51 #define DW_DT_TOP DT_TOP
52 #define DW_DT_VCENTER DT_VCENTER
53 #define DW_DT_BOTTOM DT_BOTTOM
54 #define DW_DT_HALFTONE DT_HALFTONE
55 #define DW_DT_MNEMONIC DT_MNEMONIC
56 #define DW_DT_WORDBREAK DT_WORDBREAK
57 #define DW_DT_ERASERECT DT_ERASERECT
58
59 #define DW_CLR_WHITE 16
60 #define DW_CLR_BLACK 17
61 #define DW_CLR_DEFAULT 18
62 #define DW_CLR_BLUE CLR_BLUE
63 #define DW_CLR_RED CLR_RED
64 #define DW_CLR_PINK CLR_PINK
65 #define DW_CLR_GREEN CLR_GREEN
66 #define DW_CLR_CYAN CLR_CYAN
67 #define DW_CLR_YELLOW CLR_YELLOW
68 #define DW_CLR_DARKGRAY CLR_DARKGRAY
69 #define DW_CLR_DARKBLUE CLR_DARKBLUE
70 #define DW_CLR_DARKRED CLR_DARKRED
71 #define DW_CLR_DARKPINK CLR_DARKPINK
72 #define DW_CLR_DARKGREEN CLR_DARKGREEN
73 #define DW_CLR_DARKCYAN CLR_DARKCYAN
74 #define DW_CLR_BROWN CLR_BROWN
75 #define DW_CLR_PALEGRAY CLR_PALEGRAY
76
77 #ifndef FCF_CLOSEBUTTON
78 #define FCF_CLOSEBUTTON 0x04000000L
79 #endif
80
81 #define DW_FCF_TITLEBAR FCF_TITLEBAR
82 #define DW_FCF_SYSMENU (FCF_SYSMENU | FCF_CLOSEBUTTON)
83 #define DW_FCF_MENU FCF_MENU
84 #define DW_FCF_SIZEBORDER FCF_SIZEBORDER
85 #define DW_FCF_MINBUTTON FCF_MINBUTTON
86 #define DW_FCF_MAXBUTTON FCF_MAXBUTTON
87 #define DW_FCF_MINMAX FCF_MINMAX
88 #define DW_FCF_VERTSCROLL FCF_VERTSCROLL
89 #define DW_FCF_HORZSCROLL FCF_HORZSCROLL
90 #define DW_FCF_DLGBORDER FCF_DLGBORDER
91 #define DW_FCF_BORDER FCF_BORDER
92 #define DW_FCF_SHELLPOSITION FCF_SHELLPOSITION
93 #define DW_FCF_TASKLIST FCF_TASKLIST
94 #define DW_FCF_NOBYTEALIGN FCF_NOBYTEALIGN
95 #define DW_FCF_NOMOVEWITHOWNER FCF_NOMOVEWITHOWNER
96 #define DW_FCF_SYSMODAL FCF_SYSMODAL
97 #define DW_FCF_HIDEBUTTON FCF_HIDEBUTTON
98 #define DW_FCF_HIDEMAX FCF_HIDEMAX
99 #define DW_FCF_AUTOICON FCF_AUTOICON
100
101 #define DW_CFA_BITMAPORICON CFA_BITMAPORICON
102 #define DW_CFA_STRING CFA_STRING
103 #define DW_CFA_ULONG CFA_ULONG
104 #define DW_CFA_TIME CFA_TIME
105 #define DW_CFA_DATE CFA_DATE
106 #define DW_CFA_CENTER CFA_CENTER
107 #define DW_CFA_LEFT CFA_LEFT
108 #define DW_CFA_RIGHT CFA_RIGHT
109 #define DW_CFA_HORZSEPARATOR CFA_HORZSEPARATOR
110 #define DW_CFA_SEPARATOR CFA_SEPARATOR
111
112 #define DW_CA_DETAILSVIEWTITLES CA_DETAILSVIEWTITLES
113 #define DW_CV_MINI CV_MINI
114 #define DW_CV_DETAIL CV_DETAIL
115
116 #define DW_CRA_SELECTED CRA_SELECTED
117 #define DW_CRA_CURSORED CRA_CURSORED
118
119 #define DW_SLS_READONLY SLS_READONLY
120 #define DW_SLS_RIBBONSTRIP SLS_RIBBONSTRIP
121
122 #define DW_CCS_SINGLESEL CCS_SINGLESEL
123 #define DW_CCS_EXTENDSEL CCS_EXTENDSEL
124
125 #define DW_LS_MULTIPLESEL LS_MULTIPLESEL
126
127 #define DW_LIT_NONE -1
128
129 #define DW_MLE_CASESENSITIVE MLFSEARCH_CASESENSITIVE
130
131 #define DW_POINTER_ARROW SPTR_ARROW
132 #define DW_POINTER_CLOCK SPTR_WAIT
133
134 #define DW_OS2_NEW_WINDOW 1
135
136 typedef struct _window_data {
137 PFNWP oldproc;
138 UserData *root;
139 HWND clickdefault;
140 ULONG flags;
141 void *data;
142 } WindowData;
143
144 typedef struct _hpixmap {
145 unsigned long width, height;
146 HDC hdc;
147 HPS hps;
148 HBITMAP hbm;
149 HWND handle;
150 } *HPIXMAP;
151
152 typedef HWND HMENUI;
153 typedef HMODULE HMOD;
154
155 #define DW_NOMENU NULLHANDLE
156
157 extern HAB dwhab;
158 extern HMQ dwhmq;
159 #endif
160
161 #if defined(__WIN32__) || defined(WINNT)
162 #include <windows.h>
163 #include <commctrl.h>
164
165 /* Cygwin doesn't seem to have these... */
166 #if defined(__CYGWIN32__)
167 #define LVS_EX_GRIDLINES 0x00000001
168 #define LVS_EX_FULLROWSELECT 0x00000020
169 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
170 #define ListView_SetExtendedListViewStyle(hwndLV, dw) (DWORD)SendMessage((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw)
171 #endif
172 #ifndef UDM_SETPOS32
173 #define UDM_SETPOS32 (WM_USER+113)
174 #endif
175 #ifndef UDM_GETPOS32
176 #define UDM_GETPOS32 (WM_USER+114)
177 #endif
178
179 #if defined(MSVC) && !defined(API)
180 #define API _cdecl
181 #endif
182
183 /* Lets make some platform independent defines :) */
184 #define DW_DT_LEFT SS_LEFT
185 #define DW_DT_QUERYEXTENT 0
186 #define DW_DT_UNDERSCORE 0
187 #define DW_DT_STRIKEOUT 0
188 #define DW_DT_TEXTATTRS 0
189 #define DW_DT_EXTERNALLEADING 0
190 #define DW_DT_CENTER SS_CENTER
191 #define DW_DT_RIGHT SS_RIGHT
192 #define DW_DT_TOP 0
193 #define DW_DT_VCENTER SS_NOPREFIX
194 #define DW_DT_BOTTOM 0
195 #define DW_DT_HALFTONE 0
196 #define DW_DT_MNEMONIC 0
197 #define DW_DT_WORDBREAK 0
198 #define DW_DT_ERASERECT 0
199 10
200 /* These corespond to the entries in the color 11 /* These corespond to the entries in the color
201 * arrays in the Win32 dw.c, they are also the 12 * arrays in the Win32 dw.c, they are also the
202 * same as DOS ANSI colors. 13 * same as DOS ANSI colors.
203 */ 14 */
217 #define DW_CLR_PINK 13 28 #define DW_CLR_PINK 13
218 #define DW_CLR_CYAN 14 29 #define DW_CLR_CYAN 14
219 #define DW_CLR_WHITE 15 30 #define DW_CLR_WHITE 15
220 #define DW_CLR_DEFAULT 16 31 #define DW_CLR_DEFAULT 16
221 32
33 #if defined(__OS2__) || defined(__WIN32__) || defined(WINNT) || defined(__EMX__)
34 /* OS/2 or Windows */
35
36 #if defined(__IBMC__) && !defined(API)
37 #define API _System
38 #endif
39
40 /* Used internally */
41 #define TYPEBOX 0
42 #define TYPEITEM 1
43
44 #define SIZESTATIC 0
45 #define SIZEEXPAND 1
46
47 #define SPLITBAR_WIDTH 4
48 #define BUBBLE_HELP_MAX 256
49
50 typedef struct _user_data
51 {
52 struct _user_data *next;
53 void *data;
54 char *varname;
55 } UserData;
56
57 #if defined(__OS2__) || defined(__EMX__)
58 #define INCL_DOS
59 #define INCL_WIN
60 #define INCL_GPI
61
62 #include <os2.h>
63
64 /* Lets make some platform independent defines :) */
65 #define DW_DT_LEFT DT_LEFT
66 #define DW_DT_QUERYEXTENT DT_QUERYEXTENT
67 #define DW_DT_UNDERSCORE DT_UNDERSCORE
68 #define DW_DT_STRIKEOUT DT_STRIKEOUT
69 #define DW_DT_TEXTATTRS DT_TEXTATTRS
70 #define DW_DT_EXTERNALLEADING DT_EXTERNALLEADING
71 #define DW_DT_CENTER DT_CENTER
72 #define DW_DT_RIGHT DT_RIGHT
73 #define DW_DT_TOP DT_TOP
74 #define DW_DT_VCENTER DT_VCENTER
75 #define DW_DT_BOTTOM DT_BOTTOM
76 #define DW_DT_HALFTONE DT_HALFTONE
77 #define DW_DT_MNEMONIC DT_MNEMONIC
78 #define DW_DT_WORDBREAK DT_WORDBREAK
79 #define DW_DT_ERASERECT DT_ERASERECT
80
81 #ifndef FCF_CLOSEBUTTON
82 #define FCF_CLOSEBUTTON 0x04000000L
83 #endif
84
85 #define DW_FCF_TITLEBAR FCF_TITLEBAR
86 #define DW_FCF_SYSMENU (FCF_SYSMENU | FCF_CLOSEBUTTON)
87 #define DW_FCF_MENU FCF_MENU
88 #define DW_FCF_SIZEBORDER FCF_SIZEBORDER
89 #define DW_FCF_MINBUTTON FCF_MINBUTTON
90 #define DW_FCF_MAXBUTTON FCF_MAXBUTTON
91 #define DW_FCF_MINMAX FCF_MINMAX
92 #define DW_FCF_VERTSCROLL FCF_VERTSCROLL
93 #define DW_FCF_HORZSCROLL FCF_HORZSCROLL
94 #define DW_FCF_DLGBORDER FCF_DLGBORDER
95 #define DW_FCF_BORDER FCF_BORDER
96 #define DW_FCF_SHELLPOSITION FCF_SHELLPOSITION
97 #define DW_FCF_TASKLIST FCF_TASKLIST
98 #define DW_FCF_NOBYTEALIGN FCF_NOBYTEALIGN
99 #define DW_FCF_NOMOVEWITHOWNER FCF_NOMOVEWITHOWNER
100 #define DW_FCF_SYSMODAL FCF_SYSMODAL
101 #define DW_FCF_HIDEBUTTON FCF_HIDEBUTTON
102 #define DW_FCF_HIDEMAX FCF_HIDEMAX
103 #define DW_FCF_AUTOICON FCF_AUTOICON
104
105 #define DW_CFA_BITMAPORICON CFA_BITMAPORICON
106 #define DW_CFA_STRING CFA_STRING
107 #define DW_CFA_ULONG CFA_ULONG
108 #define DW_CFA_TIME CFA_TIME
109 #define DW_CFA_DATE CFA_DATE
110 #define DW_CFA_CENTER CFA_CENTER
111 #define DW_CFA_LEFT CFA_LEFT
112 #define DW_CFA_RIGHT CFA_RIGHT
113 #define DW_CFA_HORZSEPARATOR CFA_HORZSEPARATOR
114 #define DW_CFA_SEPARATOR CFA_SEPARATOR
115
116 #define DW_CA_DETAILSVIEWTITLES CA_DETAILSVIEWTITLES
117 #define DW_CV_MINI CV_MINI
118 #define DW_CV_DETAIL CV_DETAIL
119
120 #define DW_CRA_SELECTED CRA_SELECTED
121 #define DW_CRA_CURSORED CRA_CURSORED
122
123 #define DW_SLS_READONLY SLS_READONLY
124 #define DW_SLS_RIBBONSTRIP SLS_RIBBONSTRIP
125
126 #define DW_CCS_SINGLESEL CCS_SINGLESEL
127 #define DW_CCS_EXTENDSEL CCS_EXTENDSEL
128
129 #define DW_LS_MULTIPLESEL LS_MULTIPLESEL
130
131 #define DW_LIT_NONE -1
132
133 #define DW_MLE_CASESENSITIVE MLFSEARCH_CASESENSITIVE
134
135 #define DW_POINTER_ARROW SPTR_ARROW
136 #define DW_POINTER_CLOCK SPTR_WAIT
137
138 #define DW_OS2_NEW_WINDOW 1
139
140 typedef struct _window_data {
141 PFNWP oldproc;
142 UserData *root;
143 HWND clickdefault;
144 ULONG flags;
145 void *data;
146 } WindowData;
147
148 typedef struct _hpixmap {
149 unsigned long width, height;
150 HDC hdc;
151 HPS hps;
152 HBITMAP hbm;
153 HWND handle;
154 } *HPIXMAP;
155
156 typedef HWND HMENUI;
157 typedef HMODULE HMOD;
158
159 #define DW_NOMENU NULLHANDLE
160
161 extern HAB dwhab;
162 extern HMQ dwhmq;
163 #endif
164
165 #if defined(__WIN32__) || defined(WINNT)
166 #include <windows.h>
167 #include <commctrl.h>
168
169 /* Cygwin doesn't seem to have these... */
170 #if defined(__CYGWIN32__)
171 #define LVS_EX_GRIDLINES 0x00000001
172 #define LVS_EX_FULLROWSELECT 0x00000020
173 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
174 #define ListView_SetExtendedListViewStyle(hwndLV, dw) (DWORD)SendMessage((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw)
175 #endif
176 #ifndef UDM_SETPOS32
177 #define UDM_SETPOS32 (WM_USER+113)
178 #endif
179 #ifndef UDM_GETPOS32
180 #define UDM_GETPOS32 (WM_USER+114)
181 #endif
182
183 #if defined(MSVC) && !defined(API)
184 #define API _cdecl
185 #endif
186
187 /* Lets make some platform independent defines :) */
188 #define DW_DT_LEFT SS_LEFT
189 #define DW_DT_QUERYEXTENT 0
190 #define DW_DT_UNDERSCORE 0
191 #define DW_DT_STRIKEOUT 0
192 #define DW_DT_TEXTATTRS 0
193 #define DW_DT_EXTERNALLEADING 0
194 #define DW_DT_CENTER SS_CENTER
195 #define DW_DT_RIGHT SS_RIGHT
196 #define DW_DT_TOP 0
197 #define DW_DT_VCENTER SS_NOPREFIX
198 #define DW_DT_BOTTOM 0
199 #define DW_DT_HALFTONE 0
200 #define DW_DT_MNEMONIC 0
201 #define DW_DT_WORDBREAK 0
202 #define DW_DT_ERASERECT 0
203
222 #define DW_FCF_TITLEBAR WS_CAPTION 204 #define DW_FCF_TITLEBAR WS_CAPTION
223 #define DW_FCF_SYSMENU WS_SYSMENU 205 #define DW_FCF_SYSMENU WS_SYSMENU
224 #define DW_FCF_MENU 0 206 #define DW_FCF_MENU 0
225 #define DW_FCF_SIZEBORDER WS_THICKFRAME 207 #define DW_FCF_SIZEBORDER WS_THICKFRAME
226 #define DW_FCF_MINBUTTON WS_MINIMIZEBOX 208 #define DW_FCF_MINBUTTON WS_MINIMIZEBOX
414 #define DW_DT_BOTTOM (1 << 7) 396 #define DW_DT_BOTTOM (1 << 7)
415 #define DW_DT_HALFTONE (1 << 8) 397 #define DW_DT_HALFTONE (1 << 8)
416 #define DW_DT_MNEMONIC (1 << 9) 398 #define DW_DT_MNEMONIC (1 << 9)
417 #define DW_DT_WORDBREAK (1 << 10) 399 #define DW_DT_WORDBREAK (1 << 10)
418 #define DW_DT_ERASERECT (1 << 11) 400 #define DW_DT_ERASERECT (1 << 11)
419
420 #define DW_CLR_BLACK 0
421 #define DW_CLR_DARKRED 1
422 #define DW_CLR_DARKGREEN 2
423 #define DW_CLR_BROWN 3
424 #define DW_CLR_DARKBLUE 4
425 #define DW_CLR_DARKPINK 5
426 #define DW_CLR_DARKCYAN 6
427 #define DW_CLR_PALEGRAY 7
428 #define DW_CLR_DARKGRAY 8
429 #define DW_CLR_RED 9
430 #define DW_CLR_GREEN 10
431 #define DW_CLR_YELLOW 11
432 #define DW_CLR_BLUE 12
433 #define DW_CLR_PINK 13
434 #define DW_CLR_CYAN 14
435 #define DW_CLR_WHITE 15
436 #define DW_CLR_DEFAULT 16
437 401
438 #define DW_FCF_TITLEBAR 1 402 #define DW_FCF_TITLEBAR 1
439 #define DW_FCF_SYSMENU (1 << 1) 403 #define DW_FCF_SYSMENU (1 << 1)
440 #define DW_FCF_MENU (1 << 2) 404 #define DW_FCF_MENU (1 << 2)
441 #define DW_FCF_SIZEBORDER (1 << 3) 405 #define DW_FCF_SIZEBORDER (1 << 3)