Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSPointerArray.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.NSPointerArray; | 14 module dwt.internal.cocoa.NSPointerArray; |
15 | 15 |
16 import dwt.internal.cocoa.id; | |
16 import dwt.internal.cocoa.NSArray; | 17 import dwt.internal.cocoa.NSArray; |
17 import dwt.internal.cocoa.NSInteger; | 18 import dwt.internal.cocoa.NSInteger; |
18 import dwt.internal.cocoa.NSObject; | 19 import dwt.internal.cocoa.NSObject; |
19 import dwt.internal.cocoa.NSPointerFunctions; | 20 import dwt.internal.cocoa.NSPointerFunctions; |
20 import dwt.internal.cocoa.OS; | 21 import dwt.internal.cocoa.OS; |
33 super(id); | 34 super(id); |
34 } | 35 } |
35 | 36 |
36 public void addPointer (void* pointer) | 37 public void addPointer (void* pointer) |
37 { | 38 { |
38 OS.objc_msgSend(this.id, OS.sel_addPointer_1, pointer); | 39 OS.objc_msgSend(this.id_, OS.sel_addPointer_1, pointer); |
39 } | 40 } |
40 | 41 |
41 public NSArray allObjects () | 42 public NSArray allObjects () |
42 { | 43 { |
43 objc.id result = OS.objc_msgSend(this.id, OS.sel_allObjects); | 44 objc.id result = OS.objc_msgSend(this.id_, OS.sel_allObjects); |
44 return result !is null ? new NSArray(result) : null; | 45 return result !is null ? new NSArray(result) : null; |
45 } | 46 } |
46 | 47 |
47 public void compact () | 48 public void compact () |
48 { | 49 { |
49 OS.objc_msgSend(this.id, OS.sel_compact); | 50 OS.objc_msgSend(this.id_, OS.sel_compact); |
50 } | 51 } |
51 | 52 |
52 public NSUInteger count () | 53 public NSUInteger count () |
53 { | 54 { |
54 return OS.objc_msgSend(this.id, OS.sel_count); | 55 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_count); |
55 } | 56 } |
56 | 57 |
57 public NSPointerArray initWithOptions (NSPointerFunctionsOptions options) | 58 public NSPointerArray initWithOptions (NSPointerFunctionsOptions options) |
58 { | 59 { |
59 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithOptions_1, options); | 60 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithOptions_1, options); |
60 return result !is null ? this : null; | 61 return result !is null ? this : null; |
61 } | 62 } |
62 | 63 |
63 public id initWithPointerFunctions (NSPointerFunctions functions) | 64 public id initWithPointerFunctions (NSPointerFunctions functions) |
64 { | 65 { |
65 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithPointerFunctions_1, functions !is null ? functions.id : null); | 66 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithPointerFunctions_1, functions !is null ? functions.id_ : null); |
66 return result !is null ? new id(result) : null; | 67 return result !is null ? new id(result) : null; |
67 } | 68 } |
68 | 69 |
69 public void insertPointer (void* item, NSUInteger index) | 70 public void insertPointer (void* item, NSUInteger index) |
70 { | 71 { |
71 OS.objc_msgSend(this.id, OS.sel_insertPointer_1atIndex_1, item, index); | 72 OS.objc_msgSend(this.id_, OS.sel_insertPointer_1atIndex_1, item, index); |
72 } | 73 } |
73 | 74 |
74 public static id pointerArrayWithOptions (NSPointerFunctionsOptions options) | 75 public static id pointerArrayWithOptions (NSPointerFunctionsOptions options) |
75 { | 76 { |
76 objc.id result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithOptions_1, options); | 77 objc.id result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithOptions_1, options); |
78 } | 79 } |
79 | 80 |
80 public static id pointerArrayWithPointerFunctions (NSPointerFunctions functions) | 81 public static id pointerArrayWithPointerFunctions (NSPointerFunctions functions) |
81 { | 82 { |
82 objc.id | 83 objc.id |
83 result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithPointerFunctions_1, functions !is null ? functions.id : null); | 84 result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithPointerFunctions_1, functions !is null ? functions.id_ : null); |
84 return result !is null ? new id(result) : null; | 85 return result !is null ? new id(result) : null; |
85 } | 86 } |
86 | 87 |
87 public static id pointerArrayWithStrongObjects () | 88 public static id pointerArrayWithStrongObjects () |
88 { | 89 { |
96 return result !is null ? new id(result) : null; | 97 return result !is null ? new id(result) : null; |
97 } | 98 } |
98 | 99 |
99 public void* pointerAtIndex (NSUInteger index) | 100 public void* pointerAtIndex (NSUInteger index) |
100 { | 101 { |
101 return cast(void*) OS.objc_msgSend(this.id, OS.sel_pointerAtIndex_1, index); | 102 return cast(void*) OS.objc_msgSend(this.id_, OS.sel_pointerAtIndex_1, index); |
102 } | 103 } |
103 | 104 |
104 public NSPointerFunctions pointerFunctions () | 105 public NSPointerFunctions pointerFunctions () |
105 { | 106 { |
106 objc.id result = OS.objc_msgSend(this.id, OS.sel_pointerFunctions); | 107 objc.id result = OS.objc_msgSend(this.id_, OS.sel_pointerFunctions); |
107 return result !is null ? new NSPointerFunctions(result) : null; | 108 return result !is null ? new NSPointerFunctions(result) : null; |
108 } | 109 } |
109 | 110 |
110 public void removePointerAtIndex (NSUInteger index) | 111 public void removePointerAtIndex (NSUInteger index) |
111 { | 112 { |
112 OS.objc_msgSend(this.id, OS.sel_removePointerAtIndex_1, index); | 113 OS.objc_msgSend(this.id_, OS.sel_removePointerAtIndex_1, index); |
113 } | 114 } |
114 | 115 |
115 public void replacePointerAtIndex (NSUInteger index, void* item) | 116 public void replacePointerAtIndex (NSUInteger index, void* item) |
116 { | 117 { |
117 OS.objc_msgSend(this.id, OS.sel_replacePointerAtIndex_1withPointer_1, index, item); | 118 OS.objc_msgSend(this.id_, OS.sel_replacePointerAtIndex_1withPointer_1, index, item); |
118 } | 119 } |
119 | 120 |
120 public void setCount (NSUInteger count) | 121 public void setCount (NSUInteger count) |
121 { | 122 { |
122 OS.objc_msgSend(this.id, OS.sel_setCount_1, count); | 123 OS.objc_msgSend(this.id_, OS.sel_setCount_1, count); |
123 } | 124 } |
124 | 125 |
125 } | 126 } |