Mercurial > projects > dstep
annotate dstep/foundation/NSProcessInfo.d @ 25:b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Tue, 06 Apr 2010 11:37:27 +0200 |
parents | 19885b43130e |
children |
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 { | |
25
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
30 mixin ObjcWrap; |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
31 |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
32 this (id object) |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
33 { |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
34 super(object); |
b9de51448c6b
Added an id constructor. Changed the string mixin to a template mixin. Added support for building as a dynamic library
Jacob Carlborg <doob@me.com>
parents:
16
diff
changeset
|
35 } |
16
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 this () |
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 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
40 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
41 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
42 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
43 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
44 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
45 } |
14 | 46 |
47 static NSProcessInfo processInfo () | |
48 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
15
diff
changeset
|
49 return invokeObjcSuperClass!(NSProcessInfo, "processInfo"); |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
50 } |
14 | 51 |
52 NSDictionary environment () | |
53 { | |
54 return invokeObjcSelf!(NSDictionary, "environment"); | |
55 } | |
56 | |
57 NSArray arguments () | |
58 { | |
59 return invokeObjcSelf!(NSArray, "arguments"); | |
60 } | |
61 | |
62 NSString hostName () | |
63 { | |
64 return invokeObjcSelf!(NSString, "hostName"); | |
65 } | |
66 | |
67 NSString processName () | |
68 { | |
69 return invokeObjcSelf!(NSString, "processName"); | |
70 } | |
71 | |
72 int processIdentifier () | |
73 { | |
74 return invokeObjcSelf!(int, "processIdentifier"); | |
75 } | |
76 | |
77 void setProcessName (NSString newName) | |
78 { | |
79 return invokeObjcSelf!(void, "setProcessName:", NSString)(newName); | |
80 } | |
81 | |
82 NSString globallyUniqueString () | |
83 { | |
84 return invokeObjcSelf!(NSString, "globallyUniqueString"); | |
85 } | |
86 | |
87 NSUInteger operatingSystem () | |
88 { | |
89 return invokeObjcSelf!(NSUInteger, "operatingSystem"); | |
90 } | |
91 | |
92 NSString operatingSystemName () | |
93 { | |
94 return invokeObjcSelf!(NSString, "operatingSystemName"); | |
95 } | |
96 | |
97 NSString operatingSystemVersionString () | |
98 { | |
99 return invokeObjcSelf!(NSString, "operatingSystemVersionString"); | |
100 } | |
101 | |
102 NSUInteger processorCount () | |
103 { | |
104 return invokeObjcSelf!(NSUInteger, "processorCount"); | |
105 } | |
106 | |
107 NSUInteger activeProcessorCount () | |
108 { | |
109 return invokeObjcSelf!(NSUInteger, "activeProcessorCount"); | |
110 } | |
111 | |
112 ulong physicalMemory () | |
113 { | |
114 return invokeObjcSelf!(ulong, "physicalMemory"); | |
115 } | |
116 } | |
117 |