annotate dstep/foundation/NSBundle.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 /**
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
3 * Authors: Jacob Carlborg
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 * Version: Initial created: Aug 3, 2009
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
6 */
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7 module dstep.foundation.NSBundle;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
8
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
9 import dstep.foundation.NSArray;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
10 import dstep.foundation.NSDictionary;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
11 import dstep.foundation.NSError;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
12 import dstep.foundation.NSObject;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
13 import dstep.foundation.NSString;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
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;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
17
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
18
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
19 import bindings = dstep.foundation.NSBundle_bindings;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
20
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
21 private
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
22 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
23 NSString NSBundleDidLoadNotification_;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
24 NSString NSLoadedClasses_;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
25 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
26
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
27 NSString NSBundleDidLoadNotification ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
28 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
29 if (NSBundleDidLoadNotification_)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
30 return NSBundleDidLoadNotification_;
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 return NSBundleDidLoadNotification_ = new NSString(bindings.NSBundleDidLoadNotification);
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
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
35 NSString NSLoadedClasses ()
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 if (NSLoadedClasses_)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
38 return NSLoadedClasses_;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
39
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
40 return NSLoadedClasses_ = new NSString(bindings.NSLoadedClasses);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
41 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
42
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
43 enum
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
44 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
45 NSBundleExecutableArchitectureI386 = 0x00000007,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
46 NSBundleExecutableArchitecturePPC = 0x00000012,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
47 NSBundleExecutableArchitectureX86_64 = 0x01000007,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
48 NSBundleExecutableArchitecturePPC64 = 0x01000012
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
49 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
50
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
51 class NSBundle : NSObject
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
52 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
53 mixin (ObjcWrap);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
54
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
55 this ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
56 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
57 super(typeof(this).alloc.init.objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
58 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
59
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
60 typeof(this) init ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
61 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
62 return invokeObjcSelf!(typeof(this), "init");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
63 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
64
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
65 static NSBundle mainBundle ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
66 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
67 return invokeObjcSuperClass!(NSBundle, "mainBundle");
15
7ff919f595d5 Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
68 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
69
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
70 static NSBundle bundleWithPath (NSString path)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
71 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
72 return invokeObjcSuperClass!(NSBundle, "bundleWithPath:", NSString)(path);
15
7ff919f595d5 Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
73 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
74
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
75 Object initWithPath (NSString path)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
76 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
77 return invokeObjcSelf!(Object, "initWithPath:", NSString)(path);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
78 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
79
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
80 this (NSString path)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
81 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
82 typeof(this).alloc.initWithPath(path);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
83 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
84
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
85 static NSBundle bundleForClass (Class aClass)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
86 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
87 return invokeObjcSuperClass!(NSBundle, "bundleForClass:", Class)(aClass);
15
7ff919f595d5 Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
88 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
89
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
90 static NSBundle bundleWithIdentifier (NSString identifier)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
91 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
92 return invokeObjcSuperClass!(NSBundle, "bundleWithIdentifier:", NSString)(identifier);
15
7ff919f595d5 Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
93 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
94
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
95 static NSArray allBundles ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
96 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
97 return invokeObjcSuperClass!(NSArray, "allBundles");
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
98 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
99
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
100 static NSArray allFrameworks ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
101 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
102 return invokeObjcSuperClass!(NSArray, "allFrameworks");
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
103 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
104
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
105 bool load ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
106 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
107 return invokeObjcSelf!(bool, "load");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
108 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
109
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
110 bool isLoaded ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
111 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
112 return invokeObjcSelf!(bool, "isLoaded");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
113 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
114
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
115 bool unload ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
116 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
117 return invokeObjcSelf!(bool, "unload");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
118 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
119
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
120 bool preflightAndReturnError (ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
121 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
122 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
123
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
124 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
125 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
126
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
127 bool result = invokeObjcSelf!(bool, "preflightAndReturnError:", id*)(&err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
128
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
129 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
130 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
131
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
132 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
133 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
134
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
135 bool loadAndReturnError (ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
136 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
137 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
138
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
139 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
140 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
141
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
142 bool result = invokeObjcSelf!(bool, "loadAndReturnError:", id*)(&err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
143
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
144 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
145 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
146
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
147 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
148 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
149
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
150 NSString bundlePath ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
151 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
152 return invokeObjcSelf!(NSString, "bundlePath");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
153 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
154
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
155 NSString resourcePath ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
156 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
157 return invokeObjcSelf!(NSString, "resourcePath");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
158 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
159
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
160 NSString executablePath ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
161 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
162 return invokeObjcSelf!(NSString, "executablePath");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
163 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
164
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
165 NSString pathForAuxiliaryExecutable (NSString executableName)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
166 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
167 return invokeObjcSelf!(NSString, "pathForAuxiliaryExecutable:", NSString)(executableName);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
168 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
169
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
170 NSString privateFrameworksPath ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
171 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
172 return invokeObjcSelf!(NSString, "privateFrameworksPath");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
173 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
174
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
175 NSString sharedFrameworksPath ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
176 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
177 return invokeObjcSelf!(NSString, "sharedFrameworksPath");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
178 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
179
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
180 NSString sharedSupportPath ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
181 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
182 return invokeObjcSelf!(NSString, "sharedSupportPath");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
183 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
184
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
185 NSString builtInPlugInsPath ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
186 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
187 return invokeObjcSelf!(NSString, "builtInPlugInsPath");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
188 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
189
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
190 NSString bundleIdentifier ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
191 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
192 return invokeObjcSelf!(NSString, "bundleIdentifier");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
193 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
194
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
195 Class classNamed (NSString className)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
196 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
197 return invokeObjcSelf!(Class, "classNamed:", NSString)(className);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
198 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
199
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
200 Class principalClass ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
201 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
202 return invokeObjcSelf!(Class, "principalClass");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
203 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
204
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
205 static NSString pathForResource (NSString name, NSString ext, NSString bundlePath)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
206 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
207 return invokeObjcSuperClass!(NSString, "pathForResource:ofType:inDirectory:", NSString, NSString, NSString)(name, ext, bundlePath);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
208 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
209
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
210 NSString pathForResource (NSString name, NSString ext)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
211 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
212 return invokeObjcSelf!(NSString, "pathForResource:ofType:", NSString, NSString)(name, ext);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
213 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
214
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
215 NSString pathForResource (NSString name, NSString ext, NSString subpath)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
216 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
217 return invokeObjcSelf!(NSString, "pathForResource:ofType:inDirectory:", NSString, NSString, NSString)(name, ext, subpath);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
218 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
219
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
220 NSString pathForResource (NSString name, NSString ext, NSString subpath, NSString localizationName)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
221 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
222 return invokeObjcSelf!(NSString, "pathForResource:ofType:inDirectory:forLocalization:", NSString, NSString, NSString, NSString)(name, ext, subpath, localizationName);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
223 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
224
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
225 static NSArray pathsForResourcesOfType (NSString ext, NSString bundlePath)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
226 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
227 return invokeObjcSuperClass!(NSArray, "pathsForResourcesOfType:inDirectory:", NSString, NSString)(ext, bundlePath);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
228 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
229
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
230 NSArray pathsForResourcesOfType (NSString ext, NSString subpath)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
231 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
232 return invokeObjcSelf!(NSArray, "pathsForResourcesOfType:inDirectory:", NSString, NSString)(ext, subpath);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
233 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
234
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
235 NSArray pathsForResourcesOfType (NSString ext, NSString subpath, NSString localizationName)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
236 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
237 return invokeObjcSelf!(NSArray, "pathsForResourcesOfType:inDirectory:forLocalization:", NSString, NSString, NSString)(ext, subpath, localizationName);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
238 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
239
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
240 NSString localizedStringForKey (NSString key, NSString value, NSString tableName)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
241 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
242 return invokeObjcSelf!(NSString, "localizedStringForKey:value:table:", NSString, NSString, NSString)(key, value, tableName);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
243 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
244
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
245 NSDictionary infoDictionary ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
246 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
247 return invokeObjcSelf!(NSDictionary, "infoDictionary");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
248 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
249
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
250 NSDictionary localizedInfoDictionary ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
251 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
252 return invokeObjcSelf!(NSDictionary, "localizedInfoDictionary");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
253 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
254
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
255 Object objectForInfoDictionaryKey (NSString key)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
256 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
257 return invokeObjcSelf!(Object, "objectForInfoDictionaryKey:", NSString)(key);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
258 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
259
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
260 NSArray localizations ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
261 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
262 return invokeObjcSelf!(NSArray, "localizations");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
263 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
264
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
265 NSArray preferredLocalizations ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
266 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
267 return invokeObjcSelf!(NSArray, "preferredLocalizations");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
268 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
269
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
270 NSString developmentLocalization ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
271 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
272 return invokeObjcSelf!(NSString, "developmentLocalization");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
273 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
274
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
275 static NSArray preferredLocalizationsFromArray (NSArray localizationsArray)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
276 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
277 return invokeObjcSuperClass!(NSArray, "preferredLocalizationsFromArray:", NSArray)(localizationsArray);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
278 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
279
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
280 static NSArray preferredLocalizationsFromArray (NSArray localizationsArray, NSArray preferencesArray)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
281 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 15
diff changeset
282 return invokeObjcSuperClass!(NSArray, "preferredLocalizationsFromArray:forPreferences:", NSArray, NSArray)(localizationsArray, preferencesArray);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
283 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
284
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
285 NSArray executableArchitectures ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
286 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
287 return invokeObjcSelf!(NSArray, "executableArchitectures");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
288 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
289 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
290