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