comparison dstep/foundation/NSXMLDTDNode.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
4 * Version: Initial created: Aug 3, 2009 4 * Version: Initial created: Aug 3, 2009
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.NSXMLDTDNode; 7 module dstep.foundation.NSXMLDTDNode;
8 8
9 import dstep.foundation.NSObjCRuntime;
10 import dstep.foundation.NSString;
9 import dstep.foundation.NSXMLNode; 11 import dstep.foundation.NSXMLNode;
10 import dstep.objc.bridge.Bridge; 12 import dstep.objc.bridge.Bridge;
11 import dstep.objc.objc : id; 13 import dstep.objc.objc;
12 14
13 alias NSUInteger NSXMLDTDNodeKind; 15 alias NSUInteger NSXMLDTDNodeKind;
14 16
15 enum 17 enum
16 { 18 {
36 NSXMLElementDeclarationElementKind 38 NSXMLElementDeclarationElementKind
37 } 39 }
38 40
39 class NSXMLDTDNode : NSXMLNode 41 class NSXMLDTDNode : NSXMLNode
40 { 42 {
41 mixin ObjcWrap; 43 mixin (ObjcWrap);
44
45 this ()
46 {
47 super(typeof(this).alloc.init.objcObject);
48 }
49
50 typeof(this) init ()
51 {
52 return invokeObjcSelf!(typeof(this), "init");
53 }
42 54
43 Object initWithXMLString (NSString string) 55 Object initWithXMLString (NSString string)
44 { 56 {
45 return invokeObjcSelf!(Object, "initWithXMLString:", NSString)(string); 57 return invokeObjcSelf!(Object, "initWithXMLString:", NSString)(string);
46 } 58 }
47 59
48 this (NSString string) 60 this (NSString string)
49 { 61 {
50 objcObject = Bridge.invokeObjcClassMethod!(id, "alloc")(objcClass); 62 typeof(this).alloc.initWithXMLString(string);
51 id result = Bridge.invokeObjcMethod!(id, "initWithXMLString:", NSString)(objcObject, string);
52
53 if (result)
54 objcObject = ret;
55
56 dObject = this;
57 } 63 }
58 64
59 void setDTDKind (uint kind) 65 void setDTDKind (uint kind)
60 { 66 {
61 return invokeObjcSelf!(void, "setDTDKind:", uint)(kind); 67 return invokeObjcSelf!(void, "setDTDKind:", uint)(kind);