summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.hpp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-01-31 18:37:40 +0000
committerKarl Berry <karl@freefriends.org>2017-01-31 18:37:40 +0000
commit4c245316c293169ee655c8e2f922b4bee454f9bc (patch)
tree2d3b72165f3e7e1298df8dad8b52f119a42228dc /Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.hpp
parent54a2f67f996dceca3c89276dea798f746b3cacaf (diff)
import original dvisvgm-2.1
git-svn-id: svn://tug.org/texlive/trunk@43102 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.hpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.hpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.hpp
new file mode 100644
index 00000000000..5d3172d2911
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.hpp
@@ -0,0 +1,73 @@
+/*************************************************************************
+** EPSToSVG.hpp **
+** **
+** This file is part of dvisvgm -- a fast DVI to SVG converter **
+** Copyright (C) 2005-2017 Martin Gieseking <martin.gieseking@uos.de> **
+** **
+** 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 EPSTOSVG_HPP
+#define EPSTOSVG_HPP
+
+#include <string>
+#include "SpecialActions.hpp"
+#include "SVGTree.hpp"
+
+struct SVGOutputBase;
+
+class EPSToSVG : protected SpecialActions
+{
+ public:
+ EPSToSVG (const std::string &fname, SVGOutputBase &out) : _fname(fname), _out(out), _x(0), _y(0) {}
+ void convert ();
+ void setTransformation (const Matrix &m);
+ void setPageSize (const std::string &name);
+
+ protected:
+ // implement abstract base class SpecialActions
+ double getX () const override {return _x;}
+ double getY () const override {return _y;}
+ void setX (double x) override {_x = x; _svg.setX(x);}
+ void setY (double y) override {_y = y; _svg.setY(y);}
+ void finishLine () override {}
+ void setColor (const Color &color) override {_svg.setColor(color);}
+ Color getColor () const override {return _svg.getColor();}
+ void setMatrix (const Matrix &m) override {_svg.setMatrix(m);}
+ const Matrix& getMatrix () const override {return _svg.getMatrix();}
+ void getPageTransform (Matrix &matrix) const override {}
+ void setBgColor (const Color &color) override {}
+ void appendToPage (XMLNode *node) override {_svg.appendToPage(node);}
+ void appendToDefs (XMLNode *node) override {_svg.appendToDefs(node);}
+ void prependToPage (XMLNode *node) override {_svg.prependToPage(node);}
+ void pushContextElement (XMLElementNode *node) override {_svg.pushContextElement(node);}
+ void popContextElement () override {_svg.popContextElement();}
+ void embed (const BoundingBox &bbox) override {_bbox.embed(bbox);}
+ void embed (const DPair &p, double r=0) override {if (r==0) _bbox.embed(p); else _bbox.embed(p, r);}
+ void progress (const char *id) override;
+ unsigned getCurrentPageNumber() const override {return 0;}
+ BoundingBox& bbox () override {return _bbox;}
+ BoundingBox& bbox (const std::string &name, bool reset=false) override {return _bbox;}
+ std::string getSVGFilename (unsigned pageno) const override;
+ std::string getBBoxFormatString () const override {return "";}
+
+ private:
+ std::string _fname; ///< name of EPS file
+ SVGTree _svg;
+ SVGOutputBase &_out;
+ double _x, _y;
+ BoundingBox _bbox;
+};
+
+#endif