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