add check for role to data()
[amarok.git] / src / app_mac.cpp
blob1aeade9b9dea1bef7de50e737e15ca1dc0846098
1 #include <Carbon/Carbon.h>
2 #include <QStringList>
3 #include "dynamicmode.h"
4 #include "playlistwindow.h"
6 static AEEventHandlerUPP appleEventProcessorUPP = 0;
8 OSStatus
9 appleEventProcessor(const AppleEvent *ae, AppleEvent *, long /*handlerRefCon*/)
11 OSType aeID = typeWildCard;
12 OSType aeClass = typeWildCard;
13 AEGetAttributePtr(ae, keyEventClassAttr, typeType, 0, &aeClass, sizeof(aeClass), 0);
14 AEGetAttributePtr(ae, keyEventIDAttr, typeType, 0, &aeID, sizeof(aeID), 0);
16 if(aeClass == kCoreEventClass)
18 if(aeID == kAEReopenApplication)
20 if( PlaylistWindow::self() )
21 PlaylistWindow::self()->show();
23 return noErr;
25 return eventNotHandledErr;
28 void
29 setupEventHandler_mac(long handlerRef)
31 appleEventProcessorUPP = AEEventHandlerUPP(appleEventProcessor);
32 AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, appleEventProcessorUPP, handlerRef, true);