|
|
|
@@ -29,6 +29,9 @@ AppFocusChangeCallback appFocusChangeCallback = nullptr; |
|
|
|
typedef bool (*CheckEventBlockedByModalComps) (NSEvent*);
|
|
|
|
CheckEventBlockedByModalComps isEventBlockedByModalComps = nullptr;
|
|
|
|
|
|
|
|
typedef void (*MenuTrackingBeganCallback)();
|
|
|
|
MenuTrackingBeganCallback menuTrackingBeganCallback = nullptr;
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
struct AppDelegate
|
|
|
|
{
|
|
|
|
@@ -38,6 +41,11 @@ public: |
|
|
|
static AppDelegateClass cls;
|
|
|
|
delegate = [cls.createInstance() init];
|
|
|
|
|
|
|
|
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
|
|
|
|
|
|
|
|
[center addObserver: delegate selector: @selector (trackingBegan:)
|
|
|
|
name: NSMenuDidBeginTrackingNotification object: nil];
|
|
|
|
|
|
|
|
if (JUCEApplicationBase::isStandaloneApp())
|
|
|
|
{
|
|
|
|
[NSApp setDelegate: delegate];
|
|
|
|
@@ -49,8 +57,6 @@ public: |
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
|
|
|
|
|
|
|
|
[center addObserver: delegate selector: @selector (applicationDidResignActive:)
|
|
|
|
name: NSApplicationDidResignActiveNotification object: NSApp];
|
|
|
|
|
|
|
|
@@ -104,6 +110,7 @@ private: |
|
|
|
addMethod (@selector (applicationDidResignActive:), applicationDidResignActive, "v@:@");
|
|
|
|
addMethod (@selector (applicationWillUnhide:), applicationWillUnhide, "v@:@");
|
|
|
|
addMethod (@selector (broadcastMessageCallback:), broadcastMessageCallback, "v@:@");
|
|
|
|
addMethod (@selector (trackingBegan:), trackingBegan, "v@:@");
|
|
|
|
addMethod (@selector (dummyMethod), dummyMethod, "v@:");
|
|
|
|
|
|
|
|
registerClass();
|
|
|
|
@@ -169,6 +176,12 @@ private: |
|
|
|
MessageManager::getInstance()->deliverBroadcastMessage (messageString);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void trackingBegan (id /*self*/, SEL, NSNotification*)
|
|
|
|
{
|
|
|
|
if (menuTrackingBeganCallback != nullptr)
|
|
|
|
(*menuTrackingBeganCallback)();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dummyMethod (id /*self*/, SEL) {} // (used as a way of running a dummy thread)
|
|
|
|
|
|
|
|
private:
|
|
|
|
|