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