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 <gdk-pixbuf/gdk-pixbuf.h>
12 #include <libnr/nr-rect-l.h>
13 #include "sp-canvas-item.h"
16 #define SP_TYPE_CTRL (sp_ctrl_get_type ())
17 #define SP_CTRL(obj) (GTK_CHECK_CAST ((obj), SP_TYPE_CTRL, SPCtrl))
18 #define SP_CTRL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_CTRL, SPCtrlClass))
19 #define SP_IS_CTRL(obj) (GTK_CHECK_TYPE ((obj), SP_TYPE_CTRL))
20 #define SP_IS_CTRL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_CTRL))
22 typedef enum {
23 SP_CTRL_SHAPE_SQUARE,
24 SP_CTRL_SHAPE_DIAMOND,
25 SP_CTRL_SHAPE_CIRCLE,
26 SP_CTRL_SHAPE_CROSS,
27 SP_CTRL_SHAPE_BITMAP,
28 SP_CTRL_SHAPE_IMAGE
29 } SPCtrlShapeType;
32 typedef enum {
33 SP_CTRL_MODE_COLOR,
34 SP_CTRL_MODE_XOR
35 } SPCtrlModeType;
37 struct SPCtrl : public SPCanvasItem {
38 SPCtrlShapeType shape;
39 SPCtrlModeType mode;
40 GtkAnchorType anchor;
41 gint span;
42 guint defined : 1;
43 guint shown : 1;
44 guint build : 1;
45 guint filled : 1;
46 guint stroked : 1;
47 guint32 fill_color;
48 guint32 stroke_color;
49 bool _moved;
51 NRRectL box; /* NB! x1 & y1 are included */
52 guchar *cache;
53 GdkPixbuf * pixbuf;
55 void moveto(Geom::Point const p);
56 Geom::Point _point;
57 };
59 struct SPCtrlClass : public SPCanvasItemClass{
60 };
64 /* Standard Gtk function */
65 GtkType sp_ctrl_get_type (void);
68 #endif /* !INKSCAPE_CTRL_H */
70 /*
71 Local Variables:
72 mode:c++
73 c-file-style:"stroustrup"
74 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
75 indent-tabs-mode:nil
76 fill-column:99
77 End:
78 */
79 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :