diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-01-30 08:33:01 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-01-30 08:33:01 +0000 |
| commit | 267299811df952d08324a39008f52c19641de9e0 (patch) | |
| tree | 28fef736a52cb7a72119d119be8eb663ad20a77f /src/object/sp-stop.h | |
| parent | Translations: update inkscape.pot (diff) | |
| download | inkscape-267299811df952d08324a39008f52c19641de9e0.tar.gz inkscape-267299811df952d08324a39008f52c19641de9e0.zip | |
Move classes derived from SPObject to own directory.
A lot of header clean-up.
Diffstat (limited to 'src/object/sp-stop.h')
| -rw-r--r-- | src/object/sp-stop.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/object/sp-stop.h b/src/object/sp-stop.h new file mode 100644 index 000000000..f7b3a677a --- /dev/null +++ b/src/object/sp-stop.h @@ -0,0 +1,73 @@ +#ifndef SEEN_SP_STOP_H +#define SEEN_SP_STOP_H + +/** \file + * SPStop: SVG <stop> implementation. + */ +/* + * Authors: + */ + +#include "sp-object.h" +#include "color.h" + +typedef unsigned int guint32; + +namespace Glib { +class ustring; +} + +#define SP_STOP(obj) (dynamic_cast<SPStop*>((SPObject*)obj)) +#define SP_IS_STOP(obj) (dynamic_cast<const SPStop*>((SPObject*)obj) != NULL) + +/** Gradient stop. */ +class SPStop : public SPObject { +public: + SPStop(); + virtual ~SPStop(); + + /// \todo fixme: Should be SPSVGPercentage + float offset; + + bool currentColor; + + /** \note + * N.B.\ Meaningless if currentColor is true. Use sp_stop_get_rgba32 or sp_stop_get_color + * (currently static in sp-gradient.cpp) if you want the effective color. + */ + SPColor specified_color; + + /// \todo fixme: Implement SPSVGNumber or something similar. + float opacity; + + Glib::ustring * path_string; + //SPCurve path; + + static SPColor readStopColor( Glib::ustring const &styleStr, guint32 dfl = 0 ); + + SPStop* getNextStop(); + SPStop* getPrevStop(); + + SPColor getEffectiveColor() const; + + guint32 get_rgba32() const; + +protected: + virtual void build(SPDocument* doc, Inkscape::XML::Node* repr); + virtual void set(unsigned int key, const char* value); + virtual Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags); +}; + + +#endif /* !SEEN_SP_STOP_H */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |
