Mercurial > projects > dstep
annotate dstep/foundation/NSProcessInfo.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 |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSProcessInfo; | |
8 | |
9 import dstep.foundation.NSArray; | |
10 import dstep.foundation.NSDictionary; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
11 import dstep.foundation.NSObjCRuntime; |
14 | 12 import dstep.foundation.NSObject; |
13 import dstep.foundation.NSString; | |
14 import dstep.objc.bridge.Bridge; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
15 import dstep.objc.objc; |
14 | 16 |
17 enum | |
18 { | |
19 NSWindowsNTOperatingSystem = 1, | |
20 NSWindows95OperatingSystem, | |
21 NSSolarisOperatingSystem, | |
22 NSHPUXOperatingSystem, | |
23 NSMACHOperatingSystem, | |
24 NSSunOSOperatingSystem, | |
25 NSOSF1OperatingSystem | |
26 } | |
27 | |
28 class NSProcessInfo : NSObject | |
29 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
30 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
31 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
32 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
33 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
34 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
35 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
36 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
37 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
38 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
39 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
40 } |
14 | 41 |
42 static NSProcessInfo processInfo () | |
43 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
44 return invokeObjcSuperClass!(NSProcessInfo, "processInfo"); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
45 } |
14 | 46 |
47 NSDictionary environment () | |
48 { | |
49 return invokeObjcSelf!(NSDictionary, "environment"); | |
50 } | |
51 | |
52 NSArray arguments () | |
53 { | |
54 return invokeObjcSelf!(NSArray, "arguments"); | |
55 } | |
56 | |
57 NSString hostName () | |
58 { | |
59 return invokeObjcSelf!(NSString, "hostName"); | |
60 } | |
61 | |
62 NSString processName () | |
63 { | |
64 return invokeObjcSelf!(NSString, "processName"); | |
65 } | |
66 | |
67 int processIdentifier () | |
68 { | |
69 return invokeObjcSelf!(int, "processIdentifier"); | |
70 } | |
71 | |
72 void setProcessName (NSString newName) | |
73 { | |
74 return invokeObjcSelf!(void, "setProcessName:", NSString)(newName); | |
75 } | |
76 | |
77 NSString globallyUniqueString () | |
78 { | |
79 return invokeObjcSelf!(NSString, "globallyUniqueString"); | |
80 } | |
81 | |
82 NSUInteger operatingSystem () | |
83 { | |
84 return invokeObjcSelf!(NSUInteger, "operatingSystem"); | |
85 } | |
86 | |
87 NSString operatingSystemName () | |
88 { | |
89 return invokeObjcSelf!(NSString, "operatingSystemName"); | |
90 } | |
91 | |
92 NSString operatingSystemVersionString () | |
93 { | |
94 return invokeObjcSelf!(NSString, "operatingSystemVersionString"); | |
95 } | |
96 | |
97 NSUInteger processorCount () | |
98 { | |
99 return invokeObjcSelf!(NSUInteger, "processorCount"); | |
100 } | |
101 | |
102 NSUInteger activeProcessorCount () | |
103 { | |
104 return invokeObjcSelf!(NSUInteger, "activeProcessorCount"); | |
105 } | |
106 | |
107 ulong physicalMemory () | |
108 { | |
109 return invokeObjcSelf!(ulong, "physicalMemory"); | |
110 } | |
111 } | |
112 |