From ac9e3f1f1c4ba844c5598aa577e51d128dd5921b Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 29 Jul 2008 20:22:57 +0000 Subject: [PATCH] osx regrouping git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54824 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 30 +++++++++++++++++++++++++----- include/wx/filename.h | 2 +- include/wx/icon.h | 4 ++++ include/wx/math.h | 4 ++-- include/wx/overlay.h | 2 +- include/wx/platinfo.h | 3 ++- include/wx/region.h | 2 +- include/wx/renderer.h | 2 +- include/wx/thread.h | 2 +- 9 files changed, 38 insertions(+), 13 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 5440cd9b3c..1555231826 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2662,8 +2662,10 @@ typedef unsigned long WXDWORD; typedef unsigned short WXWORD; typedef WX_OPAQUE_TYPE(PicHandle ) * WXHMETAFILE ; +#if wxOSX_USE_CARBON typedef WX_OPAQUE_TYPE(ControlRef ) * WXWidget ; typedef WX_OPAQUE_TYPE(WindowRef) * WXWindow ; +#endif typedef void* WXDisplay; @@ -2800,15 +2802,33 @@ 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__ +#ifndef __WXMAC__ typedef WX_NSView WXWidget; /* wxWidgets BASE definition */ #endif #endif /* __WXCOCOA__ || ( __WXMAC__ &__DARWIN__)*/ +#ifdef __WXMAC__ + +DECLARE_WXCOCOA_OBJC_CLASS(NSString); + +#if wxOSX_USE_COCOA + +typedef WX_NSWindow WXWindow; +typedef WX_NSView WXWidget; + +#elif wxOSX_USE_IPHONE + +DECLARE_WXCOCOA_OBJC_CLASS(UIWindow); +DECLARE_WXCOCOA_OBJC_CLASS(UIView); +DECLARE_WXCOCOA_OBJC_CLASS(UIFont); + +typedef WX_UIWindow WXWindow; +typedef WX_UIView WXWidget; + +#endif + +#endif // __WXMAC__ + #if defined(__WXPALMOS__) typedef void * WXHWND; diff --git a/include/wx/filename.h b/include/wx/filename.h index 023366e020..93b12c5107 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -248,7 +248,7 @@ public: } #endif // wxUSE_DATETIME -#ifdef __WXMAC__ +#if defined( __WXOSX_MAC__ ) && wxOSX_USE_CARBON bool MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) ; bool MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) ; // gets the 'common' type and creator for a certain extension diff --git a/include/wx/icon.h b/include/wx/icon.h index 7d5b946ca5..23ece7720e 100644 --- a/include/wx/icon.h +++ b/include/wx/icon.h @@ -32,7 +32,11 @@ #elif defined(__WXDFB__) #include "wx/generic/icon.h" #elif defined(__WXMAC__) +#if wxOSX_USE_CARBON #include "wx/osx/icon.h" +#else + #include "wx/generic/icon.h" +#endif #elif defined(__WXCOCOA__) #include "wx/cocoa/icon.h" #elif defined(__WXPM__) diff --git a/include/wx/math.h b/include/wx/math.h index b7096cbfdb..121a59062b 100644 --- a/include/wx/math.h +++ b/include/wx/math.h @@ -57,9 +57,9 @@ #if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__) #include #define wxFinite(x) _finite(x) -#elif defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \ +#elif ( defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \ defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \ - defined(__HPUX__)||defined(__MWERKS__) + defined(__HPUX__)||defined(__MWERKS__) ) && ( !defined(wxOSX_USE_IPHONE) || wxOSX_USE_IPHONE == 0 ) #ifdef __SOLARIS__ #include #endif diff --git a/include/wx/overlay.h b/include/wx/overlay.h index 5de5bc77bb..cb0b2e5a87 100644 --- a/include/wx/overlay.h +++ b/include/wx/overlay.h @@ -14,7 +14,7 @@ #include "wx/defs.h" -#if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS && wxMAC_USE_QUICKDRAW +#if defined(wxOSX_USE_CORE_GRAPHICS) && wxOSX_USE_CORE_GRAPHICS && wxOSX_USE_QUICKDRAW #define wxHAS_NATIVE_OVERLAY 1 #elif defined(__WXDFB__) #define wxHAS_NATIVE_OVERLAY 1 diff --git a/include/wx/platinfo.h b/include/wx/platinfo.h index e639d599e7..2a4e8621cf 100644 --- a/include/wx/platinfo.h +++ b/include/wx/platinfo.h @@ -80,7 +80,8 @@ enum wxPortId wxPORT_X11 = 1 << 5, // wxX11, using wxUniversal wxPORT_PM = 1 << 6, // wxOS2, using OS/2 Presentation Manager wxPORT_OS2 = wxPORT_PM, // wxOS2, using OS/2 Presentation Manager - wxPORT_MAC = 1 << 7, // wxMac, using Carbon or Classic Mac API + wxPORT_MAC = 1 << 7, // wxOSX (former wxMac), using Cocoa, Carbon or iPhone API + wxPORT_OSX = wxPORT_MAC, // wxOSX, using Cocoa, Carbon or iPhone API wxPORT_COCOA = 1 << 8, // wxCocoa, using Cocoa NextStep/Mac API wxPORT_WINCE = 1 << 9, // wxWinCE, toolkit is WinCE SDK API wxPORT_PALMOS = 1 << 10, // wxPalmOS, toolkit is PalmOS API diff --git a/include/wx/region.h b/include/wx/region.h index a4cf196b07..38c61ccf9c 100644 --- a/include/wx/region.h +++ b/include/wx/region.h @@ -183,7 +183,7 @@ protected: // ports with Combine() in this class #if defined(__WXPALMOS__) || \ defined(__WXMSW__) || \ - defined(__WXMAC__) || \ + ( defined(__WXMAC__) && wxOSX_USE_CARBON ) || \ defined(__WXPM__) #define wxHAS_REGION_COMBINE diff --git a/include/wx/renderer.h b/include/wx/renderer.h index 9b84247093..2ed03eea96 100644 --- a/include/wx/renderer.h +++ b/include/wx/renderer.h @@ -35,7 +35,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindow; #include "wx/string.h" // some platforms have their own renderers, others use the generic one -#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK__) +#if defined(__WXMSW__) || ( defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON ) || defined(__WXGTK__) #define wxHAS_NATIVE_RENDERER #else #undef wxHAS_NATIVE_RENDERER diff --git a/include/wx/thread.h b/include/wx/thread.h index 3c3493c3be..53e177f515 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -204,7 +204,7 @@ private: // in order to avoid any overhead under platforms where critical sections are // just mutexes make all wxCriticalSection class functions inline -#if !defined(__WXMSW__) && !defined(__WXMAC__) +#if !defined(__WXMSW__) && ( !defined(__WXMAC__) || wxOSX_USE_COCOA_OR_IPHONE ) #define wxCRITSECT_IS_MUTEX 1 #define wxCRITSECT_INLINE inline -- 2.47.2