Code

3e4e9092405c059a73eb3565341c4b9f8d7eee9c
[inkscape.git] / src / pen-context.h
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"
10 namespace Inkscape {
11 namespace LivePathEffect {
12 class Effect;
13 }
14 }
16 #define SP_TYPE_PEN_CONTEXT (sp_pen_context_get_type())
17 #define SP_PEN_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_PEN_CONTEXT, SPPenContext))
18 #define SP_PEN_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SP_TYPE_PEN_CONTEXT, SPPenContextClass))
19 #define SP_IS_PEN_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_PEN_CONTEXT))
20 #define SP_IS_PEN_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_PEN_CONTEXT))
22 enum {
23     SP_PEN_CONTEXT_POINT,
24     SP_PEN_CONTEXT_CONTROL,
25     SP_PEN_CONTEXT_CLOSE,
26     SP_PEN_CONTEXT_STOP
27 };
29 enum {
30     SP_PEN_CONTEXT_MODE_CLICK,
31     SP_PEN_CONTEXT_MODE_DRAG
32 };
34 /**
35  * SPPenContext: a context for pen tool events.
36  */
37 struct SPPenContext : public SPDrawContext {
38     NR::Point p[5];
40     /** \invar npoints in {0, 2, 5}. */
41     gint npoints;
43     unsigned int mode : 1;
44     unsigned int state : 2;
46     bool polylines_only;
48     unsigned int expecting_clicks_for_LPE; // if positive, finish the path after this many clicks
49     Inkscape::LivePathEffect::Effect *waiting_LPE;
50     SPLPEItem *waiting_item;
52     SPCanvasItem *c0, *c1, *cl0, *cl1;
53     
54     unsigned int events_disabled : 1;
55 };
57 /// The SPPenContext vtable (empty).
58 struct SPPenContextClass : public SPEventContextClass { };
60 GType sp_pen_context_get_type();
63 #endif /* !SEEN_PEN_CONTEXT_H */
65 /*
66   Local Variables:
67   mode:c++
68   c-file-style:"stroustrup"
69   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
70   indent-tabs-mode:nil
71   fill-column:99
72   End:
73 */
74 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :