diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-02-24 18:08:38 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-08-29 20:10:49 +0900 |
commit | e4a68755703d35d04feb4cbd2eaf145b8826a2a8 (patch) | |
tree | b8eb6cac5d17cf5741a500c37c972ff6ca516fe9 /svgio/inc/svgnode.hxx | |
parent | deal with code duplication at drawing from a definition file (diff) | |
download | core-e4a68755703d35d04feb4cbd2eaf145b8826a2a8.tar.gz core-e4a68755703d35d04feb4cbd2eaf145b8826a2a8.zip |
svgio visitor, add draw commands and create the from svg
Adds a visitor for svgio for visiting svg nodes and create something
useful from them.
Basic draw commands - a tree of draw commands (with sub-pixel
precision support) just to store a simple definition for drawing.
Adds a svg draw visitor and create draw commands from the svg
structure and expose the commands through UNO API.
Change-Id: I073e891a2cffdd76d4e3b838590e3a19c998e9bf
Reviewed-on: https://gerrit.libreoffice.org/68770
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 7894fd2b442eff45ecf14088ebd17ee9f8678752)
Diffstat (limited to 'svgio/inc/svgnode.hxx')
-rw-r--r-- | svgio/inc/svgnode.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/svgio/inc/svgnode.hxx b/svgio/inc/svgnode.hxx index 22df883b22b3..c10179bf236a 100644 --- a/svgio/inc/svgnode.hxx +++ b/svgio/inc/svgnode.hxx @@ -80,6 +80,8 @@ namespace svgio // which members should be initialized Display getDisplayFromContent(const OUString& aContent); + class Visitor; + class SvgNode : public InfoProvider { private: @@ -137,6 +139,8 @@ namespace svgio SvgNode(const SvgNode&) = delete; SvgNode& operator=(const SvgNode&) = delete; + void accept(Visitor& rVisitor); + /// scan helper to read and interpret a local CssStyle to mpLocalCssStyle void readLocalCssStyle(const OUString& aContent); @@ -182,6 +186,14 @@ namespace svgio /// alternative parent void setAlternativeParent(const SvgNode* pAlternativeParent = nullptr) { mpAlternativeParent = pAlternativeParent; } }; + + class Visitor + { + public: + virtual ~Visitor() = default; + virtual void visit(SvgNode const & pNode) = 0; + }; + } // end of namespace svgreader } // end of namespace svgio |