From 39d4733b8b7a4d7534ef2a8a531e3146d42bffdb Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Mon, 19 Mar 2012 19:21:07 +0000 Subject: [PATCH 01/54] WIP: update generator to generate qt5 js api --- generator/abstractmetabuilder.cpp | 2 +- generator/classgenerator.cpp | 6 +-- generator/main.h | 5 ++- generator/parser/codemodel_pointer.h | 51 +++++++++++++++++++++++++- generator/typesystem_core-common.xml | 9 ++++- generator/typesystem_core-qtscript.xml | 5 ++- generator/typesystem_core.xml | 15 +++++--- 7 files changed, 77 insertions(+), 16 deletions(-) diff --git a/generator/abstractmetabuilder.cpp b/generator/abstractmetabuilder.cpp index 34fb4db..bd7a07a 100644 --- a/generator/abstractmetabuilder.cpp +++ b/generator/abstractmetabuilder.cpp @@ -1799,7 +1799,7 @@ AbstractMetaType *AbstractMetaBuilder::translateType(const TypeInfo &_typei, boo return t; ClassModelItem item = m_dom->findClass(contexts.at(0)); - if (item != 0) + if (item) contexts += item->baseClasses(); contexts.pop_front(); diff --git a/generator/classgenerator.cpp b/generator/classgenerator.cpp index 75e1f0b..e2318fa 100644 --- a/generator/classgenerator.cpp +++ b/generator/classgenerator.cpp @@ -1059,9 +1059,9 @@ void maybeDeclareMetaType(QTextStream &stream, const QString &typeName, << " static int qt_metatype_id() \\" << endl << " { \\" << endl << " static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \\" << endl - << " if (!metatype_id) \\" << endl - << " metatype_id = qRegisterMetaType< " << name << " >(\"" << name << "\"); \\" << endl - << " return metatype_id; \\" << endl + << " if (!metatype_id.load()) \\" << endl + << " metatype_id.store(qRegisterMetaType< " << name << " >(\"" << name << "\")); \\" << endl + << " return metatype_id.load(); \\" << endl << " } \\" << endl << "};" << endl; } else { diff --git a/generator/main.h b/generator/main.h index ebf153d..9150ea6 100644 --- a/generator/main.h +++ b/generator/main.h @@ -111,8 +111,9 @@ struct Preprocess includes << qtdir; } - foreach (QString include, includes) - preprocess.push_include_path(QDir::convertSeparators(include).toStdString()); + foreach (QString include, includes) { + preprocess.push_include_path(QDir::toNativeSeparators(include).toStdString()); + } QString currentDir = QDir::current().absolutePath(); QFileInfo sourceInfo(sourceFile); diff --git a/generator/parser/codemodel_pointer.h b/generator/parser/codemodel_pointer.h index ac575fe..5e4d859 100644 --- a/generator/parser/codemodel_pointer.h +++ b/generator/parser/codemodel_pointer.h @@ -44,6 +44,55 @@ #include +#if QT_VERSION >= 0x050000 +#include +template class CodeModelPointer: public QAtomicPointer +{ +public: + typedef T Type; + inline CodeModelPointer(T *value = 0) : QAtomicPointer(value) {} + + inline CodeModelPointer &operator=(T *o) { + QAtomicPointer::operator=(o); + return *this; + } + + inline T *data() { return (T *) *this; } + inline const T *data() const { return (const T *) *this; } + inline const T *constData() const { return (const T *) *this; } + + // inline CodeModelPointer(const QAtomicPointer &o) : QAtomicPointer(o) { } +/* + inline CodeModelPointer &operator=(const QAtomicPointer &o) { + QAtomicPointer::operator=(o); + return *this; + } + inline CodeModelPointer &operator=(T *o) { + QAtomicPointer other(o); + QAtomicPointer::operator=(other); + return *this; + }*/ + operator T * () const { + return QAtomicPointer::load(); + } + inline bool operator!() const { return !(bool)*this; } + operator bool () const { + return (bool)QAtomicPointer::load(); + } + +// inline T *data() { return QAtomicPointer::load(); } + // inline const T *data() const { return QAtomicPointer::load(); } + // inline const T *constData() const { return QAtomicPointer::load(); } + inline T *operator->() { return QAtomicPointer::load(); } + inline const T *operator->() const { return QAtomicPointer::load(); } + inline bool operator==(const CodeModelPointer &other) const { return (T*)*this == (T*)other; } + inline bool operator!=(const CodeModelPointer &other) const { return (T*)*this != (T*)other; } + inline bool operator==(const T *ptr) const { return (T*)*this == ptr; } + inline bool operator!=(const T *ptr) const { return (T*)*this != ptr; } +}; + +#else + // Since the atomic API changed in 4.4 we need to hack a little here // to make it work with both 4.3 and 4.4 until that is not required @@ -127,5 +176,5 @@ template Q_INLINE_TEMPLATE CodeModelPointer::CodeModelPointer(T *adata) : d(adata) { if (d) d->ref.ref(); } #endif - +#endif #endif // CODEMODEL_POINTER_H diff --git a/generator/typesystem_core-common.xml b/generator/typesystem_core-common.xml index 0b2673b..0fd297a 100644 --- a/generator/typesystem_core-common.xml +++ b/generator/typesystem_core-common.xml @@ -280,6 +280,7 @@ + @@ -355,6 +356,7 @@ + @@ -392,6 +394,8 @@ + + @@ -941,7 +945,7 @@ - + @@ -1315,6 +1319,9 @@ + + + diff --git a/generator/typesystem_core-qtscript.xml b/generator/typesystem_core-qtscript.xml index 9982ea9..f773219 100644 --- a/generator/typesystem_core-qtscript.xml +++ b/generator/typesystem_core-qtscript.xml @@ -66,6 +66,7 @@ + @@ -212,11 +213,11 @@ - + diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index 3e5d7e0..2fe9838 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -33,7 +33,7 @@ } + @@ -314,6 +314,7 @@ + @@ -389,6 +390,7 @@ + @@ -426,6 +428,8 @@ + + @@ -1443,11 +1447,7 @@ - - - - - + @@ -2123,6 +2123,9 @@ + + + From 8e3ba6bcff5404c8d68c87ff2c6a5228cc8cb1cc Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Mon, 19 Mar 2012 19:21:38 +0000 Subject: [PATCH 02/54] WIP: update qtbindings to support qt5 --- qtbindings/qtscript_core/qtscript_core.pro | 2 ++ qtbindings/qtscript_core/qtscriptconcurrent.h | 21 ++++++++++++++----- qtbindings/qtscript_gui/qtscript_gui.pro | 1 + 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/qtbindings/qtscript_core/qtscript_core.pro b/qtbindings/qtscript_core/qtscript_core.pro index 2dced76..50b73c1 100644 --- a/qtbindings/qtscript_core/qtscript_core.pro +++ b/qtbindings/qtscript_core/qtscript_core.pro @@ -1,4 +1,6 @@ TARGET = qtscript_core include(../qtbindingsbase.pri) SOURCES += $$GENERATEDCPP/com_trolltech_qt_core/plugin.cpp +HEADERS += qtscriptconcurrent.h +QT += concurrent widgets include($$GENERATEDCPP/com_trolltech_qt_core/com_trolltech_qt_core.pri) diff --git a/qtbindings/qtscript_core/qtscriptconcurrent.h b/qtbindings/qtscript_core/qtscriptconcurrent.h index 015b0a2..a2826bd 100644 --- a/qtbindings/qtscript_core/qtscriptconcurrent.h +++ b/qtbindings/qtscript_core/qtscriptconcurrent.h @@ -45,15 +45,26 @@ #ifndef QT_NO_CONCURRENT #include -#include -#include -#include +// #include +#include +#include +#include +#include +#include +//#include +//#include -typedef QFutureWatcher QtScriptVoidFutureWatcher; +//typedef QFutureWatcher QtScriptVoidFutureWatcher; +class QtScriptVoidFutureWatcher : public QFutureWatcher { + Q_OBJECT +}; typedef QFuture QtScriptVoidFuture; typedef QFutureSynchronizer QtScriptVoidFutureSynchronizer; typedef QFuture QtScriptFuture; -typedef QFutureWatcher QtScriptFutureWatcher; +//typedef QFutureWatcher QtScriptFutureWatcher; +class QtScriptFutureWatcher : public QFutureWatcher { + Q_OBJECT +}; typedef QFutureSynchronizer QtScriptFutureSynchronizer; typedef QFutureIterator QtScriptFutureIterator; diff --git a/qtbindings/qtscript_gui/qtscript_gui.pro b/qtbindings/qtscript_gui/qtscript_gui.pro index f3ab584..39c9ec7 100644 --- a/qtbindings/qtscript_gui/qtscript_gui.pro +++ b/qtbindings/qtscript_gui/qtscript_gui.pro @@ -1,4 +1,5 @@ TARGET = qtscript_gui include(../qtbindingsbase.pri) SOURCES += $$GENERATEDCPP/com_trolltech_qt_gui/plugin.cpp +QT += widgets include($$GENERATEDCPP/com_trolltech_qt_gui/com_trolltech_qt_gui.pri) From dbd52ed39c591283c29adf4a2f4282b45d9a9fe5 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Thu, 22 Mar 2012 20:34:45 +0000 Subject: [PATCH 03/54] WIP: pass references from pointers --- generator/abstractmetabuilder.cpp | 33 ++++++------- generator/abstractmetalang.cpp | 69 +++++++++++++++++++++++++-- generator/abstractmetalang.h | 4 +- generator/classgenerator.cpp | 52 ++++++++++++++------ generator/generator.pro | 2 +- generator/main.h | 8 ++-- generator/parser/binder.cpp | 2 +- generator/parser/codemodel_finder.cpp | 2 +- generator/shellimplgenerator.cpp | 8 +++- qtbindings/qs_eval/main.cpp | 2 +- qtbindings/qtbindings.pro | 23 ++++----- 11 files changed, 149 insertions(+), 56 deletions(-) diff --git a/generator/abstractmetabuilder.cpp b/generator/abstractmetabuilder.cpp index bd7a07a..9842636 100644 --- a/generator/abstractmetabuilder.cpp +++ b/generator/abstractmetabuilder.cpp @@ -313,21 +313,21 @@ void AbstractMetaBuilder::traverseStreamOperator(FunctionModelItem item) } void AbstractMetaBuilder::fixQObjectForScope(TypeDatabase *types, - NamespaceModelItem scope) + NamespaceModelItem scope) { foreach (ClassModelItem item, scope->classes()) { QString qualified_name = item->qualifiedName().join("::"); TypeEntry *entry = types->findType(qualified_name); if (entry) { - if (isQObject(qualified_name) && entry->isComplex()) { + if (isQObject(qualified_name) && entry->isComplex()) { ((ComplexTypeEntry *) entry)->setQObject(true); - } - } + } + } } foreach (NamespaceModelItem item, scope->namespaceMap().values()) { if (scope != item) - fixQObjectForScope(types, item); + fixQObjectForScope(types, item); } } @@ -1835,18 +1835,18 @@ AbstractMetaType *AbstractMetaBuilder::translateType(const TypeInfo &_typei, boo if (meta_type->typeEntry()->isContainer()) { ContainerTypeEntry::Type container_type = static_cast(type)->type(); - if (container_type == ContainerTypeEntry::StringListContainer) { - TypeInfo info; - info.setQualifiedName(QStringList() << "QString"); - AbstractMetaType *targ_type = translateType(info, ok); +// if (container_type == ContainerTypeEntry::StringListContainer) { +// TypeInfo info; +// info.setQualifiedName(QStringList() << "QString"); +// AbstractMetaType *targ_type = translateType(info, ok); - Q_ASSERT(*ok); - Q_ASSERT(targ_type); +// Q_ASSERT(*ok); +// Q_ASSERT(targ_type); - meta_type->addInstantiation(targ_type); - meta_type->setInstantiationInCpp(false); +// meta_type->addInstantiation(targ_type); +// meta_type->setInstantiationInCpp(false); - } else { +// } else { foreach (const TypeParser::Info &ta, typeInfo.template_instantiations) { TypeInfo info; info.setConstant(ta.is_constant); @@ -1864,11 +1864,12 @@ AbstractMetaType *AbstractMetaBuilder::translateType(const TypeInfo &_typei, boo meta_type->addInstantiation(targ_type); } - } +// } if (container_type == ContainerTypeEntry::ListContainer || container_type == ContainerTypeEntry::VectorContainer - || container_type == ContainerTypeEntry::StringListContainer) { + ) { +// || container_type == ContainerTypeEntry::StringListContainer) { Q_ASSERT(meta_type->instantiations().size() == 1); } } diff --git a/generator/abstractmetalang.cpp b/generator/abstractmetalang.cpp index 463227d..0fe444e 100644 --- a/generator/abstractmetalang.cpp +++ b/generator/abstractmetalang.cpp @@ -53,7 +53,7 @@ AbstractMetaType *AbstractMetaType::copy() const cpy->setConstant(isConstant()); cpy->setReference(isReference()); cpy->setIndirections(indirections()); - cpy->setInstantiations(instantiations()); + cpy->setInstantiations(instantiations()); cpy->setArrayElementCount(arrayElementCount()); cpy->setOriginalTypeDescription(originalTypeDescription()); cpy->setOriginalTemplateType(originalTemplateType() ? originalTemplateType()->copy() : 0); @@ -439,7 +439,7 @@ bool AbstractMetaFunction::resetObjectAfterUse(int argument_idx) const QList argumentModifications = modification.argument_mods; foreach (ArgumentModification argumentModification, argumentModifications) { if (argumentModification.index == argument_idx && argumentModification.reset_after_use) - return true; + return true; } } @@ -512,6 +512,17 @@ QString AbstractMetaFunction::conversionRule(TypeSystem::Language language, int } } } + //qDebug() << arguments().size() << (key-1) << " x"; + + if ((key > 0) && (arguments().size() > (key-1)) && arguments().at(key-1)->type()->isReference()) { + AbstractMetaType *type = arguments().at(key-1)->type(); + return " qDebug() << \"passing ref "+type->minimalSignature()+"\";QSharedPointer<"+type->minimalNoRefNoConstSignature()+" > _sp%out%;\n" + + type->minimalRef2PtrSignature() + "_p%out% = qscriptvalue_cast<"+type->minimalRef2PtrSignature()+" >(%in%);\n" + + "if (!_p%out%){_sp%out% = ref_qscriptvalue_cast<"+type->minimalNoRefNoConstSignature()+" >(%in%); _p%out% = _sp%out%.data();}else{qDebug() << \"by PTR! :)\";}\n" + + type->minimalSignature() + " %out% = *_p%out%;\n"; + } else if ((key == 0) && type() && type()->isReference()) { + return type()->minimalRef2PtrSignature() + " %out% = &%in%;\n"; + } return QString(); } @@ -632,6 +643,12 @@ QString AbstractMetaFunction::typeReplaced(int key) const } } } + //qDebug() << arguments().size() << (key-1); + if ((key > 0) && (arguments().size() > (key-1)) && arguments().at(key-1)->type()->isReference()) { + return arguments().at(key-1)->type()->minimalRef2PtrSignature(); + } else if ((key == 0) && type() && type()->isReference()) { + return type()->minimalRef2PtrSignature(); + } return QString(); } @@ -1169,7 +1186,7 @@ QPropertySpec *AbstractMetaClass::propertySpecForReset(const QString &name) cons static bool functions_contains(const AbstractMetaFunctionList &l, const AbstractMetaFunction *func) { foreach (const AbstractMetaFunction *f, l) { - if ((f->compareTo(func) & AbstractMetaFunction::PrettySimilar) == AbstractMetaFunction::PrettySimilar) + if ((f->compareTo(func) & AbstractMetaFunction::PrettySimilar) == AbstractMetaFunction::PrettySimilar) return true; } return false; @@ -1870,11 +1887,55 @@ QString AbstractMetaType::minimalSignature() const minimalSignature += ","; minimalSignature += instantiations.at(i)->minimalSignature(); } - minimalSignature += ">"; + minimalSignature += " >"; } + for (int j=0; jqualifiedCppName(); + if (hasInstantiations()) { + QList instantiations = this->instantiations(); + minimalSignature += "<"; + for (int i=0;i 0) + minimalSignature += ","; + minimalSignature += instantiations.at(i)->minimalSignature(); + } + minimalSignature += " >"; + } + + for (int j=0; jqualifiedCppName(); + if (hasInstantiations()) { + QList instantiations = this->instantiations(); + minimalSignature += "<"; + for (int i=0;i 0) + minimalSignature += ","; + minimalSignature += instantiations.at(i)->minimalSignature(); + } + minimalSignature += " >"; + } + for (int j=0; j &insts) { m_instantiations = insts; } + void setInstantiations(const QList &insts) { m_instantiations = insts; } QList instantiations() const { return m_instantiations; } void setInstantiationInCpp(bool incpp) { m_cpp_instantiation = incpp; } bool hasInstantiationInCpp() const { return hasInstantiations() && m_cpp_instantiation; } QString minimalSignature() const; + QString minimalRef2PtrSignature() const; + QString minimalNoRefNoConstSignature() const; // true when the type is a QtJambiObject subclass bool hasNativeId() const; diff --git a/generator/classgenerator.cpp b/generator/classgenerator.cpp index e2318fa..eb4cc1d 100644 --- a/generator/classgenerator.cpp +++ b/generator/classgenerator.cpp @@ -68,9 +68,10 @@ bool ClassGenerator::shouldGenerate(const AbstractMetaClass *meta_class) const static QString normalizedType(const AbstractMetaType *type) { QString str = QString::fromLatin1(QMetaObject::normalizedType(type->cppSignature().toLatin1())); - if (str.endsWith(QLatin1Char('&'))) - str.chop(1); - else if (str.startsWith("const ")) { + //if (str.endsWith(QLatin1Char('&'))) + //str.chop(1); + //else + if (str.startsWith("const ")) { if (str.endsWith('*') || type->hasInstantiations() || type->typeEntry()->isValue()) str.remove(0, 6); } @@ -616,8 +617,8 @@ static void writeConstructorForwarding(QTextStream &stream, stream << "/** signatures:" << endl; foreach (const AbstractMetaFunction *fun, functions) { stream << " * " << fun->signature() << endl; - } - stream << " */" << endl; + } + stream << " */" << endl; #endif if (/*meta_class->isAbstract() ||*/ (functions.size() == 0)) { @@ -1013,7 +1014,7 @@ static void writeEnumClass(QTextStream &stream, const AbstractMetaClass *meta_cl << "{" << endl << " QVariant thisObj = context->thisObject().toVariant();" << endl << " QVariant otherObj = context->argument(0).toVariant();" << endl - + << " return QScriptValue(engine, ((thisObj.userType() == otherObj.userType()) &&" << endl << " (thisObj.value<" << qualifiedFlagsName << ">() == otherObj.value<" << qualifiedFlagsName << ">())));" << endl << "}" << endl << endl; @@ -1044,10 +1045,30 @@ static void writeEnumClass(QTextStream &stream, const AbstractMetaClass *meta_cl void maybeDeclareMetaType(QTextStream &stream, const QString &typeName, QSet ®isteredTypeNames) { + if (typeName == QLatin1String("QFile")) + return; + if (typeName == QLatin1String("QFuture")) + return; + if (typeName == QLatin1String("QXmlStreamReader")) + return; + if (typeName == QLatin1String("QDataStream")) + return; + if (typeName == QLatin1String("QTextStream")) + return; + +// if (typeName == QLatin1String("QStringList")) +// return; // ### wtf... +// if (typeName == QLatin1String("const QStringList*")) +// return; // ### wtf... QString name = typeName; - if (name.endsWith(QLatin1Char('&'))) + if (name.endsWith(QLatin1Char('&'))) { name.chop(1); - if (registeredTypeNames.contains(name) || (QMetaType::type(typeName.toLatin1()) != 0)) + name += "*"; + } + QString nameFootPrint = name; + nameFootPrint.replace("uint", "unsigned int"); + nameFootPrint.replace(" ", ""); + if (registeredTypeNames.contains(nameFootPrint) || (QMetaType::type(name.toLatin1()) != 0)) return; if (name.contains(QLatin1Char(','))) { // need to expand the Q_DECLARE_METATYPE macro manually, @@ -1067,7 +1088,7 @@ void maybeDeclareMetaType(QTextStream &stream, const QString &typeName, } else { stream << "Q_DECLARE_METATYPE(" << name << ")" << endl; } - registeredTypeNames << name; + registeredTypeNames << nameFootPrint; } /*! @@ -1083,8 +1104,6 @@ static void declareTypeRecursive(QTextStream &stream, const AbstractMetaType *ty for (int i = 0; i < subTypes.size(); ++i) declareTypeRecursive(stream, subTypes.at(i), registeredTypeNames); QString typeName = normalizedType(type); - if (typeName == QLatin1String("QStringList")) - return; // ### wtf... maybeDeclareMetaType(stream, typeName, registeredTypeNames); } @@ -1108,6 +1127,9 @@ void declareFunctionMetaTypes(QTextStream &stream, const AbstractMetaFunctionLis QString repl = fun->typeReplaced(j+1); if (!repl.isEmpty()) { maybeDeclareMetaType(stream, repl, registeredTypeNames); + if (arguments.at(j)->type()->isReference()) { + maybeDeclareMetaType(stream, arguments.at(j)->type()->minimalNoRefNoConstSignature(), registeredTypeNames); + } } else { const AbstractMetaArgument *arg = arguments.at(j); declareTypeRecursive(stream, arg->type(), registeredTypeNames); @@ -1178,8 +1200,8 @@ static void writeFunctionForwarding(QTextStream &stream, const AbstractMetaClass stream << "/** signatures:" << endl; foreach (const AbstractMetaFunction *fun, functions) { stream << " * " << fun->signature() << endl; - } - stream << " */" << endl; + } + stream << " */" << endl; #endif QMap argcToFunctions; argcToFunctions = createArgcToFunctionsMap(functions); @@ -1266,7 +1288,7 @@ static void writePrototypeCall(QTextStream &s, const AbstractMetaClass *meta_cla s << ")"; #endif s << ";" << endl - << " if (!_q_self) {" << endl + << " if (!_q_self) {" << endl << " return context->throwError(QScriptContext::TypeError," << endl << " QString::fromLatin1(\"" << meta_class->name() << ".%0(): this object is not a " << meta_class->name() << "\")" << endl @@ -1480,6 +1502,8 @@ void ClassGenerator::write(QTextStream &stream, const AbstractMetaClass *meta_cl stream << "#include " << endl; stream << "#include " << endl; stream << endl; + stream << "#include \"../lib/shared.h\"" << endl; + stream << endl; // write class-specific includes { diff --git a/generator/generator.pro b/generator/generator.pro index 6eac5ac..d11a783 100644 --- a/generator/generator.pro +++ b/generator/generator.pro @@ -11,7 +11,7 @@ HEADERS += \ shellheadergenerator.h \ setupgenerator.h \ docgenerator.h - + SOURCES += \ generatorsetqtscript.cpp \ metaqtscriptbuilder.cpp \ diff --git a/generator/main.h b/generator/main.h index 9150ea6..bc9334e 100644 --- a/generator/main.h +++ b/generator/main.h @@ -80,11 +80,11 @@ struct Preprocess // Environment INCLUDE QString includePath = getenv("INCLUDE"); if (!includePath.isEmpty()) - includes += includePath.split(path_splitter); + includes += includePath.split(path_splitter); // Includes from the command line if (!commandLineIncludes.isEmpty()) - includes += commandLineIncludes.split(path_splitter); + includes += commandLineIncludes.split(path_splitter); // Include Qt QString qtdir = getenv ("QTDIR"); @@ -112,12 +112,12 @@ struct Preprocess } foreach (QString include, includes) { - preprocess.push_include_path(QDir::toNativeSeparators(include).toStdString()); + preprocess.push_include_path(QDir::toNativeSeparators(include).toStdString()); } QString currentDir = QDir::current().absolutePath(); QFileInfo sourceInfo(sourceFile); - QDir::setCurrent(sourceInfo.absolutePath()); + QDir::setCurrent(sourceInfo.absolutePath()); std::string result; result.reserve (20 * 1024); // 20K diff --git a/generator/parser/binder.cpp b/generator/parser/binder.cpp index 884a724..301154f 100644 --- a/generator/parser/binder.cpp +++ b/generator/parser/binder.cpp @@ -748,7 +748,7 @@ static QString strip_preprocessor_lines(const QString &name) void Binder::visitEnumerator(EnumeratorAST *node) { - Q_ASSERT(_M_current_enum != 0); + Q_ASSERT(_M_current_enum.data() != 0); EnumeratorModelItem e = model()->create(); updateItemPosition (e->toItem(), node); e->setName(decode_symbol(node->id)->as_string()); diff --git a/generator/parser/codemodel_finder.cpp b/generator/parser/codemodel_finder.cpp index 634b46b..982f930 100644 --- a/generator/parser/codemodel_finder.cpp +++ b/generator/parser/codemodel_finder.cpp @@ -59,7 +59,7 @@ CodeModelFinder::~CodeModelFinder() ScopeModelItem CodeModelFinder::resolveScope(NameAST *name, ScopeModelItem scope) { - Q_ASSERT(scope != 0); + Q_ASSERT(scope.data() != 0); ResolvePolicy saved_resolve_policy = _M_resolve_policy; _M_resolve_policy = ResolveScope; diff --git a/generator/shellimplgenerator.cpp b/generator/shellimplgenerator.cpp index 047a4c0..50b9f8f 100644 --- a/generator/shellimplgenerator.cpp +++ b/generator/shellimplgenerator.cpp @@ -52,7 +52,7 @@ QString ShellImplGenerator::fileNameForClass(const AbstractMetaClass *meta_class return QString("qtscriptshell_%1.cpp").arg(meta_class->name()); } -static bool include_less_than(const Include &a, const Include &b) +static bool include_less_than(const Include &a, const Include &b) { return a.name < b.name; } @@ -211,8 +211,12 @@ void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla AbstractMetaType *atype = args.at(j)->type(); QString asig = atype->cppSignature(); bool constCastArg = asig.endsWith('*') && asig.startsWith("const "); - if (constCastArg) + if (constCastArg) { s << "const_cast<" << asig.mid(6) << ">("; + } + if (atype->isReference()) { + s << "&"; + } s << args.at(i)->argumentName() << ")"; if (constCastArg) s << ")"; diff --git a/qtbindings/qs_eval/main.cpp b/qtbindings/qs_eval/main.cpp index 607747a..284e5f6 100644 --- a/qtbindings/qs_eval/main.cpp +++ b/qtbindings/qs_eval/main.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include diff --git a/qtbindings/qtbindings.pro b/qtbindings/qtbindings.pro index 8535ed0..1e6711e 100644 --- a/qtbindings/qtbindings.pro +++ b/qtbindings/qtbindings.pro @@ -1,13 +1,14 @@ TEMPLATE = subdirs SUBDIRS = qtscript_core \ - qtscript_gui \ - qtscript_network \ - qtscript_opengl \ - qtscript_sql \ - qtscript_svg \ - qtscript_xml \ - qtscript_phonon \ - qtscript_webkit \ - qtscript_xmlpatterns \ - qtscript_uitools \ - qs_eval + qtscript_gui \ + qtscript_network \ + qtscript_opengl \ + qtscript_sql \ + qtscript_xml \ + qs_eval + +# qtscript_svg \ +# qtscript_phonon \ +# qtscript_webkit \ +# qtscript_xmlpatterns \ +# qtscript_uitools \ From 07f4edd4bc6de0d6d5fdb02df8af973773c173dc Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Thu, 22 Mar 2012 20:37:01 +0000 Subject: [PATCH 04/54] WIP: adjust typesystem for qt5 --- generator/typesystem_core-qtscript.xml | 63 ++++++++-- generator/typesystem_core.xml | 63 ++++++++-- generator/typesystem_gui-common.xml | 134 +++++++++------------- generator/typesystem_gui-qtscript.xml | 23 ++++ generator/typesystem_gui.xml | 153 ++++++++++++------------- 5 files changed, 253 insertions(+), 183 deletions(-) diff --git a/generator/typesystem_core-qtscript.xml b/generator/typesystem_core-qtscript.xml index f773219..6254140 100644 --- a/generator/typesystem_core-qtscript.xml +++ b/generator/typesystem_core-qtscript.xml @@ -1038,12 +1038,18 @@ - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + @@ -1053,12 +1059,18 @@ - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + @@ -1066,7 +1078,10 @@ - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + @@ -1074,7 +1089,10 @@ - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + @@ -1082,17 +1100,26 @@ - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + @@ -1100,17 +1127,26 @@ - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + @@ -1119,7 +1155,10 @@ - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index 2fe9838..3ca4068 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -2368,24 +2368,36 @@ - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + @@ -2399,7 +2411,10 @@ - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + @@ -2410,7 +2425,10 @@ - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + @@ -2419,17 +2437,26 @@ - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + @@ -2437,17 +2464,26 @@ - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + - + + + const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); + @@ -2460,7 +2496,10 @@ - + + + const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); + diff --git a/generator/typesystem_gui-common.xml b/generator/typesystem_gui-common.xml index 61f33e4..5f957bb 100644 --- a/generator/typesystem_gui-common.xml +++ b/generator/typesystem_gui-common.xml @@ -43,6 +43,7 @@ + @@ -73,6 +74,7 @@ + @@ -88,15 +90,25 @@ - - + + - - - + + + + + + + + + + + + + @@ -122,9 +134,9 @@ + - @@ -144,10 +156,10 @@ - - - - + + + + @@ -305,13 +317,13 @@ - + - - + + @@ -327,8 +339,6 @@ - - @@ -344,7 +354,7 @@ - + @@ -363,8 +373,8 @@ - - + + @@ -405,10 +415,10 @@ - - - - + + + + @@ -547,60 +557,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -734,11 +709,11 @@ - + @@ -1388,16 +1363,6 @@ - - - - - - - - - - @@ -1610,18 +1575,24 @@ + - - - - - - - + @@ -2349,6 +2320,7 @@ + @@ -3860,6 +3832,7 @@ + diff --git a/generator/typesystem_gui-qtscript.xml b/generator/typesystem_gui-qtscript.xml index 2b3fc61..db39735 100644 --- a/generator/typesystem_gui-qtscript.xml +++ b/generator/typesystem_gui-qtscript.xml @@ -34,6 +34,29 @@ + + + + + + + QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); + + + jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false); + QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0; + + + + + + + + QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); + + + + diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml index dce3bd9..ac519d9 100644 --- a/generator/typesystem_gui.xml +++ b/generator/typesystem_gui.xml @@ -43,6 +43,7 @@ + @@ -73,6 +74,7 @@ + @@ -88,15 +90,25 @@ - - + + - + + + + + + + + + + + - + @@ -122,9 +134,9 @@ + - @@ -144,10 +156,10 @@ - - - - + + + + @@ -305,13 +317,13 @@ - + - - + + @@ -327,8 +339,6 @@ - - @@ -344,7 +354,7 @@ - + @@ -363,8 +373,8 @@ - - + + @@ -405,10 +415,10 @@ - - - - + + + + @@ -553,60 +563,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -799,11 +774,11 @@ - + @@ -1620,16 +1595,6 @@ - - - - - - - - - - @@ -1891,18 +1856,24 @@ + - - - - - - - + @@ -1910,6 +1881,27 @@ + + + + + + QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); + + + jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false); + QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0; + + + + + + + + QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); + + + @@ -2673,6 +2665,7 @@ + @@ -4290,6 +4283,7 @@ + From 3ce7da1121ff129c935eacc630c1581d8998d2fd Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Thu, 22 Mar 2012 23:34:49 +0000 Subject: [PATCH 05/54] WIP: rework typecasting between cpp and js --- generator/abstractmetalang.cpp | 32 ++++++++++----------- generator/classgenerator.cpp | 43 ++++++++++++++++++++-------- generator/shellimplgenerator.cpp | 8 +++--- generator/typesystem_core-common.xml | 1 + generator/typesystem_core.xml | 1 + generator/typesystem_gui-common.xml | 3 ++ generator/typesystem_gui.xml | 2 ++ 7 files changed, 58 insertions(+), 32 deletions(-) diff --git a/generator/abstractmetalang.cpp b/generator/abstractmetalang.cpp index 0fe444e..38c4585 100644 --- a/generator/abstractmetalang.cpp +++ b/generator/abstractmetalang.cpp @@ -514,15 +514,15 @@ QString AbstractMetaFunction::conversionRule(TypeSystem::Language language, int } //qDebug() << arguments().size() << (key-1) << " x"; - if ((key > 0) && (arguments().size() > (key-1)) && arguments().at(key-1)->type()->isReference()) { - AbstractMetaType *type = arguments().at(key-1)->type(); - return " qDebug() << \"passing ref "+type->minimalSignature()+"\";QSharedPointer<"+type->minimalNoRefNoConstSignature()+" > _sp%out%;\n" - + type->minimalRef2PtrSignature() + "_p%out% = qscriptvalue_cast<"+type->minimalRef2PtrSignature()+" >(%in%);\n" - + "if (!_p%out%){_sp%out% = ref_qscriptvalue_cast<"+type->minimalNoRefNoConstSignature()+" >(%in%); _p%out% = _sp%out%.data();}else{qDebug() << \"by PTR! :)\";}\n" - + type->minimalSignature() + " %out% = *_p%out%;\n"; - } else if ((key == 0) && type() && type()->isReference()) { - return type()->minimalRef2PtrSignature() + " %out% = &%in%;\n"; - } +// if ((key > 0) && (arguments().size() > (key-1)) && arguments().at(key-1)->type()->isReference()) { +// AbstractMetaType *type = arguments().at(key-1)->type(); +// return " qDebug() << \"passing ref "+type->minimalSignature()+"\";QSharedPointer<"+type->minimalNoRefNoConstSignature()+" > _sp%out%;\n" +// + type->minimalRef2PtrSignature() + "_p%out% = qscriptvalue_cast<"+type->minimalRef2PtrSignature()+" >(%in%);\n" +// + "if (!_p%out%){_sp%out% = ref_qscriptvalue_cast<"+type->minimalNoRefNoConstSignature()+" >(%in%); _p%out% = _sp%out%.data();}else{qDebug() << \"by PTR! :)\";}\n" +// + type->minimalSignature() + " %out% = *_p%out%;\n"; +// } else if ((key == 0) && type() && type()->isReference()) { +// return type()->minimalRef2PtrSignature() + " %out% = &%in%;\n"; +// } return QString(); } @@ -644,11 +644,11 @@ QString AbstractMetaFunction::typeReplaced(int key) const } } //qDebug() << arguments().size() << (key-1); - if ((key > 0) && (arguments().size() > (key-1)) && arguments().at(key-1)->type()->isReference()) { - return arguments().at(key-1)->type()->minimalRef2PtrSignature(); - } else if ((key == 0) && type() && type()->isReference()) { - return type()->minimalRef2PtrSignature(); - } +// if ((key > 0) && (arguments().size() > (key-1)) && arguments().at(key-1)->type()->isReference()) { +// return arguments().at(key-1)->type()->minimalRef2PtrSignature(); +// } else if ((key == 0) && type() && type()->isReference()) { +// return type()->minimalRef2PtrSignature(); +// } return QString(); } @@ -1901,8 +1901,8 @@ QString AbstractMetaType::minimalSignature() const QString AbstractMetaType::minimalRef2PtrSignature() const { QString minimalSignature; - if (isConstant()) - minimalSignature += "const "; +// if (isConstant()) +// minimalSignature += "const "; minimalSignature += typeEntry()->qualifiedCppName(); if (hasInstantiations()) { QList instantiations = this->instantiations(); diff --git a/generator/classgenerator.cpp b/generator/classgenerator.cpp index eb4cc1d..2a5172a 100644 --- a/generator/classgenerator.cpp +++ b/generator/classgenerator.cpp @@ -68,13 +68,19 @@ bool ClassGenerator::shouldGenerate(const AbstractMetaClass *meta_class) const static QString normalizedType(const AbstractMetaType *type) { QString str = QString::fromLatin1(QMetaObject::normalizedType(type->cppSignature().toLatin1())); - //if (str.endsWith(QLatin1Char('&'))) - //str.chop(1); - //else - if (str.startsWith("const ")) { - if (str.endsWith('*') || type->hasInstantiations() || type->typeEntry()->isValue()) + if (str.endsWith(QLatin1Char('&'))) { + str.chop(1); + } +// if (str.startsWith("const ")) { +// if (str.endsWith('*') || type->hasInstantiations() || type->typeEntry()->isValue()) +// str.remove(0, 6); +// } + if (!str.endsWith(QLatin1Char('*'))) { + if (str.startsWith("const ")) { str.remove(0, 6); + } } + if (str == QLatin1String("QBool")) // ### hack str = QLatin1String("bool"); return str; @@ -504,7 +510,7 @@ static void writeFunctionCallAndReturn(QTextStream &stream, const AbstractMetaFu bool constCastResult = false; if (retType && !ignoreReturnValue) { QString rsig = retType->cppSignature(); - QString typeName = normalizedType(retType); + QString typeName = retType->minimalSignature();//normalizedType(retType); // stream << typeName << " _q_result = "; constCastResult = rsig.endsWith('*') && rsig.startsWith("const "); if (constCastResult) @@ -564,7 +570,11 @@ static void writeFunctionCallAndReturn(QTextStream &stream, const AbstractMetaFu stream << "QScriptValue"; else stream << "qScriptValueFromValue"; - stream << "(context->engine(), _q_result);"; + stream << "(context->engine(), "; +// if (retType->isReference()) { +// stream << "&"; +// } + stream << "_q_result);"; } else { stream << "context->engine()->undefinedValue();"; } @@ -1063,7 +1073,11 @@ void maybeDeclareMetaType(QTextStream &stream, const QString &typeName, QString name = typeName; if (name.endsWith(QLatin1Char('&'))) { name.chop(1); - name += "*"; + } + if (!name.endsWith(QLatin1Char('*'))) { + if (name.startsWith("const ")) { + name.remove(0, 6); + } } QString nameFootPrint = name; nameFootPrint.replace("uint", "unsigned int"); @@ -1103,7 +1117,7 @@ static void declareTypeRecursive(QTextStream &stream, const AbstractMetaType *ty QList subTypes = type->instantiations(); for (int i = 0; i < subTypes.size(); ++i) declareTypeRecursive(stream, subTypes.at(i), registeredTypeNames); - QString typeName = normalizedType(type); + QString typeName = type->minimalSignature();//normalizedType(type); maybeDeclareMetaType(stream, typeName, registeredTypeNames); } @@ -1127,12 +1141,17 @@ void declareFunctionMetaTypes(QTextStream &stream, const AbstractMetaFunctionLis QString repl = fun->typeReplaced(j+1); if (!repl.isEmpty()) { maybeDeclareMetaType(stream, repl, registeredTypeNames); - if (arguments.at(j)->type()->isReference()) { - maybeDeclareMetaType(stream, arguments.at(j)->type()->minimalNoRefNoConstSignature(), registeredTypeNames); - } +// if (arguments.at(j)->type()->isReference()) { +// maybeDeclareMetaType(stream, repl, registeredTypeNames); +// maybeDeclareMetaType(stream, arguments.at(j)->type()->minimalRef2PtrSignature(), registeredTypeNames); +// } } else { const AbstractMetaArgument *arg = arguments.at(j); declareTypeRecursive(stream, arg->type(), registeredTypeNames); + if (arguments.at(j)->type()->isReference()) { + maybeDeclareMetaType(stream, arguments.at(j)->type()->minimalNoRefNoConstSignature(), registeredTypeNames); + maybeDeclareMetaType(stream, arguments.at(j)->type()->minimalRef2PtrSignature(), registeredTypeNames); + } } } QString retRepl = fun->typeReplaced(0); diff --git a/generator/shellimplgenerator.cpp b/generator/shellimplgenerator.cpp index 50b9f8f..d699f3f 100644 --- a/generator/shellimplgenerator.cpp +++ b/generator/shellimplgenerator.cpp @@ -212,11 +212,11 @@ void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla QString asig = atype->cppSignature(); bool constCastArg = asig.endsWith('*') && asig.startsWith("const "); if (constCastArg) { - s << "const_cast<" << asig.mid(6) << ">("; - } - if (atype->isReference()) { - s << "&"; + s << "const_cast<" << asig << ">("; } +// if (atype->isReference()) { +// s << "&"; +// } s << args.at(i)->argumentName() << ")"; if (constCastArg) s << ")"; diff --git a/generator/typesystem_core-common.xml b/generator/typesystem_core-common.xml index 0fd297a..c42d0d4 100644 --- a/generator/typesystem_core-common.xml +++ b/generator/typesystem_core-common.xml @@ -416,6 +416,7 @@ + diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index 3ca4068..e0ecd4c 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -450,6 +450,7 @@ + diff --git a/generator/typesystem_gui-common.xml b/generator/typesystem_gui-common.xml index 5f957bb..bc17cde 100644 --- a/generator/typesystem_gui-common.xml +++ b/generator/typesystem_gui-common.xml @@ -107,6 +107,8 @@ + + @@ -707,6 +709,7 @@ + + diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml index c959fda..4533164 100644 --- a/generator/typesystem_gui.xml +++ b/generator/typesystem_gui.xml @@ -517,6 +517,8 @@ + + @@ -5157,6 +5159,7 @@ + diff --git a/generator/typesystem_network-common.xml b/generator/typesystem_network-common.xml index c33be39..942bbef 100644 --- a/generator/typesystem_network-common.xml +++ b/generator/typesystem_network-common.xml @@ -7,6 +7,8 @@ + + diff --git a/generator/typesystem_network.xml b/generator/typesystem_network.xml index 0ed8f31..1cf04fd 100644 --- a/generator/typesystem_network.xml +++ b/generator/typesystem_network.xml @@ -8,6 +8,8 @@ + + From f9453e3b6191dd09ea77416202275d32571c445e Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Tue, 9 Oct 2012 23:39:03 +0100 Subject: [PATCH 11/54] QT bindings are now possible to compile with QT5 --- generator/classgenerator.cpp | 2 + generator/setupgenerator.cpp | 85 -------------- generator/shellheadergenerator.cpp | 4 +- generator/typesystem_core-common.xml | 1 - generator/typesystem_core.xml | 1 - qtbindings/qtbindingsbase.pri | 2 +- .../qtscript_core/include/__package_shared.h | 39 +++++++ qtbindings/qtscript_core/qtscript_core.pro | 5 +- .../qtscript_gui/include/__package_shared.h | 109 ++++++++++++++++++ qtbindings/qtscript_gui/qtscript_gui.pro | 4 +- .../include/__package_shared.h | 3 + .../qtscript_network/qtscript_network.pro | 2 +- .../include/__package_shared.h | 3 + .../qtscript_opengl/qtscript_opengl.pro | 2 +- .../include/__package_shared.h | 3 + .../qtscript_phonon/qtscript_phonon.pro | 2 +- .../qtscript_sql/include/__package_shared.h | 3 + qtbindings/qtscript_sql/qtscript_sql.pro | 2 +- .../qtscript_svg/include/__package_shared.h | 3 + qtbindings/qtscript_svg/qtscript_svg.pro | 2 +- .../include/__package_shared.h | 3 + .../qtscript_uitools/qtscript_uitools.pro | 2 +- .../include/__package_shared.h | 3 + .../qtscript_webkit/qtscript_webkit.pro | 2 +- .../qtscript_xml/include/__package_shared.h | 3 + qtbindings/qtscript_xml/qtscript_xml.pro | 2 +- .../include/__package_shared.h | 3 + .../qtscript_xmlpatterns.pro | 2 +- 28 files changed, 196 insertions(+), 101 deletions(-) create mode 100644 qtbindings/qtscript_core/include/__package_shared.h create mode 100644 qtbindings/qtscript_gui/include/__package_shared.h create mode 100644 qtbindings/qtscript_network/include/__package_shared.h create mode 100644 qtbindings/qtscript_opengl/include/__package_shared.h create mode 100644 qtbindings/qtscript_phonon/include/__package_shared.h create mode 100644 qtbindings/qtscript_sql/include/__package_shared.h create mode 100644 qtbindings/qtscript_svg/include/__package_shared.h create mode 100644 qtbindings/qtscript_uitools/include/__package_shared.h create mode 100644 qtbindings/qtscript_webkit/include/__package_shared.h create mode 100644 qtbindings/qtscript_xml/include/__package_shared.h create mode 100644 qtbindings/qtscript_xmlpatterns/include/__package_shared.h diff --git a/generator/classgenerator.cpp b/generator/classgenerator.cpp index c7351ce..5d10558 100644 --- a/generator/classgenerator.cpp +++ b/generator/classgenerator.cpp @@ -1497,6 +1497,8 @@ void ClassGenerator::write(QTextStream &stream, const AbstractMetaClass *meta_cl stream << "#include " << endl; stream << "#include " << endl; stream << "#include " << endl; + + stream << "#include <__package_shared.h>" << endl; stream << endl; // write class-specific includes diff --git a/generator/setupgenerator.cpp b/generator/setupgenerator.cpp index 030f1fc..3eb2f61 100644 --- a/generator/setupgenerator.cpp +++ b/generator/setupgenerator.cpp @@ -66,13 +66,6 @@ void SetupGenerator::generate() continue; QString packName = pack.key(); - QStringList components = packName.split("."); - if ((components.size() > 2) && (components.at(0) == "com") - && (components.at(1) == "trolltech")) { - // kill com.trolltech in key - components.removeAt(0); - components.removeAt(0); - } packName.replace(".", "_"); { @@ -253,83 +246,5 @@ void SetupGenerator::generate() ++m_num_generated_written; ++m_num_generated; } - - { - FileOut pluginFile(m_out_dir + "/generated_cpp/" + packName + "/plugin.cpp"); - QTextStream &s = pluginFile.stream; - - if (FileOut::license) - writeQtScriptQtBindingsLicense(s); - - s << "#include " << endl - << "#include " << endl - << "#include " << endl << endl; - - // declare the init function - s << "void qtscript_initialize_" << packName << "_bindings(QScriptValue &);" << endl << endl; - - // plugin class declaration - s << "class " << packName << "_ScriptPlugin : public QScriptExtensionPlugin" << endl - << "{" << endl - << "public:" << endl - << " QStringList keys() const;" << endl - << " void initialize(const QString &key, QScriptEngine *engine);" << endl - << "};" << endl - << "" << endl; - - // keys() - s << "QStringList " << packName << "_ScriptPlugin::keys() const" << endl - << "{" << endl - << " QStringList list;" << endl; - { - QString key; - for (int i = 0; i < components.size(); ++i) { - if (i > 0) - key.append("."); - key.append(components.at(i)); - s << " list << QLatin1String(\"" << key << "\");" << endl; - } - } - s << " return list;" << endl - << "}" << endl; - - // initialize() - s << endl - << "void " << packName << "_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine)" << endl - << "{"; - { - QString key; - for (int i = 0; i < components.size(); ++i) { - s << endl << " "; - if (i > 0) { - key.append("."); - s << "} else "; - } - key.append(components.at(i)); - s << "if (key == QLatin1String(\"" << key << "\")) {"; - } - } - s << endl << " QScriptValue extensionObject = "; - // ### generalize - if (packName == "com.trolltech.qt.phonon") - s << "setupPackage(\"phonon\", engine)"; - else - s << "engine->globalObject()"; - s << ";" << endl; - - s << " qtscript_initialize_" << packName << "_bindings(extensionObject);" << endl; - - s << " } else {" << endl - << " Q_ASSERT_X(false, \"" << packName << "::initialize\", qPrintable(key));" << endl - << " }" << endl - << "}" << endl << endl; - - s << "Q_EXPORT_STATIC_PLUGIN(" << packName << "_ScriptPlugin)" << endl - << "Q_EXPORT_PLUGIN2(qtscript_" << packName.toLower() << ", " << packName << "_ScriptPlugin)" << endl; - - if (pluginFile.done()) - ++m_num_generated_written; - ++m_num_generated; - } } } diff --git a/generator/shellheadergenerator.cpp b/generator/shellheadergenerator.cpp index bbd4459..d48953f 100644 --- a/generator/shellheadergenerator.cpp +++ b/generator/shellheadergenerator.cpp @@ -76,7 +76,9 @@ void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c s << "\""; s << endl << endl; - s << "#include " << endl << endl; + s << "#include " << endl; + s << "#include <__package_shared.h>" << endl; + s << endl; QString packName = meta_class->package().replace(".", "_"); diff --git a/generator/typesystem_core-common.xml b/generator/typesystem_core-common.xml index c3a38d3..7c2c091 100644 --- a/generator/typesystem_core-common.xml +++ b/generator/typesystem_core-common.xml @@ -507,7 +507,6 @@ - diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index 922fd7b..8bafdae 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -545,7 +545,6 @@ - diff --git a/qtbindings/qtbindingsbase.pri b/qtbindings/qtbindingsbase.pri index 8ad8d80..ee9bed6 100644 --- a/qtbindings/qtbindingsbase.pri +++ b/qtbindings/qtbindingsbase.pri @@ -3,6 +3,6 @@ DEPENDPATH += . INCLUDEPATH += . DESTDIR = $$PWD/../plugins/script QT += script -CONFIG += debug_and_release +CONFIG += plugin debug_and_release build_all GENERATEDCPP = $$PWD/../generated_cpp TARGET=$$qtLibraryTarget($$TARGET) diff --git a/qtbindings/qtscript_core/include/__package_shared.h b/qtbindings/qtscript_core/include/__package_shared.h new file mode 100644 index 0000000..62d3c51 --- /dev/null +++ b/qtbindings/qtscript_core/include/__package_shared.h @@ -0,0 +1,39 @@ + +#pragma once + +#include + +#include +#include + +Q_DECLARE_METATYPE(QEvent) + +template <> +inline void *qMetaTypeCreateHelper(const void *t) +{ + if (t) + return new QEvent(*static_cast(t)); + return new QEvent(QEvent::None); +} + +template <> +inline void *qMetaTypeConstructHelper(void *where, const void *t) +{ + if (t) + return new (where) QEvent(*static_cast(t)); + return new (where) QEvent(QEvent::None); +} + +template <> +inline QEvent qscriptvalue_cast(const QScriptValue &value) +{ + QEvent t(QEvent::None); + const int id = qMetaTypeId(); + + if (qscriptvalue_cast_helper(value, id, &t)) + return t; + + return QEvent(QEvent::None); +} + + diff --git a/qtbindings/qtscript_core/qtscript_core.pro b/qtbindings/qtscript_core/qtscript_core.pro index 50b73c1..b8a878a 100644 --- a/qtbindings/qtscript_core/qtscript_core.pro +++ b/qtbindings/qtscript_core/qtscript_core.pro @@ -1,6 +1,7 @@ TARGET = qtscript_core include(../qtbindingsbase.pri) -SOURCES += $$GENERATEDCPP/com_trolltech_qt_core/plugin.cpp -HEADERS += qtscriptconcurrent.h +SOURCES += plugin.cpp +HEADERS += qtscriptconcurrent.h plugin.h +INCLUDEPATH += ./include/ QT += concurrent widgets include($$GENERATEDCPP/com_trolltech_qt_core/com_trolltech_qt_core.pri) diff --git a/qtbindings/qtscript_gui/include/__package_shared.h b/qtbindings/qtscript_gui/include/__package_shared.h new file mode 100644 index 0000000..d4c1210 --- /dev/null +++ b/qtbindings/qtscript_gui/include/__package_shared.h @@ -0,0 +1,109 @@ + +#pragma once + +#include +#include +#include + +#include +#include + +Q_DECLARE_METATYPE(QFontInfo) +Q_DECLARE_METATYPE(QFontMetrics) +Q_DECLARE_METATYPE(QFontMetricsF) + + + +template <> +inline void *qMetaTypeCreateHelper(const void *t) +{ + if (t) + return new QFontInfo(*static_cast(t)); + return new QFontInfo(QFont()); +} + +template <> +inline void *qMetaTypeConstructHelper(void *where, const void *t) +{ + if (t) + return new (where) QFontInfo(*static_cast(t)); + return new (where) QFontInfo(QFont()); +} + +template <> +inline QFontInfo qscriptvalue_cast(const QScriptValue &value) +{ + QFont f; + QFontInfo t(f); + const int id = qMetaTypeId(); + + if (qscriptvalue_cast_helper(value, id, (void*)&t)) + return t; + + return QFontInfo(QFont()); +} + + + + + +template <> +inline void *qMetaTypeCreateHelper(const void *t) +{ + if (t) + return new QFontMetrics(*static_cast(t)); + return new QFontMetrics(QFont()); +} + +template <> +inline void *qMetaTypeConstructHelper(void *where, const void *t) +{ + if (t) + return new (where) QFontMetrics(*static_cast(t)); + return new (where) QFontMetrics(QFont()); +} + +template <> +inline QFontMetrics qscriptvalue_cast(const QScriptValue &value) +{ + QFont f; + QFontMetrics t(f); + const int id = qMetaTypeId(); + + if (qscriptvalue_cast_helper(value, id, (void*)&t)) + return t; + + return QFontMetrics(QFont()); +} + + + + +template <> +inline void *qMetaTypeCreateHelper(const void *t) +{ + if (t) + return new QFontMetricsF(*static_cast(t)); + return new QFontMetricsF(QFont()); +} + +template <> +inline void *qMetaTypeConstructHelper(void *where, const void *t) +{ + if (t) + return new (where) QFontMetricsF(*static_cast(t)); + return new (where) QFontMetricsF(QFont()); +} + +template <> +inline QFontMetricsF qscriptvalue_cast(const QScriptValue &value) +{ + QFont f; + QFontMetricsF t(f); + const int id = qMetaTypeId(); + + if (qscriptvalue_cast_helper(value, id, (void*)&t)) + return t; + + return QFontMetricsF(QFont()); +} diff --git a/qtbindings/qtscript_gui/qtscript_gui.pro b/qtbindings/qtscript_gui/qtscript_gui.pro index 39c9ec7..3132fd0 100644 --- a/qtbindings/qtscript_gui/qtscript_gui.pro +++ b/qtbindings/qtscript_gui/qtscript_gui.pro @@ -1,5 +1,7 @@ TARGET = qtscript_gui include(../qtbindingsbase.pri) -SOURCES += $$GENERATEDCPP/com_trolltech_qt_gui/plugin.cpp +SOURCES += plugin.cpp +HEADERS += plugin.h QT += widgets +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_gui/com_trolltech_qt_gui.pri) diff --git a/qtbindings/qtscript_network/include/__package_shared.h b/qtbindings/qtscript_network/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_network/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_network/qtscript_network.pro b/qtbindings/qtscript_network/qtscript_network.pro index 072e538..28d10fa 100644 --- a/qtbindings/qtscript_network/qtscript_network.pro +++ b/qtbindings/qtscript_network/qtscript_network.pro @@ -2,5 +2,5 @@ TARGET = qtscript_network include(../qtbindingsbase.pri) QT -= gui QT += network -SOURCES += $$GENERATEDCPP/com_trolltech_qt_network/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_network/com_trolltech_qt_network.pri) diff --git a/qtbindings/qtscript_opengl/include/__package_shared.h b/qtbindings/qtscript_opengl/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_opengl/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_opengl/qtscript_opengl.pro b/qtbindings/qtscript_opengl/qtscript_opengl.pro index f231f2f..6fc6bd8 100644 --- a/qtbindings/qtscript_opengl/qtscript_opengl.pro +++ b/qtbindings/qtscript_opengl/qtscript_opengl.pro @@ -1,5 +1,5 @@ TARGET = qtscript_opengl include(../qtbindingsbase.pri) QT += opengl -SOURCES += $$GENERATEDCPP/com_trolltech_qt_opengl/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_opengl/com_trolltech_qt_opengl.pri) diff --git a/qtbindings/qtscript_phonon/include/__package_shared.h b/qtbindings/qtscript_phonon/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_phonon/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_phonon/qtscript_phonon.pro b/qtbindings/qtscript_phonon/qtscript_phonon.pro index 34bdae2..0a53a5d 100644 --- a/qtbindings/qtscript_phonon/qtscript_phonon.pro +++ b/qtbindings/qtscript_phonon/qtscript_phonon.pro @@ -1,5 +1,5 @@ TARGET = qtscript_phonon include(../qtbindingsbase.pri) QT += phonon -SOURCES += $$GENERATEDCPP/com_trolltech_qt_phonon/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_phonon/com_trolltech_qt_phonon.pri) diff --git a/qtbindings/qtscript_sql/include/__package_shared.h b/qtbindings/qtscript_sql/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_sql/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_sql/qtscript_sql.pro b/qtbindings/qtscript_sql/qtscript_sql.pro index 788c82f..8d15f1a 100644 --- a/qtbindings/qtscript_sql/qtscript_sql.pro +++ b/qtbindings/qtscript_sql/qtscript_sql.pro @@ -2,5 +2,5 @@ TARGET = qtscript_sql include(../qtbindingsbase.pri) QT -= gui QT += sql -SOURCES += $$GENERATEDCPP/com_trolltech_qt_sql/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_sql/com_trolltech_qt_sql.pri) diff --git a/qtbindings/qtscript_svg/include/__package_shared.h b/qtbindings/qtscript_svg/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_svg/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_svg/qtscript_svg.pro b/qtbindings/qtscript_svg/qtscript_svg.pro index 3aa7dcb..8970f0b 100644 --- a/qtbindings/qtscript_svg/qtscript_svg.pro +++ b/qtbindings/qtscript_svg/qtscript_svg.pro @@ -1,5 +1,5 @@ TARGET = qtscript_svg include(../qtbindingsbase.pri) QT += svg -SOURCES += $$GENERATEDCPP/com_trolltech_qt_svg/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_svg/com_trolltech_qt_svg.pri) diff --git a/qtbindings/qtscript_uitools/include/__package_shared.h b/qtbindings/qtscript_uitools/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_uitools/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_uitools/qtscript_uitools.pro b/qtbindings/qtscript_uitools/qtscript_uitools.pro index 2f48778..82e99bd 100644 --- a/qtbindings/qtscript_uitools/qtscript_uitools.pro +++ b/qtbindings/qtscript_uitools/qtscript_uitools.pro @@ -1,5 +1,5 @@ TARGET = qtscript_uitools include(../qtbindingsbase.pri) CONFIG += uitools -SOURCES += $$GENERATEDCPP/com_trolltech_qt_uitools/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) diff --git a/qtbindings/qtscript_webkit/include/__package_shared.h b/qtbindings/qtscript_webkit/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_webkit/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_webkit/qtscript_webkit.pro b/qtbindings/qtscript_webkit/qtscript_webkit.pro index 58bd913..fce623b 100644 --- a/qtbindings/qtscript_webkit/qtscript_webkit.pro +++ b/qtbindings/qtscript_webkit/qtscript_webkit.pro @@ -1,5 +1,5 @@ TARGET = qtscript_webkit include(../qtbindingsbase.pri) QT += network webkit -SOURCES += $$GENERATEDCPP/com_trolltech_qt_webkit/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_webkit/com_trolltech_qt_webkit.pri) diff --git a/qtbindings/qtscript_xml/include/__package_shared.h b/qtbindings/qtscript_xml/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_xml/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_xml/qtscript_xml.pro b/qtbindings/qtscript_xml/qtscript_xml.pro index a4ab9c8..caf3540 100644 --- a/qtbindings/qtscript_xml/qtscript_xml.pro +++ b/qtbindings/qtscript_xml/qtscript_xml.pro @@ -2,5 +2,5 @@ TARGET = qtscript_xml include(../qtbindingsbase.pri) QT -= gui QT += xml -SOURCES += $$GENERATEDCPP/com_trolltech_qt_xml/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_xml/com_trolltech_qt_xml.pri) diff --git a/qtbindings/qtscript_xmlpatterns/include/__package_shared.h b/qtbindings/qtscript_xmlpatterns/include/__package_shared.h new file mode 100644 index 0000000..25f818e --- /dev/null +++ b/qtbindings/qtscript_xmlpatterns/include/__package_shared.h @@ -0,0 +1,3 @@ + +#pragma once + diff --git a/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro b/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro index 2255ef8..484475b 100644 --- a/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro +++ b/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro @@ -2,5 +2,5 @@ TARGET = qtscript_xmlpatterns include(../qtbindingsbase.pri) QT -= gui QT += xmlpatterns network -SOURCES += $$GENERATEDCPP/com_trolltech_qt_xmlpatterns/plugin.cpp +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_xmlpatterns/com_trolltech_qt_xmlpatterns.pri) From 2fed2258d753ac005ea127d5a4ceea3afd66b257 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Tue, 9 Oct 2012 23:40:05 +0100 Subject: [PATCH 12/54] Generated files are set to be ignored by git --- .gitignore | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed82b13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +/doc/ +/generated_cpp/ +/plugins/ +/qtbindings/*/debug/ +/qtbindings/*/release/ +/qtbindings/Makefile +/qtbindings/*/Makefile +/qtbindings/*/Makefile.Debug +/qtbindings/*/Makefile.Release +/generator/.preprocessed.tmp +/qtbindings/qs_eval/qs_eval + +*.log +*.o + +/generator/generator +/generator/Makefile +/generator/Makefile.Debug +/generator/Makefile.Release +/generator/release/ From 8bf9d704b4c499c243a81bc5642e3314b356158c Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Tue, 9 Oct 2012 23:59:19 +0100 Subject: [PATCH 13/54] Plugins use QT5 export api --- qtbindings/qtscript_core/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_core/plugin.h | 17 ++++++++++++ qtbindings/qtscript_gui/plugin.cpp | 24 +++++++++++++++++ qtbindings/qtscript_gui/plugin.h | 16 ++++++++++++ qtbindings/qtscript_network/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_network/plugin.h | 17 ++++++++++++ .../qtscript_network/qtscript_network.pro | 2 ++ qtbindings/qtscript_opengl/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_opengl/plugin.h | 17 ++++++++++++ .../qtscript_opengl/qtscript_opengl.pro | 2 ++ qtbindings/qtscript_phonon/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_phonon/plugin.h | 17 ++++++++++++ .../qtscript_phonon/qtscript_phonon.pro | 2 ++ qtbindings/qtscript_sql/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_sql/plugin.h | 17 ++++++++++++ qtbindings/qtscript_sql/qtscript_sql.pro | 2 ++ qtbindings/qtscript_svg/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_svg/plugin.h | 17 ++++++++++++ qtbindings/qtscript_svg/qtscript_svg.pro | 2 ++ qtbindings/qtscript_uitools/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_uitools/plugin.h | 17 ++++++++++++ .../qtscript_uitools/qtscript_uitools.pro | 2 ++ qtbindings/qtscript_webkit/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_webkit/plugin.h | 17 ++++++++++++ .../qtscript_webkit/qtscript_webkit.pro | 2 ++ qtbindings/qtscript_xml/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_xml/plugin.h | 17 ++++++++++++ qtbindings/qtscript_xml/qtscript_xml.pro | 2 ++ qtbindings/qtscript_xmlpatterns/plugin.cpp | 26 +++++++++++++++++++ qtbindings/qtscript_xmlpatterns/plugin.h | 17 ++++++++++++ .../qtscript_xmlpatterns.pro | 2 ++ 31 files changed, 488 insertions(+) create mode 100644 qtbindings/qtscript_core/plugin.cpp create mode 100644 qtbindings/qtscript_core/plugin.h create mode 100644 qtbindings/qtscript_gui/plugin.cpp create mode 100644 qtbindings/qtscript_gui/plugin.h create mode 100644 qtbindings/qtscript_network/plugin.cpp create mode 100644 qtbindings/qtscript_network/plugin.h create mode 100644 qtbindings/qtscript_opengl/plugin.cpp create mode 100644 qtbindings/qtscript_opengl/plugin.h create mode 100644 qtbindings/qtscript_phonon/plugin.cpp create mode 100644 qtbindings/qtscript_phonon/plugin.h create mode 100644 qtbindings/qtscript_sql/plugin.cpp create mode 100644 qtbindings/qtscript_sql/plugin.h create mode 100644 qtbindings/qtscript_svg/plugin.cpp create mode 100644 qtbindings/qtscript_svg/plugin.h create mode 100644 qtbindings/qtscript_uitools/plugin.cpp create mode 100644 qtbindings/qtscript_uitools/plugin.h create mode 100644 qtbindings/qtscript_webkit/plugin.cpp create mode 100644 qtbindings/qtscript_webkit/plugin.h create mode 100644 qtbindings/qtscript_xml/plugin.cpp create mode 100644 qtbindings/qtscript_xml/plugin.h create mode 100644 qtbindings/qtscript_xmlpatterns/plugin.cpp create mode 100644 qtbindings/qtscript_xmlpatterns/plugin.h diff --git a/qtbindings/qtscript_core/plugin.cpp b/qtbindings/qtscript_core/plugin.cpp new file mode 100644 index 0000000..5507573 --- /dev/null +++ b/qtbindings/qtscript_core/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_core_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.core"); + return list; +} + +void com_trolltech_qt_core_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.core")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_core_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_core::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_core/plugin.h b/qtbindings/qtscript_core/plugin.h new file mode 100644 index 0000000..538d13c --- /dev/null +++ b/qtbindings/qtscript_core/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_core_bindings(QScriptValue &); + +class com_trolltech_qt_core_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.core.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_gui/plugin.cpp b/qtbindings/qtscript_gui/plugin.cpp new file mode 100644 index 0000000..e47a8fe --- /dev/null +++ b/qtbindings/qtscript_gui/plugin.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include "plugin.h" + +QStringList com_trolltech_qt_gui_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.gui"); + return list; +} + +void com_trolltech_qt_gui_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.gui")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_gui_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_gui::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_gui/plugin.h b/qtbindings/qtscript_gui/plugin.h new file mode 100644 index 0000000..eeb7781 --- /dev/null +++ b/qtbindings/qtscript_gui/plugin.h @@ -0,0 +1,16 @@ +#include +#include +#include + +void qtscript_initialize_com_trolltech_qt_gui_bindings(QScriptValue &); + +class com_trolltech_qt_gui_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com_trolltech_qt_gui_ScriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + + diff --git a/qtbindings/qtscript_network/plugin.cpp b/qtbindings/qtscript_network/plugin.cpp new file mode 100644 index 0000000..6f42149 --- /dev/null +++ b/qtbindings/qtscript_network/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_network_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.network"); + return list; +} + +void com_trolltech_qt_network_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.network")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_network_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_network::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_network/plugin.h b/qtbindings/qtscript_network/plugin.h new file mode 100644 index 0000000..3ca1a29 --- /dev/null +++ b/qtbindings/qtscript_network/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_network_bindings(QScriptValue &); + +class com_trolltech_qt_network_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.network.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_network/qtscript_network.pro b/qtbindings/qtscript_network/qtscript_network.pro index 28d10fa..2f1fb74 100644 --- a/qtbindings/qtscript_network/qtscript_network.pro +++ b/qtbindings/qtscript_network/qtscript_network.pro @@ -2,5 +2,7 @@ TARGET = qtscript_network include(../qtbindingsbase.pri) QT -= gui QT += network +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_network/com_trolltech_qt_network.pri) diff --git a/qtbindings/qtscript_opengl/plugin.cpp b/qtbindings/qtscript_opengl/plugin.cpp new file mode 100644 index 0000000..b664630 --- /dev/null +++ b/qtbindings/qtscript_opengl/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_opengl_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.opengl"); + return list; +} + +void com_trolltech_qt_opengl_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.opengl")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_opengl_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_opengl::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_opengl/plugin.h b/qtbindings/qtscript_opengl/plugin.h new file mode 100644 index 0000000..dba1b13 --- /dev/null +++ b/qtbindings/qtscript_opengl/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_opengl_bindings(QScriptValue &); + +class com_trolltech_qt_opengl_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.opengl.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_opengl/qtscript_opengl.pro b/qtbindings/qtscript_opengl/qtscript_opengl.pro index 6fc6bd8..3c7d627 100644 --- a/qtbindings/qtscript_opengl/qtscript_opengl.pro +++ b/qtbindings/qtscript_opengl/qtscript_opengl.pro @@ -1,5 +1,7 @@ TARGET = qtscript_opengl include(../qtbindingsbase.pri) QT += opengl +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_opengl/com_trolltech_qt_opengl.pri) diff --git a/qtbindings/qtscript_phonon/plugin.cpp b/qtbindings/qtscript_phonon/plugin.cpp new file mode 100644 index 0000000..4737086 --- /dev/null +++ b/qtbindings/qtscript_phonon/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_phonon_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.phonon"); + return list; +} + +void com_trolltech_qt_phonon_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.phonon")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_phonon_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_phonon::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_phonon/plugin.h b/qtbindings/qtscript_phonon/plugin.h new file mode 100644 index 0000000..becb38d --- /dev/null +++ b/qtbindings/qtscript_phonon/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_phonon_bindings(QScriptValue &); + +class com_trolltech_qt_phonon_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.phonon.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_phonon/qtscript_phonon.pro b/qtbindings/qtscript_phonon/qtscript_phonon.pro index 0a53a5d..b86b740 100644 --- a/qtbindings/qtscript_phonon/qtscript_phonon.pro +++ b/qtbindings/qtscript_phonon/qtscript_phonon.pro @@ -1,5 +1,7 @@ TARGET = qtscript_phonon include(../qtbindingsbase.pri) QT += phonon +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_phonon/com_trolltech_qt_phonon.pri) diff --git a/qtbindings/qtscript_sql/plugin.cpp b/qtbindings/qtscript_sql/plugin.cpp new file mode 100644 index 0000000..4629681 --- /dev/null +++ b/qtbindings/qtscript_sql/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_sql_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.sql"); + return list; +} + +void com_trolltech_qt_sql_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.sql")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_sql_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_sql::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_sql/plugin.h b/qtbindings/qtscript_sql/plugin.h new file mode 100644 index 0000000..40e65d4 --- /dev/null +++ b/qtbindings/qtscript_sql/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_sql_bindings(QScriptValue &); + +class com_trolltech_qt_sql_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.sql.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_sql/qtscript_sql.pro b/qtbindings/qtscript_sql/qtscript_sql.pro index 8d15f1a..1345504 100644 --- a/qtbindings/qtscript_sql/qtscript_sql.pro +++ b/qtbindings/qtscript_sql/qtscript_sql.pro @@ -2,5 +2,7 @@ TARGET = qtscript_sql include(../qtbindingsbase.pri) QT -= gui QT += sql +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_sql/com_trolltech_qt_sql.pri) diff --git a/qtbindings/qtscript_svg/plugin.cpp b/qtbindings/qtscript_svg/plugin.cpp new file mode 100644 index 0000000..489af35 --- /dev/null +++ b/qtbindings/qtscript_svg/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_svg_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.svg"); + return list; +} + +void com_trolltech_qt_svg_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.svg")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_svg_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_svg::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_svg/plugin.h b/qtbindings/qtscript_svg/plugin.h new file mode 100644 index 0000000..9759e94 --- /dev/null +++ b/qtbindings/qtscript_svg/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_svg_bindings(QScriptValue &); + +class com_trolltech_qt_svg_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.svg.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_svg/qtscript_svg.pro b/qtbindings/qtscript_svg/qtscript_svg.pro index 8970f0b..a65181c 100644 --- a/qtbindings/qtscript_svg/qtscript_svg.pro +++ b/qtbindings/qtscript_svg/qtscript_svg.pro @@ -1,5 +1,7 @@ TARGET = qtscript_svg include(../qtbindingsbase.pri) QT += svg +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_svg/com_trolltech_qt_svg.pri) diff --git a/qtbindings/qtscript_uitools/plugin.cpp b/qtbindings/qtscript_uitools/plugin.cpp new file mode 100644 index 0000000..68487bc --- /dev/null +++ b/qtbindings/qtscript_uitools/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_uitool_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.uitool"); + return list; +} + +void com_trolltech_qt_uitool_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.uitool")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_uitool_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_uitool::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_uitools/plugin.h b/qtbindings/qtscript_uitools/plugin.h new file mode 100644 index 0000000..2fde0e0 --- /dev/null +++ b/qtbindings/qtscript_uitools/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_uitools_bindings(QScriptValue &); + +class com_trolltech_qt_uitools_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.uitools.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_uitools/qtscript_uitools.pro b/qtbindings/qtscript_uitools/qtscript_uitools.pro index 82e99bd..2568387 100644 --- a/qtbindings/qtscript_uitools/qtscript_uitools.pro +++ b/qtbindings/qtscript_uitools/qtscript_uitools.pro @@ -1,5 +1,7 @@ TARGET = qtscript_uitools include(../qtbindingsbase.pri) CONFIG += uitools +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) diff --git a/qtbindings/qtscript_webkit/plugin.cpp b/qtbindings/qtscript_webkit/plugin.cpp new file mode 100644 index 0000000..2b41e5f --- /dev/null +++ b/qtbindings/qtscript_webkit/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_webkit_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.webkit"); + return list; +} + +void com_trolltech_qt_webkit_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.webkit")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_webkit_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_webkit::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_webkit/plugin.h b/qtbindings/qtscript_webkit/plugin.h new file mode 100644 index 0000000..b6e13b3 --- /dev/null +++ b/qtbindings/qtscript_webkit/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_webkit_bindings(QScriptValue &); + +class com_trolltech_qt_webkit_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.webkit.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_webkit/qtscript_webkit.pro b/qtbindings/qtscript_webkit/qtscript_webkit.pro index fce623b..db1ca15 100644 --- a/qtbindings/qtscript_webkit/qtscript_webkit.pro +++ b/qtbindings/qtscript_webkit/qtscript_webkit.pro @@ -1,5 +1,7 @@ TARGET = qtscript_webkit include(../qtbindingsbase.pri) QT += network webkit +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_webkit/com_trolltech_qt_webkit.pri) diff --git a/qtbindings/qtscript_xml/plugin.cpp b/qtbindings/qtscript_xml/plugin.cpp new file mode 100644 index 0000000..30c0db7 --- /dev/null +++ b/qtbindings/qtscript_xml/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_xml_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.xml"); + return list; +} + +void com_trolltech_qt_xml_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.xml")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_xml_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_xml::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_xml/plugin.h b/qtbindings/qtscript_xml/plugin.h new file mode 100644 index 0000000..5891c45 --- /dev/null +++ b/qtbindings/qtscript_xml/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_xml_bindings(QScriptValue &); + +class com_trolltech_qt_xml_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.xml.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_xml/qtscript_xml.pro b/qtbindings/qtscript_xml/qtscript_xml.pro index caf3540..82f2590 100644 --- a/qtbindings/qtscript_xml/qtscript_xml.pro +++ b/qtbindings/qtscript_xml/qtscript_xml.pro @@ -2,5 +2,7 @@ TARGET = qtscript_xml include(../qtbindingsbase.pri) QT -= gui QT += xml +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_xml/com_trolltech_qt_xml.pri) diff --git a/qtbindings/qtscript_xmlpatterns/plugin.cpp b/qtbindings/qtscript_xmlpatterns/plugin.cpp new file mode 100644 index 0000000..d77df6f --- /dev/null +++ b/qtbindings/qtscript_xmlpatterns/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_xmlpatterns_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.xmlpatterns"); + return list; +} + +void com_trolltech_qt_xmlpatterns_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.xmlpatterns")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_xmlpatterns_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_xmlpatterns::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_xmlpatterns/plugin.h b/qtbindings/qtscript_xmlpatterns/plugin.h new file mode 100644 index 0000000..e3e9e79 --- /dev/null +++ b/qtbindings/qtscript_xmlpatterns/plugin.h @@ -0,0 +1,17 @@ +#include +#include +#include +#include + + +void qtscript_initialize_com_trolltech_qt_xmlpatterns_bindings(QScriptValue &); + +class com_trolltech_qt_xmlpatterns_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com.trolltech.qt.xmlpatterns.scriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + diff --git a/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro b/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro index 484475b..6cbf48b 100644 --- a/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro +++ b/qtbindings/qtscript_xmlpatterns/qtscript_xmlpatterns.pro @@ -2,5 +2,7 @@ TARGET = qtscript_xmlpatterns include(../qtbindingsbase.pri) QT -= gui QT += xmlpatterns network +SOURCES += plugin.cpp +HEADERS += plugin.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_xmlpatterns/com_trolltech_qt_xmlpatterns.pri) From 411a41f8e177167fab41e3f6263e6eb34230de43 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Wed, 10 Oct 2012 00:00:09 +0100 Subject: [PATCH 14/54] QMake finishes without warnings regarding unescaped backslash --- qtbindings/qs_eval/qs_eval.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtbindings/qs_eval/qs_eval.pro b/qtbindings/qs_eval/qs_eval.pro index ce18f4e..108574e 100644 --- a/qtbindings/qs_eval/qs_eval.pro +++ b/qtbindings/qs_eval/qs_eval.pro @@ -2,5 +2,5 @@ QT = core gui script widgets win32: CONFIG += console mac:CONFIG -= app_bundle SOURCES += main.cpp -TOO_OLD_LIST=$$find(QT_VERSION, ^4\.[0-4]) +TOO_OLD_LIST=$$find(QT_VERSION, ^4\\.[0-4]) count(TOO_OLD_LIST, 0): QT += scripttools From c0506f227432030e7964ddc3040612addb86bb90 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sun, 14 Oct 2012 20:04:05 +0100 Subject: [PATCH 15/54] added support for QT5 HEAD version --- generator/typesystem_core.xml | 366 +++++++++--------- .../qtscript_core/include/__package_shared.h | 15 +- qtbindings/qtscript_core/qtscriptconcurrent.h | 8 +- .../qtscript_gui/include/__package_shared.h | 67 ++-- 4 files changed, 237 insertions(+), 219 deletions(-) diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index 8bafdae..f47abd0 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -462,7 +462,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -715,12 +715,12 @@ - - + + - - + + @@ -845,7 +845,7 @@ - + @@ -860,7 +860,7 @@ - + @@ -875,7 +875,7 @@ - + @@ -890,7 +890,7 @@ - + @@ -905,7 +905,7 @@ - + @@ -924,7 +924,7 @@ - + @@ -939,7 +939,7 @@ - + @@ -961,7 +961,7 @@ - + @@ -969,7 +969,7 @@ - + @@ -980,7 +980,7 @@ - + @@ -991,7 +991,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1013,7 +1013,7 @@ - + @@ -1024,7 +1024,7 @@ - + @@ -1079,7 +1079,7 @@ - + @@ -1099,16 +1099,16 @@ - + - + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + @@ -1116,7 +1116,7 @@ QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + @@ -1170,7 +1170,7 @@ - + Q_DECLARE_METATYPE(QScriptValue) @@ -1181,7 +1181,7 @@ - + @@ -1194,7 +1194,7 @@ - + @@ -1210,7 +1210,7 @@ - + @@ -1225,7 +1225,7 @@ - + @@ -1242,7 +1242,7 @@ - + @@ -1339,7 +1339,7 @@ - + @@ -1354,7 +1354,7 @@ - + @@ -1369,7 +1369,7 @@ - + @@ -1384,7 +1384,7 @@ - + @@ -1402,7 +1402,7 @@ - + @@ -1423,7 +1423,7 @@ - + @@ -1436,7 +1436,7 @@ - + @@ -1444,7 +1444,7 @@ - + @@ -1466,7 +1466,7 @@ - + @@ -1493,13 +1493,21 @@ - + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + + + + + + + + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); + @@ -1589,7 +1597,7 @@ - + @@ -1640,7 +1648,7 @@ - + @@ -1716,13 +1724,13 @@ - + - + @@ -1731,7 +1739,7 @@ - + @@ -1740,7 +1748,7 @@ - + @@ -1792,7 +1800,7 @@ - + @@ -1801,19 +1809,19 @@ - + - + - + @@ -1821,19 +1829,19 @@ - + - + - + @@ -1877,7 +1885,7 @@ - + @@ -1901,67 +1909,67 @@ - + - - + + - + - + - + - + - - + + - - + + - + - + - + bool __result; bool & %out% = __result; - + bool %out% = __result; - + - + unsigned char __result; unsigned char & %out% = __result; - + int %out% = __result; - + @@ -1971,12 +1979,12 @@ int __result; int & %out% = __result; - + int %out% = __result; - + @@ -1986,12 +1994,12 @@ uint __result; uint & %out% = __result; - + uint %out% = __result; - + @@ -2001,12 +2009,12 @@ qint64 __result; qint64 & %out% = __result; - + qint64 %out% = __result; - + @@ -2016,44 +2024,44 @@ unsigned long long __result; unsigned long long & %out% = __result; - + unsigned long long %out% = __result; - + - + float __result; float & %out% = __result; - + float %out% = __result; - + - + double __result; double & %out% = __result; - + double %out% = __result; - + - + @@ -2061,12 +2069,12 @@ short __result; short & %out% = __result; - + short %out% = __result; - + @@ -2076,12 +2084,12 @@ unsigned short __result; unsigned short & %out% = __result; - + unsigned short %out% = __result; - + @@ -2171,48 +2179,48 @@ - - + + - + - - + + - + - + - + - + - - + + - - + + - + - + - + @@ -2225,12 +2233,12 @@ char __result; char & %out% = __result; - + int %out% = __result; - + @@ -2240,12 +2248,12 @@ short __result; short & %out% = __result; - + short %out% = __result; - + @@ -2255,12 +2263,12 @@ int __result; int & %out% = __result; - + int %out% = __result; - + @@ -2270,12 +2278,12 @@ unsigned short __result; unsigned short & %out% = __result; - + unsigned short %out% = __result; - + @@ -2285,12 +2293,12 @@ unsigned int __result; unsigned int & %out% = __result; - + unsigned int %out% = __result; - + @@ -2300,12 +2308,12 @@ qlonglong __result; qlonglong & %out% = __result; - + qlonglong %out% = __result; - + @@ -2315,12 +2323,12 @@ qulonglong __result; qulonglong & %out% = __result; - + qulonglong %out% = __result; - + @@ -2330,12 +2338,12 @@ float __result; float & %out% = __result; - + float %out% = __result; - + @@ -2345,17 +2353,17 @@ double __result; double & %out% = __result; - + double %out% = __result; - + - - + + @@ -2374,7 +2382,7 @@ - + @@ -2382,7 +2390,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2390,7 +2398,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2400,7 +2408,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2408,7 +2416,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2416,7 +2424,7 @@ - + @@ -2425,7 +2433,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2439,7 +2447,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2459,7 +2467,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2467,7 +2475,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2486,7 +2494,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2494,7 +2502,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2510,7 +2518,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2524,7 +2532,7 @@ - + @@ -2532,7 +2540,7 @@ - + @@ -2540,7 +2548,7 @@ - + @@ -2548,7 +2556,7 @@ - + @@ -2556,7 +2564,7 @@ - + @@ -2570,16 +2578,16 @@ - + - + - - + + - - + + @@ -2588,7 +2596,7 @@ - + @@ -2596,7 +2604,7 @@ - + @@ -2608,7 +2616,7 @@ - + @@ -2616,7 +2624,7 @@ - + @@ -2628,7 +2636,7 @@ - + @@ -2636,7 +2644,7 @@ - + @@ -2644,7 +2652,7 @@ - + @@ -2656,7 +2664,7 @@ - + @@ -2664,7 +2672,7 @@ - + @@ -2672,7 +2680,7 @@ - + @@ -2680,7 +2688,7 @@ - + @@ -2688,7 +2696,7 @@ - + @@ -2698,7 +2706,7 @@ - + @@ -2706,7 +2714,7 @@ - + @@ -2714,7 +2722,7 @@ - + @@ -2722,7 +2730,7 @@ - + @@ -2730,7 +2738,7 @@ - + @@ -2738,7 +2746,7 @@ - + @@ -2746,7 +2754,7 @@ - + @@ -2754,7 +2762,7 @@ - + @@ -2762,7 +2770,7 @@ - + @@ -2770,7 +2778,7 @@ - + @@ -2778,7 +2786,7 @@ - + @@ -2786,7 +2794,7 @@ - + @@ -2794,7 +2802,7 @@ - + diff --git a/qtbindings/qtscript_core/include/__package_shared.h b/qtbindings/qtscript_core/include/__package_shared.h index 62d3c51..e94213a 100644 --- a/qtbindings/qtscript_core/include/__package_shared.h +++ b/qtbindings/qtscript_core/include/__package_shared.h @@ -6,22 +6,31 @@ #include #include + +#include + + Q_DECLARE_METATYPE(QEvent) +namespace QtMetaTypePrivate { + template <> -inline void *qMetaTypeCreateHelper(const void *t) +inline void *QMetaTypeFunctionHelper::Create(const void *t) { if (t) return new QEvent(*static_cast(t)); return new QEvent(QEvent::None); -} +}; template <> -inline void *qMetaTypeConstructHelper(void *where, const void *t) +inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { if (t) return new (where) QEvent(*static_cast(t)); return new (where) QEvent(QEvent::None); +}; + + } template <> diff --git a/qtbindings/qtscript_core/qtscriptconcurrent.h b/qtbindings/qtscript_core/qtscriptconcurrent.h index d916554..0500294 100644 --- a/qtbindings/qtscript_core/qtscriptconcurrent.h +++ b/qtbindings/qtscript_core/qtscriptconcurrent.h @@ -45,11 +45,9 @@ #ifndef QT_NO_CONCURRENT #include -#include -#include -#include -#include -#include +#include +#include +#include class QtScriptVoidFutureWatcher : public QFutureWatcher { Q_OBJECT diff --git a/qtbindings/qtscript_gui/include/__package_shared.h b/qtbindings/qtscript_gui/include/__package_shared.h index d4c1210..98c6239 100644 --- a/qtbindings/qtscript_gui/include/__package_shared.h +++ b/qtbindings/qtscript_gui/include/__package_shared.h @@ -13,9 +13,10 @@ Q_DECLARE_METATYPE(QFontMetrics) Q_DECLARE_METATYPE(QFontMetricsF) +namespace QtMetaTypePrivate { template <> -inline void *qMetaTypeCreateHelper(const void *t) +inline void *QMetaTypeFunctionHelper::Create(const void *t) { if (t) return new QFontInfo(*static_cast(t)); @@ -23,32 +24,19 @@ inline void *qMetaTypeCreateHelper(const void *t) } template <> -inline void *qMetaTypeConstructHelper(void *where, const void *t) +inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { if (t) return new (where) QFontInfo(*static_cast(t)); return new (where) QFontInfo(QFont()); } -template <> -inline QFontInfo qscriptvalue_cast(const QScriptValue &value) -{ - QFont f; - QFontInfo t(f); - const int id = qMetaTypeId(); - - if (qscriptvalue_cast_helper(value, id, (void*)&t)) - return t; - - return QFontInfo(QFont()); -} - template <> -inline void *qMetaTypeCreateHelper(const void *t) +inline void *QMetaTypeFunctionHelper::Create(const void *t) { if (t) return new QFontMetrics(*static_cast(t)); @@ -56,31 +44,18 @@ inline void *qMetaTypeCreateHelper(const void *t) } template <> -inline void *qMetaTypeConstructHelper(void *where, const void *t) +inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { if (t) return new (where) QFontMetrics(*static_cast(t)); return new (where) QFontMetrics(QFont()); } -template <> -inline QFontMetrics qscriptvalue_cast(const QScriptValue &value) -{ - QFont f; - QFontMetrics t(f); - const int id = qMetaTypeId(); - - if (qscriptvalue_cast_helper(value, id, (void*)&t)) - return t; - - return QFontMetrics(QFont()); -} - template <> -inline void *qMetaTypeCreateHelper(const void *t) +inline void *QMetaTypeFunctionHelper::Create(const void *t) { if (t) return new QFontMetricsF(*static_cast(t)); @@ -88,13 +63,41 @@ inline void *qMetaTypeCreateHelper(const void *t) } template <> -inline void *qMetaTypeConstructHelper(void *where, const void *t) +inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { if (t) return new (where) QFontMetricsF(*static_cast(t)); return new (where) QFontMetricsF(QFont()); } +} + +template <> +inline QFontInfo qscriptvalue_cast(const QScriptValue &value) +{ + QFont f; + QFontInfo t(f); + const int id = qMetaTypeId(); + + if (qscriptvalue_cast_helper(value, id, (void*)&t)) + return t; + + return QFontInfo(QFont()); +} + +template <> +inline QFontMetrics qscriptvalue_cast(const QScriptValue &value) +{ + QFont f; + QFontMetrics t(f); + const int id = qMetaTypeId(); + + if (qscriptvalue_cast_helper(value, id, (void*)&t)) + return t; + + return QFontMetrics(QFont()); +} + template <> inline QFontMetricsF qscriptvalue_cast(const QScriptValue &value) { From 654fad5396b18f08764e14926c42989e06cfb225 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Mon, 22 Oct 2012 16:43:58 +0100 Subject: [PATCH 16/54] separate debug and release destdirs --- qtbindings/qtbindingsbase.pri | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qtbindings/qtbindingsbase.pri b/qtbindings/qtbindingsbase.pri index ee9bed6..db90057 100644 --- a/qtbindings/qtbindingsbase.pri +++ b/qtbindings/qtbindingsbase.pri @@ -1,7 +1,10 @@ TEMPLATE = lib DEPENDPATH += . INCLUDEPATH += . -DESTDIR = $$PWD/../plugins/script + +Release:DESTDIR = $$PWD/../plugins/script +Debug: DESTDIR = $$PWD/../plugins/script_debug + QT += script CONFIG += plugin debug_and_release build_all GENERATEDCPP = $$PWD/../generated_cpp From 2c384257d5dafebb0ad06ae91287a25d7b1f1330 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sun, 11 Nov 2012 14:05:31 +0000 Subject: [PATCH 17/54] fix typo --- qtbindings/qtscript_core/include/__package_shared.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtbindings/qtscript_core/include/__package_shared.h b/qtbindings/qtscript_core/include/__package_shared.h index e94213a..2b5444a 100644 --- a/qtbindings/qtscript_core/include/__package_shared.h +++ b/qtbindings/qtscript_core/include/__package_shared.h @@ -7,7 +7,7 @@ #include -#include +#include Q_DECLARE_METATYPE(QEvent) From 8027192fc211178001d50333922307c36ed88096 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sun, 11 Nov 2012 19:41:31 +0000 Subject: [PATCH 18/54] amend typesystem to be compatible with noaccessibility qt setup --- generator/typesystem_gui-common.xml | 36 ---------------------------- generator/typesystem_gui.xml | 37 ----------------------------- 2 files changed, 73 deletions(-) diff --git a/generator/typesystem_gui-common.xml b/generator/typesystem_gui-common.xml index b9f141e..4a02e9c 100644 --- a/generator/typesystem_gui-common.xml +++ b/generator/typesystem_gui-common.xml @@ -1344,38 +1344,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2314,7 +2282,6 @@ - @@ -5045,7 +5012,6 @@ - @@ -5053,7 +5019,6 @@ - @@ -5155,7 +5120,6 @@ - diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml index db52745..6a7d3c9 100644 --- a/generator/typesystem_gui.xml +++ b/generator/typesystem_gui.xml @@ -1576,38 +1576,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2659,7 +2627,6 @@ - @@ -5541,7 +5508,6 @@ - @@ -5549,7 +5515,6 @@ - @@ -5651,7 +5616,6 @@ - @@ -5665,7 +5629,6 @@ - From d0302fbaec8b1862e5818004759103ffdc584ee1 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sun, 11 Nov 2012 19:42:42 +0000 Subject: [PATCH 19/54] add fake SSL related Qt classes when Qt is compiled without SSL support --- .../qtscript_network/include/__package_shared.h | 17 +++++++++++++++++ .../qtscript_network/qtscript_network.pro | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/qtbindings/qtscript_network/include/__package_shared.h b/qtbindings/qtscript_network/include/__package_shared.h index 25f818e..98dc031 100644 --- a/qtbindings/qtscript_network/include/__package_shared.h +++ b/qtbindings/qtscript_network/include/__package_shared.h @@ -1,3 +1,20 @@ #pragma once +#include + +#ifdef QT_NO_SSL +class QSslError : public QObject { + Q_OBJECT +public: + QSslError(): QObject() {} + QSslError(const QSslError &) : QObject() {} +}; +class QSslConfiguration : public QObject { + Q_OBJECT +public: + QSslConfiguration() : QObject() {} + QSslConfiguration(const QSslConfiguration &) : QObject() {} +}; +#endif + diff --git a/qtbindings/qtscript_network/qtscript_network.pro b/qtbindings/qtscript_network/qtscript_network.pro index 2f1fb74..dfe99df 100644 --- a/qtbindings/qtscript_network/qtscript_network.pro +++ b/qtbindings/qtscript_network/qtscript_network.pro @@ -3,6 +3,6 @@ include(../qtbindingsbase.pri) QT -= gui QT += network SOURCES += plugin.cpp -HEADERS += plugin.h +HEADERS += plugin.h include/__package_shared.h INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_network/com_trolltech_qt_network.pri) From 7dcc62c918b3d8300b0de4cb8a05d96dddde2a51 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sat, 15 Dec 2012 20:25:45 +0000 Subject: [PATCH 20/54] do not modify setFont method --- generator/typesystem_gui-common.xml | 6 ------ generator/typesystem_gui.xml | 6 ------ 2 files changed, 12 deletions(-) diff --git a/generator/typesystem_gui-common.xml b/generator/typesystem_gui-common.xml index 4a02e9c..d759b20 100644 --- a/generator/typesystem_gui-common.xml +++ b/generator/typesystem_gui-common.xml @@ -4677,12 +4677,6 @@ - - - - - - diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml index 6a7d3c9..1e35fdb 100644 --- a/generator/typesystem_gui.xml +++ b/generator/typesystem_gui.xml @@ -5150,12 +5150,6 @@ - - - - - - From a2317fb79bd1fdba5024148f479ab51b25674afc Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sat, 15 Dec 2012 20:26:06 +0000 Subject: [PATCH 21/54] compat with qt5 api changes --- qtbindings/qs_eval/main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/qtbindings/qs_eval/main.cpp b/qtbindings/qs_eval/main.cpp index 284e5f6..2760566 100644 --- a/qtbindings/qs_eval/main.cpp +++ b/qtbindings/qs_eval/main.cpp @@ -136,11 +136,7 @@ static QScriptValue importExtension(QScriptContext *context, QScriptEngine *engi int main(int argc, char *argv[]) { - QApplication *app; - if (argc >= 2 && !qstrcmp(argv[1], "-tty")) - app = new QApplication(argc, argv, QApplication::Tty); - else - app = new QApplication(argc, argv); + QApplication *app = new QApplication(argc, argv); QDir dir(QApplication::applicationDirPath()); if (dir.dirName() == QLatin1String("debug") || dir.dirName() == QLatin1String("release")) From 3dcf5fa2269b2d06004e14dd5f0de3d6962be165 Mon Sep 17 00:00:00 2001 From: Sarunas Valaskevicius Date: Sat, 15 Dec 2012 20:26:31 +0000 Subject: [PATCH 22/54] include required header --- qtbindings/qtscript_opengl/include/__package_shared.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qtbindings/qtscript_opengl/include/__package_shared.h b/qtbindings/qtscript_opengl/include/__package_shared.h index 25f818e..e118c0e 100644 --- a/qtbindings/qtscript_opengl/include/__package_shared.h +++ b/qtbindings/qtscript_opengl/include/__package_shared.h @@ -1,3 +1,5 @@ #pragma once +#include + From dcb59cdf19d9924dc2b66a2e283d0a0759f23e4b Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Tue, 9 Jul 2013 18:16:25 -0700 Subject: [PATCH 23/54] * Split QtGui module into QtGui, QtWidgets, QtPrintSupport * Split QtWebKit module into QtWebKit and QtWebKitWidgets * Fix minor bug to support Qt 5.1.0 --- generator/build_all.txt | 4 +- generator/build_printsupport.txt | 6 + generator/build_webkit.txt | 1 + ...ild_phonon.txt => build_webkitwidgets.txt} | 3 +- generator/build_widgets.txt | 5 + generator/generate.sh | 8 +- generator/generator.qrc | 5 +- generator/qtscript_masterinclude.h | 3 + generator/typesystem_core-common.xml | 31 +- generator/typesystem_core-qtscript.xml | 13 +- generator/typesystem_core.xml | 399 +- generator/typesystem_gui-common.xml | 4286 +-------------- generator/typesystem_gui-qtscript.xml | 256 +- generator/typesystem_gui.xml | 4593 ++--------------- generator/typesystem_phonon-common.xml | 206 - generator/typesystem_phonon-qtscript.xml | 58 - generator/typesystem_phonon.xml | 237 - generator/typesystem_printsupport-common.xml | 53 + .../typesystem_printsupport-qtscript.xml | 10 + generator/typesystem_printsupport.xml | 58 + generator/typesystem_uitools.xml | 8 +- generator/typesystem_webkit-common.xml | 75 +- generator/typesystem_webkit-qtscript.xml | 2 - generator/typesystem_webkit.xml | 77 +- generator/typesystem_webkitwidgets-common.xml | 106 + .../typesystem_webkitwidgets-qtscript.xml | 19 + generator/typesystem_webkitwidgets.xml | 112 + generator/typesystem_widgets-common.xml | 3743 ++++++++++++++ generator/typesystem_widgets-qtscript.xml | 254 + generator/typesystem_widgets.xml | 3940 ++++++++++++++ qtbindings/qs_eval/main.cpp | 3 + qtbindings/qtbindings.pro | 12 +- qtbindings/qtscript_phonon/plugin.cpp | 26 - .../qtscript_phonon/qtscript_phonon.pro | 7 - .../include/__package_shared.h | 1 + qtbindings/qtscript_printsupport/plugin.cpp | 24 + qtbindings/qtscript_printsupport/plugin.h | 16 + .../qtscript_printsupport.pro | 7 + qtbindings/qtscript_uitools/plugin.cpp | 12 +- .../qtscript_uitools/qtscript_uitools.pro | 4 +- .../qtscript_webkit/qtscript_webkit.pro | 2 +- .../include/__package_shared.h | 0 qtbindings/qtscript_webkitwidgets/plugin.cpp | 26 + .../plugin.h | 6 +- .../qtscript_webkitwidgets.pro | 7 + .../include/__package_shared.h | 1 + qtbindings/qtscript_widgets/plugin.cpp | 24 + qtbindings/qtscript_widgets/plugin.h | 16 + .../qtscript_widgets/qtscript_widgets.pro | 7 + 49 files changed, 9290 insertions(+), 9482 deletions(-) create mode 100644 generator/build_printsupport.txt rename generator/{build_phonon.txt => build_webkitwidgets.txt} (53%) create mode 100644 generator/build_widgets.txt delete mode 100644 generator/typesystem_phonon-common.xml delete mode 100644 generator/typesystem_phonon-qtscript.xml delete mode 100644 generator/typesystem_phonon.xml create mode 100644 generator/typesystem_printsupport-common.xml create mode 100644 generator/typesystem_printsupport-qtscript.xml create mode 100644 generator/typesystem_printsupport.xml create mode 100644 generator/typesystem_webkitwidgets-common.xml create mode 100644 generator/typesystem_webkitwidgets-qtscript.xml create mode 100644 generator/typesystem_webkitwidgets.xml create mode 100644 generator/typesystem_widgets-common.xml create mode 100644 generator/typesystem_widgets-qtscript.xml create mode 100644 generator/typesystem_widgets.xml delete mode 100644 qtbindings/qtscript_phonon/plugin.cpp delete mode 100644 qtbindings/qtscript_phonon/qtscript_phonon.pro create mode 100644 qtbindings/qtscript_printsupport/include/__package_shared.h create mode 100644 qtbindings/qtscript_printsupport/plugin.cpp create mode 100644 qtbindings/qtscript_printsupport/plugin.h create mode 100644 qtbindings/qtscript_printsupport/qtscript_printsupport.pro rename qtbindings/{qtscript_phonon => qtscript_webkitwidgets}/include/__package_shared.h (100%) create mode 100644 qtbindings/qtscript_webkitwidgets/plugin.cpp rename qtbindings/{qtscript_phonon => qtscript_webkitwidgets}/plugin.h (51%) create mode 100644 qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro create mode 100644 qtbindings/qtscript_widgets/include/__package_shared.h create mode 100644 qtbindings/qtscript_widgets/plugin.cpp create mode 100644 qtbindings/qtscript_widgets/plugin.h create mode 100644 qtbindings/qtscript_widgets/qtscript_widgets.pro diff --git a/generator/build_all.txt b/generator/build_all.txt index e3cbcd6..a1bd09a 100644 --- a/generator/build_all.txt +++ b/generator/build_all.txt @@ -1,13 +1,15 @@ + + - + diff --git a/generator/build_printsupport.txt b/generator/build_printsupport.txt new file mode 100644 index 0000000..9f2023e --- /dev/null +++ b/generator/build_printsupport.txt @@ -0,0 +1,6 @@ + + + + + + diff --git a/generator/build_webkit.txt b/generator/build_webkit.txt index 86696b1..8436bba 100644 --- a/generator/build_webkit.txt +++ b/generator/build_webkit.txt @@ -2,5 +2,6 @@ + diff --git a/generator/build_phonon.txt b/generator/build_webkitwidgets.txt similarity index 53% rename from generator/build_phonon.txt rename to generator/build_webkitwidgets.txt index dc62d2e..7df07ce 100644 --- a/generator/build_phonon.txt +++ b/generator/build_webkitwidgets.txt @@ -1,5 +1,6 @@ - + + diff --git a/generator/build_widgets.txt b/generator/build_widgets.txt new file mode 100644 index 0000000..8b52876 --- /dev/null +++ b/generator/build_widgets.txt @@ -0,0 +1,5 @@ + + + + + diff --git a/generator/generate.sh b/generator/generate.sh index c49fbe0..db9e0c3 100755 --- a/generator/generate.sh +++ b/generator/generate.sh @@ -2,6 +2,10 @@ xsltproc --stringparam source $PWD/typesystem_core-qtscript.xml merge.xsl typesy xsltproc --stringparam source $PWD/typesystem_gui-qtscript.xml merge.xsl typesystem_gui-common.xml > typesystem_gui.xml +xsltproc --stringparam source $PWD/typesystem_widgets-qtscript.xml merge.xsl typesystem_widgets-common.xml > typesystem_widgets.xml + +xsltproc --stringparam source $PWD/typesystem_printsupport-qtscript.xml merge.xsl typesystem_printsupport-common.xml > typesystem_printsupport.xml + xsltproc --stringparam source $PWD/typesystem_svg-qtscript.xml merge.xsl typesystem_svg-common.xml > typesystem_svg.xml xsltproc --stringparam source $PWD/typesystem_network-qtscript.xml merge.xsl typesystem_network-common.xml > typesystem_network.xml @@ -12,10 +16,10 @@ xsltproc --stringparam source $PWD/typesystem_xml-qtscript.xml merge.xsl typesys xsltproc --stringparam source $PWD/typesystem_sql-qtscript.xml merge.xsl typesystem_sql-common.xml > typesystem_sql.xml -xsltproc --stringparam source $PWD/typesystem_phonon-qtscript.xml merge.xsl typesystem_phonon-common.xml > typesystem_phonon.xml - xsltproc --stringparam source $PWD/typesystem_webkit-qtscript.xml merge.xsl typesystem_webkit-common.xml > typesystem_webkit.xml +xsltproc --stringparam source $PWD/typesystem_webkitwidgets-qtscript.xml merge.xsl typesystem_webkitwidgets-common.xml > typesystem_webkitwidgets.xml + xsltproc --stringparam source $PWD/typesystem_xmlpatterns-qtscript.xml merge.xsl typesystem_xmlpatterns-common.xml > typesystem_xmlpatterns.xml # ./generator qtscript_masterinclude.h typesystem_core.xml --diff diff --git a/generator/generator.qrc b/generator/generator.qrc index 77d1b3c..c58be04 100644 --- a/generator/generator.qrc +++ b/generator/generator.qrc @@ -4,14 +4,17 @@ build_all.txt typesystem_core.xml typesystem_gui.xml +typesystem_widgets.xml +typesystem_printsupport.xml typesystem_sql.xml typesystem_opengl.xml typesystem_svg.xml typesystem_network.xml typesystem_xml.xml -typesystem_phonon.xml typesystem_webkit.xml +typesystem_webkitwidgets.xml typesystem_xmlpatterns.xml +typesystem_uitools.xml parser/rpp/pp-qt-configuration diff --git a/generator/qtscript_masterinclude.h b/generator/qtscript_masterinclude.h index b80188f..4692e0e 100644 --- a/generator/qtscript_masterinclude.h +++ b/generator/qtscript_masterinclude.h @@ -42,6 +42,8 @@ #define QT_NO_STL #include #include +#include +#include #include #include #include @@ -55,6 +57,7 @@ #ifndef QT_NO_WEBKIT # include +# include #endif #ifndef QT_NO_PHONON diff --git a/generator/typesystem_core-common.xml b/generator/typesystem_core-common.xml index 7c2c091..d755aef 100644 --- a/generator/typesystem_core-common.xml +++ b/generator/typesystem_core-common.xml @@ -364,8 +364,6 @@ - - @@ -474,10 +472,10 @@ - - - - + + + + @@ -955,17 +953,14 @@ - - - - - + + + - @@ -1416,7 +1411,17 @@ - + + + + + + + + + + + diff --git a/generator/typesystem_core-qtscript.xml b/generator/typesystem_core-qtscript.xml index 6254140..32b9d02 100644 --- a/generator/typesystem_core-qtscript.xml +++ b/generator/typesystem_core-qtscript.xml @@ -103,12 +103,19 @@ - QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); + + + + + + + + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); + - diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index f47abd0..e2e89a2 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -398,8 +398,6 @@ - - @@ -462,7 +460,7 @@ - + @@ -512,10 +510,10 @@ - - - - + + + + @@ -611,7 +609,7 @@ - + @@ -715,12 +713,12 @@ - - + + - - + + @@ -845,7 +843,7 @@ - + @@ -860,7 +858,7 @@ - + @@ -875,7 +873,7 @@ - + @@ -890,7 +888,7 @@ - + @@ -905,7 +903,7 @@ - + @@ -924,7 +922,7 @@ - + @@ -939,7 +937,7 @@ - + @@ -961,7 +959,7 @@ - + @@ -969,7 +967,7 @@ - + @@ -980,7 +978,7 @@ - + @@ -991,7 +989,7 @@ - + @@ -1002,7 +1000,7 @@ - + @@ -1013,7 +1011,7 @@ - + @@ -1024,7 +1022,7 @@ - + @@ -1079,7 +1077,7 @@ - + @@ -1099,16 +1097,16 @@ - + - + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + @@ -1116,7 +1114,7 @@ QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + @@ -1170,7 +1168,7 @@ - + Q_DECLARE_METATYPE(QScriptValue) @@ -1181,7 +1179,7 @@ - + @@ -1194,7 +1192,7 @@ - + @@ -1210,7 +1208,7 @@ - + @@ -1225,7 +1223,7 @@ - + @@ -1242,7 +1240,7 @@ - + @@ -1339,7 +1337,7 @@ - + @@ -1354,7 +1352,7 @@ - + @@ -1369,7 +1367,7 @@ - + @@ -1384,7 +1382,7 @@ - + @@ -1402,7 +1400,7 @@ - + @@ -1423,7 +1421,7 @@ - + @@ -1436,7 +1434,7 @@ - + @@ -1444,7 +1442,7 @@ - + @@ -1458,21 +1456,18 @@ - - - - - - - - - + + + + + + @@ -1493,21 +1488,21 @@ - + - QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - - QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + + QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); + @@ -1597,7 +1592,7 @@ - + @@ -1648,7 +1643,7 @@ - + @@ -1724,13 +1719,13 @@ - + - + @@ -1739,7 +1734,7 @@ - + @@ -1748,7 +1743,7 @@ - + @@ -1800,7 +1795,7 @@ - + @@ -1809,19 +1804,19 @@ - + - + - + @@ -1829,19 +1824,19 @@ - + - + - + @@ -1885,7 +1880,7 @@ - + @@ -1909,67 +1904,67 @@ - + - - + + - + - + - + - + - - + + - - + + - + - + - + bool __result; bool & %out% = __result; - + bool %out% = __result; - + - + unsigned char __result; unsigned char & %out% = __result; - + int %out% = __result; - + @@ -1979,12 +1974,12 @@ int __result; int & %out% = __result; - + int %out% = __result; - + @@ -1994,12 +1989,12 @@ uint __result; uint & %out% = __result; - + uint %out% = __result; - + @@ -2009,12 +2004,12 @@ qint64 __result; qint64 & %out% = __result; - + qint64 %out% = __result; - + @@ -2024,44 +2019,44 @@ unsigned long long __result; unsigned long long & %out% = __result; - + unsigned long long %out% = __result; - + - + float __result; float & %out% = __result; - + float %out% = __result; - + - + double __result; double & %out% = __result; - + double %out% = __result; - + - + @@ -2069,12 +2064,12 @@ short __result; short & %out% = __result; - + short %out% = __result; - + @@ -2084,12 +2079,12 @@ unsigned short __result; unsigned short & %out% = __result; - + unsigned short %out% = __result; - + @@ -2179,48 +2174,48 @@ - - + + - + - - + + - + - + - + - + - - + + - - + + - + - + - + @@ -2233,12 +2228,12 @@ char __result; char & %out% = __result; - + int %out% = __result; - + @@ -2248,12 +2243,12 @@ short __result; short & %out% = __result; - + short %out% = __result; - + @@ -2263,12 +2258,12 @@ int __result; int & %out% = __result; - + int %out% = __result; - + @@ -2278,12 +2273,12 @@ unsigned short __result; unsigned short & %out% = __result; - + unsigned short %out% = __result; - + @@ -2293,12 +2288,12 @@ unsigned int __result; unsigned int & %out% = __result; - + unsigned int %out% = __result; - + @@ -2308,12 +2303,12 @@ qlonglong __result; qlonglong & %out% = __result; - + qlonglong %out% = __result; - + @@ -2323,12 +2318,12 @@ qulonglong __result; qulonglong & %out% = __result; - + qulonglong %out% = __result; - + @@ -2338,12 +2333,12 @@ float __result; float & %out% = __result; - + float %out% = __result; - + @@ -2353,17 +2348,17 @@ double __result; double & %out% = __result; - + double %out% = __result; - + - - + + @@ -2382,7 +2377,7 @@ - + @@ -2390,7 +2385,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2398,7 +2393,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2408,7 +2403,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2416,7 +2411,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2424,7 +2419,7 @@ - + @@ -2433,7 +2428,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2447,7 +2442,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2467,7 +2462,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2475,7 +2470,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2494,7 +2489,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2502,7 +2497,7 @@ const QtScriptVoidFuture & %out% = *qscriptvalue_cast<QtScriptVoidFuture*>(%in%); - + @@ -2518,7 +2513,7 @@ const QtScriptFuture & %out% = *qscriptvalue_cast<QtScriptFuture*>(%in%); - + @@ -2532,7 +2527,7 @@ - + @@ -2540,7 +2535,7 @@ - + @@ -2548,7 +2543,7 @@ - + @@ -2556,7 +2551,7 @@ - + @@ -2564,7 +2559,7 @@ - + @@ -2578,16 +2573,16 @@ - + - + - - + + - - + + @@ -2596,7 +2591,7 @@ - + @@ -2604,7 +2599,7 @@ - + @@ -2616,7 +2611,7 @@ - + @@ -2624,7 +2619,7 @@ - + @@ -2636,7 +2631,7 @@ - + @@ -2644,7 +2639,7 @@ - + @@ -2652,7 +2647,7 @@ - + @@ -2664,7 +2659,7 @@ - + @@ -2672,7 +2667,7 @@ - + @@ -2680,7 +2675,7 @@ - + @@ -2688,7 +2683,7 @@ - + @@ -2696,7 +2691,7 @@ - + @@ -2706,7 +2701,7 @@ - + @@ -2714,7 +2709,7 @@ - + @@ -2722,7 +2717,7 @@ - + @@ -2730,7 +2725,7 @@ - + @@ -2738,7 +2733,7 @@ - + @@ -2746,7 +2741,7 @@ - + @@ -2754,7 +2749,7 @@ - + @@ -2762,7 +2757,7 @@ - + @@ -2770,7 +2765,7 @@ - + @@ -2778,7 +2773,7 @@ - + @@ -2786,7 +2781,7 @@ - + @@ -2794,7 +2789,7 @@ - + @@ -2802,7 +2797,7 @@ - + @@ -2831,7 +2826,17 @@ - + + + + + + + + + + + diff --git a/generator/typesystem_gui-common.xml b/generator/typesystem_gui-common.xml index d759b20..dd00650 100644 --- a/generator/typesystem_gui-common.xml +++ b/generator/typesystem_gui-common.xml @@ -1,44 +1,26 @@ - - - + - - - + - - - - - - - - - - - - - - @@ -46,13 +28,10 @@ - - - @@ -60,19 +39,7 @@ - - - - - - - - - - - - @@ -86,8 +53,8 @@ + - @@ -96,44 +63,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -141,87 +73,19 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -229,26 +93,11 @@ - - - - - - - - - - - - - - - @@ -256,129 +105,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -386,8 +121,6 @@ - - @@ -401,57 +134,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -463,18 +159,6 @@ - - - - - - - - - - - - @@ -485,21 +169,6 @@ - - - - - - - - - - - - - - - @@ -508,26 +177,18 @@ - - - - - - - - + - + - @@ -541,38 +202,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -586,12 +219,13 @@ + - - + + @@ -600,21 +234,21 @@ + - - - + + @@ -659,7 +293,6 @@ - @@ -674,24 +307,21 @@ - - - + + - + - - @@ -725,26 +355,8 @@ - - - return new QTreeWidgetItemIterator(*copy); - - - delete copy; - - - - - - - - - - - - @@ -788,15 +400,6 @@ - - - - - - - - - @@ -805,18 +408,15 @@ - - - @@ -830,7 +430,6 @@ - @@ -891,10 +490,6 @@ - - - - @@ -995,7 +590,6 @@ - @@ -1117,6 +711,7 @@ + @@ -1193,142 +788,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (%1 != null) disableGarbageCollection(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1342,53 +801,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1396,148 +810,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -1877,2657 +882,296 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (%1 != null) disableGarbageCollection(); - - - - - - if (%2 != null) disableGarbageCollection(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + + - + - - - + + - - - - - - - - - - - - - - - - - + + + + - - + - + - - + - - - - + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + - + + - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + - + - - - - - - - - - + + + - + + + + + - + - - - - - - - - - - + - + - - - - + + + + + + + + + + + + - + - - + - + + + + + + + + - - - + - + + + + + + + + + + - - - + - - - - + + + + - - - - - - > - - - - - - - - + + + + + + + - - - - + + + + - + + + + - - - - + + - + - + + + + + - - + + - + - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -4654,410 +1298,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - @@ -5067,34 +1318,21 @@ - + + - - - - - - - - - - - - - - @@ -5103,10 +1341,9 @@ - - + @@ -5114,23 +1351,10 @@ - - - - - - - - - - - - - diff --git a/generator/typesystem_gui-qtscript.xml b/generator/typesystem_gui-qtscript.xml index 1077842..433688e 100644 --- a/generator/typesystem_gui-qtscript.xml +++ b/generator/typesystem_gui-qtscript.xml @@ -2,7 +2,6 @@ - @@ -10,30 +9,20 @@ - - - - - - - - - - - + @@ -80,30 +69,6 @@ - - - - - - - - - - - - - - - - QScriptValue %out%_orig = %in%; - QWidget* %out% = qscriptvalue_cast<QWidget*>(%out%_orig); - if (%out% != 0) - context->engine()->newQObject(%out%_orig, %out%, QScriptEngine::QtOwnership); - - - - - @@ -128,53 +93,6 @@ - - - Q_DECLARE_METATYPE(QScriptValue) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -252,98 +170,6 @@ - - - Q_DECLARE_METATYPE(QScriptValue) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -357,84 +183,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers) - { return QModelIndex(); } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -519,7 +268,6 @@ - diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml index 1e35fdb..df21430 100644 --- a/generator/typesystem_gui.xml +++ b/generator/typesystem_gui.xml @@ -1,44 +1,26 @@ - - + - - + - - - + - - - - - - - - - - - - - - @@ -46,13 +28,10 @@ - - - @@ -60,19 +39,7 @@ - - - - - - - - - - - - @@ -86,8 +53,8 @@ + - @@ -96,44 +63,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -141,87 +73,19 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -229,26 +93,11 @@ - - - - - - - - - - - - - - - @@ -256,129 +105,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -386,8 +121,6 @@ - - @@ -401,57 +134,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -463,18 +159,6 @@ - - - - - - - - - - - - @@ -485,21 +169,6 @@ - - - - - - - - - - - - - - - @@ -508,26 +177,18 @@ - - - - - - - - + - + - @@ -547,38 +208,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -603,12 +236,13 @@ + - - + + @@ -617,21 +251,21 @@ + - - - + + @@ -714,7 +348,6 @@ - @@ -729,14 +362,12 @@ - - - + + - @@ -750,13 +381,12 @@ + - - @@ -790,26 +420,8 @@ - - - return new QTreeWidgetItemIterator(*copy); - - - delete copy; - - - - - - - - - - - - @@ -828,7 +440,6 @@ - @@ -900,15 +511,6 @@ - - - - - - - - - @@ -917,18 +519,15 @@ - - - @@ -942,7 +541,6 @@ - @@ -1018,10 +616,6 @@ - - - - @@ -1122,7 +716,6 @@ - @@ -1333,6 +926,7 @@ + @@ -1413,154 +1007,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (%1 != null) disableGarbageCollection(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers) - { return QModelIndex(); } - - - - - - - - @@ -1574,53 +1020,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1628,3243 +1029,411 @@ - - - - - - - - - - - - + + + + + + + + + + - - - - + + - + + + QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); + + + jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false); + QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0; + - - - - - - - + - - + + + QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); + - - - + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + - - - - - - - - - + + - - - - - - - - - - - - - - - Q_DECLARE_METATYPE(QScriptValue) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); - - - jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false); - QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0; - - - - - - - - QDataStream & %out% = *qscriptvalue_cast<QDataStream*>(%in%); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Q_DECLARE_METATYPE(QScriptValue) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QScriptValue %out%_orig = %in%; - QWidget* %out% = qscriptvalue_cast<QWidget*>(%out%_orig); - if (%out% != 0) - context->engine()->newQObject(%out%_orig, %out%, QScriptEngine::QtOwnership); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (%1 != null) disableGarbageCollection(); - - - - - - if (%2 != null) disableGarbageCollection(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + + + + + + + - - - - + + + + + + + - - + + + + + + + - - - - - - + + + + + - - + - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - + - + - - - - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + + - - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - + - - - - + - - - - - - - - - - - - - - - + + + + + + + + + + - + - + - - - - - - - - - - + - - - + + + + + + + + + + - + - + - + + + + + + + + - + - - - - - - - - - - - - - + - - - - - - - - - - + + + + + + - + - - - + + + + - + - - - + - - - - - - - - - - - + + + + - - - - + + + + - - - - - + + - - - - - + + + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - + + - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - @@ -4874,117 +1443,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - + + - + @@ -5121,439 +1586,23 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - @@ -5563,34 +1612,21 @@ - + + - - - - - - - - - - - - - - @@ -5599,10 +1635,9 @@ - - + @@ -5610,22 +1645,10 @@ - - - - - - - - - - - + - - diff --git a/generator/typesystem_phonon-common.xml b/generator/typesystem_phonon-common.xml deleted file mode 100644 index 1cc8475..0000000 --- a/generator/typesystem_phonon-common.xml +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/generator/typesystem_phonon-qtscript.xml b/generator/typesystem_phonon-qtscript.xml deleted file mode 100644 index c183c02..0000000 --- a/generator/typesystem_phonon-qtscript.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/generator/typesystem_phonon.xml b/generator/typesystem_phonon.xml deleted file mode 100644 index 2b5b390..0000000 --- a/generator/typesystem_phonon.xml +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/generator/typesystem_printsupport-common.xml b/generator/typesystem_printsupport-common.xml new file mode 100644 index 0000000..55ab88b --- /dev/null +++ b/generator/typesystem_printsupport-common.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/generator/typesystem_printsupport-qtscript.xml b/generator/typesystem_printsupport-qtscript.xml new file mode 100644 index 0000000..dcdfd02 --- /dev/null +++ b/generator/typesystem_printsupport-qtscript.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/generator/typesystem_printsupport.xml b/generator/typesystem_printsupport.xml new file mode 100644 index 0000000..f9c9d8c --- /dev/null +++ b/generator/typesystem_printsupport.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/generator/typesystem_uitools.xml b/generator/typesystem_uitools.xml index 1b2c2ed..5a58c6c 100644 --- a/generator/typesystem_uitools.xml +++ b/generator/typesystem_uitools.xml @@ -1,5 +1,9 @@ - - + + + + + + diff --git a/generator/typesystem_webkit-common.xml b/generator/typesystem_webkit-common.xml index 3663efb..30f1ca5 100644 --- a/generator/typesystem_webkit-common.xml +++ b/generator/typesystem_webkit-common.xml @@ -8,67 +8,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - @@ -90,10 +41,13 @@ - - + + + + + @@ -117,12 +71,7 @@ --> - - - - - @@ -149,23 +98,11 @@ - - - - - - - - - - - - diff --git a/generator/typesystem_webkit-qtscript.xml b/generator/typesystem_webkit-qtscript.xml index 148df2c..290d415 100644 --- a/generator/typesystem_webkit-qtscript.xml +++ b/generator/typesystem_webkit-qtscript.xml @@ -5,8 +5,6 @@ - - diff --git a/generator/typesystem_webkit.xml b/generator/typesystem_webkit.xml index 54e961e..09d39cb 100644 --- a/generator/typesystem_webkit.xml +++ b/generator/typesystem_webkit.xml @@ -1,5 +1,5 @@ - + @@ -8,67 +8,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - @@ -90,10 +41,13 @@ - - + + + + + @@ -117,12 +71,7 @@ --> - - - - - @@ -149,23 +98,11 @@ - - - - - - - - - - - - diff --git a/generator/typesystem_webkitwidgets-common.xml b/generator/typesystem_webkitwidgets-common.xml new file mode 100644 index 0000000..9e716d1 --- /dev/null +++ b/generator/typesystem_webkitwidgets-common.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/generator/typesystem_webkitwidgets-qtscript.xml b/generator/typesystem_webkitwidgets-qtscript.xml new file mode 100644 index 0000000..e1c6c86 --- /dev/null +++ b/generator/typesystem_webkitwidgets-qtscript.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/generator/typesystem_webkitwidgets.xml b/generator/typesystem_webkitwidgets.xml new file mode 100644 index 0000000..2be37a0 --- /dev/null +++ b/generator/typesystem_webkitwidgets.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/generator/typesystem_widgets-common.xml b/generator/typesystem_widgets-common.xml new file mode 100644 index 0000000..d032ccb --- /dev/null +++ b/generator/typesystem_widgets-common.xml @@ -0,0 +1,3743 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + return new QTreeWidgetItemIterator(*copy); + + + delete copy; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (%1 != null) disableGarbageCollection(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (%1 != null) disableGarbageCollection(); + + + + + + if (%2 != null) disableGarbageCollection(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/generator/typesystem_widgets-qtscript.xml b/generator/typesystem_widgets-qtscript.xml new file mode 100644 index 0000000..89d2c82 --- /dev/null +++ b/generator/typesystem_widgets-qtscript.xml @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QScriptValue %out%_orig = %in%; + QWidget* %out% = qscriptvalue_cast<QWidget*>(%out%_orig); + if (%out% != 0) + context->engine()->newQObject(%out%_orig, %out%, QScriptEngine::QtOwnership); + + + + + + + + Q_DECLARE_METATYPE(QScriptValue) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Q_DECLARE_METATYPE(QScriptValue) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers) + { return QModelIndex(); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/generator/typesystem_widgets.xml b/generator/typesystem_widgets.xml new file mode 100644 index 0000000..91d8ba4 --- /dev/null +++ b/generator/typesystem_widgets.xml @@ -0,0 +1,3940 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + return new QTreeWidgetItemIterator(*copy); + + + delete copy; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (%1 != null) disableGarbageCollection(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers) + { return QModelIndex(); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Q_DECLARE_METATYPE(QScriptValue) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Q_DECLARE_METATYPE(QScriptValue) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QScriptValue %out%_orig = %in%; + QWidget* %out% = qscriptvalue_cast<QWidget*>(%out%_orig); + if (%out% != 0) + context->engine()->newQObject(%out%_orig, %out%, QScriptEngine::QtOwnership); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (%1 != null) disableGarbageCollection(); + + + + + + if (%2 != null) disableGarbageCollection(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/qtbindings/qs_eval/main.cpp b/qtbindings/qs_eval/main.cpp index 2760566..7cc6f3e 100644 --- a/qtbindings/qs_eval/main.cpp +++ b/qtbindings/qs_eval/main.cpp @@ -156,12 +156,15 @@ int main(int argc, char *argv[]) QStringList extensions; extensions << "qt.core" << "qt.gui" + << "qt.widgets" + << "qt.printsupport" << "qt.xml" << "qt.svg" << "qt.network" << "qt.sql" << "qt.opengl" << "qt.webkit" + << "qt.webkitwidgets" << "qt.xmlpatterns" << "qt.uitools"; QStringList failExtensions; diff --git a/qtbindings/qtbindings.pro b/qtbindings/qtbindings.pro index 1e6711e..c10232e 100644 --- a/qtbindings/qtbindings.pro +++ b/qtbindings/qtbindings.pro @@ -1,14 +1,16 @@ TEMPLATE = subdirs SUBDIRS = qtscript_core \ qtscript_gui \ + qtscript_widgets \ + qtscript_printsupport \ qtscript_network \ qtscript_opengl \ qtscript_sql \ qtscript_xml \ + qtscript_svg \ + qtscript_webkit \ + qtscript_webkitwidgets \ + qtscript_xmlpatterns \ + qtscript_uitools \ qs_eval -# qtscript_svg \ -# qtscript_phonon \ -# qtscript_webkit \ -# qtscript_xmlpatterns \ -# qtscript_uitools \ diff --git a/qtbindings/qtscript_phonon/plugin.cpp b/qtbindings/qtscript_phonon/plugin.cpp deleted file mode 100644 index 4737086..0000000 --- a/qtbindings/qtscript_phonon/plugin.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include -#include -#include "plugin.h" - - -QStringList com_trolltech_qt_phonon_ScriptPlugin::keys() const -{ - QStringList list; - list << QLatin1String("qt"); - list << QLatin1String("qt.phonon"); - return list; -} - -void com_trolltech_qt_phonon_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) -{ - if (key == QLatin1String("qt")) { - } else if (key == QLatin1String("qt.phonon")) { - QScriptValue extensionObject = engine->globalObject(); - qtscript_initialize_com_trolltech_qt_phonon_bindings(extensionObject); - } else { - Q_ASSERT_X(false, "com_trolltech_qt_phonon::initialize", qPrintable(key)); - } -} - diff --git a/qtbindings/qtscript_phonon/qtscript_phonon.pro b/qtbindings/qtscript_phonon/qtscript_phonon.pro deleted file mode 100644 index b86b740..0000000 --- a/qtbindings/qtscript_phonon/qtscript_phonon.pro +++ /dev/null @@ -1,7 +0,0 @@ -TARGET = qtscript_phonon -include(../qtbindingsbase.pri) -QT += phonon -SOURCES += plugin.cpp -HEADERS += plugin.h -INCLUDEPATH += ./include/ -include($$GENERATEDCPP/com_trolltech_qt_phonon/com_trolltech_qt_phonon.pri) diff --git a/qtbindings/qtscript_printsupport/include/__package_shared.h b/qtbindings/qtscript_printsupport/include/__package_shared.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/qtbindings/qtscript_printsupport/include/__package_shared.h @@ -0,0 +1 @@ +#pragma once diff --git a/qtbindings/qtscript_printsupport/plugin.cpp b/qtbindings/qtscript_printsupport/plugin.cpp new file mode 100644 index 0000000..aa0e1c8 --- /dev/null +++ b/qtbindings/qtscript_printsupport/plugin.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include "plugin.h" + +QStringList com_trolltech_qt_printsupport_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.printsupport"); + return list; +} + +void com_trolltech_qt_printsupport_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.printsupport")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_printsupport_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_printsupport::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_printsupport/plugin.h b/qtbindings/qtscript_printsupport/plugin.h new file mode 100644 index 0000000..0027373 --- /dev/null +++ b/qtbindings/qtscript_printsupport/plugin.h @@ -0,0 +1,16 @@ +#include +#include +#include + +void qtscript_initialize_com_trolltech_qt_printsupport_bindings(QScriptValue &); + +class com_trolltech_qt_printsupport_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com_trolltech_qt_printsupport_ScriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + + diff --git a/qtbindings/qtscript_printsupport/qtscript_printsupport.pro b/qtbindings/qtscript_printsupport/qtscript_printsupport.pro new file mode 100644 index 0000000..e74d858 --- /dev/null +++ b/qtbindings/qtscript_printsupport/qtscript_printsupport.pro @@ -0,0 +1,7 @@ +TARGET = qtscript_printsupport +include(../qtbindingsbase.pri) +SOURCES += plugin.cpp +HEADERS += plugin.h +QT += core gui widgets printsupport +INCLUDEPATH += ./include/ +include($$GENERATEDCPP/com_trolltech_qt_printsupport/com_trolltech_qt_printsupport.pri) diff --git a/qtbindings/qtscript_uitools/plugin.cpp b/qtbindings/qtscript_uitools/plugin.cpp index 68487bc..abafb82 100644 --- a/qtbindings/qtscript_uitools/plugin.cpp +++ b/qtbindings/qtscript_uitools/plugin.cpp @@ -5,22 +5,22 @@ #include "plugin.h" -QStringList com_trolltech_qt_uitool_ScriptPlugin::keys() const +QStringList com_trolltech_qt_uitools_ScriptPlugin::keys() const { QStringList list; list << QLatin1String("qt"); - list << QLatin1String("qt.uitool"); + list << QLatin1String("qt.uitools"); return list; } -void com_trolltech_qt_uitool_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +void com_trolltech_qt_uitools_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) { if (key == QLatin1String("qt")) { - } else if (key == QLatin1String("qt.uitool")) { + } else if (key == QLatin1String("qt.uitools")) { QScriptValue extensionObject = engine->globalObject(); - qtscript_initialize_com_trolltech_qt_uitool_bindings(extensionObject); + qtscript_initialize_com_trolltech_qt_uitools_bindings(extensionObject); } else { - Q_ASSERT_X(false, "com_trolltech_qt_uitool::initialize", qPrintable(key)); + Q_ASSERT_X(false, "com_trolltech_qt_uitools::initialize", qPrintable(key)); } } diff --git a/qtbindings/qtscript_uitools/qtscript_uitools.pro b/qtbindings/qtscript_uitools/qtscript_uitools.pro index 2568387..678f9db 100644 --- a/qtbindings/qtscript_uitools/qtscript_uitools.pro +++ b/qtbindings/qtscript_uitools/qtscript_uitools.pro @@ -1,7 +1,7 @@ TARGET = qtscript_uitools include(../qtbindingsbase.pri) -CONFIG += uitools +CONFIG += uitools widgets SOURCES += plugin.cpp HEADERS += plugin.h -INCLUDEPATH += ./include/ +INCLUDEPATH += ./include/ ${QTDIR}/include/QtWidgets include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) diff --git a/qtbindings/qtscript_webkit/qtscript_webkit.pro b/qtbindings/qtscript_webkit/qtscript_webkit.pro index db1ca15..393a828 100644 --- a/qtbindings/qtscript_webkit/qtscript_webkit.pro +++ b/qtbindings/qtscript_webkit/qtscript_webkit.pro @@ -1,6 +1,6 @@ TARGET = qtscript_webkit include(../qtbindingsbase.pri) -QT += network webkit +QT += network webkit webkitwidgets SOURCES += plugin.cpp HEADERS += plugin.h INCLUDEPATH += ./include/ diff --git a/qtbindings/qtscript_phonon/include/__package_shared.h b/qtbindings/qtscript_webkitwidgets/include/__package_shared.h similarity index 100% rename from qtbindings/qtscript_phonon/include/__package_shared.h rename to qtbindings/qtscript_webkitwidgets/include/__package_shared.h diff --git a/qtbindings/qtscript_webkitwidgets/plugin.cpp b/qtbindings/qtscript_webkitwidgets/plugin.cpp new file mode 100644 index 0000000..ff0a0d1 --- /dev/null +++ b/qtbindings/qtscript_webkitwidgets/plugin.cpp @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include "plugin.h" + + +QStringList com_trolltech_qt_webkitwidgets_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.webkitwidgets"); + return list; +} + +void com_trolltech_qt_webkitwidgets_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.webkitwidgets")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_webkitwidgets_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_webkitwidgets::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_phonon/plugin.h b/qtbindings/qtscript_webkitwidgets/plugin.h similarity index 51% rename from qtbindings/qtscript_phonon/plugin.h rename to qtbindings/qtscript_webkitwidgets/plugin.h index becb38d..c89d0c3 100644 --- a/qtbindings/qtscript_phonon/plugin.h +++ b/qtbindings/qtscript_webkitwidgets/plugin.h @@ -4,12 +4,12 @@ #include -void qtscript_initialize_com_trolltech_qt_phonon_bindings(QScriptValue &); +void qtscript_initialize_com_trolltech_qt_webkitwidgets_bindings(QScriptValue &); -class com_trolltech_qt_phonon_ScriptPlugin : public QScriptExtensionPlugin +class com_trolltech_qt_webkitwidgets_ScriptPlugin : public QScriptExtensionPlugin { Q_OBJECT -Q_PLUGIN_METADATA(IID "com.trolltech.qt.phonon.scriptPlugin") +Q_PLUGIN_METADATA(IID "com.trolltech.qt.webkitwidgets.scriptPlugin") public: QStringList keys() const; void initialize(const QString &key, QScriptEngine *engine); diff --git a/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro b/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro new file mode 100644 index 0000000..a631276 --- /dev/null +++ b/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro @@ -0,0 +1,7 @@ +TARGET = qtscript_webkitwidgets +include(../qtbindingsbase.pri) +QT += network webkitwidgets +SOURCES += plugin.cpp +HEADERS += plugin.h +INCLUDEPATH += ./include/ +include($$GENERATEDCPP/com_trolltech_qt_webkitwidgets/com_trolltech_qt_webkitwidgets.pri) diff --git a/qtbindings/qtscript_widgets/include/__package_shared.h b/qtbindings/qtscript_widgets/include/__package_shared.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/qtbindings/qtscript_widgets/include/__package_shared.h @@ -0,0 +1 @@ +#pragma once diff --git a/qtbindings/qtscript_widgets/plugin.cpp b/qtbindings/qtscript_widgets/plugin.cpp new file mode 100644 index 0000000..7514702 --- /dev/null +++ b/qtbindings/qtscript_widgets/plugin.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include "plugin.h" + +QStringList com_trolltech_qt_widgets_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.widgets"); + return list; +} + +void com_trolltech_qt_widgets_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.widgets")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_widgets_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_widgets::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_widgets/plugin.h b/qtbindings/qtscript_widgets/plugin.h new file mode 100644 index 0000000..a753ff5 --- /dev/null +++ b/qtbindings/qtscript_widgets/plugin.h @@ -0,0 +1,16 @@ +#include +#include +#include + +void qtscript_initialize_com_trolltech_qt_widgets_bindings(QScriptValue &); + +class com_trolltech_qt_widgets_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com_trolltech_qt_widgets_ScriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + + diff --git a/qtbindings/qtscript_widgets/qtscript_widgets.pro b/qtbindings/qtscript_widgets/qtscript_widgets.pro new file mode 100644 index 0000000..195b0d0 --- /dev/null +++ b/qtbindings/qtscript_widgets/qtscript_widgets.pro @@ -0,0 +1,7 @@ +TARGET = qtscript_widgets +include(../qtbindingsbase.pri) +SOURCES += plugin.cpp +HEADERS += plugin.h +QT += widgets gui +INCLUDEPATH += ./include/ +include($$GENERATEDCPP/com_trolltech_qt_widgets/com_trolltech_qt_widgets.pri) From a6777ca13406df2dc8f814e4175b78171093bd7a Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Tue, 9 Jul 2013 19:08:53 -0700 Subject: [PATCH 24/54] jsx generator for Qt 5.1 --- generator/abstractmetabuilder.cpp | 6 +- generator/generator.pro | 6 +- generator/generatorsetqtscript.cpp | 48 +- generator/jsxgenerator.cpp | 1080 +++++++++++++++++++++++++ generator/jsxgenerator.h | 68 ++ generator/typesystem_gui-qtscript.xml | 1 + 6 files changed, 1183 insertions(+), 26 deletions(-) create mode 100644 generator/jsxgenerator.cpp create mode 100644 generator/jsxgenerator.h diff --git a/generator/abstractmetabuilder.cpp b/generator/abstractmetabuilder.cpp index afa0837..8dfb8f2 100644 --- a/generator/abstractmetabuilder.cpp +++ b/generator/abstractmetabuilder.cpp @@ -1766,9 +1766,9 @@ AbstractMetaType *AbstractMetaBuilder::translateType(const TypeInfo &_typei, boo type = TypeDatabase::instance()->findFlagsType(qualified_name); // 7. No? Try looking it up as a container type - if (!type) - type = TypeDatabase::instance()->findContainerType(name); - + //if (!type) { + // type = TypeDatabase::instance()->findContainerType(name); + //} // 8. No? Check if the current class is a template and this type is one // of the parameters. if (type == 0 && m_current_class != 0) { diff --git a/generator/generator.pro b/generator/generator.pro index d11a783..e8ecd42 100644 --- a/generator/generator.pro +++ b/generator/generator.pro @@ -10,7 +10,8 @@ HEADERS += \ shellimplgenerator.h \ shellheadergenerator.h \ setupgenerator.h \ - docgenerator.h + docgenerator.h \ + jsxgenerator.h SOURCES += \ generatorsetqtscript.cpp \ @@ -21,7 +22,8 @@ SOURCES += \ shellimplgenerator.cpp \ shellheadergenerator.cpp \ setupgenerator.cpp \ - docgenerator.cpp + docgenerator.cpp \ + jsxgenerator.cpp CONFIG -= debug CONFIG += release diff --git a/generator/generatorsetqtscript.cpp b/generator/generatorsetqtscript.cpp index 217a5ca..bf294f9 100644 --- a/generator/generatorsetqtscript.cpp +++ b/generator/generatorsetqtscript.cpp @@ -45,12 +45,13 @@ #include "shellheadergenerator.h" #include "shellimplgenerator.h" #include "docgenerator.h" +#include "jsxgenerator.h" GeneratorSet *GeneratorSet::getInstance() { return new GeneratorSetQtScript(); } -GeneratorSetQtScript::GeneratorSetQtScript() +GeneratorSetQtScript::GeneratorSetQtScript() {} QString GeneratorSetQtScript::usage() { @@ -80,7 +81,7 @@ QString GeneratorSetQtScript::generate() { AbstractMetaClassList classes = builder.classesTopologicalSorted(); QSet declaredTypeNames = builder.qtMetaTypeDeclaredTypeNames(); - PriGenerator priGenerator; + /*PriGenerator priGenerator; priGenerator.setOutputDirectory(outDir); SetupGenerator setupGenerator; @@ -102,37 +103,42 @@ QString GeneratorSetQtScript::generate() { ShellHeaderGenerator shellHeaderGenerator(&priGenerator); shellHeaderGenerator.setOutputDirectory(outDir); shellHeaderGenerator.setClasses(classes); - shellHeaderGenerator.generate(); + shellHeaderGenerator.generate();*/ DocGenerator docGenerator; docGenerator.setOutputDirectory(outDir); docGenerator.setClasses(classes); docGenerator.generate(); - priGenerator.generate(); - setupGenerator.generate(); + JSXGenerator jsxGenerator; + jsxGenerator.setOutputDirectory(outDir); + jsxGenerator.setClasses(classes); + jsxGenerator.generate(); + + //priGenerator.generate(); + //setupGenerator.generate(); return QString("Classes in typesystem: %1\n" "Generated:\n" - " - classes...: %2 (%3)\n" - " - header....: %4 (%5)\n" - " - impl......: %6 (%7)\n" - " - modules...: %8 (%9)\n" - " - pri.......: %10 (%11)\n" + //" - classes...: %2 (%3)\n" + //" - header....: %4 (%5)\n" + //" - impl......: %6 (%7)\n" + //" - modules...: %8 (%9)\n" + //" - pri.......: %10 (%11)\n" ) - .arg(builder.classes().size()) - .arg(classGenerator.numGenerated()) - .arg(classGenerator.numGeneratedAndWritten()) + .arg(builder.classes().size()); + //.arg(classGenerator.numGenerated()) + //.arg(classGenerator.numGeneratedAndWritten()) - .arg(shellHeaderGenerator.numGenerated()) - .arg(shellHeaderGenerator.numGeneratedAndWritten()) + //.arg(shellHeaderGenerator.numGenerated()) + //.arg(shellHeaderGenerator.numGeneratedAndWritten()) - .arg(shellImplGenerator.numGenerated()) - .arg(shellImplGenerator.numGeneratedAndWritten()) + //.arg(shellImplGenerator.numGenerated()) + //.arg(shellImplGenerator.numGeneratedAndWritten()) - .arg(setupGenerator.numGenerated()) - .arg(setupGenerator.numGeneratedAndWritten()) + //.arg(setupGenerator.numGenerated()) + //.arg(setupGenerator.numGeneratedAndWritten()) - .arg(priGenerator.numGenerated()) - .arg(priGenerator.numGeneratedAndWritten()); + //.arg(priGenerator.numGenerated()) + //.arg(priGenerator.numGeneratedAndWritten()); } diff --git a/generator/jsxgenerator.cpp b/generator/jsxgenerator.cpp new file mode 100644 index 0000000..380f1e8 --- /dev/null +++ b/generator/jsxgenerator.cpp @@ -0,0 +1,1080 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Script Generator project on Qt Labs. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "jsxgenerator.h" +#include "fileout.h" +#include + +QList uniqueEnumValueIndexes(const AbstractMetaEnumValueList &values); + +JSXGenerator::JSXGenerator() +{ + _ignoreFileList.insert("qstring"); + _ignoreFileList.insert("qlist"); + _ignoreFileList.insert("qstringlist"); + _ignoreFileList.insert("qvariant"); + _ignoreFileList.insert("qnoimplicitboolcast"); + _ignoreFileList.insert("qvarlengtharray"); + _ignoreFileList.insert("qpair"); + _ignoreFileList.insert("qvector"); + _ignoreFileList.insert("qtconcurrentreducekernel"); + _ignoreFileList.insert("qtconcurrentthreadengine"); + _ignoreFileList.insert("qgenericmatrix"); + _ignoreFileList.insert("qabstracttextdocumentlayout"); + _ignoreFileList.insert("qprinterinfo"); + _ignoreFileList.insert("qtextoption"); + _ignoreFileList.insert("qcoreevent"); + + addRelatedFile("qrect", "qrectf"); + addRelatedFile("qpoint", "qpointf"); + addRelatedFile("qsize", "qsizef"); + addRelatedFile("qline", "qlinef"); + addRelatedFile("qpolygon", "qpolygonf"); +} + +QString JSXGenerator::fileNameForClass(const AbstractMetaClass *meta_class) const +{ + return QString::fromLatin1("%0.jsx").arg(meta_class->name().toLower()); +} + +QString JSXGenerator::subDirectoryForClass(const AbstractMetaClass*) const +{ + return "jsx/qt/"; +} + +static void writeSourceHeader(QTextStream &s, const QString &title) +{ + s << "/*" << endl + << " * JSX wrapper code generated by JSXgenerator." << endl + << " *" << endl + << " * " << title << endl + << " *" << endl + << " * Note: DO NOT EDIT THIS FILE" << endl + << " */" << endl; +} + +void JSXGenerator::addRelatedFile(QString target, QString relatedfile) +{ + if (_relatedFileList.contains(target)) + { + _relatedFileList.value(target)->append(relatedfile); + } + else + { + QStringList* list = new QStringList; + list->append(relatedfile); + _relatedFileList[target] = list; + } +} + +static bool classLessThan(const AbstractMetaClass *c1, const AbstractMetaClass *c2) +{ + return c1->name() < c2->name(); +} + +static void writeInclude(QTextStream &stream, const QString filename) +{ + stream << "import \"qt/" << filename << ".jsx\";" << endl; +} + +static void addIncludeFile(QSet &includes, QString name) +{ + if (name.endsWith("[]")) + { + name.chop(2); + } + switch (name.count("_")) + { + case 0: + includes.insert(name.toLower()); + break; + case 1: + if (name.startsWith("Qt_")) + { + includes.insert("qt"); + } + else + { + includes.insert(name.toLower()); + } + break; + case 2: + if (name.startsWith("Qt_")) + { + name.remove(0, 3); + includes.insert(name.left(name.indexOf("_")).toLower()); + } + break; + case 3: + if (name.startsWith("Qt_Phonon_")) + { + name.remove(0, 10); + includes.insert(name.left(name.indexOf("_")).toLower()); + } + } +} + +bool JSXGenerator::shouldGenerate(const AbstractMetaClass *meta_class) const +{ + uint cg = meta_class->typeEntry()->codeGeneration(); + return (cg & TypeEntry::GenerateCode) != 0; +} + +void JSXGenerator::generate() +{ + Generator::generate(); + + QHash > packHash; + for (int i = 0; i < m_classes.size(); ++i) { + const AbstractMetaClass *cls = m_classes.at(i); + if (shouldGenerate(cls)) + { + packHash[cls->package()].append(cls); + } + } + { + // package pages + QHash >::const_iterator it; + for (it = packHash.constBegin(); it != packHash.constEnd(); ++it) { + QString package = it.key(); + QList classesInPackage = it.value(); + qSort(classesInPackage.begin(), classesInPackage.end(), classLessThan); + + QString packageName = QStringList(package.split(".").mid(2)).join("_"); + FileOut file(m_out_dir + "/jsx/" + packageName + ".jsx"); + + writeSourceHeader(file.stream, package + " Package"); + + for (int i = 0; i < classesInPackage.size(); ++i) { + const AbstractMetaClass *cls = classesInPackage.at(i); + if (cls->name() == "Global") + continue; /// ### fixme + QString fileName = fileNameForClass(cls); + file.stream << "import \"qt/" << fileName << "\"; // " << cls->name() << endl; + } + } + } + + { + // signal page + FileOut file(m_out_dir + "/jsx/qt/_signals.jsx"); + writeSourceHeader(file.stream, "Signals"); + + writeInclude(file.stream, "qabstractanimation"); + writeInclude(file.stream, "qabstractbutton"); + writeInclude(file.stream, "qabstractitemdelegate"); + writeInclude(file.stream, "qabstractsocket"); + writeInclude(file.stream, "qaction"); + writeInclude(file.stream, "qbrush"); + writeInclude(file.stream, "qcolor"); + writeInclude(file.stream, "qclipboard"); + writeInclude(file.stream, "qdate"); + writeInclude(file.stream, "qdockwidget"); + writeInclude(file.stream, "qfont"); + writeInclude(file.stream, "qgraphicsblureffect"); + writeInclude(file.stream, "qheaderview"); + writeInclude(file.stream, "qhttpresponseheader"); + writeInclude(file.stream, "qimagereader"); + writeInclude(file.stream, "qitemselection"); + writeInclude(file.stream, "qlistwidgetitem"); + writeInclude(file.stream, "qlocalsocket"); + writeInclude(file.stream, "qmdisubwindow"); + writeInclude(file.stream, "qmodelindex"); + writeInclude(file.stream, "qmovie"); + writeInclude(file.stream, "qnetworkproxy"); + writeInclude(file.stream, "qauthenticator"); + writeInclude(file.stream, "qnetworkaccessmanager"); + writeInclude(file.stream, "qnetworkreply"); + writeInclude(file.stream, "qnetworkrequest"); + writeInclude(file.stream, "qobject"); + writeInclude(file.stream, "qpoint"); + writeInclude(file.stream, "qpointf"); + writeInclude(file.stream, "qprinter"); + writeInclude(file.stream, "qprocess"); + writeInclude(file.stream, "qrect"); + writeInclude(file.stream, "qrectf"); + writeInclude(file.stream, "qsessionmanager"); + writeInclude(file.stream, "qsize"); + writeInclude(file.stream, "qsqlrecord"); + writeInclude(file.stream, "qsslerror"); + writeInclude(file.stream, "qsslsocket"); + writeInclude(file.stream, "qstandarditem"); + writeInclude(file.stream, "qsystemtrayicon"); + writeInclude(file.stream, "qtablewidgetitem"); + writeInclude(file.stream, "qtextcharformat"); + writeInclude(file.stream, "qtextcursor"); + writeInclude(file.stream, "qtime"); + writeInclude(file.stream, "qtimeline"); + writeInclude(file.stream, "qtreewidgetitem"); + writeInclude(file.stream, "qundostack"); + writeInclude(file.stream, "qurl"); + writeInclude(file.stream, "qurlinfo"); + writeInclude(file.stream, "qwebframe"); + writeInclude(file.stream, "qwidget"); + writeInclude(file.stream, "phonon"); + writeInclude(file.stream, "audiooutputdevice"); + writeInclude(file.stream, "mediasource"); + writeInclude(file.stream, "qt"); + + QMap::const_iterator it; + for (it = _signals.constBegin(); it != _signals.constEnd(); ++it) { + file.stream << "native __fake__ class QtJSX" << it.key() << "Signal {" << endl + << " function connect(callback : function(" + << it.value() << "):void): void;" << endl + << " function disconnect(callback : function(" + << it.value() << "):void): void;" << endl + << "}" << endl << endl; + } + } + + { + // hub file + FileOut file(m_out_dir + "/jsx/qt/objectdescription.jsx"); + writeSourceHeader(file.stream, "Phonon Objects"); + writeInclude(file.stream, "phonon"); + } + + { + // hub file + FileOut file(m_out_dir + "/jsx/qt/qdom.jsx"); + writeSourceHeader(file.stream, "QXML DOM Objects"); + writeInclude(file.stream, "qdomattr"); + writeInclude(file.stream, "qdomnode"); + writeInclude(file.stream, "qdomcharacterdata"); + writeInclude(file.stream, "qdomcomment"); + writeInclude(file.stream, "qdomdocument"); + writeInclude(file.stream, "qdomdocumentfragment"); + writeInclude(file.stream, "qdomdocumenttype"); + writeInclude(file.stream, "qdomelement"); + writeInclude(file.stream, "qdomentityreference"); + writeInclude(file.stream, "qdomimplementation"); + writeInclude(file.stream, "qdomnamednodemap"); + writeInclude(file.stream, "qdomnodelist"); + writeInclude(file.stream, "qdomprocessinginstruction"); + writeInclude(file.stream, "qdomtext"); + } + + { + // hub file + FileOut file(m_out_dir + "/jsx/qt/qxml.jsx"); + writeSourceHeader(file.stream, "QXML SAX Objects"); + writeInclude(file.stream, "qxmlattributes"); + writeInclude(file.stream, "qxmlcontenthandler"); + writeInclude(file.stream, "qxmldeclhandler"); + writeInclude(file.stream, "qxmldtdhandler"); + writeInclude(file.stream, "qxmlentityresolver"); + writeInclude(file.stream, "qxmlerrorhandler"); + writeInclude(file.stream, "qxmlinputsource"); + writeInclude(file.stream, "qxmllexicalhandler"); + } + + { + // hub file + FileOut file(m_out_dir + "/jsx/qt/qxmlstream.jsx"); + writeSourceHeader(file.stream, "QXML Stream Objects"); + writeInclude(file.stream, "qxmlstreamattribute"); + writeInclude(file.stream, "qxmlstreamattributes"); + writeInclude(file.stream, "qxmlstreamentityresolver"); + writeInclude(file.stream, "qxmlstreamreader"); + writeInclude(file.stream, "qxmlstreamentitydeclaration"); + writeInclude(file.stream, "qxmlstreamnamespacedeclaration"); + writeInclude(file.stream, "qxmlstreamnotationdeclaration"); + } + + { + // hub file + FileOut file(m_out_dir + "/jsx/qt/qgl.jsx"); + writeSourceHeader(file.stream, "QOpenGL Objects"); + writeInclude(file.stream, "qglcontext"); + writeInclude(file.stream, "qglshader"); + } + + { + // hub file + FileOut file(m_out_dir + "/jsx/qt/qvariant.jsx"); + writeSourceHeader(file.stream, "QVariant class"); + file.stream << endl + << "native __fake__ class Qt_QVariant_Type {}" << endl + << "native class QVariant {" << endl + << " static const Invalid : Qt_QVariant_Type;" << endl + << " static const BitArray : Qt_QVariant_Type;" << endl + << " static const Bitmap : Qt_QVariant_Type;" << endl + << " static const Bool : Qt_QVariant_Type;" << endl + << " static const Brush : Qt_QVariant_Type;" << endl + << " static const ByteArray : Qt_QVariant_Type;" << endl + << " static const Char : Qt_QVariant_Type;" << endl + << " static const Color : Qt_QVariant_Type;" << endl + << " static const Cursor : Qt_QVariant_Type;" << endl + << " static const Date : Qt_QVariant_Type;" << endl + << " static const DateTime : Qt_QVariant_Type;" << endl + << " static const Double : Qt_QVariant_Type;" << endl + << " static const EasingCurve : Qt_QVariant_Type;" << endl + << " static const Font : Qt_QVariant_Type;" << endl + << " static const Hash : Qt_QVariant_Type;" << endl + << " static const Icon : Qt_QVariant_Type;" << endl + << " static const Image : Qt_QVariant_Type;" << endl + << " static const Int : Qt_QVariant_Type;" << endl + << " static const KeySequence : Qt_QVariant_Type;" << endl + << " static const Line : Qt_QVariant_Type;" << endl + << " static const LineF : Qt_QVariant_Type;" << endl + << " static const List : Qt_QVariant_Type;" << endl + << " static const Locale : Qt_QVariant_Type;" << endl + << " static const LongLong : Qt_QVariant_Type;" << endl + << " static const Map : Qt_QVariant_Type;" << endl + << " static const Matrix : Qt_QVariant_Type;" << endl + << " static const Transform : Qt_QVariant_Type;" << endl + << " static const Matrix4x4 : Qt_QVariant_Type;" << endl + << " static const Palette : Qt_QVariant_Type;" << endl + << " static const Pen : Qt_QVariant_Type;" << endl + << " static const Pixmap : Qt_QVariant_Type;" << endl + << " static const Point : Qt_QVariant_Type;" << endl + << " static const PointArray : Qt_QVariant_Type;" << endl + << " static const PointF : Qt_QVariant_Type;" << endl + << " static const Polygon : Qt_QVariant_Type;" << endl + << " static const Quaternion : Qt_QVariant_Type;" << endl + << " static const Rect : Qt_QVariant_Type;" << endl + << " static const RectF : Qt_QVariant_Type;" << endl + << " static const RegExp : Qt_QVariant_Type;" << endl + << " static const Region : Qt_QVariant_Type;" << endl + << " static const Size : Qt_QVariant_Type;" << endl + << " static const SizeF : Qt_QVariant_Type;" << endl + << " static const SizePolicy : Qt_QVariant_Type;" << endl + << " static const String : Qt_QVariant_Type;" << endl + << " static const StringList : Qt_QVariant_Type;" << endl + << " static const TextFormat : Qt_QVariant_Type;" << endl + << " static const TextLength : Qt_QVariant_Type;" << endl + << " static const Time : Qt_QVariant_Type;" << endl + << " static const UInt : Qt_QVariant_Type;" << endl + << " static const ULongLong : Qt_QVariant_Type;" << endl + << " static const Url : Qt_QVariant_Type;" << endl + << " static const Vector2D : Qt_QVariant_Type;" << endl + << " static const Vector3D : Qt_QVariant_Type;" << endl + << " static const Vector4D : Qt_QVariant_Type;" << endl + << " static const UserType : Qt_QVariant_Type;" << endl + << "}" << endl; + } +} + +static bool shouldIgnoreEnum(const AbstractMetaEnum *enom) +{ + return !enom->wasPublic() || (enom->name() == "enum_1"); +} + +static bool skipType(QString& type) +{ + return (type.contains("QPair") || type.contains("QMap") || + type.contains("QHash") || type.contains("QSet") || + type.contains("QMultiMap") || type == "QGLFormat" || + type.contains("QWebHistory") || type == "QAbstractFileEngine" || + type == "QThread" || type == "QInputMethodEvent" || type == "WId" || + type == "quintptr" || type == "QPrinterInfo" || type == "QGraphicsEffectSource" || + type == "QIconEngineV2" || type.contains("QTextOption") || + type.contains("QAbstractTextDocumentLayout") || type.contains("QGraphicsItem_Extension") || + type == "Qt_HANDLE" || type.startsWith("QWebPluginFactory") || + type.endsWith("iterator") || type == "Qt_QAbstractItemView_CursorAction" || + type == "Qt_QAbstractSlider_SliderChange" || type.startsWith("Qt_QTextLayout_FormatRange") || + type == "Qt_QPainterPath_Element" || type == "Qt_QTextCodec_ConverterState" || + type == "Qt_QAbstractItemView_DropIndicatorPosition" || type == "Qt_QAbstractItemView_State" || + type == "QAbstractProxyModel" || type == "Qt_QFontDatabase_WritingSystem" || + type == "Qt_QTextEdit_ExtraSelection[]" || type == "Qt_Phonon_AddonInterface_Interface" || + type == "Qt_Phonon_BackendInterface_Class" || type == "Qt_QSqlResult_BindingSyntax"); +} + +static bool skipMethod(const AbstractMetaClass* meta_class, const AbstractMetaFunction* func) +{ + QString classname = meta_class->name(); + QString methodname = func->modifiedName(); + if (classname == "QWidget") + { + return (methodname == "windowOpacity" || methodname == "setWindowOpacity"); + } + else if (classname == "QAbstractSocket" || classname == "QProcess" || classname == "QNetworkReply" || classname == "QLocalSocket") + { + return (methodname == "error"); + } + else if (classname == "QDockWidget") + { + return (methodname == "allowedAreas" || methodname == "setAllowedAreas"); + } + else if (classname == "QSslSocket") + { + return (methodname == "sslErrors"); + } + else if (classname == "QSvgGenerator" || classname == "QSvgRenderer") + { + return (methodname == "viewBox" || methodname == "setViewBox"); + } + else if (classname == "QByteArray") + { + return (methodname == "replace" && func->arguments().at(0)->argumentName() == "c"); + } + else if (classname == "QFontMetrics") + { + return (methodname == "boundingRect" && func->arguments().at(0)->argumentName() == "arg__1"); + } + else if (classname == "QFontMetricsF") + { + if (methodname == "boundingRect" || methodname == "width") + { + return (func->arguments().at(0)->argumentName() == "arg__1"); + } + } + else if (methodname == "minimumSizeHint" || methodname == "sizeHint") + { + return (classname != "QWidget"); + } + else if (methodname == "spacing") + { + return (classname == "QBoxLayout" || classname == "QGridLayout" || classname == "QFormLayout"); + } + return (methodname == "toString"); +} + +static bool skipProperty(const AbstractMetaClass* meta_class, const QPropertySpec *prop) +{ + QString classname = meta_class->name(); + QString propname = prop->name(); + if (propname == "duration") + { + return (classname == "QPauseAnimation" || classname == "QVariantAnimation"); + } + else if (classname == "QDockWidget") + { + return (propname == "windowTitle"); + } + else if (classname == "QDialog") + { + return (propname == "modal"); + } + else if (classname == "QPrintDialog") + { + return (propname == "accepted"); + } + else if (classname == "QCommandLinkButton") + { + return (propname == "flat"); + } + else if (classname == "VideoWidget") + { + return (propname == "fullScreen"); + } + return false; +} + +void filterFunctions( + const AbstractMetaClass *meta_class, + QMap &prototypeFunctions, + QMap &staticFunctions, + QMap &signalFunctions, + QMap &slotFunctions) +{ + AbstractMetaFunctionList functions = meta_class->functionsInTargetLang() + meta_class->queryFunctions(AbstractMetaClass::Signals); + for (int i = 0; i < functions.size(); ++i) { + AbstractMetaFunction* func = functions.at(i); + if (func->declaringClass() != meta_class) + continue; // function inherited through prototype + if (func->isSignal()) + { + signalFunctions[func->modifiedName()].append(func); + continue; + } + if (!func->isNormal()) + continue; +#ifdef GENERATOR_NO_PROTECTED_FUNCTIONS + if (func->wasProtected()) + continue; +#endif + if (func->isPropertyReader() || func->isPropertyWriter()) + continue; // no point in including property accessors + //if (func->isInvokable()) + // continue; // no point in including signals and slots + else if (func->isSlot()) + { + slotFunctions[func->modifiedName()].append(func); + } + else if (func->isStatic()) + { + staticFunctions[func->modifiedName()].append(func); + } + else + { + prototypeFunctions[func->modifiedName()].append(func); + } + } +} + +static QString normalizedType(QString str, bool forArg = true) +{ + if (str.contains("char*")) + { + str = "string"; + } + else if (str.endsWith("**")) + { + str.chop(2); + str = str + "[]"; + } + else if (str.endsWith("*")) + { + str.chop(1); + } + if (str.startsWith("QList<")) + { + str.remove(0, 6); + str = str.left(str.lastIndexOf(">")).trimmed(); + if (str.endsWith("*")) + { + str.chop(1); + } + str = str + (forArg ? "[]" : "List"); + } + else if (str.startsWith("QVector<")) + { + str.remove(0, 8); + str = str.left(str.lastIndexOf(">")).trimmed(); + if (str.endsWith("*")) + { + str.chop(1); + } + str = str + (forArg ? "[]" : "List"); + } + else if (str.startsWith("QFlags<")) + { + str.remove(0, 7); + str = str.left(str.lastIndexOf(">")).trimmed(); + if (str == "Qt::WindowType") + { + str = "Qt::WindowFlags"; + } + else if (str.endsWith("ty")) + { + str.chop(1); + str = str + "ies"; + } + else + { + str = str + "s"; + } + } + if (str.contains("::")) + { + str = str.replace("::", "_"); + if (!str.startsWith("Qt_")) + { + str.insert(0, "Qt_"); + } + } + else if (str == QLatin1String("QBool")) // ### hack + str = QLatin1String("boolean"); + return str; +} + +static QString normalizedType(const AbstractMetaType *type, bool forArg = true) +{ + QString str = QString::fromLatin1(QMetaObject::normalizedType(type->cppSignature().toLatin1())); + if (str.endsWith(QLatin1Char('&'))) + str.chop(1); + else if (str.startsWith("const ")) { + if (str.endsWith('*') || type->hasInstantiations() || type->typeEntry()->isValue()) + str.remove(0, 6); + } + return normalizedType(str, forArg); +} + +static void writeFunction(QTextStream &o, const AbstractMetaFunction *fun, QMap &nativeTypes, QSet &existingMethods, QSet& includes, bool isStatic = false) +{ + QMap keywords; + keywords["in"] = "in_"; + keywords["var"] = "var_"; + + QTextStream s("", QIODevice::ReadWrite); + if (isStatic) + { + s << " static function "; + } + else + { + s << " function "; + } + + // Attributes... + + if (fun->isConstructor()) + { + s << "constructor"; + } + else + { + s << fun->modifiedName(); + } + s << " ("; + + int j = 0; + for (int i=0; i< fun->arguments().size(); ++i) { + if (fun->argumentRemoved(i+1)) + continue; + if (j != 0) { + s << "," << QLatin1Char(' '); + } + QString type = normalizedType(fun->arguments().at(i)->type()); + // QtScript binding can't treat QPair + if (skipType(type)) + { + return; + } + QString varname = fun->arguments().at(i)->argumentName(); + QString finaltype = nativeTypes.value(type, type); + s << keywords.value(varname, varname) << " : " << finaltype; + addIncludeFile(includes, finaltype); + ++j; + } + if (fun->isConstructor()) + { + s << ");" << endl; + } + else + { + s << ") : "; + // Return type + if (fun->type()) { + QString sig = normalizedType(fun->type()); + // QtScript binding can't treat QPair + if (skipType(sig)) + { + return; + } + QString finalsig = nativeTypes.value(sig, sig); + s << finalsig << ";" << endl; + addIncludeFile(includes, finalsig); + } else { + s << "void;" << endl; + } + } + s.seek(0); + QString definition = s.readAll(); + if (!existingMethods.contains(definition)) + { + o << definition; + existingMethods.insert(definition); + } +} + +static void writeSignal(QTextStream &s, const AbstractMetaClass *meta_class, const AbstractMetaFunctionList &funs, QMap &nativeTypes, QMap &signalFunctions, QSet &includes) +{ + AbstractMetaFunction* shortestfun = 0; + int length = 10000; + QString signalNameString; + QString signalArgsString; + AbstractMetaFunctionList::const_iterator it; + for (it = funs.constBegin(); it != funs.constEnd(); ++it) { + AbstractMetaFunction* fun = *it; + QTextStream signalName("", QIODevice::ReadWrite); + QTextStream signalArgs("", QIODevice::ReadWrite); + int j = 0; + for (int i=0; i< fun->arguments().size(); ++i) { + if (fun->argumentRemoved(i+1)) + continue; + if (j != 0) { + signalArgs << "," << QLatin1Char(' '); + } + QString type = normalizedType(fun->arguments().at(i)->type(), false); + // QtScript binding can't treat QPair + if (skipType(type)) + { + return; + } + QString name = type; + signalName << name.replace(' ', '_'); + QString finaltype = nativeTypes.value(type, type); + signalArgs << ":" << finaltype; + addIncludeFile(includes, finaltype); + ++j; + } + signalName.seek(0); + QString tmpSignalNameString = signalName.readAll(); + if (tmpSignalNameString.length() < length) + { + signalNameString = tmpSignalNameString; + signalArgs.seek(0); + signalArgsString = signalArgs.readAll(); + shortestfun = fun; + } + } + if (shortestfun) + { + // JSX can't override property! Now this genertor ignores these properties! + if (meta_class->name() == "QPrintDialog" && shortestfun->modifiedName() == "accepted") + { + return; + } + s << " var " << shortestfun->modifiedName(); + s << " : QtJSX"; + s << signalNameString << "Signal;" << endl; + if (!signalFunctions.contains(signalNameString)) + { + signalFunctions[signalNameString] = signalArgsString; + } + } +} + +static void writeProperty(QTextStream &s, const AbstractMetaClass *meta_class, const QPropertySpec *prop, QMap &nativeTypes, QSet &includes) +{ + QString typeName = normalizedType(prop->type()->name()); + QString propName = prop->name(); + QString className = meta_class->name(); + if (className == "QGraphicsObject") + { + // JSX can't override property! Now this genertor ignores these properties! + if (propName == "*") + { + propName = "parent"; + return; + } + else if (propName == "*effect") + { + propName = "effect"; + } + } + else if (className == "QAbstractTransition" && propName == "targetStates") + { + typeName = "QAbstractAnimation[]"; + } + else if (className == "QObject" && propName == "parent") + { + // JSX can't override property! Now this genertor ignores these properties! + typeName = "variant"; + } + QString finalTypeName = nativeTypes.value(typeName, typeName); + if (skipType(finalTypeName)) + { + return; + } + s << " var " << propName << " : " << finalTypeName << ";" << endl; + addIncludeFile(includes, finalTypeName); +} + +void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) +{ + QMap nativeTypes; + nativeTypes["QDateTime"] = "Date"; + nativeTypes["QString"] = "string"; + nativeTypes["QStringRef"] = "string"; + nativeTypes["QChar"] = "string"; + nativeTypes["char"] = "string"; + nativeTypes["unsigned char"] = "int"; + nativeTypes["signed int"] = "int"; + nativeTypes["signed short"] = "int"; + nativeTypes["unsigned short"] = "int"; + nativeTypes["uchar"] = "int"; + nativeTypes["ushort"] = "int"; + nativeTypes["ulong"] = "int"; + nativeTypes["short"] = "int"; + nativeTypes["uint"] = "int"; + nativeTypes["uint[]"] = "int[]"; + nativeTypes["qint64"] = "number"; + nativeTypes["unsigned long long"] = "number"; + nativeTypes["qlonglong"] = "number"; + nativeTypes["qulonglong"] = "number"; + nativeTypes["qreal"] = "number"; + nativeTypes["qreal[]"] = "number[]"; + nativeTypes["float"] = "number"; + nativeTypes["double"] = "number"; + nativeTypes["bool"] = "boolean"; + nativeTypes["QStringList"] = "string[]"; + nativeTypes["QRegExp"] = "RegExp"; + nativeTypes["QVariant"] = "variant"; + nativeTypes["QVariant[]"] = "variant[]"; + nativeTypes["void"] = "variant"; + nativeTypes["QRectFList"] = "QRectF[]"; + nativeTypes["QSslErrorList"] = "QSslError[]"; + nativeTypes["QModelIndexList"] = "QModelIndex[]"; + nativeTypes["Qt_AlignmentFlags"] = "Qt_Alignment"; + nativeTypes["Qt_QAccessible_StateFlags"] = "Qt_QAccessible_State"; + nativeTypes["Qt_QAccessible_RelationFlags"] = "Qt_QAccessible_Relation"; + nativeTypes["Qt_QGraphicsView_CacheModeFlags"] = "Qt_QGraphicsView_CacheMode"; + nativeTypes["Qt_QAbstractSpinBox_StepEnabledFlags"] = "Qt_QAbstractSpinBox_StepEnabled"; + nativeTypes["Qt_QTextEdit_AutoFormattingFlags"] = "Qt_QTextEdit_AutoFormatting"; + nativeTypes["Qt_QUdpSocket_BindFlags"] = "Qt_QUdpSocket_BindMode"; + nativeTypes["Qt_QGLShader_ShaderTypeBits"] = "Qt_QGLShader_ShaderType"; + nativeTypes["Qt_QIODevice_OpenModeFlags"] = "Qt_QIODevice_OpenMode"; + nativeTypes["Qt_QWebPage_ExtensionOption"] = "QWebPage_ExtensionOption"; + nativeTypes["Qt_QWebPage_ExtensionReturn"] = "QWebPage_ExtensionReturn"; + nativeTypes["Qt_QWebPluginFactory_MimeType"] = "QWebPluginFactory_MimeType"; + nativeTypes["Qt_QWebPluginFactory_ExtensionOption"] = "QWebPluginFactory_ExtensionOption"; + nativeTypes["Qt_QWebPluginFactory_ExtensionReturn"] = "QWebPluginFactory_ExtensionReturn"; + nativeTypes["Qt_QWebPluginFactory_Plugin[]"] = "QWebPluginFactory_Plugin[]"; + nativeTypes["Qt_Phonon_AbstractMediaStream"] = "AbstractMediaStream"; + nativeTypes["Qt_Phonon_AudioCaptureDevice[]"] = "AudioCaptureDevice[]"; + nativeTypes["Qt_Phonon_AudioChannelDescription"] = "AudioChannelDescription"; + nativeTypes["Qt_Phonon_AudioChannelDescription[]"] = "AudioChannelDescription[]"; + nativeTypes["Qt_Phonon_AudioOutput"] = "AudioOutput"; + nativeTypes["Qt_Phonon_AudioOutputDevice"] = "AudioOutputDevice"; + nativeTypes["Qt_Phonon_AudioOutputDevice[]"] = "AudioOutputDevice[]"; + nativeTypes["Phonon_AudioOutputDevice"] = "AudioOutputDevice"; + nativeTypes["Qt_Phonon_Effect"] = "Effect"; + nativeTypes["Qt_Phonon_Effect[]"] = "Effect[]"; + nativeTypes["Qt_Phonon_EffectDescription[]"] = "EffectDescription[]"; + nativeTypes["Qt_Phonon_EffectParameter"] = "EffectParameter"; + nativeTypes["Qt_Phonon_EffectParameter[]"] = "EffectParameter[]"; + nativeTypes["Qt_Phonon_EffectParameter_Hints"] = "Qt_EffectParameter_Hints"; + nativeTypes["Qt_Phonon_EffectDescription"] = "EffectDescription"; + nativeTypes["Qt_Phonon_MediaController_Features"] = "Qt_MediaController_Features"; + nativeTypes["Qt_Phonon_MediaNode"] = "MediaNode"; + nativeTypes["Qt_Phonon_MediaObject"] = "MediaObject"; + nativeTypes["Qt_Phonon_MediaSource"] = "MediaSource"; + nativeTypes["Qt_Phonon_MediaSource[]"] = "MediaSource[]"; + nativeTypes["Qt_Phonon_MediaSource_Type"] = "Qt_MediaSource_Type"; + nativeTypes["Qt_Phonon_Path"] = "Path"; + nativeTypes["Qt_Phonon_Path[]"] = "Path[]"; + nativeTypes["Qt_Phonon_SubtitleDescription"] = "SubtitleDescription"; + nativeTypes["Qt_Phonon_SubtitleDescription[]"] = "SubtitleDescription[]"; + nativeTypes["Qt_Phonon_VideoWidget"] = "VideoWidget"; + nativeTypes["Qt_Phonon_VideoWidget_AspectRatio"] = "Qt_VideoWidget_AspectRatio"; + nativeTypes["Qt_Phonon_VideoWidget_ScaleMode"] = "Qt_VideoWidget_ScaleMode"; + nativeTypes["Qt_Phonon_VolumeFaderEffect_FadeCurve"] = "Qt_VolumeFaderEffect_FadeCurve"; + nativeTypes["Qt_QSql_ParamTypeFlags"] = "Qt_QSql_ParamType"; + nativeTypes["QtMsgType"] = "Qt_Global_QtMsgType"; + nativeTypes["Qt_QTouchEvent_TouchPoint"] = "QTouchEvent_TouchPoint"; + nativeTypes["Qt_QTouchEvent_TouchPoint[]"] = "QTouchEvent_TouchPoint[]"; + nativeTypes["Qt_QPixmapCache_Key"] = "QPixmapCache_Key"; + nativeTypes[QString("const ") + meta_class->name() + " &"] = meta_class->name(); + + QSet methods; + QSet includes; + + QString title = meta_class->name(); + title.append(" "); + if (meta_class->isNamespace()) + title.append("namespace"); + else + title.append("class"); + writeSourceHeader(o, title); + + QMap prototypeFunctions; + QMap staticFunctions; + QMap signalFunctions; + QMap slotFunctions; + filterFunctions(meta_class, prototypeFunctions, staticFunctions, signalFunctions, slotFunctions); + + QTextStream s("", QIODevice::ReadWrite); + + { + AbstractMetaEnumList enums = meta_class->enums(); + for (int i = 0; i < enums.size(); ++i) { + const AbstractMetaEnum *enom = enums.at(i); + if (shouldIgnoreEnum(enom)) + continue; + QString classname = meta_class->name(); + if (meta_class->name() != "Qt") + { + classname = QString("Qt_") + classname; + } + s << "final native class " << classname << "_" << enom->name() << " {}" << endl << endl; + FlagsTypeEntry *flags = enom->typeEntry()->flags(); + if (flags) + { + QString jsxName = classname + "_" + flags->flagsName(); + QString cppName = QString("QFlags<") + meta_class->name() + "::" + enom->name() + ">"; + s << "final native class " << jsxName << " {}" << endl << endl; + nativeTypes[cppName] = jsxName; + } + } + } + + if (meta_class->baseClass()) + { + s << "native class " << meta_class->name() << " extends " << meta_class->baseClassName() << endl; + addIncludeFile(includes, meta_class->baseClassName()); + } + else if (!meta_class->interfaces().isEmpty()) + { + AbstractMetaClass *iface = meta_class->interfaces().first(); + AbstractMetaClass *impl = iface->primaryInterfaceImplementor(); + if (impl != meta_class) { + s << "native class " << meta_class->name() << " extends " << impl->name() << endl; + addIncludeFile(includes, impl->name()); + } else { + s << "native class " << meta_class->name() << endl; + } + } + else + { + s << "native class " << meta_class->name() << endl; + } + s << "{" << endl; + + AbstractMetaFunctionList ctors; + ctors = meta_class->queryFunctions(AbstractMetaClass::Constructors + | AbstractMetaClass::WasPublic + | AbstractMetaClass::NotRemovedFromTargetLang); + + // Constructor + if (!ctors.isEmpty()) { + for (int i = 0; i < ctors.size(); ++i) { + writeFunction(s, ctors.at(i), nativeTypes, methods, includes); + } + } + + { + if (!staticFunctions.isEmpty()) { + s << endl; + s << " // Static Members" << endl; + QMap::const_iterator it; + for (it = staticFunctions.constBegin(); it != staticFunctions.constEnd(); ++it) { + writeFunction(s, it.value().first(), nativeTypes, methods, includes, true); + } + } + } + + { + AbstractMetaEnumList enums = meta_class->enums(); + for (int i = 0; i < enums.size(); ++i) { + const AbstractMetaEnum *enom = enums.at(i); + if (shouldIgnoreEnum(enom)) + continue; + AbstractMetaEnumValueList values = enom->values(); + QList indexes = uniqueEnumValueIndexes(values); + s << endl; + QString enomName = meta_class->name() + "_" + enom->name(); + if (!enomName.startsWith("Qt_")) { + enomName.insert(0, "Qt_"); + } + for (int j = 0; j < indexes.size(); ++j) { + AbstractMetaEnumValue *val = values.at(indexes.at(j)); + s << " static const " << val->name() << " : " << enomName << ";" << endl; + } + s << " static function " << enom->name() << "(value : " << enomName << ") : " << enomName << ";" << endl; + nativeTypes[enom->name()] = enomName; + FlagsTypeEntry *flags = enom->typeEntry()->flags(); + if (flags) { + QString flagName = meta_class->name() + "_" + flags->flagsName(); + if (!flagName.startsWith("Qt_")) { + flagName.insert(0, "Qt_"); + } + s << " static function " << flags->flagsName() << "(...value : " << enomName << ") : " + << flagName << ";" << endl; + nativeTypes[flags->flagsName()] = flagName; + } + } + } + + if (!prototypeFunctions.isEmpty()) { + s << endl; + s << " // Methods" << endl; + QMap::const_iterator it; + for (it = prototypeFunctions.constBegin(); it != prototypeFunctions.constEnd(); ++it) { + AbstractMetaFunctionList::const_iterator it2; + for (it2 = it.value().constBegin(); it2 != it.value().constEnd(); ++it2) { + if (!skipMethod(meta_class, *it2)) + { + writeFunction(s, *it2, nativeTypes, methods, includes); + } + } + } + if (meta_class->name() == "QPainter") + { + s << " function begin (arg__1 : QWidget) : boolean;" << endl; + includes.insert("qwidget"); + } + } + + if (!slotFunctions.isEmpty()) { + s << endl; + s << " // Slots" << endl; + QMap::const_iterator it; + for (it = slotFunctions.constBegin(); it != slotFunctions.constEnd(); ++it) { + AbstractMetaFunctionList::const_iterator it2; + for (it2 = it.value().constBegin(); it2 != it.value().constEnd(); ++it2) { + writeFunction(s, *it2, nativeTypes, methods, includes); + } + } + } + + if (!signalFunctions.isEmpty()) { + s << endl; + s << " // Signals" << endl; + QMap::const_iterator it; + for (it = signalFunctions.constBegin(); it != signalFunctions.constEnd(); ++it) { + writeSignal(s, meta_class, it.value(), nativeTypes, _signals, includes); + } + } + + if (!meta_class->isNamespace()) { + QList props = meta_class->propertySpecs(); + if (!props.isEmpty()) { + s << endl; + s << " // Instance Properties" << endl; + for (int i = 0; i < props.size(); ++i) { + if (!skipProperty(meta_class, props.at(i))) + { + writeProperty(s, meta_class, props.at(i), nativeTypes, includes); + } + } + } + } + s << "}" << endl; + + { + includes.remove(meta_class->name().toLower()); + includes.remove("int"); + includes.remove("boolean"); + includes.remove("string"); + includes.remove("number"); + includes.remove("variant"); + includes.remove("qlist"); + includes.remove("qvector"); + includes.remove("date"); + includes.remove("regexp"); + QStringList includeFiles = includes.toList(); + qSort(includeFiles.begin(), includeFiles.end()); + + foreach (const QString &i, includeFiles) { + writeInclude(o, i); + } + if (!signalFunctions.isEmpty()) { + writeInclude(o, "_signals"); + } + o << endl; + } + s.seek(0); + o << s.readAll(); +} + diff --git a/generator/jsxgenerator.h b/generator/jsxgenerator.h new file mode 100644 index 0000000..ed07675 --- /dev/null +++ b/generator/jsxgenerator.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Script Generator project on Qt Labs. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef JSXGENERATOR_H +#define JSXGENERATOR_H + +#include "generator.h" +#include + +class JSXGenerator : public Generator +{ + QSet _ignoreFileList; + QMap _relatedFileList; + QMap _additionalIncludeList; + QMap _signals; + +public: + JSXGenerator(); + + virtual bool shouldGenerate(const AbstractMetaClass *meta_class) const; + virtual void generate(); + virtual QString fileNameForClass(const AbstractMetaClass *meta_class) const; + virtual QString subDirectoryForClass(const AbstractMetaClass *cls) const; + virtual void write(QTextStream &s, const AbstractMetaClass *meta_class); + + void addRelatedFile(QString target, QString relatedfile); + void addAdditionalInclude(QString target, QString includefile); +}; + +#endif diff --git a/generator/typesystem_gui-qtscript.xml b/generator/typesystem_gui-qtscript.xml index 433688e..51f408b 100644 --- a/generator/typesystem_gui-qtscript.xml +++ b/generator/typesystem_gui-qtscript.xml @@ -264,6 +264,7 @@ + From 55cf4d4333836fb63e6392322895fa6066a074f8 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Tue, 9 Jul 2013 22:41:35 -0700 Subject: [PATCH 25/54] erase removed classes from network module --- generator/typesystem_network-common.xml | 23 ------------------- generator/typesystem_network-qtscript.xml | 6 +---- generator/typesystem_network.xml | 27 +---------------------- 3 files changed, 2 insertions(+), 54 deletions(-) diff --git a/generator/typesystem_network-common.xml b/generator/typesystem_network-common.xml index 942bbef..a573653 100644 --- a/generator/typesystem_network-common.xml +++ b/generator/typesystem_network-common.xml @@ -12,15 +12,7 @@ - - - - - - - - @@ -70,18 +62,11 @@ - - - - - - - @@ -116,14 +101,6 @@ - - - - - - - - diff --git a/generator/typesystem_network-qtscript.xml b/generator/typesystem_network-qtscript.xml index a184dd5..1d5f722 100644 --- a/generator/typesystem_network-qtscript.xml +++ b/generator/typesystem_network-qtscript.xml @@ -1,9 +1,5 @@ - - - - @@ -23,7 +19,7 @@ - + diff --git a/generator/typesystem_network.xml b/generator/typesystem_network.xml index 1cf04fd..5e48a6a 100644 --- a/generator/typesystem_network.xml +++ b/generator/typesystem_network.xml @@ -13,15 +13,7 @@ - - - - - - - - @@ -71,11 +63,7 @@ - - - - @@ -88,11 +76,6 @@ - - - - - @@ -137,19 +120,11 @@ - + - - - - - - - - From a78c877e2e0d85f94586b3a891e9b5b65a892f55 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Wed, 10 Jul 2013 02:58:47 -0700 Subject: [PATCH 26/54] add ignore types, fix qtsignal include files --- generator/jsxgenerator.cpp | 58 ++++++-------------------------------- 1 file changed, 9 insertions(+), 49 deletions(-) diff --git a/generator/jsxgenerator.cpp b/generator/jsxgenerator.cpp index 380f1e8..efeeadc 100644 --- a/generator/jsxgenerator.cpp +++ b/generator/jsxgenerator.cpp @@ -47,6 +47,9 @@ QList uniqueEnumValueIndexes(const AbstractMetaEnumValueList &values); JSXGenerator::JSXGenerator() { + _ignoreFileList.insert("long"); + _ignoreFileList.insert("intlist"); + _ignoreFileList.insert("qhttpresponseheader"); _ignoreFileList.insert("qstring"); _ignoreFileList.insert("qlist"); _ignoreFileList.insert("qstringlist"); @@ -143,12 +146,6 @@ static void addIncludeFile(QSet &includes, QString name) includes.insert(name.left(name.indexOf("_")).toLower()); } break; - case 3: - if (name.startsWith("Qt_Phonon_")) - { - name.remove(0, 10); - includes.insert(name.left(name.indexOf("_")).toLower()); - } } } @@ -206,12 +203,13 @@ void JSXGenerator::generate() writeInclude(file.stream, "qbrush"); writeInclude(file.stream, "qcolor"); writeInclude(file.stream, "qclipboard"); + writeInclude(file.stream, "qdoublevalidator"); writeInclude(file.stream, "qdate"); writeInclude(file.stream, "qdockwidget"); writeInclude(file.stream, "qfont"); + writeInclude(file.stream, "qgraphicsitem"); writeInclude(file.stream, "qgraphicsblureffect"); writeInclude(file.stream, "qheaderview"); - writeInclude(file.stream, "qhttpresponseheader"); writeInclude(file.stream, "qimagereader"); writeInclude(file.stream, "qitemselection"); writeInclude(file.stream, "qlistwidgetitem"); @@ -246,12 +244,8 @@ void JSXGenerator::generate() writeInclude(file.stream, "qtreewidgetitem"); writeInclude(file.stream, "qundostack"); writeInclude(file.stream, "qurl"); - writeInclude(file.stream, "qurlinfo"); writeInclude(file.stream, "qwebframe"); writeInclude(file.stream, "qwidget"); - writeInclude(file.stream, "phonon"); - writeInclude(file.stream, "audiooutputdevice"); - writeInclude(file.stream, "mediasource"); writeInclude(file.stream, "qt"); QMap::const_iterator it; @@ -265,13 +259,6 @@ void JSXGenerator::generate() } } - { - // hub file - FileOut file(m_out_dir + "/jsx/qt/objectdescription.jsx"); - writeSourceHeader(file.stream, "Phonon Objects"); - writeInclude(file.stream, "phonon"); - } - { // hub file FileOut file(m_out_dir + "/jsx/qt/qdom.jsx"); @@ -414,8 +401,7 @@ static bool skipType(QString& type) type == "Qt_QPainterPath_Element" || type == "Qt_QTextCodec_ConverterState" || type == "Qt_QAbstractItemView_DropIndicatorPosition" || type == "Qt_QAbstractItemView_State" || type == "QAbstractProxyModel" || type == "Qt_QFontDatabase_WritingSystem" || - type == "Qt_QTextEdit_ExtraSelection[]" || type == "Qt_Phonon_AddonInterface_Interface" || - type == "Qt_Phonon_BackendInterface_Class" || type == "Qt_QSqlResult_BindingSyntax"); + type == "Qt_QTextEdit_ExtraSelection[]" || type == "Qt_QSqlResult_BindingSyntax"); } static bool skipMethod(const AbstractMetaClass* meta_class, const AbstractMetaFunction* func) @@ -799,6 +785,7 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) nativeTypes["QStringRef"] = "string"; nativeTypes["QChar"] = "string"; nativeTypes["char"] = "string"; + nativeTypes["intList"] = "int[]"; nativeTypes["unsigned char"] = "int"; nativeTypes["signed int"] = "int"; nativeTypes["signed short"] = "int"; @@ -806,6 +793,7 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) nativeTypes["uchar"] = "int"; nativeTypes["ushort"] = "int"; nativeTypes["ulong"] = "int"; + nativeTypes["long"] = "int"; nativeTypes["short"] = "int"; nativeTypes["uint"] = "int"; nativeTypes["uint[]"] = "int[]"; @@ -841,35 +829,6 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) nativeTypes["Qt_QWebPluginFactory_ExtensionOption"] = "QWebPluginFactory_ExtensionOption"; nativeTypes["Qt_QWebPluginFactory_ExtensionReturn"] = "QWebPluginFactory_ExtensionReturn"; nativeTypes["Qt_QWebPluginFactory_Plugin[]"] = "QWebPluginFactory_Plugin[]"; - nativeTypes["Qt_Phonon_AbstractMediaStream"] = "AbstractMediaStream"; - nativeTypes["Qt_Phonon_AudioCaptureDevice[]"] = "AudioCaptureDevice[]"; - nativeTypes["Qt_Phonon_AudioChannelDescription"] = "AudioChannelDescription"; - nativeTypes["Qt_Phonon_AudioChannelDescription[]"] = "AudioChannelDescription[]"; - nativeTypes["Qt_Phonon_AudioOutput"] = "AudioOutput"; - nativeTypes["Qt_Phonon_AudioOutputDevice"] = "AudioOutputDevice"; - nativeTypes["Qt_Phonon_AudioOutputDevice[]"] = "AudioOutputDevice[]"; - nativeTypes["Phonon_AudioOutputDevice"] = "AudioOutputDevice"; - nativeTypes["Qt_Phonon_Effect"] = "Effect"; - nativeTypes["Qt_Phonon_Effect[]"] = "Effect[]"; - nativeTypes["Qt_Phonon_EffectDescription[]"] = "EffectDescription[]"; - nativeTypes["Qt_Phonon_EffectParameter"] = "EffectParameter"; - nativeTypes["Qt_Phonon_EffectParameter[]"] = "EffectParameter[]"; - nativeTypes["Qt_Phonon_EffectParameter_Hints"] = "Qt_EffectParameter_Hints"; - nativeTypes["Qt_Phonon_EffectDescription"] = "EffectDescription"; - nativeTypes["Qt_Phonon_MediaController_Features"] = "Qt_MediaController_Features"; - nativeTypes["Qt_Phonon_MediaNode"] = "MediaNode"; - nativeTypes["Qt_Phonon_MediaObject"] = "MediaObject"; - nativeTypes["Qt_Phonon_MediaSource"] = "MediaSource"; - nativeTypes["Qt_Phonon_MediaSource[]"] = "MediaSource[]"; - nativeTypes["Qt_Phonon_MediaSource_Type"] = "Qt_MediaSource_Type"; - nativeTypes["Qt_Phonon_Path"] = "Path"; - nativeTypes["Qt_Phonon_Path[]"] = "Path[]"; - nativeTypes["Qt_Phonon_SubtitleDescription"] = "SubtitleDescription"; - nativeTypes["Qt_Phonon_SubtitleDescription[]"] = "SubtitleDescription[]"; - nativeTypes["Qt_Phonon_VideoWidget"] = "VideoWidget"; - nativeTypes["Qt_Phonon_VideoWidget_AspectRatio"] = "Qt_VideoWidget_AspectRatio"; - nativeTypes["Qt_Phonon_VideoWidget_ScaleMode"] = "Qt_VideoWidget_ScaleMode"; - nativeTypes["Qt_Phonon_VolumeFaderEffect_FadeCurve"] = "Qt_VolumeFaderEffect_FadeCurve"; nativeTypes["Qt_QSql_ParamTypeFlags"] = "Qt_QSql_ParamType"; nativeTypes["QtMsgType"] = "Qt_Global_QtMsgType"; nativeTypes["Qt_QTouchEvent_TouchPoint"] = "QTouchEvent_TouchPoint"; @@ -1055,6 +1014,7 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) { includes.remove(meta_class->name().toLower()); includes.remove("int"); + includes.remove("intlist"); includes.remove("boolean"); includes.remove("string"); includes.remove("number"); From bd75a77ae142b73138c2c845d864da520ebae526 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Wed, 10 Jul 2013 02:59:42 -0700 Subject: [PATCH 27/54] fix some methods not to refer removed type --- generator/typesystem_core-qtscript.xml | 9 +++++++-- generator/typesystem_core.xml | 7 +++++-- generator/typesystem_gui-common.xml | 8 ++------ generator/typesystem_gui.xml | 9 +++------ 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/generator/typesystem_core-qtscript.xml b/generator/typesystem_core-qtscript.xml index 32b9d02..cb7e6dd 100644 --- a/generator/typesystem_core-qtscript.xml +++ b/generator/typesystem_core-qtscript.xml @@ -78,7 +78,12 @@ - + + + + + + @@ -86,7 +91,7 @@ QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index e2e89a2..e4b3afa 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -1043,7 +1043,10 @@ - + + + + @@ -1106,7 +1109,7 @@ QFile & %out% = *qscriptvalue_cast<QFile*>(%in%); - + diff --git a/generator/typesystem_gui-common.xml b/generator/typesystem_gui-common.xml index dd00650..273b17e 100644 --- a/generator/typesystem_gui-common.xml +++ b/generator/typesystem_gui-common.xml @@ -331,7 +331,7 @@ - + - - - - - + diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml index df21430..0576cd2 100644 --- a/generator/typesystem_gui.xml +++ b/generator/typesystem_gui.xml @@ -396,7 +396,7 @@ - + - - - - - + @@ -1161,6 +1157,7 @@ + From 8c206a291243041b9e01918a26db41cf157f9d82 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Thu, 12 Dec 2013 19:29:12 -0800 Subject: [PATCH 28/54] support 5.2 (create multimedia) --- .gitignore | 2 ++ generator/build_all.txt | 1 + generator/generate.sh | 2 ++ generator/typesystem_gui.xml | 1 - generator/typesystem_multimedia-common.xml | 8 +++++++ generator/typesystem_multimedia-qtscript.xml | 3 +++ generator/typesystem_multimedia.xml | 8 +++++++ generator/typesystem_widgets-common.xml | 1 - generator/typesystem_widgets.xml | 1 - qtbindings/qtbindings.pro | 1 + qtbindings/qtbindingsbase.pri | 11 +++++---- .../include/__package_shared.h | 1 + qtbindings/qtscript_multimedia/plugin.cpp | 24 +++++++++++++++++++ qtbindings/qtscript_multimedia/plugin.h | 16 +++++++++++++ .../qtscript_multimedia.pro | 7 ++++++ .../qtscript_uitools/qtscript_uitools.pro | 4 ++-- 16 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 generator/typesystem_multimedia-common.xml create mode 100644 generator/typesystem_multimedia-qtscript.xml create mode 100644 generator/typesystem_multimedia.xml create mode 100644 qtbindings/qtscript_multimedia/include/__package_shared.h create mode 100644 qtbindings/qtscript_multimedia/plugin.cpp create mode 100644 qtbindings/qtscript_multimedia/plugin.h create mode 100644 qtbindings/qtscript_multimedia/qtscript_multimedia.pro diff --git a/.gitignore b/.gitignore index ed82b13..6206425 100644 --- a/.gitignore +++ b/.gitignore @@ -12,9 +12,11 @@ *.log *.o +qtbindings/*/moc_*.cpp /generator/generator /generator/Makefile /generator/Makefile.Debug /generator/Makefile.Release /generator/release/ +.qmake.stash diff --git a/generator/build_all.txt b/generator/build_all.txt index a1bd09a..8cdc78f 100644 --- a/generator/build_all.txt +++ b/generator/build_all.txt @@ -3,6 +3,7 @@ + diff --git a/generator/generate.sh b/generator/generate.sh index db9e0c3..5449c42 100755 --- a/generator/generate.sh +++ b/generator/generate.sh @@ -4,6 +4,8 @@ xsltproc --stringparam source $PWD/typesystem_gui-qtscript.xml merge.xsl typesys xsltproc --stringparam source $PWD/typesystem_widgets-qtscript.xml merge.xsl typesystem_widgets-common.xml > typesystem_widgets.xml +xsltproc --stringparam source $PWD/typesystem_multimedia-qtscript.xml merge.xsl typesystem_multimedia-common.xml > typesystem_multimedia.xml + xsltproc --stringparam source $PWD/typesystem_printsupport-qtscript.xml merge.xsl typesystem_printsupport-common.xml > typesystem_printsupport.xml xsltproc --stringparam source $PWD/typesystem_svg-qtscript.xml merge.xsl typesystem_svg-common.xml > typesystem_svg.xml diff --git a/generator/typesystem_gui.xml b/generator/typesystem_gui.xml index 0576cd2..dc97633 100644 --- a/generator/typesystem_gui.xml +++ b/generator/typesystem_gui.xml @@ -1157,7 +1157,6 @@ - diff --git a/generator/typesystem_multimedia-common.xml b/generator/typesystem_multimedia-common.xml new file mode 100644 index 0000000..0fadbf9 --- /dev/null +++ b/generator/typesystem_multimedia-common.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/generator/typesystem_multimedia-qtscript.xml b/generator/typesystem_multimedia-qtscript.xml new file mode 100644 index 0000000..b110d63 --- /dev/null +++ b/generator/typesystem_multimedia-qtscript.xml @@ -0,0 +1,3 @@ + + + diff --git a/generator/typesystem_multimedia.xml b/generator/typesystem_multimedia.xml new file mode 100644 index 0000000..36e79c5 --- /dev/null +++ b/generator/typesystem_multimedia.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/generator/typesystem_widgets-common.xml b/generator/typesystem_widgets-common.xml index d032ccb..938b1a6 100644 --- a/generator/typesystem_widgets-common.xml +++ b/generator/typesystem_widgets-common.xml @@ -1020,7 +1020,6 @@ - diff --git a/generator/typesystem_widgets.xml b/generator/typesystem_widgets.xml index 91d8ba4..c016f69 100644 --- a/generator/typesystem_widgets.xml +++ b/generator/typesystem_widgets.xml @@ -1081,7 +1081,6 @@ - diff --git a/qtbindings/qtbindings.pro b/qtbindings/qtbindings.pro index c10232e..1aef3d6 100644 --- a/qtbindings/qtbindings.pro +++ b/qtbindings/qtbindings.pro @@ -3,6 +3,7 @@ SUBDIRS = qtscript_core \ qtscript_gui \ qtscript_widgets \ qtscript_printsupport \ + qtscript_multimedia \ qtscript_network \ qtscript_opengl \ qtscript_sql \ diff --git a/qtbindings/qtbindingsbase.pri b/qtbindings/qtbindingsbase.pri index db90057..9ed0a07 100644 --- a/qtbindings/qtbindingsbase.pri +++ b/qtbindings/qtbindingsbase.pri @@ -1,11 +1,14 @@ TEMPLATE = lib DEPENDPATH += . INCLUDEPATH += . - -Release:DESTDIR = $$PWD/../plugins/script -Debug: DESTDIR = $$PWD/../plugins/script_debug + +CONFIG(debug, debug|release) { + DESTDIR = $$PWD/../plugins/script_debug +} else { + DESTDIR = $$PWD/../plugins/script +} QT += script -CONFIG += plugin debug_and_release build_all +CONFIG += plugin release build_all GENERATEDCPP = $$PWD/../generated_cpp TARGET=$$qtLibraryTarget($$TARGET) diff --git a/qtbindings/qtscript_multimedia/include/__package_shared.h b/qtbindings/qtscript_multimedia/include/__package_shared.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/qtbindings/qtscript_multimedia/include/__package_shared.h @@ -0,0 +1 @@ +#pragma once diff --git a/qtbindings/qtscript_multimedia/plugin.cpp b/qtbindings/qtscript_multimedia/plugin.cpp new file mode 100644 index 0000000..75c5d43 --- /dev/null +++ b/qtbindings/qtscript_multimedia/plugin.cpp @@ -0,0 +1,24 @@ +#include +#include +#include +#include "plugin.h" + +QStringList com_trolltech_qt_multimedia_ScriptPlugin::keys() const +{ + QStringList list; + list << QLatin1String("qt"); + list << QLatin1String("qt.multimedia"); + return list; +} + +void com_trolltech_qt_multimedia_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) +{ + if (key == QLatin1String("qt")) { + } else if (key == QLatin1String("qt.multimedia")) { + QScriptValue extensionObject = engine->globalObject(); + qtscript_initialize_com_trolltech_qt_multimedia_bindings(extensionObject); + } else { + Q_ASSERT_X(false, "com_trolltech_qt_multimedia::initialize", qPrintable(key)); + } +} + diff --git a/qtbindings/qtscript_multimedia/plugin.h b/qtbindings/qtscript_multimedia/plugin.h new file mode 100644 index 0000000..9a6823e --- /dev/null +++ b/qtbindings/qtscript_multimedia/plugin.h @@ -0,0 +1,16 @@ +#include +#include +#include + +void qtscript_initialize_com_trolltech_qt_multimedia_bindings(QScriptValue &); + +class com_trolltech_qt_multimedia_ScriptPlugin : public QScriptExtensionPlugin +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "com_trolltech_qt_multimedia_ScriptPlugin") +public: + QStringList keys() const; + void initialize(const QString &key, QScriptEngine *engine); +}; + + diff --git a/qtbindings/qtscript_multimedia/qtscript_multimedia.pro b/qtbindings/qtscript_multimedia/qtscript_multimedia.pro new file mode 100644 index 0000000..f84e7a9 --- /dev/null +++ b/qtbindings/qtscript_multimedia/qtscript_multimedia.pro @@ -0,0 +1,7 @@ +TARGET = qtscript_multimedia +include(../qtbindingsbase.pri) +SOURCES += plugin.cpp +HEADERS += plugin.h +QT += core gui widgets multimedia +INCLUDEPATH += ./include/ +include($$GENERATEDCPP/com_trolltech_qt_multimedia/com_trolltech_qt_multimedia.pri) diff --git a/qtbindings/qtscript_uitools/qtscript_uitools.pro b/qtbindings/qtscript_uitools/qtscript_uitools.pro index 678f9db..6272007 100644 --- a/qtbindings/qtscript_uitools/qtscript_uitools.pro +++ b/qtbindings/qtscript_uitools/qtscript_uitools.pro @@ -1,7 +1,7 @@ TARGET = qtscript_uitools include(../qtbindingsbase.pri) -CONFIG += uitools widgets +QT += uitools widgets SOURCES += plugin.cpp HEADERS += plugin.h -INCLUDEPATH += ./include/ ${QTDIR}/include/QtWidgets +INCLUDEPATH += ./include/ ${QTDIR}/lib/QtWidgets.framework/Headers include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) From 1370ff2c4fa8df9603dfdefc7254e50502fd7516 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Fri, 13 Dec 2013 09:28:40 -0800 Subject: [PATCH 29/54] add signal method renaming for JSX generator --- generator/generator.pri | 5 --- generator/generatorsetqtscript.cpp | 42 ++++++++++++------------ generator/jsxgenerator.cpp | 51 ++++++++++++++++++++++-------- 3 files changed, 60 insertions(+), 38 deletions(-) diff --git a/generator/generator.pri b/generator/generator.pri index c8a651a..5fdd927 100644 --- a/generator/generator.pri +++ b/generator/generator.pri @@ -38,9 +38,6 @@ HEADERS += \ $$GENERATORPATH/abstractmetalang.h \ $$GENERATORPATH/prigenerator.h \ - - - SOURCES += \ $$GENERATORPATH/generator.cpp \ $$GENERATORPATH/main.cpp \ @@ -56,8 +53,6 @@ SOURCES += \ $$GENERATORPATH/abstractmetalang.cpp \ $$GENERATORPATH/prigenerator.cpp \ - - QT = core xml win32-msvc.net { diff --git a/generator/generatorsetqtscript.cpp b/generator/generatorsetqtscript.cpp index bf294f9..464b7f4 100644 --- a/generator/generatorsetqtscript.cpp +++ b/generator/generatorsetqtscript.cpp @@ -81,7 +81,8 @@ QString GeneratorSetQtScript::generate() { AbstractMetaClassList classes = builder.classesTopologicalSorted(); QSet declaredTypeNames = builder.qtMetaTypeDeclaredTypeNames(); - /*PriGenerator priGenerator; + /* Generate C++ */ + PriGenerator priGenerator; priGenerator.setOutputDirectory(outDir); SetupGenerator setupGenerator; @@ -103,42 +104,43 @@ QString GeneratorSetQtScript::generate() { ShellHeaderGenerator shellHeaderGenerator(&priGenerator); shellHeaderGenerator.setOutputDirectory(outDir); shellHeaderGenerator.setClasses(classes); - shellHeaderGenerator.generate();*/ + shellHeaderGenerator.generate(); + /* Generate Document */ DocGenerator docGenerator; docGenerator.setOutputDirectory(outDir); docGenerator.setClasses(classes); docGenerator.generate(); + /* Generate JSX */ JSXGenerator jsxGenerator; jsxGenerator.setOutputDirectory(outDir); jsxGenerator.setClasses(classes); jsxGenerator.generate(); - //priGenerator.generate(); - //setupGenerator.generate(); + priGenerator.generate(); + setupGenerator.generate(); return QString("Classes in typesystem: %1\n" "Generated:\n" - //" - classes...: %2 (%3)\n" - //" - header....: %4 (%5)\n" - //" - impl......: %6 (%7)\n" - //" - modules...: %8 (%9)\n" - //" - pri.......: %10 (%11)\n" + " - classes...: %2 (%3)\n" + " - header....: %4 (%5)\n" + " - impl......: %6 (%7)\n" + " - modules...: %8 (%9)\n" + " - pri.......: %10 (%11)\n" ) - .arg(builder.classes().size()); - //.arg(classGenerator.numGenerated()) - //.arg(classGenerator.numGeneratedAndWritten()) + .arg(classGenerator.numGenerated()) + .arg(classGenerator.numGeneratedAndWritten()) - //.arg(shellHeaderGenerator.numGenerated()) - //.arg(shellHeaderGenerator.numGeneratedAndWritten()) + .arg(shellHeaderGenerator.numGenerated()) + .arg(shellHeaderGenerator.numGeneratedAndWritten()) - //.arg(shellImplGenerator.numGenerated()) - //.arg(shellImplGenerator.numGeneratedAndWritten()) + .arg(shellImplGenerator.numGenerated()) + .arg(shellImplGenerator.numGeneratedAndWritten()) - //.arg(setupGenerator.numGenerated()) - //.arg(setupGenerator.numGeneratedAndWritten()) + .arg(setupGenerator.numGenerated()) + .arg(setupGenerator.numGeneratedAndWritten()) - //.arg(priGenerator.numGenerated()) - //.arg(priGenerator.numGeneratedAndWritten()); + .arg(priGenerator.numGenerated()) + .arg(priGenerator.numGeneratedAndWritten()); } diff --git a/generator/jsxgenerator.cpp b/generator/jsxgenerator.cpp index efeeadc..4dee247 100644 --- a/generator/jsxgenerator.cpp +++ b/generator/jsxgenerator.cpp @@ -210,6 +210,7 @@ void JSXGenerator::generate() writeInclude(file.stream, "qgraphicsitem"); writeInclude(file.stream, "qgraphicsblureffect"); writeInclude(file.stream, "qheaderview"); + writeInclude(file.stream, "qicon"); writeInclude(file.stream, "qimagereader"); writeInclude(file.stream, "qitemselection"); writeInclude(file.stream, "qlistwidgetitem"); @@ -251,10 +252,10 @@ void JSXGenerator::generate() QMap::const_iterator it; for (it = _signals.constBegin(); it != _signals.constEnd(); ++it) { file.stream << "native __fake__ class QtJSX" << it.key() << "Signal {" << endl - << " function connect(callback : function(" - << it.value() << "):void): void;" << endl - << " function disconnect(callback : function(" - << it.value() << "):void): void;" << endl + << " function connect(callback : (" + << it.value() << ") -> void): void;" << endl + << " function disconnect(callback : (" + << it.value() << ") -> void): void;" << endl << "}" << endl << endl; } } @@ -490,16 +491,17 @@ void filterFunctions( QMap &prototypeFunctions, QMap &staticFunctions, QMap &signalFunctions, - QMap &slotFunctions) + QMap &slotFunctions + ) { - AbstractMetaFunctionList functions = meta_class->functionsInTargetLang() + meta_class->queryFunctions(AbstractMetaClass::Signals); + AbstractMetaFunctionList functions = meta_class->functionsInTargetLang() + meta_class->cppSignalFunctions(); for (int i = 0; i < functions.size(); ++i) { AbstractMetaFunction* func = functions.at(i); if (func->declaringClass() != meta_class) continue; // function inherited through prototype if (func->isSignal()) { - signalFunctions[func->modifiedName()].append(func); + signalFunctions[func->originalName()].append(func); continue; } if (!func->isNormal()) @@ -683,7 +685,7 @@ static void writeFunction(QTextStream &o, const AbstractMetaFunction *fun, QMap< } } -static void writeSignal(QTextStream &s, const AbstractMetaClass *meta_class, const AbstractMetaFunctionList &funs, QMap &nativeTypes, QMap &signalFunctions, QSet &includes) +static void writeSignal(QTextStream &s, const AbstractMetaClass *meta_class, const AbstractMetaFunctionList &funs, QMap &nativeTypes, QMap &signalFunctions, QSet &includes, QStringList &signalAliases) { AbstractMetaFunction* shortestfun = 0; int length = 10000; @@ -710,7 +712,7 @@ static void writeSignal(QTextStream &s, const AbstractMetaClass *meta_class, con QString name = type; signalName << name.replace(' ', '_'); QString finaltype = nativeTypes.value(type, type); - signalArgs << ":" << finaltype; + signalArgs << finaltype; addIncludeFile(includes, finaltype); ++j; } @@ -727,17 +729,26 @@ static void writeSignal(QTextStream &s, const AbstractMetaClass *meta_class, con if (shortestfun) { // JSX can't override property! Now this genertor ignores these properties! - if (meta_class->name() == "QPrintDialog" && shortestfun->modifiedName() == "accepted") + if (meta_class->name() == "QPrintDialog" && shortestfun->originalName() == "accepted") { return; } - s << " var " << shortestfun->modifiedName(); + s << " var " << shortestfun->originalName(); s << " : QtJSX"; s << signalNameString << "Signal;" << endl; if (!signalFunctions.contains(signalNameString)) { signalFunctions[signalNameString] = signalArgsString; } + if (funs.length() > 1 && shortestfun->arguments().size() == 1) + { + QTextStream alias("", QIODevice::ReadWrite); + alias << meta_class->name() << ".prototype." << shortestfun->originalName() << " = " + << meta_class->name() << ".prototype['" << shortestfun->originalName() << "(" + << normalizedType(shortestfun->arguments().at(0)->type(), false) << ")'];"; + alias.seek(0); + signalAliases.append(alias.readAll()); + } } } @@ -811,6 +822,7 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) nativeTypes["QVariant"] = "variant"; nativeTypes["QVariant[]"] = "variant[]"; nativeTypes["void"] = "variant"; + nativeTypes["QUrlList"] = "QUrl[]"; nativeTypes["QRectFList"] = "QRectF[]"; nativeTypes["QSslErrorList"] = "QSslError[]"; nativeTypes["QModelIndexList"] = "QModelIndex[]"; @@ -851,6 +863,7 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) QMap staticFunctions; QMap signalFunctions; QMap slotFunctions; + QStringList signalAliases; filterFunctions(meta_class, prototypeFunctions, staticFunctions, signalFunctions, slotFunctions); QTextStream s("", QIODevice::ReadWrite); @@ -992,7 +1005,7 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) s << " // Signals" << endl; QMap::const_iterator it; for (it = signalFunctions.constBegin(); it != signalFunctions.constEnd(); ++it) { - writeSignal(s, meta_class, it.value(), nativeTypes, _signals, includes); + writeSignal(s, meta_class, it.value(), nativeTypes, _signals, includes, signalAliases); } } @@ -1009,7 +1022,19 @@ void JSXGenerator::write(QTextStream &o, const AbstractMetaClass *meta_class) } } } - s << "}" << endl; + s << "}"; + if (signalAliases.length() == 0) + { + s << endl; + } + else + { + s << " = '''" << meta_class->name() << ";" << endl; + foreach (const QString &alias, signalAliases) { + s << alias << endl; + } + s << "''';" << endl; + } { includes.remove(meta_class->name().toLower()); From f729a1a97afb10037cf584311660a28c0cc6c42f Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:44:31 +0100 Subject: [PATCH 30/54] Fix abstract function detection An abstract function is also virtual. --- generator/abstractmetabuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/abstractmetabuilder.cpp b/generator/abstractmetabuilder.cpp index 8dfb8f2..5921127 100644 --- a/generator/abstractmetabuilder.cpp +++ b/generator/abstractmetabuilder.cpp @@ -1524,7 +1524,7 @@ AbstractMetaFunction *AbstractMetaBuilder::traverseFunction(FunctionModelItem fu if (!meta_function->isAbstract()) *meta_function += AbstractMetaAttributes::Native; - if (!function_item->isVirtual()) + if (!function_item->isVirtual() && !meta_function->isAbstract()) *meta_function += AbstractMetaAttributes::Final; if (function_item->isInvokable()) From 3e5aa0f102a7261cdbb217c2559b1df5e0e27cd1 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:45:15 +0100 Subject: [PATCH 31/54] Make enum detection more robust Also add debug output and enable container type lookup --- generator/abstractmetabuilder.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/generator/abstractmetabuilder.cpp b/generator/abstractmetabuilder.cpp index 5921127..9eab325 100644 --- a/generator/abstractmetabuilder.cpp +++ b/generator/abstractmetabuilder.cpp @@ -876,9 +876,13 @@ void AbstractMetaBuilder::figureOutDefaultEnumArguments() if (classes.front() != 0) { classes << classes.front()->baseClass(); + qDebug() << "Search enum value '" << expr << "' in '" << meta_class->name() << "' and its super classes"; + AbstractMetaClassList interfaces = classes.front()->interfaces(); - foreach (AbstractMetaClass *interface, interfaces) - classes << interface->primaryInterfaceImplementor(); + foreach (AbstractMetaClass *interface, interfaces) { + if(classes.front() != interface->primaryInterfaceImplementor()) + classes << interface->primaryInterfaceImplementor(); + } e = classes.front()->findEnumForValue(expr); } @@ -1766,9 +1770,9 @@ AbstractMetaType *AbstractMetaBuilder::translateType(const TypeInfo &_typei, boo type = TypeDatabase::instance()->findFlagsType(qualified_name); // 7. No? Try looking it up as a container type - //if (!type) { - // type = TypeDatabase::instance()->findContainerType(name); - //} + if (!type) + type = TypeDatabase::instance()->findContainerType(name); + // 8. No? Check if the current class is a template and this type is one // of the parameters. if (type == 0 && m_current_class != 0) { From af3842cb67204f8a8cf9ed82fdcd62f3da573067 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:46:50 +0100 Subject: [PATCH 32/54] Do not declare some types as Qt meta types These classes are declared as Qt meta types already: * QItemSelection * QItemSelectionRange * QList * QModelIndexList --- generator/classgenerator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/generator/classgenerator.cpp b/generator/classgenerator.cpp index 5d10558..52af071 100644 --- a/generator/classgenerator.cpp +++ b/generator/classgenerator.cpp @@ -1055,8 +1055,13 @@ void maybeDeclareMetaType(QTextStream &stream, const QString &typeName, nameFootPrint.replace("uint", "unsigned int"); nameFootPrint.replace(" ", ""); - if (nameFootPrint == QLatin1String("QStringList")) { - return; // ### wtf... + if ((nameFootPrint == QLatin1String("QStringList")) || + (nameFootPrint == QLatin1String("QItemSelection")) || + (nameFootPrint == QLatin1String("QItemSelectionRange")) || + (nameFootPrint == QLatin1String("QList")) || + (nameFootPrint == QLatin1String("QModelIndexList"))) + { + return; } if (registeredTypeNames.contains(nameFootPrint) || (QMetaType::type(name.toLatin1()) != 0)) From 1e28471a0247e35faae096df4f0731463057f434 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:48:15 +0100 Subject: [PATCH 33/54] Add QtMultimdia generator * Insert into masterinclude * Add typesystem to resources --- generator/generator.qrc | 1 + generator/qtscript_masterinclude.h | 1 + 2 files changed, 2 insertions(+) diff --git a/generator/generator.qrc b/generator/generator.qrc index c58be04..01a8fd3 100644 --- a/generator/generator.qrc +++ b/generator/generator.qrc @@ -5,6 +5,7 @@ typesystem_core.xml typesystem_gui.xml typesystem_widgets.xml +typesystem_multimedia.xml typesystem_printsupport.xml typesystem_sql.xml typesystem_opengl.xml diff --git a/generator/qtscript_masterinclude.h b/generator/qtscript_masterinclude.h index 4692e0e..a4eca40 100644 --- a/generator/qtscript_masterinclude.h +++ b/generator/qtscript_masterinclude.h @@ -48,6 +48,7 @@ #include #include #include +#include #include From 5bfb36d630ef1025d1293358e02ea08c6639a8f5 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:48:57 +0100 Subject: [PATCH 34/54] Remove QNoImplicitBoolCast include --- generator/typesystem_core-common.xml | 4 ---- generator/typesystem_core.xml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/generator/typesystem_core-common.xml b/generator/typesystem_core-common.xml index d755aef..eac3030 100644 --- a/generator/typesystem_core-common.xml +++ b/generator/typesystem_core-common.xml @@ -876,10 +876,6 @@ - - - - diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index e4b3afa..3c6706b 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -1126,10 +1126,6 @@ - - - - From 8f2facd769a6b1212e2aa9bcb8627a5193077d5c Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:49:10 +0100 Subject: [PATCH 35/54] Remove QWebPluginFactory::Extension objects They to not exist in QWebPluginFactory (any more?) --- generator/typesystem_webkit-common.xml | 4 ++-- generator/typesystem_webkit.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generator/typesystem_webkit-common.xml b/generator/typesystem_webkit-common.xml index 30f1ca5..cc2c3bb 100644 --- a/generator/typesystem_webkit-common.xml +++ b/generator/typesystem_webkit-common.xml @@ -69,8 +69,8 @@ --> - - + diff --git a/generator/typesystem_webkit.xml b/generator/typesystem_webkit.xml index 09d39cb..04266dd 100644 --- a/generator/typesystem_webkit.xml +++ b/generator/typesystem_webkit.xml @@ -8,7 +8,7 @@ - + @@ -69,8 +69,8 @@ --> - - + From ca466f76e08f3d7aebf4a0583399b86b90b5fe64 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:49:56 +0100 Subject: [PATCH 36/54] Remove QMetaTypeFunctionHelper for some types * QEvent * QFontInfo * QFontMetrics * QFontMetricsF --- .../qtscript_core/include/__package_shared.h | 8 ----- .../qtscript_gui/include/__package_shared.h | 31 ------------------- 2 files changed, 39 deletions(-) diff --git a/qtbindings/qtscript_core/include/__package_shared.h b/qtbindings/qtscript_core/include/__package_shared.h index 2b5444a..5db4253 100644 --- a/qtbindings/qtscript_core/include/__package_shared.h +++ b/qtbindings/qtscript_core/include/__package_shared.h @@ -14,14 +14,6 @@ Q_DECLARE_METATYPE(QEvent) namespace QtMetaTypePrivate { -template <> -inline void *QMetaTypeFunctionHelper::Create(const void *t) -{ - if (t) - return new QEvent(*static_cast(t)); - return new QEvent(QEvent::None); -}; - template <> inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { diff --git a/qtbindings/qtscript_gui/include/__package_shared.h b/qtbindings/qtscript_gui/include/__package_shared.h index 98c6239..3e41d08 100644 --- a/qtbindings/qtscript_gui/include/__package_shared.h +++ b/qtbindings/qtscript_gui/include/__package_shared.h @@ -15,14 +15,6 @@ Q_DECLARE_METATYPE(QFontMetricsF) namespace QtMetaTypePrivate { -template <> -inline void *QMetaTypeFunctionHelper::Create(const void *t) -{ - if (t) - return new QFontInfo(*static_cast(t)); - return new QFontInfo(QFont()); -} - template <> inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { @@ -31,18 +23,6 @@ inline void *QMetaTypeFunctionHelper::Construct(void *where, co return new (where) QFontInfo(QFont()); } - - - - -template <> -inline void *QMetaTypeFunctionHelper::Create(const void *t) -{ - if (t) - return new QFontMetrics(*static_cast(t)); - return new QFontMetrics(QFont()); -} - template <> inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { @@ -51,17 +31,6 @@ inline void *QMetaTypeFunctionHelper::Construct(void *where, return new (where) QFontMetrics(QFont()); } - - - -template <> -inline void *QMetaTypeFunctionHelper::Create(const void *t) -{ - if (t) - return new QFontMetricsF(*static_cast(t)); - return new QFontMetricsF(QFont()); -} - template <> inline void *QMetaTypeFunctionHelper::Construct(void *where, const void *t) { From 0841188c0773585af5d52fd8ab1ed15792b1b186 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 17:53:08 +0100 Subject: [PATCH 37/54] Add Qt and compiler version to readme Qt and compiler version the latest changes were tested with have been added to the README --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index 1106334..fb390a8 100644 --- a/README +++ b/README @@ -1,7 +1,8 @@ Qt Script Generator labs package, version 0.2 -The Qt Script Generator is a tool that generates Qt bindings for Qt Script. +The Qt Script Generator is a tool that generates Qt bindings for Qt Script. This should work +with Qt 5.5.0 and MSVC 2012. --- From a5608738c6b19403f7c263cafc4815efa2cb7121 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 19:03:32 +0100 Subject: [PATCH 38/54] Fix compiler error C2582 with MSVC This should fix C2582 (xutility) for MSVC 2010 and (some) 2012: C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\xutility(275) : error C2582: 'operator =' function is unavailable in 'rpp::pp_output_iterator<_Container>' Credits: http://stackoverflow.com/questions/2791525/stl-operator-behavior-change-with-visual-studio-2010 --- generator/parser/rpp/pp-iterator.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generator/parser/rpp/pp-iterator.h b/generator/parser/rpp/pp-iterator.h index d982efb..bdcd8aa 100644 --- a/generator/parser/rpp/pp-iterator.h +++ b/generator/parser/rpp/pp-iterator.h @@ -83,8 +83,13 @@ class pp_output_iterator inline pp_output_iterator &operator * () { return *this; } inline pp_output_iterator &operator ++ () { return *this; } inline pp_output_iterator operator ++ (int) { return *this; } + // Fix C2582 in MSVC2010/2012: http://stackoverflow.com/questions/2791525/stl-operator-behavior-change-with-visual-studio-2010 + inline pp_output_iterator &operator=(const typename pp_output_iterator<_Container>& __v) + { + _M_result = __v._M_result; + return *this; + } }; - } // namespace rpp #endif // PP_ITERATOR_H From 658cb85e4ca0a41a4c31cdb1f73688706b7c89ee Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 19:23:35 +0100 Subject: [PATCH 39/54] WebKitWidgets: Add Qt module printsupport --- qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro b/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro index a631276..6c9e212 100644 --- a/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro +++ b/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro @@ -1,6 +1,6 @@ TARGET = qtscript_webkitwidgets include(../qtbindingsbase.pri) -QT += network webkitwidgets +QT += network webkitwidgets printsupport SOURCES += plugin.cpp HEADERS += plugin.h INCLUDEPATH += ./include/ From a54bb785fc6ce517aa02d5bcb20cb5ac0dfe7941 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 20:58:31 +0100 Subject: [PATCH 40/54] Add some debugging symbols configuration switches for Windows (MSVC) --- qtbindings/qtbindingsbase.pri | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qtbindings/qtbindingsbase.pri b/qtbindings/qtbindingsbase.pri index 9ed0a07..30c2a6c 100644 --- a/qtbindings/qtbindingsbase.pri +++ b/qtbindings/qtbindingsbase.pri @@ -1,6 +1,7 @@ TEMPLATE = lib DEPENDPATH += . INCLUDEPATH += . +PDBEXT = .pdb CONFIG(debug, debug|release) { DESTDIR = $$PWD/../plugins/script_debug @@ -8,6 +9,11 @@ CONFIG(debug, debug|release) { DESTDIR = $$PWD/../plugins/script } +win32:{ + QMAKE_CXXFLAGS += /MP /GS /Zi + QMAKE_LFLAGS += /DEBUG /OPT:REF /OPT:ICF /PDB:"$$DESTDIR\$$TARGET$$PDBEXT" +} + QT += script CONFIG += plugin release build_all GENERATEDCPP = $$PWD/../generated_cpp From 966cc1aedbada87727e2ad19228806ff35baa867 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Sat, 27 Feb 2016 21:04:48 +0100 Subject: [PATCH 41/54] Use forward slash for PDB path instead of backslash --- qtbindings/qtbindingsbase.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtbindings/qtbindingsbase.pri b/qtbindings/qtbindingsbase.pri index 30c2a6c..edaefec 100644 --- a/qtbindings/qtbindingsbase.pri +++ b/qtbindings/qtbindingsbase.pri @@ -11,7 +11,7 @@ CONFIG(debug, debug|release) { win32:{ QMAKE_CXXFLAGS += /MP /GS /Zi - QMAKE_LFLAGS += /DEBUG /OPT:REF /OPT:ICF /PDB:"$$DESTDIR\$$TARGET$$PDBEXT" + QMAKE_LFLAGS += /DEBUG /OPT:REF /OPT:ICF /PDB:"$$DESTDIR/$$TARGET$$PDBEXT" } QT += script From 91a7b6543671131d5ccaf44cc199f60efd4a525a Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Wed, 20 Apr 2016 09:40:41 +0200 Subject: [PATCH 42/54] Assign const char[] to const char* (Windows) --- generator/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/main.h b/generator/main.h index bc9334e..b9e2380 100644 --- a/generator/main.h +++ b/generator/main.h @@ -72,7 +72,7 @@ struct Preprocess includes << QString("."); #if defined(Q_OS_WIN32) - char *path_splitter = ";"; + const char *path_splitter = ";"; #else const char *path_splitter = ":"; #endif From 09d284db3185bcaa6ba47266e7d9a166f4753ddb Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Wed, 20 Apr 2016 13:53:55 +0200 Subject: [PATCH 43/54] Workaround for crash if declarator->id is nullptr. Basically as as "scope not found". --- generator/parser/binder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/parser/binder.cpp b/generator/parser/binder.cpp index 301154f..d5fe08d 100644 --- a/generator/parser/binder.cpp +++ b/generator/parser/binder.cpp @@ -359,7 +359,7 @@ void Binder::visitFunctionDefinition(FunctionDefinitionAST *node) CodeModelFinder finder(model(), this); ScopeModelItem functionScope = finder.resolveScope(declarator->id, scope); - if (! functionScope) + if (! functionScope || ! declarator->id) { name_cc.run(declarator->id); std::cerr << "** WARNING scope not found for function definition:" From af0d48ff2f59c35740120a2b7076b3671332bb46 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Wed, 20 Apr 2016 14:04:58 +0200 Subject: [PATCH 44/54] Prevent loop that might occur when resolving a type --- generator/parser/codemodel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generator/parser/codemodel.cpp b/generator/parser/codemodel.cpp index 51b9b72..59b51b3 100644 --- a/generator/parser/codemodel.cpp +++ b/generator/parser/codemodel.cpp @@ -165,10 +165,15 @@ TypeInfo TypeInfo::resolveType (TypeInfo const &__type, CodeModelItem __scope) TypeInfo otherType(__type); if (__item && __item->qualifiedName().size() > 1) { otherType.setQualifiedName(__item->qualifiedName()); + return otherType; } if (TypeAliasModelItem __alias = model_dynamic_cast (__item)) - return resolveType (TypeInfo::combine (__alias->type (), otherType), __scope); + { + TypeInfo combined = TypeInfo::combine(__alias->type(), otherType); + if (combined != __type) + return resolveType(combined, __scope); + } return otherType; } From d277be05ce5f97776ee3e0c9e23e147e0e12fd05 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Wed, 20 Apr 2016 14:06:11 +0200 Subject: [PATCH 45/54] Ignore new operator in QTextStream: operator<<(const QStringRef&) --- generator/typesystem_core.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generator/typesystem_core.xml b/generator/typesystem_core.xml index 3c6706b..f0734e6 100644 --- a/generator/typesystem_core.xml +++ b/generator/typesystem_core.xml @@ -2219,6 +2219,10 @@ + + + + From b7756ead9f7989cfc9c4c94c008483677cf391e6 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Wed, 20 Apr 2016 14:13:14 +0200 Subject: [PATCH 46/54] Update README, change the currently supported compiler version. --- README | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README b/README index fb390a8..6981dbb 100644 --- a/README +++ b/README @@ -1,8 +1,7 @@ Qt Script Generator labs package, version 0.2 - The Qt Script Generator is a tool that generates Qt bindings for Qt Script. This should work -with Qt 5.5.0 and MSVC 2012. +with Qt 5.6.0 and MSVC 2015 (Update 1). --- From 61fbc88d89d916c56e30638667be7084b35696f9 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Thu, 21 Apr 2016 13:19:54 +0200 Subject: [PATCH 47/54] Initial support for Qt5.7.0. To be honest, it's a kind of brute-force approach... --- qtbindings/qtscript_gui/include/__package_shared.h | 3 +++ qtbindings/qtscript_printsupport/include/__package_shared.h | 3 +++ qtbindings/qtscript_svg/include/__package_shared.h | 3 ++- qtbindings/qtscript_webkit/include/__package_shared.h | 3 ++- qtbindings/qtscript_webkitwidgets/include/__package_shared.h | 3 ++- qtbindings/qtscript_widgets/include/__package_shared.h | 3 +++ 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/qtbindings/qtscript_gui/include/__package_shared.h b/qtbindings/qtscript_gui/include/__package_shared.h index 3e41d08..42e7b20 100644 --- a/qtbindings/qtscript_gui/include/__package_shared.h +++ b/qtbindings/qtscript_gui/include/__package_shared.h @@ -7,6 +7,9 @@ #include #include +#include +#include +#include Q_DECLARE_METATYPE(QFontInfo) Q_DECLARE_METATYPE(QFontMetrics) diff --git a/qtbindings/qtscript_printsupport/include/__package_shared.h b/qtbindings/qtscript_printsupport/include/__package_shared.h index 6f70f09..5f8e223 100644 --- a/qtbindings/qtscript_printsupport/include/__package_shared.h +++ b/qtbindings/qtscript_printsupport/include/__package_shared.h @@ -1 +1,4 @@ #pragma once + +#include +#include diff --git a/qtbindings/qtscript_svg/include/__package_shared.h b/qtbindings/qtscript_svg/include/__package_shared.h index 25f818e..5f8e223 100644 --- a/qtbindings/qtscript_svg/include/__package_shared.h +++ b/qtbindings/qtscript_svg/include/__package_shared.h @@ -1,3 +1,4 @@ - #pragma once +#include +#include diff --git a/qtbindings/qtscript_webkit/include/__package_shared.h b/qtbindings/qtscript_webkit/include/__package_shared.h index 25f818e..5f8e223 100644 --- a/qtbindings/qtscript_webkit/include/__package_shared.h +++ b/qtbindings/qtscript_webkit/include/__package_shared.h @@ -1,3 +1,4 @@ - #pragma once +#include +#include diff --git a/qtbindings/qtscript_webkitwidgets/include/__package_shared.h b/qtbindings/qtscript_webkitwidgets/include/__package_shared.h index 25f818e..5f8e223 100644 --- a/qtbindings/qtscript_webkitwidgets/include/__package_shared.h +++ b/qtbindings/qtscript_webkitwidgets/include/__package_shared.h @@ -1,3 +1,4 @@ - #pragma once +#include +#include diff --git a/qtbindings/qtscript_widgets/include/__package_shared.h b/qtbindings/qtscript_widgets/include/__package_shared.h index 6f70f09..5f8e223 100644 --- a/qtbindings/qtscript_widgets/include/__package_shared.h +++ b/qtbindings/qtscript_widgets/include/__package_shared.h @@ -1 +1,4 @@ #pragma once + +#include +#include From e68cfb33d641e2083701740ed091c29c703c1c5e Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Tue, 26 Apr 2016 17:18:16 +0200 Subject: [PATCH 48/54] Remove QtWebKit --- examples/WebKitPlugins.html | 13 -- examples/WebKitPlugins.js | 147 ------------------ generator/build_all.txt | 2 - generator/build_webkit.txt | 7 - generator/build_webkitwidgets.txt | 6 - generator/generate.sh | 4 - generator/generator.qrc | 2 - generator/qtscript_masterinclude.h | 5 - generator/typesystem_webkit-common.xml | 108 ------------- generator/typesystem_webkit-qtscript.xml | 10 -- generator/typesystem_webkit.xml | 108 ------------- generator/typesystem_webkitwidgets-common.xml | 106 ------------- .../typesystem_webkitwidgets-qtscript.xml | 19 --- generator/typesystem_webkitwidgets.xml | 112 ------------- qtbindings/qtbindings.pro | 8 +- .../include/__package_shared.h | 4 - qtbindings/qtscript_webkit/plugin.cpp | 26 ---- qtbindings/qtscript_webkit/plugin.h | 17 -- .../qtscript_webkit/qtscript_webkit.pro | 7 - .../include/__package_shared.h | 4 - qtbindings/qtscript_webkitwidgets/plugin.cpp | 26 ---- qtbindings/qtscript_webkitwidgets/plugin.h | 17 -- .../qtscript_webkitwidgets.pro | 7 - 23 files changed, 3 insertions(+), 762 deletions(-) delete mode 100644 examples/WebKitPlugins.html delete mode 100644 examples/WebKitPlugins.js delete mode 100644 generator/build_webkit.txt delete mode 100644 generator/build_webkitwidgets.txt delete mode 100644 generator/typesystem_webkit-common.xml delete mode 100644 generator/typesystem_webkit-qtscript.xml delete mode 100644 generator/typesystem_webkit.xml delete mode 100644 generator/typesystem_webkitwidgets-common.xml delete mode 100644 generator/typesystem_webkitwidgets-qtscript.xml delete mode 100644 generator/typesystem_webkitwidgets.xml delete mode 100644 qtbindings/qtscript_webkit/include/__package_shared.h delete mode 100644 qtbindings/qtscript_webkit/plugin.cpp delete mode 100644 qtbindings/qtscript_webkit/plugin.h delete mode 100644 qtbindings/qtscript_webkit/qtscript_webkit.pro delete mode 100644 qtbindings/qtscript_webkitwidgets/include/__package_shared.h delete mode 100644 qtbindings/qtscript_webkitwidgets/plugin.cpp delete mode 100644 qtbindings/qtscript_webkitwidgets/plugin.h delete mode 100644 qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro diff --git a/examples/WebKitPlugins.html b/examples/WebKitPlugins.html deleted file mode 100644 index 9146696..0000000 --- a/examples/WebKitPlugins.html +++ /dev/null @@ -1,13 +0,0 @@ - - -
-

My Nifty Plugin

- - - - - - -
- - diff --git a/examples/WebKitPlugins.js b/examples/WebKitPlugins.js deleted file mode 100644 index 5f8f2c7..0000000 --- a/examples/WebKitPlugins.js +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Script Generator project on Qt Labs. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -function getArgumentValue(name, names, values, from) -{ - var i = (from == undefined) ? 0 : from; - for ( ; i < names.length; ++i) { - if (names[i] == name) - return values[i]; - } - return undefined; -} - -// -// Plugin class -// - -function MyWebPlugin(formUrl, scriptUrl, parent) -{ - QWidget.call(this, parent); - - this.initialized = false; - this.formReply = this.downloadFile(formUrl, this.formDownloaded); - if (scriptUrl == undefined) - this.script = ""; - else - this.scriptReply = this.downloadFile(scriptUrl, this.scriptDownloaded); -} - -MyWebPlugin.prototype = new QWidget(); - -MyWebPlugin.prototype.downloadFile = function(url, callback) -{ - if (this.accessManager == undefined) - this.accessManager = new QNetworkAccessManager(); - var reply = this.accessManager.get(new QNetworkRequest(url)); - reply.finished.connect(this, callback); - return reply; -} - -MyWebPlugin.prototype.formDownloaded = function() -{ - var loader = new QUiLoader(); - this.form = loader.load(this.formReply); - var layout = new QVBoxLayout(this); - layout.addWidget(this.form, 0, Qt.AlignCenter); - this.initialize(); -} - -MyWebPlugin.prototype.scriptDownloaded = function() -{ - var stream = new QTextStream(this.scriptReply); - this.script = stream.readAll(); - this.initialize(); -} - -MyWebPlugin.prototype.initialize = function() -{ - if (this.initialized) - return; - if ((this.form == undefined) || (this.script == undefined)) - return; - var ctor = eval(this.script); - if (typeof ctor != "function") - return; - this.instance = new ctor(this.form); - this.initialized = true; -} - - -// -// QWebPluginFactory subclass -// - -function MyWebPluginFactory(parent) -{ - QWebPluginFactory.call(this, parent); -} - -MyWebPluginFactory.prototype = new QWebPluginFactory(); - -MyWebPluginFactory.prototype.create = function(mimeType, url, argumentNames, argumentValues) -{ - if (mimeType != "application/x-qtform") - return null; - - var formUrl = getArgumentValue("form", argumentNames, argumentValues); - var scriptUrl = getArgumentValue("script", argumentNames, argumentValues); - if (formUrl == undefined) - return null; - - return new MyWebPlugin(new QUrl(formUrl), new QUrl(scriptUrl)); -} - - -// -// Main -// - -var view = new QWebView(); -view.settings().setAttribute(QWebSettings.PluginsEnabled, true); - -var factory = new MyWebPluginFactory(); -view.page().setPluginFactory(factory); - -view.load(new QUrl("WebKitPlugins.html")); -view.show(); - -QCoreApplication.exec(); diff --git a/generator/build_all.txt b/generator/build_all.txt index 8cdc78f..69e942d 100644 --- a/generator/build_all.txt +++ b/generator/build_all.txt @@ -9,8 +9,6 @@ - - diff --git a/generator/build_webkit.txt b/generator/build_webkit.txt deleted file mode 100644 index 8436bba..0000000 --- a/generator/build_webkit.txt +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/generator/build_webkitwidgets.txt b/generator/build_webkitwidgets.txt deleted file mode 100644 index 7df07ce..0000000 --- a/generator/build_webkitwidgets.txt +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/generator/generate.sh b/generator/generate.sh index 5449c42..bcc9856 100755 --- a/generator/generate.sh +++ b/generator/generate.sh @@ -18,10 +18,6 @@ xsltproc --stringparam source $PWD/typesystem_xml-qtscript.xml merge.xsl typesys xsltproc --stringparam source $PWD/typesystem_sql-qtscript.xml merge.xsl typesystem_sql-common.xml > typesystem_sql.xml -xsltproc --stringparam source $PWD/typesystem_webkit-qtscript.xml merge.xsl typesystem_webkit-common.xml > typesystem_webkit.xml - -xsltproc --stringparam source $PWD/typesystem_webkitwidgets-qtscript.xml merge.xsl typesystem_webkitwidgets-common.xml > typesystem_webkitwidgets.xml - xsltproc --stringparam source $PWD/typesystem_xmlpatterns-qtscript.xml merge.xsl typesystem_xmlpatterns-common.xml > typesystem_xmlpatterns.xml # ./generator qtscript_masterinclude.h typesystem_core.xml --diff diff --git a/generator/generator.qrc b/generator/generator.qrc index 01a8fd3..58ccdc5 100644 --- a/generator/generator.qrc +++ b/generator/generator.qrc @@ -12,8 +12,6 @@ typesystem_svg.xml typesystem_network.xml typesystem_xml.xml -typesystem_webkit.xml -typesystem_webkitwidgets.xml typesystem_xmlpatterns.xml typesystem_uitools.xml parser/rpp/pp-qt-configuration diff --git a/generator/qtscript_masterinclude.h b/generator/qtscript_masterinclude.h index a4eca40..1e70d2c 100644 --- a/generator/qtscript_masterinclude.h +++ b/generator/qtscript_masterinclude.h @@ -56,11 +56,6 @@ # include #endif -#ifndef QT_NO_WEBKIT -# include -# include -#endif - #ifndef QT_NO_PHONON # include #endif diff --git a/generator/typesystem_webkit-common.xml b/generator/typesystem_webkit-common.xml deleted file mode 100644 index cc2c3bb..0000000 --- a/generator/typesystem_webkit-common.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - return new QWebHistoryItem(*copy); - - - delete copy; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/generator/typesystem_webkit-qtscript.xml b/generator/typesystem_webkit-qtscript.xml deleted file mode 100644 index 290d415..0000000 --- a/generator/typesystem_webkit-qtscript.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/generator/typesystem_webkit.xml b/generator/typesystem_webkit.xml deleted file mode 100644 index 04266dd..0000000 --- a/generator/typesystem_webkit.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - return new QWebHistoryItem(*copy); - - - delete copy; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/generator/typesystem_webkitwidgets-common.xml b/generator/typesystem_webkitwidgets-common.xml deleted file mode 100644 index 9e716d1..0000000 --- a/generator/typesystem_webkitwidgets-common.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/generator/typesystem_webkitwidgets-qtscript.xml b/generator/typesystem_webkitwidgets-qtscript.xml deleted file mode 100644 index e1c6c86..0000000 --- a/generator/typesystem_webkitwidgets-qtscript.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/generator/typesystem_webkitwidgets.xml b/generator/typesystem_webkitwidgets.xml deleted file mode 100644 index 2be37a0..0000000 --- a/generator/typesystem_webkitwidgets.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qtbindings/qtbindings.pro b/qtbindings/qtbindings.pro index 1aef3d6..cb2c705 100644 --- a/qtbindings/qtbindings.pro +++ b/qtbindings/qtbindings.pro @@ -8,10 +8,8 @@ SUBDIRS = qtscript_core \ qtscript_opengl \ qtscript_sql \ qtscript_xml \ - qtscript_svg \ - qtscript_webkit \ - qtscript_webkitwidgets \ - qtscript_xmlpatterns \ - qtscript_uitools \ + qtscript_svg \ + qtscript_xmlpatterns \ + qtscript_uitools \ qs_eval diff --git a/qtbindings/qtscript_webkit/include/__package_shared.h b/qtbindings/qtscript_webkit/include/__package_shared.h deleted file mode 100644 index 5f8e223..0000000 --- a/qtbindings/qtscript_webkit/include/__package_shared.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include -#include diff --git a/qtbindings/qtscript_webkit/plugin.cpp b/qtbindings/qtscript_webkit/plugin.cpp deleted file mode 100644 index 2b41e5f..0000000 --- a/qtbindings/qtscript_webkit/plugin.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include -#include -#include "plugin.h" - - -QStringList com_trolltech_qt_webkit_ScriptPlugin::keys() const -{ - QStringList list; - list << QLatin1String("qt"); - list << QLatin1String("qt.webkit"); - return list; -} - -void com_trolltech_qt_webkit_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) -{ - if (key == QLatin1String("qt")) { - } else if (key == QLatin1String("qt.webkit")) { - QScriptValue extensionObject = engine->globalObject(); - qtscript_initialize_com_trolltech_qt_webkit_bindings(extensionObject); - } else { - Q_ASSERT_X(false, "com_trolltech_qt_webkit::initialize", qPrintable(key)); - } -} - diff --git a/qtbindings/qtscript_webkit/plugin.h b/qtbindings/qtscript_webkit/plugin.h deleted file mode 100644 index b6e13b3..0000000 --- a/qtbindings/qtscript_webkit/plugin.h +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include -#include - - -void qtscript_initialize_com_trolltech_qt_webkit_bindings(QScriptValue &); - -class com_trolltech_qt_webkit_ScriptPlugin : public QScriptExtensionPlugin -{ -Q_OBJECT -Q_PLUGIN_METADATA(IID "com.trolltech.qt.webkit.scriptPlugin") -public: - QStringList keys() const; - void initialize(const QString &key, QScriptEngine *engine); -}; - diff --git a/qtbindings/qtscript_webkit/qtscript_webkit.pro b/qtbindings/qtscript_webkit/qtscript_webkit.pro deleted file mode 100644 index 393a828..0000000 --- a/qtbindings/qtscript_webkit/qtscript_webkit.pro +++ /dev/null @@ -1,7 +0,0 @@ -TARGET = qtscript_webkit -include(../qtbindingsbase.pri) -QT += network webkit webkitwidgets -SOURCES += plugin.cpp -HEADERS += plugin.h -INCLUDEPATH += ./include/ -include($$GENERATEDCPP/com_trolltech_qt_webkit/com_trolltech_qt_webkit.pri) diff --git a/qtbindings/qtscript_webkitwidgets/include/__package_shared.h b/qtbindings/qtscript_webkitwidgets/include/__package_shared.h deleted file mode 100644 index 5f8e223..0000000 --- a/qtbindings/qtscript_webkitwidgets/include/__package_shared.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include -#include diff --git a/qtbindings/qtscript_webkitwidgets/plugin.cpp b/qtbindings/qtscript_webkitwidgets/plugin.cpp deleted file mode 100644 index ff0a0d1..0000000 --- a/qtbindings/qtscript_webkitwidgets/plugin.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include -#include -#include "plugin.h" - - -QStringList com_trolltech_qt_webkitwidgets_ScriptPlugin::keys() const -{ - QStringList list; - list << QLatin1String("qt"); - list << QLatin1String("qt.webkitwidgets"); - return list; -} - -void com_trolltech_qt_webkitwidgets_ScriptPlugin::initialize(const QString &key, QScriptEngine *engine) -{ - if (key == QLatin1String("qt")) { - } else if (key == QLatin1String("qt.webkitwidgets")) { - QScriptValue extensionObject = engine->globalObject(); - qtscript_initialize_com_trolltech_qt_webkitwidgets_bindings(extensionObject); - } else { - Q_ASSERT_X(false, "com_trolltech_qt_webkitwidgets::initialize", qPrintable(key)); - } -} - diff --git a/qtbindings/qtscript_webkitwidgets/plugin.h b/qtbindings/qtscript_webkitwidgets/plugin.h deleted file mode 100644 index c89d0c3..0000000 --- a/qtbindings/qtscript_webkitwidgets/plugin.h +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include -#include - - -void qtscript_initialize_com_trolltech_qt_webkitwidgets_bindings(QScriptValue &); - -class com_trolltech_qt_webkitwidgets_ScriptPlugin : public QScriptExtensionPlugin -{ -Q_OBJECT -Q_PLUGIN_METADATA(IID "com.trolltech.qt.webkitwidgets.scriptPlugin") -public: - QStringList keys() const; - void initialize(const QString &key, QScriptEngine *engine); -}; - diff --git a/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro b/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro deleted file mode 100644 index 6c9e212..0000000 --- a/qtbindings/qtscript_webkitwidgets/qtscript_webkitwidgets.pro +++ /dev/null @@ -1,7 +0,0 @@ -TARGET = qtscript_webkitwidgets -include(../qtbindingsbase.pri) -QT += network webkitwidgets printsupport -SOURCES += plugin.cpp -HEADERS += plugin.h -INCLUDEPATH += ./include/ -include($$GENERATEDCPP/com_trolltech_qt_webkitwidgets/com_trolltech_qt_webkitwidgets.pri) From 437ba20ad4a0b93afae4ceb4ebc51e6a7ae3c198 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Tue, 26 Apr 2016 17:18:35 +0200 Subject: [PATCH 49/54] Do not set the PDB path explicitly under Windows. --- qtbindings/qtbindingsbase.pri | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qtbindings/qtbindingsbase.pri b/qtbindings/qtbindingsbase.pri index edaefec..eefbcbd 100644 --- a/qtbindings/qtbindingsbase.pri +++ b/qtbindings/qtbindingsbase.pri @@ -1,7 +1,6 @@ TEMPLATE = lib DEPENDPATH += . INCLUDEPATH += . -PDBEXT = .pdb CONFIG(debug, debug|release) { DESTDIR = $$PWD/../plugins/script_debug @@ -11,7 +10,7 @@ CONFIG(debug, debug|release) { win32:{ QMAKE_CXXFLAGS += /MP /GS /Zi - QMAKE_LFLAGS += /DEBUG /OPT:REF /OPT:ICF /PDB:"$$DESTDIR/$$TARGET$$PDBEXT" + QMAKE_LFLAGS += /DEBUG /OPT:REF /OPT:ICF } QT += script From ca3344143b86d1e39228ef49bc366edba36275da Mon Sep 17 00:00:00 2001 From: neFAST Date: Wed, 22 Jun 2016 16:24:36 +0200 Subject: [PATCH 50/54] Fix compile error with msvc 2013 Tested with Qt5.6 BTW ${QTDIR} was not even expanded before the fix --- qtbindings/qtscript_uitools/qtscript_uitools.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qtbindings/qtscript_uitools/qtscript_uitools.pro b/qtbindings/qtscript_uitools/qtscript_uitools.pro index 6272007..3594cc7 100644 --- a/qtbindings/qtscript_uitools/qtscript_uitools.pro +++ b/qtbindings/qtscript_uitools/qtscript_uitools.pro @@ -3,5 +3,5 @@ include(../qtbindingsbase.pri) QT += uitools widgets SOURCES += plugin.cpp HEADERS += plugin.h -INCLUDEPATH += ./include/ ${QTDIR}/lib/QtWidgets.framework/Headers +INCLUDEPATH += ./include/ include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) From c68905181f1428cf8059c1201f47be7376049fa1 Mon Sep 17 00:00:00 2001 From: 0xd34df00d <0xd34df00d@gmail.com> Date: Sun, 24 Jul 2016 03:23:11 +0100 Subject: [PATCH 51/54] No need for `typename` in operator=() definition. --- generator/parser/rpp/pp-iterator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/parser/rpp/pp-iterator.h b/generator/parser/rpp/pp-iterator.h index bdcd8aa..ebf7cd9 100644 --- a/generator/parser/rpp/pp-iterator.h +++ b/generator/parser/rpp/pp-iterator.h @@ -84,7 +84,7 @@ class pp_output_iterator inline pp_output_iterator &operator ++ () { return *this; } inline pp_output_iterator operator ++ (int) { return *this; } // Fix C2582 in MSVC2010/2012: http://stackoverflow.com/questions/2791525/stl-operator-behavior-change-with-visual-studio-2010 - inline pp_output_iterator &operator=(const typename pp_output_iterator<_Container>& __v) + inline pp_output_iterator &operator=(const pp_output_iterator<_Container>& __v) { _M_result = __v._M_result; return *this; From 3b6ebbb7828fcb9114e65d11e2866b6500800ead Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Mon, 17 Oct 2016 11:16:48 +0200 Subject: [PATCH 52/54] Compatibility improvements for Qt 5.7.0 Add include path for QtWidgets framework headers. Fix signature or assignment operator which fixes C2582 with compiling with MSVC 2010/2012. --- generator/parser/rpp/pp-iterator.h | 2 +- qtbindings/qtscript_uitools/qtscript_uitools.pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generator/parser/rpp/pp-iterator.h b/generator/parser/rpp/pp-iterator.h index ebf7cd9..bdcd8aa 100644 --- a/generator/parser/rpp/pp-iterator.h +++ b/generator/parser/rpp/pp-iterator.h @@ -84,7 +84,7 @@ class pp_output_iterator inline pp_output_iterator &operator ++ () { return *this; } inline pp_output_iterator operator ++ (int) { return *this; } // Fix C2582 in MSVC2010/2012: http://stackoverflow.com/questions/2791525/stl-operator-behavior-change-with-visual-studio-2010 - inline pp_output_iterator &operator=(const pp_output_iterator<_Container>& __v) + inline pp_output_iterator &operator=(const typename pp_output_iterator<_Container>& __v) { _M_result = __v._M_result; return *this; diff --git a/qtbindings/qtscript_uitools/qtscript_uitools.pro b/qtbindings/qtscript_uitools/qtscript_uitools.pro index 3594cc7..6272007 100644 --- a/qtbindings/qtscript_uitools/qtscript_uitools.pro +++ b/qtbindings/qtscript_uitools/qtscript_uitools.pro @@ -3,5 +3,5 @@ include(../qtbindingsbase.pri) QT += uitools widgets SOURCES += plugin.cpp HEADERS += plugin.h -INCLUDEPATH += ./include/ +INCLUDEPATH += ./include/ ${QTDIR}/lib/QtWidgets.framework/Headers include($$GENERATEDCPP/com_trolltech_qt_uitools/com_trolltech_qt_uitools.pri) From 04af9c48e68d09e71a8f179e76dae81c3bf2487a Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Mon, 17 Oct 2016 11:39:54 +0200 Subject: [PATCH 53/54] Fix assignment operator again for non-MSVC compilers --- generator/parser/rpp/pp-iterator.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generator/parser/rpp/pp-iterator.h b/generator/parser/rpp/pp-iterator.h index bdcd8aa..0fec0bb 100644 --- a/generator/parser/rpp/pp-iterator.h +++ b/generator/parser/rpp/pp-iterator.h @@ -84,7 +84,12 @@ class pp_output_iterator inline pp_output_iterator &operator ++ () { return *this; } inline pp_output_iterator operator ++ (int) { return *this; } // Fix C2582 in MSVC2010/2012: http://stackoverflow.com/questions/2791525/stl-operator-behavior-change-with-visual-studio-2010 + // Also works with MSVC 2015 +#ifdef _MSC_BUILD inline pp_output_iterator &operator=(const typename pp_output_iterator<_Container>& __v) +#else + inline pp_output_iterator &operator=(const pp_output_iterator<_Container>& __v) +#endif { _M_result = __v._M_result; return *this; From 8240fa74e3cfffa0dbb87a36ee959d7072c98bc6 Mon Sep 17 00:00:00 2001 From: "Philipp A. Baer" Date: Mon, 17 Oct 2016 11:44:42 +0200 Subject: [PATCH 54/54] Extend compatibility info in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 6981dbb..f226be8 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ Qt Script Generator labs package, version 0.2 The Qt Script Generator is a tool that generates Qt bindings for Qt Script. This should work -with Qt 5.6.0 and MSVC 2015 (Update 1). +with Qt 5.6.0/5.7.0 (tested with 5.7.0+ICU) and MSVC 2015 Update 3. ---