Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSMutableArray.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 |
---|---|
35 super(id); | 35 super(id); |
36 } | 36 } |
37 | 37 |
38 public void addObject (id anObject) | 38 public void addObject (id anObject) |
39 { | 39 { |
40 OS.objc_msgSend(this.id, OS.sel_addObject_1, anObject !is null ? anObject.id : null); | 40 OS.objc_msgSend(this.id_, OS.sel_addObject_1, anObject !is null ? anObject.id_ : null); |
41 } | 41 } |
42 | 42 |
43 public void addObjectsFromArray (NSArray otherArray) | 43 public void addObjectsFromArray (NSArray otherArray) |
44 { | 44 { |
45 OS.objc_msgSend(this.id, OS.sel_addObjectsFromArray_1, otherArray !is null ? otherArray.id : null); | 45 OS.objc_msgSend(this.id_, OS.sel_addObjectsFromArray_1, otherArray !is null ? otherArray.id_ : null); |
46 } | 46 } |
47 | 47 |
48 public static id arrayWithCapacity (NSUInteger numItems) | 48 public static id arrayWithCapacity (NSUInteger numItems) |
49 { | 49 { |
50 objc.id result = OS.objc_msgSend(OS.class_NSMutableArray, OS.sel_arrayWithCapacity_1, numItems); | 50 objc.id result = OS.objc_msgSend(OS.class_NSMutableArray, OS.sel_arrayWithCapacity_1, numItems); |
51 return result !is null ? new id(result) : null; | 51 return result !is null ? new id(result) : null; |
52 } | 52 } |
53 | 53 |
54 public void exchangeObjectAtIndex (NSUInteger idx1, NSUInteger idx2) | 54 public void exchangeObjectAtIndex (NSUInteger idx1, NSUInteger idx2) |
55 { | 55 { |
56 OS.objc_msgSend(this.id, OS.sel_exchangeObjectAtIndex_1withObjectAtIndex_1, idx1, idx2); | 56 OS.objc_msgSend(this.id_, OS.sel_exchangeObjectAtIndex_1withObjectAtIndex_1, idx1, idx2); |
57 } | 57 } |
58 | 58 |
59 public void filterUsingPredicate (NSPredicate predicate) | 59 public void filterUsingPredicate (NSPredicate predicate) |
60 { | 60 { |
61 OS.objc_msgSend(this.id, OS.sel_filterUsingPredicate_1, predicate !is null ? predicate.id : null); | 61 OS.objc_msgSend(this.id_, OS.sel_filterUsingPredicate_1, predicate !is null ? predicate.id_ : null); |
62 } | 62 } |
63 | 63 |
64 public NSMutableArray initWithCapacity (NSUInteger numItems) | 64 public NSMutableArray initWithCapacity (NSUInteger numItems) |
65 { | 65 { |
66 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, numItems); | 66 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithCapacity_1, numItems); |
67 return result !is null ? this : null; | 67 return result !is null ? this : null; |
68 } | 68 } |
69 | 69 |
70 public void insertObject (id anObject, NSUInteger index) | 70 public void insertObject (id anObject, NSUInteger index) |
71 { | 71 { |
72 OS.objc_msgSend(this.id, OS.sel_insertObject_1atIndex_1, anObject !is null ? anObject.id : null, index); | 72 OS.objc_msgSend(this.id_, OS.sel_insertObject_1atIndex_1, anObject !is null ? anObject.id_ : null, index); |
73 } | 73 } |
74 | 74 |
75 public void insertObjects (NSArray objects, NSIndexSet indexes) | 75 public void insertObjects (NSArray objects, NSIndexSet indexes) |
76 { | 76 { |
77 OS.objc_msgSend(this.id, OS.sel_insertObjects_1atIndexes_1, objects !is null ? objects.id : null, indexes !is null ? indexes.id : null); | 77 OS.objc_msgSend(this.id_, OS.sel_insertObjects_1atIndexes_1, objects !is null ? objects.id_ : null, indexes !is null ? indexes.id_ : null); |
78 } | 78 } |
79 | 79 |
80 public void removeAllObjects () | 80 public void removeAllObjects () |
81 { | 81 { |
82 OS.objc_msgSend(this.id, OS.sel_removeAllObjects); | 82 OS.objc_msgSend(this.id_, OS.sel_removeAllObjects); |
83 } | 83 } |
84 | 84 |
85 public void removeLastObject () | 85 public void removeLastObject () |
86 { | 86 { |
87 OS.objc_msgSend(this.id, OS.sel_removeLastObject); | 87 OS.objc_msgSend(this.id_, OS.sel_removeLastObject); |
88 } | 88 } |
89 | 89 |
90 public void removeObject_ (id anObject) | 90 public void removeObject_ (id anObject) |
91 { | 91 { |
92 OS.objc_msgSend(this.id, OS.sel_removeObject_1, anObject !is null ? anObject.id : null); | 92 OS.objc_msgSend(this.id_, OS.sel_removeObject_1, anObject !is null ? anObject.id_ : null); |
93 } | 93 } |
94 | 94 |
95 public void removeObject_inRange_ (id anObject, NSRange range) | 95 public void removeObject_inRange_ (id anObject, NSRange range) |
96 { | 96 { |
97 OS.objc_msgSend(this.id, OS.sel_removeObject_1inRange_1, anObject !is null ? anObject.id : null, range); | 97 OS.objc_msgSend(this.id_, OS.sel_removeObject_1inRange_1, anObject !is null ? anObject.id_ : null, range); |
98 } | 98 } |
99 | 99 |
100 public void removeObjectAtIndex (insertObject index) | 100 public void removeObjectAtIndex (NSUInteger index) |
101 { | 101 { |
102 OS.objc_msgSend(this.id, OS.sel_removeObjectAtIndex_1, index); | 102 OS.objc_msgSend(this.id_, OS.sel_removeObjectAtIndex_1, index); |
103 } | 103 } |
104 | 104 |
105 public void removeObjectIdenticalTo_ (id anObject) | 105 public void removeObjectIdenticalTo_ (id anObject) |
106 { | 106 { |
107 OS.objc_msgSend(this.id, OS.sel_removeObjectIdenticalTo_1, anObject !is null ? anObject.id : null); | 107 OS.objc_msgSend(this.id_, OS.sel_removeObjectIdenticalTo_1, anObject !is null ? anObject.id_ : null); |
108 } | 108 } |
109 | 109 |
110 public void removeObjectIdenticalTo_inRange_ (id anObject, NSRange range) | 110 public void removeObjectIdenticalTo_inRange_ (id anObject, NSRange range) |
111 { | 111 { |
112 OS.objc_msgSend(this.id, OS.sel_removeObjectIdenticalTo_1inRange_1, anObject !is null ? anObject.id : null, range); | 112 OS.objc_msgSend(this.id_, OS.sel_removeObjectIdenticalTo_1inRange_1, anObject !is null ? anObject.id_ : null, range); |
113 } | 113 } |
114 | 114 |
115 public void removeObjectsAtIndexes (NSIndexSet indexes) | 115 public void removeObjectsAtIndexes (NSIndexSet indexes) |
116 { | 116 { |
117 OS.objc_msgSend(this.id, OS.sel_removeObjectsAtIndexes_1, indexes !is null ? indexes.id : null); | 117 OS.objc_msgSend(this.id_, OS.sel_removeObjectsAtIndexes_1, indexes !is null ? indexes.id_ : null); |
118 } | 118 } |
119 | 119 |
120 public void removeObjectsFromIndices (NSUInteger* indices, NSUInteger cnt) | 120 public void removeObjectsFromIndices (NSUInteger* indices, NSUInteger cnt) |
121 { | 121 { |
122 OS.objc_msgSend(this.id, OS.sel_removeObjectsFromIndices_1numIndices_1, indices, cnt); | 122 OS.objc_msgSend(this.id_, OS.sel_removeObjectsFromIndices_1numIndices_1, indices, cnt); |
123 } | 123 } |
124 | 124 |
125 public void removeObjectsInArray (NSArray otherArray) | 125 public void removeObjectsInArray (NSArray otherArray) |
126 { | 126 { |
127 OS.objc_msgSend(this.id, OS.sel_removeObjectsInArray_1, otherArray !is null ? otherArray.id : null); | 127 OS.objc_msgSend(this.id_, OS.sel_removeObjectsInArray_1, otherArray !is null ? otherArray.id_ : null); |
128 } | 128 } |
129 | 129 |
130 public void removeObjectsInRange (NSRange range) | 130 public void removeObjectsInRange (NSRange range) |
131 { | 131 { |
132 OS.objc_msgSend(this.id, OS.sel_removeObjectsInRange_1, range); | 132 OS.objc_msgSend(this.id_, OS.sel_removeObjectsInRange_1, range); |
133 } | 133 } |
134 | 134 |
135 public void replaceObjectAtIndex (NSUInteger index, id anObject) | 135 public void replaceObjectAtIndex (NSUInteger index, id anObject) |
136 { | 136 { |
137 OS.objc_msgSend(this.id, OS.sel_replaceObjectAtIndex_1withObject_1, index, anObject !is null ? anObject.id : null); | 137 OS.objc_msgSend(this.id_, OS.sel_replaceObjectAtIndex_1withObject_1, index, anObject !is null ? anObject.id_ : null); |
138 } | 138 } |
139 | 139 |
140 public void replaceObjectsAtIndexes (NSIndexSet indexes, NSArray objects) | 140 public void replaceObjectsAtIndexes (NSIndexSet indexes, NSArray objects) |
141 { | 141 { |
142 OS.objc_msgSend(this.id, OS.sel_replaceObjectsAtIndexes_1withObjects_1, indexes !is null ? indexes.id : null, | 142 OS.objc_msgSend(this.id_, OS.sel_replaceObjectsAtIndexes_1withObjects_1, indexes !is null ? indexes.id_ : null, |
143 objects !is null ? objects.id : null); | 143 objects !is null ? objects.id_ : null); |
144 } | 144 } |
145 | 145 |
146 public void replaceObjectsInRange_withObjectsFromArray_ (NSRange range, NSArray otherArray) | 146 public void replaceObjectsInRange_withObjectsFromArray_ (NSRange range, NSArray otherArray) |
147 { | 147 { |
148 OS.objc_msgSend(this.id, OS.sel_replaceObjectsInRange_1withObjectsFromArray_1, range, otherArray !is null ? otherArray.id : null); | 148 OS.objc_msgSend(this.id_, OS.sel_replaceObjectsInRange_1withObjectsFromArray_1, range, otherArray !is null ? otherArray.id_ : null); |
149 } | 149 } |
150 | 150 |
151 public void replaceObjectsInRange_withObjectsFromArray_range_ (NSRange range, NSArray otherArray, NSRange otherRange) | 151 public void replaceObjectsInRange_withObjectsFromArray_range_ (NSRange range, NSArray otherArray, NSRange otherRange) |
152 { | 152 { |
153 OS.objc_msgSend(this.id, OS.sel_replaceObjectsInRange_1withObjectsFromArray_1range_1, range, otherArray !is null ? otherArray.id : null, | 153 OS.objc_msgSend(this.id_, OS.sel_replaceObjectsInRange_1withObjectsFromArray_1range_1, range, otherArray !is null ? otherArray.id_ : null, |
154 otherRange); | 154 otherRange); |
155 } | 155 } |
156 | 156 |
157 public void setArray (NSArray otherArray) | 157 public void setArray (NSArray otherArray) |
158 { | 158 { |
159 OS.objc_msgSend(this.id, OS.sel_setArray_1, otherArray !is null ? otherArray.id : null); | 159 OS.objc_msgSend(this.id_, OS.sel_setArray_1, otherArray !is null ? otherArray.id_ : null); |
160 } | 160 } |
161 | 161 |
162 public void sortUsingDescriptors (NSArray sortDescriptors) | 162 public void sortUsingDescriptors (NSArray sortDescriptors) |
163 { | 163 { |
164 OS.objc_msgSend(this.id, OS.sel_sortUsingDescriptors_1, sortDescriptors !is null ? sortDescriptors.id : null); | 164 OS.objc_msgSend(this.id_, OS.sel_sortUsingDescriptors_1, sortDescriptors !is null ? sortDescriptors.id_ : null); |
165 } | 165 } |
166 | 166 |
167 public void sortUsingFunction (int function (id, id, void*) compare, void* context) | 167 public void sortUsingFunction (int function (id, id, void*) compare, void* context) |
168 { | 168 { |
169 OS.objc_msgSend(this.id, OS.sel_sortUsingFunction_1context_1, compare, context); | 169 OS.objc_msgSend(this.id_, OS.sel_sortUsingFunction_1context_1, compare, context); |
170 } | 170 } |
171 | 171 |
172 public void sortUsingSelector (objc.SEL comparator) | 172 public void sortUsingSelector (objc.SEL comparator) |
173 { | 173 { |
174 OS.objc_msgSend(this.id, OS.sel_sortUsingSelector_1, comparator); | 174 OS.objc_msgSend(this.id_, OS.sel_sortUsingSelector_1, comparator); |
175 } | 175 } |
176 | 176 |
177 } | 177 } |