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