diff -Nru prison-kf5-5.43.0/cmake/FindDmtx.cmake prison-kf5-5.44.0/cmake/FindDmtx.cmake --- prison-kf5-5.43.0/cmake/FindDmtx.cmake 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/cmake/FindDmtx.cmake 2018-03-03 09:54:09.000000000 +0000 @@ -76,7 +76,7 @@ include(FeatureSummary) set_package_properties(Dmtx PROPERTIES - URL "http://libdmtx.sourceforge.net/" + URL "https://github.com/dmtx/libdmtx" DESCRIPTION "The Datamatrix library" ) diff -Nru prison-kf5-5.43.0/cmake/FindQRencode.cmake prison-kf5-5.44.0/cmake/FindQRencode.cmake --- prison-kf5-5.43.0/cmake/FindQRencode.cmake 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/cmake/FindQRencode.cmake 2018-03-03 09:54:09.000000000 +0000 @@ -76,6 +76,6 @@ include(FeatureSummary) set_package_properties(QRencode PROPERTIES - URL "http://megaui.net/fukuchi/works/qrencode/index.en.html/" + URL "https://fukuchi.org/works/qrencode/" DESCRIPTION "The QRencode library" ) diff -Nru prison-kf5-5.43.0/CMakeLists.txt prison-kf5-5.44.0/CMakeLists.txt --- prison-kf5-5.43.0/CMakeLists.txt 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/CMakeLists.txt 2018-03-03 09:54:09.000000000 +0000 @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.0) -set(KF5_VERSION "5.43.0") # handled by release scripts +set(KF5_VERSION "5.44.0") # handled by release scripts project(prison VERSION ${KF5_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.43.0 NO_MODULE) +find_package(ECM 5.44.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${ECM_MODULE_PATH}") @@ -27,10 +27,11 @@ set(REQUIRED_QT_VERSION 5.7.0) find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Gui) +find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick) find_package(QRencode) set_package_properties(QRencode PROPERTIES TYPE REQUIRED) find_package(Dmtx) -set_package_properties(Dmtx PROPERTIES TYPE REQUIRED) +set_package_properties(Dmtx PROPERTIES TYPE RECOMMENDED) if (Qt5_POSITION_INDEPENDENT_CODE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff -Nru prison-kf5-5.43.0/debian/changelog prison-kf5-5.44.0/debian/changelog --- prison-kf5-5.43.0/debian/changelog 2018-02-11 11:17:52.000000000 +0000 +++ prison-kf5-5.44.0/debian/changelog 2018-03-12 20:00:27.000000000 +0000 @@ -1,3 +1,11 @@ +prison-kf5 (5.44.0-0ubuntu1) bionic; urgency=medium + + * Build dep on qtdeclarative for QtQuick + * New upstream release (5.44.0) + * Add package for new qml module qml-module-org-kde-prison + + -- Rik Mills Mon, 12 Mar 2018 20:00:27 +0000 + prison-kf5 (5.43.0-0ubuntu1) bionic; urgency=medium * New upstream release (5.43.0) diff -Nru prison-kf5-5.43.0/debian/control prison-kf5-5.44.0/debian/control --- prison-kf5-5.43.0/debian/control 2018-02-11 11:17:52.000000000 +0000 +++ prison-kf5-5.44.0/debian/control 2018-03-12 20:00:27.000000000 +0000 @@ -5,11 +5,12 @@ Uploaders: Maximiliano Curia Build-Depends: cmake, debhelper (>= 9), - extra-cmake-modules (>= 5.43.0~), + extra-cmake-modules (>= 5.44.0~), libdmtx-dev, libqrencode-dev, pkg-kde-tools (>= 0.12), - qtbase5-dev + qtbase5-dev, + qtdeclarative5-dev Standards-Version: 3.9.8 Homepage: https://projects.kde.org/projects/kdesupport/prison Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/prison @@ -37,3 +38,13 @@ barcodes and DataMatrix barcodes, and can easily be made support more. . This package contains the shared library to be used by applications. + +Package: qml-module-org-kde-prison +Architecture: any +Multi-arch: same +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: barcode API for Qt + prison is a barcode API currently offering a nice Qt API to produce QRCode + barcodes and DataMatrix barcodes, and can easily be made support more. + . + This package contains the QML module diff -Nru prison-kf5-5.43.0/debian/qml-module-org-kde-prison.install prison-kf5-5.44.0/debian/qml-module-org-kde-prison.install --- prison-kf5-5.43.0/debian/qml-module-org-kde-prison.install 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/debian/qml-module-org-kde-prison.install 2018-03-12 20:00:27.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/*/qt5/qml/org/kde/prison/ diff -Nru prison-kf5-5.43.0/.gitignore prison-kf5-5.44.0/.gitignore --- prison-kf5-5.43.0/.gitignore 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/.gitignore 2018-03-03 09:54:09.000000000 +0000 @@ -1 +1,3 @@ *~ +*.qmlc +*.kdev4 diff -Nru prison-kf5-5.43.0/Mainpage.dox prison-kf5-5.44.0/Mainpage.dox --- prison-kf5-5.43.0/Mainpage.dox 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/Mainpage.dox 2018-03-03 09:54:09.000000000 +0000 @@ -21,9 +21,9 @@ * %prison isn't as such designed for the latter, it will probably work, but patches implementing barcode * support for such barcodes will not be accepted. A example is EZCode. * - * %prison is currently using libdmtx for generation of DataMatrix barcodes + * %prison is currently using libdmtx for generation of DataMatrix barcodes * - * %prison is currently using libqrencode for generation of QRCode barcodes + * %prison is currently using libqrencode for generation of QRCode barcodes * */ diff -Nru prison-kf5-5.43.0/metainfo.yaml prison-kf5-5.44.0/metainfo.yaml --- prison-kf5-5.43.0/metainfo.yaml 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/metainfo.yaml 2018-03-03 09:54:09.000000000 +0000 @@ -5,6 +5,7 @@ platforms: - name: Linux - name: FreeBSD + - name: Android portingAid: false deprecated: false release: true diff -Nru prison-kf5-5.43.0/README.md prison-kf5-5.44.0/README.md --- prison-kf5-5.43.0/README.md 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/README.md 2018-03-03 09:54:09.000000000 +0000 @@ -23,7 +23,7 @@ patches implementing barcode support for such barcodes will not be accepted. An example is [EZCode](https://en.wikipedia.org/wiki/EZcode). -Prison is currently using [libdmtx](http://libdmtx.sourceforge.net/) for generation of +Prison is currently using [libdmtx](https://github.com/dmtx/libdmtx) for generation of [DataMatrix](https://en.wikipedia.org/wiki/Datamatrix) barcodes and [libqrencode](https://fukuchi.org/works/qrencode/) for generation of [QRCode](https://en.wikipedia.org/wiki/QR_Code) barcodes. diff -Nru prison-kf5-5.43.0/src/CMakeLists.txt prison-kf5-5.44.0/src/CMakeLists.txt --- prison-kf5-5.43.0/src/CMakeLists.txt 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/src/CMakeLists.txt 2018-03-03 09:54:09.000000000 +0000 @@ -1,2 +1,5 @@ add_subdirectory(lib) add_subdirectory(tools) +if(TARGET Qt5::Quick) + add_subdirectory(quick) +endif() diff -Nru prison-kf5-5.43.0/src/lib/CMakeLists.txt prison-kf5-5.44.0/src/lib/CMakeLists.txt --- prison-kf5-5.43.0/src/lib/CMakeLists.txt 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/src/lib/CMakeLists.txt 2018-03-03 09:54:09.000000000 +0000 @@ -1,4 +1,8 @@ include(CMakePackageConfigHelpers) +if(TARGET Dmtx::Dmtx) + set(HAVE_DMTX 1) +endif() +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-prison.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-prison.h) set(prison_SRCS abstractbarcode.cpp @@ -6,11 +10,13 @@ bitvector.cpp code39barcode.cpp code93barcode.cpp - datamatrixbarcode.cpp qrcodebarcode.cpp prison.cpp reedsolomon.cpp ) +if(TARGET Dmtx::Dmtx) + list(APPEND prison_SRCS datamatrixbarcode.cpp) +endif() ecm_qt_declare_logging_category(prison_SRCS HEADER prison_debug.h IDENTIFIER Prison::Log CATEGORY_NAME kf5.prison) add_library(KF5Prison ${prison_SRCS}) @@ -26,9 +32,11 @@ PUBLIC Qt5::Gui PRIVATE - Dmtx::Dmtx QRencode::QRencode ) +if(TARGET Dmtx::Dmtx) + target_link_libraries(KF5Prison PRIVATE Dmtx::Dmtx) +endif() set_target_properties(KF5Prison PROPERTIES VERSION ${PRISON_VERSION_STRING} diff -Nru prison-kf5-5.43.0/src/lib/code39barcode.cpp prison-kf5-5.44.0/src/lib/code39barcode.cpp --- prison-kf5-5.43.0/src/lib/code39barcode.cpp 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/src/lib/code39barcode.cpp 2018-03-03 09:54:09.000000000 +0000 @@ -142,6 +142,7 @@ // then maximize narrow bar width int smallWidth = (w - largeWidth*wide) / narrow; // if the requested size was too small return a null image + setMinimumSize(QSize(2* wide + narrow, 10)); if(largeWidth<2) { return QImage(); } diff -Nru prison-kf5-5.43.0/src/lib/code93barcode.cpp prison-kf5-5.44.0/src/lib/code93barcode.cpp --- prison-kf5-5.43.0/src/lib/code93barcode.cpp 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/src/lib/code93barcode.cpp 2018-03-03 09:54:09.000000000 +0000 @@ -291,6 +291,7 @@ // try to fill the requested size const int barWidth = int(size.width() / barcode.size()); + setMinimumSize(QSize(barcode.size(), 10)); if(barWidth < 1 ) { // can't go below 1 pixel return QImage(); } diff -Nru prison-kf5-5.43.0/src/lib/config-prison.h.in prison-kf5-5.44.0/src/lib/config-prison.h.in --- prison-kf5-5.43.0/src/lib/config-prison.h.in 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/src/lib/config-prison.h.in 2018-03-03 09:54:09.000000000 +0000 @@ -0,0 +1,31 @@ +/* + Copyright (c) 2018 Volker Krause + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef PRISON_CONFIG_H +#define PRISON_CONFIG_H + +#cmakedefine HAVE_DMTX + +#endif diff -Nru prison-kf5-5.43.0/src/lib/prison.cpp prison-kf5-5.44.0/src/lib/prison.cpp --- prison-kf5-5.43.0/src/lib/prison.cpp 2018-02-05 08:12:24.000000000 +0000 +++ prison-kf5-5.44.0/src/lib/prison.cpp 2018-03-03 09:54:09.000000000 +0000 @@ -24,6 +24,7 @@ */ +#include #include "prison.h" #include "aztecbarcode.h" #include "datamatrixbarcode.h" @@ -40,7 +41,11 @@ case Prison::QRCode: return new QRCodeBarcode; case Prison::DataMatrix: +#ifdef HAVE_DMTX return new DataMatrixBarcode; +#else + return nullptr; +#endif case Prison::Aztec: return new AztecBarcode; case Prison::Code39: diff -Nru prison-kf5-5.43.0/src/quick/barcodequickitem.cpp prison-kf5-5.44.0/src/quick/barcodequickitem.cpp --- prison-kf5-5.43.0/src/quick/barcodequickitem.cpp 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/src/quick/barcodequickitem.cpp 2018-03-03 09:54:09.000000000 +0000 @@ -0,0 +1,147 @@ +/* + Copyright (c) 2018 Volker Krause + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "barcodequickitem.h" + +#include + +#include +#include + +using namespace Prison; + +BarcodeQuickItem::BarcodeQuickItem(QQuickItem *parent) + : QQuickPaintedItem(parent) +{ +} + +BarcodeQuickItem::~BarcodeQuickItem() = default; + +QString BarcodeQuickItem::content() const +{ + return m_content; +} + +void BarcodeQuickItem::setContent(const QString& content) +{ + if (m_content == content) + return; + m_content = content; + emit contentChanged(); + updateBarcode(); +} + +BarcodeQuickItem::BarcodeType BarcodeQuickItem::barcodeType() const +{ + return static_cast(m_type); +} + +void BarcodeQuickItem::setBarcodeType(BarcodeQuickItem::BarcodeType type) +{ + if (m_type == static_cast(type)) + return; + m_type = static_cast(type); + emit barcodeTypeChanged(); + m_barcode.reset(); + updateBarcode(); +} + +QColor BarcodeQuickItem::foregroundColor() const +{ + return m_fgColor; +} + +void BarcodeQuickItem::setForegroundColor(const QColor &color) +{ + if (m_fgColor == color) + return; + m_fgColor = color; + emit foregroundColorChanged(); + updateBarcode(); +} + +QColor BarcodeQuickItem::backgroundColor() const +{ + return m_bgColor; +} + +void BarcodeQuickItem::setBackgroundColor(const QColor &color) +{ + if (m_bgColor == color) + return; + m_bgColor = color; + emit backgroundColorChanged(); + updateBarcode(); +} + +void BarcodeQuickItem::paint(QPainter* painter) +{ + if (!m_barcode) + return; + + const auto w_max = std::max(implicitWidth(), width()); + const auto h_max = std::max(implicitHeight(), height()); + const auto scale = std::min(w_max / implicitWidth(), h_max / implicitHeight()); + const auto w = scale * implicitWidth(); + const auto h = scale * implicitHeight(); + const auto x = (width() - w) / 2; + const auto y = (height() - h) / 2; + + const auto img = m_barcode->toImage(m_barcode->minimumSize()); + painter->setRenderHint(QPainter::SmoothPixmapTransform, false); + painter->drawImage(QRectF(x, y, w, h), img, img.rect()); +} + +void BarcodeQuickItem::componentComplete() +{ + QQuickPaintedItem::componentComplete(); + updateBarcode(); +} + +void BarcodeQuickItem::updateBarcode() +{ + if (!isComponentComplete()) + return; + + if (m_type == Prison::Null || m_content.isEmpty()) { + m_barcode.reset(); + update(); + return; + } + + if (!m_barcode) + m_barcode.reset(Prison::createBarcode(m_type)); + if (m_barcode) { + m_barcode->setData(m_content); + m_barcode->setForegroundColor(m_fgColor); + m_barcode->setBackgroundColor(m_bgColor); + // minimumSize() is only providing valid results after the first call to toImage()... + m_barcode->toImage(m_barcode->minimumSize()); + setImplicitSize(m_barcode->minimumSize().width(), m_barcode->minimumSize().height()); + } + + update(); +} diff -Nru prison-kf5-5.43.0/src/quick/barcodequickitem.h prison-kf5-5.44.0/src/quick/barcodequickitem.h --- prison-kf5-5.43.0/src/quick/barcodequickitem.h 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/src/quick/barcodequickitem.h 2018-03-03 09:54:09.000000000 +0000 @@ -0,0 +1,94 @@ +/* + Copyright (c) 2018 Volker Krause + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef PRISON_BARCODEQUICKITEM_H +#define PRISON_BARCODEQUICKITEM_H + +#include + +#include +#include + +#include + +namespace Prison { + +class AbstractBarcode; + +class BarcodeQuickItem : public QQuickPaintedItem +{ + Q_OBJECT + Q_PROPERTY(QString content READ content WRITE setContent NOTIFY contentChanged) + Q_PROPERTY(BarcodeType barcodeType READ barcodeType WRITE setBarcodeType NOTIFY barcodeTypeChanged) + Q_PROPERTY(QColor foregroundColor READ foregroundColor WRITE setForegroundColor NOTIFY foregroundColorChanged) + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged) + +public: + enum BarcodeType { + Null = Prison::Null, + QRCode = Prison::QRCode, + DataMatrix = Prison::DataMatrix, + Aztec = Prison::Aztec, + Code39 = Prison::Code39, + Code93 = Prison::Code93 + }; + Q_ENUM(BarcodeType) + explicit BarcodeQuickItem(QQuickItem *parent = nullptr); + ~BarcodeQuickItem(); + + QString content() const; + void setContent(const QString &data); + + Prison::BarcodeQuickItem::BarcodeType barcodeType() const; + void setBarcodeType(Prison::BarcodeQuickItem::BarcodeType type); + + QColor foregroundColor() const; + void setForegroundColor(const QColor &color); + QColor backgroundColor() const; + void setBackgroundColor(const QColor &color); + + void paint(QPainter *painter) override; + void componentComplete() override; + +Q_SIGNALS: + void contentChanged(); + void barcodeTypeChanged(); + void foregroundColorChanged(); + void backgroundColorChanged(); + +private: + void updateBarcode(); + + QString m_content; + std::unique_ptr m_barcode; + QColor m_fgColor = Qt::black; + QColor m_bgColor = Qt::white; + Prison::BarcodeType m_type = Prison::Null; +}; + +} + +#endif // PRISON_BARCODEQUICKITEM_H diff -Nru prison-kf5-5.43.0/src/quick/CMakeLists.txt prison-kf5-5.44.0/src/quick/CMakeLists.txt --- prison-kf5-5.43.0/src/quick/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/src/quick/CMakeLists.txt 2018-03-03 09:54:09.000000000 +0000 @@ -0,0 +1,7 @@ +add_library(prisonquickplugin SHARED + barcodequickitem.cpp + prisonquickplugin.cpp +) +target_link_libraries(prisonquickplugin PRIVATE Qt5::Quick KF5::Prison) +install(TARGETS prisonquickplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/prison) +install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/prison) diff -Nru prison-kf5-5.43.0/src/quick/prisonquickplugin.cpp prison-kf5-5.44.0/src/quick/prisonquickplugin.cpp --- prison-kf5-5.43.0/src/quick/prisonquickplugin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/src/quick/prisonquickplugin.cpp 2018-03-03 09:54:09.000000000 +0000 @@ -0,0 +1,52 @@ +/* + Copyright (c) 2018 Volker Krause + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include "barcodequickitem.h" + +#include + +#include + +class PrisonQuickPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.kde.prison") + +public: + PrisonQuickPlugin(QObject *parent = nullptr) + : QQmlExtensionPlugin(parent) + {} + + void registerTypes(const char *uri) override; +}; + + +void PrisonQuickPlugin::registerTypes(const char *uri) +{ + qmlRegisterType(uri, 1, 0, "Barcode"); +} + +#include "prisonquickplugin.moc" diff -Nru prison-kf5-5.43.0/src/quick/qmldir prison-kf5-5.44.0/src/quick/qmldir --- prison-kf5-5.43.0/src/quick/qmldir 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/src/quick/qmldir 2018-03-03 09:54:09.000000000 +0000 @@ -0,0 +1,2 @@ +module org.kde.prison +plugin prisonquickplugin diff -Nru prison-kf5-5.43.0/tests/barcode.qml prison-kf5-5.44.0/tests/barcode.qml --- prison-kf5-5.43.0/tests/barcode.qml 1970-01-01 00:00:00.000000000 +0000 +++ prison-kf5-5.44.0/tests/barcode.qml 2018-03-03 09:54:09.000000000 +0000 @@ -0,0 +1,61 @@ +/* + Copyright (c) 2018 Volker Krause + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +*/ + +import QtQuick 2.0 +import QtQuick.Controls 2.0 +import QtQuick.Layouts 1.0 +import org.kde.prison 1.0 as Prison +Rectangle { + width: 640 + height: 320 + color: "lightsteelblue" + ColumnLayout { + anchors.fill: parent + + RowLayout { + Layout.fillWidth: true + TextField { + id: contentEdit + Layout.fillWidth: true + text: "KF5::Prison - The KDE barcode generation framework." + } + ComboBox { + id: typeCombobox + model: [ "Null", "QRCode", "DataMatrix", "Aztec", "Code39", "Code93" ] + currentIndex: 3 + } + } + + Prison.Barcode { + Layout.fillWidth: true + Layout.fillHeight: true + content: contentEdit.text + barcodeType: typeCombobox.currentIndex +// foregroundColor: "red" +// backgroundColor: "green" + } + } +}