Code

b0ed49c0023d8205c8c6202da7870899eda718cb
[inkscape.git] / src / sp-gradient.h
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  *
10  * Copyright (C) 1999-2002 Lauris Kaplinski
11  * Copyright (C) 2000-2001 Ximian, Inc.
12  *
13  * Released under GNU GPL, read the file 'COPYING' for more information
14  */
16 #include <gdk/gdktypes.h>
17 #include "libnr/nr-matrix.h"
18 #include "sp-paint-server.h"
19 #include "sp-gradient-spread.h"
20 #include "sp-gradient-units.h"
21 #include "sp-gradient-vector.h"
23 #include <sigc++/connection.h>
25 struct SPGradientReference;
27 typedef enum {
28         SP_GRADIENT_TYPE_UNKNOWN,
29         SP_GRADIENT_TYPE_LINEAR,
30         SP_GRADIENT_TYPE_RADIAL
31 } SPGradientType;
33 typedef enum {
34         SP_GRADIENT_STATE_UNKNOWN,
35         SP_GRADIENT_STATE_VECTOR,
36         SP_GRADIENT_STATE_PRIVATE
37 } SPGradientState;
39 typedef enum {
40     POINT_LG_P1,
41     POINT_LG_P2,
42     POINT_RG_CENTER,
43     POINT_RG_R1,
44     POINT_RG_R2,
45     POINT_RG_FOCUS
46 } GrPoint;
48 /**
49  * Gradient
50  *
51  * Implement spread, stops list
52  * \todo fixme: Implement more here (Lauris)
53  */
54 struct SPGradient : public SPPaintServer {
55         /** Reference (href) */
56         SPGradientReference *ref;
57         /** State in Inkscape gradient system */
58         guint state : 2;
59         /** gradientUnits attribute */
60         SPGradientUnits units;
61         guint units_set : 1;
62         /** gradientTransform attribute */
63         NR::Matrix gradientTransform;
64         guint gradientTransform_set : 1;
65         /** spreadMethod attribute */
66         SPGradientSpread spread;
67         guint spread_set : 1;
68         /** Gradient stops */
69         guint has_stops : 1;
70         /** Composed vector */
71         SPGradientVector vector;
72         /** Rendered color array (4 * 1024 bytes) */
73         guchar *color;
75         sigc::connection modified_connection;
76 };
78 /**
79  * The SPGradient vtable.
80  */
81 struct SPGradientClass {
82         SPPaintServerClass parent_class;
83 };
86 #include "sp-gradient-fns.h"
88 #endif /* !__SP_GRADIENT_H__ */
90 /*
91   Local Variables:
92   mode:c++
93   c-file-style:"stroustrup"
94   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
95   indent-tabs-mode:nil
96   fill-column:99
97   End:
98 */
99 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :