Code

fix parameter ranges, copyedit
[inkscape.git] / src / pencil-context.h
1 #ifndef SEEN_PENCIL_CONTEXT_H
2 #define SEEN_PENCIL_CONTEXT_H
4 /** \file
5  * SPPencilContext: a context for pencil tool events
6  */
8 #include "draw-context.h"
11 #define SP_TYPE_PENCIL_CONTEXT (sp_pencil_context_get_type())
12 #define SP_PENCIL_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST((o), SP_TYPE_PENCIL_CONTEXT, SPPencilContext))
13 #define SP_PENCIL_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), SP_TYPE_PENCIL_CONTEXT, SPPencilContextClass))
14 #define SP_IS_PENCIL_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), SP_TYPE_PENCIL_CONTEXT))
15 #define SP_IS_PENCIL_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), SP_TYPE_PENCIL_CONTEXT))
17 enum PencilState {
18     SP_PENCIL_CONTEXT_IDLE,
19     SP_PENCIL_CONTEXT_ADDLINE,
20     SP_PENCIL_CONTEXT_FREEHAND,
21     SP_PENCIL_CONTEXT_SKETCH
22 };
24 /**
25  * SPPencilContext: a context for pencil tool events
26  */
27 struct SPPencilContext : public SPDrawContext {
28     Geom::Point p[16];
29     gint npoints;
30     PencilState state;
31     Geom::Point req_tangent;
33     bool is_drawing;
35     std::vector<Geom::Point> ps;
37     Geom::Piecewise<Geom::D2<Geom::SBasis> > sketch_interpolation; // the current proposal from the sketched paths
38     unsigned sketch_n; // number of sketches done
39 };
41 /// The SPPencilContext vtable (empty).
42 struct SPPencilContextClass : public SPEventContextClass { };
44 GType sp_pencil_context_get_type();
47 #endif /* !SEEN_PENCIL_CONTEXT_H */
49 /*
50   Local Variables:
51   mode:c++
52   c-file-style:"stroustrup"
53   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
54   indent-tabs-mode:nil
55   fill-column:99
56   End:
57 */
58 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :