Differential D24817 Diff 68400 src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QRectF.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QRectF.cpp
- This file was added.
1 | #include <QtScript/QScriptEngine> | ||||
---|---|---|---|---|---|
2 | #include <QtScript/QScriptContext> | ||||
3 | #include <QtScript/QScriptValue> | ||||
4 | #include <QtCore/QStringList> | ||||
5 | #include <QtCore/QDebug> | ||||
6 | #include <qmetaobject.h> | ||||
7 | #include <__package_shared.h> | ||||
8 | | ||||
9 | #include <qrect.h> | ||||
10 | #include <QVariant> | ||||
11 | #include <qpoint.h> | ||||
12 | #include <qrect.h> | ||||
13 | #include <qsize.h> | ||||
14 | | ||||
15 | static const char * const qtscript_QRectF_function_names[] = { | ||||
16 | "QRectF" | ||||
17 | // static | ||||
18 | // prototype | ||||
19 | , "adjust" | ||||
20 | , "adjusted" | ||||
21 | , "bottom" | ||||
22 | , "bottomLeft" | ||||
23 | , "bottomRight" | ||||
24 | , "center" | ||||
25 | , "contains" | ||||
26 | , "height" | ||||
27 | , "intersected" | ||||
28 | , "intersects" | ||||
29 | , "isEmpty" | ||||
30 | , "isNull" | ||||
31 | , "isValid" | ||||
32 | , "left" | ||||
33 | , "moveBottom" | ||||
34 | , "moveBottomLeft" | ||||
35 | , "moveBottomRight" | ||||
36 | , "moveCenter" | ||||
37 | , "moveLeft" | ||||
38 | , "moveRight" | ||||
39 | , "moveTo" | ||||
40 | , "moveTop" | ||||
41 | , "moveTopLeft" | ||||
42 | , "moveTopRight" | ||||
43 | , "normalized" | ||||
44 | , "equals" | ||||
45 | , "right" | ||||
46 | , "setBottom" | ||||
47 | , "setBottomLeft" | ||||
48 | , "setBottomRight" | ||||
49 | , "setCoords" | ||||
50 | , "setHeight" | ||||
51 | , "setLeft" | ||||
52 | , "setRect" | ||||
53 | , "setRight" | ||||
54 | , "setSize" | ||||
55 | , "setTop" | ||||
56 | , "setTopLeft" | ||||
57 | , "setTopRight" | ||||
58 | , "setWidth" | ||||
59 | , "setX" | ||||
60 | , "setY" | ||||
61 | , "size" | ||||
62 | , "toAlignedRect" | ||||
63 | , "toRect" | ||||
64 | , "top" | ||||
65 | , "topLeft" | ||||
66 | , "topRight" | ||||
67 | , "translate" | ||||
68 | , "translated" | ||||
69 | , "united" | ||||
70 | , "width" | ||||
71 | , "x" | ||||
72 | , "y" | ||||
73 | , "toString" | ||||
74 | }; | ||||
75 | | ||||
76 | static const char * const qtscript_QRectF_function_signatures[] = { | ||||
77 | "\nQPointF topleft, QPointF bottomRight\nQPointF topleft, QSizeF size\nQRect rect\nqreal left, qreal top, qreal width, qreal height" | ||||
78 | // static | ||||
79 | // prototype | ||||
80 | , "qreal x1, qreal y1, qreal x2, qreal y2" | ||||
81 | , "qreal x1, qreal y1, qreal x2, qreal y2" | ||||
82 | , "" | ||||
83 | , "" | ||||
84 | , "" | ||||
85 | , "" | ||||
86 | , "QPointF p\nQRectF r\nqreal x, qreal y" | ||||
87 | , "" | ||||
88 | , "QRectF other" | ||||
89 | , "QRectF r" | ||||
90 | , "" | ||||
91 | , "" | ||||
92 | , "" | ||||
93 | , "" | ||||
94 | , "qreal pos" | ||||
95 | , "QPointF p" | ||||
96 | , "QPointF p" | ||||
97 | , "QPointF p" | ||||
98 | , "qreal pos" | ||||
99 | , "qreal pos" | ||||
100 | , "QPointF p\nqreal x, qreal y" | ||||
101 | , "qreal pos" | ||||
102 | , "QPointF p" | ||||
103 | , "QPointF p" | ||||
104 | , "" | ||||
105 | , "QRectF arg__2" | ||||
106 | , "" | ||||
107 | , "qreal pos" | ||||
108 | , "QPointF p" | ||||
109 | , "QPointF p" | ||||
110 | , "qreal x1, qreal y1, qreal x2, qreal y2" | ||||
111 | , "qreal h" | ||||
112 | , "qreal pos" | ||||
113 | , "qreal x, qreal y, qreal w, qreal h" | ||||
114 | , "qreal pos" | ||||
115 | , "QSizeF s" | ||||
116 | , "qreal pos" | ||||
117 | , "QPointF p" | ||||
118 | , "QPointF p" | ||||
119 | , "qreal w" | ||||
120 | , "qreal pos" | ||||
121 | , "qreal pos" | ||||
122 | , "" | ||||
123 | , "" | ||||
124 | , "" | ||||
125 | , "" | ||||
126 | , "" | ||||
127 | , "" | ||||
128 | , "QPointF p\nqreal dx, qreal dy" | ||||
129 | , "QPointF p\nqreal dx, qreal dy" | ||||
130 | , "QRectF other" | ||||
131 | , "" | ||||
132 | , "" | ||||
133 | , "" | ||||
134 | "" | ||||
135 | }; | ||||
136 | | ||||
137 | static const int qtscript_QRectF_function_lengths[] = { | ||||
138 | 4 | ||||
139 | // static | ||||
140 | // prototype | ||||
141 | , 4 | ||||
142 | , 4 | ||||
143 | , 0 | ||||
144 | , 0 | ||||
145 | , 0 | ||||
146 | , 0 | ||||
147 | , 2 | ||||
148 | , 0 | ||||
149 | , 1 | ||||
150 | , 1 | ||||
151 | , 0 | ||||
152 | , 0 | ||||
153 | , 0 | ||||
154 | , 0 | ||||
155 | , 1 | ||||
156 | , 1 | ||||
157 | , 1 | ||||
158 | , 1 | ||||
159 | , 1 | ||||
160 | , 1 | ||||
161 | , 2 | ||||
162 | , 1 | ||||
163 | , 1 | ||||
164 | , 1 | ||||
165 | , 0 | ||||
166 | , 1 | ||||
167 | , 0 | ||||
168 | , 1 | ||||
169 | , 1 | ||||
170 | , 1 | ||||
171 | , 4 | ||||
172 | , 1 | ||||
173 | , 1 | ||||
174 | , 4 | ||||
175 | , 1 | ||||
176 | , 1 | ||||
177 | , 1 | ||||
178 | , 1 | ||||
179 | , 1 | ||||
180 | , 1 | ||||
181 | , 1 | ||||
182 | , 1 | ||||
183 | , 0 | ||||
184 | , 0 | ||||
185 | , 0 | ||||
186 | , 0 | ||||
187 | , 0 | ||||
188 | , 0 | ||||
189 | , 2 | ||||
190 | , 2 | ||||
191 | , 1 | ||||
192 | , 0 | ||||
193 | , 0 | ||||
194 | , 0 | ||||
195 | , 0 | ||||
196 | }; | ||||
197 | | ||||
198 | static QScriptValue qtscript_QRectF_throw_ambiguity_error_helper( | ||||
199 | QScriptContext *context, const char *functionName, const char *signatures) | ||||
200 | { | ||||
201 | QStringList lines = QString::fromLatin1(signatures).split(QLatin1Char('\n')); | ||||
202 | QStringList fullSignatures; | ||||
203 | for (int i = 0; i < lines.size(); ++i) | ||||
204 | fullSignatures.append(QString::fromLatin1("%0(%1)").arg(functionName).arg(lines.at(i))); | ||||
205 | return context->throwError(QString::fromLatin1("QRectF::%0(): could not find a function match; candidates are:\n%1") | ||||
206 | .arg(functionName).arg(fullSignatures.join(QLatin1String("\n")))); | ||||
207 | } | ||||
208 | | ||||
209 | Q_DECLARE_METATYPE(QRectF*) | ||||
210 | | ||||
211 | // | ||||
212 | // QRectF | ||||
213 | // | ||||
214 | | ||||
215 | static QScriptValue qtscript_QRectF_prototype_call(QScriptContext *context, QScriptEngine *) | ||||
216 | { | ||||
217 | #if QT_VERSION > 0x040400 | ||||
218 | Q_ASSERT(context->callee().isFunction()); | ||||
219 | uint _id = context->callee().data().toUInt32(); | ||||
220 | #else | ||||
221 | uint _id; | ||||
222 | if (context->callee().isFunction()) | ||||
223 | _id = context->callee().data().toUInt32(); | ||||
224 | else | ||||
225 | _id = 0xBABE0000 + 54; | ||||
226 | #endif | ||||
227 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
228 | _id &= 0x0000FFFF; | ||||
229 | QRectF* _q_self = qscriptvalue_cast<QRectF*>(context->thisObject()); | ||||
230 | if (!_q_self) { | ||||
231 | return context->throwError(QScriptContext::TypeError, | ||||
232 | QString::fromLatin1("QRectF.%0(): this object is not a QRectF") | ||||
233 | .arg(qtscript_QRectF_function_names[_id+1])); | ||||
234 | } | ||||
235 | | ||||
236 | switch (_id) { | ||||
237 | case 0: | ||||
238 | if (context->argumentCount() == 4) { | ||||
239 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
240 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
241 | qreal _q_arg2 = qscriptvalue_cast<qreal>(context->argument(2)); | ||||
242 | qreal _q_arg3 = qscriptvalue_cast<qreal>(context->argument(3)); | ||||
243 | _q_self->adjust(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
244 | return context->engine()->undefinedValue(); | ||||
245 | } | ||||
246 | break; | ||||
247 | | ||||
248 | case 1: | ||||
249 | if (context->argumentCount() == 4) { | ||||
250 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
251 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
252 | qreal _q_arg2 = qscriptvalue_cast<qreal>(context->argument(2)); | ||||
253 | qreal _q_arg3 = qscriptvalue_cast<qreal>(context->argument(3)); | ||||
254 | QRectF _q_result = _q_self->adjusted(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
255 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
256 | } | ||||
257 | break; | ||||
258 | | ||||
259 | case 2: | ||||
260 | if (context->argumentCount() == 0) { | ||||
261 | qreal _q_result = _q_self->bottom(); | ||||
262 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
263 | } | ||||
264 | break; | ||||
265 | | ||||
266 | case 3: | ||||
267 | if (context->argumentCount() == 0) { | ||||
268 | QPointF _q_result = _q_self->bottomLeft(); | ||||
269 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
270 | } | ||||
271 | break; | ||||
272 | | ||||
273 | case 4: | ||||
274 | if (context->argumentCount() == 0) { | ||||
275 | QPointF _q_result = _q_self->bottomRight(); | ||||
276 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
277 | } | ||||
278 | break; | ||||
279 | | ||||
280 | case 5: | ||||
281 | if (context->argumentCount() == 0) { | ||||
282 | QPointF _q_result = _q_self->center(); | ||||
283 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
284 | } | ||||
285 | break; | ||||
286 | | ||||
287 | case 6: | ||||
288 | if (context->argumentCount() == 1) { | ||||
289 | if ((qMetaTypeId<QPointF>() == context->argument(0).toVariant().userType())) { | ||||
290 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
291 | bool _q_result = _q_self->contains(_q_arg0); | ||||
292 | return QScriptValue(context->engine(), _q_result); | ||||
293 | } else if ((qMetaTypeId<QRectF>() == context->argument(0).toVariant().userType())) { | ||||
294 | QRectF _q_arg0 = qscriptvalue_cast<QRectF>(context->argument(0)); | ||||
295 | bool _q_result = _q_self->contains(_q_arg0); | ||||
296 | return QScriptValue(context->engine(), _q_result); | ||||
297 | } | ||||
298 | } | ||||
299 | if (context->argumentCount() == 2) { | ||||
300 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
301 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
302 | bool _q_result = _q_self->contains(_q_arg0, _q_arg1); | ||||
303 | return QScriptValue(context->engine(), _q_result); | ||||
304 | } | ||||
305 | break; | ||||
306 | | ||||
307 | case 7: | ||||
308 | if (context->argumentCount() == 0) { | ||||
309 | qreal _q_result = _q_self->height(); | ||||
310 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
311 | } | ||||
312 | break; | ||||
313 | | ||||
314 | case 8: | ||||
315 | if (context->argumentCount() == 1) { | ||||
316 | QRectF _q_arg0 = qscriptvalue_cast<QRectF>(context->argument(0)); | ||||
317 | QRectF _q_result = _q_self->intersected(_q_arg0); | ||||
318 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
319 | } | ||||
320 | break; | ||||
321 | | ||||
322 | case 9: | ||||
323 | if (context->argumentCount() == 1) { | ||||
324 | QRectF _q_arg0 = qscriptvalue_cast<QRectF>(context->argument(0)); | ||||
325 | bool _q_result = _q_self->intersects(_q_arg0); | ||||
326 | return QScriptValue(context->engine(), _q_result); | ||||
327 | } | ||||
328 | break; | ||||
329 | | ||||
330 | case 10: | ||||
331 | if (context->argumentCount() == 0) { | ||||
332 | bool _q_result = _q_self->isEmpty(); | ||||
333 | return QScriptValue(context->engine(), _q_result); | ||||
334 | } | ||||
335 | break; | ||||
336 | | ||||
337 | case 11: | ||||
338 | if (context->argumentCount() == 0) { | ||||
339 | bool _q_result = _q_self->isNull(); | ||||
340 | return QScriptValue(context->engine(), _q_result); | ||||
341 | } | ||||
342 | break; | ||||
343 | | ||||
344 | case 12: | ||||
345 | if (context->argumentCount() == 0) { | ||||
346 | bool _q_result = _q_self->isValid(); | ||||
347 | return QScriptValue(context->engine(), _q_result); | ||||
348 | } | ||||
349 | break; | ||||
350 | | ||||
351 | case 13: | ||||
352 | if (context->argumentCount() == 0) { | ||||
353 | qreal _q_result = _q_self->left(); | ||||
354 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
355 | } | ||||
356 | break; | ||||
357 | | ||||
358 | case 14: | ||||
359 | if (context->argumentCount() == 1) { | ||||
360 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
361 | _q_self->moveBottom(_q_arg0); | ||||
362 | return context->engine()->undefinedValue(); | ||||
363 | } | ||||
364 | break; | ||||
365 | | ||||
366 | case 15: | ||||
367 | if (context->argumentCount() == 1) { | ||||
368 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
369 | _q_self->moveBottomLeft(_q_arg0); | ||||
370 | return context->engine()->undefinedValue(); | ||||
371 | } | ||||
372 | break; | ||||
373 | | ||||
374 | case 16: | ||||
375 | if (context->argumentCount() == 1) { | ||||
376 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
377 | _q_self->moveBottomRight(_q_arg0); | ||||
378 | return context->engine()->undefinedValue(); | ||||
379 | } | ||||
380 | break; | ||||
381 | | ||||
382 | case 17: | ||||
383 | if (context->argumentCount() == 1) { | ||||
384 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
385 | _q_self->moveCenter(_q_arg0); | ||||
386 | return context->engine()->undefinedValue(); | ||||
387 | } | ||||
388 | break; | ||||
389 | | ||||
390 | case 18: | ||||
391 | if (context->argumentCount() == 1) { | ||||
392 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
393 | _q_self->moveLeft(_q_arg0); | ||||
394 | return context->engine()->undefinedValue(); | ||||
395 | } | ||||
396 | break; | ||||
397 | | ||||
398 | case 19: | ||||
399 | if (context->argumentCount() == 1) { | ||||
400 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
401 | _q_self->moveRight(_q_arg0); | ||||
402 | return context->engine()->undefinedValue(); | ||||
403 | } | ||||
404 | break; | ||||
405 | | ||||
406 | case 20: | ||||
407 | if (context->argumentCount() == 1) { | ||||
408 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
409 | _q_self->moveTo(_q_arg0); | ||||
410 | return context->engine()->undefinedValue(); | ||||
411 | } | ||||
412 | if (context->argumentCount() == 2) { | ||||
413 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
414 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
415 | _q_self->moveTo(_q_arg0, _q_arg1); | ||||
416 | return context->engine()->undefinedValue(); | ||||
417 | } | ||||
418 | break; | ||||
419 | | ||||
420 | case 21: | ||||
421 | if (context->argumentCount() == 1) { | ||||
422 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
423 | _q_self->moveTop(_q_arg0); | ||||
424 | return context->engine()->undefinedValue(); | ||||
425 | } | ||||
426 | break; | ||||
427 | | ||||
428 | case 22: | ||||
429 | if (context->argumentCount() == 1) { | ||||
430 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
431 | _q_self->moveTopLeft(_q_arg0); | ||||
432 | return context->engine()->undefinedValue(); | ||||
433 | } | ||||
434 | break; | ||||
435 | | ||||
436 | case 23: | ||||
437 | if (context->argumentCount() == 1) { | ||||
438 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
439 | _q_self->moveTopRight(_q_arg0); | ||||
440 | return context->engine()->undefinedValue(); | ||||
441 | } | ||||
442 | break; | ||||
443 | | ||||
444 | case 24: | ||||
445 | if (context->argumentCount() == 0) { | ||||
446 | QRectF _q_result = _q_self->normalized(); | ||||
447 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
448 | } | ||||
449 | break; | ||||
450 | | ||||
451 | case 25: | ||||
452 | if (context->argumentCount() == 1) { | ||||
453 | QRectF _q_arg0 = qscriptvalue_cast<QRectF>(context->argument(0)); | ||||
454 | bool _q_result = operator==(*_q_self, _q_arg0); | ||||
455 | return QScriptValue(context->engine(), _q_result); | ||||
456 | } | ||||
457 | break; | ||||
458 | | ||||
459 | case 26: | ||||
460 | if (context->argumentCount() == 0) { | ||||
461 | qreal _q_result = _q_self->right(); | ||||
462 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
463 | } | ||||
464 | break; | ||||
465 | | ||||
466 | case 27: | ||||
467 | if (context->argumentCount() == 1) { | ||||
468 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
469 | _q_self->setBottom(_q_arg0); | ||||
470 | return context->engine()->undefinedValue(); | ||||
471 | } | ||||
472 | break; | ||||
473 | | ||||
474 | case 28: | ||||
475 | if (context->argumentCount() == 1) { | ||||
476 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
477 | _q_self->setBottomLeft(_q_arg0); | ||||
478 | return context->engine()->undefinedValue(); | ||||
479 | } | ||||
480 | break; | ||||
481 | | ||||
482 | case 29: | ||||
483 | if (context->argumentCount() == 1) { | ||||
484 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
485 | _q_self->setBottomRight(_q_arg0); | ||||
486 | return context->engine()->undefinedValue(); | ||||
487 | } | ||||
488 | break; | ||||
489 | | ||||
490 | case 30: | ||||
491 | if (context->argumentCount() == 4) { | ||||
492 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
493 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
494 | qreal _q_arg2 = qscriptvalue_cast<qreal>(context->argument(2)); | ||||
495 | qreal _q_arg3 = qscriptvalue_cast<qreal>(context->argument(3)); | ||||
496 | _q_self->setCoords(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
497 | return context->engine()->undefinedValue(); | ||||
498 | } | ||||
499 | break; | ||||
500 | | ||||
501 | case 31: | ||||
502 | if (context->argumentCount() == 1) { | ||||
503 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
504 | _q_self->setHeight(_q_arg0); | ||||
505 | return context->engine()->undefinedValue(); | ||||
506 | } | ||||
507 | break; | ||||
508 | | ||||
509 | case 32: | ||||
510 | if (context->argumentCount() == 1) { | ||||
511 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
512 | _q_self->setLeft(_q_arg0); | ||||
513 | return context->engine()->undefinedValue(); | ||||
514 | } | ||||
515 | break; | ||||
516 | | ||||
517 | case 33: | ||||
518 | if (context->argumentCount() == 4) { | ||||
519 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
520 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
521 | qreal _q_arg2 = qscriptvalue_cast<qreal>(context->argument(2)); | ||||
522 | qreal _q_arg3 = qscriptvalue_cast<qreal>(context->argument(3)); | ||||
523 | _q_self->setRect(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
524 | return context->engine()->undefinedValue(); | ||||
525 | } | ||||
526 | break; | ||||
527 | | ||||
528 | case 34: | ||||
529 | if (context->argumentCount() == 1) { | ||||
530 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
531 | _q_self->setRight(_q_arg0); | ||||
532 | return context->engine()->undefinedValue(); | ||||
533 | } | ||||
534 | break; | ||||
535 | | ||||
536 | case 35: | ||||
537 | if (context->argumentCount() == 1) { | ||||
538 | QSizeF _q_arg0 = qscriptvalue_cast<QSizeF>(context->argument(0)); | ||||
539 | _q_self->setSize(_q_arg0); | ||||
540 | return context->engine()->undefinedValue(); | ||||
541 | } | ||||
542 | break; | ||||
543 | | ||||
544 | case 36: | ||||
545 | if (context->argumentCount() == 1) { | ||||
546 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
547 | _q_self->setTop(_q_arg0); | ||||
548 | return context->engine()->undefinedValue(); | ||||
549 | } | ||||
550 | break; | ||||
551 | | ||||
552 | case 37: | ||||
553 | if (context->argumentCount() == 1) { | ||||
554 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
555 | _q_self->setTopLeft(_q_arg0); | ||||
556 | return context->engine()->undefinedValue(); | ||||
557 | } | ||||
558 | break; | ||||
559 | | ||||
560 | case 38: | ||||
561 | if (context->argumentCount() == 1) { | ||||
562 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
563 | _q_self->setTopRight(_q_arg0); | ||||
564 | return context->engine()->undefinedValue(); | ||||
565 | } | ||||
566 | break; | ||||
567 | | ||||
568 | case 39: | ||||
569 | if (context->argumentCount() == 1) { | ||||
570 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
571 | _q_self->setWidth(_q_arg0); | ||||
572 | return context->engine()->undefinedValue(); | ||||
573 | } | ||||
574 | break; | ||||
575 | | ||||
576 | case 40: | ||||
577 | if (context->argumentCount() == 1) { | ||||
578 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
579 | _q_self->setX(_q_arg0); | ||||
580 | return context->engine()->undefinedValue(); | ||||
581 | } | ||||
582 | break; | ||||
583 | | ||||
584 | case 41: | ||||
585 | if (context->argumentCount() == 1) { | ||||
586 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
587 | _q_self->setY(_q_arg0); | ||||
588 | return context->engine()->undefinedValue(); | ||||
589 | } | ||||
590 | break; | ||||
591 | | ||||
592 | case 42: | ||||
593 | if (context->argumentCount() == 0) { | ||||
594 | QSizeF _q_result = _q_self->size(); | ||||
595 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
596 | } | ||||
597 | break; | ||||
598 | | ||||
599 | case 43: | ||||
600 | if (context->argumentCount() == 0) { | ||||
601 | QRect _q_result = _q_self->toAlignedRect(); | ||||
602 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
603 | } | ||||
604 | break; | ||||
605 | | ||||
606 | case 44: | ||||
607 | if (context->argumentCount() == 0) { | ||||
608 | QRect _q_result = _q_self->toRect(); | ||||
609 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
610 | } | ||||
611 | break; | ||||
612 | | ||||
613 | case 45: | ||||
614 | if (context->argumentCount() == 0) { | ||||
615 | qreal _q_result = _q_self->top(); | ||||
616 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
617 | } | ||||
618 | break; | ||||
619 | | ||||
620 | case 46: | ||||
621 | if (context->argumentCount() == 0) { | ||||
622 | QPointF _q_result = _q_self->topLeft(); | ||||
623 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
624 | } | ||||
625 | break; | ||||
626 | | ||||
627 | case 47: | ||||
628 | if (context->argumentCount() == 0) { | ||||
629 | QPointF _q_result = _q_self->topRight(); | ||||
630 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
631 | } | ||||
632 | break; | ||||
633 | | ||||
634 | case 48: | ||||
635 | if (context->argumentCount() == 1) { | ||||
636 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
637 | _q_self->translate(_q_arg0); | ||||
638 | return context->engine()->undefinedValue(); | ||||
639 | } | ||||
640 | if (context->argumentCount() == 2) { | ||||
641 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
642 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
643 | _q_self->translate(_q_arg0, _q_arg1); | ||||
644 | return context->engine()->undefinedValue(); | ||||
645 | } | ||||
646 | break; | ||||
647 | | ||||
648 | case 49: | ||||
649 | if (context->argumentCount() == 1) { | ||||
650 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
651 | QRectF _q_result = _q_self->translated(_q_arg0); | ||||
652 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
653 | } | ||||
654 | if (context->argumentCount() == 2) { | ||||
655 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
656 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
657 | QRectF _q_result = _q_self->translated(_q_arg0, _q_arg1); | ||||
658 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
659 | } | ||||
660 | break; | ||||
661 | | ||||
662 | case 50: | ||||
663 | if (context->argumentCount() == 1) { | ||||
664 | QRectF _q_arg0 = qscriptvalue_cast<QRectF>(context->argument(0)); | ||||
665 | QRectF _q_result = _q_self->united(_q_arg0); | ||||
666 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
667 | } | ||||
668 | break; | ||||
669 | | ||||
670 | case 51: | ||||
671 | if (context->argumentCount() == 0) { | ||||
672 | qreal _q_result = _q_self->width(); | ||||
673 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
674 | } | ||||
675 | break; | ||||
676 | | ||||
677 | case 52: | ||||
678 | if (context->argumentCount() == 0) { | ||||
679 | qreal _q_result = _q_self->x(); | ||||
680 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
681 | } | ||||
682 | break; | ||||
683 | | ||||
684 | case 53: | ||||
685 | if (context->argumentCount() == 0) { | ||||
686 | qreal _q_result = _q_self->y(); | ||||
687 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
688 | } | ||||
689 | break; | ||||
690 | | ||||
691 | case 54: { | ||||
692 | QString result; | ||||
693 | QDebug d(&result); | ||||
694 | d << *_q_self; | ||||
695 | return QScriptValue(context->engine(), result); | ||||
696 | } | ||||
697 | | ||||
698 | default: | ||||
699 | Q_ASSERT(false); | ||||
700 | } | ||||
701 | return qtscript_QRectF_throw_ambiguity_error_helper(context, | ||||
702 | qtscript_QRectF_function_names[_id+1], | ||||
703 | qtscript_QRectF_function_signatures[_id+1]); | ||||
704 | } | ||||
705 | | ||||
706 | static QScriptValue qtscript_QRectF_static_call(QScriptContext *context, QScriptEngine *) | ||||
707 | { | ||||
708 | uint _id = context->callee().data().toUInt32(); | ||||
709 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
710 | _id &= 0x0000FFFF; | ||||
711 | switch (_id) { | ||||
712 | case 0: | ||||
713 | if (context->thisObject().strictlyEquals(context->engine()->globalObject())) { | ||||
714 | return context->throwError(QString::fromLatin1("QRectF(): Did you forget to construct with 'new'?")); | ||||
715 | } | ||||
716 | if (context->argumentCount() == 0) { | ||||
717 | QRectF _q_cpp_result; | ||||
718 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
719 | return _q_result; | ||||
720 | } else if (context->argumentCount() == 1) { | ||||
721 | QRect _q_arg0 = qscriptvalue_cast<QRect>(context->argument(0)); | ||||
722 | QRectF _q_cpp_result(_q_arg0); | ||||
723 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
724 | return _q_result; | ||||
725 | } else if (context->argumentCount() == 2) { | ||||
726 | if ((qMetaTypeId<QPointF>() == context->argument(0).toVariant().userType()) | ||||
727 | && (qMetaTypeId<QPointF>() == context->argument(1).toVariant().userType())) { | ||||
728 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
729 | QPointF _q_arg1 = qscriptvalue_cast<QPointF>(context->argument(1)); | ||||
730 | QRectF _q_cpp_result(_q_arg0, _q_arg1); | ||||
731 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
732 | return _q_result; | ||||
733 | } else if ((qMetaTypeId<QPointF>() == context->argument(0).toVariant().userType()) | ||||
734 | && (qMetaTypeId<QSizeF>() == context->argument(1).toVariant().userType())) { | ||||
735 | QPointF _q_arg0 = qscriptvalue_cast<QPointF>(context->argument(0)); | ||||
736 | QSizeF _q_arg1 = qscriptvalue_cast<QSizeF>(context->argument(1)); | ||||
737 | QRectF _q_cpp_result(_q_arg0, _q_arg1); | ||||
738 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
739 | return _q_result; | ||||
740 | } | ||||
741 | } else if (context->argumentCount() == 4) { | ||||
742 | qreal _q_arg0 = qscriptvalue_cast<qreal>(context->argument(0)); | ||||
743 | qreal _q_arg1 = qscriptvalue_cast<qreal>(context->argument(1)); | ||||
744 | qreal _q_arg2 = qscriptvalue_cast<qreal>(context->argument(2)); | ||||
745 | qreal _q_arg3 = qscriptvalue_cast<qreal>(context->argument(3)); | ||||
746 | QRectF _q_cpp_result(_q_arg0, _q_arg1, _q_arg2, _q_arg3); | ||||
747 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
748 | return _q_result; | ||||
749 | } | ||||
750 | break; | ||||
751 | | ||||
752 | default: | ||||
753 | Q_ASSERT(false); | ||||
754 | } | ||||
755 | return qtscript_QRectF_throw_ambiguity_error_helper(context, | ||||
756 | qtscript_QRectF_function_names[_id], | ||||
757 | qtscript_QRectF_function_signatures[_id]); | ||||
758 | } | ||||
759 | | ||||
760 | QScriptValue qtscript_create_QRectF_class(QScriptEngine *engine) | ||||
761 | { | ||||
762 | engine->setDefaultPrototype(qMetaTypeId<QRectF*>(), QScriptValue()); | ||||
763 | QScriptValue proto = engine->newVariant(qVariantFromValue((QRectF*)0)); | ||||
764 | for (int i = 0; i < 55; ++i) { | ||||
765 | QScriptValue fun = engine->newFunction(qtscript_QRectF_prototype_call, qtscript_QRectF_function_lengths[i+1]); | ||||
766 | fun.setData(QScriptValue(engine, uint(0xBABE0000 + i))); | ||||
767 | proto.setProperty(QString::fromLatin1(qtscript_QRectF_function_names[i+1]), | ||||
768 | fun, QScriptValue::SkipInEnumeration); | ||||
769 | } | ||||
770 | | ||||
771 | engine->setDefaultPrototype(qMetaTypeId<QRectF>(), proto); | ||||
772 | engine->setDefaultPrototype(qMetaTypeId<QRectF*>(), proto); | ||||
773 | | ||||
774 | QScriptValue ctor = engine->newFunction(qtscript_QRectF_static_call, proto, qtscript_QRectF_function_lengths[0]); | ||||
775 | ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0))); | ||||
776 | | ||||
777 | return ctor; | ||||
778 | } |