Preparing to add widget support
[RExecServer.git] / RApplication.m
blob298699a2dc14715ea210d12dde5f65f710a467b9
1 #import "RApplication.h"
2 #include <CoreFoundation/CoreFoundation.h>
4 @implementation RApplication
5 - (void)sendEvent:(NSEvent*)theEvent {
6         [super sendEvent:theEvent];
7         if(NSApplicationDefined == [theEvent type]) {
8                 switch([theEvent subtype]) {
9                 case 1337:[self stop:self];break;
10                 }
11         }
14 - (void)setServicesMenu:(NSMenu*)aMenu {
15         //Check to see if there is already a connection. If not call [super], otherwise 
16         //do nothing since this isn't going to go well anyway.
17         
18         NSString *str = [[NSString alloc] initWithFormat:@"%@.ServiceProvider",[[NSBundle mainBundle] bundleIdentifier]];
19         CFMessagePortRef port = CFMessagePortCreateRemote(NULL,(CFStringRef)str);
20         [str release];
21         if(NULL == port) 
22                 [super setServicesMenu:aMenu];
23         else {
24                 CFRelease(port);
25         }
26         
29 @end