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;
50 bool _moved;
52 NRRectL box; /* NB! x1 & y1 are included */
53 guchar *cache;
54 GdkPixbuf * pixbuf;
56 void moveto(NR::Point const p);
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:encoding=utf-8:textwidth=99 :