Mercurial > projects > dstep
comparison dstep/foundation/NSObjCRuntime.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 |
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.NSObjCRuntime; | 7 module dstep.foundation.NSObjCRuntime; |
8 | 8 |
9 import dstep.AvailabilityMacros; | |
10 import dstep.foundation.NSString; | 9 import dstep.foundation.NSString; |
11 import dstep.foundation.Protocol; | 10 import dstep.foundation.NSZone; |
12 import dstep.limits; | 11 import dstep.internal.Version; |
13 import dstep.objc.bridge.Bridge; | 12 import dstep.objc.bridge.Bridge; |
14 import dstep.objc.objc : id; | |
15 import dstep.objc.objc; | 13 import dstep.objc.objc; |
16 import dstep.stdarg; | 14 |
17 import dstep.stdint; | 15 |
16 import dstep.objc.runtime; | |
18 | 17 |
19 import bindings = dstep.foundation.NSObjCRuntime_bindings; | 18 import bindings = dstep.foundation.NSObjCRuntime_bindings; |
20 | 19 |
21 alias int NSInteger; | 20 version (D_LP64) |
22 alias uint NSUInteger; | 21 { |
22 alias long NSInteger; | |
23 alias ulong NSUInteger; | |
24 } | |
25 | |
26 else | |
27 { | |
28 alias int NSInteger; | |
29 alias uint NSUInteger; | |
30 } | |
31 | |
23 alias NSInteger NSComparisonResult; | 32 alias NSInteger NSComparisonResult; |
24 | 33 |
25 extern (C) | 34 extern (C) |
26 { | 35 { |
27 extern | 36 extern |
60 Class NSClassFromString (NSString aClassName) | 69 Class NSClassFromString (NSString aClassName) |
61 { | 70 { |
62 return Bridge.invokeObjcFunction!(Class, bindings.NSClassFromString, NSString)(aClassName); | 71 return Bridge.invokeObjcFunction!(Class, bindings.NSClassFromString, NSString)(aClassName); |
63 } | 72 } |
64 | 73 |
65 NSString NSStringFromProtocol (Protocol proto) | 74 NSString NSStringFromProtocol (Protocol* proto) |
66 { | 75 { |
67 return Bridge.invokeObjcFunction!(NSString, bindings.NSStringFromProtocol, Protocol)(proto); | 76 return Bridge.invokeObjcFunction!(NSString, bindings.NSStringFromProtocol, Protocol*)(proto); |
68 } | 77 } |
69 | 78 |
70 Protocol NSProtocolFromString (NSString namestr) | 79 Protocol* NSProtocolFromString (NSString namestr) |
71 { | 80 { |
72 return Bridge.invokeObjcFunction!(Protocol, bindings.NSProtocolFromString, NSString)(namestr); | 81 return Bridge.invokeObjcFunction!(Protocol*, bindings.NSProtocolFromString, NSString)(namestr); |
73 } | 82 } |
74 | 83 |
75 void NSLog (NSString format, ...) | 84 void NSLog (ARGS...) (NSString format, ARGS args) |
76 { | 85 { |
77 return Bridge.invokeObjcFunction!(void, bindings.NSLog, NSString)(format); | 86 return Bridge.invokeObjcFunction!(void, bindings.NSLog, NSString, ARGS)(format, args); |
78 } | 87 } |
79 | 88 |
80 void NSLogv (NSString format, char* args) | 89 void NSLogv (NSString format, char* args) |
81 { | 90 { |
82 return Bridge.invokeObjcFunction!(void, bindings.NSLogv, NSString, char*)(format, args); | 91 return Bridge.invokeObjcFunction!(void, bindings.NSLogv, NSString, char*)(format, args); |