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