Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSAppleEventDescriptor.d @ 1:8b48be5454ce
The internal cocoa classes compile now
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Tue, 19 Aug 2008 17:35:17 +0200 |
parents | 380af2bdd8e5 |
children | f565d3a95c0a |
comparison
equal
deleted
inserted
replaced
0:380af2bdd8e5 | 1:8b48be5454ce |
---|---|
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <jacob.carlborg@gmail.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSAppleEventDescriptor; | 14 module dwt.internal.cocoa.NSAppleEventDescriptor; |
15 | 15 |
16 import dwt.internal.c.carboncore.MacTypes : FourCharCode; | 16 import dwt.internal.c.carboncore.MacTypes : FourCharCode; |
17 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSData; | 18 import dwt.internal.cocoa.NSData; |
18 import dwt.internal.cocoa.NSInteger; | 19 import dwt.internal.cocoa.NSInteger; |
19 import dwt.internal.cocoa.NSObject; | 20 import dwt.internal.cocoa.NSObject; |
20 import dwt.internal.cocoa.NSString; | 21 import dwt.internal.cocoa.NSString; |
22 import dwt.internal.cocoa.OS; | |
21 import objc = dwt.internal.objc.runtime; | 23 import objc = dwt.internal.objc.runtime; |
22 | 24 |
23 alias FourCharCode AEKeyword; | 25 alias FourCharCode AEKeyword; |
24 | 26 |
25 public class NSAppleEventDescriptor : NSObject | 27 public class NSAppleEventDescriptor : NSObject |
34 super(id); | 36 super(id); |
35 } | 37 } |
36 | 38 |
37 public objc.id aeDesc () | 39 public objc.id aeDesc () |
38 { | 40 { |
39 return OS.objc_msgSend(this.id, OS.sel_aeDesc); | 41 return OS.objc_msgSend(this.id_, OS.sel_aeDesc); |
40 } | 42 } |
41 | 43 |
42 public static NSAppleEventDescriptor appleEventWithEventClass (objc.id eventClass, objc.id eventID, NSAppleEventDescriptor targetDescriptor, | 44 public static NSAppleEventDescriptor appleEventWithEventClass (objc.id eventClass, objc.id eventID, NSAppleEventDescriptor targetDescriptor, |
43 short returnID, objc.id transactionID) | 45 short returnID, objc.id transactionID) |
44 { | 46 { |
45 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, | 47 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, |
46 OS.sel_appleEventWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1, eventClass, eventID, | 48 OS.sel_appleEventWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1, eventClass, eventID, |
47 targetDescriptor !is null ? targetDescriptor.id : null, returnID, transactionID); | 49 targetDescriptor !is null ? targetDescriptor.id_ : null, returnID, transactionID); |
48 return result !is null ? new NSAppleEventDescriptor(result) : null; | 50 return result !is null ? new NSAppleEventDescriptor(result) : null; |
49 } | 51 } |
50 | 52 |
51 public NSAppleEventDescriptor attributeDescriptorForKeyword (objc.id keyword) | 53 public NSAppleEventDescriptor attributeDescriptorForKeyword (objc.id keyword) |
52 { | 54 { |
53 objc.id result = OS.objc_msgSend(this.id, OS.sel_attributeDescriptorForKeyword_1, keyword); | 55 objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributeDescriptorForKeyword_1, keyword); |
54 return result is this.id ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); | 56 return result is this.id_ ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); |
55 } | 57 } |
56 | 58 |
57 public bool boolValue () | 59 public bool boolValue () |
58 { | 60 { |
59 return OS.objc_msgSend(this.id, OS.sel_boolValue) !is null; | 61 return OS.objc_msgSend(this.id_, OS.sel_boolValue) !is null; |
60 } | 62 } |
61 | 63 |
62 public NSAppleEventDescriptor coerceToDescriptorType (objc.id descriptorType) | 64 public NSAppleEventDescriptor coerceToDescriptorType (objc.id descriptorType) |
63 { | 65 { |
64 objc.id result = OS.objc_msgSend(this.id, OS.sel_coerceToDescriptorType_1, descriptorType); | 66 objc.id result = OS.objc_msgSend(this.id_, OS.sel_coerceToDescriptorType_1, descriptorType); |
65 return result is this.id ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); | 67 return result is this.id_ ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); |
66 } | 68 } |
67 | 69 |
68 public NSData data () | 70 public NSData data () |
69 { | 71 { |
70 objc.id result = OS.objc_msgSend(this.id, OS.sel_data); | 72 objc.id result = OS.objc_msgSend(this.id_, OS.sel_data); |
71 return result !is null ? new NSData(result) : null; | 73 return result !is null ? new NSData(result) : null; |
72 } | 74 } |
73 | 75 |
74 public NSAppleEventDescriptor descriptorAtIndex (NSInteger index) | 76 public NSAppleEventDescriptor descriptorAtIndex (NSInteger index) |
75 { | 77 { |
76 objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptorAtIndex_1, index); | 78 objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptorAtIndex_1, index); |
77 return result is this.id ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); | 79 return result is this.id_ ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); |
78 } | 80 } |
79 | 81 |
80 public NSAppleEventDescriptor descriptorForKeyword (objc.id keyword) | 82 public NSAppleEventDescriptor descriptorForKeyword (objc.id keyword) |
81 { | 83 { |
82 objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptorForKeyword_1, keyword); | 84 objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptorForKeyword_1, keyword); |
83 return result is this.id ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); | 85 return result is this.id_ ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); |
84 } | 86 } |
85 | 87 |
86 public objc.id descriptorType () | 88 public objc.id descriptorType () |
87 { | 89 { |
88 return OS.objc_msgSend(this.id, OS.sel_descriptorType); | 90 return OS.objc_msgSend(this.id_, OS.sel_descriptorType); |
89 } | 91 } |
90 | 92 |
91 public static NSAppleEventDescriptor descriptorWithBoolean (bool b) | 93 public static NSAppleEventDescriptor descriptorWithBoolean (bool b) |
92 { | 94 { |
93 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithBoolean_1, b); | 95 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithBoolean_1, b); |
102 } | 104 } |
103 | 105 |
104 public static NSAppleEventDescriptor static_descriptorWithDescriptorType_data_ (objc.id descriptorType, NSData data) | 106 public static NSAppleEventDescriptor static_descriptorWithDescriptorType_data_ (objc.id descriptorType, NSData data) |
105 { | 107 { |
106 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithDescriptorType_1data_1, descriptorType, | 108 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithDescriptorType_1data_1, descriptorType, |
107 data !is null ? data.id : 0); | 109 data !is null ? data.id_ : null); |
108 return result !is null ? new NSAppleEventDescriptor(result) : null; | 110 return result !is null ? new NSAppleEventDescriptor(result) : null; |
109 } | 111 } |
110 | 112 |
111 public static NSAppleEventDescriptor descriptorWithEnumCode (objc.id enumerator) | 113 public static NSAppleEventDescriptor descriptorWithEnumCode (objc.id enumerator) |
112 { | 114 { |
120 return result !is null ? new NSAppleEventDescriptor(result) : null; | 122 return result !is null ? new NSAppleEventDescriptor(result) : null; |
121 } | 123 } |
122 | 124 |
123 public static NSAppleEventDescriptor descriptorWithString (NSString str) | 125 public static NSAppleEventDescriptor descriptorWithString (NSString str) |
124 { | 126 { |
125 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithString_1, str !is null ? str.id : 0); | 127 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithString_1, str !is null ? str.id_ : null); |
126 return result !is null ? new NSAppleEventDescriptor(result) : null; | 128 return result !is null ? new NSAppleEventDescriptor(result) : null; |
127 } | 129 } |
128 | 130 |
129 public static NSAppleEventDescriptor descriptorWithTypeCode (objc.id typeCode) | 131 public static NSAppleEventDescriptor descriptorWithTypeCode (objc.id typeCode) |
130 { | 132 { |
132 return result !is null ? new NSAppleEventDescriptor(result) : null; | 134 return result !is null ? new NSAppleEventDescriptor(result) : null; |
133 } | 135 } |
134 | 136 |
135 public objc.id enumCodeValue () | 137 public objc.id enumCodeValue () |
136 { | 138 { |
137 return OS.objc_msgSend(this.id, OS.sel_enumCodeValue); | 139 return OS.objc_msgSend(this.id_, OS.sel_enumCodeValue); |
138 } | 140 } |
139 | 141 |
140 public objc.id eventClass () | 142 public objc.id eventClass () |
141 { | 143 { |
142 return OS.objc_msgSend(this.id, OS.sel_eventClass); | 144 return OS.objc_msgSend(this.id_, OS.sel_eventClass); |
143 } | 145 } |
144 | 146 |
145 public objc.id eventID () | 147 public objc.id eventID () |
146 { | 148 { |
147 return OS.objc_msgSend(this.id, OS.sel_eventID); | 149 return OS.objc_msgSend(this.id_, OS.sel_eventID); |
148 } | 150 } |
149 | 151 |
150 public NSAppleEventDescriptor initListDescriptor () | 152 public NSAppleEventDescriptor initListDescriptor () |
151 { | 153 { |
152 objc.id result = OS.objc_msgSend(this.id, OS.sel_initListDescriptor); | 154 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initListDescriptor); |
153 return result !is null ? this : null; | 155 return result !is null ? this : null; |
154 } | 156 } |
155 | 157 |
156 public NSAppleEventDescriptor initRecordDescriptor () | 158 public NSAppleEventDescriptor initRecordDescriptor () |
157 { | 159 { |
158 objc.id result = OS.objc_msgSend(this.id, OS.sel_initRecordDescriptor); | 160 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initRecordDescriptor); |
159 return result !is null ? this : null; | 161 return result !is null ? this : null; |
160 } | 162 } |
161 | 163 |
162 public NSAppleEventDescriptor initWithAEDescNoCopy (objc.id aeDesc) | 164 public NSAppleEventDescriptor initWithAEDescNoCopy (objc.id aeDesc) |
163 { | 165 { |
164 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithAEDescNoCopy_1, aeDesc); | 166 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithAEDescNoCopy_1, aeDesc); |
165 return result !is null ? this : null; | 167 return result !is null ? this : null; |
166 } | 168 } |
167 | 169 |
168 public NSAppleEventDescriptor initWithDescriptorType_bytes_length_ (objc.id descriptorType, /*const*/void* bytes, NSUInteger byteCount) | 170 public NSAppleEventDescriptor initWithDescriptorType_bytes_length_ (objc.id descriptorType, /*const*/void* bytes, NSUInteger byteCount) |
169 { | 171 { |
170 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithDescriptorType_1bytes_1length_1, descriptorType, bytes, byteCount); | 172 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithDescriptorType_1bytes_1length_1, descriptorType, bytes, byteCount); |
171 return result !is null ? this : null; | 173 return result !is null ? this : null; |
172 } | 174 } |
173 | 175 |
174 public NSAppleEventDescriptor initWithDescriptorType_data_ (objc.id descriptorType, NSData data) | 176 public NSAppleEventDescriptor initWithDescriptorType_data_ (objc.id descriptorType, NSData data) |
175 { | 177 { |
176 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithDescriptorType_1data_1, descriptorType, data !is null ? data.id : null); | 178 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithDescriptorType_1data_1, descriptorType, data !is null ? data.id_ : null); |
177 return result !is null ? this : null; | 179 return result !is null ? this : null; |
178 } | 180 } |
179 | 181 |
180 public NSAppleEventDescriptor initWithEventClass (objc.id eventClass, objc.id eventID, NSAppleEventDescriptor targetDescriptor, objc.id returnID, | 182 public NSAppleEventDescriptor initWithEventClass (objc.id eventClass, objc.id eventID, NSAppleEventDescriptor targetDescriptor, objc.id returnID, |
181 objc.id transactionID) | 183 objc.id transactionID) |
182 { | 184 { |
183 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1, eventClass, | 185 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1, eventClass, |
184 eventID, targetDescriptor !is null ? targetDescriptor.id : null, returnID, transactionID); | 186 eventID, targetDescriptor !is null ? targetDescriptor.id_ : null, returnID, transactionID); |
185 return result !is null ? this : null; | 187 return result !is null ? this : null; |
186 } | 188 } |
187 | 189 |
188 public void insertDescriptor (NSAppleEventDescriptor descriptor, NSInteger index) | 190 public void insertDescriptor (NSAppleEventDescriptor descriptor, NSInteger index) |
189 { | 191 { |
190 OS.objc_msgSend(this.id, OS.sel_insertDescriptor_1atIndex_1, descriptor !is null ? descriptor.id : null, index); | 192 OS.objc_msgSend(this.id_, OS.sel_insertDescriptor_1atIndex_1, descriptor !is null ? descriptor.id_ : null, index); |
191 } | 193 } |
192 | 194 |
193 public int int32Value () | 195 public int int32Value () |
194 { | 196 { |
195 return cast(int) OS.objc_msgSend(this.id, OS.sel_int32Value); | 197 return cast(int) OS.objc_msgSend(this.id_, OS.sel_int32Value); |
196 } | 198 } |
197 | 199 |
198 public AEKeyword keywordForDescriptorAtIndex (NSInteger index) | 200 public AEKeyword keywordForDescriptorAtIndex (NSInteger index) |
199 { | 201 { |
200 return OS.objc_msgSend(this.id, OS.sel_keywordForDescriptorAtIndex_1, index); | 202 return cast(AEKeyword) OS.objc_msgSend(this.id_, OS.sel_keywordForDescriptorAtIndex_1, index); |
201 } | 203 } |
202 | 204 |
203 public static NSAppleEventDescriptor listDescriptor () | 205 public static NSAppleEventDescriptor listDescriptor () |
204 { | 206 { |
205 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_listDescriptor); | 207 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_listDescriptor); |
212 return result !is null ? new NSAppleEventDescriptor(result) : null; | 214 return result !is null ? new NSAppleEventDescriptor(result) : null; |
213 } | 215 } |
214 | 216 |
215 public NSInteger numberOfItems () | 217 public NSInteger numberOfItems () |
216 { | 218 { |
217 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_numberOfItems); | 219 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfItems); |
218 } | 220 } |
219 | 221 |
220 public NSAppleEventDescriptor paramDescriptorForKeyword (objc.id keyword) | 222 public NSAppleEventDescriptor paramDescriptorForKeyword (objc.id keyword) |
221 { | 223 { |
222 objc.id result = OS.objc_msgSend(this.id, OS.sel_paramDescriptorForKeyword_1, keyword); | 224 objc.id result = OS.objc_msgSend(this.id_, OS.sel_paramDescriptorForKeyword_1, keyword); |
223 return result is this.id ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); | 225 return result is this.id_ ? this : (result !is null ? new NSAppleEventDescriptor(result) : null); |
224 } | 226 } |
225 | 227 |
226 public static NSAppleEventDescriptor recordDescriptor () | 228 public static NSAppleEventDescriptor recordDescriptor () |
227 { | 229 { |
228 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_recordDescriptor); | 230 objc.id result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_recordDescriptor); |
229 return result !is null ? new NSAppleEventDescriptor(result) : null; | 231 return result !is null ? new NSAppleEventDescriptor(result) : null; |
230 } | 232 } |
231 | 233 |
232 public void removeDescriptorAtIndex (NSInteger index) | 234 public void removeDescriptorAtIndex (NSInteger index) |
233 { | 235 { |
234 OS.objc_msgSend(this.id, OS.sel_removeDescriptorAtIndex_1, index); | 236 OS.objc_msgSend(this.id_, OS.sel_removeDescriptorAtIndex_1, index); |
235 } | 237 } |
236 | 238 |
237 public void removeDescriptorWithKeyword (objc.id keyword) | 239 public void removeDescriptorWithKeyword (objc.id keyword) |
238 { | 240 { |
239 OS.objc_msgSend(this.id, OS.sel_removeDescriptorWithKeyword_1, keyword); | 241 OS.objc_msgSend(this.id_, OS.sel_removeDescriptorWithKeyword_1, keyword); |
240 } | 242 } |
241 | 243 |
242 public void removeParamDescriptorWithKeyword (objc.id keyword) | 244 public void removeParamDescriptorWithKeyword (objc.id keyword) |
243 { | 245 { |
244 OS.objc_msgSend(this.id, OS.sel_removeParamDescriptorWithKeyword_1, keyword); | 246 OS.objc_msgSend(this.id_, OS.sel_removeParamDescriptorWithKeyword_1, keyword); |
245 } | 247 } |
246 | 248 |
247 public short returnID () | 249 public short returnID () |
248 { | 250 { |
249 return cast(short) OS.objc_msgSend(this.id, OS.sel_returnID); | 251 return cast(short) OS.objc_msgSend(this.id_, OS.sel_returnID); |
250 } | 252 } |
251 | 253 |
252 public void setAttributeDescriptor (NSAppleEventDescriptor descriptor, objc.id keyword) | 254 public void setAttributeDescriptor (NSAppleEventDescriptor descriptor, objc.id keyword) |
253 { | 255 { |
254 OS.objc_msgSend(this.id, OS.sel_setAttributeDescriptor_1forKeyword_1, descriptor !is null ? descriptor.id : null, keyword); | 256 OS.objc_msgSend(this.id_, OS.sel_setAttributeDescriptor_1forKeyword_1, descriptor !is null ? descriptor.id_ : null, keyword); |
255 } | 257 } |
256 | 258 |
257 public void setDescriptor (NSAppleEventDescriptor descriptor, objc.id keyword) | 259 public void setDescriptor (NSAppleEventDescriptor descriptor, objc.id keyword) |
258 { | 260 { |
259 OS.objc_msgSend(this.id, OS.sel_setDescriptor_1forKeyword_1, descriptor !is null ? descriptor.id : null, keyword); | 261 OS.objc_msgSend(this.id_, OS.sel_setDescriptor_1forKeyword_1, descriptor !is null ? descriptor.id_ : null, keyword); |
260 } | 262 } |
261 | 263 |
262 public void setParamDescriptor (NSAppleEventDescriptor descriptor, objc.id keyword) | 264 public void setParamDescriptor (NSAppleEventDescriptor descriptor, objc.id keyword) |
263 { | 265 { |
264 OS.objc_msgSend(this.id, OS.sel_setParamDescriptor_1forKeyword_1, descriptor !is null ? descriptor.id : null, keyword); | 266 OS.objc_msgSend(this.id_, OS.sel_setParamDescriptor_1forKeyword_1, descriptor !is null ? descriptor.id_ : null, keyword); |
265 } | 267 } |
266 | 268 |
267 public NSString StringValue () | 269 public NSString StringValue () |
268 { | 270 { |
269 objc.id result = OS.objc_msgSend(this.id, OS.sel_StringValue); | 271 objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringValue); |
270 return result !is null ? new NSString(result) : null; | 272 return result !is null ? new NSString(result) : null; |
271 } | 273 } |
272 | 274 |
273 public objc.id transactionID () | 275 public objc.id transactionID () |
274 { | 276 { |
275 return OS.objc_msgSend(this.id, OS.sel_transactionID); | 277 return OS.objc_msgSend(this.id_, OS.sel_transactionID); |
276 } | 278 } |
277 | 279 |
278 public objc.id typeCodeValue () | 280 public objc.id typeCodeValue () |
279 { | 281 { |
280 return OS.objc_msgSend(this.id, OS.sel_typeCodeValue); | 282 return OS.objc_msgSend(this.id_, OS.sel_typeCodeValue); |
281 } | 283 } |
282 } | 284 } |