]> git.saurik.com Git - wxWidgets.git/blame - include/wx/defs.h
Removed small OGL glitches; added new sample
[wxWidgets.git] / include / wx / defs.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: defs.h
3// Purpose: Declarations/definitions common to all wx source files
4// Author: Julian Smart and others
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c)
3f4a0c5b 9// Licence: wxWindows licence
c801d85f
KB
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_DEFS_H_
13#define _WX_DEFS_H_
c801d85f
KB
14
15#ifdef __GNUG__
16#pragma interface "defs.h"
17#endif
18
c801d85f
KB
19#include <stddef.h>
20
21#include "wx/setup.h"
22#include "wx/version.h"
23
3f4a0c5b
VZ
24// ----------------------------------------------------------------------------
25// compiler and OS identification
26// ----------------------------------------------------------------------------
c801d85f 27
3f4a0c5b
VZ
28// OS
29#if defined(__HPUX__) || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi ) || defined(__unix__)
30 #ifndef __UNIX__
31 #define __UNIX__
32 #endif // Unix
33
34 // Helps SGI compilation, apparently
35 #ifdef __SGI__
36 #ifdef __GNUG__
37 #define __need_wchar_t
38 #else // !gcc
39 // Note I use the term __SGI_CC__ for both cc and CC, its not a good
40 // idea to mix gcc and cc/CC, the name mangling is different
41 #define __SGI_CC__
42 #endif // gcc/!gcc
43 #endif // SGI
44
45 #if defined(sun) || defined(__SUN__)
46 #ifndef __GNUG__
47 #ifndef __SUNCC__
48 #define __SUNCC__
49 #endif // Sun CC
50 #endif
51 #endif // Sun
52#else // Windows
53 #ifndef __WINDOWS__
54 #define __WINDOWS__
55 #endif // Windows
56
57 // define another standard symbol for Microsoft Visual C++: the standard one
58 // (_MSC_VER) is also defined by Metrowerks compiler
59 #if defined(_MSC_VER) && !defined(__MWERKS__)
858f7d66 60 #define __VISUALC__ _MSC_VER
3f4a0c5b
VZ
61 #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
62 #define __BORLANDC__
63 #elif defined(__WATCOMC__)
64 //#define __WATCOMC__
65 #elif defined(__SC__)
66 #define __SYMANTECC__
67 #endif // compiler
68#endif // OS
5dcf05ae 69
fd3f686c 70// suppress some Visual C++ warnings
3f4a0c5b 71#ifdef __VISUALC__
fd3f686c
VZ
72# pragma warning(disable:4244) // cobversion from double to float
73# pragma warning(disable:4100) // unreferenced formal parameter
c801d85f
KB
74#endif
75
a3ef5bf5
JS
76// suppress some Salford C++ warnings
77#ifdef __SALFORDC__
78# pragma suppress 353 // Possible nested comments
79# pragma suppress 593 // Define not used
80# pragma suppress 61 // enum has no name (doesn't suppress!)
81# pragma suppress 106 // unnamed, unused parameter
82# pragma suppress 571 // Virtual function hiding
83#endif
84
c801d85f
KB
85//////////////////////////////////////////////////////////////////////////////////
86// Currently Only MS-Windows/NT, XView and Motif are supported
87//
2049ba38
KB
88#if defined(__HPUX__) && !defined(__WXMOTIF__)
89# define __WXMOTIF__
c801d85f 90#endif
2049ba38 91#if defined(__WXMOTIF__)
c801d85f 92# define __X__
c801d85f
KB
93#endif
94
16ee7f42 95#ifdef __WXMSW__
c801d85f 96// wxWindows checks for WIN32, not __WIN32__
34138703 97#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__) && !defined(__WXSTUBS__))
c801d85f
KB
98#define __WIN32__
99#endif
100
101#ifndef __WIN32__
102#define __WIN16__
103#endif
104
105#if !defined(__WIN95__) && (WINVER >= 0x0400)
106#define __WIN95__
107#endif
108
57c208c5
JS
109#if defined(TWIN32) && !defined(__TWIN32__)
110#define __TWIN32__
111#endif
112
16ee7f42
VZ
113#endif // wxMSW
114
c801d85f 115// Make sure the environment is set correctly
2049ba38 116#if defined(__WXMSW__) && defined(__X__)
c801d85f 117# error "Target can't be both X and Windows"
b4e76e0d 118#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
34138703
JS
119 !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__)
120#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]"
c801d85f
KB
121#endif
122
34138703 123#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__)
c801d85f
KB
124
125// Bool is now obsolete, use bool instead
126// typedef int Bool;
127
128#ifndef TRUE
129# define TRUE 1
130# define FALSE 0
131# define Bool_DEFINED
132#endif
133
2049ba38 134#elif defined(__WXMSW__)
c801d85f
KB
135
136#ifndef TRUE
137# define TRUE 1
138# define FALSE 0
139#endif
140
141#endif
142
143// VC++ 4.0 is 1000.
144
145// Add more tests here for compilers that don't already define bool.
9ac65416
SC
146#if defined( __MWERKS__ )
147 #if (__MWERKS__ < 0x1000) || !__option(bool)
148 typedef unsigned int bool;
149 #endif
2432b92d
JS
150#elif defined(__SC__)
151 typedef unsigned int bool;
a3ef5bf5
JS
152#elif defined(__SALFORDC__)
153 typedef unsigned int bool;
3f4a0c5b 154#elif defined(__VISUALC__) && (__VISUALC__ <= 1000)
dc9e1e56 155 typedef unsigned int bool;
3f4a0c5b 156#elif defined(__VISUALC__) && (__VISUALC__ == 1020)
dc9e1e56
VZ
157 #define bool unsigned int
158#elif defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
159 typedef unsigned int bool;
7be1f0d9 160#elif defined(__WATCOMC__)
818e52c2
JS
161// typedef unsigned int bool;
162
163 #if __WATCOMC__<1100
164 typedef enum _tagbool {
165 false,
166 true
167 } bool ;
168 #endif
169
5dcf05ae 170#elif defined(__SUNCC__)
e0543d2a 171 #ifdef __SUNPRO_CC
6c82a1fd 172 // starting from version 5.0 Sun CC understands 'bool'
e0543d2a 173 #if __SUNPRO_CC <= 0x0420
6c82a1fd
VZ
174 // If we use int, we get identically overloaded functions in config.cpp
175 typedef unsigned char bool;
176 #endif // Sun CC version
177 #else
1f112209 178 #error "Unknown compiler: only Sun's CC and gcc are currently recognised."
6c82a1fd 179 #endif // Sun CC
16c1f7f3
JS
180#endif
181
3f4a0c5b 182#if ( defined(__VISUALC__) && (__VISUALC__ <= 800) ) || defined(__GNUWIN32__) || (defined(__BORLANDC__) && defined(__WIN16__)) || defined(__SC__) || defined(__SALFORDC__)
57c208c5
JS
183// Not a good idea, because later system files (e.g. windows.h)
184// may try to define it. Use wxByte instead.
185// #define byte unsigned char
c801d85f
KB
186#endif
187
57c208c5 188typedef unsigned char wxByte;
c801d85f
KB
189typedef short int WXTYPE;
190typedef int wxWindowID;
191
192// Macro to cut down on compiler warnings.
193#if REMOVE_UNUSED_ARG
194#define WXUNUSED(identifier) /* identifier */
195#else // stupid, broken compiler
196#define WXUNUSED(identifier) identifier
197#endif
198
199/*
200 * Making or using wxWindows as a Windows DLL
201 */
202
2049ba38 203#ifdef __WXMSW__
c801d85f
KB
204
205#ifdef __BORLANDC__
206
207# ifdef WXMAKINGDLL
208# define WXDLLEXPORT __export
209# define WXDLLEXPORT_DATA(type) type __export
210# define WXDLLEXPORT_CTORFN __export
211# elif defined(WXUSINGDLL)
212# define WXDLLEXPORT __import
213# define WXDLLEXPORT_DATA(type) type __import
214# define WXDLLEXPORT_CTORFN
215# else
216# define WXDLLEXPORT
217# define WXDLLEXPORT_DATA(type) type
218# define WXDLLEXPORT_CTORFN
219# endif
220
221#else
222
223# ifdef WXMAKINGDLL
224# define WXDLLEXPORT __declspec( dllexport )
225# define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
184b5d99 226# define WXDLLEXPORT_CTORFN // __declspec( dllexport )
c801d85f
KB
227# elif defined(WXUSINGDLL)
228# define WXDLLEXPORT __declspec( dllimport )
229# define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type
230# define WXDLLEXPORT_CTORFN
231# else
232# define WXDLLEXPORT
233# define WXDLLEXPORT_DATA(type) type
234# define WXDLLEXPORT_CTORFN
235# endif
236
237#endif
238
239#else
240// Non-Windows
241# define WXDLLEXPORT
242# define WXDLLEXPORT_DATA(type) type
243# define WXDLLEXPORT_CTORFN
244#endif
245
246// For ostream, istream ofstream
247#if defined(__BORLANDC__) && defined( _RTLDLL )
248# define WXDLLIMPORT __import
249#else
250# define WXDLLIMPORT
251#endif
252
253class WXDLLEXPORT wxObject;
254class WXDLLEXPORT wxEvent;
255
c86f1403 256 /** symbolic constant used by all Find()-like functions returning positive
c801d85f 257 integer on success as failure indicator */
3c67202d 258#define wxNOT_FOUND (-1)
c801d85f
KB
259
260// ----------------------------------------------------------------------------
261// Error codes
262// ----------------------------------------------------------------------------
263
57c208c5
JS
264#ifdef ERR_PARAM
265#undef ERR_PARAM
266#endif
267
c801d85f
KB
268/// Standard error codes
269enum ErrCode
270{
271 /// invalid parameter (in broad sense)
272 ERR_PARAM = (-4000),
273 /// no more data (iteration functions usually return this)
274 ERR_NODATA,
275 /// user cancelled the operation
276 ERR_CANCEL,
277 /// no error (the only non negative error code)
278 ERR_SUCCESS = 0
279};
280
281// ----------------------------------------------------------------------------
282/** @name Very common macros */
283// ----------------------------------------------------------------------------
284//@{
a3622daa
VZ
285/// delete pointer if it is not NULL and NULL it afterwards
286// (checking that it's !NULL before passing it to delete is just a
287// a question of style, because delete will do it itself anyhow, but it might
288// be considered as an error by some overzealous debugging implementations of
289// the library, so we do it ourselves)
c67daf87 290#if defined(__SGI_CC__)
d4b67f95 291// Okay this is bad styling, but the native SGI compiler is very picky, it
c67daf87 292// wont let you compare/assign between a NULL (void *) and another pointer
d4b67f95
RD
293// type. To be really clean we'd need to pass in another argument, the type
294// of p.
295// Also note the use of 0L, this would allow future possible 64bit support
296// (as yet untested) by ensuring that we zero all the bits in a pointer
297// (which is always the same length as a long (at least with the LP64 standard)
c67daf87 298// --- offer aug 98
d8260b2f 299#define wxDELETE(p) if ( (p) ) { delete (p); p = 0L; }
c67daf87 300#else
d8260b2f 301#define wxDELETE(p) if ( (p) != NULL ) { delete p; p = NULL; }
c67daf87 302#endif /* __SGI__CC__ */
a3622daa
VZ
303
304// delete an array and NULL it (see comments above)
c67daf87
UR
305#if defined(__SGI_CC__)
306// see above comment.
307#define wxDELETEA(p) if ( (p) ) { delete [] (p); p = 0L; }
308#else
d8260b2f 309#define wxDELETEA(p) if ( ((void *) (p)) != NULL ) { delete [] p; p = NULL; }
c67daf87 310#endif /* __SGI__CC__ */
c801d85f
KB
311
312/// size of statically declared array
313#define WXSIZEOF(array) (sizeof(array)/sizeof(array[0]))
314
8cb50e4b
JS
315// Use of these suppresses some compiler warnings
316WXDLLEXPORT_DATA(extern const bool) wxTrue;
317WXDLLEXPORT_DATA(extern const bool) wxFalse;
318
c801d85f
KB
319// ----------------------------------------------------------------------------
320// compiler specific settings
321// ----------------------------------------------------------------------------
322
323// to allow compiling with warning level 4 under Microsoft Visual C++ some
324// warnings just must be disabled
325#ifdef __VISUALC__
326 #pragma warning(disable: 4514) // unreferenced inline func has been removed
d4b67f95 327/*
c801d85f 328 you might be tempted to disable this one also: triggered by CHECK and FAIL
3f4a0c5b
VZ
329 macros in debug.h, but it's, overall, a rather useful one, so I leave it and
330 will try to find some way to disable this warning just for CHECK/FAIL. Anyone?
c801d85f
KB
331*/
332 #pragma warning(disable: 4127) // conditional expression is constant
c801d85f
KB
333#endif // VC++
334
3f4a0c5b
VZ
335#if defined(__MWERKS__)
336 #undef try
337 #undef except
338 #undef finally
339 #define except(x) catch(...)
340#endif // Metrowerks
8a60ae88 341
85ee3474
UU
342// where should i put this? we need to make sure of this as it breaks
343// the <iostream> code.
ea57084d 344#if !wxUSE_IOSTREAMH && defined(__WXDEBUG__)
518f33a4 345#ifndef __MWERKS__
ea57084d 346#undef __WXDEBUG__
85ee3474 347#endif
518f33a4 348#endif
85ee3474 349
c801d85f
KB
350// Callback function type definition
351typedef void (*wxFunction) (wxObject&, wxEvent&);
352
353/*
354 * Window style flags.
355 * Values are chosen so they can be |'ed in a bit list.
356 * Some styles are used across more than one group,
357 * so the values mustn't clash with others in the group.
358 * Otherwise, numbers can be reused across groups.
359 *
360 * From version 1.66:
361 * Window (cross-group) styles now take up the first half
362 * of the flag, and control-specific styles the
363 * second half.
d4b67f95 364 *
c801d85f
KB
365 */
366
367/*
368 * Window (Frame/dialog/subwindow/panel item) style flags
369 */
370#define wxVSCROLL 0x80000000
371#define wxHSCROLL 0x40000000
372#define wxCAPTION 0x20000000
373
374// New styles
375#define wxDOUBLE_BORDER 0x10000000
376#define wxSUNKEN_BORDER 0x08000000
377#define wxRAISED_BORDER 0x04000000
378#define wxBORDER 0x02000000
379#define wxSIMPLE_BORDER 0x02000000
380#define wxSTATIC_BORDER 0x01000000
381#define wxTRANSPARENT_WINDOW 0x00100000
382#define wxNO_BORDER 0x00200000
383
384#define wxUSER_COLOURS 0x00800000
385 // Override CTL3D etc. control colour processing to
386 // allow own background colour
64693098 387 // OBSOLETE - use wxNO_3D instead
c801d85f
KB
388#define wxNO_3D 0x00800000
389 // Override CTL3D or native 3D styles for children
565215b2
JS
390#define wxCLIP_CHILDREN 0x00400000
391 // Clip children when painting, which reduces flicker in
392 // e.g. frames and splitter windows, but can't be used in
393 // a panel where a static box must be 'transparent' (panel
394 // paints the background for it)
c801d85f
KB
395
396// Add this style to a panel to get tab traversal working
397// outside of dialogs.
398#define wxTAB_TRAVERSAL 0x00080000
399
400// Orientations
401#define wxHORIZONTAL 0x01
402#define wxVERTICAL 0x02
403#define wxBOTH (wxVERTICAL|wxHORIZONTAL)
404#define wxCENTER_FRAME 0x04 /* centering into frame rather than screen */
405
406/*
407 * Frame/dialog style flags
408 */
3f4a0c5b
VZ
409#define wxSTAY_ON_TOP 0x8000
410#define wxICONIZE 0x4000
411#define wxMINIMIZE wxICONIZE
412#define wxMAXIMIZE 0x2000
413#define wxTHICK_FRAME 0x1000
414#define wxSYSTEM_MENU 0x0800
415#define wxMINIMIZE_BOX 0x0400
416#define wxMAXIMIZE_BOX 0x0200
417#define wxTINY_CAPTION_HORIZ 0x0100
418#define wxTINY_CAPTION_VERT 0x0080
419#define wxRESIZE_BOX wxMAXIMIZE_BOX
420#define wxRESIZE_BORDER 0x0040
421#define wxDIALOG_MODAL 0x0020
422#define wxDIALOG_MODELESS 0x0000
c801d85f 423
565215b2 424#define wxDEFAULT_FRAME_STYLE (wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN)
c801d85f
KB
425
426#if WXWIN_COMPATIBILITY
427#define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE
428#endif
429
3f4a0c5b 430#define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME)
c801d85f
KB
431
432/*
433 * Subwindow style flags
434 */
435#define wxRETAINED 0x0001
436#define wxBACKINGSTORE wxRETAINED
437// wxCanvas or wxPanel can optionally have a thick frame under MS Windows.
438// #define wxTHICK_FRAME 0x1000
439
440/*
441 * wxToolBar style flags
442 */
d4b67f95 443
c801d85f 444#define wxTB_3DBUTTONS 0x8000
81d66cf3
JS
445#define wxTB_HORIZONTAL 0x0002
446#define wxTB_VERTICAL 0x0004
bb6290e3 447// Flatbar/Coolbar under Win98
81d66cf3 448#define wxTB_FLAT 0x0008
c801d85f
KB
449
450/*
451 * Apply to all panel items
452 */
d4b67f95 453
c801d85f
KB
454#define wxCOLOURED 0x0800
455// Alignment for panel item labels: replaces characters with zeros
456// when creating label, so spaces can be included in string for alignment.
457#define wxFIXED_LENGTH 0x0400
458#define wxALIGN_LEFT 0x0000
459#define wxALIGN_CENTER 0x0100
460#define wxALIGN_CENTRE 0x0100
461#define wxALIGN_RIGHT 0x0200
462
463/*
464 * Styles for wxListBox
465 */
466
c801d85f 467#define wxLB_SORT 0x0010
9c331ded 468#define wxLB_SINGLE 0x0020
c801d85f
KB
469#define wxLB_MULTIPLE 0x0040
470#define wxLB_EXTENDED 0x0080
471// wxLB_OWNERDRAW is Windows-only
472#define wxLB_OWNERDRAW 0x0100
9c331ded
JS
473#define wxLB_NEEDED_SB 0x0200
474#define wxLB_ALWAYS_SB 0x0400
c801d85f
KB
475#define wxLB_HSCROLL wxHSCROLL
476
477/*
478 * wxTextCtrl style flags
479 */
480#define wxPROCESS_ENTER 0x0004
481#define wxPASSWORD 0x0008
482#define wxTE_PROCESS_ENTER wxPROCESS_ENTER
483#define wxTE_PASSWORD wxPASSWORD
484#define wxTE_READONLY 0x0010
485#define wxTE_MULTILINE 0x0020
2004484f 486#define wxTE_PROCESS_TAB 0x0040
c801d85f
KB
487
488/*
489 * wxComboBox style flags
490 */
491#define wxCB_SIMPLE 0x0004
c801d85f 492#define wxCB_SORT 0x0008
9c331ded
JS
493#define wxCB_READONLY 0x0010
494#define wxCB_DROPDOWN 0x0020
c801d85f
KB
495
496/*
497 * wxRadioBox/wxRadioButton style flags
498 */
fa18b757
JS
499
500// New, more intuitive names to specify majorDim argument
501
502// Same as wxRA_HORIZONTAL
503#define wxRA_SPECIFY_COLS 0x0001
504// Same as wxRA_VERTICAL
505#define wxRA_SPECIFY_ROWS 0x0002
506
507// Old names for compatibility
c801d85f
KB
508#define wxRA_HORIZONTAL wxHORIZONTAL
509#define wxRA_VERTICAL wxVERTICAL
510#define wxRB_GROUP 0x0004
511
512/*
513 * wxGauge flags
514 */
515#define wxGA_PROGRESSBAR 0x0004
516#define wxGA_HORIZONTAL wxHORIZONTAL
517#define wxGA_VERTICAL wxVERTICAL
518
519/*
520 * wxSlider flags
521 */
d4b67f95 522
c801d85f
KB
523#define wxSL_HORIZONTAL wxHORIZONTAL
524#define wxSL_VERTICAL wxVERTICAL
525// The next one is obsolete - use scroll events instead
526#define wxSL_NOTIFY_DRAG 0x0000
527#define wxSL_AUTOTICKS 0x0008
528// #define wxSL_MANUALTICKS 0x0010
529#define wxSL_LABELS 0x0020
530#define wxSL_LEFT 0x0040
531#define wxSL_TOP 0x0080
532#define wxSL_RIGHT 0x0100
533#define wxSL_BOTTOM 0x0200
534#define wxSL_BOTH 0x0400
535#define wxSL_SELRANGE 0x0800
536
537/*
538 * wxScrollBar flags
539 */
d4b67f95 540
c801d85f
KB
541#define wxSB_HORIZONTAL wxHORIZONTAL
542#define wxSB_VERTICAL wxVERTICAL
543
544/*
545 * wxButton flags
546 */
547
548#define wxBU_AUTODRAW 0x0004
549#define wxBU_NOAUTODRAW 0x0000
550
551/*
552 * wxTreeCtrl flags
553 */
554
555#define wxTR_HAS_BUTTONS 0x0004
556#define wxTR_EDIT_LABELS 0x0008
64693098 557#define wxTR_LINES_AT_ROOT 0x0010
c801d85f
KB
558
559/*
560 * wxListCtrl flags
561 */
562
563#define wxLC_ICON 0x0004
564#define wxLC_SMALL_ICON 0x0008
565#define wxLC_LIST 0x0010
566#define wxLC_REPORT 0x0020
567#define wxLC_ALIGN_TOP 0x0040
568#define wxLC_ALIGN_LEFT 0x0080
569#define wxLC_AUTOARRANGE 0x0100
570#define wxLC_USER_TEXT 0x0200
571#define wxLC_EDIT_LABELS 0x0400
572#define wxLC_NO_HEADER 0x0800
573#define wxLC_NO_SORT_HEADER 0x1000
574#define wxLC_SINGLE_SEL 0x2000
575#define wxLC_SORT_ASCENDING 0x4000
576#define wxLC_SORT_DESCENDING 0x8000
577
578#define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT)
579#define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT)
580#define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING)
581
582// Omitted because (a) too much detail (b) not enough style flags
583// #define wxLC_NO_SCROLL
584// #define wxLC_NO_LABEL_WRAP
585// #define wxLC_OWNERDRAW_FIXED
586// #define wxLC_SHOW_SEL_ALWAYS
587
588/*
589 * wxSpinButton flags
590 */
591
592#define wxSP_VERTICAL 0x0004
593#define wxSP_HORIZONTAL 0x0008
594#define wxSP_ARROW_KEYS 0x0010
595#define wxSP_WRAP 0x0020
596
597/*
cd2df130 598 * wxSplitterWindow flags
c801d85f
KB
599 */
600
601#define wxSP_NOBORDER 0x0000
602#define wxSP_3D 0x0004
603#define wxSP_BORDER 0x0008
604
cd2df130
JS
605/*
606 * wxFrame extra flags
607 */
608
609// No title on taskbar
610#define wxFRAME_TOOL_WINDOW 0x0004
611
c801d85f
KB
612/*
613 * wxTabCtrl flags
614 */
615
616#define wxTAB_MULTILINE 0x0000
617#define wxTAB_RIGHTJUSTIFY 0x0004
618#define wxTAB_FIXEDWIDTH 0x0008
619#define wxTAB_OWNERDRAW 0x0010
620
10b959e3
JS
621// Sorry, I changed my mind about these names...
622#define wxTC_MULTILINE 0x0000
623#define wxTC_RIGHTJUSTIFY 0x0004
624#define wxTC_FIXEDWIDTH 0x0008
625#define wxTC_OWNERDRAW 0x0010
626
c801d85f
KB
627/*
628 * wxStatusBar95 flags
629 */
630
565215b2 631#define wxST_SIZEGRIP 0x0002
c801d85f
KB
632
633/*
634 * GDI descriptions
635 */
636
637enum {
638// Text font families
639 wxDEFAULT = 70,
640 wxDECORATIVE,
641 wxROMAN,
642 wxSCRIPT,
643 wxSWISS,
644 wxMODERN,
645 wxTELETYPE, /* @@@@ */
646
647// Proportional or Fixed width fonts (not yet used)
648 wxVARIABLE = 80,
649 wxFIXED,
650
651 wxNORMAL = 90,
652 wxLIGHT,
653 wxBOLD,
654// Also wxNORMAL for normal (non-italic text)
655 wxITALIC,
656 wxSLANT,
657
658// Pen styles
659 wxSOLID = 100,
660 wxDOT,
661 wxLONG_DASH,
662 wxSHORT_DASH,
663 wxDOT_DASH,
664 wxUSER_DASH,
665
666 wxTRANSPARENT,
667
668// Brush & Pen Stippling. Note that a stippled pen cannot be dashed!!
669// Note also that stippling a Pen IS meaningfull, because a Line is
670// drawn with a Pen, and without any Brush -- and it can be stippled.
671 wxSTIPPLE = 110,
672 wxBDIAGONAL_HATCH,
673 wxCROSSDIAG_HATCH,
674 wxFDIAGONAL_HATCH,
675 wxCROSS_HATCH,
676 wxHORIZONTAL_HATCH,
677 wxVERTICAL_HATCH,
3f4a0c5b 678#define IS_HATCH(s) ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
c801d85f
KB
679
680 wxJOIN_BEVEL = 120,
681 wxJOIN_MITER,
682 wxJOIN_ROUND,
683
684 wxCAP_ROUND = 130,
685 wxCAP_PROJECTING,
686 wxCAP_BUTT
687};
688
689
690// Logical ops
3f4a0c5b 691typedef enum
83624f79 692{
c801d85f
KB
693 wxCLEAR, // 0
694 wxXOR, // src XOR dst
695 wxINVERT, // NOT dst
696 wxOR_REVERSE, // src OR (NOT dst)
697 wxAND_REVERSE,// src AND (NOT dst)
698 wxCOPY, // src
699 wxAND, // src AND dst
700 wxAND_INVERT, // (NOT src) AND dst
701 wxNO_OP, // dst
702 wxNOR, // (NOT src) AND (NOT dst)
703 wxEQUIV, // (NOT src) XOR dst
704 wxSRC_INVERT, // (NOT src)
705 wxOR_INVERT, // (NOT src) OR dst
706 wxNAND, // (NOT src) OR (NOT dst)
707 wxOR, // src OR dst
708 wxSET, // 1
709 wxSRC_OR, // source _bitmap_ OR destination
710 wxSRC_AND // source _bitmap_ AND destination
711} form_ops_t;
712
713// Flood styles
714#define wxFLOOD_SURFACE 1
715#define wxFLOOD_BORDER 2
716
717// Polygon filling mode
718#define wxODDEVEN_RULE 1
719#define wxWINDING_RULE 2
720
721// ToolPanel in wxFrame
3f4a0c5b
VZ
722#define wxTOOL_TOP 1
723#define wxTOOL_BOTTOM 2
724#define wxTOOL_LEFT 3
725#define wxTOOL_RIGHT 4
c801d85f
KB
726
727// Dialog specifiers/return values
728
729#define wxOK 0x0001
730#define wxYES_NO 0x0002
731#define wxCANCEL 0x0004
732#define wxYES 0x0008
733#define wxNO 0x0010
734
735#define wxICON_EXCLAMATION 0x0020
736#define wxICON_HAND 0x0040
737#define wxICON_QUESTION 0x0080
738#define wxICON_INFORMATION 0x0100
739
740#define wxICON_STOP wxICON_HAND
741#define wxICON_ASTERISK wxICON_INFORMATION
742#define wxICON_MASK (0x0020|0x0040|0x0080|0x0100)
743
744#define wxCENTRE 0x0200
745#define wxCENTER wxCENTRE
746
747// Possible SetSize flags
748
749// Use internally-calculated width if -1
81d66cf3 750#define wxSIZE_AUTO_WIDTH 0x0001
c801d85f 751// Use internally-calculated height if -1
81d66cf3 752#define wxSIZE_AUTO_HEIGHT 0x0002
c801d85f 753// Use internally-calculated width and height if each is -1
81d66cf3 754#define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT)
c801d85f
KB
755// Ignore missing (-1) dimensions (use existing).
756// For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code.
81d66cf3 757#define wxSIZE_USE_EXISTING 0x0000
c801d85f 758// Allow -1 as a valid position
81d66cf3
JS
759#define wxSIZE_ALLOW_MINUS_ONE 0x0004
760// Don't do parent client adjustments (for implementation only)
761#define wxSIZE_NO_ADJUSTMENTS 0x0008
c801d85f 762
0d2a2b60
RR
763#ifndef __WXGTK__
764
e3e65dac
RR
765enum wxDataFormat
766{
06e43511 767 wxDF_INVALID = 0,
e3e65dac
RR
768 wxDF_TEXT = 1, /* CF_TEXT */
769 wxDF_BITMAP = 2, /* CF_BITMAP */
770 wxDF_METAFILE = 3, /* CF_METAFILEPICT */
06e43511
JS
771 wxDF_SYLK = 4,
772 wxDF_DIF = 5,
773 wxDF_TIFF = 6,
e3e65dac 774 wxDF_OEMTEXT = 7, /* CF_OEMTEXT */
06e43511
JS
775 wxDF_DIB = 8, /* CF_DIB */
776 wxDF_PALETTE = 9,
777 wxDF_PENDATA = 10,
778 wxDF_RIFF = 11,
779 wxDF_WAVE = 12,
780 wxDF_UNICODETEXT = 13,
781 wxDF_ENHMETAFILE = 14,
8b53e5a2 782 wxDF_FILENAME = 15, /* CF_HDROP */
06e43511 783 wxDF_LOCALE = 16,
8b53e5a2 784 wxDF_PRIVATE = 20
e3e65dac 785};
c801d85f 786
0d2a2b60
RR
787#endif
788
83624f79 789/* Virtual keycodes */
e3e65dac 790
3f4a0c5b 791enum wxKeyCode
83624f79 792{
c801d85f
KB
793 WXK_BACK = 8,
794 WXK_TAB = 9,
3f4a0c5b
VZ
795 WXK_RETURN = 13,
796 WXK_ESCAPE = 27,
797 WXK_SPACE = 32,
c801d85f
KB
798 WXK_DELETE = 127,
799
800 WXK_START = 300,
801 WXK_LBUTTON,
802 WXK_RBUTTON,
803 WXK_CANCEL,
804 WXK_MBUTTON,
805 WXK_CLEAR,
806 WXK_SHIFT,
807 WXK_CONTROL,
808 WXK_MENU,
809 WXK_PAUSE,
810 WXK_CAPITAL,
83624f79
RR
811 WXK_PRIOR, /* Page up */
812 WXK_NEXT, /* Page down */
c801d85f
KB
813 WXK_END,
814 WXK_HOME,
815 WXK_LEFT,
816 WXK_UP,
817 WXK_RIGHT,
818 WXK_DOWN,
819 WXK_SELECT,
820 WXK_PRINT,
821 WXK_EXECUTE,
822 WXK_SNAPSHOT,
823 WXK_INSERT,
824 WXK_HELP,
825 WXK_NUMPAD0,
826 WXK_NUMPAD1,
827 WXK_NUMPAD2,
828 WXK_NUMPAD3,
829 WXK_NUMPAD4,
830 WXK_NUMPAD5,
831 WXK_NUMPAD6,
832 WXK_NUMPAD7,
833 WXK_NUMPAD8,
834 WXK_NUMPAD9,
835 WXK_MULTIPLY,
836 WXK_ADD,
837 WXK_SEPARATOR,
838 WXK_SUBTRACT,
839 WXK_DECIMAL,
840 WXK_DIVIDE,
841 WXK_F1,
842 WXK_F2,
843 WXK_F3,
844 WXK_F4,
845 WXK_F5,
846 WXK_F6,
847 WXK_F7,
848 WXK_F8,
849 WXK_F9,
850 WXK_F10,
851 WXK_F11,
852 WXK_F12,
853 WXK_F13,
854 WXK_F14,
855 WXK_F15,
856 WXK_F16,
857 WXK_F17,
858 WXK_F18,
859 WXK_F19,
860 WXK_F20,
861 WXK_F21,
862 WXK_F22,
863 WXK_F23,
864 WXK_F24,
865 WXK_NUMLOCK,
866 WXK_SCROLL,
867 WXK_PAGEUP,
868 WXK_PAGEDOWN
869};
870
83624f79
RR
871/* OS mnemonics -- Identify the running OS (useful for Windows)
872 * [Not all platforms are currently available or supported] */
3f4a0c5b 873enum
83624f79 874{
34138703 875 wxUNKNOWN_PLATFORM,
3f4a0c5b
VZ
876 wxCURSES, // Text-only CURSES
877 wxXVIEW_X, // Sun's XView OpenLOOK toolkit
878 wxMOTIF_X, // OSF Motif 1.x.x
879 wxCOSE_X, // OSF Common Desktop Environment
880 wxNEXTSTEP, // NeXTStep
881 wxMACINTOSH, // Apple System 7
882 wxGTK, // GTK
883 wxQT, // Qt
884 wxGEOS, // GEOS
885 wxOS2_PM, // OS/2 Workplace
886 wxWINDOWS, // Windows or WfW
887 wxPENWINDOWS, // Windows for Pen Computing
888 wxWINDOWS_NT, // Windows NT
889 wxWIN32S, // Windows 32S API
890 wxWIN95, // Windows 95
891 wxWIN386 // Watcom 32-bit supervisor modus
c801d85f
KB
892};
893
83624f79 894/* Printing */
c801d85f
KB
895#ifndef wxPORTRAIT
896#define wxPORTRAIT 1
897#define wxLANDSCAPE 2
898#endif
899
83624f79 900/* Standard menu identifiers */
1f112209
JS
901#define wxID_LOWEST 4999
902
c801d85f
KB
903#define wxID_OPEN 5000
904#define wxID_CLOSE 5001
905#define wxID_NEW 5002
906#define wxID_SAVE 5003
907#define wxID_SAVEAS 5004
908#define wxID_REVERT 5005
909#define wxID_EXIT 5006
910#define wxID_UNDO 5007
911#define wxID_REDO 5008
912#define wxID_HELP 5009
913#define wxID_PRINT 5010
914#define wxID_PRINT_SETUP 5011
915#define wxID_PREVIEW 5012
916#define wxID_ABOUT 5013
917#define wxID_HELP_CONTENTS 5014
918#define wxID_HELP_COMMANDS 5015
919#define wxID_HELP_PROCEDURES 5016
920#define wxID_HELP_CONTEXT 5017
921
922#define wxID_CUT 5030
923#define wxID_COPY 5031
924#define wxID_PASTE 5032
925#define wxID_CLEAR 5033
926#define wxID_FIND 5034
7f555861 927#define wxID_DUPLICATE 5035
77e3eac5 928#define wxID_SELECTALL 5036
c801d85f
KB
929
930#define wxID_FILE1 5050
931#define wxID_FILE2 5051
932#define wxID_FILE3 5052
933#define wxID_FILE4 5053
934#define wxID_FILE5 5054
935#define wxID_FILE6 5055
936#define wxID_FILE7 5056
937#define wxID_FILE8 5057
938#define wxID_FILE9 5058
939
940#define wxID_OK 5100
941#define wxID_CANCEL 5101
942#define wxID_APPLY 5102
943#define wxID_YES 5103
944#define wxID_NO 5104
5de76427 945#define wxID_STATIC 5105
c801d85f 946
dfad0599
JS
947#define wxID_HIGHEST 5999
948
e3065973
JS
949// Mapping modes (as per Windows)
950#define wxMM_TEXT 1
951#define wxMM_LOMETRIC 2
952#define wxMM_HIMETRIC 3
953#define wxMM_LOENGLISH 4
954#define wxMM_HIENGLISH 5
955#define wxMM_TWIPS 6
956#define wxMM_ISOTROPIC 7
957#define wxMM_ANISOTROPIC 8
958
959#define wxMM_POINTS 9
960#define wxMM_METRIC 10
961
83624f79 962/* Shortcut for easier dialog-unit-to-pixel conversion */
387a3b02 963#define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
fd71308f 964
2049ba38 965#ifdef __WXMSW__
83624f79
RR
966/* Stand-ins for Windows types, to avoid
967 * #including all of windows.h */
c801d85f
KB
968typedef unsigned long WXHWND;
969typedef unsigned long WXHANDLE;
970typedef unsigned long WXHICON;
971typedef unsigned long WXHFONT;
972typedef unsigned long WXHMENU;
973typedef unsigned long WXHPEN;
974typedef unsigned long WXHBRUSH;
975typedef unsigned long WXHPALETTE;
976typedef unsigned long WXHCURSOR;
977typedef unsigned long WXHRGN;
57a7b7c1 978typedef unsigned long WXHACCEL;
c801d85f
KB
979typedef unsigned long WXHINSTANCE;
980typedef unsigned long WXHBITMAP;
981typedef unsigned long WXHIMAGELIST;
982typedef unsigned long WXHGLOBAL;
983typedef unsigned long WXHDC;
984typedef unsigned int WXUINT;
985typedef unsigned long WXDWORD;
986typedef unsigned short WXWORD;
987typedef unsigned int WXWPARAM;
988typedef long WXLPARAM;
989typedef unsigned long WXCOLORREF;
c801d85f
KB
990typedef void * WXRGNDATA;
991typedef void * WXMSG;
992typedef unsigned long WXHCONV;
0d8d91a9 993typedef unsigned long WXHKEY;
ef366d32 994typedef unsigned long WXHTREEITEM;
c801d85f
KB
995typedef void * WXDRAWITEMSTRUCT;
996typedef void * WXMEASUREITEMSTRUCT;
997typedef void * WXLPCREATESTRUCT;
14b72bf5
JS
998#ifdef __GNUWIN32__
999typedef int (*WXFARPROC)();
1e6d9499 1000#elif defined(__WIN32__)
b039c367 1001typedef int (__stdcall *WXFARPROC)();
1e6d9499
JS
1002#else
1003typedef int (*WXFARPROC)();
14b72bf5 1004#endif
c801d85f
KB
1005
1006#endif
1007
589f0e3e 1008#ifdef __WXMOTIF__
83624f79 1009/* Stand-ins for X/Xt/Motif types */
589f0e3e
JS
1010typedef void* WXWindow;
1011typedef void* WXWidget;
1012typedef void* WXAppContext;
46ccb510 1013typedef void* WXColormap;
589f0e3e
JS
1014typedef void WXDisplay;
1015typedef void WXEvent;
46ccb510 1016typedef void* WXCursor;
50414e24 1017typedef void* WXPixmap;
dfc54541
JS
1018typedef void* WXFontStructPtr;
1019typedef void* WXGC;
1020typedef void* WXRegion;
e97f20a0 1021typedef void* WXFont;
f97c9854
JS
1022typedef void* WXImage;
1023typedef void* WXCursor;
1024typedef void* WXFontList;
589f0e3e
JS
1025#endif
1026
83624f79
RR
1027#ifdef __WXGTK__
1028/* Stand-ins for GLIB types */
1029typedef int gint;
1030typedef unsigned guint;
1031typedef unsigned long gulong;
1032typedef void* gpointer;
1033
1034/* Stand-ins for GDK types */
1035typedef gulong GdkAtom;
1036typedef struct _GdkColor GdkColor;
1037typedef struct _GdkColormap GdkColormap;
1038typedef struct _GdkFont GdkFont;
1039typedef struct _GdkGC GdkGC;
1040typedef struct _GdkWindow GdkWindow;
1041typedef struct _GdkWindow GdkBitmap;
1042typedef struct _GdkWindow GdkPixmap;
1043typedef struct _GdkCursor GdkCursor;
1044typedef struct _GdkRegion GdkRegion;
1045
1046/* Stand-ins for GTK types */
1047typedef struct _GtkWidget GtkWidget;
1048typedef struct _GtkStyle GtkStyle;
1049typedef struct _GtkAdjustment GtkAdjustment;
1050typedef struct _GtkList GtkList;
1051typedef struct _GtkToolbar GtkToolbar;
b1170810 1052typedef struct _GtkTooltips GtkTooltips;
83624f79
RR
1053typedef struct _GtkNotebook GtkNotebook;
1054typedef struct _GtkNotebookPage GtkNotebookPage;
ad5c34f3
JS
1055
1056#endif
1057
1058// This is required because of clashing macros in windows.h, which may be
1059// included before or after wxWindows classes, and therefore must be
1060// disabled here before any significant wxWindows headers are included.
1061#ifdef __WXMSW__
1062#ifdef GetClassInfo
1063#undef GetClassInfo
1064#endif
1065
1066#ifdef GetClassName
1067#undef GetClassName
1068#endif
1069
1070#ifdef DrawText
1071#undef DrawText
1072#endif
1073
1074#ifdef GetCharWidth
1075#undef GetCharWidth
1076#endif
1077
1078#ifdef StartDoc
1079#undef StartDoc
1080#endif
1081
1082#ifdef FindWindow
1083#undef FindWindow
1084#endif
1085
1086#ifdef FindResource
1087#undef FindResource
1088#endif
83624f79 1089#endif
ad5c34f3 1090 // __WXMSW__
83624f79 1091
c801d85f 1092#endif
34138703 1093 // _WX_DEFS_H_