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 "event-context.h"
16 #include <libnr/nr-point.h>
18 #define SP_TYPE_TWEAK_CONTEXT (sp_tweak_context_get_type())
19 #define SP_TWEAK_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_TWEAK_CONTEXT, SPTweakContext))
20 #define SP_TWEAK_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SP_TYPE_TWEAK_CONTEXT, SPTweakContextClass))
21 #define SP_IS_TWEAK_CONTEXT(o) (GTK_CHECK_TYPE((o), SP_TYPE_TWEAK_CONTEXT))
22 #define SP_IS_TWEAK_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE((k), SP_TYPE_TWEAK_CONTEXT))
24 class SPTweakContext;
25 class SPTweakContextClass;
27 #define SAMPLING_SIZE 8 /* fixme: ?? */
29 #define TC_MIN_PRESSURE 0.0
30 #define TC_MAX_PRESSURE 1.0
31 #define TC_DEFAULT_PRESSURE 0.35
33 enum {
34 TWEAK_MODE_MOVE,
35 TWEAK_MODE_MOVE_IN_OUT,
36 TWEAK_MODE_MOVE_JITTER,
37 TWEAK_MODE_SCALE,
38 TWEAK_MODE_ROTATE,
39 TWEAK_MODE_MORELESS,
40 TWEAK_MODE_PUSH,
41 TWEAK_MODE_SHRINK_GROW,
42 TWEAK_MODE_ATTRACT_REPEL,
43 TWEAK_MODE_ROUGHEN,
44 TWEAK_MODE_COLORPAINT,
45 TWEAK_MODE_COLORJITTER,
46 TWEAK_MODE_BLUR
47 };
49 struct SPTweakContext
50 {
51 SPEventContext event_context;
53 /* extended input data */
54 gdouble pressure;
56 /* attributes */
57 guint dragging : 1; /* mouse state: mouse is dragging */
58 guint usepressure : 1;
59 guint usetilt : 1;
61 double width;
62 double force;
63 double fidelity;
65 gint mode;
67 Inkscape::MessageContext *_message_context;
69 bool is_drawing;
71 bool is_dilating;
72 bool has_dilated;
73 Geom::Point last_push;
74 SPCanvasItem *dilate_area;
76 bool do_h;
77 bool do_s;
78 bool do_l;
79 bool do_o;
81 sigc::connection style_set_connection;
82 };
84 struct SPTweakContextClass
85 {
86 SPEventContextClass parent_class;
87 };
89 GtkType sp_tweak_context_get_type(void);
91 #endif
93 /*
94 Local Variables:
95 mode:c++
96 c-file-style:"stroustrup"
97 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
98 indent-tabs-mode:nil
99 fill-column:99
100 End:
101 */
102 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :