From 81fa777ff78bc5dd2fc0f2439eb8bd3079485597 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 10 Nov 2021 17:57:51 +0000 Subject: [PATCH] ObjC Helpers: Automatically derive appropriate signature for function --- .../AU/juce_AU_Wrapper.mm | 14 +- .../AU/juce_AUv3_Wrapper.mm | 70 ++++--- .../juce_audio_processors.cpp | 6 +- .../native/juce_mac_AudioCDBurner.mm | 19 +- ..._mac_BluetoothMidiDevicePairingDialogue.mm | 8 +- modules/juce_core/native/juce_mac_Network.mm | 33 ++-- .../juce_core/native/juce_mac_ObjCHelpers.h | 60 +++--- .../native/juce_mac_MessageManager.mm | 38 ++-- .../accessibility/juce_ios_Accessibility.mm | 58 +++--- .../accessibility/juce_mac_Accessibility.mm | 114 +++++------ .../native/juce_ios_ContentSharer.cpp | 2 +- .../native/juce_ios_FileChooser.mm | 6 +- .../native/juce_ios_Windowing.mm | 2 +- .../native/juce_mac_FileChooser.mm | 7 +- .../native/juce_mac_MainMenu.mm | 10 +- .../native/juce_mac_NSViewComponentPeer.mm | 178 +++++++++--------- .../native/juce_mac_Windowing.mm | 10 +- .../native/juce_ios_PushNotifications.cpp | 22 +-- .../native/juce_mac_NSViewComponent.mm | 2 +- .../native/juce_mac_PushNotifications.cpp | 12 +- .../native/juce_mac_SystemTrayIcon.cpp | 10 +- .../native/juce_mac_WebBrowserComponent.mm | 32 ++-- modules/juce_opengl/native/juce_OpenGL_osx.h | 6 +- .../native/juce_ios_InAppPurchases.cpp | 14 +- .../juce_video/native/juce_ios_CameraDevice.h | 32 ++-- .../juce_video/native/juce_mac_CameraDevice.h | 12 +- modules/juce_video/native/juce_mac_Video.h | 8 +- 27 files changed, 391 insertions(+), 394 deletions(-) diff --git a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm index 8557bceed9..3e55fa6ea1 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm @@ -1622,10 +1622,10 @@ public: addIvar ("au"); addIvar ("editor"); - addMethod (@selector (dealloc), dealloc, "v@:"); - addMethod (@selector (applicationWillTerminate:), applicationWillTerminate, "v@:@"); - addMethod (@selector (viewDidMoveToWindow), viewDidMoveToWindow, "v@:"); - addMethod (@selector (mouseDownCanMoveWindow), mouseDownCanMoveWindow, "c@:"); + addMethod (@selector (dealloc), dealloc); + addMethod (@selector (applicationWillTerminate:), applicationWillTerminate); + addMethod (@selector (viewDidMoveToWindow), viewDidMoveToWindow); + addMethod (@selector (mouseDownCanMoveWindow), mouseDownCanMoveWindow); registerClass(); } @@ -1709,9 +1709,9 @@ public: { JuceUICreationClass() : ObjCClass ("JUCE_AUCocoaViewClass_") { - addMethod (@selector (interfaceVersion), interfaceVersion, @encode (unsigned int), "@:"); - addMethod (@selector (description), description, @encode (NSString*), "@:"); - addMethod (@selector (uiViewForAudioUnit:withSize:), uiViewForAudioUnit, @encode (NSView*), "@:", @encode (AudioUnit), @encode (NSSize)); + addMethod (@selector (interfaceVersion), interfaceVersion); + addMethod (@selector (description), description); + addMethod (@selector (uiViewForAudioUnit:withSize:), uiViewForAudioUnit); addProtocol (@protocol (AUCocoaUIBase)); diff --git a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm index 5ecc29be03..cad2fd4a21 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm @@ -216,73 +216,67 @@ private: addIvar ("cppObject"); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (initWithComponentDescription:options:error:juceClass:), - initWithComponentDescriptionAndJuceClass, "@@:", - @encode (AudioComponentDescription), - @encode (AudioComponentInstantiationOptions), "^@@"); + addMethod (@selector (initWithComponentDescription:options:error:juceClass:), initWithComponentDescriptionAndJuceClass); JUCE_END_IGNORE_WARNINGS_GCC_LIKE - addMethod (@selector (initWithComponentDescription:options:error:), - initWithComponentDescription, "@@:", - @encode (AudioComponentDescription), - @encode (AudioComponentInstantiationOptions), "^@"); + addMethod (@selector (initWithComponentDescription:options:error:), initWithComponentDescription); - addMethod (@selector (dealloc), dealloc, "v@:"); + addMethod (@selector (dealloc), dealloc); //============================================================================== - addMethod (@selector (reset), reset, "v@:"); + addMethod (@selector (reset), reset); //============================================================================== - addMethod (@selector (currentPreset), getCurrentPreset, "@@:"); - addMethod (@selector (setCurrentPreset:), setCurrentPreset, "v@:@"); - addMethod (@selector (factoryPresets), getFactoryPresets, "@@:"); - addMethod (@selector (fullState), getFullState, "@@:"); - addMethod (@selector (setFullState:), setFullState, "v@:@"); - addMethod (@selector (parameterTree), getParameterTree, "@@:"); - addMethod (@selector (parametersForOverviewWithCount:), parametersForOverviewWithCount, "@@:", @encode (NSInteger)); + addMethod (@selector (currentPreset), getCurrentPreset); + addMethod (@selector (setCurrentPreset:), setCurrentPreset); + addMethod (@selector (factoryPresets), getFactoryPresets); + addMethod (@selector (fullState), getFullState); + addMethod (@selector (setFullState:), setFullState); + addMethod (@selector (parameterTree), getParameterTree); + addMethod (@selector (parametersForOverviewWithCount:), parametersForOverviewWithCount); //============================================================================== - addMethod (@selector (latency), getLatency, @encode (NSTimeInterval), "@:"); - addMethod (@selector (tailTime), getTailTime, @encode (NSTimeInterval), "@:"); + addMethod (@selector (latency), getLatency); + addMethod (@selector (tailTime), getTailTime); //============================================================================== - addMethod (@selector (inputBusses), getInputBusses, "@@:"); - addMethod (@selector (outputBusses), getOutputBusses, "@@:"); - addMethod (@selector (channelCapabilities), getChannelCapabilities, "@@:"); - addMethod (@selector (shouldChangeToFormat:forBus:), shouldChangeToFormat, "c@:@@"); + addMethod (@selector (inputBusses), getInputBusses); + addMethod (@selector (outputBusses), getOutputBusses); + addMethod (@selector (channelCapabilities), getChannelCapabilities); + addMethod (@selector (shouldChangeToFormat:forBus:), shouldChangeToFormat); //============================================================================== - addMethod (@selector (virtualMIDICableCount), getVirtualMIDICableCount, @encode (NSInteger), "@:"); + addMethod (@selector (virtualMIDICableCount), getVirtualMIDICableCount); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (supportsMPE), getSupportsMPE, @encode (BOOL), "@:"); + addMethod (@selector (supportsMPE), getSupportsMPE); JUCE_END_IGNORE_WARNINGS_GCC_LIKE #if JUCE_AUV3_MIDI_OUTPUT_SUPPORTED if (@available (macOS 10.13, iOS 11.0, *)) - addMethod (@selector (MIDIOutputNames), getMIDIOutputNames, "@@:"); + addMethod (@selector (MIDIOutputNames), getMIDIOutputNames); #endif //============================================================================== - addMethod (@selector (internalRenderBlock), getInternalRenderBlock, @encode (AUInternalRenderBlock), "@:"); - addMethod (@selector (canProcessInPlace), getCanProcessInPlace, @encode (BOOL), "@:"); - addMethod (@selector (isRenderingOffline), getRenderingOffline, @encode (BOOL), "@:"); - addMethod (@selector (setRenderingOffline:), setRenderingOffline, "v@:", @encode (BOOL)); - addMethod (@selector (shouldBypassEffect), getShouldBypassEffect, @encode (BOOL), "@:"); - addMethod (@selector (setShouldBypassEffect:), setShouldBypassEffect, "v@:", @encode (BOOL)); - addMethod (@selector (allocateRenderResourcesAndReturnError:), allocateRenderResourcesAndReturnError, "c@:^@"); - addMethod (@selector (deallocateRenderResources), deallocateRenderResources, "v@:"); + addMethod (@selector (internalRenderBlock), getInternalRenderBlock); + addMethod (@selector (canProcessInPlace), getCanProcessInPlace); + addMethod (@selector (isRenderingOffline), getRenderingOffline); + addMethod (@selector (setRenderingOffline:), setRenderingOffline); + addMethod (@selector (shouldBypassEffect), getShouldBypassEffect); + addMethod (@selector (setShouldBypassEffect:), setShouldBypassEffect); + addMethod (@selector (allocateRenderResourcesAndReturnError:), allocateRenderResourcesAndReturnError); + addMethod (@selector (deallocateRenderResources), deallocateRenderResources); //============================================================================== - addMethod (@selector (contextName), getContextName, "@@:"); - addMethod (@selector (setContextName:), setContextName, "v@:@"); + addMethod (@selector (contextName), getContextName); + addMethod (@selector (setContextName:), setContextName); //============================================================================== #if JUCE_AUV3_VIEW_CONFIG_SUPPORTED if (@available (macOS 10.13, iOS 11.0, *)) { - addMethod (@selector (supportedViewConfigurations:), getSupportedViewConfigurations, "@@:@"); - addMethod (@selector (selectViewConfiguration:), selectViewConfiguration, "v@:@"); + addMethod (@selector (supportedViewConfigurations:), getSupportedViewConfigurations); + addMethod (@selector (selectViewConfiguration:), selectViewConfiguration); } #endif diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 8592e27547..99903be4e2 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -150,9 +150,9 @@ private: { addIvar ("owner"); - addMethod (@selector (isFlipped), isFlipped, "c@:"); - addMethod (@selector (isOpaque), isOpaque, "c@:"); - addMethod (@selector (didAddSubview:), didAddSubview, "v@:@"); + addMethod (@selector (isFlipped), isFlipped); + addMethod (@selector (isOpaque), isOpaque); + addMethod (@selector (didAddSubview:), didAddSubview); registerClass(); } diff --git a/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm b/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm index 77a5a0167c..2030154563 100644 --- a/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm +++ b/modules/juce_audio_utils/native/juce_mac_AudioCDBurner.mm @@ -35,20 +35,19 @@ struct AudioTrackProducerClass : public ObjCClass addIvar ("source"); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (initWithAudioSourceHolder:), initWithAudioSourceHolder, "@@:^v"); - addMethod (@selector (verifyDataForTrack:intoBuffer:length:atAddress:blockSize:ioFlags:), - produceDataForTrack, "I@:@^cIQI^I"); + addMethod (@selector (initWithAudioSourceHolder:), initWithAudioSourceHolder); + addMethod (@selector (verifyDataForTrack:intoBuffer:length:atAddress:blockSize:ioFlags:), produceDataForTrack); JUCE_END_IGNORE_WARNINGS_GCC_LIKE - addMethod (@selector (cleanupTrackAfterBurn:), cleanupTrackAfterBurn, "v@:@"); - addMethod (@selector (cleanupTrackAfterVerification:), cleanupTrackAfterVerification, "c@:@"); - addMethod (@selector (estimateLengthOfTrack:), estimateLengthOfTrack, "Q@:@"); - addMethod (@selector (prepareTrack:forBurn:toMedia:), prepareTrack, "c@:@@@"); - addMethod (@selector (prepareTrackForVerification:), prepareTrackForVerification, "c@:@"); + addMethod (@selector (cleanupTrackAfterBurn:), cleanupTrackAfterBurn); + addMethod (@selector (cleanupTrackAfterVerification:), cleanupTrackAfterVerification); + addMethod (@selector (estimateLengthOfTrack:), estimateLengthOfTrack); + addMethod (@selector (prepareTrack:forBurn:toMedia:), prepareTrack); + addMethod (@selector (prepareTrackForVerification:), prepareTrackForVerification); addMethod (@selector (produceDataForTrack:intoBuffer:length:atAddress:blockSize:ioFlags:), - produceDataForTrack, "I@:@^cIQI^I"); + produceDataForTrack); addMethod (@selector (producePreGapForTrack:intoBuffer:length:atAddress:blockSize:ioFlags:), - produceDataForTrack, "I@:@^cIQI^I"); + produceDataForTrack); registerClass(); } diff --git a/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm b/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm index 7b60933a35..d1debbb0b4 100644 --- a/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm +++ b/modules/juce_audio_utils/native/juce_mac_BluetoothMidiDevicePairingDialogue.mm @@ -42,12 +42,12 @@ public: addIvar ("controller"); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (initWithCallbacks:), initWithCallbacks, "@@:^v"); - addMethod (@selector (show:), show, "v@:^v"); - addMethod (@selector (receivedWindowWillClose:), receivedWindowWillClose, "v@:^v"); + addMethod (@selector (initWithCallbacks:), initWithCallbacks); + addMethod (@selector (show:), show); + addMethod (@selector (receivedWindowWillClose:), receivedWindowWillClose); JUCE_END_IGNORE_WARNINGS_GCC_LIKE - addMethod (@selector (dealloc), dealloc, "v@:"); + addMethod (@selector (dealloc), dealloc); registerClass(); } diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index 22b96a8524..edbe8e55b9 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -339,13 +339,13 @@ private: { addIvar ("state"); - addMethod (@selector (connection:didReceiveResponse:), didReceiveResponse, "v@:@@"); - addMethod (@selector (connection:didFailWithError:), didFailWithError, "v@:@@"); - addMethod (@selector (connection:didReceiveData:), didReceiveData, "v@:@@"); + addMethod (@selector (connection:didReceiveResponse:), didReceiveResponse); + addMethod (@selector (connection:didFailWithError:), didFailWithError); + addMethod (@selector (connection:didReceiveData:), didReceiveData); addMethod (@selector (connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:), - connectionDidSendBodyData, "v@:@iii"); - addMethod (@selector (connectionDidFinishLoading:), connectionDidFinishLoading, "v@:@"); - addMethod (@selector (connection:willSendRequest:redirectResponse:), willSendRequest, "@@:@@@"); + connectionDidSendBodyData); + addMethod (@selector (connectionDidFinishLoading:), connectionDidFinishLoading); + addMethod (@selector (connection:willSendRequest:redirectResponse:), willSendRequest); registerClass(); } @@ -608,14 +608,14 @@ private: addIvar ("state"); addMethod (@selector (URLSession:dataTask:didReceiveResponse:completionHandler:), - didReceiveResponse, "v@:@@@@"); - addMethod (@selector (URLSession:didBecomeInvalidWithError:), didBecomeInvalidWithError, "v@:@@"); - addMethod (@selector (URLSession:dataTask:didReceiveData:), didReceiveData, "v@:@@@"); + didReceiveResponse); + addMethod (@selector (URLSession:didBecomeInvalidWithError:), didBecomeInvalidWithError); + addMethod (@selector (URLSession:dataTask:didReceiveData:), didReceiveData); addMethod (@selector (URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:), - didSendBodyData, "v@:@@qqq"); + didSendBodyData); addMethod (@selector (URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:), - willPerformHTTPRedirection, "v@:@@@@@"); - addMethod (@selector (URLSession:task:didCompleteWithError:), didCompleteWithError, "v@:@@@"); + willPerformHTTPRedirection); + addMethod (@selector (URLSession:task:didCompleteWithError:), didCompleteWithError); registerClass(); } @@ -872,11 +872,10 @@ struct BackgroundDownloadTask : public URL::DownloadTask { addIvar ("state"); - addMethod (@selector (URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:), - didWriteData, "v@:@@qqq"); - addMethod (@selector (URLSession:downloadTask:didFinishDownloadingToURL:), didFinishDownloadingToURL, "v@:@@@"); - addMethod (@selector (URLSession:task:didCompleteWithError:), didCompleteWithError, "v@:@@@"); - addMethod (@selector (URLSession:didBecomeInvalidWithError:), didBecomeInvalidWithError, "v@:@@@"); + addMethod (@selector (URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:), didWriteData); + addMethod (@selector (URLSession:downloadTask:didFinishDownloadingToURL:), didFinishDownloadingToURL); + addMethod (@selector (URLSession:task:didCompleteWithError:), didCompleteWithError); + addMethod (@selector (URLSession:didBecomeInvalidWithError:), didBecomeInvalidWithError); registerClass(); } diff --git a/modules/juce_core/native/juce_mac_ObjCHelpers.h b/modules/juce_core/native/juce_mac_ObjCHelpers.h index 1847e8c7c0..be7a3438cf 100644 --- a/modules/juce_core/native/juce_mac_ObjCHelpers.h +++ b/modules/juce_core/native/juce_mac_ObjCHelpers.h @@ -312,6 +312,35 @@ private: T item{}; }; +//============================================================================== +namespace detail +{ + constexpr auto makeCompileTimeStr() + { + return std::array { { '\0' } }; + } + + template + constexpr auto joinCompileTimeStrImpl (A&& a, std::index_sequence, + B&& b, std::index_sequence) + { + return std::array { { a[As]..., b[Bs]..., '\0' } }; + } + + template + constexpr auto joinCompileTimeStr (const char (&a)[A], std::array b) + { + return joinCompileTimeStrImpl (a, std::make_index_sequence(), + b, std::make_index_sequence()); + } + + template + constexpr auto makeCompileTimeStr (const char (&v)[A], Others&&... others) + { + return joinCompileTimeStr (v, makeCompileTimeStr (others...)); + } +} // namespace detail + //============================================================================== template inline Type getIvar (id self, const char* name) @@ -354,29 +383,12 @@ struct ObjCClass jassert (b); ignoreUnused (b); } - template - void addMethod (SEL selector, FunctionType callbackFn, const char* signature) + template + void addMethod (SEL selector, Result (*callbackFn) (Args...)) { - BOOL b = class_addMethod (cls, selector, (IMP) callbackFn, signature); - jassert (b); ignoreUnused (b); - } - - template - void addMethod (SEL selector, FunctionType callbackFn, const char* sig1, const char* sig2) - { - addMethod (selector, callbackFn, (String (sig1) + sig2).toUTF8()); - } - - template - void addMethod (SEL selector, FunctionType callbackFn, const char* sig1, const char* sig2, const char* sig3) - { - addMethod (selector, callbackFn, (String (sig1) + sig2 + sig3).toUTF8()); - } - - template - void addMethod (SEL selector, FunctionType callbackFn, const char* sig1, const char* sig2, const char* sig3, const char* sig4) - { - addMethod (selector, callbackFn, (String (sig1) + sig2 + sig3 + sig4).toUTF8()); + const auto s = detail::makeCompileTimeStr (@encode (Result), @encode (Args)...); + const auto b = class_addMethod (cls, selector, (IMP) callbackFn, s.data()); + jassertquiet (b); } void addProtocol (Protocol* protocol) @@ -413,10 +425,10 @@ struct ObjCLifetimeManagedClass : public ObjCClass addIvar ("cppObject"); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (initWithJuceObject:), initWithJuceObject, "@@:@"); + addMethod (@selector (initWithJuceObject:), initWithJuceObject); JUCE_END_IGNORE_WARNINGS_GCC_LIKE - addMethod (@selector (dealloc), dealloc, "v@:"); + addMethod (@selector (dealloc), dealloc); registerClass(); } diff --git a/modules/juce_events/native/juce_mac_MessageManager.mm b/modules/juce_events/native/juce_mac_MessageManager.mm index 8db6c39ae7..a3806649fa 100644 --- a/modules/juce_events/native/juce_mac_MessageManager.mm +++ b/modules/juce_events/native/juce_mac_MessageManager.mm @@ -37,36 +37,36 @@ struct AppDelegateClass : public ObjCClass { AppDelegateClass() : ObjCClass ("JUCEAppDelegate_") { - addMethod (@selector (applicationWillFinishLaunching:), applicationWillFinishLaunching, "v@:@"); - addMethod (@selector (applicationShouldTerminate:), applicationShouldTerminate, "I@:@"); - addMethod (@selector (applicationWillTerminate:), applicationWillTerminate, "v@:@"); - addMethod (@selector (application:openFile:), application_openFile, "c@:@@"); - addMethod (@selector (application:openFiles:), application_openFiles, "v@:@@"); - addMethod (@selector (applicationDidBecomeActive:), applicationDidBecomeActive, "v@:@"); - addMethod (@selector (applicationDidResignActive:), applicationDidResignActive, "v@:@"); - addMethod (@selector (applicationWillUnhide:), applicationWillUnhide, "v@:@"); + addMethod (@selector (applicationWillFinishLaunching:), applicationWillFinishLaunching); + addMethod (@selector (applicationShouldTerminate:), applicationShouldTerminate); + addMethod (@selector (applicationWillTerminate:), applicationWillTerminate); + addMethod (@selector (application:openFile:), application_openFile); + addMethod (@selector (application:openFiles:), application_openFiles); + addMethod (@selector (applicationDidBecomeActive:), applicationDidBecomeActive); + addMethod (@selector (applicationDidResignActive:), applicationDidResignActive); + addMethod (@selector (applicationWillUnhide:), applicationWillUnhide); 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@:"); + addMethod (@selector (getUrl:withReplyEvent:), getUrl_withReplyEvent); + addMethod (@selector (broadcastMessageCallback:), broadcastMessageCallback); + addMethod (@selector (mainMenuTrackingBegan:), mainMenuTrackingBegan); + addMethod (@selector (mainMenuTrackingEnded:), mainMenuTrackingEnded); + addMethod (@selector (dummyMethod), dummyMethod); JUCE_END_IGNORE_WARNINGS_GCC_LIKE #if JUCE_PUSH_NOTIFICATIONS //============================================================================== addIvar*> ("pushNotificationsDelegate"); - addMethod (@selector (applicationDidFinishLaunching:), applicationDidFinishLaunching, "v@:@"); + addMethod (@selector (applicationDidFinishLaunching:), applicationDidFinishLaunching); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (setPushNotificationsDelegate:), setPushNotificationsDelegate, "v@:@"); + addMethod (@selector (setPushNotificationsDelegate:), setPushNotificationsDelegate); JUCE_END_IGNORE_WARNINGS_GCC_LIKE - addMethod (@selector (application:didRegisterForRemoteNotificationsWithDeviceToken:), registeredForRemoteNotifications, "v@:@@"); - addMethod (@selector (application:didFailToRegisterForRemoteNotificationsWithError:), failedToRegisterForRemoteNotifications, "v@:@@"); - addMethod (@selector (application:didReceiveRemoteNotification:), didReceiveRemoteNotification, "v@:@@"); + addMethod (@selector (application:didRegisterForRemoteNotificationsWithDeviceToken:), registeredForRemoteNotifications); + addMethod (@selector (application:didFailToRegisterForRemoteNotificationsWithError:), failedToRegisterForRemoteNotifications); + addMethod (@selector (application:didReceiveRemoteNotification:), didReceiveRemoteNotification); #endif registerClass(); @@ -515,7 +515,7 @@ private: addIvar ("owner"); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (changed:), changed, "v@:@"); + addMethod (@selector (changed:), changed); JUCE_END_IGNORE_WARNINGS_GCC_LIKE addProtocol (@protocol (NSTextInput)); diff --git a/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm b/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm index 86a13dc03c..770bb78ecb 100644 --- a/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm +++ b/modules/juce_gui_basics/native/accessibility/juce_ios_Accessibility.mm @@ -118,13 +118,13 @@ private: AccessibilityContainer() : ObjCClass ("JUCEUIAccessibilityElementContainer_") { - addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement, "c@:"); - addMethod (@selector (accessibilityFrame), getAccessibilityFrame, @encode (CGRect), "@:"); - addMethod (@selector (accessibilityElements), getAccessibilityElements, "@@:"); + addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement); + addMethod (@selector (accessibilityFrame), getAccessibilityFrame); + addMethod (@selector (accessibilityElements), getAccessibilityElements); #if JUCE_IOS_CONTAINER_API_AVAILABLE if (@available (iOS 11.0, *)) - addMethod (@selector (accessibilityContainerType), getAccessibilityContainerType, "i@:"); + addMethod (@selector (accessibilityContainerType), getAccessibilityContainerType); #endif addIvar ("handler"); @@ -200,42 +200,42 @@ private: AccessibilityElement (Type elementType) { - addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement, "c@:"); - addMethod (@selector (accessibilityContainer), getAccessibilityContainer, "@@:"); - addMethod (@selector (accessibilityFrame), getAccessibilityFrame, @encode (CGRect), "@:"); - addMethod (@selector (accessibilityTraits), getAccessibilityTraits, "i@:"); - addMethod (@selector (accessibilityLabel), getAccessibilityTitle, "@@:"); - addMethod (@selector (accessibilityHint), getAccessibilityHelp, "@@:"); - addMethod (@selector (accessibilityValue), getAccessibilityValue, "@@:"); - addMethod (@selector (setAccessibilityValue:), setAccessibilityValue, "v@:@"); + addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement); + addMethod (@selector (accessibilityContainer), getAccessibilityContainer); + addMethod (@selector (accessibilityFrame), getAccessibilityFrame); + addMethod (@selector (accessibilityTraits), getAccessibilityTraits); + addMethod (@selector (accessibilityLabel), getAccessibilityTitle); + addMethod (@selector (accessibilityHint), getAccessibilityHelp); + addMethod (@selector (accessibilityValue), getAccessibilityValue); + addMethod (@selector (setAccessibilityValue:), setAccessibilityValue); - addMethod (@selector (accessibilityElementDidBecomeFocused), onFocusGain, "v@:"); - addMethod (@selector (accessibilityElementDidLoseFocus), onFocusLoss, "v@:"); - addMethod (@selector (accessibilityElementIsFocused), isFocused, "c@:"); - addMethod (@selector (accessibilityViewIsModal), getIsAccessibilityModal, "c@:"); + addMethod (@selector (accessibilityElementDidBecomeFocused), onFocusGain); + addMethod (@selector (accessibilityElementDidLoseFocus), onFocusLoss); + addMethod (@selector (accessibilityElementIsFocused), isFocused); + addMethod (@selector (accessibilityViewIsModal), getIsAccessibilityModal); - addMethod (@selector (accessibilityActivate), accessibilityPerformActivate, "c@:"); - addMethod (@selector (accessibilityIncrement), accessibilityPerformIncrement, "c@:"); - addMethod (@selector (accessibilityDecrement), accessibilityPerformDecrement, "c@:"); - addMethod (@selector (accessibilityPerformEscape), accessibilityPerformEscape, "c@:"); + addMethod (@selector (accessibilityActivate), accessibilityPerformActivate); + addMethod (@selector (accessibilityIncrement), accessibilityPerformIncrement); + addMethod (@selector (accessibilityDecrement), accessibilityPerformDecrement); + addMethod (@selector (accessibilityPerformEscape), accessibilityPerformEscape); #if JUCE_IOS_CONTAINER_API_AVAILABLE if (@available (iOS 11.0, *)) { - addMethod (@selector (accessibilityDataTableCellElementForRow:column:), getAccessibilityDataTableCellElementForRowColumn, "@@:ii"); - addMethod (@selector (accessibilityRowCount), getAccessibilityRowCount, "i@:"); - addMethod (@selector (accessibilityColumnCount), getAccessibilityColumnCount, "i@:"); - addMethod (@selector (accessibilityRowRange), getAccessibilityRowIndexRange, @encode (NSRange), "@:"); - addMethod (@selector (accessibilityColumnRange), getAccessibilityColumnIndexRange, @encode (NSRange), "@:"); + addMethod (@selector (accessibilityDataTableCellElementForRow:column:), getAccessibilityDataTableCellElementForRowColumn); + addMethod (@selector (accessibilityRowCount), getAccessibilityRowCount); + addMethod (@selector (accessibilityColumnCount), getAccessibilityColumnCount); + addMethod (@selector (accessibilityRowRange), getAccessibilityRowIndexRange); + addMethod (@selector (accessibilityColumnRange), getAccessibilityColumnIndexRange); } #endif if (elementType == Type::textElement) { - addMethod (@selector (accessibilityLineNumberForPoint:), getAccessibilityLineNumberForPoint, "i@:", @encode (CGPoint)); - addMethod (@selector (accessibilityContentForLineNumber:), getAccessibilityContentForLineNumber, "@@:i"); - addMethod (@selector (accessibilityFrameForLineNumber:), getAccessibilityFrameForLineNumber, @encode (CGRect), "@:i"); - addMethod (@selector (accessibilityPageContent), getAccessibilityPageContent, "@@:"); + addMethod (@selector (accessibilityLineNumberForPoint:), getAccessibilityLineNumberForPoint); + addMethod (@selector (accessibilityContentForLineNumber:), getAccessibilityContentForLineNumber); + addMethod (@selector (accessibilityFrameForLineNumber:), getAccessibilityFrameForLineNumber); + addMethod (@selector (accessibilityPageContent), getAccessibilityPageContent); addProtocol (@protocol (UIAccessibilityReadingContent)); } diff --git a/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm b/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm index b1a1b9be92..d2c226bfac 100644 --- a/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm +++ b/modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm @@ -71,70 +71,70 @@ private: private: AccessibilityElement() { - addMethod (@selector (accessibilityNotifiesWhenDestroyed), getAccessibilityNotifiesWhenDestroyed, "c@:"); - addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement, "c@:"); - addMethod (@selector (isAccessibilityEnabled), getIsAccessibilityEnabled, "c@:"); - addMethod (@selector (accessibilityWindow), getAccessibilityWindow, "@@:"); - addMethod (@selector (accessibilityTopLevelUIElement), getAccessibilityWindow, "@@:"); - addMethod (@selector (accessibilityFocusedUIElement), getAccessibilityFocusedUIElement, "@@:"); - addMethod (@selector (accessibilityHitTest:), accessibilityHitTest, "@@:", @encode (NSPoint)); - addMethod (@selector (accessibilityParent), getAccessibilityParent, "@@:"); - addMethod (@selector (accessibilityChildren), getAccessibilityChildren, "@@:"); - addMethod (@selector (isAccessibilityFocused), getIsAccessibilityFocused, "c@:"); - addMethod (@selector (setAccessibilityFocused:), setAccessibilityFocused, "v@:c"); - addMethod (@selector (isAccessibilityModal), getIsAccessibilityModal, "c@:"); - addMethod (@selector (accessibilityFrame), getAccessibilityFrame, @encode (NSRect), "@:"); - addMethod (@selector (accessibilityRole), getAccessibilityRole, "@@:"); - addMethod (@selector (accessibilitySubrole), getAccessibilitySubrole, "@@:"); - addMethod (@selector (accessibilityTitle), getAccessibilityTitle, "@@:"); - addMethod (@selector (accessibilityLabel), getAccessibilityLabel, "@@:"); - addMethod (@selector (accessibilityHelp), getAccessibilityHelp, "@@:"); - addMethod (@selector (accessibilityValue), getAccessibilityValue, "@@:"); - addMethod (@selector (setAccessibilityValue:), setAccessibilityValue, "v@:@"); - addMethod (@selector (accessibilitySelectedChildren), getAccessibilitySelectedChildren, "@@:"); - addMethod (@selector (setAccessibilitySelectedChildren:), setAccessibilitySelectedChildren, "v@:@"); - addMethod (@selector (accessibilityOrientation), getAccessibilityOrientation, "i@:@"); + addMethod (@selector (accessibilityNotifiesWhenDestroyed), getAccessibilityNotifiesWhenDestroyed); + addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement); + addMethod (@selector (isAccessibilityEnabled), getIsAccessibilityEnabled); + addMethod (@selector (accessibilityWindow), getAccessibilityWindow); + addMethod (@selector (accessibilityTopLevelUIElement), getAccessibilityWindow); + addMethod (@selector (accessibilityFocusedUIElement), getAccessibilityFocusedUIElement); + addMethod (@selector (accessibilityHitTest:), accessibilityHitTest); + addMethod (@selector (accessibilityParent), getAccessibilityParent); + addMethod (@selector (accessibilityChildren), getAccessibilityChildren); + addMethod (@selector (isAccessibilityFocused), getIsAccessibilityFocused); + addMethod (@selector (setAccessibilityFocused:), setAccessibilityFocused); + addMethod (@selector (isAccessibilityModal), getIsAccessibilityModal); + addMethod (@selector (accessibilityFrame), getAccessibilityFrame); + addMethod (@selector (accessibilityRole), getAccessibilityRole); + addMethod (@selector (accessibilitySubrole), getAccessibilitySubrole); + addMethod (@selector (accessibilityTitle), getAccessibilityTitle); + addMethod (@selector (accessibilityLabel), getAccessibilityLabel); + addMethod (@selector (accessibilityHelp), getAccessibilityHelp); + addMethod (@selector (accessibilityValue), getAccessibilityValue); + addMethod (@selector (setAccessibilityValue:), setAccessibilityValue); + addMethod (@selector (accessibilitySelectedChildren), getAccessibilitySelectedChildren); + addMethod (@selector (setAccessibilitySelectedChildren:), setAccessibilitySelectedChildren); + addMethod (@selector (accessibilityOrientation), getAccessibilityOrientation); - addMethod (@selector (accessibilityInsertionPointLineNumber), getAccessibilityInsertionPointLineNumber, "i@:"); - addMethod (@selector (accessibilityVisibleCharacterRange), getAccessibilityVisibleCharacterRange, @encode (NSRange), "@:"); - addMethod (@selector (accessibilityNumberOfCharacters), getAccessibilityNumberOfCharacters, "i@:"); - addMethod (@selector (accessibilitySelectedText), getAccessibilitySelectedText, "@@:"); - addMethod (@selector (accessibilitySelectedTextRange), getAccessibilitySelectedTextRange, @encode (NSRange), "@:"); - addMethod (@selector (accessibilityAttributedStringForRange:), getAccessibilityAttributedStringForRange, "@@:", @encode (NSRange)); - addMethod (@selector (accessibilityRangeForLine:), getAccessibilityRangeForLine, @encode (NSRange), "@:i"); - addMethod (@selector (accessibilityStringForRange:), getAccessibilityStringForRange, "@@:", @encode (NSRange)); - addMethod (@selector (accessibilityRangeForPosition:), getAccessibilityRangeForPosition, @encode (NSRange), "@:", @encode (NSPoint)); - addMethod (@selector (accessibilityRangeForIndex:), getAccessibilityRangeForIndex, @encode (NSRange), "@:i"); - addMethod (@selector (accessibilityFrameForRange:), getAccessibilityFrameForRange, @encode (NSRect), "@:", @encode (NSRange)); - addMethod (@selector (accessibilityLineForIndex:), getAccessibilityLineForIndex, "i@:i"); - addMethod (@selector (setAccessibilitySelectedTextRange:), setAccessibilitySelectedTextRange, "v@:", @encode (NSRange)); + addMethod (@selector (accessibilityInsertionPointLineNumber), getAccessibilityInsertionPointLineNumber); + addMethod (@selector (accessibilityVisibleCharacterRange), getAccessibilityVisibleCharacterRange); + addMethod (@selector (accessibilityNumberOfCharacters), getAccessibilityNumberOfCharacters); + addMethod (@selector (accessibilitySelectedText), getAccessibilitySelectedText); + addMethod (@selector (accessibilitySelectedTextRange), getAccessibilitySelectedTextRange); + addMethod (@selector (accessibilityAttributedStringForRange:), getAccessibilityAttributedStringForRange); + addMethod (@selector (accessibilityRangeForLine:), getAccessibilityRangeForLine); + addMethod (@selector (accessibilityStringForRange:), getAccessibilityStringForRange); + addMethod (@selector (accessibilityRangeForPosition:), getAccessibilityRangeForPosition); + addMethod (@selector (accessibilityRangeForIndex:), getAccessibilityRangeForIndex); + addMethod (@selector (accessibilityFrameForRange:), getAccessibilityFrameForRange); + addMethod (@selector (accessibilityLineForIndex:), getAccessibilityLineForIndex); + addMethod (@selector (setAccessibilitySelectedTextRange:), setAccessibilitySelectedTextRange); - addMethod (@selector (accessibilityRowCount), getAccessibilityRowCount, "i@:"); - addMethod (@selector (accessibilityRows), getAccessibilityRows, "@@:"); - addMethod (@selector (accessibilitySelectedRows), getAccessibilitySelectedRows, "@@:"); - addMethod (@selector (setAccessibilitySelectedRows:), setAccessibilitySelectedRows, "v@:@"); - addMethod (@selector (accessibilityColumnCount), getAccessibilityColumnCount, "i@:"); - addMethod (@selector (accessibilityColumns), getAccessibilityColumns, "@@:"); - addMethod (@selector (accessibilitySelectedColumns), getAccessibilitySelectedColumns, "@@:"); - addMethod (@selector (setAccessibilitySelectedColumns:), setAccessibilitySelectedColumns, "v@:@"); + addMethod (@selector (accessibilityRowCount), getAccessibilityRowCount); + addMethod (@selector (accessibilityRows), getAccessibilityRows); + addMethod (@selector (accessibilitySelectedRows), getAccessibilitySelectedRows); + addMethod (@selector (setAccessibilitySelectedRows:), setAccessibilitySelectedRows); + addMethod (@selector (accessibilityColumnCount), getAccessibilityColumnCount); + addMethod (@selector (accessibilityColumns), getAccessibilityColumns); + addMethod (@selector (accessibilitySelectedColumns), getAccessibilitySelectedColumns); + addMethod (@selector (setAccessibilitySelectedColumns:), setAccessibilitySelectedColumns); - addMethod (@selector (accessibilityRowIndexRange), getAccessibilityRowIndexRange, @encode (NSRange), "@:"); - addMethod (@selector (accessibilityColumnIndexRange), getAccessibilityColumnIndexRange, @encode (NSRange), "@:"); - addMethod (@selector (accessibilityIndex), getAccessibilityIndex, "i@:"); - addMethod (@selector (accessibilityDisclosureLevel), getAccessibilityDisclosureLevel, "i@:"); - addMethod (@selector (isAccessibilityExpanded), getIsAccessibilityExpanded, "c@:"); + addMethod (@selector (accessibilityRowIndexRange), getAccessibilityRowIndexRange); + addMethod (@selector (accessibilityColumnIndexRange), getAccessibilityColumnIndexRange); + addMethod (@selector (accessibilityIndex), getAccessibilityIndex); + addMethod (@selector (accessibilityDisclosureLevel), getAccessibilityDisclosureLevel); + addMethod (@selector (isAccessibilityExpanded), getIsAccessibilityExpanded); - addMethod (@selector (accessibilityPerformIncrement), accessibilityPerformIncrement, "c@:"); - addMethod (@selector (accessibilityPerformDecrement), accessibilityPerformDecrement, "c@:"); - addMethod (@selector (accessibilityPerformDelete), accessibilityPerformDelete, "c@:"); - addMethod (@selector (accessibilityPerformPress), accessibilityPerformPress, "c@:"); - addMethod (@selector (accessibilityPerformShowMenu), accessibilityPerformShowMenu, "c@:"); - addMethod (@selector (accessibilityPerformRaise), accessibilityPerformRaise, "c@:"); + addMethod (@selector (accessibilityPerformIncrement), accessibilityPerformIncrement); + addMethod (@selector (accessibilityPerformDecrement), accessibilityPerformDecrement); + addMethod (@selector (accessibilityPerformDelete), accessibilityPerformDelete); + addMethod (@selector (accessibilityPerformPress), accessibilityPerformPress); + addMethod (@selector (accessibilityPerformShowMenu), accessibilityPerformShowMenu); + addMethod (@selector (accessibilityPerformRaise), accessibilityPerformRaise); - addMethod (@selector (isAccessibilitySelectorAllowed:), getIsAccessibilitySelectorAllowed, "c@:@"); + addMethod (@selector (isAccessibilitySelectorAllowed:), getIsAccessibilitySelectorAllowed); #if defined (MAC_OS_X_VERSION_10_13) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_13 - addMethod (@selector (accessibilityChildrenInNavigationOrder), getAccessibilityChildren, "@@:"); + addMethod (@selector (accessibilityChildrenInNavigationOrder), getAccessibilityChildren); #endif registerClass(); diff --git a/modules/juce_gui_basics/native/juce_ios_ContentSharer.cpp b/modules/juce_gui_basics/native/juce_ios_ContentSharer.cpp index 059c068521..3747121e2e 100644 --- a/modules/juce_gui_basics/native/juce_ios_ContentSharer.cpp +++ b/modules/juce_gui_basics/native/juce_ios_ContentSharer.cpp @@ -176,7 +176,7 @@ private: { PopoverDelegateClass() : ObjCClass> ("PopoverDelegateClass_") { - addMethod (@selector (popoverPresentationController:willRepositionPopoverToRect:inView:), willRepositionPopover, "v@:@@@"); + addMethod (@selector (popoverPresentationController:willRepositionPopoverToRect:inView:), willRepositionPopover); registerClass(); } diff --git a/modules/juce_gui_basics/native/juce_ios_FileChooser.mm b/modules/juce_gui_basics/native/juce_ios_FileChooser.mm index 797a0c03b9..fa3a81c9b6 100644 --- a/modules/juce_gui_basics/native/juce_ios_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_ios_FileChooser.mm @@ -301,8 +301,8 @@ private: { addIvar ("owner"); - addMethod (@selector (documentPicker:didPickDocumentAtURL:), didPickDocumentAtURL, "v@:@@"); - addMethod (@selector (documentPickerWasCancelled:), documentPickerWasCancelled, "v@:@"); + addMethod (@selector (documentPicker:didPickDocumentAtURL:), didPickDocumentAtURL); + addMethod (@selector (documentPickerWasCancelled:), documentPickerWasCancelled); addProtocol (@protocol (UIDocumentPickerDelegate)); @@ -331,7 +331,7 @@ private: FileChooserControllerClass() : ObjCClass ("FileChooserController_") { addIvar ("owner"); - addMethod (@selector (viewDidDisappear:), viewDidDisappear, "v@:@c"); + addMethod (@selector (viewDidDisappear:), viewDidDisappear); registerClass(); } diff --git a/modules/juce_gui_basics/native/juce_ios_Windowing.mm b/modules/juce_gui_basics/native/juce_ios_Windowing.mm index 574947484f..21f8411f11 100644 --- a/modules/juce_gui_basics/native/juce_ios_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_ios_Windowing.mm @@ -732,7 +732,7 @@ private: addIvar ("owner"); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (darkModeChanged:), darkModeChanged, "v@:@"); + addMethod (@selector (darkModeChanged:), darkModeChanged); JUCE_END_IGNORE_WARNINGS_GCC_LIKE registerClass(); diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index a432324211..3cf1337cad 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -336,8 +336,7 @@ private: explicit SafeModalPanel (const char* name) : ObjCClass (name) { this->addMethod (@selector (preventsApplicationTerminationWhenModal), - preventsApplicationTerminationWhenModal, - "c@:"); + preventsApplicationTerminationWhenModal); this->registerClass(); } @@ -360,8 +359,8 @@ private: { addIvar ("cppObject"); - addMethod (@selector (panel:shouldShowFilename:), shouldShowFilename, "c@:@@"); - addMethod (@selector (panelSelectionDidChange:), panelSelectionDidChange, "c@"); + addMethod (@selector (panel:shouldShowFilename:), shouldShowFilename); + addMethod (@selector (panelSelectionDidChange:), panelSelectionDidChange); addProtocol (@protocol (NSOpenSavePanelDelegate)); diff --git a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm index 8585cef74b..e5143fb131 100644 --- a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm +++ b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm @@ -457,8 +457,8 @@ private: { ValidatorClass() : ObjCClass ("JUCEMenuValidator_") { - addMethod (menuItemInvokedSelector, menuItemInvoked, "c@:@"); - addMethod (@selector (validateMenuItem:), validateMenuItem, "c@:@"); + addMethod (menuItemInvokedSelector, menuItemInvoked); + addMethod (@selector (validateMenuItem:), validateMenuItem); #if defined (MAC_OS_X_VERSION_10_14) addProtocol (@protocol (NSMenuItemValidation)); @@ -551,9 +551,9 @@ private: { addIvar ("owner"); - addMethod (menuItemInvokedSelector, menuItemInvoked, "v@:@"); - addMethod (@selector (menuNeedsUpdate:), menuNeedsUpdate, "v@:@"); - addMethod (@selector (validateMenuItem:), validateMenuItem, "c@:@"); + addMethod (menuItemInvokedSelector, menuItemInvoked); + addMethod (@selector (menuNeedsUpdate:), menuNeedsUpdate); + addMethod (@selector (validateMenuItem:), validateMenuItem); 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 6d98ac4ae6..e4e225cd7d 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -1738,83 +1738,83 @@ struct JuceNSViewClass : public NSViewComponentPeerWrapper> { JuceNSViewClass() : NSViewComponentPeerWrapper ("JUCEView_") { - addMethod (@selector (isOpaque), isOpaque, "c@:"); - addMethod (@selector (drawRect:), drawRect, "v@:", @encode (NSRect)); - addMethod (@selector (mouseDown:), mouseDown, "v@:@"); - addMethod (@selector (mouseUp:), mouseUp, "v@:@"); - addMethod (@selector (mouseDragged:), mouseDragged, "v@:@"); - addMethod (@selector (mouseMoved:), mouseMoved, "v@:@"); - addMethod (@selector (mouseEntered:), mouseEntered, "v@:@"); - addMethod (@selector (mouseExited:), mouseExited, "v@:@"); - addMethod (@selector (rightMouseDown:), mouseDown, "v@:@"); - addMethod (@selector (rightMouseDragged:), mouseDragged, "v@:@"); - addMethod (@selector (rightMouseUp:), mouseUp, "v@:@"); - addMethod (@selector (otherMouseDown:), mouseDown, "v@:@"); - addMethod (@selector (otherMouseDragged:), mouseDragged, "v@:@"); - addMethod (@selector (otherMouseUp:), mouseUp, "v@:@"); - addMethod (@selector (scrollWheel:), scrollWheel, "v@:@"); - addMethod (@selector (magnifyWithEvent:), magnify, "v@:@"); - addMethod (@selector (acceptsFirstMouse:), acceptsFirstMouse, "c@:@"); - addMethod (@selector (windowWillMiniaturize:), windowWillMiniaturize, "v@:@"); - addMethod (@selector (windowDidDeminiaturize:), windowDidDeminiaturize, "v@:@"); - addMethod (@selector (wantsDefaultClipping), wantsDefaultClipping, "c@:"); - addMethod (@selector (worksWhenModal), worksWhenModal, "c@:"); - addMethod (@selector (viewDidMoveToWindow), viewDidMoveToWindow, "v@:"); - addMethod (@selector (viewWillDraw), viewWillDraw, "v@:"); - addMethod (@selector (keyDown:), keyDown, "v@:@"); - addMethod (@selector (keyUp:), keyUp, "v@:@"); - addMethod (@selector (insertText:), insertText, "v@:@"); - addMethod (@selector (doCommandBySelector:), doCommandBySelector, "v@::"); - addMethod (@selector (setMarkedText:selectedRange:), setMarkedText, "v@:@", @encode (NSRange)); - addMethod (@selector (unmarkText), unmarkText, "v@:"); - addMethod (@selector (hasMarkedText), hasMarkedText, "c@:"); - addMethod (@selector (conversationIdentifier), conversationIdentifier, "l@:"); - addMethod (@selector (attributedSubstringFromRange:), attributedSubstringFromRange, "@@:", @encode (NSRange)); - addMethod (@selector (markedRange), markedRange, @encode (NSRange), "@:"); - addMethod (@selector (selectedRange), selectedRange, @encode (NSRange), "@:"); - addMethod (@selector (firstRectForCharacterRange:), firstRectForCharacterRange, @encode (NSRect), "@:", @encode (NSRange)); - addMethod (@selector (characterIndexForPoint:), characterIndexForPoint, "L@:", @encode (NSPoint)); - addMethod (@selector (validAttributesForMarkedText), validAttributesForMarkedText, "@@:"); - addMethod (@selector (flagsChanged:), flagsChanged, "v@:@"); + addMethod (@selector (isOpaque), isOpaque); + addMethod (@selector (drawRect:), drawRect); + addMethod (@selector (mouseDown:), mouseDown); + addMethod (@selector (mouseUp:), mouseUp); + addMethod (@selector (mouseDragged:), mouseDragged); + addMethod (@selector (mouseMoved:), mouseMoved); + addMethod (@selector (mouseEntered:), mouseEntered); + addMethod (@selector (mouseExited:), mouseExited); + addMethod (@selector (rightMouseDown:), mouseDown); + addMethod (@selector (rightMouseDragged:), mouseDragged); + addMethod (@selector (rightMouseUp:), mouseUp); + addMethod (@selector (otherMouseDown:), mouseDown); + addMethod (@selector (otherMouseDragged:), mouseDragged); + addMethod (@selector (otherMouseUp:), mouseUp); + addMethod (@selector (scrollWheel:), scrollWheel); + addMethod (@selector (magnifyWithEvent:), magnify); + addMethod (@selector (acceptsFirstMouse:), acceptsFirstMouse); + addMethod (@selector (windowWillMiniaturize:), windowWillMiniaturize); + addMethod (@selector (windowDidDeminiaturize:), windowDidDeminiaturize); + addMethod (@selector (wantsDefaultClipping), wantsDefaultClipping); + addMethod (@selector (worksWhenModal), worksWhenModal); + addMethod (@selector (viewDidMoveToWindow), viewDidMoveToWindow); + addMethod (@selector (viewWillDraw), viewWillDraw); + addMethod (@selector (keyDown:), keyDown); + addMethod (@selector (keyUp:), keyUp); + addMethod (@selector (insertText:), insertText); + addMethod (@selector (doCommandBySelector:), doCommandBySelector); + addMethod (@selector (setMarkedText:selectedRange:), setMarkedText); + addMethod (@selector (unmarkText), unmarkText); + addMethod (@selector (hasMarkedText), hasMarkedText); + addMethod (@selector (conversationIdentifier), conversationIdentifier); + addMethod (@selector (attributedSubstringFromRange:), attributedSubstringFromRange); + addMethod (@selector (markedRange), markedRange); + addMethod (@selector (selectedRange), selectedRange); + addMethod (@selector (firstRectForCharacterRange:), firstRectForCharacterRange); + addMethod (@selector (characterIndexForPoint:), characterIndexForPoint); + addMethod (@selector (validAttributesForMarkedText), validAttributesForMarkedText); + addMethod (@selector (flagsChanged:), flagsChanged); - addMethod (@selector (becomeFirstResponder), becomeFirstResponder, "c@:"); - addMethod (@selector (resignFirstResponder), resignFirstResponder, "c@:"); - addMethod (@selector (acceptsFirstResponder), acceptsFirstResponder, "c@:"); + addMethod (@selector (becomeFirstResponder), becomeFirstResponder); + addMethod (@selector (resignFirstResponder), resignFirstResponder); + addMethod (@selector (acceptsFirstResponder), acceptsFirstResponder); - addMethod (@selector (draggingEntered:), draggingEntered, @encode (NSDragOperation), "@:@"); - addMethod (@selector (draggingUpdated:), draggingUpdated, @encode (NSDragOperation), "@:@"); - addMethod (@selector (draggingEnded:), draggingEnded, "v@:@"); - addMethod (@selector (draggingExited:), draggingExited, "v@:@"); - addMethod (@selector (prepareForDragOperation:), prepareForDragOperation, "c@:@"); - addMethod (@selector (performDragOperation:), performDragOperation, "c@:@"); - addMethod (@selector (concludeDragOperation:), concludeDragOperation, "v@:@"); + addMethod (@selector (draggingEntered:), draggingEntered); + addMethod (@selector (draggingUpdated:), draggingUpdated); + addMethod (@selector (draggingEnded:), draggingEnded); + addMethod (@selector (draggingExited:), draggingExited); + addMethod (@selector (prepareForDragOperation:), prepareForDragOperation); + addMethod (@selector (performDragOperation:), performDragOperation); + addMethod (@selector (concludeDragOperation:), concludeDragOperation); - addMethod (@selector (paste:), paste, "v@:@"); - addMethod (@selector (copy:), copy, "v@:@"); - addMethod (@selector (cut:), cut, "v@:@"); - addMethod (@selector (selectAll:), selectAll, "v@:@"); + addMethod (@selector (paste:), paste); + addMethod (@selector (copy:), copy); + addMethod (@selector (cut:), cut); + addMethod (@selector (selectAll:), selectAll); - addMethod (@selector (viewWillMoveToWindow:), willMoveToWindow, "v@:@"); + addMethod (@selector (viewWillMoveToWindow:), willMoveToWindow); - addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement, "c@:"); - addMethod (@selector (accessibilityChildren), getAccessibilityChildren, "@@:"); - addMethod (@selector (accessibilityHitTest:), accessibilityHitTest, "@@:", @encode (NSPoint)); - addMethod (@selector (accessibilityFocusedUIElement), getAccessibilityFocusedUIElement, "@@:"); + addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement); + addMethod (@selector (accessibilityChildren), getAccessibilityChildren); + addMethod (@selector (accessibilityHitTest:), accessibilityHitTest); + addMethod (@selector (accessibilityFocusedUIElement), getAccessibilityFocusedUIElement); // deprecated methods required for backwards compatibility - addMethod (@selector (accessibilityIsIgnored), getAccessibilityIsIgnored, "c@:"); - addMethod (@selector (accessibilityAttributeValue:), getAccessibilityAttributeValue, "@@:@"); + addMethod (@selector (accessibilityIsIgnored), getAccessibilityIsIgnored); + addMethod (@selector (accessibilityAttributeValue:), getAccessibilityAttributeValue); - addMethod (@selector (isFlipped), isFlipped, "c@:"); + addMethod (@selector (isFlipped), isFlipped); - addMethod (NSViewComponentPeer::dismissModalsSelector, dismissModals, "v@:"); - addMethod (NSViewComponentPeer::asyncMouseDownSelector, asyncMouseDown, "v@:@"); - addMethod (NSViewComponentPeer::asyncMouseUpSelector, asyncMouseUp, "v@:@"); - addMethod (NSViewComponentPeer::frameChangedSelector, frameChanged, "v@:@"); - addMethod (NSViewComponentPeer::becomeKeySelector, becomeKey, "v@:@"); - addMethod (NSViewComponentPeer::resignKeySelector, resignKey, "v@:@"); + addMethod (NSViewComponentPeer::dismissModalsSelector, dismissModals); + addMethod (NSViewComponentPeer::asyncMouseDownSelector, asyncMouseDown); + addMethod (NSViewComponentPeer::asyncMouseUpSelector, asyncMouseUp); + addMethod (NSViewComponentPeer::frameChangedSelector, frameChanged); + addMethod (NSViewComponentPeer::becomeKeySelector, becomeKey); + addMethod (NSViewComponentPeer::resignKeySelector, resignKey); - addMethod (@selector (performKeyEquivalent:), performKeyEquivalent, "c@:@"); + addMethod (@selector (performKeyEquivalent:), performKeyEquivalent); addProtocol (@protocol (NSTextInput)); @@ -2214,30 +2214,30 @@ struct JuceNSWindowClass : public NSViewComponentPeerWrapper> addIvar ("text"); addIvar ("operation"); - addMethod (@selector (dealloc), dealloc, "v@:"); - addMethod (@selector (pasteboard:item:provideDataForType:), provideDataForType, "v@:@@@"); + addMethod (@selector (dealloc), dealloc); + addMethod (@selector (pasteboard:item:provideDataForType:), provideDataForType); - addMethod (@selector (draggingSession:sourceOperationMaskForDraggingContext:), sourceOperationMaskForDraggingContext, "c@:@@"); - addMethod (@selector (draggingSession:endedAtPoint:operation:), draggingSessionEnded, "v@:@@@"); + addMethod (@selector (draggingSession:sourceOperationMaskForDraggingContext:), sourceOperationMaskForDraggingContext); + addMethod (@selector (draggingSession:endedAtPoint:operation:), draggingSessionEnded); addProtocol (@protocol (NSPasteboardItemDataProvider)); @@ -474,7 +474,7 @@ private: addIvar ("owner"); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (darkModeChanged:), darkModeChanged, "v@:@"); + addMethod (@selector (darkModeChanged:), darkModeChanged); JUCE_END_IGNORE_WARNINGS_GCC_LIKE registerClass(); diff --git a/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp b/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp index b06278ad22..9c17ed37d0 100644 --- a/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp +++ b/modules/juce_gui_extra/native/juce_ios_PushNotifications.cpp @@ -486,19 +486,19 @@ private: { addIvar ("self"); - addMethod (@selector (application:didRegisterUserNotificationSettings:), didRegisterUserNotificationSettings, "v@:@@"); - addMethod (@selector (application:didRegisterForRemoteNotificationsWithDeviceToken:), registeredForRemoteNotifications, "v@:@@"); - addMethod (@selector (application:didFailToRegisterForRemoteNotificationsWithError:), failedToRegisterForRemoteNotifications, "v@:@@"); - addMethod (@selector (application:didReceiveRemoteNotification:), didReceiveRemoteNotification, "v@:@@"); - addMethod (@selector (application:didReceiveRemoteNotification:fetchCompletionHandler:), didReceiveRemoteNotificationFetchCompletionHandler, "v@:@@@"); - addMethod (@selector (application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:), handleActionForRemoteNotificationCompletionHandler, "v@:@@@@@"); - addMethod (@selector (application:didReceiveLocalNotification:), didReceiveLocalNotification, "v@:@@"); - addMethod (@selector (application:handleActionWithIdentifier:forLocalNotification:completionHandler:), handleActionForLocalNotificationCompletionHandler, "v@:@@@@"); - addMethod (@selector (application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler:), handleActionForLocalNotificationWithResponseCompletionHandler, "v@:@@@@@"); + addMethod (@selector (application:didRegisterUserNotificationSettings:), didRegisterUserNotificationSettings); + addMethod (@selector (application:didRegisterForRemoteNotificationsWithDeviceToken:), registeredForRemoteNotifications); + addMethod (@selector (application:didFailToRegisterForRemoteNotificationsWithError:), failedToRegisterForRemoteNotifications); + addMethod (@selector (application:didReceiveRemoteNotification:), didReceiveRemoteNotification); + addMethod (@selector (application:didReceiveRemoteNotification:fetchCompletionHandler:), didReceiveRemoteNotificationFetchCompletionHandler); + addMethod (@selector (application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:), handleActionForRemoteNotificationCompletionHandler); + addMethod (@selector (application:didReceiveLocalNotification:), didReceiveLocalNotification); + addMethod (@selector (application:handleActionWithIdentifier:forLocalNotification:completionHandler:), handleActionForLocalNotificationCompletionHandler); + addMethod (@selector (application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler:), handleActionForLocalNotificationWithResponseCompletionHandler); #if defined (__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 - addMethod (@selector (userNotificationCenter:willPresentNotification:withCompletionHandler:), willPresentNotificationWithCompletionHandler, "v@:@@@"); - addMethod (@selector (userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:), didReceiveNotificationResponseWithCompletionHandler, "v@:@@@"); + addMethod (@selector (userNotificationCenter:willPresentNotification:withCompletionHandler:), willPresentNotificationWithCompletionHandler); + addMethod (@selector (userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:), didReceiveNotificationResponseWithCompletionHandler); #endif registerClass(); diff --git a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm index fa3f124b24..270f3528e3 100644 --- a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm @@ -44,7 +44,7 @@ struct NSViewFrameChangeCallbackClass : public ObjCClass { addIvar ("target"); - addMethod (nsViewFrameChangedSelector, frameChanged, "v@:@"); + addMethod (nsViewFrameChangedSelector, frameChanged); registerClass(); } diff --git a/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp b/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp index 301313b081..86b1ad65ea 100644 --- a/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp +++ b/modules/juce_gui_extra/native/juce_mac_PushNotifications.cpp @@ -307,12 +307,12 @@ private: { addIvar ("self"); - addMethod (@selector (application:didRegisterForRemoteNotificationsWithDeviceToken:), registeredForRemoteNotifications, "v@:@@"); - addMethod (@selector (application:didFailToRegisterForRemoteNotificationsWithError:), failedToRegisterForRemoteNotifications, "v@:@@"); - addMethod (@selector (application:didReceiveRemoteNotification:), didReceiveRemoteNotification, "v@:@@"); - addMethod (@selector (userNotificationCenter:didDeliverNotification:), didDeliverNotification, "v@:@@"); - addMethod (@selector (userNotificationCenter:didActivateNotification:), didActivateNotification, "v@:@@"); - addMethod (@selector (userNotificationCenter:shouldPresentNotification:), shouldPresentNotification, "c@:@@"); + addMethod (@selector (application:didRegisterForRemoteNotificationsWithDeviceToken:), registeredForRemoteNotifications); + addMethod (@selector (application:didFailToRegisterForRemoteNotificationsWithError:), failedToRegisterForRemoteNotifications); + addMethod (@selector (application:didReceiveRemoteNotification:), didReceiveRemoteNotification); + addMethod (@selector (userNotificationCenter:didDeliverNotification:), didDeliverNotification); + addMethod (@selector (userNotificationCenter:didActivateNotification:), didActivateNotification); + addMethod (@selector (userNotificationCenter:shouldPresentNotification:), shouldPresentNotification); registerClass(); } diff --git a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp index cd8cbf0a01..93a5fa5705 100644 --- a/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_mac_SystemTrayIcon.cpp @@ -184,7 +184,7 @@ struct ButtonBasedStatusItem : public StatusItemContainer { addIvar ("owner"); - addMethod (@selector (handleEvent:), handleEvent, "v@:@"); + addMethod (@selector (handleEvent:), handleEvent); registerClass(); } @@ -311,12 +311,12 @@ struct ViewBasedStatusItem : public StatusItemContainer addIvar ("owner"); addIvar ("image"); - addMethod (@selector (mouseDown:), handleEventDown, "v@:@"); - addMethod (@selector (rightMouseDown:), handleEventDown, "v@:@"); - addMethod (@selector (drawRect:), drawRect, "v@:@"); + addMethod (@selector (mouseDown:), handleEventDown); + addMethod (@selector (rightMouseDown:), handleEventDown); + addMethod (@selector (drawRect:), drawRect); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (frameChanged:), frameChanged, "v@:@"); + addMethod (@selector (frameChanged:), frameChanged); 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 bef333f3a5..b12c8f547a 100644 --- a/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_WebBrowserComponent.mm @@ -117,7 +117,7 @@ struct WebViewKeyEquivalentResponder : public ObjCClass WebViewKeyEquivalentResponder() : ObjCClass ("WebViewKeyEquivalentResponder_") { - ObjCClass::addMethod (@selector (performKeyEquivalent:), performKeyEquivalent, @encode (BOOL), "@:@"); + ObjCClass::addMethod (@selector (performKeyEquivalent:), performKeyEquivalent); ObjCClass::registerClass(); } @@ -164,15 +164,13 @@ struct DownloadClickDetectorClass : public ObjCClass { addIvar ("owner"); - addMethod (@selector (webView:decidePolicyForNavigationAction:request:frame:decisionListener:), - decidePolicyForNavigationAction, "v@:@@@@@"); - addMethod (@selector (webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:), - decidePolicyForNewWindowAction, "v@:@@@@@"); - addMethod (@selector (webView:didFinishLoadForFrame:), didFinishLoadForFrame, "v@:@@"); - addMethod (@selector (webView:didFailLoadWithError:forFrame:), didFailLoadWithError, "v@:@@@"); - addMethod (@selector (webView:didFailProvisionalLoadWithError:forFrame:), didFailLoadWithError, "v@:@@@"); - addMethod (@selector (webView:willCloseFrame:), willCloseFrame, "v@:@@"); - addMethod (@selector (webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:), runOpenPanel, "v@:@@", @encode (BOOL)); + addMethod (@selector (webView:decidePolicyForNavigationAction:request:frame:decisionListener:), decidePolicyForNavigationAction); + addMethod (@selector (webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:), decidePolicyForNewWindowAction); + addMethod (@selector (webView:didFinishLoadForFrame:), didFinishLoadForFrame); + addMethod (@selector (webView:didFailLoadWithError:forFrame:), didFailLoadWithError); + addMethod (@selector (webView:didFailProvisionalLoadWithError:forFrame:), didFailLoadWithError); + addMethod (@selector (webView:willCloseFrame:), willCloseFrame); + addMethod (@selector (webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:), runOpenPanel); registerClass(); } @@ -271,17 +269,17 @@ struct WebViewDelegateClass : public ObjCClass { addIvar ("owner"); - addMethod (@selector (webView:decidePolicyForNavigationAction:decisionHandler:), decidePolicyForNavigationAction, "v@:@@@"); - addMethod (@selector (webView:didFinishNavigation:), didFinishNavigation, "v@:@@"); - addMethod (@selector (webView:didFailNavigation:withError:), didFailNavigation, "v@:@@@"); - addMethod (@selector (webView:didFailProvisionalNavigation:withError:), didFailProvisionalNavigation, "v@:@@@"); - addMethod (@selector (webViewDidClose:), webViewDidClose, "v@:@"); + addMethod (@selector (webView:decidePolicyForNavigationAction:decisionHandler:), decidePolicyForNavigationAction); + addMethod (@selector (webView:didFinishNavigation:), didFinishNavigation); + addMethod (@selector (webView:didFailNavigation:withError:), didFailNavigation); + addMethod (@selector (webView:didFailProvisionalNavigation:withError:), didFailProvisionalNavigation); + addMethod (@selector (webViewDidClose:), webViewDidClose); addMethod (@selector (webView:createWebViewWithConfiguration:forNavigationAction: - windowFeatures:), createWebView, "@@:@@@@"); + windowFeatures:), createWebView); #if WKWEBVIEW_OPENPANEL_SUPPORTED if (@available (macOS 10.12, *)) - addMethod (@selector (webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:), runOpenPanel, "v@:@@@@"); + addMethod (@selector (webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:), runOpenPanel); #endif registerClass(); diff --git a/modules/juce_opengl/native/juce_OpenGL_osx.h b/modules/juce_opengl/native/juce_OpenGL_osx.h index 5dce10b35b..c6bbb694a5 100644 --- a/modules/juce_opengl/native/juce_OpenGL_osx.h +++ b/modules/juce_opengl/native/juce_OpenGL_osx.h @@ -256,9 +256,9 @@ public: { MouseForwardingNSOpenGLViewClass() : ObjCClass ("JUCEGLView_") { - addMethod (@selector (rightMouseDown:), rightMouseDown, "v@:@"); - addMethod (@selector (rightMouseUp:), rightMouseUp, "v@:@"); - addMethod (@selector (acceptsFirstMouse:), acceptsFirstMouse, "v@:@"); + addMethod (@selector (rightMouseDown:), rightMouseDown); + addMethod (@selector (rightMouseUp:), rightMouseUp); + addMethod (@selector (acceptsFirstMouse:), acceptsFirstMouse); registerClass(); } diff --git a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp index ca6fffb5d4..0a72e59777 100644 --- a/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp +++ b/modules/juce_product_unlocking/native/juce_ios_InAppPurchases.cpp @@ -54,13 +54,13 @@ private: { addIvar ("self"); - addMethod (@selector (productsRequest:didReceiveResponse:), didReceiveResponse, "v@:@@"); - addMethod (@selector (requestDidFinish:), requestDidFinish, "v@:@"); - addMethod (@selector (request:didFailWithError:), requestDidFailWithError, "v@:@@"); - addMethod (@selector (paymentQueue:updatedTransactions:), updatedTransactions, "v@:@@"); - addMethod (@selector (paymentQueue:restoreCompletedTransactionsFailedWithError:), restoreCompletedTransactionsFailedWithError, "v@:@@"); - addMethod (@selector (paymentQueueRestoreCompletedTransactionsFinished:), restoreCompletedTransactionsFinished, "v@:@"); - addMethod (@selector (paymentQueue:updatedDownloads:), updatedDownloads, "v@:@@"); + addMethod (@selector (productsRequest:didReceiveResponse:), didReceiveResponse); + addMethod (@selector (requestDidFinish:), requestDidFinish); + addMethod (@selector (request:didFailWithError:), requestDidFailWithError); + addMethod (@selector (paymentQueue:updatedTransactions:), updatedTransactions); + addMethod (@selector (paymentQueue:restoreCompletedTransactionsFailedWithError:), restoreCompletedTransactionsFailedWithError); + addMethod (@selector (paymentQueueRestoreCompletedTransactionsFinished:), restoreCompletedTransactionsFinished); + addMethod (@selector (paymentQueue:updatedDownloads:), updatedDownloads); registerClass(); } diff --git a/modules/juce_video/native/juce_ios_CameraDevice.h b/modules/juce_video/native/juce_ios_CameraDevice.h index 978e0b9328..fbe288114b 100644 --- a/modules/juce_video/native/juce_ios_CameraDevice.h +++ b/modules/juce_video/native/juce_ios_CameraDevice.h @@ -519,11 +519,11 @@ private: SessionDelegateClass() : ObjCClass ("SessionDelegateClass_") { JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (sessionDidStartRunning:), started, "v@:@"); - addMethod (@selector (sessionDidStopRunning:), stopped, "v@:@"); - addMethod (@selector (runtimeError:), runtimeError, "v@:@"); - addMethod (@selector (sessionWasInterrupted:), interrupted, "v@:@"); - addMethod (@selector (sessionInterruptionEnded:), interruptionEnded, "v@:@"); + addMethod (@selector (sessionDidStartRunning:), started); + addMethod (@selector (sessionDidStopRunning:), stopped); + addMethod (@selector (runtimeError:), runtimeError); + addMethod (@selector (sessionWasInterrupted:), interrupted); + addMethod (@selector (sessionInterruptionEnded:), interruptionEnded); JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); @@ -771,24 +771,20 @@ private: public: PhotoOutputDelegateClass() : ObjCClass ("PhotoOutputDelegateClass_") { - addMethod (@selector (captureOutput:willBeginCaptureForResolvedSettings:), willBeginCaptureForSettings, "v@:@@"); - addMethod (@selector (captureOutput:willCapturePhotoForResolvedSettings:), willCaptureForSettings, "v@:@@"); - addMethod (@selector (captureOutput:didCapturePhotoForResolvedSettings:), didCaptureForSettings, "v@:@@"); - addMethod (@selector (captureOutput:didFinishCaptureForResolvedSettings:error:), didFinishCaptureForSettings, "v@:@@@"); + addMethod (@selector (captureOutput:willBeginCaptureForResolvedSettings:), willBeginCaptureForSettings); + addMethod (@selector (captureOutput:willCapturePhotoForResolvedSettings:), willCaptureForSettings); + addMethod (@selector (captureOutput:didCapturePhotoForResolvedSettings:), didCaptureForSettings); + addMethod (@selector (captureOutput:didFinishCaptureForResolvedSettings:error:), didFinishCaptureForSettings); #if defined (__IPHONE_11_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0 if (@available (iOS 11.0, *)) { - addMethod (@selector (captureOutput:didFinishProcessingPhoto:error:), - didFinishProcessingPhoto, - "v@:@@@"); + addMethod (@selector (captureOutput:didFinishProcessingPhoto:error:), didFinishProcessingPhoto); } else #endif { - addMethod (@selector (captureOutput:didFinishProcessingPhotoSampleBuffer:previewPhotoSampleBuffer:resolvedSettings:bracketSettings:error:), - didFinishProcessingPhotoSampleBuffer, - "v@:@@@@@@"); + addMethod (@selector (captureOutput:didFinishProcessingPhotoSampleBuffer:previewPhotoSampleBuffer:resolvedSettings:bracketSettings:error:), didFinishProcessingPhotoSampleBuffer); } addIvar ("owner"); @@ -1075,8 +1071,8 @@ private: { FileOutputRecordingDelegateClass() : ObjCClass> ("FileOutputRecordingDelegateClass_") { - addMethod (@selector (captureOutput:didStartRecordingToOutputFileAtURL:fromConnections:), started, "v@:@@@"); - addMethod (@selector (captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error:), stopped, "v@:@@@@"); + addMethod (@selector (captureOutput:didStartRecordingToOutputFileAtURL:fromConnections:), started); + addMethod (@selector (captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error:), stopped); addIvar ("owner"); @@ -1261,7 +1257,7 @@ struct CameraDevice::ViewerComponent : public UIViewComponent { JuceCameraDeviceViewerClass() : ObjCClass ("JuceCameraDeviceViewerClass_") { - addMethod (@selector (layoutSubviews), layoutSubviews, "v@:"); + addMethod (@selector (layoutSubviews), layoutSubviews); registerClass(); } diff --git a/modules/juce_video/native/juce_mac_CameraDevice.h b/modules/juce_video/native/juce_mac_CameraDevice.h index 23b4892ef0..8fc23607ab 100644 --- a/modules/juce_video/native/juce_mac_CameraDevice.h +++ b/modules/juce_video/native/juce_mac_CameraDevice.h @@ -201,13 +201,13 @@ private: addIvar ("owner"); addProtocol (@protocol (AVCaptureFileOutputRecordingDelegate)); - addMethod (@selector (captureOutput:didStartRecordingToOutputFileAtURL: fromConnections:), didStartRecordingToOutputFileAtURL, "v@:@@@"); - addMethod (@selector (captureOutput:didPauseRecordingToOutputFileAtURL: fromConnections:), didPauseRecordingToOutputFileAtURL, "v@:@@@"); - addMethod (@selector (captureOutput:didResumeRecordingToOutputFileAtURL: fromConnections:), didResumeRecordingToOutputFileAtURL, "v@:@@@"); - addMethod (@selector (captureOutput:willFinishRecordingToOutputFileAtURL:fromConnections:error:), willFinishRecordingToOutputFileAtURL, "v@:@@@@"); + addMethod (@selector (captureOutput:didStartRecordingToOutputFileAtURL: fromConnections:), didStartRecordingToOutputFileAtURL); + addMethod (@selector (captureOutput:didPauseRecordingToOutputFileAtURL: fromConnections:), didPauseRecordingToOutputFileAtURL); + addMethod (@selector (captureOutput:didResumeRecordingToOutputFileAtURL: fromConnections:), didResumeRecordingToOutputFileAtURL); + addMethod (@selector (captureOutput:willFinishRecordingToOutputFileAtURL:fromConnections:error:), willFinishRecordingToOutputFileAtURL); JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (captureSessionRuntimeError:), sessionRuntimeError, "v@:@"); + addMethod (@selector (captureSessionRuntimeError:), sessionRuntimeError); JUCE_END_IGNORE_WARNINGS_GCC_LIKE registerClass(); @@ -298,7 +298,7 @@ private: public: PhotoOutputDelegateClass() : ObjCClass ("PhotoOutputDelegateClass_") { - addMethod (@selector (captureOutput:didFinishProcessingPhoto:error:), didFinishProcessingPhoto, "v@:@@@"); + addMethod (@selector (captureOutput:didFinishProcessingPhoto:error:), didFinishProcessingPhoto); addIvar ("owner"); registerClass(); } diff --git a/modules/juce_video/native/juce_mac_Video.h b/modules/juce_video/native/juce_mac_Video.h index 7d0f0ca402..5b8d0a1a99 100644 --- a/modules/juce_video/native/juce_mac_Video.h +++ b/modules/juce_video/native/juce_mac_Video.h @@ -206,7 +206,7 @@ private: JucePlayerStatusObserverClass() : ObjCClass ("JucePlayerStatusObserverClass_") { JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (observeValueForKeyPath:ofObject:change:context:), valueChanged, "v@:@@@?"); + addMethod (@selector (observeValueForKeyPath:ofObject:change:context:), valueChanged); JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); @@ -250,7 +250,7 @@ private: JucePlayerItemPlaybackStatusObserverClass() : ObjCClass ("JucePlayerItemPlaybackStatusObserverClass_") { JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (processNotification:), notificationReceived, "v@:@"); + addMethod (@selector (processNotification:), notificationReceived); JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); @@ -305,7 +305,7 @@ private: JucePlayerItemPreparationStatusObserverClass() : ObjCClass ("JucePlayerItemStatusObserverClass_") { JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wundeclared-selector") - addMethod (@selector (observeValueForKeyPath:ofObject:change:context:), valueChanged, "v@:@@@?"); + addMethod (@selector (observeValueForKeyPath:ofObject:change:context:), valueChanged); JUCE_END_IGNORE_WARNINGS_GCC_LIKE addIvar ("owner"); @@ -733,7 +733,7 @@ private: { JuceVideoViewerClass() : ObjCClass ("JuceVideoViewerClass_") { - addMethod (@selector (layoutSubviews), layoutSubviews, "v@:"); + addMethod (@selector (layoutSubviews), layoutSubviews); registerClass(); }