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