Differential D24817 Diff 68400 src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QFutureSynchronizer.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QFutureSynchronizer.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 <qtscriptconcurrent.h> | ||||
10 | #include <QVariant> | ||||
11 | | ||||
12 | #include "qtscriptshell_QFutureSynchronizer.h" | ||||
13 | | ||||
14 | static const char * const qtscript_QFutureSynchronizer_function_names[] = { | ||||
15 | "QFutureSynchronizer" | ||||
16 | // static | ||||
17 | // prototype | ||||
18 | , "toString" | ||||
19 | }; | ||||
20 | | ||||
21 | static const char * const qtscript_QFutureSynchronizer_function_signatures[] = { | ||||
22 | "" | ||||
23 | // static | ||||
24 | // prototype | ||||
25 | "" | ||||
26 | }; | ||||
27 | | ||||
28 | static const int qtscript_QFutureSynchronizer_function_lengths[] = { | ||||
29 | 0 | ||||
30 | // static | ||||
31 | // prototype | ||||
32 | , 0 | ||||
33 | }; | ||||
34 | | ||||
35 | static QScriptValue qtscript_QFutureSynchronizer_throw_ambiguity_error_helper( | ||||
36 | QScriptContext *context, const char *functionName, const char *signatures) | ||||
37 | { | ||||
38 | QStringList lines = QString::fromLatin1(signatures).split(QLatin1Char('\n')); | ||||
39 | QStringList fullSignatures; | ||||
40 | for (int i = 0; i < lines.size(); ++i) | ||||
41 | fullSignatures.append(QString::fromLatin1("%0(%1)").arg(functionName).arg(lines.at(i))); | ||||
42 | return context->throwError(QString::fromLatin1("QFutureSynchronizer::%0(): could not find a function match; candidates are:\n%1") | ||||
43 | .arg(functionName).arg(fullSignatures.join(QLatin1String("\n")))); | ||||
44 | } | ||||
45 | | ||||
46 | Q_DECLARE_METATYPE(QtScriptFutureSynchronizer*) | ||||
47 | Q_DECLARE_METATYPE(QtScriptShell_QFutureSynchronizer*) | ||||
48 | | ||||
49 | // | ||||
50 | // QFutureSynchronizer | ||||
51 | // | ||||
52 | | ||||
53 | static QScriptValue qtscript_QFutureSynchronizer_prototype_call(QScriptContext *context, QScriptEngine *) | ||||
54 | { | ||||
55 | #if QT_VERSION > 0x040400 | ||||
56 | Q_ASSERT(context->callee().isFunction()); | ||||
57 | uint _id = context->callee().data().toUInt32(); | ||||
58 | #else | ||||
59 | uint _id; | ||||
60 | if (context->callee().isFunction()) | ||||
61 | _id = context->callee().data().toUInt32(); | ||||
62 | else | ||||
63 | _id = 0xBABE0000 + 0; | ||||
64 | #endif | ||||
65 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
66 | _id &= 0x0000FFFF; | ||||
67 | QtScriptFutureSynchronizer* _q_self = qscriptvalue_cast<QtScriptFutureSynchronizer*>(context->thisObject()); | ||||
68 | if (!_q_self) { | ||||
69 | return context->throwError(QScriptContext::TypeError, | ||||
70 | QString::fromLatin1("QFutureSynchronizer.%0(): this object is not a QFutureSynchronizer") | ||||
71 | .arg(qtscript_QFutureSynchronizer_function_names[_id+1])); | ||||
72 | } | ||||
73 | | ||||
74 | switch (_id) { | ||||
75 | case 0: { | ||||
76 | QString result = QString::fromLatin1("QFutureSynchronizer"); | ||||
77 | return QScriptValue(context->engine(), result); | ||||
78 | } | ||||
79 | | ||||
80 | default: | ||||
81 | Q_ASSERT(false); | ||||
82 | } | ||||
83 | return qtscript_QFutureSynchronizer_throw_ambiguity_error_helper(context, | ||||
84 | qtscript_QFutureSynchronizer_function_names[_id+1], | ||||
85 | qtscript_QFutureSynchronizer_function_signatures[_id+1]); | ||||
86 | } | ||||
87 | | ||||
88 | static QScriptValue qtscript_QFutureSynchronizer_static_call(QScriptContext *context, QScriptEngine *) | ||||
89 | { | ||||
90 | uint _id = context->callee().data().toUInt32(); | ||||
91 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
92 | _id &= 0x0000FFFF; | ||||
93 | switch (_id) { | ||||
94 | case 0: | ||||
95 | if (context->thisObject().strictlyEquals(context->engine()->globalObject())) { | ||||
96 | return context->throwError(QString::fromLatin1("QFutureSynchronizer(): Did you forget to construct with 'new'?")); | ||||
97 | } | ||||
98 | if (context->argumentCount() == 0) { | ||||
99 | QtScriptShell_QFutureSynchronizer* _q_cpp_result = new QtScriptShell_QFutureSynchronizer(); | ||||
100 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue((QtScriptFutureSynchronizer*)_q_cpp_result)); | ||||
101 | _q_cpp_result->__qtscript_self = _q_result; | ||||
102 | return _q_result; | ||||
103 | } | ||||
104 | break; | ||||
105 | | ||||
106 | default: | ||||
107 | Q_ASSERT(false); | ||||
108 | } | ||||
109 | return qtscript_QFutureSynchronizer_throw_ambiguity_error_helper(context, | ||||
110 | qtscript_QFutureSynchronizer_function_names[_id], | ||||
111 | qtscript_QFutureSynchronizer_function_signatures[_id]); | ||||
112 | } | ||||
113 | | ||||
114 | QScriptValue qtscript_create_QFutureSynchronizer_class(QScriptEngine *engine) | ||||
115 | { | ||||
116 | engine->setDefaultPrototype(qMetaTypeId<QtScriptFutureSynchronizer*>(), QScriptValue()); | ||||
117 | QScriptValue proto = engine->newVariant(qVariantFromValue((QtScriptFutureSynchronizer*)0)); | ||||
118 | | ||||
119 | engine->setDefaultPrototype(qMetaTypeId<QtScriptFutureSynchronizer*>(), proto); | ||||
120 | | ||||
121 | QScriptValue ctor = engine->newFunction(qtscript_QFutureSynchronizer_static_call, proto, qtscript_QFutureSynchronizer_function_lengths[0]); | ||||
122 | ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0))); | ||||
123 | | ||||
124 | return ctor; | ||||
125 | } |