Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSSet.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 |
---|---|
37 super(id); | 37 super(id); |
38 } | 38 } |
39 | 39 |
40 public void addObserver (NSObject observer, NSString keyPath, NSKeyValueObservingOptions options, void* context) | 40 public void addObserver (NSObject observer, NSString keyPath, NSKeyValueObservingOptions options, void* context) |
41 { | 41 { |
42 OS.objc_msgSend(this.id, OS.sel_addObserver_1forKeyPath_1options_1context_1, observer !is null ? observer.id : null, | 42 OS.objc_msgSend(this.id_, OS.sel_addObserver_1forKeyPath_1options_1context_1, observer !is null ? observer.id_ : null, |
43 keyPath !is null ? keyPath.id : null, options, context); | 43 keyPath !is null ? keyPath.id_ : null, options, context); |
44 } | 44 } |
45 | 45 |
46 public NSArray allObjects () | 46 public NSArray allObjects () |
47 { | 47 { |
48 objc.id result = OS.objc_msgSend(this.id, OS.sel_allObjects); | 48 objc.id result = OS.objc_msgSend(this.id_, OS.sel_allObjects); |
49 return result !is null ? new NSArray(result) : null; | 49 return result !is null ? new NSArray(result) : null; |
50 } | 50 } |
51 | 51 |
52 public id anyObject () | 52 public id anyObject () |
53 { | 53 { |
54 objc.id result = OS.objc_msgSend(this.id, OS.sel_anyObject); | 54 objc.id result = OS.objc_msgSend(this.id_, OS.sel_anyObject); |
55 return result !is null ? new id(result) : null; | 55 return result !is null ? new id(result) : null; |
56 } | 56 } |
57 | 57 |
58 public bool containsObject (id anObject) | 58 public bool containsObject (id anObject) |
59 { | 59 { |
60 return OS.objc_msgSend(this.id, OS.sel_containsObject_1, anObject !is null ? anObject.id : null) !is null; | 60 return OS.objc_msgSend(this.id_, OS.sel_containsObject_1, anObject !is null ? anObject.id_ : null) !is null; |
61 } | 61 } |
62 | 62 |
63 public NSUInteger count () | 63 public NSUInteger count () |
64 { | 64 { |
65 return OS.objc_msgSend(this.id, OS.sel_count); | 65 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_count); |
66 } | 66 } |
67 | 67 |
68 public NSString description () | 68 public NSString description () |
69 { | 69 { |
70 objc.id result = OS.objc_msgSend(this.id, OS.sel_description); | 70 objc.id result = OS.objc_msgSend(this.id_, OS.sel_description); |
71 return result !is null ? new NSString(result) : null; | 71 return result !is null ? new NSString(result) : null; |
72 } | 72 } |
73 | 73 |
74 public NSString descriptionWithLocale (id locale) | 74 public NSString descriptionWithLocale (id locale) |
75 { | 75 { |
76 objc.id result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id : null); | 76 objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptionWithLocale_1, locale !is null ? locale.id_ : null); |
77 return result !is null ? new NSString(result) : null; | 77 return result !is null ? new NSString(result) : null; |
78 } | 78 } |
79 | 79 |
80 public NSSet filteredSetUsingPredicate (NSPredicate predicate) | 80 public NSSet filteredSetUsingPredicate (NSPredicate predicate) |
81 { | 81 { |
82 objc.id result = OS.objc_msgSend(this.id, OS.sel_filteredSetUsingPredicate_1, predicate !is null ? predicate.id : null); | 82 objc.id result = OS.objc_msgSend(this.id_, OS.sel_filteredSetUsingPredicate_1, predicate !is null ? predicate.id_ : null); |
83 return result is this.id ? this : (result !is null ? new NSSet(result) : null); | 83 return result is this.id_ ? this : (result !is null ? new NSSet(result) : null); |
84 } | 84 } |
85 | 85 |
86 public NSSet initWithArray (NSArray array) | 86 public NSSet initWithArray (NSArray array) |
87 { | 87 { |
88 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithArray_1, array !is null ? array.id : null); | 88 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithArray_1, array !is null ? array.id_ : null); |
89 return result !is null ? this : null; | 89 return result !is null ? this : null; |
90 } | 90 } |
91 | 91 |
92 public NSSet initWithObjects_ (id initWithObjects) | 92 public NSSet initWithObjects_ (id initWithObjects) |
93 { | 93 { |
94 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1, initWithObjects !is null ? initWithObjects.id : null); | 94 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithObjects_1, initWithObjects !is null ? initWithObjects.id_ : null); |
95 return result !is null ? this : null; | 95 return result !is null ? this : null; |
96 } | 96 } |
97 | 97 |
98 public NSSet initWithObjects_count_ (objc.id* objects, NSUInteger cnt) | 98 public NSSet initWithObjects_count_ (objc.id* objects, NSUInteger cnt) |
99 { | 99 { |
100 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1count_1, objects, cnt); | 100 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithObjects_1count_1, objects, cnt); |
101 return result !is null ? this : null; | 101 return result !is null ? this : null; |
102 } | 102 } |
103 | 103 |
104 public NSSet initWithSet_ (NSSet set) | 104 public NSSet initWithSet_ (NSSet set) |
105 { | 105 { |
106 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithSet_1, set !is null ? set.id : null); | 106 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithSet_1, set !is null ? set.id_ : null); |
107 return result !is null ? this : null; | 107 return result !is null ? this : null; |
108 } | 108 } |
109 | 109 |
110 public NSSet initWithSet_copyItems_ (NSSet set, bool flag) | 110 public NSSet initWithSet_copyItems_ (NSSet set, bool flag) |
111 { | 111 { |
112 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithSet_1copyItems_1, set !is null ? set.id : null, flag); | 112 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithSet_1copyItems_1, set !is null ? set.id_ : null, flag); |
113 return result !is null ? this : null; | 113 return result !is null ? this : null; |
114 } | 114 } |
115 | 115 |
116 public bool intersectsSet (NSSet otherSet) | 116 public bool intersectsSet (NSSet otherSet) |
117 { | 117 { |
118 return OS.objc_msgSend(this.id, OS.sel_intersectsSet_1, otherSet !is null ? otherSet.id : null) !is null; | 118 return OS.objc_msgSend(this.id_, OS.sel_intersectsSet_1, otherSet !is null ? otherSet.id_ : null) !is null; |
119 } | 119 } |
120 | 120 |
121 public bool isEqualToSet (NSSet otherSet) | 121 public bool isEqualToSet (NSSet otherSet) |
122 { | 122 { |
123 return OS.objc_msgSend(this.id, OS.sel_isEqualToSet_1, otherSet !is null ? otherSet.id : null) !is null; | 123 return OS.objc_msgSend(this.id_, OS.sel_isEqualToSet_1, otherSet !is null ? otherSet.id_ : null) !is null; |
124 } | 124 } |
125 | 125 |
126 public bool isSubsetOfSet (NSSet otherSet) | 126 public bool isSubsetOfSet (NSSet otherSet) |
127 { | 127 { |
128 return OS.objc_msgSend(this.id, OS.sel_isSubsetOfSet_1, otherSet !is null ? otherSet.id : null) !is null; | 128 return OS.objc_msgSend(this.id_, OS.sel_isSubsetOfSet_1, otherSet !is null ? otherSet.id_ : null) !is null; |
129 } | 129 } |
130 | 130 |
131 public void makeObjectsPerformSelector_ (objc.SEL aSelector) | 131 public void makeObjectsPerformSelector_ (objc.SEL aSelector) |
132 { | 132 { |
133 OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1, aSelector); | 133 OS.objc_msgSend(this.id_, OS.sel_makeObjectsPerformSelector_1, aSelector); |
134 } | 134 } |
135 | 135 |
136 public void makeObjectsPerformSelector_withObject_ (objc.SEL aSelector, id argument) | 136 public void makeObjectsPerformSelector_withObject_ (objc.SEL aSelector, id argument) |
137 { | 137 { |
138 OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1withObject_1, aSelector, argument !is null ? argument.id : null); | 138 OS.objc_msgSend(this.id_, OS.sel_makeObjectsPerformSelector_1withObject_1, aSelector, argument !is null ? argument.id_ : null); |
139 } | 139 } |
140 | 140 |
141 public id member (id object) | 141 public id member (id object) |
142 { | 142 { |
143 objc.id result = OS.objc_msgSend(this.id, OS.sel_member_1, object !is null ? object.id : null); | 143 objc.id result = OS.objc_msgSend(this.id_, OS.sel_member_1, object !is null ? object.id_ : null); |
144 return result !is null ? new id(result) : null; | 144 return result !is null ? new id(result) : null; |
145 } | 145 } |
146 | 146 |
147 public NSEnumerator objectEnumerator () | 147 public NSEnumerator objectEnumerator () |
148 { | 148 { |
149 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator); | 149 objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectEnumerator); |
150 return result !is null ? new NSEnumerator(result) : null; | 150 return result !is null ? new NSEnumerator(result) : null; |
151 } | 151 } |
152 | 152 |
153 public void removeObserver (NSObject observer, NSString keyPath) | 153 public void removeObserver (NSObject observer, NSString keyPath) |
154 { | 154 { |
155 OS.objc_msgSend(this.id, OS.sel_removeObserver_1forKeyPath_1, observer !is null ? observer.id : null, keyPath !is null ? keyPath.id : null); | 155 OS.objc_msgSend(this.id_, OS.sel_removeObserver_1forKeyPath_1, observer !is null ? observer.id_ : null, keyPath !is null ? keyPath.id_ : null); |
156 } | 156 } |
157 | 157 |
158 public static id set () | 158 public static id set () |
159 { | 159 { |
160 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_set); | 160 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_set); |
161 return result !is null ? new id(result) : null; | 161 return result !is null ? new id(result) : null; |
162 } | 162 } |
163 | 163 |
164 public NSSet setByAddingObject (id anObject) | 164 public NSSet setByAddingObject (id anObject) |
165 { | 165 { |
166 objc.id result = OS.objc_msgSend(this.id, OS.sel_setByAddingObject_1, anObject !is null ? anObject.id : null); | 166 objc.id result = OS.objc_msgSend(this.id_, OS.sel_setByAddingObject_1, anObject !is null ? anObject.id_ : null); |
167 return result is this.id ? this : (result !is null ? new NSSet(result) : null); | 167 return result is this.id_ ? this : (result !is null ? new NSSet(result) : null); |
168 } | 168 } |
169 | 169 |
170 public NSSet setByAddingObjectsFromArray (NSArray other) | 170 public NSSet setByAddingObjectsFromArray (NSArray other) |
171 { | 171 { |
172 objc.id result = OS.objc_msgSend(this.id, OS.sel_setByAddingObjectsFromArray_1, other !is null ? other.id : null); | 172 objc.id result = OS.objc_msgSend(this.id_, OS.sel_setByAddingObjectsFromArray_1, other !is null ? other.id_ : null); |
173 return result is this.id ? this : (result !is null ? new NSSet(result) : null); | 173 return result is this.id_ ? this : (result !is null ? new NSSet(result) : null); |
174 } | 174 } |
175 | 175 |
176 public NSSet setByAddingObjectsFromSet (NSSet other) | 176 public NSSet setByAddingObjectsFromSet (NSSet other) |
177 { | 177 { |
178 objc.id result = OS.objc_msgSend(this.id, OS.sel_setByAddingObjectsFromSet_1, other !is null ? other.id : null); | 178 objc.id result = OS.objc_msgSend(this.id_, OS.sel_setByAddingObjectsFromSet_1, other !is null ? other.id_ : null); |
179 return result is this.id ? this : (result !is null ? new NSSet(result) : null); | 179 return result is this.id_ ? this : (result !is null ? new NSSet(result) : null); |
180 } | 180 } |
181 | 181 |
182 public void setValue (id value, NSString key) | 182 public void setValue (id value, NSString key) |
183 { | 183 { |
184 OS.objc_msgSend(this.id, OS.sel_setValue_1forKey_1, value !is null ? value.id : null, key !is null ? key.id : null); | 184 OS.objc_msgSend(this.id_, OS.sel_setValue_1forKey_1, value !is null ? value.id_ : null, key !is null ? key.id_ : null); |
185 } | 185 } |
186 | 186 |
187 public static id setWithArray (NSArray array) | 187 public static id setWithArray (NSArray array) |
188 { | 188 { |
189 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithArray_1, array !is null ? array.id : null); | 189 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithArray_1, array !is null ? array.id_ : null); |
190 return result !is null ? new id(result) : null; | 190 return result !is null ? new id(result) : null; |
191 } | 191 } |
192 | 192 |
193 public static id setWithObject (id object) | 193 public static id setWithObject (id object) |
194 { | 194 { |
195 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithObject_1, object !is null ? object.id : null); | 195 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithObject_1, object !is null ? object.id_ : null); |
196 return result !is null ? new id(result) : null; | 196 return result !is null ? new id(result) : null; |
197 } | 197 } |
198 | 198 |
199 public static id static_setWithObjects_ (id setWithObjects) | 199 public static id static_setWithObjects_ (id setWithObjects) |
200 { | 200 { |
201 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithObjects_1, setWithObjects !is null ? setWithObjects.id : null); | 201 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithObjects_1, setWithObjects !is null ? setWithObjects.id_ : null); |
202 return result !is null ? new id(result) : null; | 202 return result !is null ? new id(result) : null; |
203 } | 203 } |
204 | 204 |
205 public static id static_setWithObjects_count_ (objc.id* objects, NSUInteger cnt) | 205 public static id static_setWithObjects_count_ (objc.id* objects, NSUInteger cnt) |
206 { | 206 { |
208 return result !is null ? new id(result) : null; | 208 return result !is null ? new id(result) : null; |
209 } | 209 } |
210 | 210 |
211 public static id setWithSet (NSSet set) | 211 public static id setWithSet (NSSet set) |
212 { | 212 { |
213 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithSet_1, set !is null ? set.id : null); | 213 objc.id result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithSet_1, set !is null ? set.id_ : null); |
214 return result !is null ? new id(result) : null; | 214 return result !is null ? new id(result) : null; |
215 } | 215 } |
216 | 216 |
217 public id valueForKey (NSString key) | 217 public id valueForKey (NSString key) |
218 { | 218 { |
219 objc.id result = OS.objc_msgSend(this.id, OS.sel_valueForKey_1, key !is null ? key.id : null); | 219 objc.id result = OS.objc_msgSend(this.id_, OS.sel_valueForKey_1, key !is null ? key.id_ : null); |
220 return result !is null ? new id(result) : null; | 220 return result !is null ? new id(result) : null; |
221 } | 221 } |
222 | 222 |
223 } | 223 } |