Coverage Report

Created: 2025-07-23 07:02

/src/wxwidgets/include/wx/defs.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 *  Name:        wx/defs.h
3
 *  Purpose:     Declarations/definitions common to all wx source files
4
 *  Author:      Julian Smart and others
5
 *  Modified by: Ryan Norton (Converted to C)
6
 *  Created:     01/02/97
7
 *  Copyright:   (c) Julian Smart
8
 *  Licence:     wxWindows licence
9
 */
10
11
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
12
13
/*
14
    We want to avoid compilation and, even more perniciously, link errors if
15
    the user code includes <windows.h> before include wxWidgets headers. These
16
    error happen because <windows.h> #define's many common symbols, such as
17
    Yield or GetClassInfo, which are also used in wxWidgets API. Including our
18
    "cleanup" header below un-#defines them to fix this.
19
20
    Moreover, notice that it is also possible for the user code to include some
21
    wx header (this including wx/defs.h), then include <windows.h> and then
22
    include another wx header. To avoid the problem for the second header
23
    inclusion, we must include wx/msw/winundef.h from here always and not just
24
    during the first inclusion, so it has to be outside of _WX_DEFS_H_ guard
25
    check below.
26
 */
27
#ifdef __cplusplus
28
    /*
29
        Test for _WINDOWS_, used as header guard by windows.h itself, not our
30
        own __WINDOWS__, which is not defined yet.
31
     */
32
#   ifdef _WINDOWS_
33
#       include "wx/msw/winundef.h"
34
#   endif /* WIN32 */
35
#endif /* __cplusplus */
36
37
38
#ifndef _WX_DEFS_H_
39
#define _WX_DEFS_H_
40
41
/*  ---------------------------------------------------------------------------- */
42
/*  compiler and OS identification */
43
/*  ---------------------------------------------------------------------------- */
44
45
#include "wx/platform.h"
46
47
#ifdef __cplusplus
48
/*  Make sure the environment is set correctly */
49
#   if defined(__WXMSW__) && defined(__X__)
50
#       error "Target can't be both X and MSW"
51
#   elif !defined(__WXMSW__)   && \
52
         !defined(__WXGTK__)   && \
53
         !defined(__WXOSX_COCOA__)   && \
54
         !defined(__WXOSX_IPHONE__)   && \
55
         !defined(__X__)       && \
56
         !defined(__WXDFB__)   && \
57
         !defined(__WXX11__)   && \
58
         !defined(__WXQT__)    && \
59
          wxUSE_GUI
60
#       ifdef __UNIX__
61
#           error "No Target! You should use wx-config program for compilation flags!"
62
#       else /*  !Unix */
63
#           error "No Target! You should use supplied makefiles for compilation!"
64
#       endif /*  Unix/!Unix */
65
#   endif
66
#endif /*__cplusplus*/
67
68
#ifndef __WXWINDOWS__
69
    #define __WXWINDOWS__ 1
70
#endif
71
72
#ifndef wxUSE_BASE
73
    /*  by default consider that this is a monolithic build */
74
    #define wxUSE_BASE 1
75
#endif
76
77
#if !wxUSE_GUI && !defined(__WXBASE__)
78
    #define __WXBASE__
79
#endif
80
81
/*  suppress some Visual C++ warnings */
82
#ifdef __VISUALC__
83
    /*  the only "real" warning here is 4244 but there are just too many of them */
84
    /*  in our code... one day someone should go and fix them but until then... */
85
#   pragma warning(disable:4244)    /*  conversion from double to float */
86
87
    /*
88
        TODO: this warning should really be enabled as it can be genuinely
89
              useful, check where does it occur in wxWidgets
90
     */
91
    #pragma warning(disable: 4127) /*  conditional expression is constant */
92
93
    /* There are too many false positives for this one, particularly when
94
       using templates like wxVector<T> */
95
    /* class 'foo' needs to have dll-interface to be used by clients of
96
       class 'bar'" */
97
#   pragma warning(disable:4251)
98
99
    /*
100
        This is a similar warning which occurs when deriving from standard
101
        containers. MSDN even mentions that it can be ignored in this case
102
        (albeit only in debug build while the warning is the same in release
103
        too and seems equally harmless).
104
     */
105
#if wxUSE_STD_CONTAINERS
106
#   pragma warning(disable:4275)
107
#endif /* wxUSE_STD_CONTAINERS */
108
    /*
109
       When compiling with VC++ 7 /Wp64 option we get thousands of warnings for
110
       conversion from size_t to int or long. Some precious few of them might
111
       be worth looking into but unfortunately it seems infeasible to fix all
112
       the other, harmless ones (e.g. inserting static_cast<int>(s.length())
113
       everywhere this method is used though we are quite sure that using >4GB
114
       strings is a bad idea anyhow) so just disable it globally for now.
115
     */
116
    /* conversion from 'size_t' to 'unsigned long', possible loss of data */
117
    #pragma warning(disable:4267)
118
119
    /*
120
       VC++ 8 gives a warning when using standard functions such as sprintf,
121
       localtime, ... -- stop this madness, unless the user had already done it
122
     */
123
    #ifndef _CRT_SECURE_NO_DEPRECATE
124
        #define _CRT_SECURE_NO_DEPRECATE 1
125
    #endif
126
    #ifndef _CRT_NON_CONFORMING_SWPRINTFS
127
        #define _CRT_NON_CONFORMING_SWPRINTFS 1
128
    #endif
129
    #ifndef _SCL_SECURE_NO_WARNINGS
130
        #define _SCL_SECURE_NO_WARNINGS 1
131
    #endif
132
#endif /*  __VISUALC__ */
133
134
/*
135
   g++ gives a warning when a class has private dtor if it has no friends but
136
   this is a perfectly valid situation for a ref-counted class which destroys
137
   itself when its ref count drops to 0, so provide a macro to suppress this
138
   warning
139
 */
140
#ifdef __GNUG__
141
#   define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) \
142
        friend class wxDummyFriendFor ## name;
143
#else /* !g++ */
144
#   define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name)
145
#endif
146
147
/* Enable some warnings not enabled by default if requested. */
148
#ifdef wxENABLE_EXTRA_WARNINGS
149
#   ifdef __GNUC__
150
#       pragma GCC diagnostic warning "-Wcast-qual"
151
#       pragma GCC diagnostic warning "-Wdouble-promotion"
152
#       pragma GCC diagnostic warning "-Wextra"
153
#   endif
154
#endif
155
156
/*
157
   Clang Support
158
 */
159
160
#ifndef WX_HAS_CLANG_FEATURE
161
#   ifndef __has_feature
162
#       define WX_HAS_CLANG_FEATURE(x) 0
163
#   else
164
#       define WX_HAS_CLANG_FEATURE(x) __has_feature(x)
165
#   endif
166
#endif
167
168
/* Prevents conflicts between sys/types.h and winsock.h with Cygwin, */
169
/* when using Windows sockets. */
170
#if defined(__CYGWIN__) && defined(__WINDOWS__)
171
#define __USE_W32_SOCKETS
172
#endif
173
174
/*  ---------------------------------------------------------------------------- */
175
/*  wxWidgets version and compatibility defines */
176
/*  ---------------------------------------------------------------------------- */
177
178
#include "wx/version.h"
179
180
/*  ============================================================================ */
181
/*  non portable C++ features */
182
/*  ============================================================================ */
183
184
/*  ---------------------------------------------------------------------------- */
185
/*  C++ version check */
186
/*  ---------------------------------------------------------------------------- */
187
188
#if defined(_MSVC_LANG)
189
/*
190
   We want to always use the really supported C++ standard when using MSVC
191
   recent enough to define _MSVC_LANG, even if /Zc:__cplusplus option is not
192
   used, but unfortunately we can't just redefine __cplusplus as _MSVC_LANG
193
   because this is not allowed by the standard and, worse, doesn't work in
194
   practice (it results in a warning and nothing else).
195
196
   So, instead, we define a macro for testing __cplusplus which also works in
197
   this case.
198
*/
199
    #define wxCHECK_CXX_STD(ver) (_MSVC_LANG >= (ver))
200
#elif defined(__cplusplus)
201
    #define wxCHECK_CXX_STD(ver) (__cplusplus >= (ver))
202
203
    #if !wxCHECK_CXX_STD(201103L)
204
        #error "C++11 compiler is required to build wxWidgets."
205
    #endif
206
#else
207
    #define wxCHECK_CXX_STD(ver) 0
208
#endif
209
210
/**
211
 * C++ header checks
212
 */
213
#if defined(__has_include)
214
    #define wxHAS_CXX17_INCLUDE(header) (wxCHECK_CXX_STD(201703L) && __has_include(header))
215
#else
216
    #define wxHAS_CXX17_INCLUDE(header) 0
217
#endif
218
219
/*  ---------------------------------------------------------------------------- */
220
/*  check for native bool type and TRUE/FALSE constants */
221
/*  ---------------------------------------------------------------------------- */
222
223
/*  for backwards compatibility, also define TRUE and FALSE */
224
/*  */
225
/*  note that these definitions should work both in C++ and C code, so don't */
226
/*  use true/false below */
227
#ifndef TRUE
228
    #define TRUE 1
229
#endif
230
231
#ifndef FALSE
232
    #define FALSE 0
233
#endif
234
235
typedef short int WXTYPE;
236
237
238
/*  ---------------------------------------------------------------------------- */
239
/*  other feature tests */
240
/*  ---------------------------------------------------------------------------- */
241
242
#ifdef __cplusplus
243
244
/*  Every ride down a slippery slope begins with a single step.. */
245
/*  */
246
/*  Yes, using nested classes is indeed against our coding standards in */
247
/*  general, but there are places where you can use them to advantage */
248
/*  without totally breaking ports that cannot use them.  If you do, then */
249
/*  wrap it in this guard, but such cases should still be relatively rare. */
250
#define wxUSE_NESTED_CLASSES    1
251
252
/*
253
    These macros are obsolete, use the corresponding C++ keywords directly in
254
    the new code.
255
 */
256
#define wxEXPLICIT explicit
257
#define wxOVERRIDE override
258
#define wxNOEXCEPT noexcept
259
260
/* More macros only remaining defined for compatibility */
261
#define wxHAS_MEMBER_DEFAULT
262
#define wxHAS_NOEXCEPT
263
#define wxHAS_NULLPTR_T
264
265
/* wxFALLTHROUGH is used to notate explicit fallthroughs in switch statements */
266
267
#if wxCHECK_CXX_STD(201703L)
268
0
    #define wxFALLTHROUGH [[fallthrough]]
269
#elif defined(__has_warning) && WX_HAS_CLANG_FEATURE(cxx_attributes)
270
    #define wxFALLTHROUGH [[clang::fallthrough]]
271
#elif wxCHECK_GCC_VERSION(7, 0)
272
    #define wxFALLTHROUGH __attribute__ ((fallthrough))
273
#endif
274
275
#ifndef wxFALLTHROUGH
276
    #define wxFALLTHROUGH ((void)0)
277
#endif
278
279
/* wxNODISCARD is used to indicate that the function return value must not be ignored */
280
281
#if wxCHECK_CXX_STD(201703L)
282
    #define wxNODISCARD [[nodiscard]]
283
#elif defined(__VISUALC__)
284
    #define wxNODISCARD _Check_return_
285
#elif defined(__clang__) || defined(__GNUC__)
286
    #define wxNODISCARD __attribute__ ((warn_unused_result))
287
#else
288
    #define wxNODISCARD
289
#endif
290
291
/* wxWARN_UNUSED is used as an attribute to a class, stating that unused instances
292
   should be warned about (in case such warnings are enabled in the first place) */
293
294
#ifdef __has_attribute /* __has_cpp_attribute(warn_unused) would return false with Clang, */
295
    #if __has_attribute(warn_unused) /* so use __has_attribute instead */
296
        #define wxWARN_UNUSED __attribute__((warn_unused))
297
    #endif
298
#endif
299
#ifndef wxWARN_UNUSED
300
    #define wxWARN_UNUSED
301
#endif
302
303
/* these macros are obsolete, use the standard C++ casts directly now */
304
#define wx_static_cast(t, x) static_cast<t>(x)
305
#define wx_const_cast(t, x) const_cast<t>(x)
306
#define wx_reinterpret_cast(t, x) reinterpret_cast<t>(x)
307
308
/*
309
   This one is a wx invention: like static cast but used when we intentionally
310
   truncate from a larger to smaller type, static_cast<> can't be used for it
311
   as it results in warnings when using some compilers (SGI mipspro for example)
312
 */
313
#if defined(__INTELC__)
314
    template <typename T, typename X>
315
    inline T wx_truncate_cast_impl(X x)
316
    {
317
        #pragma warning(push)
318
        /* implicit conversion of a 64-bit integral type to a smaller integral type */
319
        #pragma warning(disable: 1682)
320
        /* conversion from "X" to "T" may lose significant bits */
321
        #pragma warning(disable: 810)
322
        /* non-pointer conversion from "foo" to "bar" may lose significant bits */
323
        #pragma warning(disable: 2259)
324
325
        return x;
326
327
        #pragma warning(pop)
328
    }
329
330
    #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
331
332
#elif defined(__clang__)
333
37.7k
    #define wx_truncate_cast(t, x) static_cast<t>(x)
334
335
#elif defined(__VISUALC__)
336
    template <typename T, typename X>
337
    inline T wx_truncate_cast_impl(X x)
338
    {
339
        #pragma warning(push)
340
        /* conversion from 'size_t' to 'type', possible loss of data */
341
        #pragma warning(disable: 4267)
342
        /* conversion from 'type1' to 'type2', possible loss of data */
343
        #pragma warning(disable: 4242)
344
345
        return x;
346
347
        #pragma warning(pop)
348
    }
349
350
    #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
351
#else
352
    #define wx_truncate_cast(t, x) ((t)(x))
353
#endif
354
355
/* for consistency with wxStatic/DynamicCast defined in wx/object.h */
356
0
#define wxConstCast(obj, className) const_cast<className *>(obj)
357
358
/* Poor man's version of C++20 std::ssize(). */
359
template <class C>
360
int wxSsize(const C& c)
361
{
362
    return static_cast<int>(c.size());
363
}
364
365
#endif /* __cplusplus */
366
367
/* provide replacement for C99 va_copy() if the compiler doesn't have it */
368
369
/* could be already defined by configure or the user */
370
#ifndef wxVaCopy
371
    /* if va_copy is a macro or configure detected that we have it, use it */
372
    #if defined(va_copy) || defined(HAVE_VA_COPY)
373
0
        #define wxVaCopy va_copy
374
    #else /* no va_copy, try to provide a replacement */
375
        /*
376
           configure tries to determine whether va_list is an array or struct
377
           type, but it may not be used under Windows, so deal with a few
378
           special cases.
379
         */
380
381
        #if defined(__PPC__) && (defined(_CALL_SYSV) || defined (_WIN32))
382
            /*
383
                PPC using SysV ABI and NT/PPC are special in that they use an
384
                extra level of indirection.
385
             */
386
            #define VA_LIST_IS_POINTER
387
        #endif /* SysV or Win32 on __PPC__ */
388
389
        /*
390
            note that we use memmove(), not memcpy(), in case anybody tries
391
            to do wxVaCopy(ap, ap)
392
         */
393
        #if defined(VA_LIST_IS_POINTER)
394
            #define wxVaCopy(d, s)  memmove(*(d), *(s), sizeof(va_list))
395
        #elif defined(VA_LIST_IS_ARRAY)
396
            #define wxVaCopy(d, s) memmove((d), (s), sizeof(va_list))
397
        #else /* we can only hope that va_lists are simple lvalues */
398
            #define wxVaCopy(d, s) ((d) = (s))
399
        #endif
400
    #endif /* va_copy/!va_copy */
401
#endif /* wxVaCopy */
402
403
#ifndef HAVE_WOSTREAM
404
    /*
405
        Cygwin is the only platform which doesn't have std::wostream
406
     */
407
    #if !defined(__CYGWIN__)
408
        #define HAVE_WOSTREAM
409
    #endif
410
#endif /* HAVE_WOSTREAM */
411
412
/*  ---------------------------------------------------------------------------- */
413
/*  portable calling conventions macros */
414
/*  ---------------------------------------------------------------------------- */
415
416
/*  stdcall is used for all functions called by Windows under Windows */
417
#if defined(__WINDOWS__)
418
    #if defined(__GNUWIN32__)
419
        #define wxSTDCALL __attribute__((stdcall))
420
    #else
421
        #define wxSTDCALL _stdcall
422
    #endif
423
424
#else /*  Win */
425
    /*  no such stupidness under Unix */
426
    #define wxSTDCALL
427
#endif /*  platform */
428
429
/*  LINKAGEMODE mode is most likely empty everywhere */
430
#ifndef LINKAGEMODE
431
    #define LINKAGEMODE
432
#endif /*  LINKAGEMODE */
433
434
/*  wxCALLBACK should be used for the functions which are called back by */
435
/*  Windows (such as compare function for wxListCtrl) */
436
#if defined(__WIN32__)
437
    #define wxCALLBACK wxSTDCALL
438
#else
439
    /*  no stdcall under Unix nor Win16 */
440
    #define wxCALLBACK
441
#endif /*  platform */
442
443
/*  generic calling convention for the extern "C" functions */
444
445
#if defined(__VISUALC__)
446
  #define   wxC_CALLING_CONV    _cdecl
447
#else   /*  !Visual C++ */
448
  #define   wxC_CALLING_CONV
449
#endif  /*  compiler */
450
451
/*  calling convention for the qsort(3) callback */
452
#define wxCMPFUNC_CONV wxC_CALLING_CONV
453
454
/*  compatibility :-( */
455
#define CMPFUNC_CONV wxCMPFUNC_CONV
456
457
/*  DLL import/export declarations */
458
#include "wx/dlimpexp.h"
459
460
/*  ---------------------------------------------------------------------------- */
461
/*  Very common macros */
462
/*  ---------------------------------------------------------------------------- */
463
464
/* Printf-like attribute definitions which could be used to obtain warnings
465
   with GNU C/C++ but unfortunately don't work any longer
466
467
   TODO: make this work with Unicode functions
468
469
#if defined(__GNUC__)
470
#    define WX_ATTRIBUTE_FORMAT(like, m, n) __attribute__ ((__format__ (like, m, n)))
471
#else
472
*/
473
474
#define WX_ATTRIBUTE_FORMAT(like, m, n)
475
476
#ifndef WX_ATTRIBUTE_PRINTF
477
#   define WX_ATTRIBUTE_PRINTF(m, n) WX_ATTRIBUTE_FORMAT(__printf__, m, n)
478
479
#   define WX_ATTRIBUTE_PRINTF_1 WX_ATTRIBUTE_PRINTF(1, 2)
480
#   define WX_ATTRIBUTE_PRINTF_2 WX_ATTRIBUTE_PRINTF(2, 3)
481
#   define WX_ATTRIBUTE_PRINTF_3 WX_ATTRIBUTE_PRINTF(3, 4)
482
#   define WX_ATTRIBUTE_PRINTF_4 WX_ATTRIBUTE_PRINTF(4, 5)
483
#   define WX_ATTRIBUTE_PRINTF_5 WX_ATTRIBUTE_PRINTF(5, 6)
484
#endif /* !defined(WX_ATTRIBUTE_PRINTF) */
485
486
#ifndef WX_ATTRIBUTE_NORETURN
487
#   if WX_HAS_CLANG_FEATURE(attribute_analyzer_noreturn)
488
#       define WX_ATTRIBUTE_NORETURN __attribute__((analyzer_noreturn))
489
#   elif defined( __GNUC__ )
490
#       define WX_ATTRIBUTE_NORETURN __attribute__ ((noreturn))
491
#   elif defined(__VISUALC__)
492
#       define WX_ATTRIBUTE_NORETURN __declspec(noreturn)
493
#   else
494
#       define WX_ATTRIBUTE_NORETURN
495
#   endif
496
#endif
497
498
#if defined(__GNUC__)
499
    #define WX_ATTRIBUTE_UNUSED __attribute__ ((unused))
500
#else
501
    #define WX_ATTRIBUTE_UNUSED
502
#endif
503
504
/*
505
    Macros for marking functions as being deprecated.
506
507
    The preferred macro in the new code is wxDEPRECATED_ATTR() which expands to
508
    the standard [[deprecated]] attribute if supported and allows to explain
509
    why is the function deprecated. If supporting older compilers is important,
510
    wxDEPRECATED_MSG() can be used as it's almost universally available and
511
    still allows to explain the reason for the deprecation.
512
513
    However almost all the existing code uses the older wxDEPRECATED() or its
514
    variants currently, but this will hopefully change in the future.
515
 */
516
517
#if defined(__has_cpp_attribute)
518
    #if __has_cpp_attribute(deprecated)
519
        /* gcc 5 claims to support this attribute, but actually doesn't */
520
        #if !defined(__GNUC__) || wxCHECK_GCC_VERSION(6, 0)
521
            #define wxHAS_DEPRECATED_ATTR
522
        #endif
523
    #endif
524
#endif
525
526
/* The basic compiler-specific construct to generate a deprecation warning. */
527
#ifdef wxHAS_DEPRECATED_ATTR
528
    #define wxDEPRECATED_DECL [[deprecated]]
529
#elif defined(__clang__)
530
    #define wxDEPRECATED_DECL __attribute__((deprecated))
531
#elif defined(__GNUC__)
532
    #define wxDEPRECATED_DECL __attribute__((deprecated))
533
#elif defined(__VISUALC__)
534
    #define wxDEPRECATED_DECL __declspec(deprecated)
535
#else
536
    #define wxDEPRECATED_DECL
537
#endif
538
539
#ifdef wxHAS_DEPRECATED_ATTR
540
    #define wxDEPRECATED_ATTR(msg) [[deprecated(msg)]]
541
#else
542
    /*
543
        Note that we can't fall back on wxDEPRECATED_DECL here, as the standard
544
        attribute works in places where the compiler-specific one don't,
545
        notably it can be used after enumerator declaration with MSVC, while
546
        __declspec(deprecated) can't occur there as it can only be used before
547
        the declaration.
548
     */
549
    #define wxDEPRECATED_ATTR(msg)
550
#endif
551
552
/*
553
    Macro taking the deprecation message. It applies to the next declaration.
554
555
    If the compiler doesn't support showing the message, this degrades to a
556
    simple wxDEPRECATED(), i.e. at least gives a warning, if possible.
557
 */
558
#ifdef wxHAS_DEPRECATED_ATTR
559
    #define wxDEPRECATED_MSG(msg) [[deprecated(msg)]]
560
#elif defined(__clang__) && defined(__has_extension)
561
    #if __has_extension(attribute_deprecated_with_message)
562
        #define wxDEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
563
    #else
564
        #define wxDEPRECATED_MSG(msg) __attribute__((deprecated))
565
    #endif
566
#elif defined(__GNUC__)
567
    #define wxDEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
568
#elif defined(__VISUALC__)
569
    #define wxDEPRECATED_MSG(msg) __declspec(deprecated("deprecated: " msg))
570
#else
571
    #define wxDEPRECATED_MSG(msg) wxDEPRECATED_DECL
572
#endif
573
574
/*
575
    Macro taking the declaration that it deprecates. Prefer to use
576
    wxDEPRECATED_MSG() instead as it's simpler (wrapping the entire declaration
577
    makes the code unclear) and allows to specify the explanation.
578
 */
579
#define wxDEPRECATED(x) wxDEPRECATED_DECL x
580
581
/*
582
    This macro used to be defined differently for gcc < 3.4, but we don't
583
    support it any more, so it's just the same thing as wxDEPRECATED now.
584
 */
585
#define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED(x)
586
587
/*
588
   Macro which marks the function as being deprecated but also defines it
589
   inline.
590
591
   Currently it's defined in the same trivial way in all cases but it could
592
   need a special definition with some other compilers in the future which
593
   explains why do we have it.
594
 */
595
#define wxDEPRECATED_INLINE(func, body) wxDEPRECATED(func) { body }
596
597
/*
598
    A macro to define a simple deprecated accessor.
599
 */
600
#define wxDEPRECATED_ACCESSOR(func, what) wxDEPRECATED_INLINE(func, return what;)
601
602
/*
603
   Special variant of the macros above which should be used for the functions
604
   which are deprecated but called by wx itself: this often happens with
605
   deprecated virtual functions which are called by the library.
606
 */
607
#ifdef WXBUILDING
608
#   define wxDEPRECATED_BUT_USED_INTERNALLY(x) x
609
#   define wxDEPRECATED_BUT_USED_INTERNALLY_MSG(x)
610
#else
611
#   define wxDEPRECATED_BUT_USED_INTERNALLY(x) wxDEPRECATED(x)
612
#   define wxDEPRECATED_BUT_USED_INTERNALLY_MSG(x) wxDEPRECATED_MSG(x)
613
#endif
614
615
/*
616
    Some gcc versions choke on __has_cpp_attribute(gnu::visibility) due to the
617
    presence of the colon, but we only need this macro in C++ code, so just
618
    don't define it when using C.
619
 */
620
#ifdef __cplusplus
621
622
/*
623
    wxDEPRECATED_EXPORT_CORE is a special macro used for the classes that are
624
    exported and deprecated (but not when building the library itself, as this
625
    would trigger warnings about using this class when implementing it).
626
627
    It exists because standard [[deprecated]] attribute can't be combined with
628
    legacy __attribute__((visibility)), but we can't use [[visibility]] instead
629
    of the latter because it can't be use in the same place in the declarations
630
    where we use WXDLLIMPEXP_CORE. So we define this special macro which uses
631
    the standard visibility attribute just where we can't do otherwise.
632
 */
633
#ifdef WXBUILDING
634
    #define wxDEPRECATED_EXPORT_CORE(msg) WXDLLIMPEXP_CORE
635
#else /* !WXBUILDING */
636
    #ifdef wxHAS_DEPRECATED_ATTR
637
        #if __has_cpp_attribute(gnu::visibility)
638
            #define wxDEPRECATED_EXPORT_CORE(msg) \
639
                [[deprecated(msg), gnu::visibility("default")]]
640
        #endif
641
    #endif
642
643
    #ifndef wxDEPRECATED_EXPORT_CORE
644
        /* Fall back when nothing special is needed or available. */
645
        #define wxDEPRECATED_EXPORT_CORE(msg) \
646
            wxDEPRECATED_MSG(msg) WXDLLIMPEXP_CORE
647
    #endif
648
#endif /* WXBUILDING/!WXBUILDING */
649
650
#endif /* __cplusplus */
651
652
/*
653
   Macros to suppress and restore gcc warnings, requires g++ >= 4.6 and don't
654
   do anything otherwise.
655
656
   Example of use:
657
658
        wxGCC_WARNING_SUPPRESS(float-equal)
659
        inline bool wxIsSameDouble(double x, double y) { return x == y; }
660
        wxGCC_WARNING_RESTORE(float-equal)
661
662
   Note that these macros apply to both gcc and clang, even though they only
663
   have "GCC" in their names.
664
 */
665
#if defined(__clang__) || defined(__GNUC__)
666
#   define wxGCC_WARNING_SUPPRESS(x) \
667
        _Pragma (wxSTRINGIZE(GCC diagnostic push)) \
668
        _Pragma (wxSTRINGIZE(GCC diagnostic ignored wxSTRINGIZE(wxCONCAT(-W,x))))
669
#   define wxGCC_WARNING_RESTORE(x) \
670
       _Pragma (wxSTRINGIZE(GCC diagnostic pop))
671
#else /* gcc < 4.6 or not gcc and not clang at all */
672
#   define wxGCC_WARNING_SUPPRESS(x)
673
#   define wxGCC_WARNING_RESTORE(x)
674
#endif
675
676
/*
677
    Similar macros but for gcc-specific warnings.
678
 */
679
#if defined(__GNUC__) && !defined(__clang__)
680
#   define wxGCC_ONLY_WARNING_SUPPRESS(x) wxGCC_WARNING_SUPPRESS(x)
681
#   define wxGCC_ONLY_WARNING_RESTORE(x) wxGCC_WARNING_RESTORE(x)
682
#else
683
#   define wxGCC_ONLY_WARNING_SUPPRESS(x)
684
#   define wxGCC_ONLY_WARNING_RESTORE(x)
685
#endif
686
687
/* Specific macros for -Wcast-function-type warning new in gcc 8. */
688
#if wxCHECK_GCC_VERSION(8, 0)
689
    #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() \
690
        wxGCC_WARNING_SUPPRESS(cast-function-type)
691
    #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() \
692
        wxGCC_WARNING_RESTORE(cast-function-type)
693
#else
694
    #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE()
695
    #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE()
696
#endif
697
698
/*
699
   Macros to suppress and restore clang warning only when it is valid.
700
701
   Example:
702
        wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override)
703
        virtual wxClassInfo *GetClassInfo() const
704
        wxCLANG_WARNING_RESTORE(inconsistent-missing-override)
705
*/
706
#if defined(__clang__) && defined(__has_warning)
707
#    define wxCLANG_HAS_WARNING(x) __has_warning(x) /* allow macro expansion for the warning name */
708
#    define wxCLANG_IF_VALID_WARNING(x,y) \
709
         wxCONCAT(wxCLANG_IF_VALID_WARNING_,wxCLANG_HAS_WARNING(wxSTRINGIZE(wxCONCAT(-W,x))))(y)
710
#    define wxCLANG_IF_VALID_WARNING_0(x)
711
#    define wxCLANG_IF_VALID_WARNING_1(x) x
712
#    define wxCLANG_WARNING_SUPPRESS(x) \
713
         wxCLANG_IF_VALID_WARNING(x,wxGCC_WARNING_SUPPRESS(x))
714
#    define wxCLANG_WARNING_RESTORE(x) \
715
         wxCLANG_IF_VALID_WARNING(x,wxGCC_WARNING_RESTORE(x))
716
#else
717
#    define wxCLANG_WARNING_SUPPRESS(x)
718
#    define wxCLANG_WARNING_RESTORE(x)
719
#endif
720
721
/*
722
    Specific macro for disabling warnings related to not using override: this
723
    has to be done differently for gcc and clang and is only supported since
724
    gcc 5.1.
725
 */
726
#if defined(__clang__)
727
#   define wxWARNING_SUPPRESS_MISSING_OVERRIDE() \
728
        wxCLANG_WARNING_SUPPRESS(suggest-override) \
729
        wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override)
730
#   define wxWARNING_RESTORE_MISSING_OVERRIDE() \
731
        wxCLANG_WARNING_RESTORE(inconsistent-missing-override) \
732
        wxCLANG_WARNING_RESTORE(suggest-override)
733
#elif wxCHECK_GCC_VERSION(5, 1)
734
#   define wxWARNING_SUPPRESS_MISSING_OVERRIDE() \
735
        wxGCC_WARNING_SUPPRESS(suggest-override)
736
#   define wxWARNING_RESTORE_MISSING_OVERRIDE() \
737
        wxGCC_WARNING_RESTORE(suggest-override)
738
#else
739
#   define wxWARNING_SUPPRESS_MISSING_OVERRIDE()
740
#   define wxWARNING_RESTORE_MISSING_OVERRIDE()
741
#endif
742
743
/*
744
    Macros above don't work with gcc 11 due to a compiler bug, unless we also
745
    use "override" in the function declaration -- but this breaks other
746
    compilers, so define a specific macro for gcc 11 only.
747
 */
748
#if wxCHECK_GCC_VERSION(11, 0)
749
#   define wxDUMMY_OVERRIDE wxOVERRIDE
750
#else
751
#   define wxDUMMY_OVERRIDE
752
#endif
753
754
/*
755
    Combination of the two variants above: should be used for deprecated
756
    functions which are defined inline and are used by wxWidgets itself.
757
 */
758
#ifdef WXBUILDING
759
#   define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) func { body }
760
#else
761
#   define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) \
762
        wxDEPRECATED(func) { body }
763
#endif
764
765
/* Get size_t declaration. */
766
#include <stddef.h>
767
768
/*  size of statically declared array */
769
6
#define WXSIZEOF(array)   (sizeof(array)/sizeof(array[0]))
770
771
/*  symbolic constant used by all Find()-like functions returning positive */
772
/*  integer on success as failure indicator */
773
8
#define wxNOT_FOUND       (-1)
774
775
/* the default value for some length parameters meaning that the string is */
776
/* NUL-terminated */
777
13.4M
#define wxNO_LEN ((size_t)-1)
778
779
/*  ---------------------------------------------------------------------------- */
780
/*  macros dealing with comparison operators */
781
/*  ---------------------------------------------------------------------------- */
782
783
/*
784
    Expands into m(op, args...) for each op in the set { ==, !=, <, <=, >, >= }.
785
 */
786
#define wxFOR_ALL_COMPARISONS(m) \
787
    m(==) m(!=) m(>=) m(<=) m(>) m(<)
788
789
#define wxFOR_ALL_COMPARISONS_1(m, x) \
790
    m(==,x) m(!=,x) m(>=,x) m(<=,x) m(>,x) m(<,x)
791
792
#define wxFOR_ALL_COMPARISONS_2(m, x, y) \
793
    m(==,x,y) m(!=,x,y) m(>=,x,y) m(<=,x,y) m(>,x,y) m(<,x,y)
794
795
#define wxFOR_ALL_COMPARISONS_3(m, x, y, z) \
796
    m(==,x,y,z) m(!=,x,y,z) m(>=,x,y,z) m(<=,x,y,z) m(>,x,y,z) m(<,x,y,z)
797
798
/*
799
    These are only used with wxDEFINE_COMPARISON_[BY_]REV: they pass both the
800
    normal and the reversed comparison operators to the macro.
801
 */
802
#define wxFOR_ALL_COMPARISONS_2_REV(m, x, y) \
803
    m(==,x,y,==) m(!=,x,y,!=) m(>=,x,y,<=) \
804
    m(<=,x,y,>=) m(>,x,y,<) m(<,x,y,>)
805
806
#define wxFOR_ALL_COMPARISONS_3_REV(m, x, y, z) \
807
    m(==,x,y,z,==) m(!=,x,y,z,!=) m(>=,x,y,z,<=) \
808
    m(<=,x,y,z,>=) m(>,x,y,z,<) m(<,x,y,z,>)
809
810
811
#define wxDEFINE_COMPARISON(op, T1, T2, cmp) \
812
0
    friend bool operator op(T1 x, T2 y) { return cmp(x, y, op); }
Unexecuted instantiation: operator==(wchar_t const*, wxCStrData const&)
Unexecuted instantiation: operator!=(wchar_t const*, wxCStrData const&)
Unexecuted instantiation: operator>=(wchar_t const*, wxCStrData const&)
Unexecuted instantiation: operator<=(wchar_t const*, wxCStrData const&)
Unexecuted instantiation: operator>(wchar_t const*, wxCStrData const&)
Unexecuted instantiation: operator<(wchar_t const*, wxCStrData const&)
Unexecuted instantiation: operator==(char const*, wxCStrData const&)
Unexecuted instantiation: operator!=(char const*, wxCStrData const&)
Unexecuted instantiation: operator>=(char const*, wxCStrData const&)
Unexecuted instantiation: operator<=(char const*, wxCStrData const&)
Unexecuted instantiation: operator>(char const*, wxCStrData const&)
Unexecuted instantiation: operator<(char const*, wxCStrData const&)
Unexecuted instantiation: operator==(wchar_t const*, wxString const&)
Unexecuted instantiation: operator!=(wchar_t const*, wxString const&)
Unexecuted instantiation: operator>=(wchar_t const*, wxString const&)
Unexecuted instantiation: operator<=(wchar_t const*, wxString const&)
Unexecuted instantiation: operator>(wchar_t const*, wxString const&)
Unexecuted instantiation: operator<(wchar_t const*, wxString const&)
Unexecuted instantiation: operator==(char const*, wxString const&)
Unexecuted instantiation: operator!=(char const*, wxString const&)
Unexecuted instantiation: operator>=(char const*, wxString const&)
Unexecuted instantiation: operator<=(char const*, wxString const&)
Unexecuted instantiation: operator>(char const*, wxString const&)
Unexecuted instantiation: operator<(char const*, wxString const&)
813
814
#define wxDEFINE_COMPARISON_REV(op, T1, T2, cmp, oprev) \
815
49.9k
    friend bool operator op(T2 y, T1 x) { return cmp(x, y, oprev); }
Unexecuted instantiation: operator==(wxCStrData const&, wchar_t const*)
Unexecuted instantiation: operator!=(wxCStrData const&, wchar_t const*)
Unexecuted instantiation: operator>=(wxCStrData const&, wchar_t const*)
Unexecuted instantiation: operator<=(wxCStrData const&, wchar_t const*)
Unexecuted instantiation: operator>(wxCStrData const&, wchar_t const*)
Unexecuted instantiation: operator<(wxCStrData const&, wchar_t const*)
Unexecuted instantiation: operator==(wxCStrData const&, char const*)
Unexecuted instantiation: operator!=(wxCStrData const&, char const*)
Unexecuted instantiation: operator>=(wxCStrData const&, char const*)
Unexecuted instantiation: operator<=(wxCStrData const&, char const*)
Unexecuted instantiation: operator>(wxCStrData const&, char const*)
Unexecuted instantiation: operator<(wxCStrData const&, char const*)
operator==(wxString const&, wchar_t const*)
Line
Count
Source
815
49.9k
    friend bool operator op(T2 y, T1 x) { return cmp(x, y, oprev); }
Unexecuted instantiation: operator!=(wxString const&, wchar_t const*)
Unexecuted instantiation: operator>=(wxString const&, wchar_t const*)
Unexecuted instantiation: operator<=(wxString const&, wchar_t const*)
Unexecuted instantiation: operator>(wxString const&, wchar_t const*)
Unexecuted instantiation: operator<(wxString const&, wchar_t const*)
Unexecuted instantiation: operator==(wxString const&, char const*)
Unexecuted instantiation: operator!=(wxString const&, char const*)
Unexecuted instantiation: operator>=(wxString const&, char const*)
Unexecuted instantiation: operator<=(wxString const&, char const*)
Unexecuted instantiation: operator>(wxString const&, char const*)
Unexecuted instantiation: operator<(wxString const&, char const*)
816
817
#define wxDEFINE_COMPARISON_BY_REV(op, T1, T2, oprev) \
818
0
    friend bool operator op(T1 x, T2 y) { return y oprev x; }
Unexecuted instantiation: operator==(char, wxUniChar const&)
Unexecuted instantiation: operator!=(char, wxUniChar const&)
Unexecuted instantiation: operator>=(char, wxUniChar const&)
Unexecuted instantiation: operator<=(char, wxUniChar const&)
Unexecuted instantiation: operator>(char, wxUniChar const&)
Unexecuted instantiation: operator<(char, wxUniChar const&)
Unexecuted instantiation: operator==(wchar_t, wxUniChar const&)
Unexecuted instantiation: operator!=(wchar_t, wxUniChar const&)
Unexecuted instantiation: operator>=(wchar_t, wxUniChar const&)
Unexecuted instantiation: operator<=(wchar_t, wxUniChar const&)
Unexecuted instantiation: operator>(wchar_t, wxUniChar const&)
Unexecuted instantiation: operator<(wchar_t, wxUniChar const&)
Unexecuted instantiation: operator==(char, wxUniCharRef const&)
Unexecuted instantiation: operator!=(char, wxUniCharRef const&)
Unexecuted instantiation: operator>=(char, wxUniCharRef const&)
Unexecuted instantiation: operator<=(char, wxUniCharRef const&)
Unexecuted instantiation: operator>(char, wxUniCharRef const&)
Unexecuted instantiation: operator<(char, wxUniCharRef const&)
Unexecuted instantiation: operator==(wchar_t, wxUniCharRef const&)
Unexecuted instantiation: operator!=(wchar_t, wxUniCharRef const&)
Unexecuted instantiation: operator>=(wchar_t, wxUniCharRef const&)
Unexecuted instantiation: operator<=(wchar_t, wxUniCharRef const&)
Unexecuted instantiation: operator>(wchar_t, wxUniCharRef const&)
Unexecuted instantiation: operator<(wchar_t, wxUniCharRef const&)
Unexecuted instantiation: operator==(wxUniChar const&, wxUniCharRef const&)
Unexecuted instantiation: operator!=(wxUniChar const&, wxUniCharRef const&)
Unexecuted instantiation: operator>=(wxUniChar const&, wxUniCharRef const&)
Unexecuted instantiation: operator<=(wxUniChar const&, wxUniCharRef const&)
Unexecuted instantiation: operator>(wxUniChar const&, wxUniCharRef const&)
Unexecuted instantiation: operator<(wxUniChar const&, wxUniCharRef const&)
819
820
/*
821
    Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given
822
    types in the specified order. The implementation is provided by the cmp
823
    macro. Normally wxDEFINE_ALL_COMPARISONS should be used as comparison
824
    operators are usually symmetric.
825
826
    Note that comparison operators are defined as hidden friends and so this
827
    macro can only be used inside the class declaration.
828
 */
829
#define wxDEFINE_COMPARISONS(T1, T2, cmp) \
830
    wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp)
831
832
/*
833
    Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given
834
    types in the specified order, implemented in terms of existing operators
835
    for the reverse order.
836
837
    Note that comparison operators are defined as hidden friends and so this
838
    macro can only be used inside the class declaration.
839
 */
840
#define wxDEFINE_COMPARISONS_BY_REV(T1, T2) \
841
    wxFOR_ALL_COMPARISONS_2_REV(wxDEFINE_COMPARISON_BY_REV, T1, T2)
842
843
/*
844
    This macro allows to define all 12 comparison operators (6 operators for
845
    both orders of arguments) for the given types using the provided "cmp"
846
    macro to implement the actual comparison: the macro is called with the 2
847
    arguments names, the first of type T1 and the second of type T2, and the
848
    comparison operator being implemented.
849
 */
850
#define wxDEFINE_ALL_COMPARISONS(T1, T2, cmp) \
851
    wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp) \
852
    wxFOR_ALL_COMPARISONS_3_REV(wxDEFINE_COMPARISON_REV, T1, T2, cmp)
853
854
/*  ---------------------------------------------------------------------------- */
855
/*  macros to avoid compiler warnings */
856
/*  ---------------------------------------------------------------------------- */
857
858
/*  Macro to cut down on compiler warnings. */
859
#if 1 /*  there should be no more any compilers needing the "#else" version */
860
    #define WXUNUSED(identifier) /* identifier */
861
#else  /*  stupid, broken compiler */
862
    #define WXUNUSED(identifier) identifier
863
#endif
864
865
/* Defined for compatibility only. */
866
#define WXUNUSED_IN_UNICODE(param)  WXUNUSED(param)
867
868
/*  unused parameters in non stream builds */
869
#if wxUSE_STREAMS
870
    #define WXUNUSED_UNLESS_STREAMS(param)  param
871
#else
872
    #define WXUNUSED_UNLESS_STREAMS(param)  WXUNUSED(param)
873
#endif
874
875
/*  some compilers give warning about a possibly unused variable if it is */
876
/*  initialized in both branches of if/else and shut up if it is initialized */
877
/*  when declared, but other compilers then give warnings about unused variable */
878
/*  value -- this should satisfy both of them */
879
#if defined(__VISUALC__)
880
    #define wxDUMMY_INITIALIZE(val) = val
881
#else
882
    #define wxDUMMY_INITIALIZE(val)
883
#endif
884
885
/*  sometimes the value of a variable is *really* not used, to suppress  the */
886
/*  resulting warning you may pass it to this function */
887
#ifdef __cplusplus
888
    template <class T>
889
0
        inline void wxUnusedVar(const T& WXUNUSED(t)) { }
Unexecuted instantiation: void wxUnusedVar<wxString>(wxString const&)
Unexecuted instantiation: void wxUnusedVar<wxArrayString>(wxArrayString const&)
Unexecuted instantiation: void wxUnusedVar<wxAnyValueBuffer>(wxAnyValueBuffer const&)
Unexecuted instantiation: void wxUnusedVar<wxAnyValueType*>(wxAnyValueType* const&)
Unexecuted instantiation: void wxUnusedVar<wxDateTime const*>(wxDateTime const* const&)
Unexecuted instantiation: void wxUnusedVar<wxLogRecordInfo>(wxLogRecordInfo const&)
Unexecuted instantiation: void wxUnusedVar<int>(int const&)
Unexecuted instantiation: void wxUnusedVar<unsigned long>(unsigned long const&)
Unexecuted instantiation: void wxUnusedVar<wxEvent>(wxEvent const&)
Unexecuted instantiation: void wxUnusedVar<wxMessageOutputFlags>(wxMessageOutputFlags const&)
Unexecuted instantiation: void wxUnusedVar<wxMBConv>(wxMBConv const&)
890
#endif
891
892
/*  ---------------------------------------------------------------------------- */
893
/*  compiler specific settings */
894
/*  ---------------------------------------------------------------------------- */
895
896
#include "wx/types.h"
897
898
#ifdef __cplusplus
899
900
// everybody gets the assert and other debug macros
901
#include "wx/debug.h"
902
903
    // delete pointer if it is not null and null it afterwards
904
    template <typename T>
905
    inline void wxDELETE(T*& ptr)
906
0
    {
907
0
        typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
908
909
0
        if ( ptr != nullptr )
910
0
        {
911
0
            delete ptr;
912
0
            ptr = nullptr;
913
0
        }
914
0
    }
Unexecuted instantiation: void wxDELETE<wxEventLoopBase>(wxEventLoopBase*&)
Unexecuted instantiation: void wxDELETE<wxHashTable>(wxHashTable*&)
Unexecuted instantiation: void wxDELETE<wxMBConv>(wxMBConv*&)
Unexecuted instantiation: void wxDELETE<wxXLocale>(wxXLocale*&)
Unexecuted instantiation: void wxDELETE<z_stream_s>(z_stream_s*&)
Unexecuted instantiation: void wxDELETE<wxList>(wxList*&)
Unexecuted instantiation: void wxDELETE<wxArrayInt>(wxArrayInt*&)
Unexecuted instantiation: void wxDELETE<wxFDIODispatcher>(wxFDIODispatcher*&)
915
916
    // delete an array and null it (see comments above)
917
    template <typename T>
918
    inline void wxDELETEA(T*& ptr)
919
0
    {
920
0
        typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
921
922
0
        if ( ptr != nullptr )
923
0
        {
924
0
            delete [] ptr;
925
0
            ptr = nullptr;
926
0
        }
927
0
    }
Unexecuted instantiation: void wxDELETEA<unsigned char>(unsigned char*&)
Unexecuted instantiation: void wxDELETEA<wxEventHashTable::EventTypeTable*>(wxEventHashTable::EventTypeTable**&)
Unexecuted instantiation: void wxDELETEA<wchar_t>(wchar_t*&)
Unexecuted instantiation: void wxDELETEA<wxHashTableBase_Node*>(wxHashTableBase_Node**&)
928
929
    // trivial implementation of std::swap() for primitive types
930
    template <typename T>
931
    inline void wxSwap(T& first, T& second)
932
0
    {
933
0
        T tmp(first);
934
0
        first = second;
935
0
        second = tmp;
936
0
    }
937
938
/* And also define a couple of simple functions to cast pointer to/from it. */
939
inline wxUIntPtr wxPtrToUInt(const void *p)
940
0
{
941
    /*
942
       VC++ 7.1 gives warnings about casts such as below even when they're
943
       explicit with /Wp64 option, suppress them as we really know what we're
944
       doing here. Same thing with icc with -Wall.
945
     */
946
#ifdef __VISUALC__
947
    #pragma warning(push)
948
    /* pointer truncation from '' to '' */
949
    #pragma warning(disable: 4311)
950
#elif defined(__INTELC__)
951
    #pragma warning(push)
952
    /* conversion from pointer to same-sized integral type */
953
    #pragma warning(disable: 1684)
954
#endif
955
956
0
    return reinterpret_cast<wxUIntPtr>(p);
957
958
#if defined(__VISUALC__) || defined(__INTELC__)
959
    #pragma warning(pop)
960
#endif
961
0
}
962
963
inline void *wxUIntToPtr(wxUIntPtr p)
964
0
{
965
0
#ifdef __VISUALC__
966
0
    #pragma warning(push)
967
0
    /* conversion to type of greater size */
968
0
    #pragma warning(disable: 4312)
969
0
#elif defined(__INTELC__)
970
0
    #pragma warning(push)
971
0
    /* invalid type conversion: "wxUIntPtr={unsigned long}" to "void *" */
972
0
    #pragma warning(disable: 171)
973
0
#endif
974
0
975
0
    return reinterpret_cast<void *>(p);
976
0
977
0
#if defined(__VISUALC__) || defined(__INTELC__)
978
0
    #pragma warning(pop)
979
0
#endif
980
0
}
981
#endif /*__cplusplus*/
982
983
984
985
/*  base floating point types */
986
/*  wxFloat32: 32 bit IEEE float ( 1 sign, 8 exponent bits, 23 fraction bits ) */
987
/*  wxFloat64: 64 bit IEEE float ( 1 sign, 11 exponent bits, 52 fraction bits ) */
988
/*  wxDouble: native fastest representation that has at least wxFloat64 */
989
/*            precision, so use the IEEE types for storage, and this for */
990
/*            calculations */
991
992
typedef float wxFloat32;
993
typedef double wxFloat64;
994
995
typedef double wxDouble;
996
997
/*
998
    Some (non standard) compilers typedef wchar_t as an existing type instead
999
    of treating it as a real fundamental type, set wxWCHAR_T_IS_REAL_TYPE to 0
1000
    for them and to 1 for all the others.
1001
 */
1002
#ifndef wxWCHAR_T_IS_REAL_TYPE
1003
    /*
1004
        VC++ typedefs wchar_t as unsigned short by default until VC8, that is
1005
        unless /Za or /Zc:wchar_t option is used in which case _WCHAR_T_DEFINED
1006
        is defined.
1007
     */
1008
#   if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED)
1009
#       define wxWCHAR_T_IS_REAL_TYPE 0
1010
#   else /* compiler having standard-conforming wchar_t */
1011
#       define wxWCHAR_T_IS_REAL_TYPE 1
1012
#   endif
1013
#endif /* !defined(wxWCHAR_T_IS_REAL_TYPE) */
1014
1015
/* Helper macro for doing something dependent on whether wchar_t is or isn't a
1016
   typedef inside another macro. */
1017
#if wxWCHAR_T_IS_REAL_TYPE
1018
207k
    #define wxIF_WCHAR_T_TYPE(x) x
wxUniChar::wxUniChar(wchar_t)
Line
Count
Source
1018
69.8k
    #define wxIF_WCHAR_T_TYPE(x) x
wxUniChar::operator wchar_t() const
Line
Count
Source
1018
4
    #define wxIF_WCHAR_T_TYPE(x) x
Unexecuted instantiation: wxUniChar::operator=(wchar_t)
wxUniChar::operator==(wchar_t) const
Line
Count
Source
1018
116k
    #define wxIF_WCHAR_T_TYPE(x) x
Unexecuted instantiation: wxUniChar::operator!=(wchar_t) const
Unexecuted instantiation: wxUniChar::operator>=(wchar_t) const
Unexecuted instantiation: wxUniChar::operator<=(wchar_t) const
Unexecuted instantiation: wxUniChar::operator>(wchar_t) const
Unexecuted instantiation: wxUniChar::operator<(wchar_t) const
Unexecuted instantiation: wxUniCharRef::operator=(wchar_t)
Unexecuted instantiation: wxUniCharRef::operator wchar_t() const
wxUniCharRef::operator==(wchar_t) const
Line
Count
Source
1018
20.9k
    #define wxIF_WCHAR_T_TYPE(x) x
Unexecuted instantiation: wxUniCharRef::operator!=(wchar_t) const
Unexecuted instantiation: wxUniCharRef::operator>=(wchar_t) const
Unexecuted instantiation: wxUniCharRef::operator<=(wchar_t) const
Unexecuted instantiation: wxUniCharRef::operator>(wchar_t) const
Unexecuted instantiation: wxUniCharRef::operator<(wchar_t) const
1019
#else /* !wxWCHAR_T_IS_REAL_TYPE */
1020
    #define wxIF_WCHAR_T_TYPE(x)
1021
#endif /* wxWCHAR_T_IS_REAL_TYPE/!wxWCHAR_T_IS_REAL_TYPE */
1022
1023
/*
1024
   Deprecated constant existing only for compatibility, use nullptr directly in
1025
   the new code.
1026
 */
1027
#define wxNullPtr nullptr
1028
1029
/*
1030
    Helper macro expanding into the given "m" macro invoked with each of the
1031
    integer types as parameter (notice that this does not include char/unsigned
1032
    char and bool but does include wchar_t).
1033
 */
1034
#define wxDO_FOR_INT_TYPES(m) \
1035
    m(short) \
1036
    m(unsigned short) \
1037
    m(int) \
1038
    m(unsigned int) \
1039
    m(long) \
1040
    m(unsigned long) \
1041
    wxIF_LONG_LONG_TYPE( m(wxLongLong_t) ) \
1042
    wxIF_LONG_LONG_TYPE( m(wxULongLong_t) ) \
1043
    wxIF_WCHAR_T_TYPE( m(wchar_t) )
1044
1045
/*
1046
    Same as wxDO_FOR_INT_TYPES() but does include char and unsigned char.
1047
1048
    Notice that we use "char" and "unsigned char" here but not "signed char"
1049
    which would be more correct as "char" could be unsigned by default. But
1050
    wxWidgets code currently supposes that char is signed and we'd need to
1051
    clean up assumptions about it, notably in wx/unichar.h, to be able to use
1052
    "signed char" here.
1053
 */
1054
#define wxDO_FOR_CHAR_INT_TYPES(m) \
1055
    m(char) \
1056
    m(unsigned char) \
1057
    wxDO_FOR_INT_TYPES(m)
1058
1059
/*
1060
    Same as wxDO_FOR_INT_TYPES() above except that m macro takes the
1061
    type as the first argument and some extra argument, passed from this macro
1062
    itself, as the second one.
1063
 */
1064
#define wxDO_FOR_INT_TYPES_1(m, arg) \
1065
    m(short, arg) \
1066
    m(unsigned short, arg) \
1067
    m(int, arg) \
1068
    m(unsigned int, arg) \
1069
    m(long, arg) \
1070
    m(unsigned long, arg) \
1071
    wxIF_LONG_LONG_TYPE( m(wxLongLong_t, arg) ) \
1072
    wxIF_LONG_LONG_TYPE( m(wxULongLong_t, arg) ) \
1073
    wxIF_WCHAR_T_TYPE( m(wchar_t, arg) )
1074
1075
/*
1076
    Combination of wxDO_FOR_CHAR_INT_TYPES() and wxDO_FOR_INT_TYPES_1():
1077
    invokes the given macro with the specified argument as its second parameter
1078
    for all char and int types.
1079
 */
1080
#define wxDO_FOR_CHAR_INT_TYPES_1(m, arg) \
1081
    m(char, arg) \
1082
    m(unsigned char, arg) \
1083
    wxDO_FOR_INT_TYPES_1(m, arg)
1084
1085
1086
/*  ---------------------------------------------------------------------------- */
1087
/*  byte ordering related definition and macros */
1088
/*  ---------------------------------------------------------------------------- */
1089
1090
/*  byte sex */
1091
1092
0
#define  wxBIG_ENDIAN     4321
1093
0
#define  wxLITTLE_ENDIAN  1234
1094
#define  wxPDP_ENDIAN     3412
1095
1096
#ifdef WORDS_BIGENDIAN
1097
#define  wxBYTE_ORDER  wxBIG_ENDIAN
1098
#else
1099
0
#define  wxBYTE_ORDER  wxLITTLE_ENDIAN
1100
#endif
1101
1102
/*  byte swapping */
1103
1104
#define wxUINT16_SWAP_ALWAYS(val) \
1105
0
   ((wxUint16) ( \
1106
0
    (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \
1107
0
    (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8)))
1108
1109
#define wxINT16_SWAP_ALWAYS(val) \
1110
   ((wxInt16) ( \
1111
    (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \
1112
    (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8)))
1113
1114
#define wxUINT32_SWAP_ALWAYS(val) \
1115
0
   ((wxUint32) ( \
1116
0
    (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \
1117
0
    (((wxUint32) (val) & (wxUint32) 0x0000ff00U) <<  8) | \
1118
0
    (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >>  8) | \
1119
0
    (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24)))
1120
1121
#define wxINT32_SWAP_ALWAYS(val) \
1122
   ((wxInt32) ( \
1123
    (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \
1124
    (((wxUint32) (val) & (wxUint32) 0x0000ff00U) <<  8) | \
1125
    (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >>  8) | \
1126
    (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24)))
1127
/*  machine specific byte swapping */
1128
1129
#define wxUINT64_SWAP_ALWAYS(val) \
1130
0
   ((wxUint64) ( \
1131
0
    (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
1132
0
    (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
1133
0
    (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
1134
0
    (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) <<  8) | \
1135
0
    (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >>  8) | \
1136
0
    (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
1137
0
    (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
1138
0
    (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
1139
1140
#define wxINT64_SWAP_ALWAYS(val) \
1141
   ((wxInt64) ( \
1142
    (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \
1143
    (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \
1144
    (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \
1145
    (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) <<  8) | \
1146
    (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >>  8) | \
1147
    (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \
1148
    (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \
1149
    (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56)))
1150
1151
#ifdef WORDS_BIGENDIAN
1152
    #define wxUINT16_SWAP_ON_BE(val)  wxUINT16_SWAP_ALWAYS(val)
1153
    #define wxINT16_SWAP_ON_BE(val)   wxINT16_SWAP_ALWAYS(val)
1154
    #define wxUINT16_SWAP_ON_LE(val)  (val)
1155
    #define wxINT16_SWAP_ON_LE(val)   (val)
1156
    #define wxUINT32_SWAP_ON_BE(val)  wxUINT32_SWAP_ALWAYS(val)
1157
    #define wxINT32_SWAP_ON_BE(val)   wxINT32_SWAP_ALWAYS(val)
1158
    #define wxUINT32_SWAP_ON_LE(val)  (val)
1159
    #define wxINT32_SWAP_ON_LE(val)   (val)
1160
1161
    #define wxUINT64_SWAP_ON_BE(val)  wxUINT64_SWAP_ALWAYS(val)
1162
    #define wxUINT64_SWAP_ON_LE(val)  (val)
1163
    #define wxINT64_SWAP_ON_BE(val)  wxINT64_SWAP_ALWAYS(val)
1164
    #define wxINT64_SWAP_ON_LE(val)  (val)
1165
1166
    #define wxUINT64_SWAP_ON_BE_IN_PLACE(val)   val = wxUINT64_SWAP_ALWAYS(val)
1167
    #define wxINT64_SWAP_ON_BE_IN_PLACE(val)   val = wxINT64_SWAP_ALWAYS(val)
1168
    #define wxUINT64_SWAP_ON_LE_IN_PLACE(val)
1169
    #define wxINT64_SWAP_ON_LE_IN_PLACE(val)
1170
1171
    #define wxUINT16_SWAP_ON_BE_IN_PLACE(val)   val = wxUINT16_SWAP_ALWAYS(val)
1172
    #define wxINT16_SWAP_ON_BE_IN_PLACE(val)   val = wxINT16_SWAP_ALWAYS(val)
1173
    #define wxUINT16_SWAP_ON_LE_IN_PLACE(val)
1174
    #define wxINT16_SWAP_ON_LE_IN_PLACE(val)
1175
    #define wxUINT32_SWAP_ON_BE_IN_PLACE(val)   val = wxUINT32_SWAP_ALWAYS(val)
1176
    #define wxINT32_SWAP_ON_BE_IN_PLACE(val)   val = wxINT32_SWAP_ALWAYS(val)
1177
    #define wxUINT32_SWAP_ON_LE_IN_PLACE(val)
1178
    #define wxINT32_SWAP_ON_LE_IN_PLACE(val)
1179
#else
1180
0
    #define wxUINT16_SWAP_ON_LE(val)  wxUINT16_SWAP_ALWAYS(val)
1181
    #define wxINT16_SWAP_ON_LE(val)   wxINT16_SWAP_ALWAYS(val)
1182
0
    #define wxUINT16_SWAP_ON_BE(val)  (val)
1183
    #define wxINT16_SWAP_ON_BE(val)   (val)
1184
0
    #define wxUINT32_SWAP_ON_LE(val)  wxUINT32_SWAP_ALWAYS(val)
1185
    #define wxINT32_SWAP_ON_LE(val)   wxINT32_SWAP_ALWAYS(val)
1186
0
    #define wxUINT32_SWAP_ON_BE(val)  (val)
1187
    #define wxINT32_SWAP_ON_BE(val)   (val)
1188
0
    #define wxUINT64_SWAP_ON_LE(val)  wxUINT64_SWAP_ALWAYS(val)
1189
0
    #define wxUINT64_SWAP_ON_BE(val)  (val)
1190
    #define wxINT64_SWAP_ON_LE(val)  wxINT64_SWAP_ALWAYS(val)
1191
    #define wxINT64_SWAP_ON_BE(val)  (val)
1192
    #define wxUINT64_SWAP_ON_BE_IN_PLACE(val)
1193
    #define wxINT64_SWAP_ON_BE_IN_PLACE(val)
1194
    #define wxUINT64_SWAP_ON_LE_IN_PLACE(val)   val = wxUINT64_SWAP_ALWAYS(val)
1195
    #define wxINT64_SWAP_ON_LE_IN_PLACE(val)   val = wxINT64_SWAP_ALWAYS(val)
1196
1197
    #define wxUINT16_SWAP_ON_BE_IN_PLACE(val)
1198
    #define wxINT16_SWAP_ON_BE_IN_PLACE(val)
1199
    #define wxUINT16_SWAP_ON_LE_IN_PLACE(val)   val = wxUINT16_SWAP_ALWAYS(val)
1200
    #define wxINT16_SWAP_ON_LE_IN_PLACE(val)   val = wxINT16_SWAP_ALWAYS(val)
1201
    #define wxUINT32_SWAP_ON_BE_IN_PLACE(val)
1202
    #define wxINT32_SWAP_ON_BE_IN_PLACE(val)
1203
    #define wxUINT32_SWAP_ON_LE_IN_PLACE(val)   val = wxUINT32_SWAP_ALWAYS(val)
1204
    #define wxINT32_SWAP_ON_LE_IN_PLACE(val)   val = wxINT32_SWAP_ALWAYS(val)
1205
#endif
1206
1207
/*  ---------------------------------------------------------------------------- */
1208
/*  Geometric flags */
1209
/*  ---------------------------------------------------------------------------- */
1210
1211
/*
1212
    In C++20 operations on the elements of different enums are deprecated and
1213
    many compilers (clang 10+, gcc 11+, MSVS 2019) warn about combining them,
1214
    as a lot of existing code using them does, so we provide explicit operators
1215
    for doing this, that do the same thing as would happen without them, but
1216
    without the warnings.
1217
 */
1218
#if wxCHECK_CXX_STD(202002L)
1219
    #define wxALLOW_COMBINING_ENUMS_IMPL(en1, en2)                            \
1220
        inline int operator|(en1 v1, en2 v2)                                  \
1221
            { return static_cast<int>(v1) | static_cast<int>(v2); }           \
1222
        inline int operator+(en1 v1, en2 v2)                                  \
1223
            { return static_cast<int>(v1) + static_cast<int>(v2); }
1224
1225
    #define wxALLOW_COMBINING_ENUMS(en1, en2)                                 \
1226
        wxALLOW_COMBINING_ENUMS_IMPL(en1, en2)                                \
1227
        wxALLOW_COMBINING_ENUMS_IMPL(en2, en1)
1228
#else /* !C++ 20 */
1229
    /* Don't bother doing anything in this case. */
1230
    #define wxALLOW_COMBINING_ENUMS(en1, en2)
1231
#endif /* C++ 20 */
1232
1233
enum wxGeometryCentre
1234
{
1235
    wxCENTRE                  = 0x0001,
1236
    wxCENTER                  = wxCENTRE
1237
};
1238
1239
/*  centering into frame rather than screen (obsolete) */
1240
#define wxCENTER_FRAME          0x0000
1241
/*  centre on screen rather than parent */
1242
#define wxCENTRE_ON_SCREEN      0x0002
1243
#define wxCENTER_ON_SCREEN      wxCENTRE_ON_SCREEN
1244
1245
enum wxOrientation
1246
{
1247
    /* don't change the values of these elements, they are used elsewhere */
1248
    wxHORIZONTAL              = 0x0004,
1249
    wxVERTICAL                = 0x0008,
1250
1251
    wxBOTH                    = wxVERTICAL | wxHORIZONTAL,
1252
1253
    /*  a mask to extract orientation from the combination of flags */
1254
    wxORIENTATION_MASK        = wxBOTH
1255
};
1256
1257
enum wxDirection
1258
{
1259
    wxLEFT                    = 0x0010,
1260
    wxRIGHT                   = 0x0020,
1261
    wxUP                      = 0x0040,
1262
    wxDOWN                    = 0x0080,
1263
1264
    wxTOP                     = wxUP,
1265
    wxBOTTOM                  = wxDOWN,
1266
1267
    wxNORTH                   = wxUP,
1268
    wxSOUTH                   = wxDOWN,
1269
    wxWEST                    = wxLEFT,
1270
    wxEAST                    = wxRIGHT,
1271
1272
    wxALL                     = (wxUP | wxDOWN | wxRIGHT | wxLEFT),
1273
1274
    /*  a mask to extract direction from the combination of flags */
1275
    wxDIRECTION_MASK           = wxALL
1276
};
1277
1278
enum wxAlignment
1279
{
1280
    /*
1281
        0 is a valid wxAlignment value (both wxALIGN_LEFT and wxALIGN_TOP
1282
        use it) so define a symbolic name for an invalid alignment value
1283
        which can be assumed to be different from anything else
1284
     */
1285
    wxALIGN_INVALID           = -1,
1286
1287
    wxALIGN_NOT               = 0x0000,
1288
    wxALIGN_CENTER_HORIZONTAL = 0x0100,
1289
    wxALIGN_CENTRE_HORIZONTAL = wxALIGN_CENTER_HORIZONTAL,
1290
    wxALIGN_LEFT              = wxALIGN_NOT,
1291
    wxALIGN_TOP               = wxALIGN_NOT,
1292
    wxALIGN_RIGHT             = 0x0200,
1293
    wxALIGN_BOTTOM            = 0x0400,
1294
    wxALIGN_CENTER_VERTICAL   = 0x0800,
1295
    wxALIGN_CENTRE_VERTICAL   = wxALIGN_CENTER_VERTICAL,
1296
1297
    wxALIGN_CENTER            = (wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL),
1298
    wxALIGN_CENTRE            = wxALIGN_CENTER,
1299
1300
    /*  a mask to extract alignment from the combination of flags */
1301
    wxALIGN_MASK              = 0x0f00
1302
};
1303
1304
/* misc. flags for wxSizer items */
1305
enum wxSizerFlagBits
1306
{
1307
    wxFIXED_MINSIZE                = 0x8000,
1308
    wxRESERVE_SPACE_EVEN_IF_HIDDEN = 0x0002,
1309
1310
    /*  a mask to extract wxSizerFlagBits from combination of flags */
1311
    wxSIZER_FLAG_BITS_MASK         = 0x8002
1312
};
1313
1314
enum wxStretch
1315
{
1316
    wxSTRETCH_NOT             = 0x0000,
1317
    wxSHRINK                  = 0x1000,
1318
    wxGROW                    = 0x2000,
1319
    wxEXPAND                  = wxGROW,
1320
    wxSHAPED                  = 0x4000,
1321
    wxTILE                    = 0xc000, /* wxSHAPED | wxFIXED_MINSIZE */
1322
1323
    /*  a mask to extract stretch from the combination of flags */
1324
    wxSTRETCH_MASK            = 0x7000 /* sans wxTILE */
1325
};
1326
1327
/*  border flags: the values are chosen for backwards compatibility */
1328
enum wxBorder
1329
{
1330
    /*  this is different from wxBORDER_NONE as by default the controls do have */
1331
    /*  border */
1332
    wxBORDER_DEFAULT = 0,
1333
1334
    wxBORDER_NONE   = 0x00200000,
1335
    wxBORDER_STATIC = 0x01000000,
1336
    wxBORDER_SIMPLE = 0x02000000,
1337
    wxBORDER_RAISED = 0x04000000,
1338
    wxBORDER_SUNKEN = 0x08000000,
1339
    wxBORDER_DOUBLE = 0x10000000, /* deprecated */
1340
    wxBORDER_THEME  = wxBORDER_DOUBLE,
1341
1342
    /*  a mask to extract border style from the combination of flags */
1343
    wxBORDER_MASK   = 0x1f200000
1344
};
1345
1346
/* This makes it easier to specify a 'normal' border for a control */
1347
#define wxDEFAULT_CONTROL_BORDER    wxBORDER_SUNKEN
1348
1349
/*
1350
    Elements of these enums can be combined with each other when using
1351
    wxSizer::Add() overload not using wxSizerFlags.
1352
 */
1353
wxALLOW_COMBINING_ENUMS(wxAlignment, wxBorder)
1354
wxALLOW_COMBINING_ENUMS(wxAlignment, wxDirection)
1355
wxALLOW_COMBINING_ENUMS(wxAlignment, wxGeometryCentre)
1356
wxALLOW_COMBINING_ENUMS(wxAlignment, wxSizerFlagBits)
1357
wxALLOW_COMBINING_ENUMS(wxAlignment, wxStretch)
1358
wxALLOW_COMBINING_ENUMS(wxBorder, wxDirection)
1359
wxALLOW_COMBINING_ENUMS(wxBorder, wxGeometryCentre)
1360
wxALLOW_COMBINING_ENUMS(wxBorder, wxSizerFlagBits)
1361
wxALLOW_COMBINING_ENUMS(wxBorder, wxStretch)
1362
wxALLOW_COMBINING_ENUMS(wxDirection, wxGeometryCentre)
1363
wxALLOW_COMBINING_ENUMS(wxDirection, wxStretch)
1364
wxALLOW_COMBINING_ENUMS(wxDirection, wxSizerFlagBits)
1365
wxALLOW_COMBINING_ENUMS(wxGeometryCentre, wxSizerFlagBits)
1366
wxALLOW_COMBINING_ENUMS(wxGeometryCentre, wxStretch)
1367
wxALLOW_COMBINING_ENUMS(wxSizerFlagBits, wxStretch)
1368
1369
/*  ---------------------------------------------------------------------------- */
1370
/*  Window style flags */
1371
/*  ---------------------------------------------------------------------------- */
1372
1373
/*
1374
 * Values are chosen so they can be |'ed in a bit list.
1375
 * Some styles are used across more than one group,
1376
 * so the values mustn't clash with others in the group.
1377
 * Otherwise, numbers can be reused across groups.
1378
 */
1379
1380
/*
1381
    Summary of the bits used by various styles.
1382
1383
    High word, containing styles which can be used with many windows:
1384
1385
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1386
    |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|
1387
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
1388
      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
1389
      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  \_ wxFULL_REPAINT_ON_RESIZE
1390
      |  |  |  |  |  |  |  |  |  |  |  |  |  |  \____ wxPOPUP_WINDOW
1391
      |  |  |  |  |  |  |  |  |  |  |  |  |  \_______ wxWANTS_CHARS
1392
      |  |  |  |  |  |  |  |  |  |  |  |  \__________ wxTAB_TRAVERSAL
1393
      |  |  |  |  |  |  |  |  |  |  |  \_____________ (ex-wxTRANSPARENT_WINDOW)
1394
      |  |  |  |  |  |  |  |  |  |  \________________ wxBORDER_NONE
1395
      |  |  |  |  |  |  |  |  |  \___________________ wxCLIP_CHILDREN
1396
      |  |  |  |  |  |  |  |  \______________________ wxALWAYS_SHOW_SB
1397
      |  |  |  |  |  |  |  \_________________________ wxBORDER_STATIC
1398
      |  |  |  |  |  |  \____________________________ wxBORDER_SIMPLE
1399
      |  |  |  |  |  \_______________________________ wxBORDER_RAISED
1400
      |  |  |  |  \__________________________________ wxBORDER_SUNKEN
1401
      |  |  |  \_____________________________________ wxBORDER_{DOUBLE,THEME}
1402
      |  |  \________________________________________ wxCAPTION/wxCLIP_SIBLINGS
1403
      |  \___________________________________________ wxHSCROLL
1404
      \______________________________________________ wxVSCROLL
1405
1406
1407
    Low word style bits is class-specific meaning that the same bit can have
1408
    different meanings for different controls (e.g. 0x10 is wxCB_READONLY
1409
    meaning that the control can't be modified for wxComboBox but wxLB_SORT
1410
    meaning that the control should be kept sorted for wxListBox, while
1411
    wxLB_SORT has a different value -- and this is just fine).
1412
 */
1413
1414
/*
1415
 * Window (Frame/dialog/subwindow/panel item) style flags
1416
 */
1417
1418
/* The cast is needed to avoid g++ -Wnarrowing warnings when initializing
1419
 * values of int type with wxVSCROLL on 32 bit platforms, where its value is
1420
 * greater than INT_MAX.
1421
 */
1422
#define wxVSCROLL               ((int)0x80000000)
1423
#define wxHSCROLL               0x40000000
1424
#define wxCAPTION               0x20000000
1425
1426
/*  New styles (border styles are now in their own enum) */
1427
#define wxDOUBLE_BORDER         wxBORDER_DOUBLE
1428
#define wxSUNKEN_BORDER         wxBORDER_SUNKEN
1429
#define wxRAISED_BORDER         wxBORDER_RAISED
1430
#define wxBORDER                wxBORDER_SIMPLE
1431
#define wxSIMPLE_BORDER         wxBORDER_SIMPLE
1432
#define wxSTATIC_BORDER         wxBORDER_STATIC
1433
#define wxNO_BORDER             wxBORDER_NONE
1434
1435
/*  wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed, */
1436
/*  disable it - but still show (see also wxLB_ALWAYS_SB style) */
1437
#define wxALWAYS_SHOW_SB        0x00800000
1438
1439
/*  Clip children when painting, which reduces flicker in e.g. frames and */
1440
/*  splitter windows, but can't be used in a panel where a static box must be */
1441
/*  'transparent' (panel paints the background for it) */
1442
#define wxCLIP_CHILDREN         0x00400000
1443
1444
/*  Note we're reusing the wxCAPTION style because we won't need captions */
1445
/*  for subwindows/controls */
1446
#define wxCLIP_SIBLINGS         0x20000000
1447
1448
/* This style is obsolete and doesn't do anything. */
1449
#define wxTRANSPARENT_WINDOW    0
1450
1451
/*  Add this style to a panel to get tab traversal working outside of dialogs */
1452
/*  (on by default for wxPanel, wxDialog, wxScrolledWindow) */
1453
#define wxTAB_TRAVERSAL         0x00080000
1454
1455
/*  Add this style if the control wants to get all keyboard messages (under */
1456
/*  Windows, it won't normally get the dialog navigation key events) */
1457
#define wxWANTS_CHARS           0x00040000
1458
1459
/*  Deprecated, defined only for compatibility. */
1460
#define wxRETAINED              0x00000000
1461
#define wxBACKINGSTORE          wxRETAINED
1462
1463
/*  set this flag to create a special popup window: it will be always shown on */
1464
/*  top of other windows, will capture the mouse and will be dismissed when the */
1465
/*  mouse is clicked outside of it or if it loses focus in any other way */
1466
#define wxPOPUP_WINDOW          0x00020000
1467
1468
/*  force a full repaint when the window is resized (instead of repainting just */
1469
/*  the invalidated area) */
1470
#define wxFULL_REPAINT_ON_RESIZE 0x00010000
1471
1472
/*  obsolete: now this is the default behaviour */
1473
/*  */
1474
/*  don't invalidate the whole window (resulting in a PAINT event) when the */
1475
/*  window is resized (currently, makes sense for wxMSW only) */
1476
#define wxNO_FULL_REPAINT_ON_RESIZE 0
1477
1478
/* A mask which can be used to filter (out) all wxWindow-specific styles.
1479
 */
1480
#define wxWINDOW_STYLE_MASK     \
1481
    (wxVSCROLL|wxHSCROLL|wxBORDER_MASK|wxALWAYS_SHOW_SB|wxCLIP_CHILDREN| \
1482
     wxCLIP_SIBLINGS|wxTAB_TRAVERSAL|wxWANTS_CHARS| \
1483
     wxRETAINED|wxPOPUP_WINDOW|wxFULL_REPAINT_ON_RESIZE)
1484
1485
/*
1486
 * Extra window style flags (use wxWS_EX prefix to make it clear that they
1487
 * should be passed to wxWindow::SetExtraStyle(), not SetWindowStyle())
1488
 */
1489
1490
/* This flag is obsolete as recursive validation is now the default (and only
1491
 * possible) behaviour. Simply don't use it any more in the new code. */
1492
#define wxWS_EX_VALIDATE_RECURSIVELY    0x00000000 /* used to be 1 */
1493
1494
/*  wxCommandEvents and the objects of the derived classes are forwarded to the */
1495
/*  parent window and so on recursively by default. Using this flag for the */
1496
/*  given window allows to block this propagation at this window, i.e. prevent */
1497
/*  the events from being propagated further upwards. The dialogs have this */
1498
/*  flag on by default. */
1499
#define wxWS_EX_BLOCK_EVENTS            0x00000002
1500
1501
/*  don't use this window as an implicit parent for the other windows: this must */
1502
/*  be used with transient windows as otherwise there is the risk of creating a */
1503
/*  dialog/frame with this window as a parent which would lead to a crash if the */
1504
/*  parent is destroyed before the child */
1505
#define wxWS_EX_TRANSIENT               0x00000004
1506
1507
/*  don't paint the window background, we'll assume it will */
1508
/*  be done by a theming engine. This is not yet used but could */
1509
/*  possibly be made to work in the future, at least on Windows */
1510
#define wxWS_EX_THEMED_BACKGROUND       0x00000008
1511
1512
/*  this window should always process idle events */
1513
#define wxWS_EX_PROCESS_IDLE            0x00000010
1514
1515
/*  this window should always process UI update events */
1516
#define wxWS_EX_PROCESS_UI_UPDATES      0x00000020
1517
1518
/*  Draw the window in a metal theme on Mac */
1519
#define wxFRAME_EX_METAL                0x00000040
1520
#define wxDIALOG_EX_METAL               0x00000040
1521
1522
/*  Use this style to add a context-sensitive help to the window (currently for */
1523
/*  Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) */
1524
#define wxWS_EX_CONTEXTHELP             0x00000080
1525
1526
/* synonyms for wxWS_EX_CONTEXTHELP for compatibility */
1527
#define wxFRAME_EX_CONTEXTHELP          wxWS_EX_CONTEXTHELP
1528
#define wxDIALOG_EX_CONTEXTHELP         wxWS_EX_CONTEXTHELP
1529
1530
/*  Create a window which is attachable to another top level window */
1531
#define wxFRAME_DRAWER          0x0020
1532
1533
/*
1534
 * MDI parent frame style flags
1535
 * Can overlap with some of the above.
1536
 */
1537
1538
#define wxFRAME_NO_WINDOW_MENU  0x0100
1539
1540
/*
1541
 * wxMenuBar style flags
1542
 */
1543
/*  use native docking */
1544
#define wxMB_DOCKABLE       0x0001
1545
1546
/*
1547
 * wxMenu style flags
1548
 */
1549
#define wxMENU_TEAROFF      0x0001
1550
1551
/*
1552
 * Apply to all panel items
1553
 */
1554
#define wxCOLOURED          0x0800
1555
#define wxFIXED_LENGTH      0x0400
1556
1557
/*
1558
 * Styles for wxListBox
1559
 */
1560
#define wxLB_SORT           0x0010
1561
#define wxLB_SINGLE         0x0020
1562
#define wxLB_MULTIPLE       0x0040
1563
#define wxLB_EXTENDED       0x0080
1564
/*  wxLB_OWNERDRAW is Windows-only */
1565
#define wxLB_NEEDED_SB      0x0000
1566
#define wxLB_OWNERDRAW      0x0100
1567
#define wxLB_ALWAYS_SB      0x0200
1568
#define wxLB_NO_SB          0x0400
1569
#define wxLB_HSCROLL        wxHSCROLL
1570
/*  always show an entire number of rows */
1571
#define wxLB_INT_HEIGHT     0x0800
1572
1573
/*
1574
 * wxComboBox style flags
1575
 */
1576
#define wxCB_SIMPLE         0x0004
1577
#define wxCB_SORT           0x0008
1578
#define wxCB_READONLY       0x0010
1579
#define wxCB_DROPDOWN       0x0020
1580
1581
/*
1582
 * wxRadioBox style flags
1583
 * These styles are not used in any port.
1584
 */
1585
#define wxRA_LEFTTORIGHT    0x0001
1586
#define wxRA_TOPTOBOTTOM    0x0002
1587
1588
/*  New, more intuitive names to specify majorDim argument */
1589
#define wxRA_SPECIFY_COLS   wxHORIZONTAL
1590
#define wxRA_SPECIFY_ROWS   wxVERTICAL
1591
1592
/*  Old names for compatibility */
1593
#define wxRA_HORIZONTAL     wxHORIZONTAL
1594
#define wxRA_VERTICAL       wxVERTICAL
1595
1596
/*
1597
 * wxRadioButton style flag
1598
 */
1599
#define wxRB_GROUP          0x0004
1600
#define wxRB_SINGLE         0x0008
1601
1602
/*
1603
 * wxScrollBar flags
1604
 */
1605
#define wxSB_HORIZONTAL      wxHORIZONTAL
1606
#define wxSB_VERTICAL        wxVERTICAL
1607
1608
/*
1609
 * wxSpinButton flags.
1610
 * Note that a wxSpinCtrl is sometimes defined as a wxTextCtrl, and so the
1611
 * flags shouldn't overlap with wxTextCtrl flags that can be used for a single
1612
 * line controls (currently we reuse wxTE_CHARWRAP and wxTE_RICH2 neither of
1613
 * which makes sense for them).
1614
 */
1615
#define wxSP_HORIZONTAL       wxHORIZONTAL /*  4 */
1616
#define wxSP_VERTICAL         wxVERTICAL   /*  8 */
1617
#define wxSP_ARROW_KEYS       0x4000
1618
#define wxSP_WRAP             0x8000
1619
1620
/*
1621
 * wxTabCtrl flags
1622
 */
1623
#define wxTC_RIGHTJUSTIFY     0x0010
1624
#define wxTC_FIXEDWIDTH       0x0020
1625
#define wxTC_TOP              0x0000    /*  default */
1626
#define wxTC_LEFT             0x0020
1627
#define wxTC_RIGHT            0x0040
1628
#define wxTC_BOTTOM           0x0080
1629
#define wxTC_MULTILINE        0x0200    /* == wxNB_MULTILINE */
1630
#define wxTC_OWNERDRAW        0x0400
1631
1632
/*
1633
 * wxStaticBitmap flags
1634
 */
1635
#define wxBI_EXPAND           wxEXPAND
1636
1637
/*
1638
 * wxStaticLine flags
1639
 */
1640
#define wxLI_HORIZONTAL         wxHORIZONTAL
1641
#define wxLI_VERTICAL           wxVERTICAL
1642
1643
/*
1644
    wxTextCtrl flags also used by other controls.
1645
1646
    wxComboBox, wxSpinCtrl and maybe others can also use some of these flags,
1647
    so define them in common header. More wxTE_XXX are in wx/textctrl.h.
1648
 */
1649
#define wxTE_READONLY       0x0010
1650
#define wxTE_MULTILINE      0x0020
1651
#define wxTE_PROCESS_TAB    0x0040
1652
1653
#define wxTE_PROCESS_ENTER  0x0400
1654
#define wxTE_PASSWORD       0x0800
1655
1656
1657
/*
1658
 * extended dialog specifiers. these values are stored in a different
1659
 * flag and thus do not overlap with other style flags. note that these
1660
 * values do not correspond to the return values of the dialogs (for
1661
 * those values, look at the wxID_XXX defines).
1662
 */
1663
1664
/*  wxCENTRE already defined as  0x00000001 */
1665
#define wxYES                   0x00000002
1666
#define wxOK                    0x00000004
1667
#define wxNO                    0x00000008
1668
#define wxYES_NO                (wxYES | wxNO)
1669
#define wxCANCEL                0x00000010
1670
#define wxAPPLY                 0x00000020
1671
#define wxCLOSE                 0x00000040
1672
1673
#define wxOK_DEFAULT            0x00000000  /* has no effect (default) */
1674
#define wxYES_DEFAULT           0x00000000  /* has no effect (default) */
1675
#define wxNO_DEFAULT            0x00000080  /* only valid with wxYES_NO */
1676
#define wxCANCEL_DEFAULT        0x80000000  /* only valid with wxCANCEL */
1677
1678
#define wxICON_WARNING          0x00000100
1679
#define wxICON_ERROR            0x00000200
1680
#define wxICON_QUESTION         0x00000400
1681
#define wxICON_INFORMATION      0x00000800
1682
#define wxICON_EXCLAMATION      wxICON_WARNING
1683
#define wxICON_HAND             wxICON_ERROR
1684
#define wxICON_STOP             wxICON_ERROR
1685
#define wxICON_ASTERISK         wxICON_INFORMATION
1686
1687
#define wxHELP                  0x00001000
1688
#define wxFORWARD               0x00002000
1689
#define wxBACKWARD              0x00004000
1690
#define wxRESET                 0x00008000
1691
#define wxMORE                  0x00010000
1692
#define wxSETUP                 0x00020000
1693
#define wxICON_NONE             0x00040000
1694
#define wxICON_AUTH_NEEDED      0x00080000
1695
1696
#define wxICON_MASK \
1697
    (wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION|wxICON_NONE|wxICON_AUTH_NEEDED)
1698
1699
/*
1700
 * Background styles. See wxWindow::SetBackgroundStyle
1701
 */
1702
enum wxBackgroundStyle
1703
{
1704
    /*
1705
        background is erased in the EVT_ERASE_BACKGROUND handler or using
1706
        the system default background if no such handler is defined (this
1707
        is the default style)
1708
     */
1709
    wxBG_STYLE_ERASE,
1710
1711
    /*
1712
        background is erased by the system, no EVT_ERASE_BACKGROUND event
1713
        is generated at all
1714
     */
1715
    wxBG_STYLE_SYSTEM,
1716
1717
    /*
1718
        background is erased in EVT_PAINT handler and not erased at all
1719
        before it, this should be used if the paint handler paints over
1720
        the entire window to avoid flicker
1721
     */
1722
    wxBG_STYLE_PAINT,
1723
1724
    /*
1725
        Indicates that the window background is not erased, letting the parent
1726
        window show through.
1727
     */
1728
    wxBG_STYLE_TRANSPARENT,
1729
1730
    /* this style is deprecated and doesn't do anything, don't use */
1731
    wxBG_STYLE_COLOUR,
1732
1733
    /*
1734
        this style is deprecated and is synonymous with
1735
        wxBG_STYLE_PAINT, use the new name
1736
     */
1737
    wxBG_STYLE_CUSTOM = wxBG_STYLE_PAINT
1738
};
1739
1740
/*
1741
 * Key types used by (old style) lists and hashes.
1742
 */
1743
enum wxKeyType
1744
{
1745
    wxKEY_NONE,
1746
    wxKEY_INTEGER,
1747
    wxKEY_STRING
1748
};
1749
1750
/*  ---------------------------------------------------------------------------- */
1751
/*  standard IDs */
1752
/*  ---------------------------------------------------------------------------- */
1753
1754
/*  Standard menu IDs */
1755
enum wxStandardID
1756
{
1757
    /*
1758
       These ids delimit the range used by automatically-generated ids
1759
       (i.e. those used when wxID_ANY is specified during construction).
1760
     */
1761
#if defined(__WXMSW__) || wxUSE_AUTOID_MANAGEMENT
1762
    /*
1763
       On MSW the range is always restricted no matter if id management
1764
       is used or not because the native window ids are limited to short
1765
       range.  On other platforms the range is only restricted if id
1766
       management is used so the reference count buffer won't be so big.
1767
     */
1768
    wxID_AUTO_LOWEST = -32000,
1769
    wxID_AUTO_HIGHEST = -2000,
1770
#else
1771
    wxID_AUTO_LOWEST = -1000000,
1772
    wxID_AUTO_HIGHEST = -2000,
1773
#endif
1774
1775
    /* no id matches this one when compared to it */
1776
    wxID_NONE = -3,
1777
1778
    /*  id for a separator line in the menu (invalid for normal item) */
1779
    wxID_SEPARATOR = -2,
1780
1781
    /* any id: means that we don't care about the id, whether when installing
1782
     * an event handler or when creating a new window */
1783
    wxID_ANY = -1,
1784
1785
1786
    /* all predefined ids are between wxID_LOWEST and wxID_HIGHEST (exclusive) */
1787
    wxID_LOWEST = 5000,
1788
1789
    wxID_OPEN = wxID_LOWEST,
1790
    wxID_CLOSE,
1791
    wxID_NEW,
1792
    wxID_SAVE,
1793
    wxID_SAVEAS,
1794
    wxID_REVERT,
1795
    wxID_EXIT,
1796
    wxID_UNDO,
1797
    wxID_REDO,
1798
    wxID_HELP,
1799
    wxID_PRINT,
1800
    wxID_PRINT_SETUP,
1801
    wxID_PAGE_SETUP,
1802
    wxID_PREVIEW,
1803
    wxID_ABOUT,
1804
    wxID_HELP_CONTENTS,
1805
    wxID_HELP_INDEX,
1806
    wxID_HELP_SEARCH,
1807
    wxID_HELP_COMMANDS,
1808
    wxID_HELP_PROCEDURES,
1809
    wxID_HELP_CONTEXT,
1810
    wxID_CLOSE_ALL,
1811
    wxID_PREFERENCES,
1812
1813
    wxID_EDIT = 5030,
1814
    wxID_CUT,
1815
    wxID_COPY,
1816
    wxID_PASTE,
1817
    wxID_CLEAR,
1818
    wxID_FIND,
1819
    wxID_DUPLICATE,
1820
    wxID_SELECTALL,
1821
    wxID_DELETE,
1822
    wxID_REPLACE,
1823
    wxID_REPLACE_ALL,
1824
    wxID_PROPERTIES,
1825
1826
    wxID_VIEW_DETAILS,
1827
    wxID_VIEW_LARGEICONS,
1828
    wxID_VIEW_SMALLICONS,
1829
    wxID_VIEW_LIST,
1830
    wxID_VIEW_SORTDATE,
1831
    wxID_VIEW_SORTNAME,
1832
    wxID_VIEW_SORTSIZE,
1833
    wxID_VIEW_SORTTYPE,
1834
1835
    wxID_FILE = 5050,
1836
    wxID_FILE1,
1837
    wxID_FILE2,
1838
    wxID_FILE3,
1839
    wxID_FILE4,
1840
    wxID_FILE5,
1841
    wxID_FILE6,
1842
    wxID_FILE7,
1843
    wxID_FILE8,
1844
    wxID_FILE9,
1845
1846
    /*  Standard button and menu IDs */
1847
    wxID_OK = 5100,
1848
    wxID_CANCEL,
1849
    wxID_APPLY,
1850
    wxID_YES,
1851
    wxID_NO,
1852
    wxID_STATIC,
1853
    wxID_FORWARD,
1854
    wxID_BACKWARD,
1855
    wxID_DEFAULT,
1856
    wxID_MORE,
1857
    wxID_SETUP,
1858
    wxID_RESET,
1859
    wxID_CONTEXT_HELP,
1860
    wxID_YESTOALL,
1861
    wxID_NOTOALL,
1862
    wxID_ABORT,
1863
    wxID_RETRY,
1864
    wxID_IGNORE,
1865
    wxID_ADD,
1866
    wxID_REMOVE,
1867
1868
    wxID_UP,
1869
    wxID_DOWN,
1870
    wxID_HOME,
1871
    wxID_REFRESH,
1872
    wxID_STOP,
1873
    wxID_INDEX,
1874
1875
    wxID_BOLD,
1876
    wxID_ITALIC,
1877
    wxID_JUSTIFY_CENTER,
1878
    wxID_JUSTIFY_FILL,
1879
    wxID_JUSTIFY_RIGHT,
1880
    wxID_JUSTIFY_LEFT,
1881
    wxID_UNDERLINE,
1882
    wxID_INDENT,
1883
    wxID_UNINDENT,
1884
    wxID_ZOOM_100,
1885
    wxID_ZOOM_FIT,
1886
    wxID_ZOOM_IN,
1887
    wxID_ZOOM_OUT,
1888
    wxID_UNDELETE,
1889
    wxID_REVERT_TO_SAVED,
1890
    wxID_CDROM,
1891
    wxID_CONVERT,
1892
    wxID_EXECUTE,
1893
    wxID_FLOPPY,
1894
    wxID_HARDDISK,
1895
    wxID_BOTTOM,
1896
    wxID_FIRST,
1897
    wxID_LAST,
1898
    wxID_TOP,
1899
    wxID_INFO,
1900
    wxID_JUMP_TO,
1901
    wxID_NETWORK,
1902
    wxID_SELECT_COLOR,
1903
    wxID_SELECT_FONT,
1904
    wxID_SORT_ASCENDING,
1905
    wxID_SORT_DESCENDING,
1906
    wxID_SPELL_CHECK,
1907
    wxID_STRIKETHROUGH,
1908
1909
    /*  System menu IDs (used by wxUniv): */
1910
    wxID_SYSTEM_MENU = 5200,
1911
    wxID_CLOSE_FRAME,
1912
    wxID_MOVE_FRAME,
1913
    wxID_RESIZE_FRAME,
1914
    wxID_MAXIMIZE_FRAME,
1915
    wxID_ICONIZE_FRAME,
1916
    wxID_RESTORE_FRAME,
1917
1918
    /* MDI window menu ids */
1919
    wxID_MDI_WINDOW_FIRST = 5230,
1920
    wxID_MDI_WINDOW_CASCADE = wxID_MDI_WINDOW_FIRST,
1921
    wxID_MDI_WINDOW_TILE_HORZ,
1922
    wxID_MDI_WINDOW_TILE_VERT,
1923
    wxID_MDI_WINDOW_ARRANGE_ICONS,
1924
    wxID_MDI_WINDOW_PREV,
1925
    wxID_MDI_WINDOW_NEXT,
1926
    wxID_MDI_WINDOW_LAST = wxID_MDI_WINDOW_NEXT,
1927
1928
    /* OS X system menu ids */
1929
    wxID_OSX_MENU_FIRST = 5250,
1930
    wxID_OSX_HIDE = wxID_OSX_MENU_FIRST,
1931
    wxID_OSX_HIDEOTHERS,
1932
    wxID_OSX_SHOWALL,
1933
    wxID_OSX_SERVICES,
1934
    wxID_OSX_MENU_LAST = wxID_OSX_SERVICES,
1935
1936
    /*  IDs used by generic file dialog (13 consecutive starting from this value) */
1937
    wxID_FILEDLGG = 5900,
1938
1939
    /*  IDs used by generic file ctrl (4 consecutive starting from this value) */
1940
    wxID_FILECTRL = 5950,
1941
1942
    /* Lowest ID not reserved for standard wx IDs greater than wxID_LOWEST */
1943
    wxID_HIGHEST = 6000
1944
};
1945
1946
/*  ---------------------------------------------------------------------------- */
1947
/*  wxWindowID type                                                              */
1948
/*  ---------------------------------------------------------------------------- */
1949
1950
/* Note that this is defined even in non-GUI code as the same type is also used
1951
   for e.g. timer IDs. */
1952
typedef int wxWindowID;
1953
1954
/*  ---------------------------------------------------------------------------- */
1955
/*  other constants */
1956
/*  ---------------------------------------------------------------------------- */
1957
1958
/*  menu and toolbar item kinds */
1959
enum wxItemKind
1960
{
1961
    wxITEM_SEPARATOR = -1,
1962
    wxITEM_NORMAL,
1963
    wxITEM_CHECK,
1964
    wxITEM_RADIO,
1965
    wxITEM_DROPDOWN,
1966
    wxITEM_MAX
1967
};
1968
1969
/*
1970
 * The possible states of a 3-state checkbox (Compatible
1971
 * with the 2-state checkbox).
1972
 */
1973
enum wxCheckBoxState
1974
{
1975
    wxCHK_UNCHECKED,
1976
    wxCHK_CHECKED,
1977
    wxCHK_UNDETERMINED /* 3-state checkbox only */
1978
};
1979
1980
1981
/*  hit test results */
1982
enum wxHitTest
1983
{
1984
    wxHT_NOWHERE,
1985
1986
    /*  scrollbar */
1987
    wxHT_SCROLLBAR_FIRST = wxHT_NOWHERE,
1988
    wxHT_SCROLLBAR_ARROW_LINE_1,    /*  left or upper arrow to scroll by line */
1989
    wxHT_SCROLLBAR_ARROW_LINE_2,    /*  right or down */
1990
    wxHT_SCROLLBAR_ARROW_PAGE_1,    /*  left or upper arrow to scroll by page */
1991
    wxHT_SCROLLBAR_ARROW_PAGE_2,    /*  right or down */
1992
    wxHT_SCROLLBAR_THUMB,           /*  on the thumb */
1993
    wxHT_SCROLLBAR_BAR_1,           /*  bar to the left/above the thumb */
1994
    wxHT_SCROLLBAR_BAR_2,           /*  bar to the right/below the thumb */
1995
    wxHT_SCROLLBAR_LAST,
1996
1997
    /*  window */
1998
    wxHT_WINDOW_OUTSIDE,            /*  not in this window at all */
1999
    wxHT_WINDOW_INSIDE,             /*  in the client area */
2000
    wxHT_WINDOW_VERT_SCROLLBAR,     /*  on the vertical scrollbar */
2001
    wxHT_WINDOW_HORZ_SCROLLBAR,     /*  on the horizontal scrollbar */
2002
    wxHT_WINDOW_CORNER,             /*  on the corner between 2 scrollbars */
2003
2004
    wxHT_MAX
2005
};
2006
2007
/*  ---------------------------------------------------------------------------- */
2008
/*  Possible SetSize flags */
2009
/*  ---------------------------------------------------------------------------- */
2010
2011
/*  Use internally-calculated width if -1 */
2012
#define wxSIZE_AUTO_WIDTH       0x0001
2013
/*  Use internally-calculated height if -1 */
2014
#define wxSIZE_AUTO_HEIGHT      0x0002
2015
/*  Use internally-calculated width and height if each is -1 */
2016
#define wxSIZE_AUTO             (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT)
2017
/*  Ignore missing (-1) dimensions (use existing). */
2018
/*  For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code. */
2019
#define wxSIZE_USE_EXISTING     0x0000
2020
/*  Allow -1 as a valid position */
2021
#define wxSIZE_ALLOW_MINUS_ONE  0x0004
2022
/*  Don't do parent client adjustments (for implementation only) */
2023
#define wxSIZE_NO_ADJUSTMENTS   0x0008
2024
/*  Change the window position even if it seems to be already correct */
2025
#define wxSIZE_FORCE            0x0010
2026
/*  Emit size event even if size didn't change */
2027
#define wxSIZE_FORCE_EVENT      0x0020
2028
2029
/*  ---------------------------------------------------------------------------- */
2030
/*  GDI descriptions */
2031
/*  ---------------------------------------------------------------------------- */
2032
2033
// Hatch styles used by both pen and brush styles.
2034
//
2035
// NB: Do not use these constants directly, they're for internal use only, use
2036
//     wxBRUSHSTYLE_XXX_HATCH and wxPENSTYLE_XXX_HATCH instead.
2037
enum wxHatchStyle
2038
{
2039
    wxHATCHSTYLE_INVALID = -1,
2040
2041
    /*
2042
        The value of the first style is chosen to fit with
2043
        wxDeprecatedGUIConstants values below, don't change it.
2044
     */
2045
    wxHATCHSTYLE_FIRST = 111,
2046
    wxHATCHSTYLE_BDIAGONAL = wxHATCHSTYLE_FIRST,
2047
    wxHATCHSTYLE_CROSSDIAG,
2048
    wxHATCHSTYLE_FDIAGONAL,
2049
    wxHATCHSTYLE_CROSS,
2050
    wxHATCHSTYLE_HORIZONTAL,
2051
    wxHATCHSTYLE_VERTICAL,
2052
    wxHATCHSTYLE_LAST = wxHATCHSTYLE_VERTICAL
2053
};
2054
2055
/*
2056
    WARNING: the following styles are deprecated; use the
2057
             wxFontFamily, wxFontStyle, wxFontWeight, wxBrushStyle,
2058
             wxPenStyle, wxPenCap, wxPenJoin enum values instead!
2059
*/
2060
2061
/* don't use any elements of this enum in the new code */
2062
enum wxDeprecatedGUIConstants
2063
{
2064
    /*  Text font families */
2065
    wxDEFAULT    = 70,
2066
    wxDECORATIVE,
2067
    wxROMAN,
2068
    wxSCRIPT,
2069
    wxSWISS,
2070
    wxMODERN,
2071
    wxTELETYPE,  /* @@@@ */
2072
2073
    /*  Proportional or Fixed width fonts (not yet used) */
2074
    wxVARIABLE   = 80,
2075
    wxFIXED,
2076
2077
    wxNORMAL     = 90,
2078
    wxLIGHT,
2079
    wxBOLD,
2080
    /*  Also wxNORMAL for normal (non-italic text) */
2081
    wxITALIC,
2082
    wxSLANT,
2083
2084
    /*  Pen styles */
2085
    wxSOLID      =   100,
2086
    wxDOT,
2087
    wxLONG_DASH,
2088
    wxSHORT_DASH,
2089
    wxDOT_DASH,
2090
    wxUSER_DASH,
2091
2092
    wxTRANSPARENT,
2093
2094
    /*  Brush & Pen Stippling. Note that a stippled pen cannot be dashed!! */
2095
    /*  Note also that stippling a Pen IS meaningful, because a Line is */
2096
    wxSTIPPLE_MASK_OPAQUE, /* mask is used for blitting monochrome using text fore and back ground colors */
2097
    wxSTIPPLE_MASK,        /* mask is used for masking areas in the stipple bitmap (TO DO) */
2098
    /*  drawn with a Pen, and without any Brush -- and it can be stippled. */
2099
    wxSTIPPLE =          110,
2100
2101
    wxBDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
2102
    wxCROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
2103
    wxFDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
2104
    wxCROSS_HATCH = wxHATCHSTYLE_CROSS,
2105
    wxHORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
2106
    wxVERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
2107
    wxFIRST_HATCH = wxHATCHSTYLE_FIRST,
2108
    wxLAST_HATCH = wxHATCHSTYLE_LAST
2109
};
2110
2111
/*  ToolPanel in wxFrame (VZ: unused?) */
2112
enum
2113
{
2114
    wxTOOL_TOP = 1,
2115
    wxTOOL_BOTTOM,
2116
    wxTOOL_LEFT,
2117
    wxTOOL_RIGHT
2118
};
2119
2120
/*  the values of the format constants should be the same as corresponding */
2121
/*  CF_XXX constants in Windows API */
2122
enum wxDataFormatId
2123
{
2124
    wxDF_INVALID =          0,
2125
    wxDF_TEXT =             1,  /* CF_TEXT */
2126
    wxDF_BITMAP =           2,  /* CF_BITMAP */
2127
    wxDF_METAFILE =         3,  /* CF_METAFILEPICT */
2128
    wxDF_SYLK =             4,
2129
    wxDF_DIF =              5,
2130
    wxDF_TIFF =             6,
2131
    wxDF_OEMTEXT =          7,  /* CF_OEMTEXT */
2132
    wxDF_DIB =              8,  /* CF_DIB */
2133
    wxDF_PALETTE =          9,
2134
    wxDF_PENDATA =          10,
2135
    wxDF_RIFF =             11,
2136
    wxDF_WAVE =             12,
2137
    wxDF_UNICODETEXT =      13,
2138
    wxDF_ENHMETAFILE =      14,
2139
    wxDF_FILENAME =         15, /* CF_HDROP */
2140
    wxDF_LOCALE =           16,
2141
    wxDF_PRIVATE =          20,
2142
    wxDF_HTML =             30, /* Note: does not correspond to CF_ constant */
2143
    wxDF_PNG =              31, /* Note: does not correspond to CF_ constant */
2144
    wxDF_MAX
2145
};
2146
2147
/* Key codes */
2148
enum wxKeyCode
2149
{
2150
    WXK_NONE    =    0,
2151
2152
    WXK_CONTROL_A = 1,
2153
    WXK_CONTROL_B,
2154
    WXK_CONTROL_C,
2155
    WXK_CONTROL_D,
2156
    WXK_CONTROL_E,
2157
    WXK_CONTROL_F,
2158
    WXK_CONTROL_G,
2159
    WXK_CONTROL_H,
2160
    WXK_CONTROL_I,
2161
    WXK_CONTROL_J,
2162
    WXK_CONTROL_K,
2163
    WXK_CONTROL_L,
2164
    WXK_CONTROL_M,
2165
    WXK_CONTROL_N,
2166
    WXK_CONTROL_O,
2167
    WXK_CONTROL_P,
2168
    WXK_CONTROL_Q,
2169
    WXK_CONTROL_R,
2170
    WXK_CONTROL_S,
2171
    WXK_CONTROL_T,
2172
    WXK_CONTROL_U,
2173
    WXK_CONTROL_V,
2174
    WXK_CONTROL_W,
2175
    WXK_CONTROL_X,
2176
    WXK_CONTROL_Y,
2177
    WXK_CONTROL_Z,
2178
2179
    WXK_BACK    =    8, /* backspace */
2180
    WXK_TAB     =    9,
2181
    WXK_RETURN  =    13,
2182
    WXK_ESCAPE  =    27,
2183
2184
    /* values from 33 to 126 are reserved for the standard ASCII characters */
2185
2186
    WXK_SPACE   =    32,
2187
    WXK_DELETE  =    127,
2188
2189
    /* values from 128 to 255 are reserved for ASCII extended characters
2190
       (note that there isn't a single fixed standard for the meaning
2191
       of these values; avoid them in portable apps!) */
2192
2193
    /* These are not compatible with unicode characters.
2194
       If you want to get a unicode character from a key event, use
2195
       wxKeyEvent::GetUnicodeKey                                    */
2196
    WXK_START   = 300,
2197
    WXK_LBUTTON,
2198
    WXK_RBUTTON,
2199
    WXK_CANCEL,
2200
    WXK_MBUTTON,
2201
    WXK_CLEAR,
2202
    WXK_SHIFT,
2203
    WXK_ALT,
2204
    WXK_CONTROL,
2205
    WXK_MENU,
2206
    WXK_PAUSE,
2207
    WXK_CAPITAL,
2208
    WXK_END,
2209
    WXK_HOME,
2210
    WXK_LEFT,
2211
    WXK_UP,
2212
    WXK_RIGHT,
2213
    WXK_DOWN,
2214
    WXK_SELECT,
2215
    WXK_PRINT,
2216
    WXK_EXECUTE,
2217
    WXK_SNAPSHOT,
2218
    WXK_INSERT,
2219
    WXK_HELP,
2220
    WXK_NUMPAD0,
2221
    WXK_NUMPAD1,
2222
    WXK_NUMPAD2,
2223
    WXK_NUMPAD3,
2224
    WXK_NUMPAD4,
2225
    WXK_NUMPAD5,
2226
    WXK_NUMPAD6,
2227
    WXK_NUMPAD7,
2228
    WXK_NUMPAD8,
2229
    WXK_NUMPAD9,
2230
    WXK_MULTIPLY,
2231
    WXK_ADD,
2232
    WXK_SEPARATOR,
2233
    WXK_SUBTRACT,
2234
    WXK_DECIMAL,
2235
    WXK_DIVIDE,
2236
    WXK_F1,
2237
    WXK_F2,
2238
    WXK_F3,
2239
    WXK_F4,
2240
    WXK_F5,
2241
    WXK_F6,
2242
    WXK_F7,
2243
    WXK_F8,
2244
    WXK_F9,
2245
    WXK_F10,
2246
    WXK_F11,
2247
    WXK_F12,
2248
    WXK_F13,
2249
    WXK_F14,
2250
    WXK_F15,
2251
    WXK_F16,
2252
    WXK_F17,
2253
    WXK_F18,
2254
    WXK_F19,
2255
    WXK_F20,
2256
    WXK_F21,
2257
    WXK_F22,
2258
    WXK_F23,
2259
    WXK_F24,
2260
    WXK_NUMLOCK,
2261
    WXK_SCROLL,
2262
    WXK_PAGEUP,
2263
    WXK_PAGEDOWN,
2264
    WXK_NUMPAD_SPACE,
2265
    WXK_NUMPAD_TAB,
2266
    WXK_NUMPAD_ENTER,
2267
    WXK_NUMPAD_F1,
2268
    WXK_NUMPAD_F2,
2269
    WXK_NUMPAD_F3,
2270
    WXK_NUMPAD_F4,
2271
    WXK_NUMPAD_HOME,
2272
    WXK_NUMPAD_LEFT,
2273
    WXK_NUMPAD_UP,
2274
    WXK_NUMPAD_RIGHT,
2275
    WXK_NUMPAD_DOWN,
2276
    WXK_NUMPAD_PAGEUP,
2277
    WXK_NUMPAD_PAGEDOWN,
2278
    WXK_NUMPAD_END,
2279
    WXK_NUMPAD_BEGIN,
2280
    WXK_NUMPAD_INSERT,
2281
    WXK_NUMPAD_DELETE,
2282
    WXK_NUMPAD_EQUAL,
2283
    WXK_NUMPAD_MULTIPLY,
2284
    WXK_NUMPAD_ADD,
2285
    WXK_NUMPAD_SEPARATOR,
2286
    WXK_NUMPAD_SUBTRACT,
2287
    WXK_NUMPAD_DECIMAL,
2288
    WXK_NUMPAD_DIVIDE,
2289
2290
    WXK_WINDOWS_LEFT,
2291
    WXK_WINDOWS_RIGHT,
2292
    WXK_WINDOWS_MENU ,
2293
#ifdef __WXOSX__
2294
    WXK_RAW_CONTROL,
2295
#else
2296
    WXK_RAW_CONTROL = WXK_CONTROL,
2297
#endif
2298
    WXK_COMMAND = WXK_CONTROL,
2299
2300
    /* Hardware-specific buttons */
2301
    WXK_SPECIAL1 = WXK_WINDOWS_MENU + 2, /* Skip WXK_RAW_CONTROL if necessary */
2302
    WXK_SPECIAL2,
2303
    WXK_SPECIAL3,
2304
    WXK_SPECIAL4,
2305
    WXK_SPECIAL5,
2306
    WXK_SPECIAL6,
2307
    WXK_SPECIAL7,
2308
    WXK_SPECIAL8,
2309
    WXK_SPECIAL9,
2310
    WXK_SPECIAL10,
2311
    WXK_SPECIAL11,
2312
    WXK_SPECIAL12,
2313
    WXK_SPECIAL13,
2314
    WXK_SPECIAL14,
2315
    WXK_SPECIAL15,
2316
    WXK_SPECIAL16,
2317
    WXK_SPECIAL17,
2318
    WXK_SPECIAL18,
2319
    WXK_SPECIAL19,
2320
    WXK_SPECIAL20,
2321
2322
    WXK_BROWSER_BACK,
2323
    WXK_BROWSER_FORWARD,
2324
    WXK_BROWSER_REFRESH,
2325
    WXK_BROWSER_STOP,
2326
    WXK_BROWSER_SEARCH,
2327
    WXK_BROWSER_FAVORITES,
2328
    WXK_BROWSER_HOME,
2329
    WXK_VOLUME_MUTE,
2330
    WXK_VOLUME_DOWN,
2331
    WXK_VOLUME_UP,
2332
    WXK_MEDIA_NEXT_TRACK,
2333
    WXK_MEDIA_PREV_TRACK,
2334
    WXK_MEDIA_STOP,
2335
    WXK_MEDIA_PLAY_PAUSE,
2336
    WXK_LAUNCH_MAIL,
2337
2338
    // Events for these keys are currently only generated by wxGTK, with the
2339
    // exception of WXK_LAUNCH_{A,B}, see WXK_LAUNCH_APP{1,2} below.
2340
    WXK_LAUNCH_0,
2341
    WXK_LAUNCH_1,
2342
    WXK_LAUNCH_2,
2343
    WXK_LAUNCH_3,
2344
    WXK_LAUNCH_4,
2345
    WXK_LAUNCH_5,
2346
    WXK_LAUNCH_6,
2347
    WXK_LAUNCH_7,
2348
    WXK_LAUNCH_8,
2349
    WXK_LAUNCH_9,
2350
    WXK_LAUNCH_A,
2351
    WXK_LAUNCH_B,
2352
    WXK_LAUNCH_C,
2353
    WXK_LAUNCH_D,
2354
    WXK_LAUNCH_E,
2355
    WXK_LAUNCH_F,
2356
2357
    // These constants are the same as the corresponding GTK keys, so give them
2358
    // the same value, but they are also generated by wxMSW.
2359
    WXK_LAUNCH_APP1 = WXK_LAUNCH_A,
2360
    WXK_LAUNCH_APP2 = WXK_LAUNCH_B,
2361
2362
    // This one provides a portable way to refer to the key event generated by
2363
    // the "5" key on the numpad when Num Lock is off.
2364
#ifdef __WXMSW__
2365
    WXK_NUMPAD_CENTER = WXK_CLEAR
2366
#else
2367
    WXK_NUMPAD_CENTER = WXK_NUMPAD_BEGIN
2368
#endif
2369
};
2370
2371
/* This enum contains bit mask constants used in wxKeyEvent */
2372
enum wxKeyModifier
2373
{
2374
    wxMOD_NONE      = 0x0000,
2375
    wxMOD_ALT       = 0x0001,
2376
    wxMOD_CONTROL   = 0x0002,
2377
    wxMOD_ALTGR     = wxMOD_ALT | wxMOD_CONTROL,
2378
    wxMOD_SHIFT     = 0x0004,
2379
    wxMOD_META      = 0x0008,
2380
    wxMOD_WIN       = wxMOD_META,
2381
#if defined(__WXMAC__)
2382
    wxMOD_RAW_CONTROL = 0x0010,
2383
#else
2384
    wxMOD_RAW_CONTROL = wxMOD_CONTROL,
2385
#endif
2386
    wxMOD_CMD       = wxMOD_CONTROL,
2387
    wxMOD_ALL       = 0xffff
2388
};
2389
2390
/* Shortcut for easier dialog-unit-to-pixel conversion */
2391
#define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
2392
2393
/* Paper types */
2394
enum wxPaperSize
2395
{
2396
    wxPAPER_NONE,               /*  Use specific dimensions */
2397
    wxPAPER_LETTER,             /*  Letter, 8 1/2 by 11 inches */
2398
    wxPAPER_LEGAL,              /*  Legal, 8 1/2 by 14 inches */
2399
    wxPAPER_A4,                 /*  A4 Sheet, 210 by 297 millimeters */
2400
    wxPAPER_CSHEET,             /*  C Sheet, 17 by 22 inches */
2401
    wxPAPER_DSHEET,             /*  D Sheet, 22 by 34 inches */
2402
    wxPAPER_ESHEET,             /*  E Sheet, 34 by 44 inches */
2403
    wxPAPER_LETTERSMALL,        /*  Letter Small, 8 1/2 by 11 inches */
2404
    wxPAPER_TABLOID,            /*  Tabloid, 11 by 17 inches */
2405
    wxPAPER_LEDGER,             /*  Ledger, 17 by 11 inches */
2406
    wxPAPER_STATEMENT,          /*  Statement, 5 1/2 by 8 1/2 inches */
2407
    wxPAPER_EXECUTIVE,          /*  Executive, 7 1/4 by 10 1/2 inches */
2408
    wxPAPER_A3,                 /*  A3 sheet, 297 by 420 millimeters */
2409
    wxPAPER_A4SMALL,            /*  A4 small sheet, 210 by 297 millimeters */
2410
    wxPAPER_A5,                 /*  A5 sheet, 148 by 210 millimeters */
2411
    wxPAPER_B4,                 /*  B4 sheet, 250 by 354 millimeters */
2412
    wxPAPER_B5,                 /*  B5 sheet, 182-by-257-millimeter paper */
2413
    wxPAPER_FOLIO,              /*  Folio, 8-1/2-by-13-inch paper */
2414
    wxPAPER_QUARTO,             /*  Quarto, 215-by-275-millimeter paper */
2415
    wxPAPER_10X14,              /*  10-by-14-inch sheet */
2416
    wxPAPER_11X17,              /*  11-by-17-inch sheet */
2417
    wxPAPER_NOTE,               /*  Note, 8 1/2 by 11 inches */
2418
    wxPAPER_ENV_9,              /*  #9 Envelope, 3 7/8 by 8 7/8 inches */
2419
    wxPAPER_ENV_10,             /*  #10 Envelope, 4 1/8 by 9 1/2 inches */
2420
    wxPAPER_ENV_11,             /*  #11 Envelope, 4 1/2 by 10 3/8 inches */
2421
    wxPAPER_ENV_12,             /*  #12 Envelope, 4 3/4 by 11 inches */
2422
    wxPAPER_ENV_14,             /*  #14 Envelope, 5 by 11 1/2 inches */
2423
    wxPAPER_ENV_DL,             /*  DL Envelope, 110 by 220 millimeters */
2424
    wxPAPER_ENV_C5,             /*  C5 Envelope, 162 by 229 millimeters */
2425
    wxPAPER_ENV_C3,             /*  C3 Envelope, 324 by 458 millimeters */
2426
    wxPAPER_ENV_C4,             /*  C4 Envelope, 229 by 324 millimeters */
2427
    wxPAPER_ENV_C6,             /*  C6 Envelope, 114 by 162 millimeters */
2428
    wxPAPER_ENV_C65,            /*  C65 Envelope, 114 by 229 millimeters */
2429
    wxPAPER_ENV_B4,             /*  B4 Envelope, 250 by 353 millimeters */
2430
    wxPAPER_ENV_B5,             /*  B5 Envelope, 176 by 250 millimeters */
2431
    wxPAPER_ENV_B6,             /*  B6 Envelope, 176 by 125 millimeters */
2432
    wxPAPER_ENV_ITALY,          /*  Italy Envelope, 110 by 230 millimeters */
2433
    wxPAPER_ENV_MONARCH,        /*  Monarch Envelope, 3 7/8 by 7 1/2 inches */
2434
    wxPAPER_ENV_PERSONAL,       /*  6 3/4 Envelope, 3 5/8 by 6 1/2 inches */
2435
    wxPAPER_FANFOLD_US,         /*  US Std Fanfold, 14 7/8 by 11 inches */
2436
    wxPAPER_FANFOLD_STD_GERMAN, /*  German Std Fanfold, 8 1/2 by 12 inches */
2437
    wxPAPER_FANFOLD_LGL_GERMAN, /*  German Legal Fanfold, 8 1/2 by 13 inches */
2438
2439
    wxPAPER_ISO_B4,             /*  B4 (ISO) 250 x 353 mm */
2440
    wxPAPER_JAPANESE_POSTCARD,  /*  Japanese Postcard 100 x 148 mm */
2441
    wxPAPER_9X11,               /*  9 x 11 in */
2442
    wxPAPER_10X11,              /*  10 x 11 in */
2443
    wxPAPER_15X11,              /*  15 x 11 in */
2444
    wxPAPER_ENV_INVITE,         /*  Envelope Invite 220 x 220 mm */
2445
    wxPAPER_LETTER_EXTRA,       /*  Letter Extra 9 \275 x 12 in */
2446
    wxPAPER_LEGAL_EXTRA,        /*  Legal Extra 9 \275 x 15 in */
2447
    wxPAPER_TABLOID_EXTRA,      /*  Tabloid Extra 11.69 x 18 in */
2448
    wxPAPER_A4_EXTRA,           /*  A4 Extra 9.27 x 12.69 in */
2449
    wxPAPER_LETTER_TRANSVERSE,  /*  Letter Transverse 8 \275 x 11 in */
2450
    wxPAPER_A4_TRANSVERSE,      /*  A4 Transverse 210 x 297 mm */
2451
    wxPAPER_LETTER_EXTRA_TRANSVERSE, /*  Letter Extra Transverse 9\275 x 12 in */
2452
    wxPAPER_A_PLUS,             /*  SuperA/SuperA/A4 227 x 356 mm */
2453
    wxPAPER_B_PLUS,             /*  SuperB/SuperB/A3 305 x 487 mm */
2454
    wxPAPER_LETTER_PLUS,        /*  Letter Plus 8.5 x 12.69 in */
2455
    wxPAPER_A4_PLUS,            /*  A4 Plus 210 x 330 mm */
2456
    wxPAPER_A5_TRANSVERSE,      /*  A5 Transverse 148 x 210 mm */
2457
    wxPAPER_B5_TRANSVERSE,      /*  B5 (JIS) Transverse 182 x 257 mm */
2458
    wxPAPER_A3_EXTRA,           /*  A3 Extra 322 x 445 mm */
2459
    wxPAPER_A5_EXTRA,           /*  A5 Extra 174 x 235 mm */
2460
    wxPAPER_B5_EXTRA,           /*  B5 (ISO) Extra 201 x 276 mm */
2461
    wxPAPER_A2,                 /*  A2 420 x 594 mm */
2462
    wxPAPER_A3_TRANSVERSE,      /*  A3 Transverse 297 x 420 mm */
2463
    wxPAPER_A3_EXTRA_TRANSVERSE, /*  A3 Extra Transverse 322 x 445 mm */
2464
2465
    wxPAPER_DBL_JAPANESE_POSTCARD,/* Japanese Double Postcard 200 x 148 mm */
2466
    wxPAPER_A6,                 /* A6 105 x 148 mm */
2467
    wxPAPER_JENV_KAKU2,         /* Japanese Envelope Kaku #2 */
2468
    wxPAPER_JENV_KAKU3,         /* Japanese Envelope Kaku #3 */
2469
    wxPAPER_JENV_CHOU3,         /* Japanese Envelope Chou #3 */
2470
    wxPAPER_JENV_CHOU4,         /* Japanese Envelope Chou #4 */
2471
    wxPAPER_LETTER_ROTATED,     /* Letter Rotated 11 x 8 1/2 in */
2472
    wxPAPER_A3_ROTATED,         /* A3 Rotated 420 x 297 mm */
2473
    wxPAPER_A4_ROTATED,         /* A4 Rotated 297 x 210 mm */
2474
    wxPAPER_A5_ROTATED,         /* A5 Rotated 210 x 148 mm */
2475
    wxPAPER_B4_JIS_ROTATED,     /* B4 (JIS) Rotated 364 x 257 mm */
2476
    wxPAPER_B5_JIS_ROTATED,     /* B5 (JIS) Rotated 257 x 182 mm */
2477
    wxPAPER_JAPANESE_POSTCARD_ROTATED,/* Japanese Postcard Rotated 148 x 100 mm */
2478
    wxPAPER_DBL_JAPANESE_POSTCARD_ROTATED,/* Double Japanese Postcard Rotated 148 x 200 mm */
2479
    wxPAPER_A6_ROTATED,         /* A6 Rotated 148 x 105 mm */
2480
    wxPAPER_JENV_KAKU2_ROTATED, /* Japanese Envelope Kaku #2 Rotated */
2481
    wxPAPER_JENV_KAKU3_ROTATED, /* Japanese Envelope Kaku #3 Rotated */
2482
    wxPAPER_JENV_CHOU3_ROTATED, /* Japanese Envelope Chou #3 Rotated */
2483
    wxPAPER_JENV_CHOU4_ROTATED, /* Japanese Envelope Chou #4 Rotated */
2484
    wxPAPER_B6_JIS,             /* B6 (JIS) 128 x 182 mm */
2485
    wxPAPER_B6_JIS_ROTATED,     /* B6 (JIS) Rotated 182 x 128 mm */
2486
    wxPAPER_12X11,              /* 12 x 11 in */
2487
    wxPAPER_JENV_YOU4,          /* Japanese Envelope You #4 */
2488
    wxPAPER_JENV_YOU4_ROTATED,  /* Japanese Envelope You #4 Rotated */
2489
    wxPAPER_P16K,               /* PRC 16K 146 x 215 mm */
2490
    wxPAPER_P32K,               /* PRC 32K 97 x 151 mm */
2491
    wxPAPER_P32KBIG,            /* PRC 32K(Big) 97 x 151 mm */
2492
    wxPAPER_PENV_1,             /* PRC Envelope #1 102 x 165 mm */
2493
    wxPAPER_PENV_2,             /* PRC Envelope #2 102 x 176 mm */
2494
    wxPAPER_PENV_3,             /* PRC Envelope #3 125 x 176 mm */
2495
    wxPAPER_PENV_4,             /* PRC Envelope #4 110 x 208 mm */
2496
    wxPAPER_PENV_5,             /* PRC Envelope #5 110 x 220 mm */
2497
    wxPAPER_PENV_6,             /* PRC Envelope #6 120 x 230 mm */
2498
    wxPAPER_PENV_7,             /* PRC Envelope #7 160 x 230 mm */
2499
    wxPAPER_PENV_8,             /* PRC Envelope #8 120 x 309 mm */
2500
    wxPAPER_PENV_9,             /* PRC Envelope #9 229 x 324 mm */
2501
    wxPAPER_PENV_10,            /* PRC Envelope #10 324 x 458 mm */
2502
    wxPAPER_P16K_ROTATED,       /* PRC 16K Rotated */
2503
    wxPAPER_P32K_ROTATED,       /* PRC 32K Rotated */
2504
    wxPAPER_P32KBIG_ROTATED,    /* PRC 32K(Big) Rotated */
2505
    wxPAPER_PENV_1_ROTATED,     /* PRC Envelope #1 Rotated 165 x 102 mm */
2506
    wxPAPER_PENV_2_ROTATED,     /* PRC Envelope #2 Rotated 176 x 102 mm */
2507
    wxPAPER_PENV_3_ROTATED,     /* PRC Envelope #3 Rotated 176 x 125 mm */
2508
    wxPAPER_PENV_4_ROTATED,     /* PRC Envelope #4 Rotated 208 x 110 mm */
2509
    wxPAPER_PENV_5_ROTATED,     /* PRC Envelope #5 Rotated 220 x 110 mm */
2510
    wxPAPER_PENV_6_ROTATED,     /* PRC Envelope #6 Rotated 230 x 120 mm */
2511
    wxPAPER_PENV_7_ROTATED,     /* PRC Envelope #7 Rotated 230 x 160 mm */
2512
    wxPAPER_PENV_8_ROTATED,     /* PRC Envelope #8 Rotated 309 x 120 mm */
2513
    wxPAPER_PENV_9_ROTATED,     /* PRC Envelope #9 Rotated 324 x 229 mm */
2514
    wxPAPER_PENV_10_ROTATED,    /* PRC Envelope #10 Rotated 458 x 324 m */
2515
    wxPAPER_A0,                 /* A0 Sheet 841 x 1189 mm */
2516
    wxPAPER_A1                  /* A1 Sheet 594 x 841 mm */
2517
};
2518
2519
/* Printing orientation */
2520
enum wxPrintOrientation
2521
{
2522
   wxPORTRAIT = 1,
2523
   wxLANDSCAPE
2524
};
2525
2526
/* Duplex printing modes
2527
 */
2528
2529
enum wxDuplexMode
2530
{
2531
    wxDUPLEX_SIMPLEX, /*  Non-duplex */
2532
    wxDUPLEX_HORIZONTAL,
2533
    wxDUPLEX_VERTICAL
2534
};
2535
2536
/* Print quality.
2537
 */
2538
2539
#define wxPRINT_QUALITY_HIGH    -1
2540
#define wxPRINT_QUALITY_MEDIUM  -2
2541
#define wxPRINT_QUALITY_LOW     -3
2542
#define wxPRINT_QUALITY_DRAFT   -4
2543
2544
typedef int wxPrintQuality;
2545
2546
/* Print mode (currently PostScript only)
2547
 */
2548
2549
enum wxPrintMode
2550
{
2551
    wxPRINT_MODE_NONE =    0,
2552
    wxPRINT_MODE_PREVIEW = 1,   /*  Preview in external application */
2553
    wxPRINT_MODE_FILE =    2,   /*  Print to file */
2554
    wxPRINT_MODE_PRINTER = 3,   /*  Send to printer */
2555
    wxPRINT_MODE_STREAM =  4    /*  Send postscript data into a stream */
2556
};
2557
2558
/*  ---------------------------------------------------------------------------- */
2559
/*  UpdateWindowUI flags */
2560
/*  ---------------------------------------------------------------------------- */
2561
2562
enum wxUpdateUI
2563
{
2564
    wxUPDATE_UI_NONE          = 0x0000,
2565
    wxUPDATE_UI_RECURSE       = 0x0001,
2566
    wxUPDATE_UI_FROMIDLE      = 0x0002 /*  Invoked from On(Internal)Idle */
2567
};
2568
2569
2570
/* ---------------------------------------------------------------------------- */
2571
/* wxList types */
2572
/* ---------------------------------------------------------------------------- */
2573
2574
/* type of compare function for list sort operation (as in 'qsort'): it should
2575
   return a negative value, 0 or positive value if the first element is less
2576
   than, equal or greater than the second */
2577
2578
typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2);
2579
2580
/* wxList iterator function */
2581
typedef int (* LINKAGEMODE wxListIterateFunction)(void *current);
2582
2583
2584
/*  ---------------------------------------------------------------------------- */
2585
/*  miscellaneous */
2586
/*  ---------------------------------------------------------------------------- */
2587
2588
/*  macro to specify "All Files" on different platforms */
2589
#if defined(__WXMSW__)
2590
#   define wxALL_FILES_PATTERN   wxT("*.*")
2591
#   define wxALL_FILES           gettext_noop("All files (*.*)|*.*")
2592
#else
2593
#   define wxALL_FILES_PATTERN   wxT("*")
2594
#   define wxALL_FILES           gettext_noop("All files (*)|*")
2595
#endif
2596
2597
#if defined(__CYGWIN__) && defined(__WXMSW__)
2598
    /*
2599
       NASTY HACK because the gethostname in sys/unistd.h which the gnu
2600
       stl includes and wx builds with by default clash with each other
2601
       (windows version 2nd param is int, sys/unistd.h version is unsigned
2602
       int).
2603
     */
2604
#   define gethostname gethostnameHACK
2605
#   include <unistd.h>
2606
#   undef gethostname
2607
#endif
2608
2609
/*  --------------------------------------------------------------------------- */
2610
/*  macros that enable wxWidgets apps to be compiled in absence of the */
2611
/*  system headers, although some platform specific types are used in the */
2612
/*  platform specific (implementation) parts of the headers */
2613
/*  --------------------------------------------------------------------------- */
2614
2615
#ifdef __DARWIN__
2616
#define DECLARE_WXOSX_OPAQUE_CFREF( name ) typedef struct __##name* name##Ref;
2617
#define DECLARE_WXOSX_OPAQUE_CONST_CFREF( name ) typedef const struct __##name* name##Ref;
2618
2619
#define WX_OPAQUE_TYPE( name ) struct wxOpaque##name
2620
2621
typedef void*       WXHCURSOR;
2622
typedef void*       WXRECTPTR;
2623
typedef void*       WXPOINTPTR;
2624
typedef void*       WXHWND;
2625
typedef void*       WXEVENTREF;
2626
typedef void*       WXEVENTHANDLERREF;
2627
typedef void*       WXEVENTHANDLERCALLREF;
2628
typedef void*       WXAPPLEEVENTREF;
2629
2630
typedef unsigned int    WXUINT;
2631
typedef unsigned long   WXDWORD;
2632
typedef unsigned short  WXWORD;
2633
2634
typedef WX_OPAQUE_TYPE(PicHandle ) * WXHMETAFILE ;
2635
2636
/*
2637
 * core frameworks
2638
 */
2639
2640
#if __has_attribute(objc_bridge) && __has_feature(objc_bridge_id) && __has_feature(objc_bridge_id_on_typedefs)
2641
2642
#ifdef __OBJC__
2643
@class NSArray;
2644
@class NSString;
2645
@class NSData;
2646
@class NSDictionary;
2647
#endif
2648
2649
#define WXOSX_BRIDGED_TYPE(T)   __attribute__((objc_bridge(T)))
2650
#define WXOSX_BRIDGED_MUTABLE_TYPE(T) __attribute__((objc_bridge_mutable(T)))
2651
2652
#else
2653
2654
#define WXOSX_BRIDGED_TYPE(T)
2655
#define WXOSX_BRIDGED_MUTABLE_TYPE(T)
2656
2657
#endif
2658
2659
#define DECLARE_WXOSX_BRIDGED_TYPE_AND_CFREF( name ) \
2660
    typedef const struct WXOSX_BRIDGED_TYPE(NS##name) __CF##name* CF##name##Ref;
2661
#define DECLARE_WXOSX_BRIDGED_MUTABLE_TYPE_AND_CFREF( name ) \
2662
    typedef struct WXOSX_BRIDGED_MUTABLE_TYPE(NSMutable##name) __CF##name* CFMutable##name##Ref;
2663
2664
typedef const WXOSX_BRIDGED_TYPE(id) void * CFTypeRef;
2665
2666
DECLARE_WXOSX_BRIDGED_TYPE_AND_CFREF( Data )
2667
DECLARE_WXOSX_BRIDGED_MUTABLE_TYPE_AND_CFREF( Data )
2668
2669
DECLARE_WXOSX_BRIDGED_TYPE_AND_CFREF( String )
2670
DECLARE_WXOSX_BRIDGED_MUTABLE_TYPE_AND_CFREF( String )
2671
2672
DECLARE_WXOSX_BRIDGED_TYPE_AND_CFREF( Dictionary )
2673
DECLARE_WXOSX_BRIDGED_MUTABLE_TYPE_AND_CFREF( Dictionary )
2674
2675
DECLARE_WXOSX_BRIDGED_TYPE_AND_CFREF( Array )
2676
DECLARE_WXOSX_BRIDGED_MUTABLE_TYPE_AND_CFREF( Array )
2677
2678
DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoopSource )
2679
DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFont )
2680
DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFontDescriptor )
2681
2682
#define DECLARE_WXOSX_OPAQUE_CGREF( name ) typedef struct name* name##Ref;
2683
2684
DECLARE_WXOSX_OPAQUE_CGREF( CGColor )
2685
DECLARE_WXOSX_OPAQUE_CGREF( CGImage )
2686
DECLARE_WXOSX_OPAQUE_CGREF( CGContext )
2687
DECLARE_WXOSX_OPAQUE_CGREF( CGFont )
2688
2689
typedef CGColorRef    WXCOLORREF;
2690
typedef CGImageRef    WXCGIMAGEREF;
2691
typedef CGContextRef  WXHDC;
2692
typedef CGContextRef  WXHBITMAP;
2693
2694
/*
2695
 * carbon
2696
 */
2697
2698
typedef const struct __HIShape * HIShapeRef;
2699
typedef struct __HIShape * HIMutableShapeRef;
2700
2701
#define DECLARE_WXMAC_OPAQUE_REF( name ) typedef struct Opaque##name* name;
2702
2703
DECLARE_WXMAC_OPAQUE_REF( PasteboardRef )
2704
DECLARE_WXMAC_OPAQUE_REF( IconRef )
2705
DECLARE_WXMAC_OPAQUE_REF( MenuRef )
2706
2707
typedef IconRef WXHICON ;
2708
typedef HIShapeRef WXHRGN;
2709
2710
#endif // __WXMAC__
2711
2712
#ifdef __DARWIN__
2713
2714
/* Objective-C type declarations.
2715
 * These are to be used in public headers in lieu of NSSomething* because
2716
 * Objective-C class names are not available in C/C++ code.
2717
 */
2718
2719
/*  NOTE: This ought to work with other compilers too, but I'm being cautious */
2720
#if (defined(__GNUC__) && defined(__APPLE__))
2721
/* It's desirable to have type safety for Objective-C(++) code as it does
2722
at least catch typos of method names among other things.  However, it
2723
is not possible to declare an Objective-C class from plain old C or C++
2724
code.  Furthermore, because of C++ name mangling, the type name must
2725
be the same for both C++ and Objective-C++ code.  Therefore, we define
2726
what should be a pointer to an Objective-C class as a pointer to a plain
2727
old C struct with the same name.  Unfortunately, because the compiler
2728
does not see a struct as an Objective-C class we cannot declare it
2729
as a struct in Objective-C(++) mode.
2730
*/
2731
#if defined(__OBJC__)
2732
#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
2733
@class klass; \
2734
typedef klass *WX_##klass
2735
#else /*  not defined(__OBJC__) */
2736
#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
2737
typedef struct klass *WX_##klass
2738
#endif /*  defined(__OBJC__) */
2739
2740
#else /*  not Apple's gcc */
2741
#warning "Objective-C types will not be checked by the compiler."
2742
/*  NOTE: typedef struct objc_object *id; */
2743
/*  IOW, we're declaring these using the id type without using that name, */
2744
/*  since "id" is used extensively not only within wxWidgets itself, but */
2745
/*  also in wxWidgets application code.  The following works fine when */
2746
/*  compiling C(++) code, and works without typesafety for Obj-C(++) code */
2747
#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
2748
typedef struct objc_object *WX_##klass
2749
2750
#endif /*  (defined(__GNUC__) && defined(__APPLE__)) */
2751
2752
DECLARE_WXCOCOA_OBJC_CLASS(NSArray);
2753
DECLARE_WXCOCOA_OBJC_CLASS(NSData);
2754
DECLARE_WXCOCOA_OBJC_CLASS(NSMutableArray);
2755
DECLARE_WXCOCOA_OBJC_CLASS(NSString);
2756
DECLARE_WXCOCOA_OBJC_CLASS(NSObject);
2757
2758
#if wxOSX_USE_COCOA
2759
2760
DECLARE_WXCOCOA_OBJC_CLASS(NSApplication);
2761
DECLARE_WXCOCOA_OBJC_CLASS(NSBitmapImageRep);
2762
DECLARE_WXCOCOA_OBJC_CLASS(NSBox);
2763
DECLARE_WXCOCOA_OBJC_CLASS(NSButton);
2764
DECLARE_WXCOCOA_OBJC_CLASS(NSColor);
2765
DECLARE_WXCOCOA_OBJC_CLASS(NSColorPanel);
2766
DECLARE_WXCOCOA_OBJC_CLASS(NSControl);
2767
DECLARE_WXCOCOA_OBJC_CLASS(NSCursor);
2768
DECLARE_WXCOCOA_OBJC_CLASS(NSEvent);
2769
DECLARE_WXCOCOA_OBJC_CLASS(NSFont);
2770
DECLARE_WXCOCOA_OBJC_CLASS(NSFontDescriptor);
2771
DECLARE_WXCOCOA_OBJC_CLASS(NSFontPanel);
2772
DECLARE_WXCOCOA_OBJC_CLASS(NSImage);
2773
DECLARE_WXCOCOA_OBJC_CLASS(NSLayoutManager);
2774
DECLARE_WXCOCOA_OBJC_CLASS(NSMenu);
2775
DECLARE_WXCOCOA_OBJC_CLASS(NSMenuExtra);
2776
DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem);
2777
DECLARE_WXCOCOA_OBJC_CLASS(NSNotification);
2778
DECLARE_WXCOCOA_OBJC_CLASS(NSPanel);
2779
DECLARE_WXCOCOA_OBJC_CLASS(NSResponder);
2780
DECLARE_WXCOCOA_OBJC_CLASS(NSScrollView);
2781
DECLARE_WXCOCOA_OBJC_CLASS(NSSound);
2782
DECLARE_WXCOCOA_OBJC_CLASS(NSStatusItem);
2783
DECLARE_WXCOCOA_OBJC_CLASS(NSTableColumn);
2784
DECLARE_WXCOCOA_OBJC_CLASS(NSTableView);
2785
DECLARE_WXCOCOA_OBJC_CLASS(NSTextContainer);
2786
DECLARE_WXCOCOA_OBJC_CLASS(NSTextField);
2787
DECLARE_WXCOCOA_OBJC_CLASS(NSTextStorage);
2788
DECLARE_WXCOCOA_OBJC_CLASS(NSThread);
2789
DECLARE_WXCOCOA_OBJC_CLASS(NSWindow);
2790
DECLARE_WXCOCOA_OBJC_CLASS(NSView);
2791
DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLContext);
2792
DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLPixelFormat);
2793
DECLARE_WXCOCOA_OBJC_CLASS(NSPrintInfo);
2794
DECLARE_WXCOCOA_OBJC_CLASS(NSGestureRecognizer);
2795
DECLARE_WXCOCOA_OBJC_CLASS(NSPanGestureRecognizer);
2796
DECLARE_WXCOCOA_OBJC_CLASS(NSMagnificationGestureRecognizer);
2797
DECLARE_WXCOCOA_OBJC_CLASS(NSRotationGestureRecognizer);
2798
DECLARE_WXCOCOA_OBJC_CLASS(NSPressGestureRecognizer);
2799
DECLARE_WXCOCOA_OBJC_CLASS(NSTouch);
2800
DECLARE_WXCOCOA_OBJC_CLASS(NSPasteboard);
2801
DECLARE_WXCOCOA_OBJC_CLASS(WKWebView);
2802
2803
typedef WX_NSWindow WXWindow;
2804
typedef WX_NSView WXWidget;
2805
typedef WX_NSImage WXImage;
2806
typedef WX_NSMenu WXHMENU;
2807
typedef WX_NSOpenGLPixelFormat WXGLPixelFormat;
2808
typedef WX_NSOpenGLContext WXGLContext;
2809
typedef WX_NSPasteboard OSXPasteboard;
2810
typedef WX_WKWebView OSXWebViewPtr;
2811
2812
#elif wxOSX_USE_IPHONE
2813
2814
DECLARE_WXCOCOA_OBJC_CLASS(UIMenu);
2815
DECLARE_WXCOCOA_OBJC_CLASS(UIMenuItem);
2816
DECLARE_WXCOCOA_OBJC_CLASS(UIWindow);
2817
DECLARE_WXCOCOA_OBJC_CLASS(UImage);
2818
DECLARE_WXCOCOA_OBJC_CLASS(UIView);
2819
DECLARE_WXCOCOA_OBJC_CLASS(UIFont);
2820
DECLARE_WXCOCOA_OBJC_CLASS(UIImage);
2821
DECLARE_WXCOCOA_OBJC_CLASS(UIEvent);
2822
DECLARE_WXCOCOA_OBJC_CLASS(NSSet);
2823
DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext);
2824
DECLARE_WXCOCOA_OBJC_CLASS(UIPasteboard);
2825
2826
typedef WX_UIWindow WXWindow;
2827
typedef WX_UIView WXWidget;
2828
typedef WX_UIImage WXImage;
2829
typedef WX_UIMenu WXHMENU;
2830
typedef WX_EAGLContext WXGLContext;
2831
typedef WX_NSString WXGLPixelFormat;
2832
typedef WX_UIPasteboard WXOSXPasteboard;
2833
2834
#endif
2835
2836
2837
2838
#endif /* __WXMAC__ */
2839
2840
/* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */
2841
#if defined(__WIN32__)
2842
2843
/*  Stand-ins for Windows types to avoid #including all of windows.h */
2844
2845
#ifndef NO_STRICT
2846
    #define WX_MSW_DECLARE_HANDLE(type) typedef struct type##__ * WX##type
2847
#else
2848
    #define WX_MSW_DECLARE_HANDLE(type) typedef void * WX##type
2849
#endif
2850
2851
typedef void* WXHANDLE;
2852
WX_MSW_DECLARE_HANDLE(HWND);
2853
WX_MSW_DECLARE_HANDLE(HICON);
2854
WX_MSW_DECLARE_HANDLE(HFONT);
2855
WX_MSW_DECLARE_HANDLE(HMENU);
2856
WX_MSW_DECLARE_HANDLE(HPEN);
2857
WX_MSW_DECLARE_HANDLE(HBRUSH);
2858
WX_MSW_DECLARE_HANDLE(HPALETTE);
2859
WX_MSW_DECLARE_HANDLE(HCURSOR);
2860
WX_MSW_DECLARE_HANDLE(HRGN);
2861
WX_MSW_DECLARE_HANDLE(RECTPTR);
2862
WX_MSW_DECLARE_HANDLE(HACCEL);
2863
WX_MSW_DECLARE_HANDLE(HINSTANCE);
2864
WX_MSW_DECLARE_HANDLE(HBITMAP);
2865
WX_MSW_DECLARE_HANDLE(HIMAGELIST);
2866
WX_MSW_DECLARE_HANDLE(HGLOBAL);
2867
WX_MSW_DECLARE_HANDLE(HDC);
2868
WX_MSW_DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
2869
typedef WXHINSTANCE WXHMODULE;
2870
2871
#undef WX_MSW_DECLARE_HANDLE
2872
2873
typedef unsigned int    WXUINT;
2874
typedef unsigned long   WXDWORD;
2875
typedef unsigned short  WXWORD;
2876
2877
typedef unsigned long   WXCOLORREF;
2878
typedef void *          WXRGNDATA;
2879
typedef struct tagMSG   WXMSG;
2880
typedef void *          WXHCONV;
2881
typedef void *          WXHKEY;
2882
typedef void *          WXHTREEITEM;
2883
2884
typedef void *          WXDRAWITEMSTRUCT;
2885
typedef void *          WXMEASUREITEMSTRUCT;
2886
typedef void *          WXLPCREATESTRUCT;
2887
2888
#ifdef __WXMSW__
2889
typedef WXHWND          WXWidget;
2890
#endif
2891
2892
#ifdef __WIN64__
2893
typedef wxUint64           WXWPARAM;
2894
typedef wxInt64            WXLPARAM;
2895
typedef wxInt64            WXLRESULT;
2896
#else
2897
typedef unsigned int       WXWPARAM;
2898
typedef long               WXLPARAM;
2899
typedef long               WXLRESULT;
2900
#endif
2901
2902
/*
2903
   This is defined for compatibility only, it's not really the same thing as
2904
   FARPROC.
2905
 */
2906
#if defined(__GNUWIN32__)
2907
typedef int             (*WXFARPROC)();
2908
#else
2909
typedef int             (__stdcall *WXFARPROC)();
2910
#endif
2911
2912
typedef WXLRESULT (wxSTDCALL *WXWNDPROC)(WXHWND, WXUINT, WXWPARAM, WXLPARAM);
2913
2914
#endif /*  __WIN32__ */
2915
2916
2917
#if defined(__WXX11__)
2918
/* Stand-ins for X/Xt types */
2919
typedef void*           WXWindow;
2920
typedef void*           WXWidget;
2921
typedef void*           WXAppContext;
2922
typedef void*           WXColormap;
2923
typedef void*           WXColor;
2924
typedef void            WXDisplay;
2925
typedef void            WXEvent;
2926
typedef void*           WXCursor;
2927
typedef void*           WXPixmap;
2928
typedef void*           WXFontStructPtr;
2929
typedef void*           WXGC;
2930
typedef void*           WXRegion;
2931
typedef void*           WXFont;
2932
typedef void*           WXImage;
2933
typedef void*           WXFontList;
2934
typedef void*           WXFontSet;
2935
typedef void*           WXRendition;
2936
typedef void*           WXRenderTable;
2937
typedef void*           WXFontType; /* either a XmFontList or XmRenderTable */
2938
typedef void*           WXString;
2939
2940
typedef unsigned long   Atom;  /* this might fail on a few architectures */
2941
typedef long            WXPixel;
2942
2943
#endif /* X11 */
2944
2945
#ifdef __WXGTK__
2946
2947
/* Stand-ins for GLIB types */
2948
typedef struct _GSList GSList;
2949
2950
/* Stand-ins for GDK types */
2951
typedef struct _GdkColor        GdkColor;
2952
typedef struct _GdkCursor       GdkCursor;
2953
typedef struct _GdkDragContext  GdkDragContext;
2954
2955
typedef struct _GdkAtom* GdkAtom;
2956
2957
#if !defined(__WXGTK3__)
2958
    typedef struct _GdkColormap GdkColormap;
2959
    typedef struct _GdkFont GdkFont;
2960
    typedef struct _GdkGC GdkGC;
2961
    typedef struct _GdkRegion GdkRegion;
2962
#endif
2963
2964
#if defined(__WXGTK3__)
2965
    typedef struct _GdkWindow GdkWindow;
2966
    typedef struct _GdkEventSequence GdkEventSequence;
2967
#else
2968
    typedef struct _GdkDrawable GdkWindow;
2969
    typedef struct _GdkDrawable GdkPixmap;
2970
#endif
2971
2972
/* Stand-ins for GTK types */
2973
typedef struct _GtkWidget         GtkWidget;
2974
typedef struct _GtkRcStyle        GtkRcStyle;
2975
typedef struct _GtkAdjustment     GtkAdjustment;
2976
typedef struct _GtkToolbar        GtkToolbar;
2977
typedef struct _GtkNotebook       GtkNotebook;
2978
typedef struct _GtkNotebookPage   GtkNotebookPage;
2979
typedef struct _GtkAccelGroup     GtkAccelGroup;
2980
typedef struct _GtkSelectionData  GtkSelectionData;
2981
typedef struct _GtkTextBuffer     GtkTextBuffer;
2982
typedef struct _GtkRange          GtkRange;
2983
typedef struct _GtkCellRenderer   GtkCellRenderer;
2984
2985
typedef GtkWidget *WXWidget;
2986
2987
#endif /*  __WXGTK__ */
2988
2989
#if defined(__WXGTK__) || defined(__WXX11__)
2990
#define wxUSE_PANGO 1
2991
#else
2992
#define wxUSE_PANGO 0
2993
#endif
2994
2995
#if wxUSE_PANGO
2996
/* Stand-ins for Pango types */
2997
typedef struct _PangoContext         PangoContext;
2998
typedef struct _PangoLayout          PangoLayout;
2999
typedef struct _PangoFontDescription PangoFontDescription;
3000
#endif
3001
3002
#ifdef __WXDFB__
3003
/* DirectFB doesn't have the concept of non-TLW window, so use
3004
   something arbitrary */
3005
typedef const void* WXWidget;
3006
#endif /*  DFB */
3007
3008
#ifdef __WXQT__
3009
#include "wx/qt/defs.h"
3010
#endif
3011
3012
/*  include the feature test macros */
3013
#include "wx/features.h"
3014
3015
/*  --------------------------------------------------------------------------- */
3016
/*  macros to define a class without copy ctor nor assignment operator */
3017
/*  --------------------------------------------------------------------------- */
3018
3019
/* Obsolete macros kept only for compatibility, just use the corresponding
3020
   C++11 keywords directly in the class definition when writing new code. */
3021
#define wxMEMBER_DELETE = delete
3022
3023
/* Also note that these macro do _not_ require a semicolon after them for
3024
   compatibility with wxWidgets 3.2. */
3025
#define wxDECLARE_DEFAULT_COPY_CTOR(classname) \
3026
    public:                                    \
3027
0
        classname(const classname&) = default;
Unexecuted instantiation: wxEventBasicPayloadMixin::wxEventBasicPayloadMixin(wxEventBasicPayloadMixin const&)
Unexecuted instantiation: wxProcessEvent::wxProcessEvent(wxProcessEvent const&)
Unexecuted instantiation: wxTimerEvent::wxTimerEvent(wxTimerEvent const&)
3028
3029
#define wxDECLARE_DEFAULT_COPY(classname)  \
3030
    wxDECLARE_DEFAULT_COPY_CTOR(classname) \
3031
    classname& operator=(const classname&) = default;
3032
3033
#define wxDECLARE_DEFAULT_COPY_AND_DEF(classname) \
3034
    classname() = default;                        \
3035
    wxDECLARE_DEFAULT_COPY(classname);
3036
3037
/* These macros do require a semicolon after them. */
3038
#define wxDECLARE_NO_COPY_CLASS(classname)      \
3039
    private:                                    \
3040
        classname(const classname&) wxMEMBER_DELETE; \
3041
        classname& operator=(const classname&) wxMEMBER_DELETE
3042
3043
#define wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg)  \
3044
    private:                                              \
3045
        classname(const classname<arg>&) wxMEMBER_DELETE; \
3046
        classname& operator=(const classname<arg>&) wxMEMBER_DELETE
3047
3048
#define wxDECLARE_NO_COPY_TEMPLATE_CLASS_2(classname, arg1, arg2) \
3049
    private:                                                      \
3050
        classname(const classname<arg1, arg2>&) wxMEMBER_DELETE; \
3051
        classname& operator=(const classname<arg1, arg2>&) wxMEMBER_DELETE
3052
3053
#define wxDECLARE_NO_ASSIGN_CLASS(classname)    \
3054
    private:                                    \
3055
        classname& operator=(const classname&) wxMEMBER_DELETE
3056
3057
#define wxDECLARE_NO_ASSIGN_DEF_COPY(classname)                 \
3058
        wxDECLARE_DEFAULT_COPY_CTOR(classname)                  \
3059
    private:                                                    \
3060
        classname& operator=(const classname&) wxMEMBER_DELETE
3061
3062
/* deprecated variants _not_ requiring a semicolon after them */
3063
#define DECLARE_NO_COPY_CLASS(classname) \
3064
    wxDECLARE_NO_COPY_CLASS(classname);
3065
#define DECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \
3066
    wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg);
3067
#define DECLARE_NO_ASSIGN_CLASS(classname) \
3068
    wxDECLARE_NO_ASSIGN_CLASS(classname);
3069
3070
/*  --------------------------------------------------------------------------- */
3071
/*  If a manifest is being automatically generated, add common controls 6 to it */
3072
/*  --------------------------------------------------------------------------- */
3073
3074
#if wxUSE_GUI && \
3075
    (!defined wxUSE_NO_MANIFEST || wxUSE_NO_MANIFEST == 0 ) && \
3076
    ( defined _MSC_FULL_VER && _MSC_FULL_VER >= 140040130 )
3077
3078
#define WX_CC_MANIFEST                          \
3079
    "/manifestdependency:\"type='win32'         \
3080
     name='Microsoft.Windows.Common-Controls'   \
3081
     version='6.0.0.0'                          \
3082
     processorArchitecture='*'                  \
3083
     publicKeyToken='6595b64144ccf1df'          \
3084
     language='*'\""
3085
3086
#pragma comment(linker, WX_CC_MANIFEST)
3087
3088
#endif /* !wxUSE_NO_MANIFEST && _MSC_FULL_VER >= 140040130 */
3089
3090
/* wxThread and wxProcess priorities */
3091
enum
3092
{
3093
    wxPRIORITY_MIN     = 0u,   /* lowest possible priority */
3094
    wxPRIORITY_DEFAULT = 50u,  /* normal priority */
3095
    wxPRIORITY_MAX     = 100u  /* highest possible priority */
3096
};
3097
3098
#endif
3099
    /*  _WX_DEFS_H_ */