]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
wxCocoa: Added (mostly) stubs for wxGLCanvas and friends.
[wxWidgets.git] / include / wx / defs.h
index 6fc8a46f854edc3543450c35cf3197abfefc188d..5a0ede9afacab9627331652ca1e3b0e5aa598f6b 100644 (file)
@@ -270,6 +270,9 @@ typedef int wxWindowID;
     #ifndef HAVE_CONST_CAST
         #define HAVE_CONST_CAST
     #endif
+    #ifndef HAVE_REINTERPRET_CAST
+        #define HAVE_REINTERPRET_CAST
+    #endif
     #ifndef HAVE_STATIC_CAST
         #define HAVE_STATIC_CAST
     #endif
@@ -287,6 +290,12 @@ typedef int wxWindowID;
     #define wx_const_cast(t, x) ((t)(x))
 #endif
 
+#ifdef HAVE_REINTERPRET_CAST
+    #define wx_reinterpret_cast(t, x) reinterpret_cast<t>(x)
+#else
+    #define wx_reinterpret_cast(t, x) ((t)(x))
+#endif
+
 /* for consistency with wxStatic/DynamicCast defined in wx/object.h */
 #define wxConstCast(obj, className) wx_const_cast(className *, obj)
 
@@ -731,6 +740,28 @@ typedef wxUint32 wxDword;
     #error "Pointers can't be stored inside integer types."
 #endif
 
+#ifdef __cplusplus
+/* And also define a simple function to cast pointer to it. */
+inline wxUIntPtr wxPtrToUInt(void *p)
+{
+    /*
+       VC++ 7.1 gives warnings about casts such as below even when they're
+       explicit with /Wp64 option, suppress them as we really know what we're
+       doing here
+     */
+#ifdef __VISUALC__
+    #pragma warning(disable: 4311) /* pointer truncation from '' to '' */
+#endif
+
+    return wx_reinterpret_cast(wxUIntPtr, p);
+
+#ifdef __VISUALC__
+    #pragma warning(default: 4311)
+#endif
+}
+#endif /*__cplusplus*/
+
+
 /*  64 bit */
 
 /*  NB: we #define and not typedef wxLongLong_t because we want to be able to */
@@ -817,6 +848,24 @@ typedef float wxFloat32;
     typedef double wxDouble;
 #endif
 
+/*
+    Some (non standard) compilers typedef wchar_t as an existing type instead
+    of treating it as a real fundamental type, set wxWCHAR_T_IS_REAL_TYPE to 0
+    for them and to 1 for all the others.
+ */
+#if wxUSE_WCHAR_T
+    /*
+        VC++ typedefs wchar_t as unsigned short by default, that is unless
+        /Za or /Zc:wchar_t option is used in which case _WCHAR_T_DEFINED is
+        defined.
+     */
+#   if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED)
+#       define wxWCHAR_T_IS_REAL_TYPE 0
+#   else /* compiler having standard-conforming wchar_t */
+#       define wxWCHAR_T_IS_REAL_TYPE 1
+#   endif
+#endif /* wxUSE_WCHAR_T */
+
 /*  ---------------------------------------------------------------------------- */
 /*  byte ordering related definition and macros */
 /*  ---------------------------------------------------------------------------- */
@@ -1038,7 +1087,7 @@ enum wxStretch
     wxFIXED_MINSIZE           = 0x8000,
     wxTILE                    = 0xc000,
 
-    // for compatibility only, default now, don't use explicitly any more
+    /* for compatibility only, default now, don't use explicitly any more */
 #if WXWIN_COMPATIBILITY_2_4
     wxADJUST_MINSIZE          = 0x00100000
 #else
@@ -1188,6 +1237,9 @@ enum wxBorder
 #define wxFRAME_EX_CONTEXTHELP  0x00000004
 #define wxDIALOG_EX_CONTEXTHELP 0x00000004
 
+/*  Create a window which is attachable to another top level window */
+#define wxFRAME_DRAWER          0x0020
+
 /*
  * MDI parent frame style flags
  * Can overlap with some of the above.
@@ -1318,6 +1370,27 @@ enum wxBorder
 #define wxNB_RIGHT            0x0040
 #define wxNB_BOTTOM           0x0080
 #define wxNB_MULTILINE        0x0100
+#define wxNB_DEFAULT          wxNB_TOP
+
+/*
+ * wxListbook flags
+ */
+#define wxLB_DEFAULT          0x0
+#define wxLB_TOP              0x1
+#define wxLB_BOTTOM           0x2
+#define wxLB_LEFT             0x4
+#define wxLB_RIGHT            0x8
+#define wxLB_ALIGN_MASK       0xf
+
+/*
+ * wxChoicebook flags
+ */
+#define wxCHB_DEFAULT         0x0
+#define wxCHB_TOP             0x1
+#define wxCHB_BOTTOM          0x2
+#define wxCHB_LEFT            0x4
+#define wxCHB_RIGHT           0x8
+#define wxCHB_ALIGN_MASK      0xf
 
 /*
  * wxTabCtrl flags
@@ -2054,8 +2127,8 @@ typedef unsigned long   WXDWORD;
 typedef unsigned short  WXWORD;
 
 
-//typedef void*       WXWidget;
-//typedef void*       WXWindow;
+/* typedef void*       WXWidget; */
+/* typedef void*       WXWindow; */
 typedef WX_OPAQUE_TYPE(ControlRef ) * WXWidget ;
 typedef WX_OPAQUE_TYPE(WindowRef) * WXWindow ;
 typedef void*       WXDisplay;