Code

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