summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-1.0.3/src/DVIToSVGActions.h
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-10-01 14:11:26 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-10-01 14:11:26 +0000
commit7031fb25c01d2f107ffc741c7b82efd87718f2c4 (patch)
tree080a3dd9385346cb36991bcce9047b9946a01351 /Build/source/texk/dvisvgm/dvisvgm-1.0.3/src/DVIToSVGActions.h
parent30e4cb274ed8ce8af054f2e228270a270ee958e5 (diff)
dvisvgm 1.0.3 (6 aug 10)
git-svn-id: svn://tug.org/texlive/trunk@19969 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-1.0.3/src/DVIToSVGActions.h')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.0.3/src/DVIToSVGActions.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.0.3/src/DVIToSVGActions.h b/Build/source/texk/dvisvgm/dvisvgm-1.0.3/src/DVIToSVGActions.h
new file mode 100644
index 00000000000..1589fdaa0d9
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.0.3/src/DVIToSVGActions.h
@@ -0,0 +1,100 @@
+/*************************************************************************
+** DVIToSVGActions.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2010 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 DVITOSVGACTIONS_H
+#define DVITOSVGACTIONS_H
+
+#include <map>
+#include <set>
+#include "BoundingBox.h"
+#include "DVIActions.h"
+#include "Matrix.h"
+#include "SpecialActions.h"
+#include "SpecialManager.h"
+#include "SVGTree.h"
+
+
+class DVIToSVG;
+class FileFinder;
+class Font;
+class XMLNode;
+
+class DVIToSVGActions : public DVIActions, public SpecialActions, public SpecialManager::Listener
+{
+ typedef std::map<const Font*, std::set<int> > CharMap;
+ typedef std::set<const Font*> FontSet;
+ typedef std::map<std::string,BoundingBox> BoxMap;
+
+ public:
+ DVIToSVGActions (DVIToSVG &dvisvg, SVGTree &svg);
+ ~DVIToSVGActions ();
+ void reset ();
+ void setChar (double x, double y, unsigned c, const Font *f);
+ void setRule (double x, double y, double height, double width);
+ void setBgColor (const Color &color);
+ void setColor (const Color &color) {_svg.setColor(color);}
+ void setMatrix (const Matrix &m) {_svg.setMatrix(m);}
+ const Matrix& getMatrix () const {return _svg.getMatrix();}
+ Color getColor () const {return _svg.getColor();}
+ void appendToPage (XMLNode *node) {_svg.appendToPage(node);}
+ void appendToDefs (XMLNode *node) {_svg.appendToDefs(node);}
+ void moveToX (double x) {_svg.setX(x);}
+ void moveToY (double y) {_svg.setY(y);}
+ void setFont (int num, const Font *font);
+ void special (const std::string &s);
+ void preamble (const std::string &cmt);
+ void postamble ();
+ void beginPage (unsigned n, Int32 *c);
+ void endPage ();
+ void beginSpecial (const char *prefix);
+ void endSpecial (const char *prefix);
+ void progress (size_t current, size_t total, const char *id=0);
+ void progress (const char *id);
+ CharMap& getUsedChars () const {return _usedChars;}
+ const FontSet& getUsedFonts () const {return _usedFonts;}
+ void setPageMatrix (const Matrix &tm);
+ double getX() const {return _dvisvg.getXPos();}
+ double getY() const {return _dvisvg.getYPos();}
+ void setX (double x) {_dvisvg.setXPos(x);}
+ void setY (double y) {_dvisvg.setYPos(y);}
+ BoundingBox& bbox () {return _bbox;}
+ BoundingBox& bbox (const std::string &name, bool reset=false);
+ void embed (const BoundingBox &bbox);
+ void embed (const DPair &p, double r=0);
+
+ public:
+ static double PROGRESSBAR_DELAY; ///< progress bar doesn't appear before this time has elapsed (in sec)
+ static bool EXACT_BBOX;
+
+ private:
+ SVGTree &_svg;
+ DVIToSVG &_dvisvg;
+ BoundingBox _bbox;
+ int _pageCount;
+ int _currentFontNum;
+ mutable CharMap _usedChars;
+ FontSet _usedFonts;
+ Matrix *_pageMatrix; // transformation of whole page
+ Color _bgcolor;
+ BoxMap *_boxes;
+};
+
+
+#endif