Mercurial > projects > dstep
annotate dstep/foundation/NSAppleEventManager.d @ 25:b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 06 Apr 2010 11:37:27 +0200 |
parents | 19885b43130e |
children |
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 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
9 //import dstep.applicationservices.ApplicationServices; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
10 import dstep.coreservices.ae.AEDataModel; |
14 | 11 import dstep.foundation.NSAppleEventDescriptor; |
12 import dstep.foundation.NSObject; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
13 import dstep.foundation.NSString; |
14 | 14 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
15 import dstep.objc.objc; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
16 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
17 |
14 | 18 |
19 import bindings = dstep.foundation.NSAppleEventManager_bindings; | |
20 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
21 struct __NSAppleEventManagerSuspension; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
22 |
14 | 23 alias __NSAppleEventManagerSuspension* NSAppleEventManagerSuspensionID; |
24 | |
25 extern (C) | |
26 { | |
27 extern | |
28 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
29 double NSAppleEventTimeOutDefault; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
30 double NSAppleEventTimeOutNone; |
14 | 31 } |
32 } | |
33 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
34 private NSString NSAppleEventManagerWillProcessFirstEventNotification_; |
14 | 35 |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
36 NSString NSAppleEventManagerWillProcessFirstEventNotification () |
14 | 37 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
38 if (NSAppleEventManagerWillProcessFirstEventNotification_) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
39 return NSAppleEventManagerWillProcessFirstEventNotification_; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
40 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
41 return NSAppleEventManagerWillProcessFirstEventNotification_ = new NSString(bindings.NSAppleEventManagerWillProcessFirstEventNotification); |
14 | 42 } |
43 | |
44 class NSAppleEventManager : NSObject | |
45 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
46 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
47 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
48 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
49 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
50 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
51 } |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
52 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
53 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
54 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
55 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
56 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
57 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
58 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
59 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
60 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
61 } |
14 | 62 |
63 static NSAppleEventManager sharedAppleEventManager () | |
64 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
65 return invokeObjcSuperClass!(NSAppleEventManager, "sharedAppleEventManager"); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
66 } |
14 | 67 |
68 void setEventHandler (Object handler, SEL handleEventSelector, uint eventClass, uint eventID) | |
69 { | |
70 return invokeObjcSelf!(void, "setEventHandler:andSelector:forEventClass:andEventID:", Object, SEL, uint, uint)(handler, handleEventSelector, eventClass, eventID); | |
71 } | |
72 | |
73 void removeEventHandlerForEventClass (uint eventClass, uint eventID) | |
74 { | |
75 return invokeObjcSelf!(void, "removeEventHandlerForEventClass:andEventID:", uint, uint)(eventClass, eventID); | |
76 } | |
77 | |
78 short dispatchRawAppleEvent (AppleEvent* theAppleEvent, AppleEvent* theReply, int handlerRefCon) | |
79 { | |
80 return invokeObjcSelf!(short, "dispatchRawAppleEvent:withRawReply:handlerRefCon:", AppleEvent*, AppleEvent*, int)(theAppleEvent, theReply, handlerRefCon); | |
81 } | |
82 | |
83 NSAppleEventDescriptor currentAppleEvent () | |
84 { | |
85 return invokeObjcSelf!(NSAppleEventDescriptor, "currentAppleEvent"); | |
86 } | |
87 | |
88 NSAppleEventDescriptor currentReplyAppleEvent () | |
89 { | |
90 return invokeObjcSelf!(NSAppleEventDescriptor, "currentReplyAppleEvent"); | |
91 } | |
92 | |
93 NSAppleEventManagerSuspensionID suspendCurrentAppleEvent () | |
94 { | |
95 return invokeObjcSelf!(NSAppleEventManagerSuspensionID, "suspendCurrentAppleEvent"); | |
96 } | |
97 | |
98 NSAppleEventDescriptor appleEventForSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
99 { | |
100 return invokeObjcSelf!(NSAppleEventDescriptor, "appleEventForSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
101 } | |
102 | |
103 NSAppleEventDescriptor replyAppleEventForSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
104 { | |
105 return invokeObjcSelf!(NSAppleEventDescriptor, "replyAppleEventForSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
106 } | |
107 | |
108 void setCurrentAppleEventAndReplyEventWithSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
109 { | |
110 return invokeObjcSelf!(void, "setCurrentAppleEventAndReplyEventWithSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
111 } | |
112 | |
113 void resumeWithSuspensionID (NSAppleEventManagerSuspensionID suspensionID) | |
114 { | |
115 return invokeObjcSelf!(void, "resumeWithSuspensionID:", NSAppleEventManagerSuspensionID)(suspensionID); | |
116 } | |
117 } | |
118 |