X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/37df1f337058d50f5749797400a767cf6efa5db1..13ff9344d600ab38ad5ad4088d4a4797184405d2:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index c345db56a5..9c6ced61d3 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -164,13 +164,11 @@ #endif // compilers #endif // HAVE_BOOL -#if !defined(HAVE_BOOL) && !defined(bool) +#if !defined(HAVE_BOOL) && !defined(bool) && !defined(VMS) // NB: of course, this doesn't replace the standard type, because, for // example, overloading based on bool/int parameter doesn't work and // so should be avoided in portable programs -#ifndef VMS typedef unsigned int bool; -#endif #endif // bool typedef short int WXTYPE; @@ -433,47 +431,27 @@ enum #define wxInt8 char signed #define wxUint8 char unsigned -#ifdef __WIN16__ +#if defined(__WIN16__) || (defined(SIZEOF_INT) && (SIZEOF_INT == 2)) #define wxInt16 int signed #define wxUint16 int unsigned #define wxInt32 long signed #define wxUint32 long unsigned -#endif - -#ifdef __WIN32__ -#define wxInt16 short signed -#define wxUint16 short unsigned -#define wxInt32 int signed -#define wxUint32 int unsigned -#endif - -#ifdef __WXMAC__ -#define wxInt16 short signed -#define wxUint16 short unsigned -#define wxInt32 int signed -#define wxUint32 int unsigned -#endif - -#ifdef __WXOS2__ +#else #define wxInt16 short signed #define wxUint16 short unsigned #define wxInt32 int signed #define wxUint32 int unsigned #endif -#if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXOS2__) - #if defined(SIZEOF_INT) - /* well, this shouldn't happen... */ - #define wxInt16 short signed - #define wxUint16 short unsigned - #define wxInt32 int signed - #define wxUint32 int unsigned - #else - #define wxInt16 short signed - #define wxUint16 short unsigned - #define wxInt32 int signed - #define wxUint32 int unsigned - #endif +#if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) +#define wxInt64 long signed +#define wxUint64 long unsigned +#elif defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8) +#define wxInt64 long long signed +#define wxUint64 long long unsigned +#else // FIXME: what else can we do here aside from implementing wxULongLong +#define wxInt64 wxLongLong +#define wxUint64 wxULongLong #endif #define wxByte wxUint8 @@ -572,6 +550,76 @@ typedef float wxFloat32 ; #endif // machine specific byte swapping +#if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) +#define wxUINT64_SWAP_ALWAYS(val) \ + ((wxUint64) ( \ + (((wxUint64) (val) & (wxUint64) 0x00000000000000ffUL) << 56) | \ + (((wxUint64) (val) & (wxUint64) 0x000000000000ff00UL) << 40) | \ + (((wxUint64) (val) & (wxUint64) 0x0000000000ff0000UL) << 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00000000ff000000UL) << 8) | \ + (((wxUint64) (val) & (wxUint64) 0x000000ff00000000UL) >> 8) | \ + (((wxUint64) (val) & (wxUint64) 0x0000ff0000000000UL) >> 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00ff000000000000UL) >> 40) | \ + (((wxUint64) (val) & (wxUint64) 0xff00000000000000UL) >> 56))) + +#define wxINT64_SWAP_ALWAYS(val) \ + ((wxInt64) ( \ + (((wxUint64) (val) & (wxUint64) 0x00000000000000ffUL) << 56) | \ + (((wxUint64) (val) & (wxUint64) 0x000000000000ff00UL) << 40) | \ + (((wxUint64) (val) & (wxUint64) 0x0000000000ff0000UL) << 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00000000ff000000UL) << 8) | \ + (((wxUint64) (val) & (wxUint64) 0x000000ff00000000UL) >> 8) | \ + (((wxUint64) (val) & (wxUint64) 0x0000ff0000000000UL) >> 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00ff000000000000UL) >> 40) | \ + (((wxUint64) (val) & (wxUint64) 0xff00000000000000UL) >> 56))) + +#elif defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8) +#define wxUINT64_SWAP_ALWAYS(val) \ + ((wxUint64) ( \ + (((wxUint64) (val) & (wxUint64) 0x00000000000000ffULL) << 56) | \ + (((wxUint64) (val) & (wxUint64) 0x000000000000ff00ULL) << 40) | \ + (((wxUint64) (val) & (wxUint64) 0x0000000000ff0000ULL) << 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00000000ff000000ULL) << 8) | \ + (((wxUint64) (val) & (wxUint64) 0x000000ff00000000ULL) >> 8) | \ + (((wxUint64) (val) & (wxUint64) 0x0000ff0000000000ULL) >> 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00ff000000000000ULL) >> 40) | \ + (((wxUint64) (val) & (wxUint64) 0xff00000000000000ULL) >> 56))) + +#define wxINT64_SWAP_ALWAYS(val) \ + ((wxInt64) ( \ + (((wxUint64) (val) & (wxUint64) 0x00000000000000ffULL) << 56) | \ + (((wxUint64) (val) & (wxUint64) 0x000000000000ff00ULL) << 40) | \ + (((wxUint64) (val) & (wxUint64) 0x0000000000ff0000ULL) << 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00000000ff000000ULL) << 8) | \ + (((wxUint64) (val) & (wxUint64) 0x000000ff00000000ULL) >> 8) | \ + (((wxUint64) (val) & (wxUint64) 0x0000ff0000000000ULL) >> 24) | \ + (((wxUint64) (val) & (wxUint64) 0x00ff000000000000ULL) >> 40) | \ + (((wxUint64) (val) & (wxUint64) 0xff00000000000000ULL) >> 56))) + +#else +#define wxUINT64_SWAP_ALWAYS(val) \ + ((wxUint64) ( \ + ((wxLongLong(val) & wxLongLong(0L, 0x000000ffU)) << 56) | \ + ((wxLongLong(val) & wxLongLong(0L, 0x0000ff00U)) << 40) | \ + ((wxLongLong(val) & wxLongLong(0L, 0x00ff0000U)) << 24) | \ + ((wxLongLong(val) & wxLongLong(0L, 0xff000000U)) << 8) | \ + ((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \ + ((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \ + ((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \ + ((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56))) + +#define wxINT64_SWAP_ALWAYS(val) \ + ((wxInt64) ( \ + ((wxLongLong(val) & wxLongLong(0L, 0x000000ffU)) << 56) | \ + ((wxLongLong(val) & wxLongLong(0L, 0x0000ff00U)) << 40) | \ + ((wxLongLong(val) & wxLongLong(0L, 0x00ff0000U)) << 24) | \ + ((wxLongLong(val) & wxLongLong(0L, 0xff000000U)) << 8) | \ + ((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \ + ((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \ + ((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \ + ((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56))) +#endif + #ifdef WORDS_BIGENDIAN #define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val) #define wxINT16_SWAP_ON_BE(val) wxINT16_SWAP_ALWAYS(val) @@ -581,6 +629,8 @@ typedef float wxFloat32 ; #define wxINT32_SWAP_ON_BE(val) wxINT32_SWAP_ALWAYS(val) #define wxUINT32_SWAP_ON_LE(val) (val) #define wxINT32_SWAP_ON_LE(val) (val) + #define wxUINT64_SWAP_ON_BE(val) wxUINT64_SWAP_ALWAYS(val) + #define wxUINT64_SWAP_ON_LE(val) (val) #else #define wxUINT16_SWAP_ON_LE(val) wxUINT16_SWAP_ALWAYS(val) #define wxINT16_SWAP_ON_LE(val) wxINT16_SWAP_ALWAYS(val) @@ -590,6 +640,8 @@ typedef float wxFloat32 ; #define wxINT32_SWAP_ON_LE(val) wxINT32_SWAP_ALWAYS(val) #define wxUINT32_SWAP_ON_BE(val) (val) #define wxINT32_SWAP_ON_BE(val) (val) + #define wxUINT64_SWAP_ON_LE(val) wxUINT64_SWAP_ALWAYS(val) + #define wxUINT64_SWAP_ON_BE(val) (val) #endif // ---------------------------------------------------------------------------- @@ -779,6 +831,12 @@ enum wxBorder // flag on by default. #define wxWS_EX_BLOCK_EVENTS 0x00000002 +// don't use this window as an implicit parent for the other windows: this must +// be used with transient windows as otherwise there is the risk of creating a +// dialog/frame with this window as a parent which would lead to a crash if the +// parent is destroyed before the child +#define wxWS_EX_TRANSIENT 0x00000004 + /* * wxFrame/wxDialog style flags */ @@ -894,15 +952,9 @@ enum wxBorder // always show an entire number of rows #define wxLB_INT_HEIGHT 0x0800 -// use wxHSCROLL to not wrap text at all, wxTE_LINEWRAP to wrap it at any -// position and wxTE_WORDWRAP to wrap at words boundary -#define wxTE_DONTWRAP wxHSCROLL -#define wxTE_LINEWRAP 0x0800 -#define wxTE_WORDWRAP 0x0000 // it's just == !wxHSCROLL - // deprecated synonyms -#define wxPROCESS_ENTER wxTE_PROCESS_ENTER -#define wxPASSWORD wxTE_PASSWORD +#define wxPROCESS_ENTER 0x0400 // wxTE_PROCESS_ENTER +#define wxPASSWORD 0x0800 // wxTE_PASSWORD /* * wxComboBox style flags @@ -1055,13 +1107,14 @@ enum wxBorder */ // wxCENTRE already defined as 0x00000001 +#define wxYES 0x00000002 #define wxOK 0x00000004 -#define wxYES_NO 0x00000008 +#define wxNO 0x00000008 +#define wxYES_NO (wxYES | wxNO) #define wxCANCEL 0x00000010 -#define wxYES 0x00000020 -#define wxNO 0x00000040 + +#define wxYES_DEFAULT 0x00000000 // has no effect (default) #define wxNO_DEFAULT 0x00000080 -#define wxYES_DEFAULT 0x00000000 // has no effect #define wxICON_EXCLAMATION 0x00000100 #define wxICON_HAND 0x00000200