summaryrefslogtreecommitdiffstats
path: root/src/object/sp-symbol.h
blob: ab55995e809abd9a7d0109bc5b5e51b6b45d2bb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef SEEN_SP_SYMBOL_H
#define SEEN_SP_SYMBOL_H

/*
 * SVG <symbol> implementation
 *
 * Authors:
 *   Lauris Kaplinski <lauris@kaplinski.com>
 *
 * Copyright (C) 1999-2003 Lauris Kaplinski
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

/*
 * This is quite similar in logic to <svg>
 * Maybe we should merge them somehow (Lauris)
 */

#include <2geom/affine.h>
#include "sp-dimensions.h"
#include "sp-item-group.h"
#include "viewbox.h"

class SPSymbol final : public SPGroup, public SPViewBox, public SPDimensions {
public:
	SPSymbol();
	~SPSymbol() override;
	int tag() const override { return tag_of<decltype(*this)>; }

	void build(SPDocument *document, Inkscape::XML::Node *repr) override;
	void release() override;
	void set(SPAttr key, char const* value) override;
	void update(SPCtx *ctx, unsigned int flags) override;
    void unSymbol();
	Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override;

	void modified(unsigned int flags) override;
	void child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref) override;

    std::optional<Geom::PathVector> documentExactBounds() const override;
	Inkscape::DrawingItem* show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override;
	void print(SPPrintContext *ctx) override;
	Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType type) const override;
	void hide (unsigned int key) override;

public:
    // reference point
    SVGLength refX;
    SVGLength refY;
};

#endif