Mercurial > projects > dstep
comparison dstep/foundation/NSScriptClassDescription.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 |
---|---|
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.NSScriptClassDescription; | 7 module dstep.foundation.NSScriptClassDescription; |
8 | 8 |
9 import dstep.foundation.NSClassDescription; | 9 import dstep.foundation.NSClassDescription; |
10 import dstep.foundation.NSDictionary; | |
10 import dstep.foundation.NSScriptCommandDescription; | 11 import dstep.foundation.NSScriptCommandDescription; |
12 import dstep.foundation.NSString; | |
11 import dstep.objc.bridge.Bridge; | 13 import dstep.objc.bridge.Bridge; |
12 import dstep.objc.objc : id; | 14 import dstep.objc.objc; |
13 | 15 |
14 class NSScriptClassDescription : NSClassDescription | 16 class NSScriptClassDescription : NSClassDescription |
15 { | 17 { |
16 mixin ObjcWrap; | 18 mixin (ObjcWrap); |
19 | |
20 this () | |
21 { | |
22 super(typeof(this).alloc.init.objcObject); | |
23 } | |
24 | |
25 typeof(this) init () | |
26 { | |
27 return invokeObjcSelf!(typeof(this), "init"); | |
28 } | |
17 | 29 |
18 static NSScriptClassDescription classDescriptionForClass (Class aClass) | 30 static NSScriptClassDescription classDescriptionForClass (Class aClass) |
19 { | 31 { |
20 return invokeObjcSelfClass!(NSScriptClassDescription, "classDescriptionForClass:", Class)(aClass); | 32 return invokeObjcSuperClass!(NSScriptClassDescription, "classDescriptionForClass:", Class)(aClass); |
21 } | 33 } |
22 | 34 |
23 Object initWithSuiteName (NSString suiteName, NSString className, NSDictionary classDeclaration) | 35 Object initWithSuiteName (NSString suiteName, NSString className, NSDictionary classDeclaration) |
24 { | 36 { |
25 return invokeObjcSelf!(Object, "initWithSuiteName:className:dictionary:", NSString, NSString, NSDictionary)(suiteName, className, classDeclaration); | 37 return invokeObjcSelf!(Object, "initWithSuiteName:className:dictionary:", NSString, NSString, NSDictionary)(suiteName, className, classDeclaration); |
26 } | 38 } |
27 | 39 |
28 this (NSString suiteName, NSString className, NSDictionary classDeclaration) | 40 this (NSString suiteName, NSString className, NSDictionary classDeclaration) |
29 { | 41 { |
30 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); | 42 typeof(this).alloc.initWithSuiteName(suiteName, className, classDeclaration); |
31 id result = Bridge.invokeObjcMethod!(id, "initWithSuiteName:className:dictionary:", NSString, NSString, NSDictionary)(objcObject, suiteName, className, classDeclaration); | |
32 | |
33 if (result) | |
34 objcObject = ret; | |
35 | |
36 dObject = this; | |
37 } | 43 } |
38 | 44 |
39 NSString suiteName () | 45 NSString suiteName () |
40 { | 46 { |
41 return invokeObjcSelf!(NSString, "suiteName"); | 47 return invokeObjcSelf!(NSString, "suiteName"); |
127 { | 133 { |
128 return invokeObjcSelf!(bool, "hasWritablePropertyForKey:", NSString)(key); | 134 return invokeObjcSelf!(bool, "hasWritablePropertyForKey:", NSString)(key); |
129 } | 135 } |
130 } | 136 } |
131 | 137 |
132 template TNSScriptClassDescription () | 138 const TNSScriptClassDescription = ` |
133 { | |
134 uint classCode (); | |
135 NSString className (); | |
136 } | |
137 | 139 |
140 uint classCode () | |
141 { | |
142 return invokeObjcSelf!(uint, "classCode"); | |
143 } | |
144 | |
145 NSString className () | |
146 { | |
147 return invokeObjcSelf!(NSString, "className"); | |
148 } | |
149 | |
150 //mixin ObjcBindMethod!(classCode, "classCode"); | |
151 //mixin ObjcBindMethod!(className, "className"); | |
152 `; |