Code

9c152598b3a033063dbac03591e7def38f0ee866
[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 struct SPGradientReference;
25 typedef enum {
26         SP_GRADIENT_TYPE_UNKNOWN,
27         SP_GRADIENT_TYPE_LINEAR,
28         SP_GRADIENT_TYPE_RADIAL
29 } SPGradientType;
31 typedef enum {
32         SP_GRADIENT_STATE_UNKNOWN,
33         SP_GRADIENT_STATE_VECTOR,
34         SP_GRADIENT_STATE_PRIVATE
35 } SPGradientState;
37 typedef enum {
38     POINT_LG_P1,
39     POINT_LG_P2,
40     POINT_RG_CENTER,
41     POINT_RG_R1,
42     POINT_RG_R2,
43     POINT_RG_FOCUS
44 } GrPoint;
46 /**
47  * Gradient
48  *
49  * Implement spread, stops list
50  * \todo fixme: Implement more here (Lauris)
51  */
52 struct SPGradient : public SPPaintServer {
53         /** Reference (href) */
54         SPGradientReference *ref;
55         /** State in Inkscape gradient system */
56         guint state : 2;
57         /** gradientUnits attribute */
58         SPGradientUnits units;
59         guint units_set : 1;
60         /** gradientTransform attribute */
61         NR::Matrix gradientTransform;
62         guint gradientTransform_set : 1;
63         /** spreadMethod attribute */
64         SPGradientSpread spread;
65         guint spread_set : 1;
66         /** Gradient stops */
67         guint has_stops : 1;
68         /** Composed vector */
69         SPGradientVector vector;
70         /** Rendered color array (4 * 1024 bytes) */
71         guchar *color;
72 };
74 /**
75  * The SPGradient vtable.
76  */
77 struct SPGradientClass {
78         SPPaintServerClass parent_class;
79 };
82 #include "sp-gradient-fns.h"
84 #endif /* !__SP_GRADIENT_H__ */
86 /*
87   Local Variables:
88   mode:c++
89   c-file-style:"stroustrup"
90   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
91   indent-tabs-mode:nil
92   fill-column:99
93   End:
94 */
95 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :