Code

945d94807f5da0538696294c54b3079f30ed7bb8
[inkscape.git] / src / display / sodipodi-ctrl.h
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(Geom::Point const p);
57     Geom::Point _point;
58 };
60 struct SPCtrlClass : public SPCanvasItemClass{
61 };
65 /* Standard Gtk function */
66 GtkType sp_ctrl_get_type (void);
69 #endif /* !INKSCAPE_CTRL_H */
71 /*
72   Local Variables:
73   mode:c++
74   c-file-style:"stroustrup"
75   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
76   indent-tabs-mode:nil
77   fill-column:99
78   End:
79 */
80 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :