Differential D24817 Diff 68400 src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QAbstractTransition.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QAbstractTransition.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 <qabstracttransition.h> | ||||
10 | #include <QVariant> | ||||
11 | #include <qabstractanimation.h> | ||||
12 | #include <qabstractstate.h> | ||||
13 | #include <qabstracttransition.h> | ||||
14 | #include <qbytearray.h> | ||||
15 | #include <qcoreevent.h> | ||||
16 | #include <qlist.h> | ||||
17 | #include <qobject.h> | ||||
18 | #include <qstate.h> | ||||
19 | #include <qstatemachine.h> | ||||
20 | | ||||
21 | #include "qtscriptshell_QAbstractTransition.h" | ||||
22 | | ||||
23 | static const char * const qtscript_QAbstractTransition_function_names[] = { | ||||
24 | "QAbstractTransition" | ||||
25 | // static | ||||
26 | // prototype | ||||
27 | , "addAnimation" | ||||
28 | , "animations" | ||||
29 | , "machine" | ||||
30 | , "removeAnimation" | ||||
31 | , "toString" | ||||
32 | }; | ||||
33 | | ||||
34 | static const char * const qtscript_QAbstractTransition_function_signatures[] = { | ||||
35 | "QState sourceState" | ||||
36 | // static | ||||
37 | // prototype | ||||
38 | , "QAbstractAnimation animation" | ||||
39 | , "" | ||||
40 | , "" | ||||
41 | , "QAbstractAnimation animation" | ||||
42 | "" | ||||
43 | }; | ||||
44 | | ||||
45 | static const int qtscript_QAbstractTransition_function_lengths[] = { | ||||
46 | 1 | ||||
47 | // static | ||||
48 | // prototype | ||||
49 | , 1 | ||||
50 | , 0 | ||||
51 | , 0 | ||||
52 | , 1 | ||||
53 | , 0 | ||||
54 | }; | ||||
55 | | ||||
56 | static QScriptValue qtscript_QAbstractTransition_throw_ambiguity_error_helper( | ||||
57 | QScriptContext *context, const char *functionName, const char *signatures) | ||||
58 | { | ||||
59 | QStringList lines = QString::fromLatin1(signatures).split(QLatin1Char('\n')); | ||||
60 | QStringList fullSignatures; | ||||
61 | for (int i = 0; i < lines.size(); ++i) | ||||
62 | fullSignatures.append(QString::fromLatin1("%0(%1)").arg(functionName).arg(lines.at(i))); | ||||
63 | return context->throwError(QString::fromLatin1("QAbstractTransition::%0(): could not find a function match; candidates are:\n%1") | ||||
64 | .arg(functionName).arg(fullSignatures.join(QLatin1String("\n")))); | ||||
65 | } | ||||
66 | | ||||
67 | Q_DECLARE_METATYPE(QAbstractTransition*) | ||||
68 | Q_DECLARE_METATYPE(QtScriptShell_QAbstractTransition*) | ||||
69 | Q_DECLARE_METATYPE(QAbstractAnimation*) | ||||
70 | Q_DECLARE_METATYPE(QList<QAbstractAnimation* >) | ||||
71 | Q_DECLARE_METATYPE(QStateMachine*) | ||||
72 | Q_DECLARE_METATYPE(QState*) | ||||
73 | | ||||
74 | // | ||||
75 | // QAbstractTransition | ||||
76 | // | ||||
77 | | ||||
78 | static QScriptValue qtscript_QAbstractTransition_prototype_call(QScriptContext *context, QScriptEngine *) | ||||
79 | { | ||||
80 | #if QT_VERSION > 0x040400 | ||||
81 | Q_ASSERT(context->callee().isFunction()); | ||||
82 | uint _id = context->callee().data().toUInt32(); | ||||
83 | #else | ||||
84 | uint _id; | ||||
85 | if (context->callee().isFunction()) | ||||
86 | _id = context->callee().data().toUInt32(); | ||||
87 | else | ||||
88 | _id = 0xBABE0000 + 4; | ||||
89 | #endif | ||||
90 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
91 | _id &= 0x0000FFFF; | ||||
92 | QAbstractTransition* _q_self = qscriptvalue_cast<QAbstractTransition*>(context->thisObject()); | ||||
93 | if (!_q_self) { | ||||
94 | return context->throwError(QScriptContext::TypeError, | ||||
95 | QString::fromLatin1("QAbstractTransition.%0(): this object is not a QAbstractTransition") | ||||
96 | .arg(qtscript_QAbstractTransition_function_names[_id+1])); | ||||
97 | } | ||||
98 | | ||||
99 | switch (_id) { | ||||
100 | case 0: | ||||
101 | if (context->argumentCount() == 1) { | ||||
102 | QAbstractAnimation* _q_arg0 = qscriptvalue_cast<QAbstractAnimation*>(context->argument(0)); | ||||
103 | _q_self->addAnimation(_q_arg0); | ||||
104 | return context->engine()->undefinedValue(); | ||||
105 | } | ||||
106 | break; | ||||
107 | | ||||
108 | case 1: | ||||
109 | if (context->argumentCount() == 0) { | ||||
110 | QList<QAbstractAnimation* > _q_result = _q_self->animations(); | ||||
111 | return qScriptValueFromSequence(context->engine(), _q_result); | ||||
112 | } | ||||
113 | break; | ||||
114 | | ||||
115 | case 2: | ||||
116 | if (context->argumentCount() == 0) { | ||||
117 | QStateMachine* _q_result = _q_self->machine(); | ||||
118 | return qScriptValueFromValue(context->engine(), _q_result); | ||||
119 | } | ||||
120 | break; | ||||
121 | | ||||
122 | case 3: | ||||
123 | if (context->argumentCount() == 1) { | ||||
124 | QAbstractAnimation* _q_arg0 = qscriptvalue_cast<QAbstractAnimation*>(context->argument(0)); | ||||
125 | _q_self->removeAnimation(_q_arg0); | ||||
126 | return context->engine()->undefinedValue(); | ||||
127 | } | ||||
128 | break; | ||||
129 | | ||||
130 | case 4: { | ||||
131 | QString result = QString::fromLatin1("QAbstractTransition"); | ||||
132 | return QScriptValue(context->engine(), result); | ||||
133 | } | ||||
134 | | ||||
135 | default: | ||||
136 | Q_ASSERT(false); | ||||
137 | } | ||||
138 | return qtscript_QAbstractTransition_throw_ambiguity_error_helper(context, | ||||
139 | qtscript_QAbstractTransition_function_names[_id+1], | ||||
140 | qtscript_QAbstractTransition_function_signatures[_id+1]); | ||||
141 | } | ||||
142 | | ||||
143 | static QScriptValue qtscript_QAbstractTransition_static_call(QScriptContext *context, QScriptEngine *) | ||||
144 | { | ||||
145 | uint _id = context->callee().data().toUInt32(); | ||||
146 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
147 | _id &= 0x0000FFFF; | ||||
148 | switch (_id) { | ||||
149 | case 0: | ||||
150 | if (context->thisObject().strictlyEquals(context->engine()->globalObject())) { | ||||
151 | return context->throwError(QString::fromLatin1("QAbstractTransition(): Did you forget to construct with 'new'?")); | ||||
152 | } | ||||
153 | if (context->argumentCount() == 0) { | ||||
154 | QtScriptShell_QAbstractTransition* _q_cpp_result = new QtScriptShell_QAbstractTransition(); | ||||
155 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QAbstractTransition*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
156 | _q_cpp_result->__qtscript_self = _q_result; | ||||
157 | return _q_result; | ||||
158 | } else if (context->argumentCount() == 1) { | ||||
159 | QState* _q_arg0 = qscriptvalue_cast<QState*>(context->argument(0)); | ||||
160 | QtScriptShell_QAbstractTransition* _q_cpp_result = new QtScriptShell_QAbstractTransition(_q_arg0); | ||||
161 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QAbstractTransition*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
162 | _q_cpp_result->__qtscript_self = _q_result; | ||||
163 | return _q_result; | ||||
164 | } | ||||
165 | break; | ||||
166 | | ||||
167 | default: | ||||
168 | Q_ASSERT(false); | ||||
169 | } | ||||
170 | return qtscript_QAbstractTransition_throw_ambiguity_error_helper(context, | ||||
171 | qtscript_QAbstractTransition_function_names[_id], | ||||
172 | qtscript_QAbstractTransition_function_signatures[_id]); | ||||
173 | } | ||||
174 | | ||||
175 | static QScriptValue qtscript_QAbstractTransition_toScriptValue(QScriptEngine *engine, QAbstractTransition* const &in) | ||||
176 | { | ||||
177 | return engine->newQObject(in, QScriptEngine::QtOwnership, QScriptEngine::PreferExistingWrapperObject); | ||||
178 | } | ||||
179 | | ||||
180 | static void qtscript_QAbstractTransition_fromScriptValue(const QScriptValue &value, QAbstractTransition* &out) | ||||
181 | { | ||||
182 | out = qobject_cast<QAbstractTransition*>(value.toQObject()); | ||||
183 | } | ||||
184 | | ||||
185 | QScriptValue qtscript_create_QAbstractTransition_class(QScriptEngine *engine) | ||||
186 | { | ||||
187 | engine->setDefaultPrototype(qMetaTypeId<QAbstractTransition*>(), QScriptValue()); | ||||
188 | QScriptValue proto = engine->newVariant(qVariantFromValue((QAbstractTransition*)0)); | ||||
189 | proto.setPrototype(engine->defaultPrototype(qMetaTypeId<QObject*>())); | ||||
190 | for (int i = 0; i < 5; ++i) { | ||||
191 | QScriptValue fun = engine->newFunction(qtscript_QAbstractTransition_prototype_call, qtscript_QAbstractTransition_function_lengths[i+1]); | ||||
192 | fun.setData(QScriptValue(engine, uint(0xBABE0000 + i))); | ||||
193 | proto.setProperty(QString::fromLatin1(qtscript_QAbstractTransition_function_names[i+1]), | ||||
194 | fun, QScriptValue::SkipInEnumeration); | ||||
195 | } | ||||
196 | | ||||
197 | qScriptRegisterMetaType<QAbstractTransition*>(engine, qtscript_QAbstractTransition_toScriptValue, | ||||
198 | qtscript_QAbstractTransition_fromScriptValue, proto); | ||||
199 | | ||||
200 | QScriptValue ctor = engine->newFunction(qtscript_QAbstractTransition_static_call, proto, qtscript_QAbstractTransition_function_lengths[0]); | ||||
201 | ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0))); | ||||
202 | | ||||
203 | return ctor; | ||||
204 | } |