1 #ifndef __SP_GRADIENT_SELECTOR_H__
2 #define __SP_GRADIENT_SELECTOR_H__
4 /*
5 * Gradient vector and position widget
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 2001-2002 Lauris Kaplinski
11 * Copyright (C) 2001 Ximian, Inc.
12 *
13 * Released under GNU GPL, read the file 'COPYING' for more information
14 */
16 #include <glib.h>
17 #include "sp-gradient-spread.h"
18 #include "sp-gradient-units.h"
19 class SPGradient;
21 #define SP_TYPE_GRADIENT_SELECTOR (sp_gradient_selector_get_type ())
22 #define SP_GRADIENT_SELECTOR(o) (GTK_CHECK_CAST ((o), SP_TYPE_GRADIENT_SELECTOR, SPGradientSelector))
23 #define SP_GRADIENT_SELECTOR_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), SP_TYPE_GRADIENT_SELECTOR, SPGradientSelectorClass))
24 #define SP_IS_GRADIENT_SELECTOR(o) (GTK_CHECK_TYPE ((o), SP_TYPE_GRADIENT_SELECTOR))
25 #define SP_IS_GRADIENT_SELECTOR_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), SP_TYPE_GRADIENT_SELECTOR))
27 #include <libnr/nr-forward.h>
28 #include <gtk/gtkvbox.h>
29 #include "../forward.h"
30 #include <sp-gradient.h>
32 enum {
33 SP_GRADIENT_SELECTOR_MODE_LINEAR,
34 SP_GRADIENT_SELECTOR_MODE_RADIAL
35 };
37 struct SPGradientSelector {
38 GtkVBox vbox;
40 guint mode : 1;
42 SPGradientUnits gradientUnits : 1;
43 SPGradientSpread gradientSpread : 2;
45 /* Vector selector */
46 GtkWidget *vectors;
47 /* Editing buttons */
48 GtkWidget *edit, *add;
49 /* Position widget */
50 GtkWidget *position;
51 /* Spread selector */
52 GtkWidget *spread;
53 };
55 struct SPGradientSelectorClass {
56 GtkVBoxClass parent_class;
58 void (* grabbed) (SPGradientSelector *sel);
59 void (* dragged) (SPGradientSelector *sel);
60 void (* released) (SPGradientSelector *sel);
61 void (* changed) (SPGradientSelector *sel);
62 };
64 GtkType sp_gradient_selector_get_type (void);
66 GtkWidget *sp_gradient_selector_new (void);
68 void sp_gradient_selector_set_mode (SPGradientSelector *sel, guint mode);
69 void sp_gradient_selector_set_units (SPGradientSelector *sel, guint units);
70 void sp_gradient_selector_set_spread (SPGradientSelector *sel, guint spread);
71 void sp_gradient_selector_set_vector (SPGradientSelector *sel, SPDocument *doc, SPGradient *vector);
72 void sp_gradient_selector_set_bbox (SPGradientSelector *sel, gdouble x0, gdouble y0, gdouble x1, gdouble y1);
74 SPGradientUnits sp_gradient_selector_get_units (SPGradientSelector *sel);
75 SPGradientSpread sp_gradient_selector_get_spread (SPGradientSelector *sel);
77 SPGradient *sp_gradient_selector_get_vector (SPGradientSelector *sel);
79 #endif