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