Mercurial > projects > dstep
annotate dstep/foundation/NSIndexSet.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 | 89f3c3ef1fd2 |
children | b9de51448c6b |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSIndexSet; | |
8 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
9 import dstep.foundation.NSCoder; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
10 import dstep.foundation.NSObjCRuntime; |
14 | 11 import dstep.foundation.NSObject; |
12 import dstep.foundation.NSRange; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.foundation.NSZone; |
14 | 14 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
15 import dstep.objc.objc; |
14 | 16 |
17 class NSMutableIndexSet : NSIndexSet | |
18 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
19 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
20 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
21 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
22 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
23 typeof(this).alloc.init; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
24 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
25 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
26 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
27 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
28 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
29 } |
14 | 30 |
31 void addIndexes (NSIndexSet indexSet) | |
32 { | |
33 return invokeObjcSelf!(void, "addIndexes:", NSIndexSet)(indexSet); | |
34 } | |
35 | |
36 void removeIndexes (NSIndexSet indexSet) | |
37 { | |
38 return invokeObjcSelf!(void, "removeIndexes:", NSIndexSet)(indexSet); | |
39 } | |
40 | |
41 void removeAllIndexes () | |
42 { | |
43 return invokeObjcSelf!(void, "removeAllIndexes"); | |
44 } | |
45 | |
46 void addIndex (NSUInteger value) | |
47 { | |
48 return invokeObjcSelf!(void, "addIndex:", NSUInteger)(value); | |
49 } | |
50 | |
51 void removeIndex (NSUInteger value) | |
52 { | |
53 return invokeObjcSelf!(void, "removeIndex:", NSUInteger)(value); | |
54 } | |
55 | |
56 void addIndexesInRange (NSRange range) | |
57 { | |
58 return invokeObjcSelf!(void, "addIndexesInRange:", NSRange)(range); | |
59 } | |
60 | |
61 void removeIndexesInRange (NSRange range) | |
62 { | |
63 return invokeObjcSelf!(void, "removeIndexesInRange:", NSRange)(range); | |
64 } | |
65 | |
66 void shiftIndexesStartingAtIndex (NSUInteger index, NSInteger delta) | |
67 { | |
68 return invokeObjcSelf!(void, "shiftIndexesStartingAtIndex:by:", NSUInteger, NSInteger)(index, delta); | |
69 } | |
70 } | |
71 | |
72 class NSIndexSet : NSObject, INSCopying, INSMutableCopying, INSCoding | |
73 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
74 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
75 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
76 this () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
77 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
78 typeof(this).alloc.init; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
79 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
80 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
81 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
82 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
83 return invokeObjcSelf!(typeof(this), "init"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
84 } |
14 | 85 |
86 static Object indexSet () | |
87 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
88 return invokeObjcSuperClass!(Object, "indexSet"); |
14 | 89 } |
90 | |
91 static Object indexSetWithIndex (NSUInteger value) | |
92 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
93 return invokeObjcSuperClass!(Object, "indexSetWithIndex:", NSUInteger)(value); |
14 | 94 } |
95 | |
96 static Object indexSetWithIndexesInRange (NSRange range) | |
97 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
98 return invokeObjcSuperClass!(Object, "indexSetWithIndexesInRange:", NSRange)(range); |
14 | 99 } |
100 | |
101 Object initWithIndex (NSUInteger value) | |
102 { | |
103 return invokeObjcSelf!(Object, "initWithIndex:", NSUInteger)(value); | |
104 } | |
105 | |
106 this (NSUInteger value) | |
107 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
108 typeof(this).alloc.initWithIndex(value); |
14 | 109 } |
110 | |
111 Object initWithIndexesInRange (NSRange range) | |
112 { | |
113 return invokeObjcSelf!(Object, "initWithIndexesInRange:", NSRange)(range); | |
114 } | |
115 | |
116 this (NSRange range) | |
117 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
118 typeof(this).alloc.initWithIndexesInRange(range); |
14 | 119 } |
120 | |
121 Object initWithIndexSet (NSIndexSet indexSet) | |
122 { | |
123 return invokeObjcSelf!(Object, "initWithIndexSet:", NSIndexSet)(indexSet); | |
124 } | |
125 | |
126 this (NSIndexSet indexSet) | |
127 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
128 typeof(this).alloc.initWithIndexSet(indexSet); |
14 | 129 } |
130 | |
131 bool isEqualToIndexSet (NSIndexSet indexSet) | |
132 { | |
133 return invokeObjcSelf!(bool, "isEqualToIndexSet:", NSIndexSet)(indexSet); | |
134 } | |
135 | |
136 NSUInteger count () | |
137 { | |
138 return invokeObjcSelf!(NSUInteger, "count"); | |
139 } | |
140 | |
141 NSUInteger firstIndex () | |
142 { | |
143 return invokeObjcSelf!(NSUInteger, "firstIndex"); | |
144 } | |
145 | |
146 NSUInteger lastIndex () | |
147 { | |
148 return invokeObjcSelf!(NSUInteger, "lastIndex"); | |
149 } | |
150 | |
151 NSUInteger indexGreaterThanIndex (NSUInteger value) | |
152 { | |
153 return invokeObjcSelf!(NSUInteger, "indexGreaterThanIndex:", NSUInteger)(value); | |
154 } | |
155 | |
156 NSUInteger indexLessThanIndex (NSUInteger value) | |
157 { | |
158 return invokeObjcSelf!(NSUInteger, "indexLessThanIndex:", NSUInteger)(value); | |
159 } | |
160 | |
161 NSUInteger indexGreaterThanOrEqualToIndex (NSUInteger value) | |
162 { | |
163 return invokeObjcSelf!(NSUInteger, "indexGreaterThanOrEqualToIndex:", NSUInteger)(value); | |
164 } | |
165 | |
166 NSUInteger indexLessThanOrEqualToIndex (NSUInteger value) | |
167 { | |
168 return invokeObjcSelf!(NSUInteger, "indexLessThanOrEqualToIndex:", NSUInteger)(value); | |
169 } | |
170 | |
171 NSUInteger getIndexes (NSUInteger* indexBuffer, NSUInteger bufferSize, NSRangePointer range) | |
172 { | |
173 return invokeObjcSelf!(NSUInteger, "getIndexes:maxCount:inIndexRange:", NSUInteger*, NSUInteger, NSRangePointer)(indexBuffer, bufferSize, range); | |
174 } | |
175 | |
176 NSUInteger countOfIndexesInRange (NSRange range) | |
177 { | |
178 return invokeObjcSelf!(NSUInteger, "countOfIndexesInRange:", NSRange)(range); | |
179 } | |
180 | |
181 bool containsIndex (NSUInteger value) | |
182 { | |
183 return invokeObjcSelf!(bool, "containsIndex:", NSUInteger)(value); | |
184 } | |
185 | |
186 bool containsIndexesInRange (NSRange range) | |
187 { | |
188 return invokeObjcSelf!(bool, "containsIndexesInRange:", NSRange)(range); | |
189 } | |
190 | |
191 bool containsIndexes (NSIndexSet indexSet) | |
192 { | |
193 return invokeObjcSelf!(bool, "containsIndexes:", NSIndexSet)(indexSet); | |
194 } | |
195 | |
196 bool intersectsIndexesInRange (NSRange range) | |
197 { | |
198 return invokeObjcSelf!(bool, "intersectsIndexesInRange:", NSRange)(range); | |
199 } | |
200 | |
201 Object copyWithZone (NSZone* zone) | |
202 { | |
203 return invokeObjcSelf!(Object, "copyWithZone:", NSZone*)(zone); | |
204 } | |
205 | |
206 Object mutableCopyWithZone (NSZone* zone) | |
207 { | |
208 return invokeObjcSelf!(Object, "mutableCopyWithZone:", NSZone*)(zone); | |
209 } | |
210 | |
211 void encodeWithCoder (NSCoder aCoder) | |
212 { | |
213 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
214 } | |
215 | |
216 Object initWithCoder (NSCoder aDecoder) | |
217 { | |
218 return invokeObjcSelf!(Object, "initWithCoder:", NSCoder)(aDecoder); | |
219 } | |
220 | |
221 this (NSCoder aDecoder) | |
222 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
223 typeof(this).alloc.initWithCoder(aDecoder); |
14 | 224 } |
225 } | |
226 |