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