]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/missing.h
First hack at wxBrush for wxCocoa
[wxWidgets.git] / include / wx / msw / missing.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: missing.h
3 // Purpose: Declarations for parts of the Win32 SDK that are missing in
4 // the version that comes with some compilers
5 // Created: 2002/04/23
6 // RCS-ID: $Id$
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_MISSING_H_
11 #define _WX_MISSING_H_
12
13 // ----------------------------------------------------------------------------
14 // ListView common control
15 // ----------------------------------------------------------------------------
16
17 #ifndef LVHT_ONITEM
18 #define LVHT_ONITEM \
19 (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
20 #endif
21
22 #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
23 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
24 #endif
25
26 #ifndef LVS_EX_FULLROWSELECT
27 #define LVS_EX_FULLROWSELECT 0x00000020
28 #endif
29
30 #ifndef LVS_OWNERDATA
31 #define LVS_OWNERDATA 0x1000
32 #endif
33
34 #ifndef LVM_FIRST
35 #define LVM_FIRST 0x1000
36 #endif
37
38 #ifndef HDM_FIRST
39 #define HDM_FIRST 0x1200
40 #endif
41
42 #ifndef LVCFMT_JUSTIFYMASK
43 #define LVCFMT_JUSTIFYMASK 0x0003
44 #endif
45
46 #ifndef LVSICF_NOSCROLL
47 #define LVSICF_NOSCROLL 0x0002
48 #endif
49
50 // mingw32/cygwin don't have declarations for comctl32.dll 4.70+ stuff
51 #ifndef NM_CACHEHINT
52 typedef struct tagNMLVCACHEHINT
53 {
54 NMHDR hdr;
55 int iFrom;
56 int iTo;
57 } NMLVCACHEHINT;
58
59 #define NM_CACHEHINT NMLVCACHEHINT
60 #endif
61
62 #ifndef LVN_ODCACHEHINT
63 #define LVN_ODCACHEHINT (-113)
64 #endif
65
66 #ifndef ListView_GetHeader
67 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
68 #endif
69
70 #ifndef LVM_GETHEADER
71 #define LVM_GETHEADER (LVM_FIRST+31)
72 #endif
73
74 #ifndef Header_GetItemRect
75 #define Header_GetItemRect(w,i,r) \
76 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
77 #endif
78
79 #ifndef HDM_GETITEMRECT
80 #define HDM_GETITEMRECT (HDM_FIRST+7)
81 #endif
82
83 #ifndef LVCF_IMAGE
84 #define LVCF_IMAGE 0x0010
85 #endif
86
87 #ifndef LVCFMT_BITMAP_ON_RIGHT
88 #define LVCFMT_BITMAP_ON_RIGHT 0x1000
89 #endif
90
91 #if defined(__GNUWIN32__) && !defined(LV_ITEM) \
92 && !wxCHECK_W32API_VERSION( 0, 5 )
93 typedef struct _LVITEMW {
94 UINT mask;
95 int iItem;
96 int iSubItem;
97 UINT state;
98 UINT stateMask;
99 LPWSTR pszText;
100 int cchTextMax;
101 int iImage;
102 LPARAM lParam;
103 #if (_WIN32_IE >= 0x0300)
104 int iIndent;
105 #endif
106 } LV_ITEMW;
107
108 typedef struct tagLVITEMA
109 {
110 UINT mask;
111 int iItem;
112 int iSubItem;
113 UINT state;
114 UINT stateMask;
115 LPSTR pszText;
116 int cchTextMax;
117 int iImage;
118 LPARAM lParam;
119 #if (_WIN32_IE >= 0x0300)
120 int iIndent;
121 #endif
122 } LV_ITEMA;
123
124 #define LV_ITEM LV_ITEMA;
125 #endif
126
127 #ifndef ListView_GetColumnWidth
128 #define ListView_GetColumnWidth(hwnd, iCol) \
129 (int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
130 #endif
131
132 #ifndef ListView_SetColumnWidth
133 #define ListView_SetColumnWidth(hwnd, iCol, cx) \
134 (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
135 #endif
136
137 #ifndef ListView_GetTextColor
138 #define ListView_GetTextColor(hwnd) \
139 (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
140 #endif
141
142 #ifndef ListView_FindItem
143 #define ListView_FindItem(hwnd, iStart, plvfi) \
144 (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
145 #endif
146
147 #if defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 0, 5 )
148 #ifndef LV_DISPINFOA
149 typedef struct tagNMLVDISPINFOA {
150 NMHDR hdr;
151 LV_ITEMA item;
152 } NMLVDISPINFOA, FAR *LPNMLVDISPINFOA;
153 #define _LV_DISPINFOA tagNMLVDISPINFOA
154 #define LV_DISPINFOA NMLVDISPINFOA
155 #endif
156 #ifndef LV_DISPINFOW
157 typedef struct tagNMLVDISPINFOW {
158 NMHDR hdr;
159 LV_ITEMW item;
160 } NMLVDISPINFOW, FAR *LPNMLVDISPINFOW;
161 #define _LV_DISPINFOW tagNMLVDISPINFOW
162 #define LV_DISPINFOW NMLVDISPINFOW
163 #endif
164 #endif
165
166 #if ((defined(__WATCOMC__) && __WATCOMC__ >= 1200) || defined(__GNUWIN32__) || defined (__MINGW32__) || defined(__DIGITALMARS__) || defined (__BORLANDC__)) && !defined(HDN_GETDISPINFOW)
167 #define HDN_GETDISPINFOW (HDN_FIRST-29)
168 #if !wxCHECK_W32API_VERSION(2, 2)
169 typedef struct {
170 NMHDR hdr;
171 int iItem;
172 UINT mask;
173 LPWSTR pszText;
174 int cchTextMax;
175 int iImage;
176 LPARAM lParam;
177 } NMHDDISPINFOW, *LPNMHDDISPINFOW;
178 #endif
179 #endif
180
181
182 // ----------------------------------------------------------------------------
183 // MS HTML Help
184 // ----------------------------------------------------------------------------
185
186 // instead of including htmlhelp.h, duplicate the things from it we need here:
187
188 enum
189 {
190 HH_DISPLAY_TOPIC,
191 HH_DISPLAY_TOC,
192 HH_DISPLAY_INDEX,
193 HH_DISPLAY_SEARCH,
194 HH_SET_WIN_TYPE,
195 HH_GET_WIN_TYPE,
196 HH_GET_WIN_HANDLE,
197 HH_ENUM_INFO_TYPE,
198 HH_SET_INFO_TYPE,
199 HH_SYNC,
200 HH_RESERVED1,
201 HH_RESERVED2,
202 HH_RESERVED3,
203 HH_KEYWORD_LOOKUP,
204 HH_DISPLAY_TEXT_POPUP,
205 HH_HELP_CONTEXT,
206 HH_TP_HELP_CONTEXTMENU,
207 HH_TP_HELP_WM_HELP,
208 HH_CLOSE_ALL,
209 HH_ALINK_LOOKUP,
210 HH_GET_LAST_ERROR,
211 HH_ENUM_CATEGORY,
212 HH_ENUM_CATEGORY_IT,
213 HH_RESET_IT_FILTER,
214 HH_SET_INCLUSIVE_FILTER,
215 HH_SET_EXCLUSIVE_FILTER
216 };
217
218 struct HH_POPUP
219 {
220 int cbStruct;
221 HINSTANCE hinst;
222 UINT idString;
223 LPCTSTR pszText;
224 POINT pt;
225 COLORREF clrForeground;
226 COLORREF clrBackground;
227 RECT rcMargins;
228 LPCTSTR pszFont;
229 };
230
231 struct HH_AKLINK
232 {
233 int cbStruct;
234 BOOL fReserved;
235 LPCTSTR pszKeywords;
236 LPCTSTR pszUrl;
237 LPCTSTR pszMsgText;
238 LPCTSTR pszMsgTitle;
239 LPCTSTR pszWindow;
240 BOOL fIndexOnFail;
241 };
242
243 // ----------------------------------------------------------------------------
244 // SHGetFileInfo-related things
245 // ----------------------------------------------------------------------------
246
247 #ifndef SHGetFileInfo
248 #ifdef UNICODE
249 #define SHGetFileInfo SHGetFileInfoW
250 #else
251 #define SHGetFileInfo SHGetFileInfoA
252 #endif
253 #endif
254
255 #ifndef SHGFI_ATTRIBUTES
256 #define SHGFI_ATTRIBUTES 2048
257 #endif
258
259 #ifndef SFGAO_READONLY
260 #define SFGAO_READONLY 0x00040000L
261 #endif
262
263 #ifndef SFGAO_REMOVABLE
264 #define SFGAO_REMOVABLE 0x02000000L
265 #endif
266
267 #ifndef SHGFI_DISPLAYNAME
268 #define SHGFI_DISPLAYNAME 512
269 #endif
270
271 #ifndef SHGFI_ICON
272 #define SHGFI_ICON 256
273 #endif
274
275 #ifndef SHGFI_SMALLICON
276 #define SHGFI_SMALLICON 1
277 #endif
278
279 #ifndef SHGFI_SHELLICONSIZE
280 #define SHGFI_SHELLICONSIZE 4
281 #endif
282
283 #ifndef SHGFI_OPENICON
284 #define SHGFI_OPENICON 2
285 #endif
286
287 // ----------------------------------------------------------------------------
288 // Rich text control
289 // ----------------------------------------------------------------------------
290
291 #if wxUSE_RICHEDIT && defined(MAX_TAB_STOPS)
292
293 // old mingw32 doesn't define this
294 #ifndef CFM_CHARSET
295 #define CFM_CHARSET 0x08000000
296 #endif // CFM_CHARSET
297
298 #ifndef CFM_BACKCOLOR
299 #define CFM_BACKCOLOR 0x04000000
300 #endif
301
302 // cygwin does not have these defined for richedit
303 #ifndef ENM_LINK
304 #define ENM_LINK 0x04000000
305 #endif
306
307 #ifndef EM_AUTOURLDETECT
308 #define EM_AUTOURLDETECT (WM_USER + 91)
309 #endif
310
311 #ifndef EN_LINK
312 #define EN_LINK 0x070b
313
314 typedef struct _enlink
315 {
316 NMHDR nmhdr;
317 UINT msg;
318 WPARAM wParam;
319 LPARAM lParam;
320 CHARRANGE chrg;
321 } ENLINK;
322 #endif // ENLINK
323
324 #ifndef SF_UNICODE
325 #define SF_UNICODE 0x0010
326 #endif
327
328 // Watcom C++ doesn't define this
329 #ifndef SCF_ALL
330 #define SCF_ALL 0x0004
331 #endif
332
333 #ifndef PFA_JUSTIFY
334 #define PFA_JUSTIFY 4
335
336 typedef struct _paraformat2 {
337 UINT cbSize;
338 DWORD dwMask;
339 WORD wNumbering;
340 WORD wEffects;
341 LONG dxStartIndent;
342 LONG dxRightIndent;
343 LONG dxOffset;
344 WORD wAlignment;
345 SHORT cTabCount;
346 LONG rgxTabs[MAX_TAB_STOPS];
347 LONG dySpaceBefore;
348 LONG dySpaceAfter;
349 LONG dyLineSpacing;
350 SHORT sStype;
351 BYTE bLineSpacingRule;
352 BYTE bOutlineLevel;
353 WORD wShadingWeight;
354 WORD wShadingStyle;
355 WORD wNumberingStart;
356 WORD wNumberingStyle;
357 WORD wNumberingTab;
358 WORD wBorderSpace;
359 WORD wBorderWidth;
360 WORD wBorders;
361 } PARAFORMAT2;
362 #define wxEffects wReserved
363
364 #endif
365
366 #endif // wxUSE_RICHEDIT
367
368 // ----------------------------------------------------------------------------
369 // Misc stuff
370 // ----------------------------------------------------------------------------
371
372 #ifndef QS_ALLPOSTMESSAGE
373 #define QS_ALLPOSTMESSAGE 0x0100
374 #endif
375
376 #ifndef WS_EX_CLIENTEDGE
377 #define WS_EX_CLIENTEDGE 0x00000200L
378 #endif
379
380 #ifndef ENDSESSION_LOGOFF
381 #define ENDSESSION_LOGOFF 0x80000000
382 #endif
383
384 #endif
385 // _WX_MISSING_H_