X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f3f9b50aa275243ade3541ecccb95de22cf57a9..da52a4e023e73c2922f63d95026816a624695559:/include/wx/defs.h?ds=sidebyside diff --git a/include/wx/defs.h b/include/wx/defs.h index c8f84b7ef4..76f031c29d 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -71,6 +71,12 @@ # pragma warning(disable:4512) /* operator=() couldn't be generated */ # pragma warning(disable:4710) /* function not inlined */ + /* There are too many false positivies for this one, particularly when + using templates like wxVector */ + /* class 'foo' needs to have dll-interface to be used by clients of + class 'bar'" */ +# pragma warning(disable:4251) + /* For VC++ 5.0 for release mode, the warning 'C4702: unreachable code */ /* is buggy, and occurs for code that does actually get executed */ # if !defined __WXDEBUG__ && __VISUALC__ <= 1100 @@ -443,6 +449,13 @@ typedef int wxWindowID; #endif /* HAVE_VARIADIC_MACROS */ +#ifndef HAVE_WOSTREAM + // Mingw <=3.4 doesn't have std::wostream + #if !defined(__MINGW32__) || wxCHECK_GCC_VERSION(4,0) + #define HAVE_WOSTREAM + #endif +#endif /* HAVE_WOSTREAM */ + /* ---------------------------------------------------------------------------- */ /* portable calling conventions macros */ /* ---------------------------------------------------------------------------- */ @@ -516,13 +529,23 @@ typedef int wxWindowID; /* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */ #if wxCHECK_GCC_VERSION(3, 1) - #define wxDEPRECATED(x) x __attribute__ ((deprecated)) + #define wxDEPRECATED(x) __attribute__((deprecated)) x #elif defined(__VISUALC__) && (__VISUALC__ >= 1300) #define wxDEPRECATED(x) __declspec(deprecated) x #else #define wxDEPRECATED(x) x #endif +/* + Macro which marks the function as being deprecated but also defines it + inline. + + Currently it's defined in the same trivial way in all cases but it could + need a special definition with some other compilers in the future which + explains why do we have it. + */ +#define wxDEPRECATED_INLINE(func, body) wxDEPRECATED(func) { body } + /* Special variant of the macro above which should be used for the functions which are deprecated but called by wx itself: this often happens with @@ -1407,7 +1430,7 @@ enum wxBorder wxBORDER_RAISED = 0x04000000, wxBORDER_SUNKEN = 0x08000000, wxBORDER_DOUBLE = 0x10000000, /* deprecated */ - wxBORDER_THEME = wxBORDER_DEFAULT, + wxBORDER_THEME = wxBORDER_DOUBLE, /* a mask to extract border style from the combination of flags */ wxBORDER_MASK = 0x1f200000 @@ -1728,7 +1751,8 @@ enum wxBackgroundStyle { wxBG_STYLE_SYSTEM, wxBG_STYLE_COLOUR, - wxBG_STYLE_CUSTOM + wxBG_STYLE_CUSTOM, + wxBG_STYLE_TRANSPARENT }; /* @@ -1748,6 +1772,13 @@ enum wxKeyType /* Standard menu IDs */ enum { + /* + These ids delimit the range used by automatically-generated ids + (i.e. those used when wxID_ANY is specified during construction). + */ + wxID_AUTO_LOWEST = -32000, + wxID_AUTO_HIGHEST = -2000, + /* no id matches this one when compared to it */ wxID_NONE = -3, @@ -1875,6 +1906,9 @@ enum /* IDs used by generic file dialog (13 consecutive starting from this value) */ wxID_FILEDLGG = 5900, + + /* IDs used by generic file ctrl (4 consecutive starting from this value) */ + wxID_FILECTRL = 5950, wxID_HIGHEST = 5999 }; @@ -2466,11 +2500,8 @@ enum wxUpdateUI #define WX_OPAQUE_TYPE( name ) struct wxOpaque##name -typedef unsigned char WXCOLORREF[6]; -typedef void* WXCGIMAGEREF; typedef void* WXHBITMAP; typedef void* WXHCURSOR; -typedef void* WXHRGN; typedef void* WXRECTPTR; typedef void* WXPOINTPTR; typedef void* WXHWND; @@ -2478,54 +2509,57 @@ typedef void* WXEVENTREF; typedef void* WXEVENTHANDLERREF; typedef void* WXEVENTHANDLERCALLREF; typedef void* WXAPPLEEVENTREF; -typedef void* WXHDC; typedef void* WXHMENU; + typedef unsigned int WXUINT; typedef unsigned long WXDWORD; typedef unsigned short WXWORD; -typedef WX_OPAQUE_TYPE(CIconHandle ) * WXHICON ; typedef WX_OPAQUE_TYPE(PicHandle ) * WXHMETAFILE ; - - -/* typedef void* WXWidget; */ -/* typedef void* WXWindow; */ typedef WX_OPAQUE_TYPE(ControlRef ) * WXWidget ; typedef WX_OPAQUE_TYPE(WindowRef) * WXWindow ; + typedef void* WXDisplay; -/* typedef WindowPtr WXHWND; */ -/* typedef Handle WXHANDLE; */ -/* typedef CIconHandle WXHICON; */ -/* typedef unsigned long WXHFONT; */ -/* typedef MenuHandle WXHMENU; */ -/* typedef unsigned long WXHPEN; */ -/* typedef unsigned long WXHBRUSH; */ -/* typedef unsigned long WXHPALETTE; */ -/* typedef CursHandle WXHCURSOR; */ -/* typedef RgnHandle WXHRGN; */ -/* typedef unsigned long WXHACCEL; */ -/* typedef unsigned long WXHINSTANCE; */ -/* typedef unsigned long WXHIMAGELIST; */ -/* typedef unsigned long WXHGLOBAL; */ -/* typedef GrafPtr WXHDC; */ -/* typedef unsigned int WXWPARAM; */ -/* typedef long WXLPARAM; */ -/* typedef void * WXRGNDATA; */ -/* typedef void * WXMSG; */ -/* typedef unsigned long WXHCONV; */ -/* typedef unsigned long WXHKEY; */ -/* typedef void * WXDRAWITEMSTRUCT; */ -/* typedef void * WXMEASUREITEMSTRUCT; */ -/* typedef void * WXLPCREATESTRUCT; */ -/* typedef int (*WXFARPROC)(); */ - -/* typedef WindowPtr WXWindow; */ -/* typedef ControlHandle WXWidget; */ - -#endif - -#ifdef __WXCOCOA__ +/* + * core frameworks + */ + +typedef const void * CFTypeRef; + +typedef const struct __CFString * CFStringRef; +typedef struct __CFString * CFMutableStringRef; + +typedef struct __CFRunLoopSource * CFRunLoopSourceRef; + +#define DECLARE_WXMAC_OPAQUE_CGREF( name ) typedef struct name* name##Ref; + +DECLARE_WXMAC_OPAQUE_CGREF( CGColor ); +DECLARE_WXMAC_OPAQUE_CGREF( CGImage ); +DECLARE_WXMAC_OPAQUE_CGREF( CGContext ); + +typedef CGColorRef WXCOLORREF; +typedef CGImageRef WXCGIMAGEREF; +typedef CGContextRef WXHDC; + +/* + * carbon + */ + +typedef const struct __HIShape * HIShapeRef; +typedef struct __HIShape * HIMutableShapeRef; + +#define DECLARE_WXMAC_OPAQUE_REF( name ) typedef struct Opaque##name* name; + +DECLARE_WXMAC_OPAQUE_REF( PasteboardRef ); +DECLARE_WXMAC_OPAQUE_REF( IconRef ); + +typedef IconRef WXHICON ; +typedef HIShapeRef WXHRGN; + +#endif + +#if defined( __WXCOCOA__ ) || defined(__WXMAC__) /* Definitions of 32-bit/64-bit types * These are typedef'd exactly the same way in newer OS X headers so @@ -2539,9 +2573,9 @@ typedef void* WXDisplay; * since they are unlikely to be needed in a public header. */ #if defined(__LP64__) && __LP64__ - typedef double CGFloat; + typedef double CGFloat; #else - typedef float CGFloat; + typedef float CGFloat; #endif #if (defined(__LP64__) && __LP64__) || (defined(NS_BUILD_32_LIKE_64) && NS_BUILD_32_LIKE_64) @@ -2620,8 +2654,14 @@ DECLARE_WXCOCOA_OBJC_CLASS(NSTextStorage); DECLARE_WXCOCOA_OBJC_CLASS(NSThread); DECLARE_WXCOCOA_OBJC_CLASS(NSWindow); DECLARE_WXCOCOA_OBJC_CLASS(NSView); +#ifdef __WXMAC__ +// things added for __WXMAC__ +DECLARE_WXCOCOA_OBJC_CLASS(NSString); +#else +// things only for __WXCOCOA__ typedef WX_NSView WXWidget; /* wxWidgets BASE definition */ -#endif /* __WXCOCOA__ */ +#endif +#endif /* __WXCOCOA__ || ( __WXMAC__ &__DARWIN__)*/ #if defined(__WXPALMOS__) @@ -2945,35 +2985,8 @@ typedef const void* WXWidget; /* included before or after wxWidgets classes, and therefore must be */ /* disabled here before any significant wxWidgets headers are included. */ #ifdef __WXMSW__ -#ifdef GetClassInfo -#undef GetClassInfo -#endif - -#ifdef GetClassName -#undef GetClassName -#endif - -#ifdef DrawText -#undef DrawText -#endif - -#ifdef GetCharWidth -#undef GetCharWidth -#endif - -#ifdef StartDoc -#undef StartDoc -#endif - -#ifdef FindWindow -#undef FindWindow -#endif - -#ifdef FindResource -#undef FindResource -#endif -#endif - /* __WXMSW__ */ +#include "wx/msw/winundef.h" +#endif /* __WXMSW__ */ /* include the feature test macros */