Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-stop.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
/*
5 * Authors: see git history
6 *
7 * Copyright (C) 2018 Authors
8 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
9 */
13/*
14 * Authors:
15 */
16
17#ifndef SEEN_SP_STOP_H
18#define SEEN_SP_STOP_H
19
20#include <glibmm/ustring.h>
21
22#include "sp-object.h"
23
24typedef unsigned int guint32;
25
26namespace Inkscape::Colors {
27 class Color;
28}
29
31class SPStop final : public SPObject {
32public:
33 SPStop();
34 ~SPStop() override;
35 int tag() const override { return tag_of<decltype(*this)>; }
36
38 float offset;
39
40 Glib::ustring path_string;
41
44
46 void setColor(Inkscape::Colors::Color const &color);
47
49
50protected:
51 void build(SPDocument* doc, Inkscape::XML::Node* repr) override;
52 void set(SPAttr key, const char* value) override;
53 void modified(guint flags) override;
54 Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags) override;
55};
56
57#endif /* !SEEN_SP_STOP_H */
58
59/*
60 Local Variables:
61 mode:c++
62 c-file-style:"stroustrup"
63 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
64 indent-tabs-mode:nil
65 fill-column:99
66 End:
67*/
68// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
SPAttr
Definition attributes.h:27
uint32_t Color
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
Interface for refcounted XML nodes.
Definition node.h:80
Typed SVG document implementation.
Definition document.h:101
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
Inkscape::XML::Node * repr
Definition sp-object.h:193
Gradient stop.
Definition sp-stop.h:31
int tag() const override
Definition sp-stop.h:35
Glib::ustring path_string
Definition sp-stop.h:40
float offset
Definition sp-stop.h:38
void modified(guint flags) override
Definition sp-stop.cpp:69
~SPStop() override
SPStop()
Definition sp-stop.cpp:25
SPStop * getNextStop()
Virtual write: write object attributes to repr.
Definition sp-stop.cpp:98
static void setColorRepr(Inkscape::XML::Node *node, Inkscape::Colors::Color const &color)
Set the color and opacity directly into the given xml repr.
Definition sp-stop.cpp:150
void setColor(Inkscape::Colors::Color const &color)
Sets the stop color and stop opacity in the style attribute.
Definition sp-stop.cpp:142
Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags) override
Virtual set: set attribute to value.
Definition sp-stop.cpp:80
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
Definition sp-stop.cpp:31
Inkscape::Colors::Color getColor() const
Definition sp-stop.cpp:130
SPStop * getPrevStop()
Definition sp-stop.cpp:110
Inkscape::XML::Node * node
A set of useful color modifying functions which do not fit as generic methods on the color class itse...
Definition profile.cpp:24
static cairo_user_data_key_t key
unsigned int guint32
Definition sp-stop.h:24
Interface for XML documents.
Definition document.h:43