Mercurial > projects > dstep
annotate dstep/foundation/NSAppleEventManager.d @ 15:7ff919f595d5
Added the Foundation framework, again
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 03 Aug 2009 15:31:48 +0200 |
parents | 89f3c3ef1fd2 |
children | 19885b43130e |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSAppleEventManager; | |
8 | |
9 import dstep.applicationservices.ApplicationServices; | |
10 import dstep.foundation.NSAppleEventDescriptor; | |
11 import dstep.foundation.NSObject; | |
12 import dstep.objc.bridge.Bridge; | |
13 import dstep.objc.objc : id; | |
14 | |
15 import bindings = dstep.foundation.NSAppleEventManager_bindings; | |
16 | |
17 alias __NSAppleEventManagerSuspension* NSAppleEventManagerSuspensionID; | |
18 | |
19 extern (C) | |
20 { | |
21 extern | |
22 { | |
23 const double NSAppleEventTimeOutDefault; | |
24 const double NSAppleEventTimeOutNone; | |
25 } | |
26 } | |
27 | |
28 NSString NSAppleEventManagerWillProcessFirstEventNotification; | |
29 | |
30 static this () | |
31 { | |
32 NSAppleEventManagerWillProcessFirstEventNotification = new NSString(bindings.NSAppleEventManagerWillProcessFirstEventNotification); | |
33 } | |
34 | |
35 class NSAppleEventManager : NSObject | |
36 { | |
37 mixin ObjcWrap; | |
38 | |
39 static NSAppleEventManager sharedAppleEventManager () | |
40 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
41 return invokeObjcSelfClass!(NSAppleEventManager, "sharedAppleEventManager"); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
42 } |
14 | 43 |
44 void setEventHandler (Object handler, SEL handleEventSelector, uint eventClass, uint eventID) | |
45 { | |
46 return invokeObjcSelf!(void, "setEventHandler:andSelector:forEventClass:andEventID:", Object, SEL, uint, uint)(handler, handleEventSelector, eventClass, eventID); | |
47 } | |
48 | |
49 void removeEventHandlerForEventClass (uint eventClass, uint eventID) | |
50 { | |
51 return invokeObjcSelf!(void, "removeEventHandlerForEventClass:andEventID:", uint, uint)(eventClass, eventID); | |
52 } | |
53 | |
54 short dispatchRawAppleEvent (AppleEvent* theAppleEvent, AppleEvent* theReply, int handlerRefCon) | |
55 { | |
56 return invokeObjcSelf!(short, "dispatchRawAppleEvent:withRawReply:handlerRefCon:", AppleEvent*, AppleEvent*, int)(theAppleEvent, theReply, handlerRefCon); | |
57 } | |
58 | |
59 NSAppleEventDescriptor currentAppleEvent () | |
60 { | |
61 return invokeObjcSelf!(NSAppleEventDescriptor, "currentAppleEvent"); | |
62 } | |
63 | |
64 NSAppleEventDescriptor currentReplyAppleEvent () | |
65 { | |
66 return invokeObjcSelf!(NSAppleEventDescriptor, "currentReplyAppleEvent"); | |
67 } | |
68 | |
69 NSAppleEventManagerSuspensionID suspendCurrentAppleEvent () | |
70 { | |
71 return invokeObjcSelf!(NSAppleEventManagerSuspensionID, "suspendCurrentAppleEvent"); | |
72 } | |
73 | |
74 NSAppleEventDescriptor appleEventForSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
75 { | |
76 return invokeObjcSelf!(NSAppleEventDescriptor, "appleEventForSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
77 } | |
78 | |
79 NSAppleEventDescriptor replyAppleEventForSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
80 { | |
81 return invokeObjcSelf!(NSAppleEventDescriptor, "replyAppleEventForSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
82 } | |
83 | |
84 void setCurrentAppleEventAndReplyEventWithSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
85 { | |
86 return invokeObjcSelf!(void, "setCurrentAppleEventAndReplyEventWithSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
87 } | |
88 | |
89 void resumeWithSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
90 { | |
91 return invokeObjcSelf!(void, "resumeWithSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
92 } | |
93 } | |
94 |