1 | /* |
2 | SPDX-FileCopyrightText: 2009 Alan Alpert <alan.alpert@nokia.com> |
3 | SPDX-FileCopyrightText: 2010 Ménard Alexis <menard@kde.org> |
4 | SPDX-FileCopyrightText: 2010 Marco Martin <mart@kde.org> |
5 | SPDX-FileCopyrightText: 2013 Sebastian Kügler <sebas@kde.org> |
6 | |
7 | SPDX-License-Identifier: LGPL-2.0-or-later |
8 | */ |
9 | |
10 | #include "corebindingsplugin.h" |
11 | |
12 | #include <QQmlContext> |
13 | |
14 | #include <ksvg/framesvg.h> |
15 | #include <ksvg/svg.h> |
16 | |
17 | #include <Kirigami/Platform/PlatformTheme> |
18 | |
19 | #include "framesvgitem.h" |
20 | #include "imageset.h" |
21 | #include "svgitem.h" |
22 | |
23 | #include <QDebug> |
24 | #include <QWindow> |
25 | #include <qquickitem.h> |
26 | |
27 | using namespace Qt::Literals::StringLiterals; |
28 | |
29 | void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri) |
30 | { |
31 | QQmlExtensionPlugin::initializeEngine(engine, uri); |
32 | } |
33 | |
34 | void CoreBindingsPlugin::registerTypes(const char *uri) |
35 | { |
36 | Q_ASSERT(uri == QByteArray("org.kde.ksvg" )); |
37 | |
38 | qmlRegisterRevision<QQuickItem, 6>(uri, versionMajor: 1, versionMinor: 0); |
39 | qmlRegisterAnonymousType<Kirigami::Platform::PlatformTheme>(uri, versionMajor: 1); |
40 | qmlRegisterType<KSvg::Svg>(uri, versionMajor: 1, versionMinor: 0, qmlName: "Svg" ); |
41 | qmlRegisterType<KSvg::FrameSvg>(uri, versionMajor: 1, versionMinor: 0, qmlName: "FrameSvg" ); |
42 | qmlRegisterType<KSvg::SvgItem>(uri, versionMajor: 1, versionMinor: 0, qmlName: "SvgItem" ); |
43 | qmlRegisterType<KSvg::FrameSvgItem>(uri, versionMajor: 1, versionMinor: 0, qmlName: "FrameSvgItem" ); |
44 | qmlRegisterUncreatableType<KSvg::FrameSvgItemMargins>(uri, versionMajor: 1, versionMinor: 0, qmlName: "FrameSvgItemMargins" , reason: u"FrameSvgItemMargins are read-only properties of FrameSvgItem"_s ); |
45 | qmlRegisterType<KSvg::ImageSet>(uri, versionMajor: 1, versionMinor: 0, qmlName: "ImageSet" ); |
46 | |
47 | qmlRegisterSingletonType<KSvg::ImageSet>(uri, versionMajor: 1, versionMinor: 0, typeName: "ImageSet" , callback: [](QQmlEngine *, QJSEngine *) { |
48 | return new KSvg::ImageSet; |
49 | }); |
50 | } |
51 | |
52 | #include "moc_corebindingsplugin.cpp" |
53 | |