diff --git a/modules/juce_events/juce_events.cpp b/modules/juce_events/juce_events.cpp index 884db8d743..922eb539c4 100644 --- a/modules/juce_events/juce_events.cpp +++ b/modules/juce_events/juce_events.cpp @@ -73,16 +73,12 @@ #include "native/juce_osx_MessageQueue.h" - JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - #if JUCE_MAC #include "native/juce_mac_MessageManager.mm" #else #include "native/juce_ios_MessageManager.mm" #endif - JUCE_END_IGNORE_WARNINGS_GCC_LIKE - #elif JUCE_WINDOWS #include "native/juce_win32_Messaging.cpp" #if JUCE_EVENTS_INCLUDE_WINRT_WRAPPER diff --git a/modules/juce_events/native/juce_mac_MessageManager.mm b/modules/juce_events/native/juce_mac_MessageManager.mm index 36352ab5ba..972e894ac7 100644 --- a/modules/juce_events/native/juce_mac_MessageManager.mm +++ b/modules/juce_events/native/juce_mac_MessageManager.mm @@ -43,20 +43,24 @@ public: NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [center addObserver: delegate selector: @selector (mainMenuTrackingBegan:) name: NSMenuDidBeginTrackingNotification object: nil]; [center addObserver: delegate selector: @selector (mainMenuTrackingEnded:) name: NSMenuDidEndTrackingNotification object: nil]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE if (JUCEApplicationBase::isStandaloneApp()) { [NSApp setDelegate: delegate]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSDistributedNotificationCenter defaultCenter] addObserver: delegate selector: @selector (broadcastMessageCallback:) name: getBroadcastEventName() object: nil suspensionBehavior: NSNotificationSuspensionBehaviorDeliverImmediately]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } else { @@ -103,7 +107,6 @@ private: AppDelegateClass() : ObjCClass ("JUCEAppDelegate_") { addMethod (@selector (applicationWillFinishLaunching:), applicationWillFinishLaunching, "v@:@"); - addMethod (@selector (getUrl:withReplyEvent:), getUrl_withReplyEvent, "v@:@@"); addMethod (@selector (applicationShouldTerminate:), applicationShouldTerminate, "I@:@"); addMethod (@selector (applicationWillTerminate:), applicationWillTerminate, "v@:@"); addMethod (@selector (application:openFile:), application_openFile, "c@:@@"); @@ -111,17 +114,25 @@ private: addMethod (@selector (applicationDidBecomeActive:), applicationDidBecomeActive, "v@:@"); addMethod (@selector (applicationDidResignActive:), applicationDidResignActive, "v@:@"); addMethod (@selector (applicationWillUnhide:), applicationWillUnhide, "v@:@"); + + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") + addMethod (@selector (getUrl:withReplyEvent:), getUrl_withReplyEvent, "v@:@@"); addMethod (@selector (broadcastMessageCallback:), broadcastMessageCallback, "v@:@"); addMethod (@selector (mainMenuTrackingBegan:), mainMenuTrackingBegan, "v@:@"); addMethod (@selector (mainMenuTrackingEnded:), mainMenuTrackingEnded, "v@:@"); addMethod (@selector (dummyMethod), dummyMethod, "v@:"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE #if JUCE_PUSH_NOTIFICATIONS //============================================================================== addIvar*> ("pushNotificationsDelegate"); addMethod (@selector (applicationDidFinishLaunching:), applicationDidFinishLaunching, "v@:@"); + + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (setPushNotificationsDelegate:), setPushNotificationsDelegate, "v@:@"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + addMethod (@selector (application:didRegisterForRemoteNotificationsWithDeviceToken:), registeredForRemoteNotifications, "v@:@@"); addMethod (@selector (application:didFailToRegisterForRemoteNotificationsWithError:), failedToRegisterForRemoteNotifications, "v@:@@"); addMethod (@selector (application:didReceiveRemoteNotification:), didReceiveRemoteNotification, "v@:@@"); @@ -133,10 +144,12 @@ private: private: static void applicationWillFinishLaunching (id self, SEL, NSNotification*) { + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSAppleEventManager sharedAppleEventManager] setEventHandler: self andSelector: @selector (getUrl:withReplyEvent:) forEventClass: kInternetEventClass andEventID: kAEGetURL]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } #if JUCE_PUSH_NOTIFICATIONS @@ -263,7 +276,7 @@ private: { auto* delegate = getPushNotificationsDelegate (self); - SEL selector = NSSelectorFromString (@"application:didRegisterForRemoteNotificationsWithDeviceToken:"); + SEL selector = @selector (application:didRegisterForRemoteNotificationsWithDeviceToken:); if (delegate != nil && [delegate respondsToSelector: selector]) { @@ -281,7 +294,7 @@ private: { auto* delegate = getPushNotificationsDelegate (self); - SEL selector = NSSelectorFromString (@"application:didFailToRegisterForRemoteNotificationsWithError:"); + SEL selector = @selector (application:didFailToRegisterForRemoteNotificationsWithError:); if (delegate != nil && [delegate respondsToSelector: selector]) { @@ -299,7 +312,7 @@ private: { auto* delegate = getPushNotificationsDelegate (self); - SEL selector = NSSelectorFromString (@"application:didReceiveRemoteNotification:"); + SEL selector = @selector (application:didReceiveRemoteNotification:); if (delegate != nil && [delegate respondsToSelector: selector]) { @@ -487,8 +500,10 @@ struct MountedVolumeListChangeDetector::Pimpl NSNotificationCenter* nc = [[NSWorkspace sharedWorkspace] notificationCenter]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [nc addObserver: delegate selector: @selector (changed:) name: NSWorkspaceDidMountNotification object: nil]; [nc addObserver: delegate selector: @selector (changed:) name: NSWorkspaceDidUnmountNotification object: nil]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } ~Pimpl() @@ -506,7 +521,11 @@ private: ObserverClass() : ObjCClass ("JUCEDriveObserver_") { addIvar ("owner"); + + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (changed:), changed, "v@:@"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + addProtocol (@protocol (NSTextInput)); registerClass(); } diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp index 056ff591b2..c70541c991 100644 --- a/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/modules/juce_gui_basics/juce_gui_basics.cpp @@ -229,8 +229,6 @@ namespace juce #endif #if JUCE_MAC || JUCE_IOS - JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - #if JUCE_IOS #include "native/juce_ios_UIViewComponentPeer.mm" #include "native/juce_ios_Windowing.mm" @@ -247,8 +245,6 @@ namespace juce #include "native/juce_mac_FileChooser.mm" #endif - JUCE_END_IGNORE_WARNINGS_GCC_LIKE - #include "native/juce_mac_MouseCursor.mm" #elif JUCE_WINDOWS diff --git a/modules/juce_gui_basics/native/juce_ios_Windowing.mm b/modules/juce_gui_basics/native/juce_ios_Windowing.mm index 82c9452fb3..f232905525 100644 --- a/modules/juce_gui_basics/native/juce_ios_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_ios_Windowing.mm @@ -198,7 +198,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:didRegisterUserNotificationSettings:"); + SEL selector = @selector (application:didRegisterUserNotificationSettings:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -216,7 +216,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:didRegisterForRemoteNotificationsWithDeviceToken:"); + SEL selector = @selector (application:didRegisterForRemoteNotificationsWithDeviceToken:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -234,7 +234,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:didFailToRegisterForRemoteNotificationsWithError:"); + SEL selector = @selector (application:didFailToRegisterForRemoteNotificationsWithError:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -252,7 +252,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:didReceiveRemoteNotification:"); + SEL selector = @selector (application:didReceiveRemoteNotification:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -271,7 +271,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:didReceiveRemoteNotification:fetchCompletionHandler:"); + SEL selector = @selector (application:didReceiveRemoteNotification:fetchCompletionHandler:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -292,7 +292,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:"); + SEL selector = @selector (application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -313,7 +313,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:didReceiveLocalNotification:"); + SEL selector = @selector (application:didReceiveLocalNotification:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -332,7 +332,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:handleActionWithIdentifier:forLocalNotification:completionHandler:"); + SEL selector = @selector (application:handleActionWithIdentifier:forLocalNotification:completionHandler:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -354,7 +354,7 @@ namespace juce { ignoreUnused (application); - SEL selector = NSSelectorFromString (@"application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler:"); + SEL selector = @selector (application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -377,7 +377,7 @@ namespace juce { ignoreUnused (center); - SEL selector = NSSelectorFromString (@"userNotificationCenter:willPresentNotification:withCompletionHandler:"); + SEL selector = @selector (userNotificationCenter:willPresentNotification:withCompletionHandler:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { @@ -397,7 +397,7 @@ namespace juce { ignoreUnused (center); - SEL selector = NSSelectorFromString (@"userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:"); + SEL selector = @selector (userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:); if (_pushNotificationsDelegate != nil && [_pushNotificationsDelegate respondsToSelector: selector]) { diff --git a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm index 9c147cafde..2389f7faa6 100644 --- a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm +++ b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm @@ -38,7 +38,10 @@ struct JuceMainMenuBarHolder : private DeletedAtShutdown auto appMenu = [[NSMenu alloc] initWithTitle: nsStringLiteral ("Apple")]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [NSApp performSelector: @selector (setAppleMenu:) withObject: appMenu]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + [mainMenuBar setSubmenu: appMenu forItem: item]; [appMenu release]; @@ -282,9 +285,11 @@ public: } else { + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") auto item = [[NSMenuItem alloc] initWithTitle: text action: @selector (menuItemInvoked:) keyEquivalent: nsEmptyString()]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE [item setTag: topLevelIndex]; [item setEnabled: i.isEnabled]; @@ -515,7 +520,10 @@ private: { addIvar ("owner"); + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (menuItemInvoked:), menuItemInvoked, "v@:@"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + addMethod (@selector (menuNeedsUpdate:), menuNeedsUpdate, "v@:@"); addProtocol (@protocol (NSMenuDelegate)); diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index beeeb4cfd1..98c05fc7ca 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -99,8 +99,12 @@ public: notificationCenter = [NSNotificationCenter defaultCenter]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") + SEL frameChangedSelector = @selector (frameChanged:); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + [notificationCenter addObserver: view - selector: @selector (frameChanged:) + selector: frameChangedSelector name: NSViewFrameDidChangeNotification object: view]; @@ -171,12 +175,12 @@ public: #endif [notificationCenter addObserver: view - selector: @selector (frameChanged:) + selector: frameChangedSelector name: NSWindowDidMoveNotification object: window]; [notificationCenter addObserver: view - selector: @selector (frameChanged:) + selector: frameChangedSelector name: NSWindowDidMiniaturizeNotification object: window]; @@ -1613,9 +1617,7 @@ struct JuceNSViewClass : public ObjCClass addMethod (@selector (isOpaque), isOpaque, "c@:"); addMethod (@selector (drawRect:), drawRect, "v@:", @encode (NSRect)); addMethod (@selector (mouseDown:), mouseDown, "v@:@"); - addMethod (@selector (asyncMouseDown:), asyncMouseDown, "v@:@"); addMethod (@selector (mouseUp:), mouseUp, "v@:@"); - addMethod (@selector (asyncMouseUp:), asyncMouseUp, "v@:@"); addMethod (@selector (mouseDragged:), mouseDragged, "v@:@"); addMethod (@selector (mouseMoved:), mouseMoved, "v@:@"); addMethod (@selector (mouseEntered:), mouseEntered, "v@:@"); @@ -1629,7 +1631,6 @@ struct JuceNSViewClass : public ObjCClass addMethod (@selector (scrollWheel:), scrollWheel, "v@:@"); addMethod (@selector (magnifyWithEvent:), magnify, "v@:@"); addMethod (@selector (acceptsFirstMouse:), acceptsFirstMouse, "c@:@"); - addMethod (@selector (frameChanged:), frameChanged, "v@:@"); addMethod (@selector (windowWillMiniaturize:), windowWillMiniaturize, "v@:@"); addMethod (@selector (windowDidDeminiaturize:), windowDidDeminiaturize, "v@:@"); addMethod (@selector (wantsDefaultClipping), wantsDefaultClipping, "c@:"); @@ -1670,6 +1671,12 @@ struct JuceNSViewClass : public ObjCClass addMethod (@selector (viewWillMoveToWindow:), willMoveToWindow, "v@:@"); + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") + addMethod (@selector (asyncMouseDown:), asyncMouseDown, "v@:@"); + addMethod (@selector (asyncMouseUp:), asyncMouseUp, "v@:@"); + addMethod (@selector (frameChanged:), frameChanged, "v@:@"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + addProtocol (@protocol (NSTextInput)); registerClass(); @@ -1684,27 +1691,39 @@ private: static void mouseDown (id self, SEL s, NSEvent* ev) { if (JUCEApplicationBase::isStandaloneApp()) + { asyncMouseDown (self, s, ev); + } else + { + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") // In some host situations, the host will stop modal loops from working // correctly if they're called from a mouse event, so we'll trigger // the event asynchronously.. [self performSelectorOnMainThread: @selector (asyncMouseDown:) withObject: ev waitUntilDone: NO]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + } } static void mouseUp (id self, SEL s, NSEvent* ev) { if (JUCEApplicationBase::isStandaloneApp()) + { asyncMouseUp (self, s, ev); + } else + { + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") // In some host situations, the host will stop modal loops from working // correctly if they're called from a mouse event, so we'll trigger // the event asynchronously.. [self performSelectorOnMainThread: @selector (asyncMouseUp:) withObject: ev waitUntilDone: NO]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + } } static void asyncMouseDown (id self, SEL, NSEvent* ev) { if (auto* p = getOwner (self)) p->redirectMouseDown (ev); } diff --git a/modules/juce_gui_extra/juce_gui_extra.cpp b/modules/juce_gui_extra/juce_gui_extra.cpp index d4ebed7fd2..bda3c872f6 100644 --- a/modules/juce_gui_extra/juce_gui_extra.cpp +++ b/modules/juce_gui_extra/juce_gui_extra.cpp @@ -149,8 +149,6 @@ //============================================================================== #if JUCE_MAC || JUCE_IOS - JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - #if JUCE_MAC #include "native/juce_mac_NSViewComponent.mm" #include "native/juce_mac_AppleRemote.mm" @@ -165,8 +163,6 @@ #include "native/juce_mac_WebBrowserComponent.mm" #endif - JUCE_END_IGNORE_WARNINGS_GCC_LIKE - //============================================================================== #elif JUCE_WINDOWS #include "native/juce_win32_ActiveXComponent.cpp" diff --git a/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp b/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp index 5255d835af..fbccee94d1 100644 --- a/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp +++ b/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp @@ -422,10 +422,10 @@ struct PushNotificationsDelegate id appDelegate = [[UIApplication sharedApplication] delegate]; - SEL selector = NSSelectorFromString (@"setPushNotificationsDelegateToUse:"); - - if ([appDelegate respondsToSelector: selector]) - [appDelegate performSelector: selector withObject: delegate.get()]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") + if ([appDelegate respondsToSelector: @selector (setPushNotificationsDelegateToUse:)]) + [appDelegate performSelector: @selector (setPushNotificationsDelegateToUse:) withObject: delegate.get()]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } virtual ~PushNotificationsDelegate() {} diff --git a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm index a4d997a837..6326283b99 100644 --- a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm @@ -42,10 +42,12 @@ struct NSViewResizeWatcher callback = [cls.createInstance() init]; ViewFrameChangeCallbackClass::setTarget (callback, this); + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] addObserver: callback selector: @selector (frameChanged:) name: NSViewFrameDidChangeNotification object: view]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } void detachViewWatcher() @@ -69,7 +71,11 @@ private: ViewFrameChangeCallbackClass() : ObjCClass ("JUCE_NSViewCallback_") { addIvar ("target"); + + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (frameChanged:), frameChanged, "v@:@"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE + registerClass(); } diff --git a/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp b/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp index 17880e7713..f72d93782a 100644 --- a/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp +++ b/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp @@ -272,10 +272,10 @@ struct PushNotificationsDelegate id appDelegate = [[NSApplication sharedApplication] delegate]; - SEL selector = NSSelectorFromString (@"setPushNotificationsDelegate:"); - - if ([appDelegate respondsToSelector: selector]) - [appDelegate performSelector: selector withObject: delegate.get()]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") + if ([appDelegate respondsToSelector: @selector (setPushNotificationsDelegate:)]) + [appDelegate performSelector: @selector (setPushNotificationsDelegate:) withObject: delegate.get()]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE [NSUserNotificationCenter defaultUserNotificationCenter].delegate = delegate.get(); } diff --git a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp index b92b3b37af..f40d166834 100644 --- a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp @@ -223,10 +223,12 @@ struct ViewBasedStatusItem : public StatusItemContainer SystemTrayViewClass::frameChanged (view.get(), SEL(), nullptr); + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] addObserver: view.get() selector: @selector (frameChanged:) name: NSWindowDidMoveNotification object: nil]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } ~ViewBasedStatusItem() override @@ -312,7 +314,10 @@ struct ViewBasedStatusItem : public StatusItemContainer addMethod (@selector (mouseDown:), handleEventDown, "v@:@"); addMethod (@selector (rightMouseDown:), handleEventDown, "v@:@"); addMethod (@selector (drawRect:), drawRect, "v@:@"); + + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") addMethod (@selector (frameChanged:), frameChanged, "v@:@"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE registerClass(); } diff --git a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm index 3177a62048..626aaa7ea3 100644 --- a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm @@ -565,10 +565,12 @@ public: void mouseMove (const MouseEvent&) { + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") // WebKit doesn't capture mouse-moves itself, so it seems the only way to make // them work is to push them via this non-public method.. if ([webView respondsToSelector: @selector (_updateMouseoverWithFakeEvent)]) [webView performSelector: @selector (_updateMouseoverWithFakeEvent)]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } private: diff --git a/modules/juce_opengl/juce_opengl.cpp b/modules/juce_opengl/juce_opengl.cpp index 78beeee9f8..76754ae0f5 100644 --- a/modules/juce_opengl/juce_opengl.cpp +++ b/modules/juce_opengl/juce_opengl.cpp @@ -263,16 +263,12 @@ private: //============================================================================== #if JUCE_MAC || JUCE_IOS - JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - #if JUCE_MAC #include "native/juce_OpenGL_osx.h" #else #include "native/juce_OpenGL_ios.h" #endif - JUCE_END_IGNORE_WARNINGS_GCC_LIKE - #elif JUCE_WINDOWS #include "native/juce_OpenGL_win32.h" diff --git a/modules/juce_opengl/native/juce_OpenGL_osx.h b/modules/juce_opengl/native/juce_OpenGL_osx.h index 3a7686bf58..e6378a99c7 100644 --- a/modules/juce_opengl/native/juce_OpenGL_osx.h +++ b/modules/juce_opengl/native/juce_OpenGL_osx.h @@ -49,10 +49,12 @@ public: if ([view respondsToSelector: @selector (setWantsBestResolutionOpenGLSurface:)]) [view setWantsBestResolutionOpenGLSurface: YES]; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] addObserver: view selector: @selector (_surfaceNeedsUpdate:) name: NSViewGlobalFrameDidChangeNotification object: view]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE renderContext = [[[NSOpenGLContext alloc] initWithFormat: format shareContext: (NSOpenGLContext*) contextToShare] autorelease]; diff --git a/modules/juce_video/native/juce_mac_CameraDevice.h b/modules/juce_video/native/juce_mac_CameraDevice.h index 30e69328c5..da3ca40ebe 100644 --- a/modules/juce_video/native/juce_mac_CameraDevice.h +++ b/modules/juce_video/native/juce_mac_CameraDevice.h @@ -215,10 +215,12 @@ struct CameraDevice::Pimpl callbackDelegate = (id) [cls.createInstance() init]; DelegateClass::setOwner (callbackDelegate, this); + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") [[NSNotificationCenter defaultCenter] addObserver: callbackDelegate - selector: DelegateClass::runtimeErrorSel() + selector: @selector (captureSessionRuntimeError:) name: AVCaptureSessionRuntimeErrorNotification object: session]; + JUCE_END_IGNORE_WARNINGS_GCC_LIKE } ~Pimpl() @@ -345,7 +347,9 @@ private: addMethod (@selector (captureOutput:didResumeRecordingToOutputFileAtURL: fromConnections:), didResumeRecordingToOutputFileAtURL, "v@:@@@"); addMethod (@selector (captureOutput:willFinishRecordingToOutputFileAtURL:fromConnections:error:), willFinishRecordingToOutputFileAtURL, "v@:@@@@"); - addMethod (runtimeErrorSel(), sessionRuntimeError, "v@:@"); + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") + addMethod (@selector (captureSessionRuntimeError:), sessionRuntimeError, "v@:@"); + JUCE_END_IGNORE_WARNINGS_GCC_LIKE registerClass(); } @@ -353,8 +357,6 @@ private: static void setOwner (id self, Pimpl* owner) { object_setInstanceVariable (self, "owner", owner); } static Pimpl& getOwner (id self) { return *getIvar (self, "owner"); } - static SEL runtimeErrorSel() { return NSSelectorFromString (nsStringLiteral ("captureSessionRuntimeError:")); } - private: static void didStartRecordingToOutputFileAtURL (id, SEL, AVCaptureFileOutput*, NSURL*, NSArray*) {} static void didPauseRecordingToOutputFileAtURL (id, SEL, AVCaptureFileOutput*, NSURL*, NSArray*) {}