Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-use-reference.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_SP_USE_REFERENCE_H
3#define SEEN_SP_USE_REFERENCE_H
4
5/*
6 * The reference corresponding to href of <use> element.
7 *
8 * Copyright (C) 2004 Bulia Byak
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#include <sigc++/sigc++.h>
14#include <2geom/pathvector.h>
15
16#include "sp-item.h"
17#include "uri-references.h"
18
19#include <memory>
20
21namespace Inkscape {
22namespace XML {
23class Node;
24}
25}
26
27
29public:
31
32 SPItem *getObject() const {
33 return static_cast<SPItem *>(URIReference::getObject());
34 }
35
36protected:
37 bool _acceptObject(SPObject * const obj) const override;
38
39};
40
41
42class SPUsePath : public SPUseReference {
43public:
44 std::optional<Geom::PathVector> originalPath;
45 bool sourceDirty{false};
46
48 char *sourceHref{nullptr};
51
52 sigc::connection _modified_connection;
53 sigc::connection _delete_connection;
54 sigc::connection _changed_connection;
55 sigc::connection _transformed_connection;
56
57 SPUsePath(SPObject* i_owner);
58 ~SPUsePath() override;
59
60 void link(char* to);
61 void unlink();
62 void start_listening(SPItem* to);
63 void quit_listening();
64 void refresh_source();
65
66 void (*user_unlink) (SPObject *user);
67};
68
69#endif /* !SEEN_SP_USE_REFERENCE_H */
70
71/*
72 Local Variables:
73 mode:c++
74 c-file-style:"stroustrup"
75 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
76 indent-tabs-mode:nil
77 fill-column:99
78 End:
79*/
80// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
A class encapsulating a reference to a particular URI; observers can be notified when the URI comes t...
URIReference(SPObject *owner)
Constructor.
Interface for refcounted XML nodes.
Definition node.h:80
Base class for visual SVG elements.
Definition sp-item.h:109
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
~SPUsePath() override
char * sourceHref
void(* user_unlink)(SPObject *user)
Inkscape::XML::Node * sourceRepr
sigc::connection _changed_connection
sigc::connection _transformed_connection
void link(char *to)
sigc::connection _modified_connection
void start_listening(SPItem *to)
SPObject * owner
SPObject * sourceObject
sigc::connection _delete_connection
std::optional< Geom::PathVector > originalPath
void quit_listening()
SPItem * getObject() const
SPUseReference(SPObject *owner)
bool _acceptObject(SPObject *const obj) const override
Helper class to stream background task notifications as a series of messages.
PathVector - a sequence of subpaths.
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.