-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.2024.08.26: fix #20: margins: add framings
- Loading branch information
1 parent
09b729a
commit 6e6fa76
Showing
41 changed files
with
970 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Scan Tailor - Interactive post-processing tool for scanned pages. | ||
Copyright (C) 2007-2008 Joseph Artsimovich <joseph_a@mail.ru> | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program 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 General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <QDomDocument> | ||
#include <QDomElement> | ||
#include <QString> | ||
#include "Framings.h" | ||
|
||
namespace page_layout | ||
{ | ||
|
||
Framings::Framings(QDomElement const& el) | ||
: m_framingw(el.attribute("framingWidth").toDouble()), | ||
m_framingh(el.attribute("framingHeight").toDouble()) | ||
{ | ||
} | ||
|
||
QDomElement | ||
Framings::toXml(QDomDocument& doc, QString const& name) const | ||
{ | ||
QDomElement el(doc.createElement(name)); | ||
el.setAttribute("framingWidth", m_framingw); | ||
el.setAttribute("framingHeight", m_framingh); | ||
return el; | ||
} | ||
|
||
} // namespace page_layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
Scan Tailor - Interactive post-processing tool for scanned pages. | ||
Copyright (C) 2007-2008 Joseph Artsimovich <joseph_a@mail.ru> | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program 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 General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef PAGE_LAYOUT_FRAMINGS_H_ | ||
#define PAGE_LAYOUT_FRAMINGS_H_ | ||
|
||
class QDomDocument; | ||
class QDomElement; | ||
class QString; | ||
|
||
namespace page_layout | ||
{ | ||
|
||
class Framings | ||
{ | ||
public: | ||
Framings() : m_framingw(0.12), m_framingh(0.08) {} | ||
|
||
Framings(double hor, double vert) : m_framingw(hor), m_framingh(vert) {} | ||
|
||
Framings(QDomElement const& el); | ||
|
||
double getFramingWidth() const | ||
{ | ||
return m_framingw; | ||
} | ||
void setFramingWidth(double value) | ||
{ | ||
m_framingw = value; | ||
} | ||
|
||
double getFramingHeight() const | ||
{ | ||
return m_framingh; | ||
} | ||
void setFramingHeight(double value) | ||
{ | ||
m_framingh = value; | ||
} | ||
|
||
bool operator==(Framings const& other) const | ||
{ | ||
return m_framingw == other.m_framingw && m_framingh == other.m_framingh; | ||
} | ||
|
||
bool operator!=(Framings const& other) const | ||
{ | ||
return !(*this == other); | ||
} | ||
|
||
QDomElement toXml(QDomDocument& doc, QString const& name) const; | ||
private: | ||
double m_framingw; | ||
double m_framingh; | ||
}; | ||
|
||
} // namespace page_layout | ||
|
||
#endif |
Oops, something went wrong.