File indexing completed on 2024-05-12 04:46:38

0001 // SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
0002 //
0003 // SPDX-License-Identifier: LGPL-2.1-or-later
0004 
0005 #include <QQmlEngine>
0006 #include <QResource>
0007 
0008 #include "picinfomodel.h"
0009 #include "imagetools_plugin.h"
0010 
0011 #ifndef Q_OS_ANDROID
0012 #include <ocs.h>
0013 #endif
0014 
0015 void ImageToolsPlugin::registerTypes(const char *uri)
0016 {
0017 #if defined(Q_OS_ANDROID)
0018     QResource::registerResource(QStringLiteral("assets:/android_rcc_bundle.rcc"));
0019 #endif
0020 
0021     Q_ASSERT(QLatin1String(uri) == QLatin1String("org.mauikit.imagetools"));
0022     
0023     qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer");
0024     qmlRegisterType(componentUrl(QStringLiteral("ImageEditor.qml")), uri, 1, 0, "ImageEditor");
0025     
0026     qmlRegisterType<PicInfoModel>(uri, 1, 3, "PicInfoModel");
0027     qmlRegisterType(componentUrl(QStringLiteral("ImageInfoDialog.qml")), uri, 1, 3, "ImageInfoDialog");
0028     qmlRegisterType(componentUrl(QStringLiteral("MetadataEditor.qml")), uri, 1, 3, "MetadataEditor");
0029 
0030 #ifndef Q_OS_ANDROID
0031     qmlRegisterType<OCS>(uri, 1, 3, "OCR");
0032     qmlRegisterType(componentUrl(QStringLiteral("image2text/OCRPage.qml")), uri, 1, 3, "OCRPage");
0033 #endif
0034 }
0035 
0036 QUrl ImageToolsPlugin::componentUrl(const QString &fileName) const
0037 {
0038     return QUrl(resolveFileUrl(fileName));
0039 }
0040 
0041 #include "imagetools_plugin.moc"
0042 #include "moc_imagetools_plugin.cpp"
0043