1 #ifndef SEEN_SP_STOP_H
2 #define SEEN_SP_STOP_H
4 /** \file
5 * SPStop: SVG <stop> implementation.
6 */
7 /*
8 * Authors?
9 */
11 #include <glib/gtypes.h>
12 #include <glibmm/ustring.h>
13 #include "sp-object.h"
14 #include "color.h"
16 class SPObjectClass;
17 class SPColor;
19 struct SPStop;
20 struct SPStopClass;
22 #define SP_TYPE_STOP (sp_stop_get_type())
23 #define SP_STOP(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_STOP, SPStop))
24 #define SP_STOP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SP_TYPE_STOP, SPStopClass))
25 #define SP_IS_STOP(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_STOP))
26 #define SP_IS_STOP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_STOP))
28 GType sp_stop_get_type();
30 /** Gradient stop. */
31 struct SPStop : public SPObject {
32 /// \todo fixme: Should be SPSVGPercentage
33 gfloat offset;
35 bool currentColor;
37 /** \note
38 * N.B.\ Meaningless if currentColor is true. Use sp_stop_get_rgba32 or sp_stop_get_color
39 * (currently static in sp-gradient.cpp) if you want the effective color.
40 */
41 SPColor specified_color;
43 /// \todo fixme: Implement SPSVGNumber or something similar.
44 gfloat opacity;
47 static SPColor readStopColor( Glib::ustring const &styleStr, guint32 dfl = 0 );
49 SPStop* getNextStop();
50 SPStop* getPrevStop();
52 SPColor getEffectiveColor() const;
53 };
55 /// The SPStop vtable.
56 struct SPStopClass {
57 SPObjectClass parent_class;
58 };
60 guint32 sp_stop_get_rgba32(SPStop const *);
63 #endif /* !SEEN_SP_STOP_H */
65 /*
66 Local Variables:
67 mode:c++
68 c-file-style:"stroustrup"
69 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
70 indent-tabs-mode:nil
71 fill-column:99
72 End:
73 */
74 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :