Mercurial > projects > dstep
comparison dstep/foundation/NSAppleEventManager.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 7ff919f595d5 |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
4 * Version: Initial created: Aug 3, 2009 | 4 * Version: Initial created: Aug 3, 2009 |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | 5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) |
6 */ | 6 */ |
7 module dstep.foundation.NSAppleEventManager; | 7 module dstep.foundation.NSAppleEventManager; |
8 | 8 |
9 import dstep.applicationservices.ApplicationServices; | 9 //import dstep.applicationservices.ApplicationServices; |
10 import dstep.coreservices.ae.AEDataModel; | |
10 import dstep.foundation.NSAppleEventDescriptor; | 11 import dstep.foundation.NSAppleEventDescriptor; |
11 import dstep.foundation.NSObject; | 12 import dstep.foundation.NSObject; |
13 import dstep.foundation.NSString; | |
12 import dstep.objc.bridge.Bridge; | 14 import dstep.objc.bridge.Bridge; |
13 import dstep.objc.objc : id; | 15 import dstep.objc.objc; |
16 | |
17 | |
14 | 18 |
15 import bindings = dstep.foundation.NSAppleEventManager_bindings; | 19 import bindings = dstep.foundation.NSAppleEventManager_bindings; |
20 | |
21 struct __NSAppleEventManagerSuspension; | |
16 | 22 |
17 alias __NSAppleEventManagerSuspension* NSAppleEventManagerSuspensionID; | 23 alias __NSAppleEventManagerSuspension* NSAppleEventManagerSuspensionID; |
18 | 24 |
19 extern (C) | 25 extern (C) |
20 { | 26 { |
21 extern | 27 extern |
22 { | 28 { |
23 const double NSAppleEventTimeOutDefault; | 29 double NSAppleEventTimeOutDefault; |
24 const double NSAppleEventTimeOutNone; | 30 double NSAppleEventTimeOutNone; |
25 } | 31 } |
26 } | 32 } |
27 | 33 |
28 NSString NSAppleEventManagerWillProcessFirstEventNotification; | 34 private NSString NSAppleEventManagerWillProcessFirstEventNotification_; |
29 | 35 |
30 static this () | 36 NSString NSAppleEventManagerWillProcessFirstEventNotification () |
31 { | 37 { |
32 NSAppleEventManagerWillProcessFirstEventNotification = new NSString(bindings.NSAppleEventManagerWillProcessFirstEventNotification); | 38 if (NSAppleEventManagerWillProcessFirstEventNotification_) |
39 return NSAppleEventManagerWillProcessFirstEventNotification_; | |
40 | |
41 return NSAppleEventManagerWillProcessFirstEventNotification_ = new NSString(bindings.NSAppleEventManagerWillProcessFirstEventNotification); | |
33 } | 42 } |
34 | 43 |
35 class NSAppleEventManager : NSObject | 44 class NSAppleEventManager : NSObject |
36 { | 45 { |
37 mixin ObjcWrap; | 46 mixin (ObjcWrap); |
47 | |
48 this () | |
49 { | |
50 super(typeof(this).alloc.init.objcObject); | |
51 } | |
52 | |
53 typeof(this) init () | |
54 { | |
55 return invokeObjcSelf!(typeof(this), "init"); | |
56 } | |
38 | 57 |
39 static NSAppleEventManager sharedAppleEventManager () | 58 static NSAppleEventManager sharedAppleEventManager () |
40 { | 59 { |
41 return invokeObjcSelfClass!(NSAppleEventManager, "sharedAppleEventManager"); | 60 return invokeObjcSuperClass!(NSAppleEventManager, "sharedAppleEventManager"); |
42 } | 61 } |
43 | 62 |
44 void setEventHandler (Object handler, SEL handleEventSelector, uint eventClass, uint eventID) | 63 void setEventHandler (Object handler, SEL handleEventSelector, uint eventClass, uint eventID) |
45 { | 64 { |
46 return invokeObjcSelf!(void, "setEventHandler:andSelector:forEventClass:andEventID:", Object, SEL, uint, uint)(handler, handleEventSelector, eventClass, eventID); | 65 return invokeObjcSelf!(void, "setEventHandler:andSelector:forEventClass:andEventID:", Object, SEL, uint, uint)(handler, handleEventSelector, eventClass, eventID); |