From ed9a71b85849a653a3cc710e59b885002fc6f506 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 29 Mar 2014 10:05:09 +0100 Subject: Make it possible to supply compilation units from plugins This also cleans up the script and type initialization in the type loader, for example by getting rid of the m_irUnit member for scripts. Change-Id: I207afeb21c0bae9091d3c7b4cac2e80e9aae0ea3 Reviewed-by: Lars Knoll --- src/qml/qml/qqmlprivate.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/qml/qml/qqmlprivate.h') diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index 90e7961e6b..5460c99f1d 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -61,6 +61,22 @@ QT_BEGIN_NAMESPACE +namespace QQmlPrivate { +struct CachedQmlUnit; +} + +namespace QV4 { +struct ExecutionEngine; +namespace CompiledData { +struct QmlUnit; +struct CompilationUnit; +} +typedef CompiledData::CompilationUnit *(*CompilationUnitFactoryFunction)(); +} +namespace QmlIR { +struct Document; +typedef void (*IRLoaderFunction)(Document *, const QQmlPrivate::CachedQmlUnit *); +} typedef QObject *(*QQmlAttachedPropertiesFunc)(QObject *); @@ -268,13 +284,26 @@ namespace QQmlPrivate const char *typeName; }; + struct CachedQmlUnit { + const QV4::CompiledData::QmlUnit *qmlData; + QV4::CompilationUnitFactoryFunction createCompilationUnit; + QmlIR::IRLoaderFunction loadIR; + }; + + typedef const CachedQmlUnit *(*QmlUnitCacheLookupFunction)(const QUrl &url); + struct RegisterQmlUnitCacheHook { + int version; + QmlUnitCacheLookupFunction lookupCachedQmlUnit; + }; + enum RegistrationType { TypeRegistration = 0, InterfaceRegistration = 1, AutoParentRegistration = 2, SingletonRegistration = 3, CompositeRegistration = 4, - CompositeSingletonRegistration = 5 + CompositeSingletonRegistration = 5, + QmlUnitCacheHookRegistration = 6 }; int Q_QML_EXPORT qmlregister(RegistrationType, void *); -- cgit v1.2.3