Code

Make curvature work again by fixing a minor omission
[inkscape.git] / src / sp-gradient-fns.h
1 #ifndef SEEN_SP_GRADIENT_FNS_H
2 #define SEEN_SP_GRADIENT_FNS_H
4 /** \file
5  * Macros and fn declarations related to gradients.
6  */
8 #include <glib/gtypes.h>
9 #include <glib-object.h>
10 #include <2geom/forward.h>
11 #include "sp-gradient-spread.h"
12 #include "sp-gradient-units.h"
14 class SPGradient;
16 namespace Inkscape {
17 namespace XML {
18 class Node;
19 }
20 }
22 #define SP_TYPE_GRADIENT (sp_gradient_get_type())
23 #define SP_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SP_TYPE_GRADIENT, SPGradient))
24 #define SP_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SP_TYPE_GRADIENT, SPGradientClass))
25 #define SP_IS_GRADIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), SP_TYPE_GRADIENT))
26 #define SP_IS_GRADIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SP_TYPE_GRADIENT))
28 #define SP_GRADIENT_STATE_IS_SET(g) (SP_GRADIENT(g)->state != SP_GRADIENT_STATE_UNKNOWN)
29 #define SP_GRADIENT_IS_VECTOR(g) (SP_GRADIENT(g)->state == SP_GRADIENT_STATE_VECTOR)
30 #define SP_GRADIENT_IS_PRIVATE(g) (SP_GRADIENT(g)->state == SP_GRADIENT_STATE_PRIVATE)
31 #define SP_GRADIENT_HAS_STOPS(g) (SP_GRADIENT(g)->has_stops)
32 #define SP_GRADIENT_SPREAD(g) (SP_GRADIENT(g)->spread)
33 #define SP_GRADIENT_UNITS(g) (SP_GRADIENT(g)->units)
35 GType sp_gradient_get_type();
37 /** Forces vector to be built, if not present (i.e. changed) */
38 void sp_gradient_ensure_vector(SPGradient *gradient);
40 /** Ensures that color array is populated */
41 void sp_gradient_ensure_colors(SPGradient *gradient);
43 void sp_gradient_set_units(SPGradient *gr, SPGradientUnits units);
44 void sp_gradient_set_spread(SPGradient *gr, SPGradientSpread spread);
46 SPGradient *sp_gradient_get_vector (SPGradient *gradient, bool force_private);
47 SPGradientSpread sp_gradient_get_spread (SPGradient *gradient);
49 /* Gradient repr methods */
50 void sp_gradient_repr_write_vector(SPGradient *gr);
51 void sp_gradient_repr_clear_vector(SPGradient *gr);
53 void sp_gradient_render_vector_block_rgba(SPGradient *gr, guchar *px, gint w, gint h, gint rs, gint pos, gint span, bool horizontal);
54 void sp_gradient_render_vector_block_rgb(SPGradient *gr, guchar *px, gint w, gint h, gint rs, gint pos, gint span, bool horizontal);
56 /** Transforms to/from gradient position space in given environment */
57 Geom::Matrix sp_gradient_get_g2d_matrix(SPGradient const *gr, Geom::Matrix const &ctm,
58                                       Geom::Rect const &bbox);
59 Geom::Matrix sp_gradient_get_gs2d_matrix(SPGradient const *gr, Geom::Matrix const &ctm,
60                                        Geom::Rect const &bbox);
61 void sp_gradient_set_gs2d_matrix(SPGradient *gr, Geom::Matrix const &ctm, Geom::Rect const &bbox,
62                                  Geom::Matrix const &gs2d);
65 #endif /* !SEEN_SP_GRADIENT_FNS_H */
67 /*
68   Local Variables:
69   mode:c++
70   c-file-style:"stroustrup"
71   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
72   indent-tabs-mode:nil
73   fill-column:99
74   End:
75 */
76 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :