Differential D24817 Diff 68400 src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QPropertyAnimation.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QPropertyAnimation.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 <qpropertyanimation.h> | ||||
10 | #include <QVariant> | ||||
11 | #include <qanimationgroup.h> | ||||
12 | #include <qbytearray.h> | ||||
13 | #include <qcoreevent.h> | ||||
14 | #include <qeasingcurve.h> | ||||
15 | #include <qlist.h> | ||||
16 | #include <qobject.h> | ||||
17 | #include <qpair.h> | ||||
18 | #include <qpropertyanimation.h> | ||||
19 | #include <qvector.h> | ||||
20 | | ||||
21 | #include "qtscriptshell_QPropertyAnimation.h" | ||||
22 | | ||||
23 | static const char * const qtscript_QPropertyAnimation_function_names[] = { | ||||
24 | "QPropertyAnimation" | ||||
25 | // static | ||||
26 | // prototype | ||||
27 | , "toString" | ||||
28 | }; | ||||
29 | | ||||
30 | static const char * const qtscript_QPropertyAnimation_function_signatures[] = { | ||||
31 | "QObject parent\nQObject target, QByteArray propertyName, QObject parent" | ||||
32 | // static | ||||
33 | // prototype | ||||
34 | "" | ||||
35 | }; | ||||
36 | | ||||
37 | static const int qtscript_QPropertyAnimation_function_lengths[] = { | ||||
38 | 3 | ||||
39 | // static | ||||
40 | // prototype | ||||
41 | , 0 | ||||
42 | }; | ||||
43 | | ||||
44 | static QScriptValue qtscript_QPropertyAnimation_throw_ambiguity_error_helper( | ||||
45 | QScriptContext *context, const char *functionName, const char *signatures) | ||||
46 | { | ||||
47 | QStringList lines = QString::fromLatin1(signatures).split(QLatin1Char('\n')); | ||||
48 | QStringList fullSignatures; | ||||
49 | for (int i = 0; i < lines.size(); ++i) | ||||
50 | fullSignatures.append(QString::fromLatin1("%0(%1)").arg(functionName).arg(lines.at(i))); | ||||
51 | return context->throwError(QString::fromLatin1("QPropertyAnimation::%0(): could not find a function match; candidates are:\n%1") | ||||
52 | .arg(functionName).arg(fullSignatures.join(QLatin1String("\n")))); | ||||
53 | } | ||||
54 | | ||||
55 | Q_DECLARE_METATYPE(QPropertyAnimation*) | ||||
56 | Q_DECLARE_METATYPE(QtScriptShell_QPropertyAnimation*) | ||||
57 | Q_DECLARE_METATYPE(QVariantAnimation*) | ||||
58 | | ||||
59 | // | ||||
60 | // QPropertyAnimation | ||||
61 | // | ||||
62 | | ||||
63 | static QScriptValue qtscript_QPropertyAnimation_prototype_call(QScriptContext *context, QScriptEngine *) | ||||
64 | { | ||||
65 | #if QT_VERSION > 0x040400 | ||||
66 | Q_ASSERT(context->callee().isFunction()); | ||||
67 | uint _id = context->callee().data().toUInt32(); | ||||
68 | #else | ||||
69 | uint _id; | ||||
70 | if (context->callee().isFunction()) | ||||
71 | _id = context->callee().data().toUInt32(); | ||||
72 | else | ||||
73 | _id = 0xBABE0000 + 0; | ||||
74 | #endif | ||||
75 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
76 | _id &= 0x0000FFFF; | ||||
77 | QPropertyAnimation* _q_self = qscriptvalue_cast<QPropertyAnimation*>(context->thisObject()); | ||||
78 | if (!_q_self) { | ||||
79 | return context->throwError(QScriptContext::TypeError, | ||||
80 | QString::fromLatin1("QPropertyAnimation.%0(): this object is not a QPropertyAnimation") | ||||
81 | .arg(qtscript_QPropertyAnimation_function_names[_id+1])); | ||||
82 | } | ||||
83 | | ||||
84 | switch (_id) { | ||||
85 | case 0: { | ||||
86 | QString result = QString::fromLatin1("QPropertyAnimation"); | ||||
87 | return QScriptValue(context->engine(), result); | ||||
88 | } | ||||
89 | | ||||
90 | default: | ||||
91 | Q_ASSERT(false); | ||||
92 | } | ||||
93 | return qtscript_QPropertyAnimation_throw_ambiguity_error_helper(context, | ||||
94 | qtscript_QPropertyAnimation_function_names[_id+1], | ||||
95 | qtscript_QPropertyAnimation_function_signatures[_id+1]); | ||||
96 | } | ||||
97 | | ||||
98 | static QScriptValue qtscript_QPropertyAnimation_static_call(QScriptContext *context, QScriptEngine *) | ||||
99 | { | ||||
100 | uint _id = context->callee().data().toUInt32(); | ||||
101 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
102 | _id &= 0x0000FFFF; | ||||
103 | switch (_id) { | ||||
104 | case 0: | ||||
105 | if (context->thisObject().strictlyEquals(context->engine()->globalObject())) { | ||||
106 | return context->throwError(QString::fromLatin1("QPropertyAnimation(): Did you forget to construct with 'new'?")); | ||||
107 | } | ||||
108 | if (context->argumentCount() == 0) { | ||||
109 | QtScriptShell_QPropertyAnimation* _q_cpp_result = new QtScriptShell_QPropertyAnimation(); | ||||
110 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QPropertyAnimation*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
111 | _q_cpp_result->__qtscript_self = _q_result; | ||||
112 | return _q_result; | ||||
113 | } else if (context->argumentCount() == 1) { | ||||
114 | QObject* _q_arg0 = context->argument(0).toQObject(); | ||||
115 | QtScriptShell_QPropertyAnimation* _q_cpp_result = new QtScriptShell_QPropertyAnimation(_q_arg0); | ||||
116 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QPropertyAnimation*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
117 | _q_cpp_result->__qtscript_self = _q_result; | ||||
118 | return _q_result; | ||||
119 | } else if (context->argumentCount() == 2) { | ||||
120 | QObject* _q_arg0 = context->argument(0).toQObject(); | ||||
121 | | ||||
122 | // TEMPLATE - core.convert_string_arg_to_latin1 - START | ||||
123 | QByteArray _q_arg1 = context->argument(1).toString().toLatin1(); | ||||
124 | // TEMPLATE - core.convert_string_arg_to_latin1 - END | ||||
125 | QtScriptShell_QPropertyAnimation* _q_cpp_result = new QtScriptShell_QPropertyAnimation(_q_arg0, _q_arg1); | ||||
126 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QPropertyAnimation*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
127 | _q_cpp_result->__qtscript_self = _q_result; | ||||
128 | return _q_result; | ||||
129 | } else if (context->argumentCount() == 3) { | ||||
130 | QObject* _q_arg0 = context->argument(0).toQObject(); | ||||
131 | | ||||
132 | // TEMPLATE - core.convert_string_arg_to_latin1 - START | ||||
133 | QByteArray _q_arg1 = context->argument(1).toString().toLatin1(); | ||||
134 | // TEMPLATE - core.convert_string_arg_to_latin1 - END | ||||
135 | QObject* _q_arg2 = context->argument(2).toQObject(); | ||||
136 | QtScriptShell_QPropertyAnimation* _q_cpp_result = new QtScriptShell_QPropertyAnimation(_q_arg0, _q_arg1, _q_arg2); | ||||
137 | QScriptValue _q_result = context->engine()->newQObject(context->thisObject(), (QPropertyAnimation*)_q_cpp_result, QScriptEngine::AutoOwnership); | ||||
138 | _q_cpp_result->__qtscript_self = _q_result; | ||||
139 | return _q_result; | ||||
140 | } | ||||
141 | break; | ||||
142 | | ||||
143 | default: | ||||
144 | Q_ASSERT(false); | ||||
145 | } | ||||
146 | return qtscript_QPropertyAnimation_throw_ambiguity_error_helper(context, | ||||
147 | qtscript_QPropertyAnimation_function_names[_id], | ||||
148 | qtscript_QPropertyAnimation_function_signatures[_id]); | ||||
149 | } | ||||
150 | | ||||
151 | static QScriptValue qtscript_QPropertyAnimation_toScriptValue(QScriptEngine *engine, QPropertyAnimation* const &in) | ||||
152 | { | ||||
153 | return engine->newQObject(in, QScriptEngine::QtOwnership, QScriptEngine::PreferExistingWrapperObject); | ||||
154 | } | ||||
155 | | ||||
156 | static void qtscript_QPropertyAnimation_fromScriptValue(const QScriptValue &value, QPropertyAnimation* &out) | ||||
157 | { | ||||
158 | out = qobject_cast<QPropertyAnimation*>(value.toQObject()); | ||||
159 | } | ||||
160 | | ||||
161 | QScriptValue qtscript_create_QPropertyAnimation_class(QScriptEngine *engine) | ||||
162 | { | ||||
163 | engine->setDefaultPrototype(qMetaTypeId<QPropertyAnimation*>(), QScriptValue()); | ||||
164 | QScriptValue proto = engine->newVariant(qVariantFromValue((QPropertyAnimation*)0)); | ||||
165 | proto.setPrototype(engine->defaultPrototype(qMetaTypeId<QVariantAnimation*>())); | ||||
166 | | ||||
167 | qScriptRegisterMetaType<QPropertyAnimation*>(engine, qtscript_QPropertyAnimation_toScriptValue, | ||||
168 | qtscript_QPropertyAnimation_fromScriptValue, proto); | ||||
169 | | ||||
170 | QScriptValue ctor = engine->newFunction(qtscript_QPropertyAnimation_static_call, proto, qtscript_QPropertyAnimation_function_lengths[0]); | ||||
171 | ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0))); | ||||
172 | | ||||
173 | return ctor; | ||||
174 | } |