1 #ifndef __SP_GRADIENT_H__
2 #define __SP_GRADIENT_H__
4 /** \file
5 * SVG <stop> <linearGradient> and <radialGradient> implementation
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 * Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
10 *
11 * Copyright (C) 2007 Johan Engelen
12 * Copyright (C) 1999-2002 Lauris Kaplinski
13 * Copyright (C) 2000-2001 Ximian, Inc.
14 *
15 * Released under GNU GPL, read the file 'COPYING' for more information
16 */
18 #include <gdk/gdktypes.h>
19 #include "libnr/nr-matrix.h"
20 #include "sp-paint-server.h"
21 #include "sp-gradient-spread.h"
22 #include "sp-gradient-units.h"
23 #include "sp-gradient-vector.h"
25 #include <sigc++/connection.h>
27 struct SPGradientReference;
29 typedef enum {
30 SP_GRADIENT_TYPE_UNKNOWN,
31 SP_GRADIENT_TYPE_LINEAR,
32 SP_GRADIENT_TYPE_RADIAL
33 } SPGradientType;
35 typedef enum {
36 SP_GRADIENT_STATE_UNKNOWN,
37 SP_GRADIENT_STATE_VECTOR,
38 SP_GRADIENT_STATE_PRIVATE
39 } SPGradientState;
41 typedef enum {
42 POINT_LG_BEGIN,
43 POINT_LG_END,
44 POINT_LG_MID,
45 POINT_RG_CENTER,
46 POINT_RG_R1,
47 POINT_RG_R2,
48 POINT_RG_FOCUS,
49 POINT_RG_MID1,
50 POINT_RG_MID2
51 } GrPointType;
53 /**
54 * Gradient
55 *
56 * Implement spread, stops list
57 * \todo fixme: Implement more here (Lauris)
58 */
59 struct SPGradient : public SPPaintServer {
60 /** Reference (href) */
61 SPGradientReference *ref;
62 /** State in Inkscape gradient system */
63 guint state : 2;
64 /** gradientUnits attribute */
65 SPGradientUnits units;
66 guint units_set : 1;
67 /** gradientTransform attribute */
68 NR::Matrix gradientTransform;
69 guint gradientTransform_set : 1;
70 /** spreadMethod attribute */
71 SPGradientSpread spread;
72 guint spread_set : 1;
73 /** Gradient stops */
74 guint has_stops : 1;
75 /** Composed vector */
76 SPGradientVector vector;
77 /** Rendered color array (4 * 1024 bytes) */
78 guchar *color;
80 sigc::connection modified_connection;
81 };
83 /**
84 * The SPGradient vtable.
85 */
86 struct SPGradientClass {
87 SPPaintServerClass parent_class;
88 };
91 #include "sp-gradient-fns.h"
93 #endif /* !__SP_GRADIENT_H__ */
95 /*
96 Local Variables:
97 mode:c++
98 c-file-style:"stroustrup"
99 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
100 indent-tabs-mode:nil
101 fill-column:99
102 End:
103 */
104 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :