Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-offset.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_SP_OFFSET_H
3#define SEEN_SP_OFFSET_H
4/*
5 * Authors:
6 * Mitsuru Oka <oka326@parkcity.ne.jp>
7 * Lauris Kaplinski <lauris@kaplinski.com>
8 * (of the sp-spiral.h upon which this file was created)
9 * Copyright (C) 1999-2002 Lauris Kaplinski
10 * Copyright (C) 2000-2001 Ximian, Inc.
11 *
12 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
13 */
14
15#include <cstddef>
16#include <sigc++/sigc++.h>
17
18#include "sp-shape.h"
19
20class SPUseReference;
21
50class SPOffset final : public SPShape {
51public:
52 SPOffset();
53 ~SPOffset() override;
54 int tag() const override { return tag_of<decltype(*this)>; }
55
57 char *original;
58 float rad;
59
61 bool knotSet;
63
66
71
72 sigc::connection _modified_connection;
73 sigc::connection _delete_connection;
74 sigc::connection _changed_connection;
75 sigc::connection _transformed_connection;
76
78 void set(SPAttr key, char const* value) override;
79 void update(SPCtx *ctx, unsigned int flags) override;
80 Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned flags) override;
81 void release() override;
82
83 void snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) const override;
84 const char* displayName() const override;
85 const char* typeName() const override;
86 char* description() const override;
87
88 void set_shape() override;
89};
90
93
95
96#endif
97
98/*
99 Local Variables:
100 mode:c++
101 c-file-style:"stroustrup"
102 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
103 indent-tabs-mode:nil
104 fill-column:99
105 End:
106*/
107// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
SPAttr
Definition attributes.h:27
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
Two-dimensional point that doubles as a vector.
Definition point.h:66
Storing of snapping preferences.
Interface for refcounted XML nodes.
Definition node.h:80
Typed SVG document implementation.
Definition document.h:101
Base class for visual SVG elements.
Definition sp-item.h:109
Inkscape::XML::Node * repr
Definition sp-object.h:193
SPDocument * document
Definition sp-object.h:188
SPOffset class.
Definition sp-offset.h:50
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned flags) override
char * description() const override
bool knotSet
for interactive setting of the radius
Definition sp-offset.h:61
void build(SPDocument *document, Inkscape::XML::Node *repr) override
float rad
offset radius
Definition sp-offset.h:58
SPUseReference * sourceRef
Definition sp-offset.h:68
const char * typeName() const override
The item's type name, not node tag name.
bool isUpdating
Definition sp-offset.h:65
void set_shape() override
~SPOffset() override
sigc::connection _modified_connection
Definition sp-offset.h:72
void snappoints(std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const override
void release() override
int tag() const override
Definition sp-offset.h:54
bool sourceDirty
Definition sp-offset.h:64
Geom::Point knot
Definition sp-offset.h:62
Inkscape::XML::Node * sourceRepr
the repr associated with that id
Definition sp-offset.h:69
char * sourceHref
Definition sp-offset.h:67
sigc::connection _transformed_connection
Definition sp-offset.h:75
void update(SPCtx *ctx, unsigned int flags) override
sigc::connection _changed_connection
Definition sp-offset.h:74
SPItem * sourceObject
Definition sp-offset.h:70
const char * displayName() const override
The item's type name as a translated human string.
char * original
SVG description of the source path.
Definition sp-offset.h:57
void * originalPath
will be a livarot Path, just don't declare it here to please the gcc linker FIXME what?
Definition sp-offset.h:56
sigc::connection _delete_connection
Definition sp-offset.h:73
Base class for shapes, including <path> element.
Definition sp-shape.h:38
double offset
static cairo_user_data_key_t key
double sp_offset_distance_to_original(SPOffset *offset, Geom::Point px)
Distance to the original path; that function is called from shape-editor-knotholders to set the radiu...
SPItem * sp_offset_get_source(SPOffset *offset)
void sp_offset_top_point(SPOffset const *offset, Geom::Point *px)
Computes a point on the offset; used to set a "seed" position for the control knot.
Interface for XML documents.
Definition document.h:43
Unused.
Definition sp-object.h:94