comparison dstep/foundation/NSDebug.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
6 */ 6 */
7 module dstep.foundation.NSDebug; 7 module dstep.foundation.NSDebug;
8 8
9 import dstep.foundation.NSAutoreleasePool; 9 import dstep.foundation.NSAutoreleasePool;
10 import dstep.foundation.NSDate; 10 import dstep.foundation.NSDate;
11 import dstep.foundation.NSObjCRuntime;
11 import dstep.foundation.NSObject; 12 import dstep.foundation.NSObject;
12 import dstep.foundation.NSPort; 13 import dstep.foundation.NSPort;
13 import dstep.objc.bridge.Bridge; 14 import dstep.objc.bridge.Bridge;
14 import dstep.objc.objc : id; 15 import dstep.objc.objc;
15 16
16 import bindings = dstep.foundation.NSDebug_bindings; 17 import bindings = dstep.foundation.NSDebug_bindings;
17 18
18 extern (C) 19 extern (C)
19 { 20 {
25 bool NSHangOnUncaughtException; 26 bool NSHangOnUncaughtException;
26 bool NSKeepAllocationStatistics; 27 bool NSKeepAllocationStatistics;
27 } 28 }
28 } 29 }
29 30
30 template TNSAutoreleasePoolDebugging () 31 const TNSAutoreleasePoolDebugging = `
31 { 32
32 static void enableRelease (bool enable) 33 static void enableRelease (bool enable)
33 { 34 {
34 return invokeObjcSelfClass!(void, "enableRelease:", bool)(enable); 35 return invokeObjcSuperClass!(void, "enableRelease:", bool)(enable);
35 } 36 }
36 37
37 static void showPools () 38 static void showPools ()
38 { 39 {
39 return invokeObjcSelfClass!(void, "showPools"); 40 return invokeObjcSuperClass!(void, "showPools");
40 } 41 }
41 42
42 static void resetTotalAutoreleasedObjects () 43 static void resetTotalAutoreleasedObjects ()
43 { 44 {
44 return invokeObjcSelfClass!(void, "resetTotalAutoreleasedObjects"); 45 return invokeObjcSuperClass!(void, "resetTotalAutoreleasedObjects");
45 } 46 }
46 47
47 static NSUInteger totalAutoreleasedObjects () 48 static NSUInteger totalAutoreleasedObjects ()
48 { 49 {
49 return invokeObjcSelfClass!(NSUInteger, "totalAutoreleasedObjects"); 50 return invokeObjcSuperClass!(NSUInteger, "totalAutoreleasedObjects");
50 } 51 }
51 52
52 static void enableFreedObjectCheck (bool enable) 53 static void enableFreedObjectCheck (bool enable)
53 { 54 {
54 return invokeObjcSelfClass!(void, "enableFreedObjectCheck:", bool)(enable); 55 return invokeObjcSuperClass!(void, "enableFreedObjectCheck:", bool)(enable);
55 } 56 }
56 57
57 static NSUInteger autoreleasedObjectCount () 58 static NSUInteger autoreleasedObjectCount ()
58 { 59 {
59 return invokeObjcSelfClass!(NSUInteger, "autoreleasedObjectCount"); 60 return invokeObjcSuperClass!(NSUInteger, "autoreleasedObjectCount");
60 } 61 }
61 62
62 static NSUInteger topAutoreleasePoolCount () 63 static NSUInteger topAutoreleasePoolCount ()
63 { 64 {
64 return invokeObjcSelfClass!(NSUInteger, "topAutoreleasePoolCount"); 65 return invokeObjcSuperClass!(NSUInteger, "topAutoreleasePoolCount");
65 } 66 }
66 67
67 static NSUInteger poolCountHighWaterMark () 68 static NSUInteger poolCountHighWaterMark ()
68 { 69 {
69 return invokeObjcSelfClass!(NSUInteger, "poolCountHighWaterMark"); 70 return invokeObjcSuperClass!(NSUInteger, "poolCountHighWaterMark");
70 } 71 }
71 72
72 static void setPoolCountHighWaterMark (NSUInteger count) 73 static void setPoolCountHighWaterMark (NSUInteger count)
73 { 74 {
74 return invokeObjcSelfClass!(void, "setPoolCountHighWaterMark:", NSUInteger)(count); 75 return invokeObjcSuperClass!(void, "setPoolCountHighWaterMark:", NSUInteger)(count);
75 } 76 }
76 77
77 static NSUInteger poolCountHighWaterResolution () 78 static NSUInteger poolCountHighWaterResolution ()
78 { 79 {
79 return invokeObjcSelfClass!(NSUInteger, "poolCountHighWaterResolution"); 80 return invokeObjcSuperClass!(NSUInteger, "poolCountHighWaterResolution");
80 } 81 }
81 82
82 static void setPoolCountHighWaterResolution (NSUInteger res) 83 static void setPoolCountHighWaterResolution (NSUInteger res)
83 { 84 {
84 return invokeObjcSelfClass!(void, "setPoolCountHighWaterResolution:", NSUInteger)(res); 85 return invokeObjcSuperClass!(void, "setPoolCountHighWaterResolution:", NSUInteger)(res);
85 } 86 }
86 } 87 `;
87 88
88 bool NSIsFreedObject (Object anObject) 89 bool NSIsFreedObject (Object anObject)
89 { 90 {
90 return Bridge.invokeObjcFunction!(bool, bindings.NSIsFreedObject, Object)(anObject); 91 return Bridge.invokeObjcFunction!(bool, bindings.NSIsFreedObject, Object)(anObject);
91 } 92 }