Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSOperationQueue.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 |
---|---|
11 * Port to the D Programming language: | 11 * Port to the D Programming language: |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | 12 * Jacob Carlborg <jacob.carlborg@gmail.com> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 module dwt.internal.cocoa.NSOperationQueue; | 14 module dwt.internal.cocoa.NSOperationQueue; |
15 | 15 |
16 import dwt.internal.cocoa.NSArray; | |
16 import dwt.internal.cocoa.NSInteger; | 17 import dwt.internal.cocoa.NSInteger; |
17 import dwt.internal.cocoa.NSObject; | 18 import dwt.internal.cocoa.NSObject; |
19 import dwt.internal.cocoa.NSOperation; | |
18 import dwt.internal.cocoa.OS; | 20 import dwt.internal.cocoa.OS; |
19 import objc = dwt.internal.objc.runtime; | 21 import objc = dwt.internal.objc.runtime; |
20 | 22 |
21 public class NSOperationQueue : NSObject | 23 public class NSOperationQueue : NSObject |
22 { | 24 { |
31 super(id); | 33 super(id); |
32 } | 34 } |
33 | 35 |
34 public void addOperation (NSOperation op) | 36 public void addOperation (NSOperation op) |
35 { | 37 { |
36 OS.objc_msgSend(this.id, OS.sel_addOperation_1, op !is null ? op.id : null); | 38 OS.objc_msgSend(this.id_, OS.sel_addOperation_1, op !is null ? op.id_ : null); |
37 } | 39 } |
38 | 40 |
39 public void cancelAllOperations () | 41 public void cancelAllOperations () |
40 { | 42 { |
41 OS.objc_msgSend(this.id, OS.sel_cancelAllOperations); | 43 OS.objc_msgSend(this.id_, OS.sel_cancelAllOperations); |
42 } | 44 } |
43 | 45 |
44 public bool isSuspended () | 46 public bool isSuspended () |
45 { | 47 { |
46 return OS.objc_msgSend(this.id, OS.sel_isSuspended) !is null; | 48 return OS.objc_msgSend(this.id_, OS.sel_isSuspended) !is null; |
47 } | 49 } |
48 | 50 |
49 public NSInteger maxConcurrentOperationCount () | 51 public NSInteger maxConcurrentOperationCount () |
50 { | 52 { |
51 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_maxConcurrentOperationCount); | 53 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_maxConcurrentOperationCount); |
52 } | 54 } |
53 | 55 |
54 public NSArray operations () | 56 public NSArray operations () |
55 { | 57 { |
56 objc.id result = OS.objc_msgSend(this.id, OS.sel_operations); | 58 objc.id result = OS.objc_msgSend(this.id_, OS.sel_operations); |
57 return result !is null ? new NSArray(result) : null; | 59 return result !is null ? new NSArray(result) : null; |
58 } | 60 } |
59 | 61 |
60 public void setMaxConcurrentOperationCount (NSInteger cnt) | 62 public void setMaxConcurrentOperationCount (NSInteger cnt) |
61 { | 63 { |
62 OS.objc_msgSend(this.id, OS.sel_setMaxConcurrentOperationCount_1, cnt); | 64 OS.objc_msgSend(this.id_, OS.sel_setMaxConcurrentOperationCount_1, cnt); |
63 } | 65 } |
64 | 66 |
65 public void setSuspended (bool b) | 67 public void setSuspended (bool b) |
66 { | 68 { |
67 OS.objc_msgSend(this.id, OS.sel_setSuspended_1, b); | 69 OS.objc_msgSend(this.id_, OS.sel_setSuspended_1, b); |
68 } | 70 } |
69 | 71 |
70 public void waitUntilAllOperationsAreFinished () | 72 public void waitUntilAllOperationsAreFinished () |
71 { | 73 { |
72 OS.objc_msgSend(this.id, OS.sel_waitUntilAllOperationsAreFinished); | 74 OS.objc_msgSend(this.id_, OS.sel_waitUntilAllOperationsAreFinished); |
73 } | 75 } |
74 | 76 |
75 } | 77 } |