mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-02-26 08:27:49 +01:00
DocDiff application: basic functionality, opening documents
This commit is contained in:
parent
ba13871a9c
commit
e354a03564
@ -21,24 +21,47 @@
|
||||
#include "aboutdialog.h"
|
||||
|
||||
#include "pdfwidgetutils.h"
|
||||
#include "pdfdocumentreader.h"
|
||||
|
||||
#include <QToolBar>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDesktopServices>
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
#include <QFileDialog>
|
||||
|
||||
namespace pdfdocdiff
|
||||
{
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
ui(new Ui::MainWindow),
|
||||
m_progress(new pdf::PDFProgress(this)),
|
||||
m_taskbarButton(new QWinTaskbarButton(this)),
|
||||
m_progressTaskbarIndicator(nullptr),
|
||||
m_diff(nullptr),
|
||||
m_isChangingProgressStep(false),
|
||||
m_dontDisplayErrorMessage(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(800, 600)));
|
||||
|
||||
// Initialize task bar progress
|
||||
m_progressTaskbarIndicator = m_taskbarButton->progress();
|
||||
|
||||
ui->actionGet_Source->setData(int(Operation::GetSource));
|
||||
ui->actionAbout->setData(int(Operation::About));
|
||||
ui->actionOpen_Left->setData(int(Operation::OpenLeft));
|
||||
ui->actionOpen_Right->setData(int(Operation::OpenRight));
|
||||
ui->actionCompare->setData(int(Operation::Compare));
|
||||
ui->actionClose->setData(int(Operation::Close));
|
||||
|
||||
QToolBar* mainToolbar = addToolBar(tr("Main"));
|
||||
mainToolbar->setObjectName("main_toolbar");
|
||||
mainToolbar->addActions({ ui->actionOpen_Left, ui->actionOpen_Right });
|
||||
mainToolbar->addSeparator();
|
||||
mainToolbar->addAction(ui->actionCompare);
|
||||
|
||||
QSize iconSize = pdf::PDFWidgetUtils::scaleDPI(this, QSize(24, 24));
|
||||
auto toolbars = findChildren<QToolBar*>();
|
||||
@ -61,6 +84,14 @@ MainWindow::MainWindow(QWidget* parent) :
|
||||
}
|
||||
}
|
||||
|
||||
connect(m_progress, &pdf::PDFProgress::progressStarted, this, &MainWindow::onProgressStarted);
|
||||
connect(m_progress, &pdf::PDFProgress::progressStep, this, &MainWindow::onProgressStep);
|
||||
connect(m_progress, &pdf::PDFProgress::progressFinished, this, &MainWindow::onProgressFinished);
|
||||
|
||||
m_diff.setProgress(m_progress);
|
||||
m_diff.setOption(pdf::PDFDiff::Asynchronous, true);
|
||||
connect(&m_diff, &pdf::PDFDiff::comparationFinished, this, &MainWindow::onComparationFinished);
|
||||
|
||||
m_diff.setLeftDocument(&m_leftDocument);
|
||||
m_diff.setRightDocument(&m_rightDocument);
|
||||
|
||||
@ -74,11 +105,32 @@ MainWindow::~MainWindow()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
m_taskbarButton->setWindow(windowHandle());
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
BaseClass::closeEvent(event);
|
||||
m_diff.stop();
|
||||
}
|
||||
|
||||
void MainWindow::onMappedActionTriggered(int actionId)
|
||||
{
|
||||
performOperation(static_cast<Operation>(actionId));
|
||||
}
|
||||
|
||||
void MainWindow::onComparationFinished()
|
||||
{
|
||||
auto result = m_diff.getResult().getResult();
|
||||
if (!result && !m_dontDisplayErrorMessage)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), result.getErrorMessage());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateActions()
|
||||
{
|
||||
QList<QAction*> actions = findChildren<QAction*>();
|
||||
@ -138,6 +190,10 @@ bool MainWindow::canPerformOperation(Operation operation) const
|
||||
{
|
||||
switch (operation)
|
||||
{
|
||||
case Operation::OpenLeft:
|
||||
case Operation::OpenRight:
|
||||
case Operation::Compare:
|
||||
case Operation::Close:
|
||||
case Operation::GetSource:
|
||||
case Operation::About:
|
||||
return true;
|
||||
@ -154,9 +210,103 @@ void MainWindow::performOperation(Operation operation)
|
||||
{
|
||||
switch (operation)
|
||||
{
|
||||
case Operation::OpenLeft:
|
||||
{
|
||||
pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true);
|
||||
m_diff.stop();
|
||||
|
||||
std::optional<pdf::PDFDocument> document = openDocument();
|
||||
if (document)
|
||||
{
|
||||
m_leftDocument = std::move(*document);
|
||||
|
||||
const size_t pageCount = m_leftDocument.getCatalog()->getPageCount();
|
||||
if (pageCount > 1)
|
||||
{
|
||||
ui->leftPageSelectionEdit->setText(QString("1-%2").arg(pageCount));
|
||||
}
|
||||
else if (pageCount == 1)
|
||||
{
|
||||
ui->leftPageSelectionEdit->setText("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->leftPageSelectionEdit->clear();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Operation::OpenRight:
|
||||
{
|
||||
pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true);
|
||||
m_diff.stop();
|
||||
|
||||
std::optional<pdf::PDFDocument> document = openDocument();
|
||||
if (document)
|
||||
{
|
||||
m_rightDocument = std::move(*document);
|
||||
|
||||
const size_t pageCount = m_rightDocument.getCatalog()->getPageCount();
|
||||
if (pageCount > 1)
|
||||
{
|
||||
ui->rightPageSelectionEdit->setText(QString("1-%2").arg(pageCount));
|
||||
}
|
||||
else if (pageCount == 1)
|
||||
{
|
||||
ui->rightPageSelectionEdit->setText("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->rightPageSelectionEdit->clear();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case Operation::Compare:
|
||||
{
|
||||
pdf::PDFTemporaryValueChange guard(&m_dontDisplayErrorMessage, true);
|
||||
m_diff.stop();
|
||||
|
||||
QString errorMessage;
|
||||
|
||||
pdf::PDFClosedIntervalSet rightPageIndices;
|
||||
pdf::PDFClosedIntervalSet leftPageIndices = pdf::PDFClosedIntervalSet::parse(1, qMax<pdf::PDFInteger>(1, m_leftDocument.getCatalog()->getPageCount()), ui->leftPageSelectionEdit->text(), &errorMessage);
|
||||
|
||||
if (errorMessage.isEmpty())
|
||||
{
|
||||
rightPageIndices = pdf::PDFClosedIntervalSet::parse(1, qMax<pdf::PDFInteger>(1, m_rightDocument.getCatalog()->getPageCount()), ui->rightPageSelectionEdit->text(), &errorMessage);
|
||||
}
|
||||
|
||||
// Check if pages are succesfully parsed
|
||||
if (!errorMessage.isEmpty())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), errorMessage);
|
||||
break;
|
||||
}
|
||||
|
||||
leftPageIndices.translate(-1);
|
||||
rightPageIndices.translate(-1);
|
||||
|
||||
m_diff.setPagesForLeftDocument(std::move(leftPageIndices));
|
||||
m_diff.setPagesForRightDocument(std::move(rightPageIndices));
|
||||
|
||||
m_diff.start();
|
||||
break;
|
||||
}
|
||||
|
||||
case Operation::Close:
|
||||
{
|
||||
close();
|
||||
break;
|
||||
}
|
||||
|
||||
case Operation::GetSource:
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://github.com/JakubMelka/PDF4QT"));
|
||||
break;
|
||||
}
|
||||
|
||||
case Operation::About:
|
||||
{
|
||||
@ -174,4 +324,63 @@ void MainWindow::performOperation(Operation operation)
|
||||
updateActions();
|
||||
}
|
||||
|
||||
std::optional<pdf::PDFDocument> MainWindow::openDocument()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select PDF document"), m_settings.directory, tr("PDF document (*.pdf)"));
|
||||
if (fileName.isEmpty())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
auto queryPassword = [this](bool* ok)
|
||||
{
|
||||
*ok = false;
|
||||
return QInputDialog::getText(this, tr("Encrypted document"), tr("Enter password to access document content"), QLineEdit::Password, QString(), ok);
|
||||
};
|
||||
|
||||
// Mark current directory as this
|
||||
QFileInfo fileInfo(fileName);
|
||||
m_settings.directory = fileInfo.dir().absolutePath();
|
||||
|
||||
// Try to open a new document
|
||||
pdf::PDFDocumentReader reader(nullptr, qMove(queryPassword), true, false);
|
||||
pdf::PDFDocument document = reader.readFromFile(fileName);
|
||||
|
||||
QString errorMessage = reader.getErrorMessage();
|
||||
pdf::PDFDocumentReader::Result result = reader.getReadingResult();
|
||||
if (result == pdf::PDFDocumentReader::Result::OK)
|
||||
{
|
||||
return document;
|
||||
}
|
||||
else if (result == pdf::PDFDocumentReader::Result::Failed)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), errorMessage);
|
||||
}
|
||||
|
||||
return pdf::PDFDocument();
|
||||
}
|
||||
|
||||
void MainWindow::onProgressStarted(pdf::ProgressStartupInfo info)
|
||||
{
|
||||
m_progressTaskbarIndicator->setRange(0, 100);
|
||||
m_progressTaskbarIndicator->reset();
|
||||
m_progressTaskbarIndicator->show();
|
||||
}
|
||||
|
||||
void MainWindow::onProgressStep(int percentage)
|
||||
{
|
||||
if (m_isChangingProgressStep)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pdf::PDFTemporaryValueChange guard(&m_isChangingProgressStep, true);
|
||||
m_progressTaskbarIndicator->setValue(percentage);
|
||||
}
|
||||
|
||||
void MainWindow::onProgressFinished()
|
||||
{
|
||||
m_progressTaskbarIndicator->hide();
|
||||
}
|
||||
|
||||
} // namespace pdfdocdiff
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSignalMapper>
|
||||
#include <QWinTaskbarButton>
|
||||
#include <QWinTaskbarProgress>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -36,21 +38,36 @@ class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using BaseClass = QMainWindow;
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent);
|
||||
virtual ~MainWindow() override;
|
||||
|
||||
enum class Operation
|
||||
{
|
||||
OpenLeft,
|
||||
OpenRight,
|
||||
Compare,
|
||||
Close,
|
||||
GetSource,
|
||||
About
|
||||
};
|
||||
|
||||
virtual void showEvent(QShowEvent* event) override;
|
||||
virtual void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
private slots:
|
||||
void updateActions();
|
||||
|
||||
private:
|
||||
void onMappedActionTriggered(int actionId);
|
||||
void onComparationFinished();
|
||||
|
||||
void onProgressStarted(pdf::ProgressStartupInfo info);
|
||||
void onProgressStep(int percentage);
|
||||
void onProgressFinished();
|
||||
|
||||
void loadSettings();
|
||||
void saveSettings();
|
||||
@ -58,6 +75,8 @@ private:
|
||||
bool canPerformOperation(Operation operation) const;
|
||||
void performOperation(Operation operation);
|
||||
|
||||
std::optional<pdf::PDFDocument> openDocument();
|
||||
|
||||
struct Settings
|
||||
{
|
||||
QString directory;
|
||||
@ -65,9 +84,15 @@ private:
|
||||
|
||||
Ui::MainWindow* ui;
|
||||
|
||||
pdf::PDFProgress* m_progress;
|
||||
QWinTaskbarButton* m_taskbarButton;
|
||||
QWinTaskbarProgress* m_progressTaskbarIndicator;
|
||||
|
||||
Settings m_settings;
|
||||
QSignalMapper m_mapper;
|
||||
pdf::PDFDiff m_diff;
|
||||
bool m_isChangingProgressStep;
|
||||
bool m_dontDisplayErrorMessage;
|
||||
|
||||
pdf::PDFDocument m_leftDocument;
|
||||
pdf::PDFDocument m_rightDocument;
|
||||
|
@ -81,6 +81,9 @@
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionOpen_Left"/>
|
||||
<addaction name="actionOpen_Right"/>
|
||||
<addaction name="actionClose"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
@ -94,15 +97,22 @@
|
||||
<string>Toolbars</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuCompare">
|
||||
<property name="title">
|
||||
<string>Compare</string>
|
||||
</property>
|
||||
<addaction name="actionCompare"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuCompare"/>
|
||||
<addaction name="menuToolbars"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionGet_Source">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/pdfdocpage/resources/get-source.svg</normaloff>:/pdfdocpage/resources/get-source.svg</iconset>
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/pdfdocdiff/resources/get-source.svg</normaloff>:/pdfdocdiff/resources/get-source.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Get Source</string>
|
||||
@ -110,8 +120,8 @@
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>:/pdfdocpage/resources/about.svg</normaloff>:/pdfdocpage/resources/about.svg</iconset>
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/pdfdocdiff/resources/about.svg</normaloff>:/pdfdocdiff/resources/about.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
@ -120,7 +130,51 @@
|
||||
<string>F1</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOpen_Left">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/pdfdocdiff/resources/open-left.svg</normaloff>:/pdfdocdiff/resources/open-left.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Left</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOpen_Right">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/pdfdocdiff/resources/open-right.svg</normaloff>:/pdfdocdiff/resources/open-right.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Right</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCompare">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/pdfdocdiff/resources/compare.svg</normaloff>:/pdfdocdiff/resources/compare.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Compare</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F5</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionClose">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/pdfdocdiff/resources/close.svg</normaloff>:/pdfdocdiff/resources/close.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Close</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+F4</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -1,5 +1,10 @@
|
||||
<RCC>
|
||||
<qresource prefix="/pdfdocdiff">
|
||||
<file>resources/about.svg</file>
|
||||
<file>resources/close.svg</file>
|
||||
<file>resources/compare.svg</file>
|
||||
<file>resources/get-source.svg</file>
|
||||
<file>resources/open-left.svg</file>
|
||||
<file>resources/open-right.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
108
Pdf4QtDocDiff/resources/close.svg
Normal file
108
Pdf4QtDocDiff/resources/close.svg
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30mm"
|
||||
height="30mm"
|
||||
viewBox="0 0 30 30"
|
||||
version="1.1"
|
||||
id="svg5291"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
sodipodi:docname="about.svg">
|
||||
<defs
|
||||
id="defs5285">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 15 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="30 : 15 : 1"
|
||||
inkscape:persp3d-origin="15 : 10 : 1"
|
||||
id="perspective5921" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.656854"
|
||||
inkscape:cx="148.43961"
|
||||
inkscape:cy="135.18316"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="3840"
|
||||
inkscape:window-height="2035"
|
||||
inkscape:window-x="-13"
|
||||
inkscape:window-y="-13"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5288">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Melka</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Vrstva 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-267)">
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot5913"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"><flowRegion
|
||||
id="flowRegion5915"><rect
|
||||
id="rect5917"
|
||||
width="129.22377"
|
||||
height="91.747108"
|
||||
x="-13.788582"
|
||||
y="-33.515606" /></flowRegion><flowPara
|
||||
id="flowPara5919" /></flowRoot> <g
|
||||
aria-label="?"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25.39999962px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
id="text849"
|
||||
transform="translate(-4.7625002,-4.2333335)">
|
||||
<path
|
||||
d="m 25.373474,281.70442 q 0,1.21543 -0.434082,2.17041 -0.434082,0.94258 -1.141016,1.67432 -0.694531,0.70693 -1.599902,1.32705 -0.905371,0.62011 -1.922363,1.20302 v 2.79053 h -2.22002 v -3.78271 q 0.806153,-0.45889 1.736328,-1.00459 0.942578,-0.54571 1.537891,-1.10381 0.719336,-0.64492 1.116211,-1.32705 0.396875,-0.69453 0.396875,-1.76114 0,-1.40146 -0.954981,-2.08359 -0.942578,-0.69453 -2.443261,-0.69453 -1.339453,0 -2.542481,0.42168 -1.190625,0.42168 -1.885156,0.85576 h -0.124023 v -2.53008 q 0.868164,-0.33486 2.195214,-0.59531 1.339454,-0.27285 2.530079,-0.27285 2.666503,0 4.204394,1.30224 1.550293,1.28985 1.550293,3.41065 z m -4.898926,14.12627 H 17.94447 v -2.6169 h 2.530078 z"
|
||||
style="stroke-width:0.26458332"
|
||||
id="path851"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
108
Pdf4QtDocDiff/resources/compare.svg
Normal file
108
Pdf4QtDocDiff/resources/compare.svg
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30mm"
|
||||
height="30mm"
|
||||
viewBox="0 0 30 30"
|
||||
version="1.1"
|
||||
id="svg5291"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
sodipodi:docname="about.svg">
|
||||
<defs
|
||||
id="defs5285">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 15 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="30 : 15 : 1"
|
||||
inkscape:persp3d-origin="15 : 10 : 1"
|
||||
id="perspective5921" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.656854"
|
||||
inkscape:cx="148.43961"
|
||||
inkscape:cy="135.18316"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="3840"
|
||||
inkscape:window-height="2035"
|
||||
inkscape:window-x="-13"
|
||||
inkscape:window-y="-13"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5288">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Melka</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Vrstva 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-267)">
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot5913"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"><flowRegion
|
||||
id="flowRegion5915"><rect
|
||||
id="rect5917"
|
||||
width="129.22377"
|
||||
height="91.747108"
|
||||
x="-13.788582"
|
||||
y="-33.515606" /></flowRegion><flowPara
|
||||
id="flowPara5919" /></flowRoot> <g
|
||||
aria-label="?"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25.39999962px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
id="text849"
|
||||
transform="translate(-4.7625002,-4.2333335)">
|
||||
<path
|
||||
d="m 25.373474,281.70442 q 0,1.21543 -0.434082,2.17041 -0.434082,0.94258 -1.141016,1.67432 -0.694531,0.70693 -1.599902,1.32705 -0.905371,0.62011 -1.922363,1.20302 v 2.79053 h -2.22002 v -3.78271 q 0.806153,-0.45889 1.736328,-1.00459 0.942578,-0.54571 1.537891,-1.10381 0.719336,-0.64492 1.116211,-1.32705 0.396875,-0.69453 0.396875,-1.76114 0,-1.40146 -0.954981,-2.08359 -0.942578,-0.69453 -2.443261,-0.69453 -1.339453,0 -2.542481,0.42168 -1.190625,0.42168 -1.885156,0.85576 h -0.124023 v -2.53008 q 0.868164,-0.33486 2.195214,-0.59531 1.339454,-0.27285 2.530079,-0.27285 2.666503,0 4.204394,1.30224 1.550293,1.28985 1.550293,3.41065 z m -4.898926,14.12627 H 17.94447 v -2.6169 h 2.530078 z"
|
||||
style="stroke-width:0.26458332"
|
||||
id="path851"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
108
Pdf4QtDocDiff/resources/get-source.svg
Normal file
108
Pdf4QtDocDiff/resources/get-source.svg
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30mm"
|
||||
height="30mm"
|
||||
viewBox="0 0 30 30"
|
||||
version="1.1"
|
||||
id="svg5291"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
sodipodi:docname="about.svg">
|
||||
<defs
|
||||
id="defs5285">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 15 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="30 : 15 : 1"
|
||||
inkscape:persp3d-origin="15 : 10 : 1"
|
||||
id="perspective5921" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.656854"
|
||||
inkscape:cx="148.43961"
|
||||
inkscape:cy="135.18316"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="3840"
|
||||
inkscape:window-height="2035"
|
||||
inkscape:window-x="-13"
|
||||
inkscape:window-y="-13"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5288">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Melka</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Vrstva 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-267)">
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot5913"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"><flowRegion
|
||||
id="flowRegion5915"><rect
|
||||
id="rect5917"
|
||||
width="129.22377"
|
||||
height="91.747108"
|
||||
x="-13.788582"
|
||||
y="-33.515606" /></flowRegion><flowPara
|
||||
id="flowPara5919" /></flowRoot> <g
|
||||
aria-label="?"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25.39999962px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
id="text849"
|
||||
transform="translate(-4.7625002,-4.2333335)">
|
||||
<path
|
||||
d="m 25.373474,281.70442 q 0,1.21543 -0.434082,2.17041 -0.434082,0.94258 -1.141016,1.67432 -0.694531,0.70693 -1.599902,1.32705 -0.905371,0.62011 -1.922363,1.20302 v 2.79053 h -2.22002 v -3.78271 q 0.806153,-0.45889 1.736328,-1.00459 0.942578,-0.54571 1.537891,-1.10381 0.719336,-0.64492 1.116211,-1.32705 0.396875,-0.69453 0.396875,-1.76114 0,-1.40146 -0.954981,-2.08359 -0.942578,-0.69453 -2.443261,-0.69453 -1.339453,0 -2.542481,0.42168 -1.190625,0.42168 -1.885156,0.85576 h -0.124023 v -2.53008 q 0.868164,-0.33486 2.195214,-0.59531 1.339454,-0.27285 2.530079,-0.27285 2.666503,0 4.204394,1.30224 1.550293,1.28985 1.550293,3.41065 z m -4.898926,14.12627 H 17.94447 v -2.6169 h 2.530078 z"
|
||||
style="stroke-width:0.26458332"
|
||||
id="path851"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
108
Pdf4QtDocDiff/resources/open-left.svg
Normal file
108
Pdf4QtDocDiff/resources/open-left.svg
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30mm"
|
||||
height="30mm"
|
||||
viewBox="0 0 30 30"
|
||||
version="1.1"
|
||||
id="svg5291"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
sodipodi:docname="about.svg">
|
||||
<defs
|
||||
id="defs5285">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 15 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="30 : 15 : 1"
|
||||
inkscape:persp3d-origin="15 : 10 : 1"
|
||||
id="perspective5921" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.656854"
|
||||
inkscape:cx="148.43961"
|
||||
inkscape:cy="135.18316"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="3840"
|
||||
inkscape:window-height="2035"
|
||||
inkscape:window-x="-13"
|
||||
inkscape:window-y="-13"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5288">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Melka</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Vrstva 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-267)">
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot5913"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"><flowRegion
|
||||
id="flowRegion5915"><rect
|
||||
id="rect5917"
|
||||
width="129.22377"
|
||||
height="91.747108"
|
||||
x="-13.788582"
|
||||
y="-33.515606" /></flowRegion><flowPara
|
||||
id="flowPara5919" /></flowRoot> <g
|
||||
aria-label="?"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25.39999962px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
id="text849"
|
||||
transform="translate(-4.7625002,-4.2333335)">
|
||||
<path
|
||||
d="m 25.373474,281.70442 q 0,1.21543 -0.434082,2.17041 -0.434082,0.94258 -1.141016,1.67432 -0.694531,0.70693 -1.599902,1.32705 -0.905371,0.62011 -1.922363,1.20302 v 2.79053 h -2.22002 v -3.78271 q 0.806153,-0.45889 1.736328,-1.00459 0.942578,-0.54571 1.537891,-1.10381 0.719336,-0.64492 1.116211,-1.32705 0.396875,-0.69453 0.396875,-1.76114 0,-1.40146 -0.954981,-2.08359 -0.942578,-0.69453 -2.443261,-0.69453 -1.339453,0 -2.542481,0.42168 -1.190625,0.42168 -1.885156,0.85576 h -0.124023 v -2.53008 q 0.868164,-0.33486 2.195214,-0.59531 1.339454,-0.27285 2.530079,-0.27285 2.666503,0 4.204394,1.30224 1.550293,1.28985 1.550293,3.41065 z m -4.898926,14.12627 H 17.94447 v -2.6169 h 2.530078 z"
|
||||
style="stroke-width:0.26458332"
|
||||
id="path851"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
108
Pdf4QtDocDiff/resources/open-right.svg
Normal file
108
Pdf4QtDocDiff/resources/open-right.svg
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30mm"
|
||||
height="30mm"
|
||||
viewBox="0 0 30 30"
|
||||
version="1.1"
|
||||
id="svg5291"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
sodipodi:docname="about.svg">
|
||||
<defs
|
||||
id="defs5285">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 15 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="30 : 15 : 1"
|
||||
inkscape:persp3d-origin="15 : 10 : 1"
|
||||
id="perspective5921" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.656854"
|
||||
inkscape:cx="148.43961"
|
||||
inkscape:cy="135.18316"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="3840"
|
||||
inkscape:window-height="2035"
|
||||
inkscape:window-x="-13"
|
||||
inkscape:window-y="-13"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5288">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Melka</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Vrstva 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-267)">
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot5913"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"><flowRegion
|
||||
id="flowRegion5915"><rect
|
||||
id="rect5917"
|
||||
width="129.22377"
|
||||
height="91.747108"
|
||||
x="-13.788582"
|
||||
y="-33.515606" /></flowRegion><flowPara
|
||||
id="flowPara5919" /></flowRoot> <g
|
||||
aria-label="?"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25.39999962px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332"
|
||||
id="text849"
|
||||
transform="translate(-4.7625002,-4.2333335)">
|
||||
<path
|
||||
d="m 25.373474,281.70442 q 0,1.21543 -0.434082,2.17041 -0.434082,0.94258 -1.141016,1.67432 -0.694531,0.70693 -1.599902,1.32705 -0.905371,0.62011 -1.922363,1.20302 v 2.79053 h -2.22002 v -3.78271 q 0.806153,-0.45889 1.736328,-1.00459 0.942578,-0.54571 1.537891,-1.10381 0.719336,-0.64492 1.116211,-1.32705 0.396875,-0.69453 0.396875,-1.76114 0,-1.40146 -0.954981,-2.08359 -0.942578,-0.69453 -2.443261,-0.69453 -1.339453,0 -2.542481,0.42168 -1.190625,0.42168 -1.885156,0.85576 h -0.124023 v -2.53008 q 0.868164,-0.33486 2.195214,-0.59531 1.339454,-0.27285 2.530079,-0.27285 2.666503,0 4.204394,1.30224 1.550293,1.28985 1.550293,3.41065 z m -4.898926,14.12627 H 17.94447 v -2.6169 h 2.530078 z"
|
||||
style="stroke-width:0.26458332"
|
||||
id="path851"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
@ -16,23 +16,34 @@
|
||||
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "pdfdiff.h"
|
||||
#include "pdfdocumenttextflow.h"
|
||||
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
|
||||
namespace pdf
|
||||
{
|
||||
|
||||
PDFDiff::PDFDiff(QObject* parent) :
|
||||
BaseClass(parent),
|
||||
m_progress(nullptr),
|
||||
m_leftDocument(nullptr),
|
||||
m_rightDocument(nullptr)
|
||||
m_rightDocument(nullptr),
|
||||
m_options(Asynchronous),
|
||||
m_cancelled(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PDFDiff::~PDFDiff()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
void PDFDiff::setLeftDocument(const PDFDocument* leftDocument)
|
||||
{
|
||||
if (m_leftDocument != leftDocument)
|
||||
{
|
||||
clear();
|
||||
stop();
|
||||
m_leftDocument = leftDocument;
|
||||
}
|
||||
}
|
||||
@ -41,15 +52,147 @@ void PDFDiff::setRightDocument(const PDFDocument* rightDocument)
|
||||
{
|
||||
if (m_rightDocument != rightDocument)
|
||||
{
|
||||
clear();
|
||||
stop();
|
||||
m_rightDocument = rightDocument;
|
||||
}
|
||||
}
|
||||
|
||||
void PDFDiff::clear()
|
||||
void PDFDiff::setPagesForLeftDocument(PDFClosedIntervalSet pagesForLeftDocument)
|
||||
{
|
||||
stopEngine();
|
||||
stop();
|
||||
m_pagesForLeftDocument = std::move(pagesForLeftDocument);
|
||||
}
|
||||
|
||||
void PDFDiff::setPagesForRightDocument(PDFClosedIntervalSet pagesForRightDocument)
|
||||
{
|
||||
stop();
|
||||
m_pagesForRightDocument = std::move(pagesForRightDocument);
|
||||
}
|
||||
|
||||
void PDFDiff::start()
|
||||
{
|
||||
// Jakub Melka: First, we must ensure, that comparation
|
||||
// process is finished, otherwise we must wait for end.
|
||||
// Then, create a new future watcher.
|
||||
stop();
|
||||
|
||||
m_cancelled = false;
|
||||
|
||||
if (m_options.testFlag(Asynchronous))
|
||||
{
|
||||
m_futureWatcher = std::nullopt;
|
||||
m_futureWatcher.emplace();
|
||||
|
||||
m_future = QtConcurrent::run(std::bind(&PDFDiff::perform, this));
|
||||
connect(&*m_futureWatcher, &QFutureWatcher<PDFDiffResult>::finished, this, &PDFDiff::onComparationPerformed);
|
||||
m_futureWatcher->setFuture(m_future);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just do comparation immediately
|
||||
m_result = perform();
|
||||
emit comparationFinished();
|
||||
}
|
||||
}
|
||||
|
||||
void PDFDiff::stop()
|
||||
{
|
||||
if (m_futureWatcher && !m_futureWatcher->isFinished())
|
||||
{
|
||||
// Do stop only if process doesn't finished already.
|
||||
// If we are finished, we do not want to set cancelled state.
|
||||
m_cancelled = true;
|
||||
m_futureWatcher->waitForFinished();
|
||||
}
|
||||
}
|
||||
|
||||
PDFDiffResult PDFDiff::perform()
|
||||
{
|
||||
PDFDiffResult result;
|
||||
|
||||
if (!m_leftDocument || !m_rightDocument)
|
||||
{
|
||||
result.setResult(tr("No document to be compared."));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (m_pagesForLeftDocument.isEmpty() || m_pagesForRightDocument.isEmpty())
|
||||
{
|
||||
result.setResult(tr("No page to be compared."));
|
||||
return result;
|
||||
}
|
||||
|
||||
auto leftPages = m_pagesForLeftDocument.unfold();
|
||||
auto rightPages = m_pagesForRightDocument.unfold();
|
||||
|
||||
const size_t leftDocumentPageCount = m_leftDocument->getCatalog()->getPageCount();
|
||||
const size_t rightDocumentPageCount = m_rightDocument->getCatalog()->getPageCount();
|
||||
|
||||
if (leftPages.front() < 0 ||
|
||||
leftPages.back() >= PDFInteger(leftDocumentPageCount) ||
|
||||
rightPages.front() < 0 ||
|
||||
rightPages.back() >= PDFInteger(rightDocumentPageCount))
|
||||
{
|
||||
result.setResult(tr("Invalid page range."));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (m_progress)
|
||||
{
|
||||
ProgressStartupInfo info;
|
||||
info.showDialog = false;
|
||||
info.text = tr("");
|
||||
m_progress->start(StepLast, std::move(info));
|
||||
}
|
||||
|
||||
// StepExtractContentLeftDocument
|
||||
stepProgress();
|
||||
|
||||
// StepExtractContentRightDocument
|
||||
stepProgress();
|
||||
|
||||
// StepExtractTextLeftDocument
|
||||
pdf::PDFDocumentTextFlowFactory factoryLeftDocumentTextFlow;
|
||||
factoryLeftDocumentTextFlow.setCalculateBoundingBoxes(true);
|
||||
PDFDocumentTextFlow leftTextFlow = factoryLeftDocumentTextFlow.create(m_leftDocument, leftPages, PDFDocumentTextFlowFactory::Algorithm::Auto);
|
||||
stepProgress();
|
||||
|
||||
// StepExtractTextRightDocument
|
||||
pdf::PDFDocumentTextFlowFactory factoryRightDocumentTextFlow;
|
||||
factoryRightDocumentTextFlow.setCalculateBoundingBoxes(true);
|
||||
PDFDocumentTextFlow rightTextFlow = factoryRightDocumentTextFlow.create(m_rightDocument, rightPages, PDFDocumentTextFlowFactory::Algorithm::Auto);
|
||||
stepProgress();
|
||||
|
||||
// StepCompare
|
||||
stepProgress();
|
||||
|
||||
if (m_progress)
|
||||
{
|
||||
m_progress->finish();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void PDFDiff::stepProgress()
|
||||
{
|
||||
if (m_progress)
|
||||
{
|
||||
m_progress->step();
|
||||
}
|
||||
}
|
||||
|
||||
void PDFDiff::onComparationPerformed()
|
||||
{
|
||||
m_cancelled = false;
|
||||
m_result = m_future.result();
|
||||
emit comparationFinished();
|
||||
}
|
||||
|
||||
PDFDiffResult::PDFDiffResult() :
|
||||
m_result(true)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace pdf
|
||||
|
@ -19,14 +19,32 @@
|
||||
#define PDFDIFF_H
|
||||
|
||||
#include "pdfdocument.h"
|
||||
#include "pdfprogress.h"
|
||||
#include "pdfutils.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QFuture>
|
||||
#include <QFutureWatcher>
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace pdf
|
||||
{
|
||||
|
||||
class PDFDiffResult
|
||||
{
|
||||
public:
|
||||
explicit PDFDiffResult();
|
||||
|
||||
void setResult(PDFOperationResult result) { m_result = std::move(result); }
|
||||
const PDFOperationResult& getResult() const { return m_result; }
|
||||
|
||||
private:
|
||||
PDFOperationResult m_result;
|
||||
};
|
||||
|
||||
/// Diff engine for comparing two pdf documents.
|
||||
class PDFDiff : public QObject
|
||||
class PDF4QTLIBSHARED_EXPORT PDFDiff : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -35,19 +53,84 @@ private:
|
||||
|
||||
public:
|
||||
explicit PDFDiff(QObject* parent);
|
||||
virtual ~PDFDiff() override;
|
||||
|
||||
enum Option
|
||||
{
|
||||
None = 0x0000,
|
||||
Asynchronous = 0x0001, ///< Compare document asynchronously
|
||||
};
|
||||
Q_DECLARE_FLAGS(Options, Option)
|
||||
|
||||
/// Source document (left)
|
||||
/// \param leftDocument Document
|
||||
void setLeftDocument(const PDFDocument* leftDocument);
|
||||
|
||||
/// Source document (right)(
|
||||
/// \param rightDocument Document
|
||||
void setRightDocument(const PDFDocument* rightDocument);
|
||||
|
||||
/// Clears data (but not source document pointers,
|
||||
/// for them, use setters), also stops comparing engine.
|
||||
void clear();
|
||||
/// Source pages to be compared (left document)
|
||||
/// \param pagesForLeftDocument Page indices
|
||||
void setPagesForLeftDocument(PDFClosedIntervalSet pagesForLeftDocument);
|
||||
|
||||
/// Source pages to be compared (right document)
|
||||
/// \param pagesForRightDocument Page indices
|
||||
void setPagesForRightDocument(PDFClosedIntervalSet pagesForRightDocument);
|
||||
|
||||
/// Sets progress object
|
||||
/// \param progress Progress object
|
||||
void setProgress(PDFProgress* progress) { m_progress = progress; }
|
||||
|
||||
/// Enables or disables comparator engine option
|
||||
/// \param option Option
|
||||
/// \param enable Enable or disable option?
|
||||
void setOption(Option option, bool enable) { m_options.setFlag(option, enable); }
|
||||
|
||||
/// Starts comparator engine. If asynchronous engine option
|
||||
/// is enabled, then separate thread is started, in which two
|
||||
/// document is compared, and then signal \p comparationFinished,
|
||||
/// otherwise this function is blocking until comparation process
|
||||
/// is finished.
|
||||
void start();
|
||||
|
||||
/// Stops comparator engine. Result data are cleared.
|
||||
void stop();
|
||||
|
||||
/// Returns result of a comparation process
|
||||
const PDFDiffResult& getResult() const { return m_result; }
|
||||
|
||||
signals:
|
||||
void comparationFinished();
|
||||
|
||||
private:
|
||||
void stopEngine();
|
||||
|
||||
enum Steps
|
||||
{
|
||||
StepExtractContentLeftDocument,
|
||||
StepExtractContentRightDocument,
|
||||
StepExtractTextLeftDocument,
|
||||
StepExtractTextRightDocument,
|
||||
StepCompare,
|
||||
StepLast
|
||||
};
|
||||
|
||||
PDFDiffResult perform();
|
||||
void stepProgress();
|
||||
|
||||
void onComparationPerformed();
|
||||
|
||||
PDFProgress* m_progress;
|
||||
const PDFDocument* m_leftDocument;
|
||||
const PDFDocument* m_rightDocument;
|
||||
PDFClosedIntervalSet m_pagesForLeftDocument;
|
||||
PDFClosedIntervalSet m_pagesForRightDocument;
|
||||
Options m_options;
|
||||
std::atomic_bool m_cancelled;
|
||||
PDFDiffResult m_result;
|
||||
|
||||
QFuture<PDFDiffResult> m_future;
|
||||
std::optional<QFutureWatcher<PDFDiffResult>> m_futureWatcher;
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
@ -367,6 +367,15 @@ std::vector<PDFInteger> PDFClosedIntervalSet::unfold() const
|
||||
return result;
|
||||
}
|
||||
|
||||
void PDFClosedIntervalSet::translate(PDFInteger offset)
|
||||
{
|
||||
for (auto& interval : m_intervals)
|
||||
{
|
||||
interval.first += offset;
|
||||
interval.second += offset;
|
||||
}
|
||||
}
|
||||
|
||||
PDFClosedIntervalSet PDFClosedIntervalSet::parse(PDFInteger first, PDFInteger last, const QString& text, QString* errorMessage)
|
||||
{
|
||||
PDFClosedIntervalSet result;
|
||||
|
@ -694,6 +694,10 @@ public:
|
||||
/// Returns true, if interval set is empty
|
||||
bool isEmpty() const { return m_intervals.empty(); }
|
||||
|
||||
/// Translates interval set by a given offset
|
||||
/// \param offset Offset
|
||||
void translate(PDFInteger offset);
|
||||
|
||||
/// Parses text into closed interval set, text should be in form "1,3,4,7,-11,12-,52-53,-",
|
||||
/// where 1,3,4,7 means single pages, -11 means range from \p first to 11, 12- means range
|
||||
/// from 12 to \p last, and 52-53 means closed interval [52, 53]. If text is not in this form,
|
||||
|
Loading…
x
Reference in New Issue
Block a user