1 #ifndef SEEN_PEN_CONTEXT_H
2 #define SEEN_PEN_CONTEXT_H
4 /** \file
5 * SPPenContext: a context for pen tool events.
6 */
8 #include "draw-context.h"
11 #define SP_TYPE_PEN_CONTEXT (sp_pen_context_get_type())
12 #define SP_PEN_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_PEN_CONTEXT, SPPenContext))
13 #define SP_PEN_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SP_TYPE_PEN_CONTEXT, SPPenContextClass))
14 #define SP_IS_PEN_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_PEN_CONTEXT))
15 #define SP_IS_PEN_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_PEN_CONTEXT))
17 enum {
18 SP_PEN_CONTEXT_POINT,
19 SP_PEN_CONTEXT_CONTROL,
20 SP_PEN_CONTEXT_CLOSE,
21 SP_PEN_CONTEXT_STOP
22 };
24 enum {
25 SP_PEN_CONTEXT_MODE_CLICK,
26 SP_PEN_CONTEXT_MODE_DRAG
27 };
29 /**
30 * SPPenContext: a context for pen tool events.
31 */
32 struct SPPenContext : public SPDrawContext {
33 NR::Point p[5];
35 /** \invar npoints in {0, 2, 5}. */
36 gint npoints;
38 unsigned int mode : 1;
39 unsigned int state : 2;
40 unsigned int onlycurves : 1;
42 SPCanvasItem *c0, *c1, *cl0, *cl1;
43 };
45 /// The SPPenContext vtable (empty).
46 struct SPPenContextClass : public SPEventContextClass { };
48 GType sp_pen_context_get_type();
51 #endif /* !SEEN_PEN_CONTEXT_H */
53 /*
54 Local Variables:
55 mode:c++
56 c-file-style:"stroustrup"
57 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
58 indent-tabs-mode:nil
59 fill-column:99
60 End:
61 */
62 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :