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_SUCK,
38 TWEAK_MODE_BLOW,
39 TWEAK_MODE_ROUGHEN
40 };
42 struct SPTweakContext
43 {
44 SPEventContext event_context;
46 /* extended input data */
47 gdouble pressure;
49 /* attributes */
50 guint dragging : 1; /* mouse state: mouse is dragging */
51 guint usepressure : 1;
52 guint usetilt : 1;
54 double width;
55 double force;
56 double fidelity;
58 gint mode;
60 Inkscape::MessageContext *_message_context;
62 bool is_drawing;
64 bool is_dilating;
65 bool has_dilated;
66 NR::Point last_push;
67 SPCanvasItem *dilate_area;
68 };
70 struct SPTweakContextClass
71 {
72 SPEventContextClass parent_class;
73 };
75 GtkType sp_tweak_context_get_type(void);
77 #endif
79 /*
80 Local Variables:
81 mode:c++
82 c-file-style:"stroustrup"
83 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
84 indent-tabs-mode:nil
85 fill-column:99
86 End:
87 */
88 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :