Mercurial > projects > qtd
comparison qt/d1/qt/core/QRect.d @ 231:99e74c8a22f8
change ref to in in structs
author | eldar |
---|---|
date | Fri, 17 Jul 2009 21:16:44 +0000 |
parents | 7dd099050621 |
children | 7664de4a55e5 |
comparison
equal
deleted
inserted
replaced
230:0c2a27b23238 | 231:99e74c8a22f8 |
---|---|
25 rt.x2 = (aleft + awidth - 1); | 25 rt.x2 = (aleft + awidth - 1); |
26 rt.y2 = (atop + aheight - 1); | 26 rt.y2 = (atop + aheight - 1); |
27 return rt; | 27 return rt; |
28 } | 28 } |
29 | 29 |
30 public static QRect opCall(ref QPoint atopLeft, ref QPoint abottomRight) | 30 public static QRect opCall(in QPoint atopLeft, in QPoint abottomRight) |
31 { | 31 { |
32 QRect rt; | 32 QRect rt; |
33 rt.x1 = atopLeft.x(); | 33 rt.x1 = atopLeft.x(); |
34 rt.y1 = atopLeft.y(); | 34 rt.y1 = atopLeft.y(); |
35 rt.x2 = abottomRight.x(); | 35 rt.x2 = abottomRight.x(); |
36 rt.y2 = abottomRight.y(); | 36 rt.y2 = abottomRight.y(); |
37 return rt; | 37 return rt; |
38 } | 38 } |
39 | 39 |
40 public static QRect opCall(ref QPoint atopLeft, ref QSize asize) | 40 public static QRect opCall(in QPoint atopLeft, in QSize asize) |
41 { | 41 { |
42 QRect rt; | 42 QRect rt; |
43 rt.x1 = atopLeft.x(); | 43 rt.x1 = atopLeft.x(); |
44 rt.y1 = atopLeft.y(); | 44 rt.y1 = atopLeft.y(); |
45 rt.x2 = (rt.x1+asize.width() - 1); | 45 rt.x2 = (rt.x1+asize.width() - 1); |
96 { x2 = pos; } | 96 { x2 = pos; } |
97 | 97 |
98 void setBottom(int pos) | 98 void setBottom(int pos) |
99 { y2 = pos; } | 99 { y2 = pos; } |
100 | 100 |
101 void setTopLeft(ref QPoint p) | 101 void setTopLeft(in QPoint p) |
102 { x1 = p.x(); y1 = p.y(); } | 102 { x1 = p.x(); y1 = p.y(); } |
103 | 103 |
104 void setBottomRight(ref QPoint p) | 104 void setBottomRight(in QPoint p) |
105 { x2 = p.x(); y2 = p.y(); } | 105 { x2 = p.x(); y2 = p.y(); } |
106 | 106 |
107 void setTopRight(ref QPoint p) | 107 void setTopRight(in QPoint p) |
108 { x2 = p.x(); y1 = p.y(); } | 108 { x2 = p.x(); y1 = p.y(); } |
109 | 109 |
110 void setBottomLeft(ref QPoint p) | 110 void setBottomLeft(in QPoint p) |
111 { x1 = p.x(); y2 = p.y(); } | 111 { x1 = p.x(); y2 = p.y(); } |
112 | 112 |
113 void setX(int ax) | 113 void setX(int ax) |
114 { x1 = ax; } | 114 { x1 = ax; } |
115 | 115 |
146 y1 += dy; | 146 y1 += dy; |
147 x2 += dx; | 147 x2 += dx; |
148 y2 += dy; | 148 y2 += dy; |
149 } | 149 } |
150 | 150 |
151 void translate(ref QPoint p) | 151 void translate(in QPoint p) |
152 { | 152 { |
153 x1 += p.x(); | 153 x1 += p.x(); |
154 y1 += p.y(); | 154 y1 += p.y(); |
155 x2 += p.x(); | 155 x2 += p.x(); |
156 y2 += p.y(); | 156 y2 += p.y(); |
157 } | 157 } |
158 | 158 |
159 QRect translated(int dx, int dy) // const | 159 QRect translated(int dx, int dy) // const |
160 { return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); } | 160 { return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); } |
161 | 161 |
162 QRect translated(ref QPoint p) // const | 162 QRect translated(in QPoint p) // const |
163 { return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); } | 163 { return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); } |
164 | 164 |
165 void moveTo(int ax, int ay) | 165 void moveTo(int ax, int ay) |
166 { | 166 { |
167 x2 += ax - x1; | 167 x2 += ax - x1; |
168 y2 += ay - y1; | 168 y2 += ay - y1; |
169 x1 = ax; | 169 x1 = ax; |
170 y1 = ay; | 170 y1 = ay; |
171 } | 171 } |
172 | 172 |
173 void moveTo(ref QPoint p) | 173 void moveTo(in QPoint p) |
174 { | 174 { |
175 x2 += p.x() - x1; | 175 x2 += p.x() - x1; |
176 y2 += p.y() - y1; | 176 y2 += p.y() - y1; |
177 x1 = p.x(); | 177 x1 = p.x(); |
178 y1 = p.y(); | 178 y1 = p.y(); |
194 { | 194 { |
195 y1 += (pos - y2); | 195 y1 += (pos - y2); |
196 y2 = pos; | 196 y2 = pos; |
197 } | 197 } |
198 | 198 |
199 void moveTopLeft(ref QPoint p) | 199 void moveTopLeft(in QPoint p) |
200 { | 200 { |
201 moveLeft(p.x()); | 201 moveLeft(p.x()); |
202 moveTop(p.y()); | 202 moveTop(p.y()); |
203 } | 203 } |
204 | 204 |
205 void moveBottomRight(ref QPoint p) | 205 void moveBottomRight(in QPoint p) |
206 { | 206 { |
207 moveRight(p.x()); | 207 moveRight(p.x()); |
208 moveBottom(p.y()); | 208 moveBottom(p.y()); |
209 } | 209 } |
210 | 210 |
211 void moveTopRight(ref QPoint p) | 211 void moveTopRight(in QPoint p) |
212 { | 212 { |
213 moveRight(p.x()); | 213 moveRight(p.x()); |
214 moveTop(p.y()); | 214 moveTop(p.y()); |
215 } | 215 } |
216 | 216 |
217 void moveBottomLeft(ref QPoint p) | 217 void moveBottomLeft(in QPoint p) |
218 { | 218 { |
219 moveLeft(p.x()); | 219 moveLeft(p.x()); |
220 moveBottom(p.y()); | 220 moveBottom(p.y()); |
221 } | 221 } |
222 | 222 |
267 { x2 = (x1 + w - 1); } | 267 { x2 = (x1 + w - 1); } |
268 | 268 |
269 void setHeight(int h) | 269 void setHeight(int h) |
270 { y2 = (y1 + h - 1); } | 270 { y2 = (y1 + h - 1); } |
271 | 271 |
272 void setSize(ref QSize s) | 272 void setSize(in QSize s) |
273 { | 273 { |
274 x2 = (s.width() + x1 - 1); | 274 x2 = (s.width() + x1 - 1); |
275 y2 = (s.height() + y1 - 1); | 275 y2 = (s.height() + y1 - 1); |
276 } | 276 } |
277 | 277 |
283 bool contains(int ax, int ay) // const | 283 bool contains(int ax, int ay) // const |
284 { | 284 { |
285 return contains(QPoint(ax, ay), false); | 285 return contains(QPoint(ax, ay), false); |
286 } | 286 } |
287 | 287 |
288 QRect opOrAssign(ref QRect r) | 288 QRect opOrAssign(in QRect r) |
289 { | 289 { |
290 *this = *this | r; | 290 *this = *this | r; |
291 return *this; | 291 return *this; |
292 } | 292 } |
293 | 293 |
294 QRect opAndAssign(ref QRect r) | 294 QRect opAndAssign(in QRect r) |
295 { | 295 { |
296 *this = *this & r; | 296 *this = *this & r; |
297 return *this; | 297 return *this; |
298 } | 298 } |
299 | 299 |
300 QRect intersected(ref QRect other) // const | 300 QRect intersected(in QRect other) // const |
301 { | 301 { |
302 return *this & other; | 302 return *this & other; |
303 } | 303 } |
304 | 304 |
305 QRect united(ref QRect r) // const | 305 QRect united(in QRect r) // const |
306 { | 306 { |
307 return *this | r; | 307 return *this | r; |
308 } | 308 } |
309 | 309 |
310 bool opEquals(ref QRect r) | 310 bool opEquals(in QRect r) |
311 { | 311 { |
312 return x1==r.x1 && x2==r.x2 && y1==r.y1 && y2==r.y2; | 312 return x1==r.x1 && x2==r.x2 && y1==r.y1 && y2==r.y2; |
313 } | 313 } |
314 | 314 |
315 public final void writeTo(QDataStream arg__1) { | 315 public final void writeTo(QDataStream arg__1) { |
318 | 318 |
319 public final void readFrom(QDataStream arg__1) { | 319 public final void readFrom(QDataStream arg__1) { |
320 qtd_QRect_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId); | 320 qtd_QRect_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId); |
321 } | 321 } |
322 | 322 |
323 public final QRect opAnd(ref QRect r) { | 323 public final QRect opAnd(in QRect r) { |
324 return qtd_QRect_operator_and_QRect(this, &r); | 324 return qtd_QRect_operator_and_QRect(this, &r); |
325 } | 325 } |
326 | 326 |
327 public final QRect opOr(ref QRect r) { | 327 public final QRect opOr(in QRect r) { |
328 return qtd_QRect_operator_or_QRect(this, &r); | 328 return qtd_QRect_operator_or_QRect(this, &r); |
329 } | 329 } |
330 | 330 |
331 public final bool contains(QPoint p, bool proper = false) { | 331 public final bool contains(QPoint p, bool proper = false) { |
332 return qtd_QRect_contains_QPoint_bool(this, &p, proper); | 332 return qtd_QRect_contains_QPoint_bool(this, &p, proper); |