de5247c1c57fc2499a1353a05d8772c708b13fcb
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_BEGIN,
41 POINT_LG_END,
42 POINT_LG_MID,
43 POINT_RG_CENTER,
44 POINT_RG_R1,
45 POINT_RG_R2,
46 POINT_RG_FOCUS
47 } GrPointType;
49 /**
50 * Gradient
51 *
52 * Implement spread, stops list
53 * \todo fixme: Implement more here (Lauris)
54 */
55 struct SPGradient : public SPPaintServer {
56 /** Reference (href) */
57 SPGradientReference *ref;
58 /** State in Inkscape gradient system */
59 guint state : 2;
60 /** gradientUnits attribute */
61 SPGradientUnits units;
62 guint units_set : 1;
63 /** gradientTransform attribute */
64 NR::Matrix gradientTransform;
65 guint gradientTransform_set : 1;
66 /** spreadMethod attribute */
67 SPGradientSpread spread;
68 guint spread_set : 1;
69 /** Gradient stops */
70 guint has_stops : 1;
71 /** Composed vector */
72 SPGradientVector vector;
73 /** Rendered color array (4 * 1024 bytes) */
74 guchar *color;
76 sigc::connection modified_connection;
77 };
79 /**
80 * The SPGradient vtable.
81 */
82 struct SPGradientClass {
83 SPPaintServerClass parent_class;
84 };
87 #include "sp-gradient-fns.h"
89 #endif /* !__SP_GRADIENT_H__ */
91 /*
92 Local Variables:
93 mode:c++
94 c-file-style:"stroustrup"
95 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
96 indent-tabs-mode:nil
97 fill-column:99
98 End:
99 */
100 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :