comparison dstep/foundation/NSScriptCommandDescription.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 89f3c3ef1fd2
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.NSScriptCommandDescription; 7 module dstep.foundation.NSScriptCommandDescription;
8 8
9 import dstep.foundation.NSArray; 9 import dstep.foundation.NSArray;
10 import dstep.foundation.NSCoder;
10 import dstep.foundation.NSDictionary; 11 import dstep.foundation.NSDictionary;
11 import dstep.foundation.NSObject; 12 import dstep.foundation.NSObject;
12 import dstep.foundation.NSScriptCommand; 13 import dstep.foundation.NSScriptCommand;
13 import dstep.foundation.NSString; 14 import dstep.foundation.NSString;
15 import dstep.foundation.NSZone;
14 import dstep.objc.bridge.Bridge; 16 import dstep.objc.bridge.Bridge;
15 import dstep.objc.objc : id; 17 import dstep.objc.objc;
16 18
17 class NSScriptCommandDescription : NSObject, INSCoding 19 class NSScriptCommandDescription : NSObject, INSCoding
18 { 20 {
19 mixin ObjcWrap; 21 mixin (ObjcWrap);
20 22
23 this ()
24 {
25 super(typeof(this).alloc.init.objcObject);
26 }
27
28 typeof(this) init ()
29 {
30 return invokeObjcSelf!(typeof(this), "init");
31 }
32
21 Object initWithSuiteName (NSString suiteName, NSString commandName, NSDictionary commandDeclaration) 33 Object initWithSuiteName (NSString suiteName, NSString commandName, NSDictionary commandDeclaration)
22 { 34 {
23 return invokeObjcSelf!(Object, "initWithSuiteName:commandName:dictionary:", NSString, NSString, NSDictionary)(suiteName, commandName, commandDeclaration); 35 return invokeObjcSelf!(Object, "initWithSuiteName:commandName:dictionary:", NSString, NSString, NSDictionary)(suiteName, commandName, commandDeclaration);
24 } 36 }
25 37
26 this (NSString suiteName, NSString commandName, NSDictionary commandDeclaration) 38 this (NSString suiteName, NSString commandName, NSDictionary commandDeclaration)
27 { 39 {
28 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); 40 typeof(this).alloc.initWithSuiteName(suiteName, commandName, commandDeclaration);
29 id result = Bridge.invokeObjcMethod!(id, "initWithSuiteName:commandName:dictionary:", NSString, NSString, NSDictionary)(objcObject, suiteName, commandName, commandDeclaration);
30
31 if (result)
32 objcObject = ret;
33
34 dObject = this;
35 } 41 }
36 42
37 NSString suiteName () 43 NSString suiteName ()
38 { 44 {
39 return invokeObjcSelf!(NSString, "suiteName"); 45 return invokeObjcSelf!(NSString, "suiteName");
109 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); 115 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder);
110 } 116 }
111 117
112 this (NSCoder aDecoder) 118 this (NSCoder aDecoder)
113 { 119 {
114 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); 120 typeof(this).alloc.initWithCoder(aDecoder);
115 id result = Bridge.invokeObjcMethod!(id, "initWithCoder:", NSCoder)(objcObject, aDecoder);
116
117 if (result)
118 objcObject = ret;
119
120 dObject = this;
121 } 121 }
122 } 122 }
123 123