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_PUSH,
36 TWEAK_MODE_SHRINK,
37 TWEAK_MODE_GROW,
38 TWEAK_MODE_ATTRACT,
39 TWEAK_MODE_REPEL,
40 TWEAK_MODE_ROUGHEN,
41 TWEAK_MODE_COLORPAINT,
42 TWEAK_MODE_COLORJITTER
43 };
45 struct SPTweakContext
46 {
47 SPEventContext event_context;
49 /* extended input data */
50 gdouble pressure;
52 /* attributes */
53 guint dragging : 1; /* mouse state: mouse is dragging */
54 guint usepressure : 1;
55 guint usetilt : 1;
57 double width;
58 double force;
59 double fidelity;
61 gint mode;
63 Inkscape::MessageContext *_message_context;
65 bool is_drawing;
67 bool is_dilating;
68 bool has_dilated;
69 NR::Point last_push;
70 SPCanvasItem *dilate_area;
72 bool do_h;
73 bool do_s;
74 bool do_l;
75 bool do_o;
77 sigc::connection style_set_connection;
78 };
80 struct SPTweakContextClass
81 {
82 SPEventContextClass parent_class;
83 };
85 GtkType sp_tweak_context_get_type(void);
87 #endif
89 /*
90 Local Variables:
91 mode:c++
92 c-file-style:"stroustrup"
93 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
94 indent-tabs-mode:nil
95 fill-column:99
96 End:
97 */
98 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :