X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a8141d3f2815c0d439122c3c2b42ded4b93ae543..f0c87536e11f228cef0234cdd9e146582d7237fd:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index 160d4b82f7..9601f2c17d 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,17 +24,20 @@ // 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 + !defined(__WXMGL__) && !defined(__WXX11__) && 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 #endif +// include the feature test macros +#include "wx/features.h" + // suppress some Visual C++ warnings #ifdef __VISUALC__ # pragma warning(disable:4201) // nonstandard extension used: nameless struct/union @@ -77,11 +80,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 +97,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 // ---------------------------------------------------------------------------- @@ -134,6 +143,9 @@ #if (__MWERKS__ >= 0x1000) && __option(bool) #define HAVE_BOOL #endif + #elif defined(__APPLE__) && defined(__APPLE_CC__) + // Apple bundled gcc supports bool + #define HAVE_BOOL #elif defined(__VISUALC__) && (__VISUALC__ == 1020) // in VC++ 4.2 the bool keyword is reserved (hence can't be typedefed) // but not implemented, so we must #define it @@ -164,13 +176,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; @@ -182,6 +192,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 // ---------------------------------------------------------------------------- @@ -214,16 +241,19 @@ typedef int wxWindowID; #define wxCALLBACK #endif // platform -// callling convention for the qsort(3) callback +// generic calling convention for the extern "C" functions #if defined(__VISUALC__) - #define wxCMPFUNC_CONV _cdecl + #define wxC_CALLING_CONV _cdecl #elif defined(__VISAGECPP__) - #define wxCMPFUNC_CONV _Optlink + #define wxC_CALLING_CONV _Optlink #else // !Visual C++ - #define wxCMPFUNC_CONV + #define wxC_CALLING_CONV #endif // compiler +// callling convention for the qsort(3) callback +#define wxCMPFUNC_CONV wxC_CALLING_CONV + // compatibility :-( #define CMPFUNC_CONV wxCMPFUNC_CONV @@ -251,6 +281,11 @@ typedef int wxWindowID; #define WXEXPORT _Export #define WXIMPORT _Export #endif +#elif defined(__WXMAC__) + #ifdef __MWERKS__ + #define WXEXPORT __declspec(export) + #define WXIMPORT __declspec(import) + #endif #endif // for other platforms/compilers we don't anything @@ -395,6 +430,7 @@ enum wxGEOS, // GEOS wxOS2_PM, // OS/2 Workplace wxWINDOWS, // Windows or WfW + wxMICROWINDOWS, // MicroWindows wxPENWINDOWS, // Windows for Pen Computing wxWINDOWS_NT, // Windows NT wxWIN32S, // Windows 32S API @@ -404,8 +440,10 @@ 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 + wxUNIX, // wxBase under Unix + wxX11 // Plain X11 and Universal widgets }; // ---------------------------------------------------------------------------- @@ -433,47 +471,53 @@ enum #define wxInt8 char signed #define wxUint8 char unsigned -#ifdef __WIN16__ -#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__ -#define wxInt16 short signed -#define wxUint16 short unsigned -#define wxInt32 int signed -#define wxUint32 int unsigned -#endif +#ifdef __WINDOWS__ + #if defined(__WIN16__) + #define wxInt16 int signed + #define wxUint16 int unsigned + #define wxInt32 long signed + #define wxUint32 long unsigned + #elif defined(__WIN32__) + #define wxInt16 short signed + #define wxUint16 short unsigned + #define wxInt32 int signed + #define wxUint32 int unsigned + #else + // Win64 will have different type sizes + #error "Please define a 32 bit type" + #endif +#else // !Windows + // SIZEOF_XXX are defined by configure + #if defined(SIZEOF_INT) && (SIZEOF_INT == 4) + #define wxInt16 short signed + #define wxUint16 short unsigned + #define wxInt32 int signed + #define wxUint32 int unsigned + #elif defined(SIZEOF_INT) && (SIZEOF_INT == 2) + #define wxInt16 int signed + #define wxUint16 int unsigned + #define wxInt32 long signed + #define wxUint32 long unsigned + #else + // assume sizeof(int) == 4 - what else can we do + wxCOMPILE_TIME_ASSERT( sizeof(int) == 4, IntMustBeExactly4Bytes); -#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 + #define wxInt16 short signed + #define wxUint16 short unsigned + #define wxInt32 int signed + #define wxUint32 int unsigned + #endif +#endif // Win/!Win + +#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 +616,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) ( \ + ((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) ( \ + ((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 +695,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 +706,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 +897,17 @@ 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 + +// Use this style to add a context-sensitive help to the window (currently for +// Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) +#define wxFRAME_EX_CONTEXTHELP 0x00000004 +#define wxDIALOG_EX_CONTEXTHELP 0x00000004 + /* * wxFrame/wxDialog style flags */ @@ -786,7 +915,7 @@ enum wxBorder #define wxICONIZE 0x4000 #define wxMINIMIZE wxICONIZE #define wxMAXIMIZE 0x2000 -// free value: 0x1000 + // free flag value: 0x1000 #define wxSYSTEM_MENU 0x0800 #define wxMINIMIZE_BOX 0x0400 #define wxMAXIMIZE_BOX 0x0200 @@ -801,18 +930,12 @@ enum wxBorder // deprecated versions defined for compatibility reasons #define wxRESIZE_BOX wxMAXIMIZE_BOX #define wxTHICK_FRAME wxRESIZE_BORDER +#define wxFRAME_FLOAT_ON_PARENT wxFRAME_TOOL_WINDOW // obsolete styles, unused any more -#define wxDIALOG_MODAL 0x0020 +#define wxDIALOG_MODAL 0x0020 // free flag value 0x0020 #define wxDIALOG_MODELESS 0x0000 -// deprecated flag, don't use any more, defined for compatibility only -#define wxFRAME_FLOAT_ON_PARENT 0 - -// Context-sensitive help -#define wxFRAME_EX_CONTEXTHELP 0x00000004 -#define wxDIALOG_EX_CONTEXTHELP 0x00000004 - /* * MDI parent frame style flags * Can overlap with some of the above. @@ -829,7 +952,7 @@ enum wxBorder wxMINIMIZE_BOX | wxMAXIMIZE_BOX | \ wxCAPTION | wxCLIP_CHILDREN) -#ifdef __WXMSW__ +#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMGL__) # define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU | wxCAPTION) #else // Under Unix, the dialogs don't have a system menu. Specifying wxSYSTEM_MENU @@ -982,6 +1105,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 @@ -1035,12 +1159,6 @@ enum wxBorder // be modal. No progress will then be made at all. #define wxPD_REMAINING_TIME 0x0040 -/* - * wxHtmlWindow flags - */ -#define wxHW_SCROLLBAR_NEVER 0x0002 -#define wxHW_SCROLLBAR_AUTO 0x0004 - /* * extended dialog specifiers. these values are stored in a different * flag and thus do not overlap with other style flags. note that these @@ -1103,6 +1221,7 @@ enum wxBorder #define wxID_HELP_COMMANDS 5015 #define wxID_HELP_PROCEDURES 5016 #define wxID_HELP_CONTEXT 5017 +#define wxID_CLOSE_ALL 5018 #define wxID_CUT 5030 #define wxID_COPY 5031 @@ -1142,14 +1261,34 @@ enum wxBorder #define wxID_RETRY 5116 #define wxID_IGNORE 5117 -// IDs used by generic file dialog (11 consecutive starting from this value) +// System menu IDs (used by wxUniv): +#define wxID_SYSTEM_MENU 5200 +#define wxID_CLOSE_FRAME 5201 +#define wxID_MOVE_FRAME 5202 +#define wxID_RESIZE_FRAME 5203 +#define wxID_MAXIMIZE_FRAME 5204 +#define wxID_ICONIZE_FRAME 5205 +#define wxID_RESTORE_FRAME 5206 + +// IDs used by generic file dialog (13 consecutive starting from this value) #define wxID_FILEDLGG 5900 + #define wxID_HIGHEST 5999 // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- +// menu and toolbar item kinds +enum wxItemKind +{ + wxITEM_SEPARATOR = -1, + wxITEM_NORMAL, + wxITEM_CHECK, + wxITEM_RADIO, + wxITEM_MAX +}; + // hit test results enum wxHitTest { @@ -1558,7 +1697,7 @@ typedef enum { #endif // macro to specify "All Files" on different platforms -#if defined(__WXMSW__) +#if defined(__WXMSW__) || defined(__WXPM__) # define wxALL_FILES_PATTERN "*.*" # define wxALL_FILES gettext_noop("All files (*.*)|*.*") #else @@ -1574,6 +1713,26 @@ typedef enum { #ifdef __WXMAC__ +typedef unsigned char WXCOLORREF[6]; +typedef void* WXHBITMAP; +typedef void* WXHMETAFILE ; +typedef void* WXHICON ; +typedef void* WXHCURSOR ; +typedef void* WXHRGN ; +typedef void* WXRECTPTR ; +typedef void* WXPOINTPTR ; +typedef void* WXHWND ; +typedef void* WXEVENTREF ; +typedef void* WXAPPLEEVENTREF ; +typedef void* WXHDC ; +typedef void* WXHMENU ; +typedef unsigned int WXUINT; +typedef unsigned long WXDWORD; +typedef unsigned short WXWORD; + +typedef void* WXWidget ; +typedef void* WXWindow ; +/* typedef WindowPtr WXHWND; typedef Handle WXHANDLE; typedef CIconHandle WXHICON; @@ -1586,16 +1745,11 @@ typedef CursHandle WXHCURSOR; typedef RgnHandle WXHRGN; //typedef unsigned long WXHACCEL; //typedef unsigned long WXHINSTANCE; -typedef GWorldPtr WXHBITMAP; //typedef unsigned long WXHIMAGELIST; //typedef unsigned long WXHGLOBAL; typedef GrafPtr WXHDC; -typedef unsigned int WXUINT; -typedef unsigned long WXDWORD; -typedef unsigned short WXWORD; //typedef unsigned int WXWPARAM; //typedef long WXLPARAM; -typedef RGBColor WXCOLORREF; //typedef void * WXRGNDATA; //typedef void * WXMSG; //typedef unsigned long WXHCONV; @@ -1607,7 +1761,7 @@ typedef int (*WXFARPROC)(); typedef WindowPtr WXWindow; typedef ControlHandle WXWidget; - +*/ #endif #if defined(__WXMSW__) || defined(__WXPM__) @@ -1645,17 +1799,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; @@ -1667,7 +1811,38 @@ 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__) +#ifdef __EMX__ +/* Need a well-known type for WXFARPROC + below. MPARAM is typedef'ed too late. */ +#define WXWPARAM void * +#define WXLPARAM void * +#else +#define WXWPARAM MPARAM +#define WXLPARAM MPARAM +#endif +#define RECT RECTL +#define LOGFONT FATTRS +#define LOWORD SHORT1FROMMP +#define HIWORD SHORT2FROMMP + typedef unsigned long WXMPARAM; typedef unsigned long WXMSGID; typedef void* WXRESULT; @@ -1715,42 +1890,27 @@ 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)(); +#ifdef __EMX__ +#define _System #endif - -typedef WXHWND WXWidget; - -#if defined(__BORLANDC__) && !defined(__WIN32__) -# ifndef LPTSTR -# define LPTSTR LPSTR -# endif -# ifndef LPCTSTR -# define LPCTSTR LPSTR -# endif +typedef WXRESULT (_System *WXFARPROC)(WXHWND, WXMSGID, WXWPARAM, WXLPARAM); #endif -#endif // MSW or OS2 +#endif //__WXPM__ -#ifdef __WXMOTIF__ + +#if defined(__WXMOTIF__) || defined(__WXX11__) /* Stand-ins for X/Xt/Motif types */ typedef void* WXWindow; typedef void* WXWidget; typedef void* WXAppContext; typedef void* WXColormap; +typedef void* WXColor; typedef void WXDisplay; typedef void WXEvent; typedef void* WXCursor; @@ -1767,6 +1927,7 @@ typedef unsigned long Atom; /* this might fail on a few architectures */ #endif // Motif #ifdef __WXGTK__ + /* Stand-ins for GLIB types */ typedef char gchar; typedef signed char gint8; @@ -1777,23 +1938,28 @@ typedef void* gpointer; typedef struct _GSList GSList; /* Stand-ins for GDK types */ -typedef gulong GdkAtom; typedef struct _GdkColor GdkColor; typedef struct _GdkColormap GdkColormap; typedef struct _GdkFont GdkFont; typedef struct _GdkGC GdkGC; +typedef struct _GdkVisual GdkVisual; + #ifdef __WXGTK20__ - 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; -#endif +typedef struct _GdkAtom *GdkAtom; +typedef struct _GdkDrawable GdkWindow; +typedef struct _GdkDrawable GdkBitmap; +typedef struct _GdkDrawable GdkPixmap; +#else // GTK+ 1.2 +typedef gulong GdkAtom; +typedef struct _GdkWindow GdkWindow; +typedef struct _GdkWindow GdkBitmap; +typedef struct _GdkWindow GdkPixmap; +#endif // GTK+ 1.2/2.0 + typedef struct _GdkCursor GdkCursor; typedef struct _GdkRegion GdkRegion; typedef struct _GdkDragContext GdkDragContext; + #ifdef HAVE_XIM typedef struct _GdkIC GdkIC; typedef struct _GdkICAttr GdkICAttr; @@ -1824,7 +1990,8 @@ typedef GtkWidget *WXWidget; typedef struct _PangoContext PangoContext; typedef struct _PangoLayout PangoLayout; typedef struct _PangoFontDescription PangoFontDescription; -#endif +#endif // GTK+ 2.0 + #endif // GTK #ifdef __WXMGL__