Mercurial > projects > dstep
annotate dstep/foundation/NSScriptCommand.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 |
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.NSScriptCommand; | |
8 | |
9 import dstep.foundation.NSAppleEventDescriptor; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
10 import dstep.foundation.NSCoder; |
14 | 11 import dstep.foundation.NSDictionary; |
12 import dstep.foundation.NSObject; | |
13 import dstep.foundation.NSScriptCommandDescription; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
14 import dstep.foundation.NSScriptObjectSpecifiers; |
14 | 15 import dstep.foundation.NSString; |
16 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
17 import dstep.objc.objc; |
14 | 18 |
19 enum | |
20 { | |
21 NSNoScriptError = 0, | |
22 NSReceiverEvaluationScriptError, | |
23 NSKeySpecifierEvaluationScriptError, | |
24 NSArgumentEvaluationScriptError, | |
25 NSReceiversCantHandleCommandScriptError, | |
26 NSRequiredArgumentsMissingScriptError, | |
27 NSArgumentsWrongScriptError, | |
28 NSUnknownKeyScriptError, | |
29 NSInternalScriptError, | |
30 NSOperationNotSupportedForKeyScriptError, | |
31 NSCannotCreateScriptCommandError | |
32 } | |
33 | |
34 class NSScriptCommand : NSObject, INSCoding | |
35 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
36 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
37 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
38 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
39 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
40 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
41 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
42 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
43 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
44 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
45 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
46 } |
14 | 47 |
48 Object initWithCommandDescription (NSScriptCommandDescription commandDef) | |
49 { | |
50 return invokeObjcSelf!(Object, "initWithCommandDescription:", NSScriptCommandDescription)(commandDef); | |
51 } | |
52 | |
53 this (NSScriptCommandDescription commandDef) | |
54 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
55 typeof(this).alloc.initWithCommandDescription(commandDef); |
14 | 56 } |
57 | |
58 NSScriptCommandDescription commandDescription () | |
59 { | |
60 return invokeObjcSelf!(NSScriptCommandDescription, "commandDescription"); | |
61 } | |
62 | |
63 void setDirectParameter (Object directParameter) | |
64 { | |
65 return invokeObjcSelf!(void, "setDirectParameter:", Object)(directParameter); | |
66 } | |
67 | |
68 Object directParameter () | |
69 { | |
70 return invokeObjcSelf!(Object, "directParameter"); | |
71 } | |
72 | |
73 void setReceiversSpecifier (NSScriptObjectSpecifier receiversRef) | |
74 { | |
75 return invokeObjcSelf!(void, "setReceiversSpecifier:", NSScriptObjectSpecifier)(receiversRef); | |
76 } | |
77 | |
78 NSScriptObjectSpecifier receiversSpecifier () | |
79 { | |
80 return invokeObjcSelf!(NSScriptObjectSpecifier, "receiversSpecifier"); | |
81 } | |
82 | |
83 Object evaluatedReceivers () | |
84 { | |
85 return invokeObjcSelf!(Object, "evaluatedReceivers"); | |
86 } | |
87 | |
88 void setArguments (NSDictionary args) | |
89 { | |
90 return invokeObjcSelf!(void, "setArguments:", NSDictionary)(args); | |
91 } | |
92 | |
93 NSDictionary arguments () | |
94 { | |
95 return invokeObjcSelf!(NSDictionary, "arguments"); | |
96 } | |
97 | |
98 NSDictionary evaluatedArguments () | |
99 { | |
100 return invokeObjcSelf!(NSDictionary, "evaluatedArguments"); | |
101 } | |
102 | |
103 bool isWellFormed () | |
104 { | |
105 return invokeObjcSelf!(bool, "isWellFormed"); | |
106 } | |
107 | |
108 Object performDefaultImplementation () | |
109 { | |
110 return invokeObjcSelf!(Object, "performDefaultImplementation"); | |
111 } | |
112 | |
113 Object executeCommand () | |
114 { | |
115 return invokeObjcSelf!(Object, "executeCommand"); | |
116 } | |
117 | |
118 void setScriptErrorNumber (int errorNumber) | |
119 { | |
120 return invokeObjcSelf!(void, "setScriptErrorNumber:", int)(errorNumber); | |
121 } | |
122 | |
123 void setScriptErrorOffendingObjectDescriptor (NSAppleEventDescriptor errorOffendingObjectDescriptor) | |
124 { | |
125 return invokeObjcSelf!(void, "setScriptErrorOffendingObjectDescriptor:", NSAppleEventDescriptor)(errorOffendingObjectDescriptor); | |
126 } | |
127 | |
128 void setScriptErrorExpectedTypeDescriptor (NSAppleEventDescriptor errorExpectedTypeDescriptor) | |
129 { | |
130 return invokeObjcSelf!(void, "setScriptErrorExpectedTypeDescriptor:", NSAppleEventDescriptor)(errorExpectedTypeDescriptor); | |
131 } | |
132 | |
133 void setScriptErrorString (NSString errorString) | |
134 { | |
135 return invokeObjcSelf!(void, "setScriptErrorString:", NSString)(errorString); | |
136 } | |
137 | |
138 int scriptErrorNumber () | |
139 { | |
140 return invokeObjcSelf!(int, "scriptErrorNumber"); | |
141 } | |
142 | |
143 NSAppleEventDescriptor scriptErrorOffendingObjectDescriptor () | |
144 { | |
145 return invokeObjcSelf!(NSAppleEventDescriptor, "scriptErrorOffendingObjectDescriptor"); | |
146 } | |
147 | |
148 NSAppleEventDescriptor scriptErrorExpectedTypeDescriptor () | |
149 { | |
150 return invokeObjcSelf!(NSAppleEventDescriptor, "scriptErrorExpectedTypeDescriptor"); | |
151 } | |
152 | |
153 NSString scriptErrorString () | |
154 { | |
155 return invokeObjcSelf!(NSString, "scriptErrorString"); | |
156 } | |
157 | |
158 static NSScriptCommand currentCommand () | |
159 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
160 return invokeObjcSuperClass!(NSScriptCommand, "currentCommand"); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
161 } |
14 | 162 |
163 NSAppleEventDescriptor appleEvent () | |
164 { | |
165 return invokeObjcSelf!(NSAppleEventDescriptor, "appleEvent"); | |
166 } | |
167 | |
168 void suspendExecution () | |
169 { | |
170 return invokeObjcSelf!(void, "suspendExecution"); | |
171 } | |
172 | |
173 void resumeExecutionWithResult (Object result) | |
174 { | |
175 return invokeObjcSelf!(void, "resumeExecutionWithResult:", Object)(result); | |
176 } | |
177 | |
178 void encodeWithCoder (NSCoder aCoder) | |
179 { | |
180 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
181 } | |
182 | |
183 Object initWithCoder (NSCoder aDecoder) | |
184 { | |
185 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); | |
186 } | |
187 | |
188 this (NSCoder aDecoder) | |
189 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
190 typeof(this).alloc.initWithCoder(aDecoder); |
14 | 191 } |
192 } | |
193 |