Mercurial > projects > qtd
annotate qt/d2/qt/core/QVariant.d @ 298:adae77fdc1ea signals
Native QList implementation is now used throughout QtD
author | eldar |
---|---|
date | Sun, 06 Dec 2009 17:26:37 +0000 |
parents | 463563fc9e17 |
children |
rev | line source |
---|---|
188 | 1 module qt.core.QVariant; |
2 | |
3 public import qt.QGlobal; | |
254 | 4 private import qt.QtdObject; |
188 | 5 private import qt.core.QMetaType; |
6 | |
7 // automatic imports------------- | |
8 private import qt.core.QSizeF; | |
9 private import qt.core.QPoint; | |
10 private import qt.core.QRectF; | |
11 public import qt.core.Qt; | |
12 private import qt.core.QDateTime; | |
13 private import qt.core.QDataStream; | |
14 private import qt.core.QTime; | |
15 private import qt.core.QUrl; | |
16 private import qt.core.QRegExp; | |
17 private import qt.core.QBitArray; | |
18 private import qt.core.QLine; | |
19 private import qt.core.QByteArray; | |
20 private import qt.core.QSize; | |
21 private import qt.core.QDate; | |
22 private import qt.core.QPointF; | |
23 private import qt.core.QLineF; | |
24 private import qt.core.QRect; | |
25 private import qt.core.QLocale; | |
26 | |
27 import std.string; | |
28 | |
29 | |
254 | 30 public class QVariant : QtdObject |
188 | 31 { |
32 enum Type { | |
33 Invalid = 0, | |
34 | |
35 Bool = 1, | |
36 Int = 2, | |
37 UInt = 3, | |
38 LongLong = 4, | |
39 ULongLong = 5, | |
40 Double = 6, | |
41 Char = 7, | |
42 Map = 8, | |
43 List = 9, | |
44 String = 10, | |
45 StringList = 11, | |
46 ByteArray = 12, | |
47 BitArray = 13, | |
48 Date = 14, | |
49 Time = 15, | |
50 DateTime = 16, | |
51 Url = 17, | |
52 Locale = 18, | |
53 Rect = 19, | |
54 RectF = 20, | |
55 Size = 21, | |
56 SizeF = 22, | |
57 Line = 23, | |
58 LineF = 24, | |
59 Point = 25, | |
60 PointF = 26, | |
61 RegExp = 27, | |
62 LastCoreType = RegExp, | |
63 | |
64 // value 62 is internally reserved | |
65 | |
66 Font = 64, | |
67 Pixmap = 65, | |
68 Brush = 66, | |
69 Color = 67, | |
70 Palette = 68, | |
71 Icon = 69, | |
72 Image = 70, | |
73 Polygon = 71, | |
74 Region = 72, | |
75 Bitmap = 73, | |
76 Cursor = 74, | |
77 SizePolicy = 75, | |
78 KeySequence = 76, | |
79 Pen = 77, | |
80 TextLength = 78, | |
81 TextFormat = 79, | |
82 Matrix = 80, | |
83 Transform = 81, | |
84 LastGuiType = Transform, | |
85 | |
86 UserType = 127, | |
87 | |
88 LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type | |
89 } | |
254 | 90 |
188 | 91 // Functions |
92 | |
93 private template getMetaId() | |
94 { | |
95 const char[] getMetaId = " | |
96 int i = qtd_MetatypeId(toStringz(name)); | |
97 if(i <= 0) | |
98 i = qRegisterMetaType!(T)(name);"; | |
99 } | |
254 | 100 |
188 | 101 static public QVariant fromValue(T)(T obj) |
102 { | |
103 QVariant var; | |
104 static if (is(T == class) || is(T == interface)) | |
105 { | |
106 string name = obj.classinfo.name; | |
107 mixin(getMetaId!()); | |
108 var = new QVariant(i, cast(void*)(obj)); | |
109 } | |
110 else static if (isDynamicArrayType!(T) || isStaticArrayType!(T) ) | |
111 { | |
112 string name = typeid(ElementTypeOfArray!(T)).toString ~ "[]"; | |
113 mixin(getMetaId!()); | |
114 auto darray = new DArrayToC; | |
115 darray.array = obj.dup; | |
116 var = new QVariant(i, cast(void*)(darray)); | |
117 } | |
118 else | |
119 { | |
120 string name = typeid(T).toString; | |
121 mixin(getMetaId!()); | |
122 auto data = new T; | |
123 *data = obj; | |
124 var = new QVariant(i, cast(void*)(data)); | |
125 } | |
126 return var; | |
127 } | |
254 | 128 |
188 | 129 static public QVariant opCall(T)(T obj) |
130 { | |
131 return fromValue(obj); | |
132 } | |
133 | |
134 public this() { | |
135 void* __qt_return_value = qtd_QVariant_QVariant(); | |
136 super(__qt_return_value); | |
137 } | |
138 | |
139 | |
140 public this(QDataStream s) { | |
254 | 141 void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.__nativeId); |
188 | 142 super(__qt_return_value); |
143 } | |
144 | |
145 | |
146 public this(Qt.GlobalColor color) { | |
147 void* __qt_return_value = qtd_QVariant_QVariant_GlobalColor(color); | |
148 super(__qt_return_value); | |
149 } | |
150 | |
151 | |
152 public this(bool b) { | |
153 void* __qt_return_value = qtd_QVariant_QVariant_bool(b); | |
154 super(__qt_return_value); | |
155 } | |
156 | |
157 | |
158 public this(QBitArray bitarray) { | |
254 | 159 void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.__nativeId); |
188 | 160 super(__qt_return_value); |
161 } | |
162 | |
163 | |
164 public this(QByteArray bytearray) { | |
254 | 165 void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.__nativeId); |
188 | 166 super(__qt_return_value); |
167 } | |
168 | |
169 | |
170 public this(QDate date) { | |
254 | 171 void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.__nativeId); |
188 | 172 super(__qt_return_value); |
173 } | |
174 | |
175 | |
176 public this(QDateTime datetime) { | |
254 | 177 void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.__nativeId); |
188 | 178 super(__qt_return_value); |
179 } | |
180 | |
181 | |
182 public this(string str) { | |
183 void* __qt_return_value = qtd_QVariant_QVariant_String(str); | |
184 super(__qt_return_value); | |
185 } | |
186 | |
187 | |
188 public this(QLine line) { | |
189 void* __qt_return_value = qtd_QVariant_QVariant_QLine(&line); | |
190 super(__qt_return_value); | |
191 } | |
192 | |
193 | |
194 public this(QLineF line) { | |
195 void* __qt_return_value = qtd_QVariant_QVariant_QLineF(&line); | |
196 super(__qt_return_value); | |
197 } | |
198 | |
199 | |
200 public this(QLocale locale) { | |
254 | 201 void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.__nativeId); |
188 | 202 super(__qt_return_value); |
203 } | |
204 | |
205 | |
206 public this(QPoint pt) { | |
207 void* __qt_return_value = qtd_QVariant_QVariant_QPoint(&pt); | |
208 super(__qt_return_value); | |
209 } | |
210 | |
211 | |
212 public this(QPointF pt) { | |
213 void* __qt_return_value = qtd_QVariant_QVariant_QPointF(&pt); | |
214 super(__qt_return_value); | |
215 } | |
216 | |
217 | |
218 public this(QRect rect) { | |
219 void* __qt_return_value = qtd_QVariant_QVariant_QRect(&rect); | |
220 super(__qt_return_value); | |
221 } | |
222 | |
223 | |
224 public this(QRectF rect) { | |
225 void* __qt_return_value = qtd_QVariant_QVariant_QRectF(&rect); | |
226 super(__qt_return_value); | |
227 } | |
228 | |
229 | |
230 public this(QRegExp regExp) { | |
254 | 231 void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.__nativeId); |
188 | 232 super(__qt_return_value); |
233 } | |
234 | |
235 | |
236 public this(QSize size) { | |
237 void* __qt_return_value = qtd_QVariant_QVariant_QSize(&size); | |
238 super(__qt_return_value); | |
239 } | |
240 | |
241 | |
242 public this(QSizeF size) { | |
243 void* __qt_return_value = qtd_QVariant_QVariant_QSizeF(&size); | |
244 super(__qt_return_value); | |
245 } | |
246 | |
247 | |
248 public this(QTime time) { | |
254 | 249 void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.__nativeId); |
188 | 250 super(__qt_return_value); |
251 } | |
252 | |
253 | |
254 public this(QUrl url) { | |
254 | 255 void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.__nativeId); |
188 | 256 super(__qt_return_value); |
257 } | |
258 | |
259 | |
260 public this(QVariant other) { | |
254 | 261 void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.__nativeId); |
188 | 262 super(__qt_return_value); |
263 } | |
264 | |
265 /* | |
266 public this(char* str) { | |
267 void* __qt_return_value = qtd_QVariant_QVariant_nativepointerchar(str); | |
268 super(__qt_return_value); | |
269 } | |
270 */ | |
271 | |
272 public this(double d) { | |
273 void* __qt_return_value = qtd_QVariant_QVariant_double(d); | |
274 super(__qt_return_value); | |
275 } | |
276 | |
277 | |
278 public this(int i) { | |
279 void* __qt_return_value = qtd_QVariant_QVariant_int(i); | |
280 super(__qt_return_value); | |
281 } | |
282 | |
283 | |
284 public this(int typeOrUserType, void* copy) { | |
285 void* __qt_return_value = qtd_QVariant_QVariant_int_nativepointervoid(typeOrUserType, copy); | |
286 super(__qt_return_value); | |
287 } | |
288 | |
289 | |
290 public this(long ll) { | |
291 void* __qt_return_value = qtd_QVariant_QVariant_long(ll); | |
292 super(__qt_return_value); | |
293 } | |
294 | |
295 | |
296 public this(uint ui) { | |
297 void* __qt_return_value = qtd_QVariant_QVariant_uint(ui); | |
298 super(__qt_return_value); | |
299 } | |
300 | |
301 | |
302 public this(ulong ull) { | |
303 void* __qt_return_value = qtd_QVariant_QVariant_ulong(ull); | |
304 super(__qt_return_value); | |
305 } | |
306 | |
307 private final bool canConvertImpl(string name) | |
308 { | |
309 int i = qtd_MetatypeId(toStringz(name)); | |
310 assert(i > 0); | |
254 | 311 return qtd_QVariant_canConvert(__nativeId, i); |
188 | 312 } |
313 | |
314 public final bool canConvert(Type)() { | |
315 static if ( is(Type == QBitArray) ) | |
316 return canConvertImpl("QBitArray"); | |
317 else static if ( is(Type == bool) ) | |
318 return canConvertImpl("bool"); | |
319 else static if ( is(Type == QByteArray) ) | |
320 return canConvertImpl("QByteArray"); | |
321 else static if ( is(Type == QDate) ) | |
322 return canConvertImpl("QDate"); | |
323 else static if ( is(Type == QDateTime) ) | |
324 return canConvertImpl("QDateTime"); | |
325 else static if ( is(Type == double) ) | |
326 return canConvertImpl("double"); | |
327 else static if ( is(Type == int) ) | |
328 return canConvertImpl("int"); | |
329 else static if ( is(Type == QLine) ) | |
330 return canConvertImpl("QLine"); | |
331 else static if ( is(Type == QLineF) ) | |
332 return canConvertImpl("QLineF"); | |
333 else static if ( is(Type == QLocale) ) | |
334 return canConvertImpl("QLocale"); | |
335 else static if ( is(Type == long) ) | |
336 return canConvertImpl("long"); | |
337 else static if ( is(Type == QPoint) ) | |
338 return canConvertImpl("QPoint"); | |
339 else static if ( is(Type == QPointF) ) | |
340 return canConvertImpl("QPointF"); | |
341 else static if ( is(Type == QRect) ) | |
342 return canConvertImpl("QRect"); | |
343 else static if ( is(Type == QRectF) ) | |
344 return canConvertImpl("QRectF"); | |
345 else static if ( is(Type == QRegExp) ) | |
346 return canConvertImpl("QRegExp"); | |
347 else static if ( is(Type == QSize) ) | |
348 return canConvertImpl("QSize"); | |
349 else static if ( is(Type == QSizeF) ) | |
350 return canConvertImpl("QSizeF"); | |
351 else static if ( is(Type == string) ) | |
352 return canConvertImpl("QString"); | |
353 else static if ( is(Type == QTime) ) | |
354 return canConvertImpl("QTime"); | |
355 else static if ( is(Type == uint) ) | |
254 | 356 return canConvertImpl("unsigned int"); // TODO: |
188 | 357 else static if ( is(Type == ulong) ) |
254 | 358 return canConvertImpl("unsigned long long"); // TODO: |
188 | 359 else static if ( is(Type == QUrl) ) |
360 return canConvertImpl("QUrl"); | |
361 else | |
362 { | |
363 static if( is( Type == class ) || is( Type == interface ) ) | |
364 { | |
254 | 365 Object object = cast(Object)qtd_QVariant_data(__nativeId); |
188 | 366 if(object) |
367 return cast(Type)(object) !is null; | |
368 return false; | |
369 } | |
370 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) ) | |
371 { | |
254 | 372 auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId); |
188 | 373 return cast(Type)(array.array) !is null; |
374 } | |
375 else | |
376 { | |
377 int i = qtd_MetatypeId(toStringz(typeid(Type).toString)); | |
254 | 378 return qtd_QVariant_canConvert(__nativeId, i); |
188 | 379 } |
380 } | |
381 } | |
382 | |
383 public final Type value(Type)() { | |
384 static if ( is(Type == QBitArray) ) | |
254 | 385 return toBitArra; |
188 | 386 else static if ( is(Type == bool) ) |
254 | 387 return toBool; |
188 | 388 else static if ( is(Type == QByteArray) ) |
254 | 389 return toByteArray; |
188 | 390 else static if ( is(Type == QDate) ) |
254 | 391 return toDate; |
188 | 392 else static if ( is(Type == QDateTime) ) |
254 | 393 return toDateTime; |
188 | 394 else static if ( is(Type == double) ) |
254 | 395 return toDouble; |
188 | 396 else static if ( is(Type == int) ) |
254 | 397 return toInt; |
188 | 398 else static if ( is(Type == QLine) ) |
254 | 399 return toLine; |
188 | 400 else static if ( is(Type == QLineF) ) |
254 | 401 return toLineF; |
188 | 402 else static if ( is(Type == QLocale) ) |
254 | 403 return toLocale; |
188 | 404 else static if ( is(Type == long) ) |
254 | 405 return toLongLong; |
188 | 406 else static if ( is(Type == QPoint) ) |
254 | 407 return toPoint; |
188 | 408 else static if ( is(Type == QPointF) ) |
409 return toPointF; | |
410 else static if ( is(Type == QRect) ) | |
411 return toRect; | |
412 else static if ( is(Type == QRectF) ) | |
413 return toRectF; | |
414 else static if ( is(Type == QRegExp) ) | |
415 return toRegExp; | |
416 else static if ( is(Type == QSize) ) | |
417 return toSize; | |
418 else static if ( is(Type == QSizeF) ) | |
419 return toSizeF; | |
420 else static if ( is(Type == string) ) | |
421 return toString; | |
422 else static if ( is(Type == QTime) ) | |
423 return toTime; | |
424 else static if ( is(Type == uint) ) | |
425 return toUInt; | |
426 else static if ( is(Type == ulong) ) | |
427 return toULongLong; | |
428 else static if ( is(Type == QUrl) ) | |
429 return toUrl; | |
430 else static if( is( Type == class ) || is( Type == interface ) ) | |
431 { | |
254 | 432 Object object = cast(Object)qtd_QVariant_data(__nativeId); |
188 | 433 if(object) |
434 return cast(Type)(object); | |
435 return null; | |
436 } | |
437 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) ) | |
438 { | |
254 | 439 auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId); |
188 | 440 return cast(Type)(array.array); |
441 } | |
442 else | |
443 { | |
254 | 444 return *cast(Type*)qtd_QVariant_data(__nativeId); |
188 | 445 } |
446 } | |
447 | |
448 public final void clear() { | |
254 | 449 qtd_QVariant_clear(__nativeId); |
188 | 450 } |
451 | |
452 protected final bool cmp(QVariant other) { | |
254 | 453 return qtd_QVariant_cmp_QVariant(__nativeId, other is null ? null : other.__nativeId); |
188 | 454 } |
455 | |
456 protected final void create(int type, void* copy) { | |
254 | 457 qtd_QVariant_create_int_nativepointervoid(__nativeId, type, copy); |
188 | 458 } |
459 | |
460 public final bool isNull() { | |
254 | 461 return qtd_QVariant_isNull(__nativeId); |
188 | 462 } |
463 | |
464 public final bool isValid() { | |
254 | 465 return qtd_QVariant_isValid(__nativeId); |
188 | 466 } |
467 | |
468 public final void load(QDataStream ds) { | |
254 | 469 qtd_QVariant_load_QDataStream(__nativeId, ds is null ? null : ds.__nativeId); |
188 | 470 } |
471 | |
472 public final void writeTo(QDataStream s) { | |
254 | 473 qtd_QVariant_writeTo_QDataStream(__nativeId, s is null ? null : s.__nativeId); |
188 | 474 } |
475 | |
476 public final QVariant operator_assign(QVariant other) { | |
254 | 477 void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(__nativeId, other is null ? null : other.__nativeId); |
478 return new QVariant(__qt_return_value, QtdObjectFlags.nativeOwnership); | |
188 | 479 } |
480 | |
481 private final bool operator_equal(QVariant v) { | |
254 | 482 return qtd_QVariant_operator_equal_QVariant(__nativeId, v is null ? null : v.__nativeId); |
188 | 483 } |
484 | |
485 public final void readFrom(QDataStream s) { | |
254 | 486 qtd_QVariant_readFrom_QDataStream(__nativeId, s is null ? null : s.__nativeId); |
188 | 487 } |
488 | |
489 public final void save(QDataStream ds) { | |
254 | 490 qtd_QVariant_save_QDataStream(__nativeId, ds is null ? null : ds.__nativeId); |
188 | 491 } |
492 | |
493 public final QBitArray toBitArray() { | |
254 | 494 void* __qt_return_value = qtd_QVariant_toBitArray(__nativeId); |
495 return new QBitArray(__qt_return_value); | |
188 | 496 } |
497 | |
498 public final bool toBool() { | |
254 | 499 return qtd_QVariant_toBool(__nativeId); |
188 | 500 } |
501 | |
502 public final QByteArray toByteArray() { | |
254 | 503 void* __qt_return_value = qtd_QVariant_toByteArray(__nativeId); |
504 return new QByteArray(__qt_return_value); | |
188 | 505 } |
506 | |
507 public final QDate toDate() { | |
254 | 508 void* __qt_return_value = qtd_QVariant_toDate(__nativeId); |
509 return new QDate(__qt_return_value); | |
188 | 510 } |
511 | |
512 public final QDateTime toDateTime() { | |
254 | 513 void* __qt_return_value = qtd_QVariant_toDateTime(__nativeId); |
514 return new QDateTime(__qt_return_value); | |
188 | 515 } |
516 | |
517 public final double toDouble(bool* ok = null) { | |
254 | 518 return qtd_QVariant_toDouble_nativepointerbool(__nativeId, ok); |
188 | 519 } |
520 | |
521 public final int toInt(bool* ok = null) { | |
254 | 522 return qtd_QVariant_toInt_nativepointerbool(__nativeId, ok); |
188 | 523 } |
524 | |
525 public final QLine toLine() { | |
254 | 526 return qtd_QVariant_toLine(__nativeId); |
188 | 527 } |
528 | |
529 public final QLineF toLineF() { | |
254 | 530 return qtd_QVariant_toLineF(__nativeId); |
188 | 531 } |
532 | |
533 public final QLocale toLocale() { | |
254 | 534 void* __qt_return_value = qtd_QVariant_toLocale(__nativeId); |
535 return new QLocale(__qt_return_value); | |
188 | 536 } |
537 | |
538 public final long toLongLong(bool* ok = null) { | |
254 | 539 return qtd_QVariant_toLongLong_nativepointerbool(__nativeId, ok); |
188 | 540 } |
541 | |
542 public final QPoint toPoint() { | |
254 | 543 return qtd_QVariant_toPoint(__nativeId); |
188 | 544 } |
545 | |
546 public final QPointF toPointF() { | |
254 | 547 return qtd_QVariant_toPointF(__nativeId); |
188 | 548 } |
549 | |
550 public final QRect toRect() { | |
254 | 551 return qtd_QVariant_toRect(__nativeId); |
188 | 552 } |
553 | |
554 public final QRectF toRectF() { | |
254 | 555 return qtd_QVariant_toRectF(__nativeId); |
188 | 556 } |
557 | |
558 public final QRegExp toRegExp() { | |
254 | 559 void* __qt_return_value = qtd_QVariant_toRegExp(__nativeId); |
560 return new QRegExp(__qt_return_value); | |
188 | 561 } |
562 | |
563 public final QSize toSize() { | |
254 | 564 return qtd_QVariant_toSize(__nativeId); |
188 | 565 } |
566 | |
567 public final QSizeF toSizeF() { | |
254 | 568 return qtd_QVariant_toSizeF(__nativeId); |
188 | 569 } |
570 | |
571 public final string toString() { | |
572 string res; | |
254 | 573 qtd_QVariant_toString(__nativeId, &res); |
188 | 574 return res; |
575 } | |
576 | |
577 public final QTime toTime() { | |
254 | 578 void* __qt_return_value = qtd_QVariant_toTime(__nativeId); |
579 return new QTime(__qt_return_value); | |
188 | 580 } |
581 | |
582 public final uint toUInt(bool* ok = null) { | |
254 | 583 return qtd_QVariant_toUInt_nativepointerbool(__nativeId, ok); |
188 | 584 } |
585 | |
586 public final ulong toULongLong(bool* ok = null) { | |
254 | 587 return qtd_QVariant_toULongLong_nativepointerbool(__nativeId, ok); |
188 | 588 } |
589 | |
590 public final QUrl toUrl() { | |
254 | 591 void* __qt_return_value = qtd_QVariant_toUrl(__nativeId); |
592 return new QUrl(__qt_return_value); | |
188 | 593 } |
594 | |
595 public final char* typeName() { | |
254 | 596 return qtd_QVariant_typeName(__nativeId); |
188 | 597 } |
254 | 598 |
188 | 599 public final Type type() { |
254 | 600 return cast(Type)qtd_QVariant_type(__nativeId); |
188 | 601 } |
602 | |
603 public final int userType() { | |
254 | 604 return qtd_QVariant_userType(__nativeId); |
188 | 605 } |
606 // Field accessors | |
607 | |
254 | 608 public this(void* native_id, QtdObjectFlags flags = QtdObjectFlags.none) { |
609 super(native_id, flags); | |
188 | 610 } |
611 | |
254 | 612 protected override void __deleteNative() { |
613 qtd_QVariant_destructor(__nativeId); | |
188 | 614 } |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
615 |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
616 public alias void __isValueType; |
188 | 617 |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
618 public alias void __isQtType_QVariant; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
619 |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
620 struct QTypeInfo |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
621 { |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
622 enum bool isComplex = true; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
623 enum bool isStatic = false; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
624 enum bool isLarge = true; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
625 enum bool isPointer = false; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
626 enum bool isDummy = false; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
627 } |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
628 |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
629 static void* __constructNativeCopy(const void* orig) { |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
630 return qtd_QVariant_QVariant_QVariant(cast(void*)orig); |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
631 } |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
632 |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
633 static void* __constructPlacedNativeCopy(const void* orig, void* place) { |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
634 return qtd_QVariant_placed_copy(orig, place); |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
635 } |
298
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
636 |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
637 public static void __deleteNativeObject(void* ptr) { |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
638 qtd_QVariant_destructor(ptr); |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
639 } |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
640 |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
641 public static void __callNativeDestructor(void* ptr) { |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
642 qtd_QVariant_call_destructor(ptr); |
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
643 } |
188 | 644 // Injected code in class |
645 } | |
298
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
646 |
188 | 647 extern (C) void qtd_QVariant_destructor(void *ptr); |
298
adae77fdc1ea
Native QList implementation is now used throughout QtD
eldar
parents:
295
diff
changeset
|
648 extern (C) void qtd_QVariant_call_destructor(void *ptr); |
188 | 649 |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
650 private extern(C) void* qtd_QVariant_placed_copy(const void* orig, void* place); |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
254
diff
changeset
|
651 |
188 | 652 |
653 // C wrappers | |
654 private extern(C) void* qtd_QVariant_QVariant(); | |
655 private extern(C) void* qtd_QVariant_QVariant_QDataStream(void* s0); | |
656 private extern(C) void* qtd_QVariant_QVariant_GlobalColor(int color0); | |
657 private extern(C) void* qtd_QVariant_QVariant_bool(bool b0); | |
658 private extern(C) void* qtd_QVariant_QVariant_QBitArray(void* bitarray0); | |
659 private extern(C) void* qtd_QVariant_QVariant_QByteArray(void* bytearray0); | |
660 private extern(C) void* qtd_QVariant_QVariant_QDate(void* date0); | |
661 private extern(C) void* qtd_QVariant_QVariant_QDateTime(void* datetime0); | |
662 private extern(C) void* qtd_QVariant_QVariant_String(string string0); | |
663 private extern(C) void* qtd_QVariant_QVariant_QLine(void* line0); | |
664 private extern(C) void* qtd_QVariant_QVariant_QLineF(void* line0); | |
665 private extern(C) void* qtd_QVariant_QVariant_QLocale(void* locale0); | |
666 private extern(C) void* qtd_QVariant_QVariant_QPoint(void* pt0); | |
667 private extern(C) void* qtd_QVariant_QVariant_QPointF(void* pt0); | |
668 private extern(C) void* qtd_QVariant_QVariant_QRect(void* rect0); | |
669 private extern(C) void* qtd_QVariant_QVariant_QRectF(void* rect0); | |
670 private extern(C) void* qtd_QVariant_QVariant_QRegExp(void* regExp0); | |
671 private extern(C) void* qtd_QVariant_QVariant_QSize(void* size0); | |
672 private extern(C) void* qtd_QVariant_QVariant_QSizeF(void* size0); | |
673 private extern(C) void* qtd_QVariant_QVariant_QTime(void* time0); | |
674 private extern(C) void* qtd_QVariant_QVariant_QUrl(void* url0); | |
675 private extern(C) void* qtd_QVariant_QVariant_QVariant(void* other0); | |
676 private extern(C) void* qtd_QVariant_QVariant_nativepointerchar(char* str0); | |
677 private extern(C) void* qtd_QVariant_QVariant_double(double d0); | |
678 private extern(C) void* qtd_QVariant_QVariant_int(int i0); | |
679 private extern(C) void* qtd_QVariant_QVariant_int_nativepointervoid(int typeOrUserType0, | |
680 void* copy1); | |
681 private extern(C) void* qtd_QVariant_QVariant_long(long ll0); | |
682 private extern(C) void* qtd_QVariant_QVariant_uint(uint ui0); | |
683 private extern(C) void* qtd_QVariant_QVariant_ulong(ulong ull0); | |
684 private extern(C) bool qtd_QVariant_canConvert(void* __this_nativeId, int); | |
685 private extern(C) void qtd_QVariant_clear(void* __this_nativeId); | |
686 private extern(C) bool qtd_QVariant_cmp_QVariant(void* __this_nativeId, | |
687 void* other0); | |
688 private extern(C) void qtd_QVariant_create_int_nativepointervoid(void* __this_nativeId, | |
689 int type0, | |
690 void* copy1); | |
691 private extern(C) bool qtd_QVariant_isNull(void* __this_nativeId); | |
692 private extern(C) bool qtd_QVariant_isValid(void* __this_nativeId); | |
693 private extern(C) void qtd_QVariant_load_QDataStream(void* __this_nativeId, | |
694 void* ds0); | |
695 private extern(C) void qtd_QVariant_writeTo_QDataStream(void* __this_nativeId, | |
696 void* s0); | |
697 private extern(C) void* qtd_QVariant_operator_assign_QVariant(void* __this_nativeId, | |
698 void* other0); | |
699 private extern(C) bool qtd_QVariant_operator_equal_QVariant(void* __this_nativeId, | |
700 void* v0); | |
701 private extern(C) void qtd_QVariant_readFrom_QDataStream(void* __this_nativeId, | |
702 void* s0); | |
703 private extern(C) void qtd_QVariant_save_QDataStream(void* __this_nativeId, | |
704 void* ds0); | |
705 private extern(C) void* qtd_QVariant_toBitArray(void* __this_nativeId); | |
706 private extern(C) bool qtd_QVariant_toBool(void* __this_nativeId); | |
707 private extern(C) void* qtd_QVariant_toByteArray(void* __this_nativeId); | |
708 private extern(C) void* qtd_QVariant_toDate(void* __this_nativeId); | |
709 private extern(C) void* qtd_QVariant_toDateTime(void* __this_nativeId); | |
710 private extern(C) double qtd_QVariant_toDouble_nativepointerbool(void* __this_nativeId, | |
711 bool* ok0); | |
712 private extern(C) int qtd_QVariant_toInt_nativepointerbool(void* __this_nativeId, | |
713 bool* ok0); | |
714 private extern(C) QLine qtd_QVariant_toLine(void* __this_nativeId); | |
715 private extern(C) QLineF qtd_QVariant_toLineF(void* __this_nativeId); | |
716 private extern(C) void* qtd_QVariant_toLocale(void* __this_nativeId); | |
717 private extern(C) long qtd_QVariant_toLongLong_nativepointerbool(void* __this_nativeId, | |
718 bool* ok0); | |
719 private extern(C) QPoint qtd_QVariant_toPoint(void* __this_nativeId); | |
720 private extern(C) QPointF qtd_QVariant_toPointF(void* __this_nativeId); | |
721 private extern(C) QRect qtd_QVariant_toRect(void* __this_nativeId); | |
722 private extern(C) QRectF qtd_QVariant_toRectF(void* __this_nativeId); | |
723 private extern(C) void* qtd_QVariant_toRegExp(void* __this_nativeId); | |
724 private extern(C) QSize qtd_QVariant_toSize(void* __this_nativeId); | |
725 private extern(C) QSizeF qtd_QVariant_toSizeF(void* __this_nativeId); | |
726 private extern(C) void qtd_QVariant_toString(void* __this_nativeId, | |
727 void* __java_return_value); | |
728 private extern(C) void* qtd_QVariant_toTime(void* __this_nativeId); | |
729 private extern(C) uint qtd_QVariant_toUInt_nativepointerbool(void* __this_nativeId, | |
730 bool* ok0); | |
731 private extern(C) ulong qtd_QVariant_toULongLong_nativepointerbool(void* __this_nativeId, | |
732 bool* ok0); | |
733 private extern(C) void* qtd_QVariant_toUrl(void* __this_nativeId); | |
734 private extern(C) char* qtd_QVariant_typeName(void* __this_nativeId); | |
735 private extern(C) int qtd_QVariant_type(void* __this_nativeId); | |
736 private extern(C) int qtd_QVariant_userType(void* __this_nativeId); | |
737 private extern(C) void *qtd_QVariant_data(void* __this_nativeId); | |
738 | |
739 // Just the private functions for abstract functions implemeneted in superclasses | |
740 | |
741 // Virtual Dispatch functions |