diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
commit | 35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch) | |
tree | 657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/object/sp-tag-use.h | |
parent | Initial commit. (diff) | |
download | inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip |
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/object/sp-tag-use.h')
-rw-r--r-- | src/object/sp-tag-use.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/object/sp-tag-use.h b/src/object/sp-tag-use.h new file mode 100644 index 0000000..158d8c3 --- /dev/null +++ b/src/object/sp-tag-use.h @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#ifndef __SP_TAG_USE_H__ +#define __SP_TAG_USE_H__ + +/* + * SVG <inkscape:tagref> implementation + * + * Authors: + * Theodore Janeczko + * + * Copyright (C) Theodore Janeczko 2012 <flutterguy317@gmail.com> + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include <glib.h> +#include <cstddef> +#include <sigc++/sigc++.h> +#include "svg/svg-length.h" +#include "sp-object.h" + + +#define SP_TAG_USE(obj) (dynamic_cast<SPTagUse*> (obj)) +#define SP_IS_TAG_USE(obj) (dynamic_cast<SPTagUse*> (obj) != NULL) + +class SPItem; +class SPTagUse; +class SPTagUseReference; + +class SPTagUse : public SPObject { + +public: + // item built from the original's repr (the visible clone) + // relative to the SPUse itself, it is treated as a child, similar to a grouped item relative to its group + gchar *href; +public: + SPTagUse(); + ~SPTagUse() override; + + void build(SPDocument *doc, Inkscape::XML::Node *repr) override; + void set(SPAttributeEnum key, gchar const *value) override; + Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, guint flags) override; + void release() override; + + virtual void href_changed(SPObject* old_ref, SPObject* ref); + + //virtual SPItem* unlink(); + virtual SPItem* get_original(); + + // the reference to the original object + SPTagUseReference *ref; + sigc::connection _changed_connection; +}; + +#endif |