]> git.saurik.com Git - wxWidgets.git/commitdiff
Make public headers compatible with Objective-C++ with ARC.
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 21 Sep 2013 10:11:08 +0000 (10:11 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 21 Sep 2013 10:11:08 +0000 (10:11 +0000)
OSXGetViewOrWindow() virtual methods were defined in headers and were casting
NSView*/NSWindow* to void*, which the compiler complains about with ARC
enabled. Rather than writing conditional code in the header, move the
implementations into .cpp files. They were virtual anyway, so this is no less
efficient, and doesn't leave any problematic code in public headers.

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

include/wx/osx/nonownedwnd.h
include/wx/osx/window.h
src/osx/nonownedwnd_osx.cpp
src/osx/window_osx.cpp

index c7b75b085ff8338ee88462950b4bfaf35400a32a..edc3f04e6265889b0194be05ba827fb15450a952 100644 (file)
@@ -104,7 +104,7 @@ public:
 
 #if wxOSX_USE_COCOA_OR_IPHONE
     // override the base class method to return an NSWindow instead of NSView
-    virtual void *OSXGetViewOrWindow() const { return GetWXWindow(); }
+    virtual void *OSXGetViewOrWindow() const;
 #endif // Cocoa
 
     // osx specific event handling common for all osx-ports
index b98107e049889b135e0f2277485740930e920009..623493aa1e7d74424d7f3f22734519cb89a7fa29 100644 (file)
@@ -277,7 +277,7 @@ public:
     //
     // this is useful for a few Cocoa function which can work with either views
     // or windows indiscriminately, e.g. for setting NSViewAnimationTargetKey
-    virtual void *OSXGetViewOrWindow() const { return GetHandle(); }
+    virtual void *OSXGetViewOrWindow() const;
 #endif // Cocoa
 
     void *              MacGetCGContextRef() { return m_cgContextRef ; }
index 0828348eb19af8f04d6a300e77b674be801a8cd9..9e7f1e185cb9ac5ac75b73bd2e4f418e0ef12da6 100644 (file)
@@ -496,6 +496,11 @@ WXWindow wxNonOwnedWindow::GetWXWindow() const
     return m_nowpeer ? m_nowpeer->GetWXWindow() : NULL;
 }
 
+void *wxNonOwnedWindow::OSXGetViewOrWindow() const
+{
+    return GetWXWindow();
+}
+
 // ---------------------------------------------------------------------------
 // Shape implementation
 // ---------------------------------------------------------------------------
index cb3e871efdb8d5e888d6f7fe48f704a025e72a97..afbf5a0a3247ec1ef23e87e85dcd816d77df41b0 100644 (file)
@@ -2545,6 +2545,11 @@ bool wxWindowMac::OSXHandleClicked( double WXUNUSED(timestampsec) )
     return false;
 }
 
+void *wxWindowMac::OSXGetViewOrWindow() const
+{
+    return GetHandle();
+}
+
 wxInt32 wxWindowMac::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF event )
 {
 #if wxOSX_USE_COCOA_OR_CARBON