X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/39cc7a0bae66d5b82ce9a9cc71a51f4efda52166..249128027a5a317e36e63bb1377f6fcda402df88:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index 39578aaa31..32ed238ad9 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -13,7 +13,7 @@ #define _WX_DEFS_H_ #ifdef __GNUG__ - #pragma interface "defs.h" +#pragma interface "defs.h" #endif // ---------------------------------------------------------------------------- @@ -24,15 +24,15 @@ // Make sure the environment is set correctly #if defined(__WXMSW__) && defined(__X__) - #error "Target can't be both X and Windows" +#error "Target can't be both X and Windows" #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \ !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \ !defined(__WXMGL__) && wxUSE_GUI - #ifdef __UNIX__ - #error "No Target! You should use wx-config program for compilation flags!" - #else // !Unix - #error "No Target! You should use supplied makefiles for compilation!" - #endif // Unix/!Unix +#ifdef __UNIX__ +#error "No Target! You should use wx-config program for compilation flags!" +#else // !Unix +#error "No Target! You should use supplied makefiles for compilation!" +#endif // Unix/!Unix #endif // suppress some Visual C++ warnings @@ -77,11 +77,11 @@ // possibility to build non GUI apps is new, so don't burden ourselves with // compatibility code #if !wxUSE_GUI - #undef WXWIN_COMPATIBILITY_2 - #undef WXWIN_COMPATIBILITY_2_2 +#undef WXWIN_COMPATIBILITY_2 +#undef WXWIN_COMPATIBILITY_2_2 - #define WXWIN_COMPATIBILITY_2 0 - #define WXWIN_COMPATIBILITY_2_2 0 +#define WXWIN_COMPATIBILITY_2 0 +#define WXWIN_COMPATIBILITY_2_2 0 #endif // !GUI // ============================================================================ @@ -94,24 +94,30 @@ #if defined(__VISUALC__) && !defined(WIN32) // VC1.5 does not have LPTSTR type - #define LPTSTR LPSTR - #define LPCTSTR LPCSTR -#endif // VC++ 1.5 +#define LPTSTR LPSTR +#define LPCTSTR LPCSTR +#elif defined(__BORLANDC__) && !defined(__WIN32__) +#ifndef LPTSTR +#define LPTSTR LPSTR +#endif +#ifndef LPCTSTR +#define LPCTSTR LPSTR +#endif +#endif + /* Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files, so define it ourselves (newer versions do it for all files, though, and don't allow it to be redefined) */ -#ifdef __DECCXX - #if !defined(__VMS) && !defined(__cplusplus) - #define __cplusplus - #endif +#if defined(__DECCXX) && !defined(__VMS) && !defined(__cplusplus) +#define __cplusplus #endif /* __DECCXX */ // Resolves linking problems under HP-UX when compiling with gcc/g++ #if defined(__HPUX__) && defined(__GNUG__) - #define va_list __gnuc_va_list +#define va_list __gnuc_va_list #endif // HP-UX // ---------------------------------------------------------------------------- @@ -180,6 +186,23 @@ typedef short int WXTYPE; // because -1 is a valid (and largely used) value for window id. typedef int wxWindowID; +// ---------------------------------------------------------------------------- +// other feature tests +// ---------------------------------------------------------------------------- + + // Every ride down a slippery slope begins with a single step.. + // + // Yes, using nested classes is indeed against our coding standards in + // general, but there are places where you can use them to advantage + // without totally breaking ports that cannot use them. If you do, then + // wrap it in this guard, but such cases should still be relatively rare. + +#ifndef __WIN16__ +#define wxUSE_NESTED_CLASSES 1 +#else +#define wxUSE_NESTED_CLASSES 0 +#endif + // ---------------------------------------------------------------------------- // portable calling conventions macros // ---------------------------------------------------------------------------- @@ -402,6 +425,7 @@ enum wxMGL_X, // MGL on X wxMGL_WIN32, // MGL on Win32 wxMGL_OS2, // MGL on OS/2 + wxMGL_DOS, // MGL on MS-DOS wxWINDOWS_OS2, // Native OS/2 PM wxUNIX // wxBase under Unix }; @@ -451,7 +475,7 @@ enum #define wxUint64 long long unsigned #else // FIXME: what else can we do here aside from implementing wxULongLong #define wxInt64 wxLongLong -#define wxUint64 wxLongLong +#define wxUint64 wxULongLong #endif #define wxByte wxUint8 @@ -550,16 +574,63 @@ typedef float wxFloat32 ; #endif // machine specific byte swapping +#if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) #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)).GetValue()) + (((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) ( \ + ((wxULongLong(val) & wxULongLong(0L, 0x000000ffU)) << 56) | \ + ((wxULongLong(val) & wxULongLong(0L, 0x0000ff00U)) << 40) | \ + ((wxULongLong(val) & wxULongLong(0L, 0x00ff0000U)) << 24) | \ + ((wxULongLong(val) & wxULongLong(0L, 0xff000000U)) << 8) | \ + ((wxULongLong(val) & wxULongLong(0x000000ffL, 0U)) >> 8) | \ + ((wxULongLong(val) & wxULongLong(0x0000ff00L, 0U)) >> 24) | \ + ((wxULongLong(val) & wxULongLong(0x00ff0000L, 0U)) >> 40) | \ + ((wxULongLong(val) & wxULongLong(0xff000000L, 0U)) >> 56))) #define wxINT64_SWAP_ALWAYS(val) \ ((wxInt64) ( \ @@ -570,8 +641,8 @@ typedef float wxFloat32 ; ((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \ ((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \ ((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \ - ((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56)).GetValue()) - + ((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56))) +#endif #ifdef WORDS_BIGENDIAN #define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val) @@ -993,6 +1064,7 @@ enum wxBorder #define wxSP_3DBORDER 0x0200 #define wxSP_FULLSASH 0x0400 #define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH) +#define wxSP_SASH_AQUA 0x0800 /* * wxNotebook flags @@ -1656,17 +1728,7 @@ typedef unsigned long WXHDC; typedef unsigned int WXUINT; typedef unsigned long WXDWORD; typedef unsigned short WXWORD; -#ifdef __WXMSW__ -typedef unsigned int WXWPARAM; -typedef long WXLPARAM; -#else -# define WXWPARAM MPARAM -# define WXLPARAM MPARAM -# define RECT RECTL -# define LOGFONT FATTRS -# define LOWORD SHORT1FROMMP -# define HIWORD SHORT2FROMMP -#endif // __WXMSW__ + typedef unsigned long WXCOLORREF; typedef void * WXRGNDATA; typedef void * WXMSG; @@ -1678,7 +1740,31 @@ typedef void * WXDRAWITEMSTRUCT; typedef void * WXMEASUREITEMSTRUCT; typedef void * WXLPCREATESTRUCT; +typedef WXHWND WXWidget; + +#endif // MSW or OS2 + + +#ifdef __WXMSW__ +typedef unsigned int WXWPARAM; +typedef long WXLPARAM; + +#if !defined(__WIN32__) || defined(__GNUWIN32__) || defined(__WXWINE__) || defined(__WXMICROWIN__) +typedef int (*WXFARPROC)(); +#else +typedef int (__stdcall *WXFARPROC)(); +#endif +#endif // __WXMSW__ + + #if defined(__WXPM__) +#define WXWPARAM MPARAM +#define WXLPARAM MPARAM +#define RECT RECTL +#define LOGFONT FATTRS +#define LOWORD SHORT1FROMMP +#define HIWORD SHORT2FROMMP + typedef unsigned long WXMPARAM; typedef unsigned long WXMSGID; typedef void* WXRESULT; @@ -1726,35 +1812,16 @@ typedef struct tagLOGPALETTE WORD palNumentries; WORD PALETTEENTRY[1]; } LOGPALETTE; -#endif //__WXPM__ -#if defined(__GNUWIN32__) || defined(__WXWINE__) || defined(__WXMICROWIN__) - typedef int (*WXFARPROC)(); -#elif defined(__WIN32__) - typedef int (__stdcall *WXFARPROC)(); -#elif defined(__WXPM__) -# if (defined(__VISAGECPP__) && (__IBMCPP__ < 400)) || defined (__WATCOMC__) +#if (defined(__VISAGECPP__) && (__IBMCPP__ < 400)) || defined (__WATCOMC__) // VA 3.0 for some reason needs base data types when typedefing a proc proto??? - typedef void* (_System *WXFARPROC)(unsigned long, unsigned long, void*, void*); -# else - typedef WXRESULT (_System *WXFARPROC)(WXHWND, WXMSGID, WXWPARAM, WXLPARAM); -# endif +typedef void* (_System *WXFARPROC)(unsigned long, unsigned long, void*, void*); #else - typedef int (*WXFARPROC)(); +typedef WXRESULT (_System *WXFARPROC)(WXHWND, WXMSGID, WXWPARAM, WXLPARAM); #endif -typedef WXHWND WXWidget; - -#if defined(__BORLANDC__) && !defined(__WIN32__) -# ifndef LPTSTR -# define LPTSTR LPSTR -# endif -# ifndef LPCTSTR -# define LPCTSTR LPSTR -# endif -#endif +#endif //__WXPM__ -#endif // MSW or OS2 #ifdef __WXMOTIF__ /* Stand-ins for X/Xt/Motif types */ @@ -1794,13 +1861,13 @@ typedef struct _GdkColormap GdkColormap; typedef struct _GdkFont GdkFont; typedef struct _GdkGC GdkGC; #ifdef __WXGTK20__ - typedef struct _GdkDrawable GdkWindow; - typedef struct _GdkDrawable GdkBitmap; - typedef struct _GdkDrawable GdkPixmap; +typedef struct _GdkDrawable GdkWindow; +typedef struct _GdkDrawable GdkBitmap; +typedef struct _GdkDrawable GdkPixmap; #else - typedef struct _GdkWindow GdkWindow; - typedef struct _GdkWindow GdkBitmap; - typedef struct _GdkWindow GdkPixmap; +typedef struct _GdkWindow GdkWindow; +typedef struct _GdkWindow GdkBitmap; +typedef struct _GdkWindow GdkPixmap; #endif typedef struct _GdkCursor GdkCursor; typedef struct _GdkRegion GdkRegion;