1 #ifndef INKSCAPE_CTRL_H
2 #define INKSCAPE_CTRL_H
4 /* sodipodi-ctrl
5 *
6 * It is simply small square, which does not scale nor rotate
7 *
8 */
10 #include <gtk/gtkenums.h>
11 #include "sp-canvas.h"
12 #include <gdk-pixbuf/gdk-pixbuf.h>
13 #include <libnr/nr-rect-l.h>
17 #define SP_TYPE_CTRL (sp_ctrl_get_type ())
18 #define SP_CTRL(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CTRL, SPCtrl))
19 #define SP_CTRL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_CTRL, SPCtrlClass))
20 #define SP_IS_CTRL(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CTRL))
21 #define SP_IS_CTRL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CTRL))
23 typedef enum {
24 SP_CTRL_SHAPE_SQUARE,
25 SP_CTRL_SHAPE_DIAMOND,
26 SP_CTRL_SHAPE_CIRCLE,
27 SP_CTRL_SHAPE_CROSS,
28 SP_CTRL_SHAPE_BITMAP,
29 SP_CTRL_SHAPE_IMAGE
30 } SPCtrlShapeType;
33 typedef enum {
34 SP_CTRL_MODE_COLOR,
35 SP_CTRL_MODE_XOR
36 } SPCtrlModeType;
38 struct SPCtrl : public SPCanvasItem{
39 SPCtrlShapeType shape;
40 SPCtrlModeType mode;
41 GtkAnchorType anchor;
42 gint span;
43 guint defined : 1;
44 guint shown : 1;
45 guint build : 1;
46 guint filled : 1;
47 guint stroked : 1;
48 guint32 fill_color;
49 guint32 stroke_color;
51 NRRectL box; /* NB! x1 & y1 are included */
52 guchar *cache;
53 GdkPixbuf * pixbuf;
55 void moveto(NR::Point const p);
56 };
58 struct SPCtrlClass : public SPCanvasItemClass{
59 };
63 /* Standard Gtk function */
64 GtkType sp_ctrl_get_type (void);
65 #endif