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