From 0c4b5fbc829c5a8b232d5bb5e2da04af64249053 Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Sun, 21 Aug 2022 18:03:06 +0200 Subject: [PATCH] #Issue 25: Plugin compilation + icons for programs --- Pdf4QtDocDiff/CMakeLists.txt | 1 + Pdf4QtDocDiff/icon.rc | 1 + Pdf4QtDocPageOrganizer/CMakeLists.txt | 1 + Pdf4QtDocPageOrganizer/icon.rc | 1 + Pdf4QtLib/CMakeLists.txt | 3 + Pdf4QtLib/sources/pdfwidgetutils.cpp | 70 ++++++++++++++----- Pdf4QtViewer/CMakeLists.txt | 4 ++ Pdf4QtViewerLite/CMakeLists.txt | 1 + Pdf4QtViewerLite/icon.rc | 1 + .../AudioBookPlugin/CMakeLists.txt | 33 +++++++++ Pdf4QtViewerPlugins/CMakeLists.txt | 26 +++++++ .../DimensionsPlugin/CMakeLists.txt | 33 +++++++++ .../ObjectInspectorPlugin/CMakeLists.txt | 39 +++++++++++ .../OutputPreviewPlugin/CMakeLists.txt | 35 ++++++++++ .../RedactPlugin/CMakeLists.txt | 32 +++++++++ .../SignaturePlugin/CMakeLists.txt | 34 +++++++++ .../SignaturePlugin/signatureplugin.cpp | 2 +- .../SoftProofingPlugin/CMakeLists.txt | 31 ++++++++ Pdf4QtViewerProfi/CMakeLists.txt | 1 + Pdf4QtViewerProfi/icon.rc | 1 + 20 files changed, 333 insertions(+), 17 deletions(-) create mode 100644 Pdf4QtDocDiff/icon.rc create mode 100644 Pdf4QtDocPageOrganizer/icon.rc create mode 100644 Pdf4QtViewerLite/icon.rc create mode 100644 Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt create mode 100644 Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt create mode 100644 Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt create mode 100644 Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt create mode 100644 Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt create mode 100644 Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt create mode 100644 Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt create mode 100644 Pdf4QtViewerProfi/icon.rc diff --git a/Pdf4QtDocDiff/CMakeLists.txt b/Pdf4QtDocDiff/CMakeLists.txt index 8349f9e..adb0ab2 100644 --- a/Pdf4QtDocDiff/CMakeLists.txt +++ b/Pdf4QtDocDiff/CMakeLists.txt @@ -27,6 +27,7 @@ add_executable(Pdf4QtDocDiff mainwindow.ui settingsdockwidget.ui resources.qrc + icon.rc ) target_link_libraries(Pdf4QtDocDiff PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) diff --git a/Pdf4QtDocDiff/icon.rc b/Pdf4QtDocDiff/icon.rc new file mode 100644 index 0000000..dfcf0ed --- /dev/null +++ b/Pdf4QtDocDiff/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "app-icon.ico" \ No newline at end of file diff --git a/Pdf4QtDocPageOrganizer/CMakeLists.txt b/Pdf4QtDocPageOrganizer/CMakeLists.txt index 3f98cf4..5073438 100644 --- a/Pdf4QtDocPageOrganizer/CMakeLists.txt +++ b/Pdf4QtDocPageOrganizer/CMakeLists.txt @@ -28,6 +28,7 @@ add_executable(Pdf4QtDocPageOrganizer mainwindow.ui selectbookmarkstoregroupdialog.ui resources.qrc + icon.rc ) target_link_libraries(Pdf4QtDocPageOrganizer PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) diff --git a/Pdf4QtDocPageOrganizer/icon.rc b/Pdf4QtDocPageOrganizer/icon.rc new file mode 100644 index 0000000..dfcf0ed --- /dev/null +++ b/Pdf4QtDocPageOrganizer/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "app-icon.ico" \ No newline at end of file diff --git a/Pdf4QtLib/CMakeLists.txt b/Pdf4QtLib/CMakeLists.txt index 23211bc..b8cf2c7 100644 --- a/Pdf4QtLib/CMakeLists.txt +++ b/Pdf4QtLib/CMakeLists.txt @@ -119,4 +119,7 @@ target_link_libraries(Pdf4QtLib PRIVATE JPEG::JPEG) target_include_directories(Pdf4QtLib INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/sources) target_include_directories(Pdf4QtLib PUBLIC ${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}) +set_target_properties(Pdf4QtLib PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION}) diff --git a/Pdf4QtLib/sources/pdfwidgetutils.cpp b/Pdf4QtLib/sources/pdfwidgetutils.cpp index 9e32847..e34e426 100644 --- a/Pdf4QtLib/sources/pdfwidgetutils.cpp +++ b/Pdf4QtLib/sources/pdfwidgetutils.cpp @@ -33,6 +33,11 @@ int qt_default_dpi_y() { return 96; } namespace pdf { +static constexpr bool isScalingNeeded() +{ + return QT_VERSION_MAJOR < 6; +} + int PDFWidgetUtils::getPixelSize(const QPaintDevice* device, pdf::PDFReal sizeMM) { const int width = device->width(); @@ -50,27 +55,53 @@ int PDFWidgetUtils::getPixelSize(const QPaintDevice* device, pdf::PDFReal sizeMM int PDFWidgetUtils::scaleDPI_x(const QPaintDevice* device, int unscaledSize) { - const double logicalDPI_x = device->logicalDpiX(); - const double defaultDPI_x = qt_default_dpi_x(); - return (logicalDPI_x / defaultDPI_x) * unscaledSize; + if constexpr (isScalingNeeded()) + { + const double logicalDPI_x = device->logicalDpiX(); + const double defaultDPI_x = qt_default_dpi_x(); + return (logicalDPI_x / defaultDPI_x) * unscaledSize; + } + else + { + return unscaledSize; + } } int PDFWidgetUtils::scaleDPI_y(const QPaintDevice* device, int unscaledSize) { - const double logicalDPI_y = device->logicalDpiY(); - const double defaultDPI_y = qt_default_dpi_y(); - return (logicalDPI_y / defaultDPI_y) * unscaledSize; + if constexpr (isScalingNeeded()) + { + const double logicalDPI_y = device->logicalDpiY(); + const double defaultDPI_y = qt_default_dpi_y(); + return (logicalDPI_y / defaultDPI_y) * unscaledSize; + } + else + { + return unscaledSize; + } } PDFReal PDFWidgetUtils::scaleDPI_x(const QPaintDevice* device, PDFReal unscaledSize) { - const double logicalDPI_x = device->logicalDpiX(); - const double defaultDPI_x = qt_default_dpi_x(); - return (logicalDPI_x / defaultDPI_x) * unscaledSize; + if constexpr (isScalingNeeded()) + { + const double logicalDPI_x = device->logicalDpiX(); + const double defaultDPI_x = qt_default_dpi_x(); + return (logicalDPI_x / defaultDPI_x) * unscaledSize; + } + else + { + return unscaledSize; + } } void PDFWidgetUtils::scaleWidget(QWidget* widget, QSize unscaledSize) { + if constexpr (!isScalingNeeded()) + { + return; + } + const double logicalDPI_x = widget->logicalDpiX(); const double logicalDPI_y = widget->logicalDpiY(); const double defaultDPI_x = qt_default_dpi_x(); @@ -84,15 +115,22 @@ void PDFWidgetUtils::scaleWidget(QWidget* widget, QSize unscaledSize) QSize PDFWidgetUtils::scaleDPI(const QPaintDevice* widget, QSize unscaledSize) { - const double logicalDPI_x = widget->logicalDpiX(); - const double logicalDPI_y = widget->logicalDpiY(); - const double defaultDPI_x = qt_default_dpi_x(); - const double defaultDPI_y = qt_default_dpi_y(); + if constexpr (isScalingNeeded()) + { + const double logicalDPI_x = widget->logicalDpiX(); + const double logicalDPI_y = widget->logicalDpiY(); + const double defaultDPI_x = qt_default_dpi_x(); + const double defaultDPI_y = qt_default_dpi_y(); - const int width = (logicalDPI_x / defaultDPI_x) * unscaledSize.width(); - const int height = (logicalDPI_y / defaultDPI_y) * unscaledSize.height(); + const int width = (logicalDPI_x / defaultDPI_x) * unscaledSize.width(); + const int height = (logicalDPI_y / defaultDPI_y) * unscaledSize.height(); - return QSize(width, height); + return QSize(width, height); + } + else + { + return unscaledSize; + } } void PDFWidgetUtils::style(QWidget* widget) diff --git a/Pdf4QtViewer/CMakeLists.txt b/Pdf4QtViewer/CMakeLists.txt index df4bdc8..76f0def 100644 --- a/Pdf4QtViewer/CMakeLists.txt +++ b/Pdf4QtViewer/CMakeLists.txt @@ -58,3 +58,7 @@ GENERATE_EXPORT_HEADER(Pdf4QtViewer target_link_libraries(Pdf4QtViewer PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::PrintSupport Qt6::TextToSpeech Qt6::Xml Qt6::OpenGLWidgets) target_include_directories(Pdf4QtViewer INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(Pdf4QtViewer PUBLIC ${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}) + +set_target_properties(Pdf4QtLib PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION}) diff --git a/Pdf4QtViewerLite/CMakeLists.txt b/Pdf4QtViewerLite/CMakeLists.txt index d3ed240..bb5e4de 100644 --- a/Pdf4QtViewerLite/CMakeLists.txt +++ b/Pdf4QtViewerLite/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(Pdf4QtViewerLite main.cpp + icon.rc ) target_link_libraries(Pdf4QtViewerLite PRIVATE Pdf4QtLib Pdf4QtViewer Qt6::Core Qt6::Gui Qt6::Widgets) diff --git a/Pdf4QtViewerLite/icon.rc b/Pdf4QtViewerLite/icon.rc new file mode 100644 index 0000000..dfcf0ed --- /dev/null +++ b/Pdf4QtViewerLite/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "app-icon.ico" \ No newline at end of file diff --git a/Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt new file mode 100644 index 0000000..ee6c2ac --- /dev/null +++ b/Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +add_library(AudioBookPlugin SHARED + audiobookcreator.cpp + audiobookplugin.cpp + audiotextstreameditordockwidget.cpp + audiotextstreameditordockwidget.ui + icons.qrc +) + +target_link_libraries(AudioBookPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) + +set_target_properties(AudioBookPlugin PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR} + RUNTIME_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR}) + diff --git a/Pdf4QtViewerPlugins/CMakeLists.txt b/Pdf4QtViewerPlugins/CMakeLists.txt index e69de29..fa7a0b3 100644 --- a/Pdf4QtViewerPlugins/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +set(PDF4QT_PLUGINS_DIR ${PROJECT_BINARY_DIR}/pdfplugins) + +add_subdirectory(AudioBookPlugin) +add_subdirectory(DimensionsPlugin) +add_subdirectory(ObjectInspectorPlugin) +add_subdirectory(OutputPreviewPlugin) +add_subdirectory(RedactPlugin) +add_subdirectory(SignaturePlugin) +add_subdirectory(SoftProofingPlugin) diff --git a/Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt new file mode 100644 index 0000000..3833b77 --- /dev/null +++ b/Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +add_library(DimensionsPlugin SHARED + dimensionsplugin.cpp + dimensiontool.cpp + settingsdialog.cpp + settingsdialog.ui + icons.qrc +) + +target_link_libraries(DimensionsPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) + +set_target_properties(DimensionsPlugin PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR} + RUNTIME_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR}) + diff --git a/Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt new file mode 100644 index 0000000..495c82a --- /dev/null +++ b/Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +add_library(ObjectInspectorPlugin SHARED + objectinspectordialog.cpp + objectinspectorplugin.cpp + objectstatisticsdialog.cpp + objectviewerwidget.cpp + pdfobjectinspectortreeitemmodel.cpp + statisticsgraphwidget.cpp + objectinspectordialog.ui + objectstatisticsdialog.ui + objectviewerwidget.ui + statisticsgraphwidget.ui + icons.qrc +) + +target_link_libraries(ObjectInspectorPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) + +set_target_properties(ObjectInspectorPlugin PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR} + RUNTIME_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR}) + diff --git a/Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt new file mode 100644 index 0000000..d62f480 --- /dev/null +++ b/Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +add_library(OutputPreviewPlugin SHARED + inkcoveragedialog.cpp + outputpreviewdialog.cpp + outputpreviewplugin.cpp + outputpreviewwidget.cpp + inkcoveragedialog.ui + outputpreviewdialog.ui + icons.qrc +) + +target_link_libraries(OutputPreviewPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) + +set_target_properties(OutputPreviewPlugin PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR} + RUNTIME_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR}) + diff --git a/Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt new file mode 100644 index 0000000..aae11a6 --- /dev/null +++ b/Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +add_library(RedactPlugin SHARED + createredacteddocumentdialog.cpp + redactplugin.cpp + createredacteddocumentdialog.ui + icons.qrc +) + +target_link_libraries(RedactPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) + +set_target_properties(RedactPlugin PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR} + RUNTIME_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR}) + diff --git a/Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt new file mode 100644 index 0000000..a962d72 --- /dev/null +++ b/Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +add_library(SignaturePlugin SHARED + signatureplugin.cpp + signdialog.cpp + signdialog.ui + icons.qrc +) + +target_link_libraries(SignaturePlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +target_link_libraries(SignaturePlugin PRIVATE OpenSSL::SSL OpenSSL::Crypto) + +set_target_properties(SignaturePlugin PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR} + RUNTIME_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR}) + + diff --git a/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp b/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp index 10abb45..fcc6d16 100644 --- a/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp +++ b/Pdf4QtViewerPlugins/SignaturePlugin/signatureplugin.cpp @@ -441,7 +441,7 @@ void SignaturePlugin::onSignDigitally() { QString offsetString = QString::number(offset); offsetString = offsetString.leftJustified(static_cast(offsetMarkStringLength), ' ', true); - const auto index = buffer.data().lastIndexOf(QString(offsetMarkString), indexOfSignature); + const auto index = buffer.data().lastIndexOf(QByteArray(offsetMarkString, offsetMarkStringLength), indexOfSignature); buffer.seek(index); buffer.write(offsetString.toLocal8Bit()); }; diff --git a/Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt new file mode 100644 index 0000000..6a0a7bd --- /dev/null +++ b/Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (C) 2022 Jakub Melka +# +# This file is part of PDF4QT. +# +# PDF4QT is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# with the written consent of the copyright owner, any later version. +# +# PDF4QT is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PDF4QT. If not, see . + +add_library(SoftProofingPlugin SHARED + softproofingplugin.cpp + settingsdialog.cpp + settingsdialog.ui + icons.qrc +) + +target_link_libraries(SoftProofingPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) + +set_target_properties(SoftProofingPlugin PROPERTIES + VERSION ${PDF4QT_VERSION} + SOVERSION ${PDF4QT_VERSION} + LIBRARY_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR} + RUNTIME_OUTPUT_DIRECTORY ${PDF4QT_PLUGINS_DIR}) diff --git a/Pdf4QtViewerProfi/CMakeLists.txt b/Pdf4QtViewerProfi/CMakeLists.txt index da92917..0170c11 100644 --- a/Pdf4QtViewerProfi/CMakeLists.txt +++ b/Pdf4QtViewerProfi/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(Pdf4QtViewerProfi main.cpp + icon.rc ) target_link_libraries(Pdf4QtViewerProfi PRIVATE Pdf4QtLib Pdf4QtViewer Qt6::Core Qt6::Gui Qt6::Widgets) diff --git a/Pdf4QtViewerProfi/icon.rc b/Pdf4QtViewerProfi/icon.rc new file mode 100644 index 0000000..dfcf0ed --- /dev/null +++ b/Pdf4QtViewerProfi/icon.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "app-icon.ico" \ No newline at end of file