]> git.saurik.com Git - wxWidgets.git/commitdiff
Various changes for wxCocoa
authorDavid Elliott <dfe@tgwbd.org>
Fri, 21 Mar 2003 17:09:18 +0000 (17:09 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Fri, 21 Mar 2003 17:09:18 +0000 (17:09 +0000)
- Check for __WXCOCOA__ as an acceptable definition for a GUI
- Where __WXMAC__ is used to mean "running on a mac" check for
  one of __WXMAC__ or __WXCOCOA__
- Add the obligatory __WXCOCOA__ definitions section

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h

index ff1598c7320dfc5d3d3139093eba0ec279882f45..e86ebff8d73299c6c2bb180641c1d868871b0cf2 100644 (file)
@@ -26,8 +26,9 @@
 #if defined(__WXMSW__) && defined(__X__)
 #error "Target can't be both X and Windows"
 #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
 #if defined(__WXMSW__) && defined(__X__)
 #error "Target can't be both X and Windows"
 #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
-      !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \
-      !defined(__WXMGL__) && !defined(__WXX11__) && wxUSE_GUI
+      !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__WXCOCOA__) && \
+      !defined(__X__) && !defined(__WXMGL__) && !defined(__WXX11__) && \
+      wxUSE_GUI
 #ifdef __UNIX__
 #error "No Target! You should use wx-config program for compilation flags!"
 #else // !Unix
 #ifdef __UNIX__
 #error "No Target! You should use wx-config program for compilation flags!"
 #else // !Unix
@@ -334,7 +335,7 @@ typedef int wxWindowID;
         #define WXEXPORT _Export
         #define WXIMPORT _Export
     #endif
         #define WXEXPORT _Export
         #define WXIMPORT _Export
     #endif
-#elif defined(__WXMAC__)    
+#elif defined(__WXMAC__) || defined(__WXCOCOA__)
     #ifdef __MWERKS__
         #define WXEXPORT __declspec(export)
         #define WXIMPORT __declspec(import)
     #ifdef __MWERKS__
         #define WXEXPORT __declspec(export)
         #define WXIMPORT __declspec(import)
@@ -613,7 +614,7 @@ enum
 //            precision, so use the IEEE types for storage , and this for calculations
 
 typedef float wxFloat32 ;
 //            precision, so use the IEEE types for storage , and this for calculations
 
 typedef float wxFloat32 ;
-#if defined( __WXMAC__ )  && defined (__MWERKS__)
+#if (defined( __WXMAC__ ) || defined(__WXCOCOA__))  && defined (__MWERKS__)
     typedef short double wxFloat64;
 #else
     typedef double wxFloat64;
     typedef short double wxFloat64;
 #else
     typedef double wxFloat64;
@@ -1889,6 +1890,34 @@ typedef ControlHandle   WXWidget;
 */
 #endif
 
 */
 #endif
 
+#ifdef __WXCOCOA__
+
+#if defined(__OBJC__)
+    #include <objc/objc.h>
+    #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
+    @class klass;                   typedef klass *WX_##klass
+#elif defined(wxI_LIKE_OBJC_ID)
+    #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
+    typedef id WX_##klass
+#else // the goal is to get rid of this secion at some time!
+    #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \
+    typedef void *WX_##klass
+#endif
+
+DECLARE_WXCOCOA_OBJC_CLASS(NSApplication);
+DECLARE_WXCOCOA_OBJC_CLASS(NSBox);
+DECLARE_WXCOCOA_OBJC_CLASS(NSButton);
+DECLARE_WXCOCOA_OBJC_CLASS(NSControl);
+DECLARE_WXCOCOA_OBJC_CLASS(NSMenu);
+DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem);
+DECLARE_WXCOCOA_OBJC_CLASS(NSPanel);
+DECLARE_WXCOCOA_OBJC_CLASS(NSTableView);
+DECLARE_WXCOCOA_OBJC_CLASS(NSTextField);
+DECLARE_WXCOCOA_OBJC_CLASS(NSWindow);
+DECLARE_WXCOCOA_OBJC_CLASS(NSView);
+typedef WX_NSView WXWidget; // wxWindows BASE definition
+#endif // __WXCOCOA__
+
 #if defined(__WXMSW__) || defined(__WXPM__)
 
 // the keywords needed for WinMain() declaration
 #if defined(__WXMSW__) || defined(__WXPM__)
 
 // the keywords needed for WinMain() declaration