comparison dwt/internal/cocoa/NSWorkspace.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
comparison
equal deleted inserted replaced
0:380af2bdd8e5 1:8b48be5454ce
76 super(id); 76 super(id);
77 } 77 }
78 78
79 public NSString absolutePathForAppBundleWithIdentifier (NSString bundleIdentifier) 79 public NSString absolutePathForAppBundleWithIdentifier (NSString bundleIdentifier)
80 { 80 {
81 objc.id result = OS.objc_msgSend(this.id, OS.sel_absolutePathForAppBundleWithIdentifier_1, 81 objc.id result = OS.objc_msgSend(this.id_, OS.sel_absolutePathForAppBundleWithIdentifier_1,
82 bundleIdentifier !is null ? bundleIdentifier.id : null); 82 bundleIdentifier !is null ? bundleIdentifier.id_ : null);
83 return result !is null ? new NSString(result) : null; 83 return result !is null ? new NSString(result) : null;
84 } 84 }
85 85
86 public NSDictionary activeApplication () 86 public NSDictionary activeApplication ()
87 { 87 {
88 objc.id result = OS.objc_msgSend(this.id, OS.sel_activeApplication); 88 objc.id result = OS.objc_msgSend(this.id_, OS.sel_activeApplication);
89 return result !is null ? new NSDictionary(result) : null; 89 return result !is null ? new NSDictionary(result) : null;
90 } 90 }
91 91
92 public void checkForRemovableMedia () 92 public void checkForRemovableMedia ()
93 { 93 {
94 OS.objc_msgSend(this.id, OS.sel_checkForRemovableMedia); 94 OS.objc_msgSend(this.id_, OS.sel_checkForRemovableMedia);
95 } 95 }
96 96
97 public NSInteger extendPowerOffBy (NSInteger requested) 97 public NSInteger extendPowerOffBy (NSInteger requested)
98 { 98 {
99 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_extendPowerOffBy_1, requested); 99 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_extendPowerOffBy_1, requested);
100 } 100 }
101 101
102 public bool fileSystemChanged () 102 public bool fileSystemChanged ()
103 { 103 {
104 return OS.objc_msgSend(this.id, OS.sel_fileSystemChanged) !is null; 104 return OS.objc_msgSend(this.id_, OS.sel_fileSystemChanged) !is null;
105 } 105 }
106 106
107 public bool filenameExtension (NSString filenameExtension, NSString typeName) 107 public bool filenameExtension (NSString filenameExtension, NSString typeName)
108 { 108 {
109 return OS.objc_msgSend(this.id, OS.sel_filenameExtension_1isValidForType_1, filenameExtension !is null ? filenameExtension.id : null, 109 return OS.objc_msgSend(this.id_, OS.sel_filenameExtension_1isValidForType_1, filenameExtension !is null ? filenameExtension.id_ : null,
110 typeName !is null ? typeName.id : null) !is null; 110 typeName !is null ? typeName.id_ : null) !is null;
111 } 111 }
112 112
113 public void findApplications () 113 public void findApplications ()
114 { 114 {
115 OS.objc_msgSend(this.id, OS.sel_findApplications); 115 OS.objc_msgSend(this.id_, OS.sel_findApplications);
116 } 116 }
117 117
118 public NSString fullPathForApplication (NSString appName) 118 public NSString fullPathForApplication (NSString appName)
119 { 119 {
120 objc.id result = OS.objc_msgSend(this.id, OS.sel_fullPathForApplication_1, appName !is null ? appName.id : null); 120 objc.id result = OS.objc_msgSend(this.id_, OS.sel_fullPathForApplication_1, appName !is null ? appName.id_ : null);
121 return result !is null ? new NSString(result) : null; 121 return result !is null ? new NSString(result) : null;
122 } 122 }
123 123
124 public bool getFileSystemInfoForPath (NSString fullPath, bool* removableFlag, bool* writableFlag, bool* unmountableFlag, 124 public bool getFileSystemInfoForPath (NSString fullPath, bool* removableFlag, bool* writableFlag, bool* unmountableFlag,
125 /*NSString** */objc.id** description, 125 /*NSString** */objc.id** description,
126 /*NSString** */objc.id** fileSystemType) 126 /*NSString** */objc.id** fileSystemType)
127 { 127 {
128 return OS.objc_msgSend(this.id, OS.sel_getFileSystemInfoForPath_1isRemovable_1isWritable_1isUnmountable_1description_1type_1, 128 return OS.objc_msgSend(this.id_, OS.sel_getFileSystemInfoForPath_1isRemovable_1isWritable_1isUnmountable_1description_1type_1,
129 fullPath !is null ? fullPath.id : null, removableFlag, writableFlag, unmountableFlag, description, fileSystemType) !is null; 129 fullPath !is null ? fullPath.id_ : null, removableFlag, writableFlag, unmountableFlag, description, fileSystemType) !is null;
130 } 130 }
131 131
132 public bool getInfoForFile (NSString fullPath, /*NSString** */objc.id** appName, /*NSString** */objc.id** type) 132 public bool getInfoForFile (NSString fullPath, /*NSString** */objc.id** appName, /*NSString** */objc.id** type)
133 { 133 {
134 return OS.objc_msgSend(this.id, OS.sel_getInfoForFile_1application_1type_1, fullPath !is null ? fullPath.id : null, appName, type) !is null; 134 return OS.objc_msgSend(this.id_, OS.sel_getInfoForFile_1application_1type_1, fullPath !is null ? fullPath.id_ : null, appName, type) !is null;
135 } 135 }
136 136
137 public void hideOtherApplications () 137 public void hideOtherApplications ()
138 { 138 {
139 OS.objc_msgSend(this.id, OS.sel_hideOtherApplications); 139 OS.objc_msgSend(this.id_, OS.sel_hideOtherApplications);
140 } 140 }
141 141
142 public NSImage iconForFile (NSString fullPath) 142 public NSImage iconForFile (NSString fullPath)
143 { 143 {
144 objc.id result = OS.objc_msgSend(this.id, OS.sel_iconForFile_1, fullPath !is null ? fullPath.id : null); 144 objc.id result = OS.objc_msgSend(this.id_, OS.sel_iconForFile_1, fullPath !is null ? fullPath.id_ : null);
145 return result !is null ? new NSImage(result) : null; 145 return result !is null ? new NSImage(result) : null;
146 } 146 }
147 147
148 public NSImage iconForFileType (NSString fileType) 148 public NSImage iconForFileType (NSString fileType)
149 { 149 {
150 objc.id result = OS.objc_msgSend(this.id, OS.sel_iconForFileType_1, fileType !is null ? fileType.id : null); 150 objc.id result = OS.objc_msgSend(this.id_, OS.sel_iconForFileType_1, fileType !is null ? fileType.id_ : null);
151 return result !is null ? new NSImage(result) : null; 151 return result !is null ? new NSImage(result) : null;
152 } 152 }
153 153
154 public NSImage iconForFiles (NSArray fullPaths) 154 public NSImage iconForFiles (NSArray fullPaths)
155 { 155 {
156 objc.id result = OS.objc_msgSend(this.id, OS.sel_iconForFiles_1, fullPaths !is null ? fullPaths.id : null); 156 objc.id result = OS.objc_msgSend(this.id_, OS.sel_iconForFiles_1, fullPaths !is null ? fullPaths.id_ : null);
157 return result !is null ? new NSImage(result) : null; 157 return result !is null ? new NSImage(result) : null;
158 } 158 }
159 159
160 public bool isFilePackageAtPath (NSString fullPath) 160 public bool isFilePackageAtPath (NSString fullPath)
161 { 161 {
162 return OS.objc_msgSend(this.id, OS.sel_isFilePackageAtPath_1, fullPath !is null ? fullPath.id : null) !is null; 162 return OS.objc_msgSend(this.id_, OS.sel_isFilePackageAtPath_1, fullPath !is null ? fullPath.id_ : null) !is null;
163 } 163 }
164 164
165 public bool launchAppWithBundleIdentifier (NSString bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor, 165 public bool launchAppWithBundleIdentifier (NSString bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor,
166 /*NSNumber** */objc.id** identifier) 166 /*NSNumber** */objc.id** identifier)
167 { 167 {
168 return OS.objc_msgSend(this.id, OS.sel_launchAppWithBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifier_1, 168 return OS.objc_msgSend(this.id_, OS.sel_launchAppWithBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifier_1,
169 bundleIdentifier !is null ? bundleIdentifier.id : null, options, descriptor !is null ? descriptor.id : null, identifier) !is null; 169 bundleIdentifier !is null ? bundleIdentifier.id_ : null, options, descriptor !is null ? descriptor.id_ : null, identifier) !is null;
170 } 170 }
171 171
172 public bool launchApplication_ (NSString appName) 172 public bool launchApplication_ (NSString appName)
173 { 173 {
174 return OS.objc_msgSend(this.id, OS.sel_launchApplication_1, appName !is null ? appName.id : null) !is null; 174 return OS.objc_msgSend(this.id_, OS.sel_launchApplication_1, appName !is null ? appName.id_ : null) !is null;
175 } 175 }
176 176
177 public bool launchApplication_showIcon_autolaunch_ (NSString appName, bool showIcon, bool autolaunch) 177 public bool launchApplication_showIcon_autolaunch_ (NSString appName, bool showIcon, bool autolaunch)
178 { 178 {
179 return OS.objc_msgSend(this.id, OS.sel_launchApplication_1showIcon_1autolaunch_1, appName !is null ? appName.id : null, showIcon, autolaunch) !is null; 179 return OS.objc_msgSend(this.id_, OS.sel_launchApplication_1showIcon_1autolaunch_1, appName !is null ? appName.id_ : null, showIcon, autolaunch) !is null;
180 } 180 }
181 181
182 public NSArray launchedApplications () 182 public NSArray launchedApplications ()
183 { 183 {
184 objc.id result = OS.objc_msgSend(this.id, OS.sel_launchedApplications); 184 objc.id result = OS.objc_msgSend(this.id_, OS.sel_launchedApplications);
185 return result !is null ? new NSArray(result) : null; 185 return result !is null ? new NSArray(result) : null;
186 } 186 }
187 187
188 public NSString localizedDescriptionForType (NSString typeName) 188 public NSString localizedDescriptionForType (NSString typeName)
189 { 189 {
190 objc.id result = OS.objc_msgSend(this.id, OS.sel_localizedDescriptionForType_1, typeName !is null ? typeName.id : null); 190 objc.id result = OS.objc_msgSend(this.id_, OS.sel_localizedDescriptionForType_1, typeName !is null ? typeName.id_ : null);
191 return result !is null ? new NSString(result) : null; 191 return result !is null ? new NSString(result) : null;
192 } 192 }
193 193
194 public NSArray mountNewRemovableMedia () 194 public NSArray mountNewRemovableMedia ()
195 { 195 {
196 objc.id result = OS.objc_msgSend(this.id, OS.sel_mountNewRemovableMedia); 196 objc.id result = OS.objc_msgSend(this.id_, OS.sel_mountNewRemovableMedia);
197 return result !is null ? new NSArray(result) : null; 197 return result !is null ? new NSArray(result) : null;
198 } 198 }
199 199
200 public NSArray mountedLocalVolumePaths () 200 public NSArray mountedLocalVolumePaths ()
201 { 201 {
202 objc.id result = OS.objc_msgSend(this.id, OS.sel_mountedLocalVolumePaths); 202 objc.id result = OS.objc_msgSend(this.id_, OS.sel_mountedLocalVolumePaths);
203 return result !is null ? new NSArray(result) : null; 203 return result !is null ? new NSArray(result) : null;
204 } 204 }
205 205
206 public NSArray mountedRemovableMedia () 206 public NSArray mountedRemovableMedia ()
207 { 207 {
208 objc.id result = OS.objc_msgSend(this.id, OS.sel_mountedRemovableMedia); 208 objc.id result = OS.objc_msgSend(this.id_, OS.sel_mountedRemovableMedia);
209 return result !is null ? new NSArray(result) : null; 209 return result !is null ? new NSArray(result) : null;
210 } 210 }
211 211
212 public void noteFileSystemChanged () 212 public void noteFileSystemChanged ()
213 { 213 {
214 OS.objc_msgSend(this.id, OS.sel_noteFileSystemChanged); 214 OS.objc_msgSend(this.id_, OS.sel_noteFileSystemChanged);
215 } 215 }
216 216
217 public void noteFileSystemChanged_ (NSString path) 217 public void noteFileSystemChanged_ (NSString path)
218 { 218 {
219 OS.objc_msgSend(this.id, OS.sel_noteFileSystemChanged_1, path !is null ? path.id : null); 219 OS.objc_msgSend(this.id_, OS.sel_noteFileSystemChanged_1, path !is null ? path.id_ : null);
220 } 220 }
221 221
222 public void noteUserDefaultsChanged () 222 public void noteUserDefaultsChanged ()
223 { 223 {
224 OS.objc_msgSend(this.id, OS.sel_noteUserDefaultsChanged); 224 OS.objc_msgSend(this.id_, OS.sel_noteUserDefaultsChanged);
225 } 225 }
226 226
227 public NSNotificationCenter notificationCenter () 227 public NSNotificationCenter notificationCenter ()
228 { 228 {
229 objc.id result = OS.objc_msgSend(this.id, OS.sel_notificationCenter); 229 objc.id result = OS.objc_msgSend(this.id_, OS.sel_notificationCenter);
230 return result !is null ? new NSNotificationCenter(result) : null; 230 return result !is null ? new NSNotificationCenter(result) : null;
231 } 231 }
232 232
233 public bool openFile_ (NSString fullPath) 233 public bool openFile_ (NSString fullPath)
234 { 234 {
235 return OS.objc_msgSend(this.id, OS.sel_openFile_1, fullPath !is null ? fullPath.id : null) !is null; 235 return OS.objc_msgSend(this.id_, OS.sel_openFile_1, fullPath !is null ? fullPath.id_ : null) !is null;
236 } 236 }
237 237
238 public bool openFile_fromImage_at_inView_ (NSString fullPath, NSImage anImage, NSPoint point, NSView aView) 238 public bool openFile_fromImage_at_inView_ (NSString fullPath, NSImage anImage, NSPoint point, NSView aView)
239 { 239 {
240 return OS.objc_msgSend(this.id, OS.sel_openFile_1fromImage_1at_1inView_1, fullPath !is null ? fullPath.id : null, 240 return OS.objc_msgSend(this.id_, OS.sel_openFile_1fromImage_1at_1inView_1, fullPath !is null ? fullPath.id_ : null,
241 anImage !is null ? anImage.id : null, point, aView !is null ? aView.id : null) !is null; 241 anImage !is null ? anImage.id_ : null, point, aView !is null ? aView.id_ : null) !is null;
242 } 242 }
243 243
244 public bool openFile_withApplication_ (NSString fullPath, NSString appName) 244 public bool openFile_withApplication_ (NSString fullPath, NSString appName)
245 { 245 {
246 return OS.objc_msgSend(this.id, OS.sel_openFile_1withApplication_1, fullPath !is null ? fullPath.id : null, 246 return OS.objc_msgSend(this.id_, OS.sel_openFile_1withApplication_1, fullPath !is null ? fullPath.id_ : null,
247 appName !is null ? appName.id : null) !is null; 247 appName !is null ? appName.id_ : null) !is null;
248 } 248 }
249 249
250 public bool openFile_withApplication_andDeactivate_ (NSString fullPath, NSString appName, bool flag) 250 public bool openFile_withApplication_andDeactivate_ (NSString fullPath, NSString appName, bool flag)
251 { 251 {
252 return OS.objc_msgSend(this.id, OS.sel_openFile_1withApplication_1andDeactivate_1, fullPath !is null ? fullPath.id : null, 252 return OS.objc_msgSend(this.id_, OS.sel_openFile_1withApplication_1andDeactivate_1, fullPath !is null ? fullPath.id_ : null,
253 appName !is null ? appName.id : null, flag) !is null; 253 appName !is null ? appName.id_ : null, flag) !is null;
254 } 254 }
255 255
256 public bool openTempFile (NSString fullPath) 256 public bool openTempFile (NSString fullPath)
257 { 257 {
258 return OS.objc_msgSend(this.id, OS.sel_openTempFile_1, fullPath !is null ? fullPath.id : null) !is null; 258 return OS.objc_msgSend(this.id_, OS.sel_openTempFile_1, fullPath !is null ? fullPath.id_ : null) !is null;
259 } 259 }
260 260
261 public bool openURL (NSURL url) 261 public bool openURL (NSURL url)
262 { 262 {
263 return OS.objc_msgSend(this.id, OS.sel_openURL_1, url !is null ? url.id : null) !is null; 263 return OS.objc_msgSend(this.id_, OS.sel_openURL_1, url !is null ? url.id_ : null) !is null;
264 } 264 }
265 265
266 public bool openURLs (NSArray urls, NSString bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor, 266 public bool openURLs (NSArray urls, NSString bundleIdentifier, NSWorkspaceLaunchOptions options, NSAppleEventDescriptor descriptor,
267 /*NSArray** */objc.id** identifiers) 267 /*NSArray** */objc.id** identifiers)
268 { 268 {
269 return OS.objc_msgSend(this.id, OS.sel_openURLs_1withAppBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifiers_1, 269 return OS.objc_msgSend(this.id_, OS.sel_openURLs_1withAppBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifiers_1,
270 urls !is null ? urls.id : null, bundleIdentifier !is null ? bundleIdentifier.id : null, options, 270 urls !is null ? urls.id_ : null, bundleIdentifier !is null ? bundleIdentifier.id_ : null, options,
271 descriptor !is null ? descriptor.id : null, identifiers) !is null; 271 descriptor !is null ? descriptor.id_ : null, identifiers) !is null;
272 } 272 }
273 273
274 public bool performFileOperation (NSString operation, NSString source, NSString destination, NSArray files, NSInteger* tag) 274 public bool performFileOperation (NSString operation, NSString source, NSString destination, NSArray files, NSInteger* tag)
275 { 275 {
276 return OS.objc_msgSend(this.id, OS.sel_performFileOperation_1source_1destination_1files_1tag_1, operation !is null ? operation.id : null, 276 return OS.objc_msgSend(this.id_, OS.sel_performFileOperation_1source_1destination_1files_1tag_1, operation !is null ? operation.id_ : null,
277 source !is null ? source.id : null, destination !is null ? destination.id : null, files !is null ? files.id : null, tag) !is null; 277 source !is null ? source.id_ : null, destination !is null ? destination.id_ : null, files !is null ? files.id_ : null, tag) !is null;
278 } 278 }
279 279
280 public NSString preferredFilenameExtensionForType (NSString typeName) 280 public NSString preferredFilenameExtensionForType (NSString typeName)
281 { 281 {
282 objc.id result = OS.objc_msgSend(this.id, OS.sel_preferredFilenameExtensionForType_1, typeName !is null ? typeName.id : null); 282 objc.id result = OS.objc_msgSend(this.id_, OS.sel_preferredFilenameExtensionForType_1, typeName !is null ? typeName.id_ : null);
283 return result !is null ? new NSString(result) : null; 283 return result !is null ? new NSString(result) : null;
284 } 284 }
285 285
286 public bool selectFile (NSString fullPath, NSString rootFullpath) 286 public bool selectFile (NSString fullPath, NSString rootFullpath)
287 { 287 {
288 return OS.objc_msgSend(this.id, OS.sel_selectFile_1inFileViewerRootedAtPath_1, fullPath !is null ? fullPath.id : null, 288 return OS.objc_msgSend(this.id_, OS.sel_selectFile_1inFileViewerRootedAtPath_1, fullPath !is null ? fullPath.id_ : null,
289 rootFullpath !is null ? rootFullpath.id : null) !is null; 289 rootFullpath !is null ? rootFullpath.id_ : null) !is null;
290 } 290 }
291 291
292 public bool setIcon (NSImage image, NSString fullPath, NSWorkspaceIconCreationOptions options) 292 public bool setIcon (NSImage image, NSString fullPath, NSWorkspaceIconCreationOptions options)
293 { 293 {
294 return OS.objc_msgSend(this.id, OS.sel_setIcon_1forFile_1options_1, image !is null ? image.id : null, fullPath !is null ? fullPath.id : null, 294 return OS.objc_msgSend(this.id_, OS.sel_setIcon_1forFile_1options_1, image !is null ? image.id_ : null, fullPath !is null ? fullPath.id_ : null,
295 options) !is null; 295 options) !is null;
296 } 296 }
297 297
298 public static NSWorkspace sharedWorkspace () 298 public static NSWorkspace sharedWorkspace ()
299 { 299 {
301 return result !is null ? new NSWorkspace(result) : null; 301 return result !is null ? new NSWorkspace(result) : null;
302 } 302 }
303 303
304 public void slideImage (NSImage image, NSPoint fromPoint, NSPoint toPoint) 304 public void slideImage (NSImage image, NSPoint fromPoint, NSPoint toPoint)
305 { 305 {
306 OS.objc_msgSend(this.id, OS.sel_slideImage_1from_1to_1, image !is null ? image.id : null, fromPoint, toPoint); 306 OS.objc_msgSend(this.id_, OS.sel_slideImage_1from_1to_1, image !is null ? image.id_ : null, fromPoint, toPoint);
307 } 307 }
308 308
309 public bool type (NSString firstTypeName, NSString secondTypeName) 309 public bool type (NSString firstTypeName, NSString secondTypeName)
310 { 310 {
311 return OS.objc_msgSend(this.id, OS.sel_type_1conformsToType_1, firstTypeName !is null ? firstTypeName.id : null, 311 return OS.objc_msgSend(this.id_, OS.sel_type_1conformsToType_1, firstTypeName !is null ? firstTypeName.id_ : null,
312 secondTypeName !is null ? secondTypeName.id : null) !is null; 312 secondTypeName !is null ? secondTypeName.id_ : null) !is null;
313 } 313 }
314 314
315 public NSString typeOfFile (NSString absoluteFilePath, /*NSError** */objc.id** outError) 315 public NSString typeOfFile (NSString absoluteFilePath, /*NSError** */objc.id** outError)
316 { 316 {
317 objc.id result = OS.objc_msgSend(this.id, OS.sel_typeOfFile_1error_1, absoluteFilePath !is null ? absoluteFilePath.id : null, outError); 317 objc.id result = OS.objc_msgSend(this.id_, OS.sel_typeOfFile_1error_1, absoluteFilePath !is null ? absoluteFilePath.id_ : null, outError);
318 return result !is null ? new NSString(result) : null; 318 return result !is null ? new NSString(result) : null;
319 } 319 }
320 320
321 public bool unmountAndEjectDeviceAtPath (NSString path) 321 public bool unmountAndEjectDeviceAtPath (NSString path)
322 { 322 {
323 return OS.objc_msgSend(this.id, OS.sel_unmountAndEjectDeviceAtPath_1, path !is null ? path.id : null) !is null; 323 return OS.objc_msgSend(this.id_, OS.sel_unmountAndEjectDeviceAtPath_1, path !is null ? path.id_ : null) !is null;
324 } 324 }
325 325
326 public bool userDefaultsChanged () 326 public bool userDefaultsChanged ()
327 { 327 {
328 return OS.objc_msgSend(this.id, OS.sel_userDefaultsChanged) !is null; 328 return OS.objc_msgSend(this.id_, OS.sel_userDefaultsChanged) !is null;
329 } 329 }
330 330
331 } 331 }