Code

four more modes
[inkscape.git] / src / tweak-context.h
1 #ifndef __SP_TWEAK_CONTEXT_H__
2 #define __SP_TWEAK_CONTEXT_H__
4 /*
5  * tweaking paths without node editing
6  *
7  * Authors:
8  *   bulia byak 
9  *
10  * Copyright (C) 2007 authors
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #include "display/curve.h"
16 #include "event-context.h"
17 #include <display/display-forward.h>
18 #include <libnr/nr-point.h>
20 #define SP_TYPE_TWEAK_CONTEXT (sp_tweak_context_get_type())
21 #define SP_TWEAK_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_TWEAK_CONTEXT, SPTweakContext))
22 #define SP_TWEAK_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SP_TYPE_TWEAK_CONTEXT, SPTweakContextClass))
23 #define SP_IS_TWEAK_CONTEXT(o) (GTK_CHECK_TYPE((o), SP_TYPE_TWEAK_CONTEXT))
24 #define SP_IS_TWEAK_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE((k), SP_TYPE_TWEAK_CONTEXT))
26 class SPTweakContext;
27 class SPTweakContextClass;
29 #define SAMPLING_SIZE 8        /* fixme: ?? */
31 #define TC_MIN_PRESSURE      0.0
32 #define TC_MAX_PRESSURE      1.0
33 #define TC_DEFAULT_PRESSURE  0.4
35 enum {
36     TWEAK_MODE_PUSH,
37     TWEAK_MODE_SHRINK,
38     TWEAK_MODE_GROW,
39     TWEAK_MODE_ATTRACT,
40     TWEAK_MODE_REPEL,
41     TWEAK_MODE_ROUGHEN,
42     TWEAK_MODE_COLORPAINT,
43     TWEAK_MODE_COLORJITTER
44 };
46 struct SPTweakContext
47 {
48     SPEventContext event_context;
50     /* extended input data */
51     gdouble pressure;
53     /* attributes */
54     guint dragging : 1;           /* mouse state: mouse is dragging */
55     guint usepressure : 1;
56     guint usetilt : 1;
58     double width;
59     double force;
60     double fidelity;
62     gint mode;
64     Inkscape::MessageContext *_message_context;
66     bool is_drawing;
68     bool is_dilating;
69     bool has_dilated;
70     NR::Point last_push;
71     SPCanvasItem *dilate_area;
73     bool do_h;
74     bool do_s;
75     bool do_l;
76     bool do_o;
78         sigc::connection style_set_connection;
79 };
81 struct SPTweakContextClass
82 {
83     SPEventContextClass parent_class;
84 };
86 GtkType sp_tweak_context_get_type(void);
88 #endif
90 /*
91   Local Variables:
92   mode:c++
93   c-file-style:"stroustrup"
94   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
95   indent-tabs-mode:nil
96   fill-column:99
97   End:
98 */
99 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :