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