]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxOSX_10_6_AND_LATER macro and use it.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 1 Dec 2009 16:47:33 +0000 (16:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 1 Dec 2009 16:47:33 +0000 (16:47 +0000)
Replace all occurrences of

@interface wxFoo : NSFoo
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
    <NSProtocol>
#endif

which we used for protocols new in 10.6 with just

@interface wxFoo : NSFoo wxOSX_10_6_AND_LATER(<NSProtocol>)

which looks better and simpler.

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

include/wx/osx/cocoa/private.h
include/wx/osx/core/private.h
src/osx/cocoa/listbox.mm
src/osx/cocoa/menu.mm
src/osx/cocoa/window.mm

index 2b0083adbd044a3ba83ef3fc6737308703a52ae4..caf331cf2a6514927f1d0be38f5c5c55a5d7e5aa 100644 (file)
@@ -144,7 +144,7 @@ public :
     virtual bool        DoHandleKeyEvent(NSEvent *event);
     virtual bool        DoHandleCharEvent(NSEvent *event, NSString *text);
     virtual void        DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
-    
+
     virtual void        SetupKeyEvent(wxKeyEvent &wxevent, NSEvent * nsEvent, NSString* charString = NULL);
     virtual void        SetupMouseEvent(wxMouseEvent &wxevent, NSEvent * nsEvent);
 
@@ -234,7 +234,7 @@ public :
     virtual bool IsFullScreen() const;
 
     virtual bool ShowFullScreen(bool show, long style);
-    
+
     virtual void ShowWithoutActivating();
 
     virtual void RequestUserAttention(int flags);
@@ -244,7 +244,7 @@ public :
     virtual void WindowToScreen( int *x, int *y );
 
     virtual bool IsActive();
-    
+
     wxNonOwnedWindow*   GetWXPeer() { return m_wxPeer; }
 protected :
     WX_wxNSWindow         m_macWindow;
@@ -301,12 +301,12 @@ protected :
     @end
 
 
-    @interface wxNSTextView : NSTextView
+    @interface wxNSTextView : NSTextView wxOSX_10_6_AND_LATER(<NSTextViewDelegate>)
     {
     }
-    
+
     - (void)textDidChange:(NSNotification *)aNotification;
-    
+
     @end
 
     @interface wxNSMenu : NSMenu
index 5cb0e3688ab1c0b4117886dfb892836ff9b0eec3..3326b1f1c8180b865989dc6045e09ba6f54b0180 100644 (file)
 #include "wx/osx/core/cfstring.h"
 #include "wx/osx/core/cfdataref.h"
 
+// Define helper macros allowing to insert small snippets of code to be
+// compiled for high enough OS X version only: this shouldn't be abused for
+// anything big but it's handy for e.g. specifying OS X 10.6-only protocols in
+// the Objective C classes declarations when they're not supported under the
+// previous versions
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+    #define wxOSX_10_6_AND_LATER(x) x
+#else
+    #define wxOSX_10_6_AND_LATER(x)
+#endif
+
 #if wxOSX_USE_COCOA_OR_CARBON
 
 WXDLLIMPEXP_BASE long UMAGetSystemVersion() ;
index 0e04dfb22c3ca6047b4d0963b2a067fe605aac8e..9aced58b092a86a78a7efc44d7469d09c8259ff2 100644 (file)
 
 class wxListWidgetCocoaImpl;
 
-@interface wxNSTableDataSource : NSObject
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
-    <NSTableViewDataSource>
-#endif
+@interface wxNSTableDataSource : NSObject wxOSX_10_6_AND_LATER(<NSTableViewDataSource>)
 {
     wxListWidgetCocoaImpl* impl;
 }
@@ -56,10 +53,7 @@ class wxListWidgetCocoaImpl;
 
 @end
 
-@interface wxNSTableView : NSTableView
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
-    <NSTableViewDelegate>
-#endif
+@interface wxNSTableView : NSTableView wxOSX_10_6_AND_LATER(<NSTableViewDelegate>)
 {
 }
 
index 34ea162c4df9c5e42db597dcf50320a9d9264402..39ebcf6acaea1e3966f50282044e5a5696e13d82 100644 (file)
 
 @end
 
-@interface wxNSMenuController : NSObject 
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
-    <NSMenuDelegate>
-#endif
+@interface wxNSMenuController : NSObject wxOSX_10_6_AND_LATER(<NSMenuDelegate>)
 {
 }
 
index 59b06c142f1e83a98706f45f6bea1bc5e92ebb06..a90434a622b368a67d6039223a86f1213d1a019f 100644 (file)
@@ -1199,10 +1199,7 @@ void wxWidgetCocoaImpl::SetVisibility( bool visible )
 // ----------------------------------------------------------------------------
 
 // define a delegate used to refresh the window during animation
-@interface wxNSAnimationDelegate : NSObject
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
-                                   <NSAnimationDelegate>
-#endif
+@interface wxNSAnimationDelegate : NSObject wxOSX_10_6_AND_LATER(<NSAnimationDelegate>)
 {
     wxWindow *m_win;
     bool m_isDone;