/* ---------------------------------------------------------------------------- */
/* Printf-like attribute definitions to obtain warnings with GNU C/C++ */
-#ifndef ATTRIBUTE_PRINTF
+#ifndef WX_ATTRIBUTE_PRINTF
# if defined(__GNUC__) && !wxUSE_UNICODE
-# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
+# define WX_ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
# else
-# define ATTRIBUTE_PRINTF(m, n)
+# define WX_ATTRIBUTE_PRINTF(m, n)
# endif
-# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
-# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
-# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
-# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
-# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
-#endif /* !defined(ATTRIBUTE_PRINTF) */
+# define WX_ATTRIBUTE_PRINTF_1 WX_ATTRIBUTE_PRINTF(1, 2)
+# define WX_ATTRIBUTE_PRINTF_2 WX_ATTRIBUTE_PRINTF(2, 3)
+# define WX_ATTRIBUTE_PRINTF_3 WX_ATTRIBUTE_PRINTF(3, 4)
+# define WX_ATTRIBUTE_PRINTF_4 WX_ATTRIBUTE_PRINTF(4, 5)
+# define WX_ATTRIBUTE_PRINTF_5 WX_ATTRIBUTE_PRINTF(5, 6)
+#endif /* !defined(WX_ATTRIBUTE_PRINTF) */
/* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */
handle the deprecation attribute even in the constructor.
doesn't seem to work on Apple's gcc 4.0.1 unless using -O0
*/
-#if defined( __DARWIN__ ) && !defined(__WXDEBUG__)
+#if wxCHECK_GCC_VERSION(3, 4) || defined( __DARWIN__ )
#define wxDEPRECATED_CONSTRUCTOR(x) x
#else
#define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x)
# define wxDEPRECATED_BUT_USED_INTERNALLY(x) wxDEPRECATED(x)
#endif
-/* everybody gets the assert and other debug macros */
-#include "wx/debug.h"
+/*
+ Combination of the two variants above: should be used for deprecated
+ functions which are defined inline and are used by wxWidgets itself.
+ */
+#ifdef WXBUILDING
+# define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) func { body }
+#else
+# define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) \
+ wxDEPRECATED(func) { body }
+#endif
/* NULL declaration: it must be defined as 0 for C++ programs (in particular, */
/* it must not be defined as "(void *)0" which is standard for C but completely */
#endif
#ifdef __cplusplus
+
+// everybody gets the assert and other debug macros
+#include "wx/debug.h"
+
// delete pointer if it is not NULL and NULL it afterwards
template <typename T>
inline void wxDELETE(T*& ptr)
/* integer on success as failure indicator */
#define wxNOT_FOUND (-1)
+/* the default value for some length parameters meaning that the string is */
+/* NUL-terminated */
+#define wxNO_LEN ((size_t)-1)
+
/* ---------------------------------------------------------------------------- */
/* macros dealing with comparison operators */
/* ---------------------------------------------------------------------------- */
#define WXUNUSED(identifier) identifier
#endif
-/* some arguments are only used in debug mode, but unused in release one */
-#ifdef __WXDEBUG__
- #define WXUNUSED_UNLESS_DEBUG(param) param
-#else
- #define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param)
-#endif
-
/* some arguments are not used in unicode mode */
#if wxUSE_UNICODE
#define WXUNUSED_IN_UNICODE(param) WXUNUSED(param)
#else
#error "error defining ssize_t, size_t is not 4 or 8 bytes"
#endif
+
+ /* prevent ssize_t redefinitions in other libraries */
+ #define HAVE_SSIZE_T
#endif
// we can't rely on Windows _W64 being defined as windows.h may not be included
/* base floating point types */
-/* wxFloat32: 32 bit IEEE float ( 1 sign, 8 exponent bits, 23 fraction bits */
-/* wxFloat64: 64 bit IEEE float ( 1 sign, 11 exponent bits, 52 fraction bits */
+/* wxFloat32: 32 bit IEEE float ( 1 sign, 8 exponent bits, 23 fraction bits ) */
+/* wxFloat64: 64 bit IEEE float ( 1 sign, 11 exponent bits, 52 fraction bits ) */
/* wxDouble: native fastest representation that has at least wxFloat64 */
/* precision, so use the IEEE types for storage, and this for */
/* calculations */
#define wxTC_MULTILINE 0x0200 /* == wxNB_MULTILINE */
#define wxTC_OWNERDRAW 0x0400
-/*
- * wxStatusBar95 flags
- */
-#define wxST_SIZEGRIP 0x0010
-
/*
* wxStaticBitmap flags
*/
#define wxSIZE_NO_ADJUSTMENTS 0x0008
/* Change the window position even if it seems to be already correct */
#define wxSIZE_FORCE 0x0010
+/* Emit size event even if size didn't change */
+#define wxSIZE_FORCE_EVENT 0x0020
/* ---------------------------------------------------------------------------- */
/* GDI descriptions */
/* Virtual keycodes */
enum wxKeyCode
{
- WXK_BACK = 8,
+ WXK_BACK = 8, // backspace
WXK_TAB = 9,
WXK_RETURN = 13,
WXK_ESCAPE = 27,
+
+ /* values from 33 to 126 are reserved for the standard ASCII characters */
+
WXK_SPACE = 32,
WXK_DELETE = 127,
+ /* values from 128 to 255 are reserved for ASCII extended characters
+ (note that there isn't a real widely used standard for the meaning
+ of these values; avoid them in portable apps!) */
+
/* These are, by design, not compatible with unicode characters.
If you want to get a unicode character from a key event, use
wxKeyEvent::GetUnicodeKey instead. */
typedef WX_OPAQUE_TYPE(PicHandle ) * WXHMETAFILE ;
#if wxOSX_USE_CARBON
-typedef WX_OPAQUE_TYPE(ControlRef ) * WXWidget ;
-typedef WX_OPAQUE_TYPE(WindowRef) * WXWindow ;
+typedef struct OpaqueControlRef* WXWidget ;
+typedef struct OpaqueWindowPtr* WXWindow ;
typedef struct __AGLPixelFormatRec *WXGLPixelFormat;
typedef struct __AGLContextRec *WXGLContext;
#endif
typedef const void * CFTypeRef;
-typedef const struct __CFString * CFStringRef;
+// typedef const struct __CFString * CFStringRef;
+
+#define DECLARE_WXOSX_OPAQUE_CFREF( name ) typedef struct __##name* name##Ref;
+#define DECLARE_WXOSX_OPAQUE_CONST_CFREF( name ) typedef const struct __##name* name##Ref;
+
+DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFString )
typedef struct __CFString * CFMutableStringRef;
-typedef struct __CFRunLoopSource * CFRunLoopSourceRef;
+DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoopSource )
+DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFont )
+DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFontDescriptor )
-#define DECLARE_WXMAC_OPAQUE_CGREF( name ) typedef struct name* name##Ref;
+#define DECLARE_WXOSX_OPAQUE_CGREF( name ) typedef struct name* name##Ref;
-DECLARE_WXMAC_OPAQUE_CGREF( CGColor )
-DECLARE_WXMAC_OPAQUE_CGREF( CGImage )
-DECLARE_WXMAC_OPAQUE_CGREF( CGContext )
+DECLARE_WXOSX_OPAQUE_CGREF( CGColor )
+DECLARE_WXOSX_OPAQUE_CGREF( CGImage )
+DECLARE_WXOSX_OPAQUE_CGREF( CGContext )
+DECLARE_WXOSX_OPAQUE_CGREF( CGFont )
typedef CGColorRef WXCOLORREF;
typedef CGImageRef WXCGIMAGEREF;
DECLARE_WXCOCOA_OBJC_CLASS(NSControl);
DECLARE_WXCOCOA_OBJC_CLASS(NSCursor);
DECLARE_WXCOCOA_OBJC_CLASS(NSEvent);
+DECLARE_WXCOCOA_OBJC_CLASS(NSFont);
+DECLARE_WXCOCOA_OBJC_CLASS(NSFontDescriptor);
DECLARE_WXCOCOA_OBJC_CLASS(NSFontPanel);
DECLARE_WXCOCOA_OBJC_CLASS(NSImage);
DECLARE_WXCOCOA_OBJC_CLASS(NSLayoutManager);
#include "wx/features.h"
/* --------------------------------------------------------------------------- */
-/* macro to define a class without copy ctor nor assignment operator */
+/* macros to define a class without copy ctor nor assignment operator */
/* --------------------------------------------------------------------------- */
-#define DECLARE_NO_COPY_CLASS(classname) \
+#define wxDECLARE_NO_COPY_CLASS(classname) \
private: \
classname(const classname&); \
- classname& operator=(const classname&);
+ classname& operator=(const classname&)
+
+#define wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \
+ private: \
+ classname(const classname<arg>&); \
+ classname& operator=(const classname<arg>&)
-#define DECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \
- private: \
- classname(const classname<arg>&); \
- classname& operator=(const classname<arg>&);
+#define wxDECLARE_NO_COPY_TEMPLATE_CLASS_2(classname, arg1, arg2) \
+ private: \
+ classname(const classname<arg1, arg2>&); \
+ classname& operator=(const classname<arg1, arg2>&)
-#define DECLARE_NO_ASSIGN_CLASS(classname) \
+#define wxDECLARE_NO_ASSIGN_CLASS(classname) \
private: \
- classname& operator=(const classname&);
+ classname& operator=(const classname&)
+
+// deprecated variants _not_ requiring a semicolon after them
+#define DECLARE_NO_COPY_CLASS(classname) \
+ wxDECLARE_NO_COPY_CLASS(classname);
+#define DECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \
+ wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg);
+#define DECLARE_NO_ASSIGN_CLASS(classname) \
+ wxDECLARE_NO_ASSIGN_CLASS(classname);
/* --------------------------------------------------------------------------- */
/* If a manifest is being automatically generated, add common controls 6 to it */