1 #ifndef __SP_SPRAY_CONTEXT_H__
2 #define __SP_SPRAY_CONTEXT_H__
4 /*
5 * Spray Tool
6 *
7 * Authors:
8 * Pierre-Antoine MARC
9 * Pierre CACLIN
10 * Aurel-Aimé MARMION
11 * Julien LERAY
12 * Benoît LAVORATA
13 * Vincent MONTAGNE
14 * Pierre BARBRY-BLOT
15 *
16 * Copyright (C) 2009 authors
17 *
18 * Released under GNU GPL, read the file 'COPYING' for more information
19 */
21 #include "event-context.h"
22 #include <libnr/nr-point.h>
23 //#include "ui/widget/spray-option.h"
24 #include "ui/dialog/dialog.h"
26 #define SP_TYPE_SPRAY_CONTEXT (sp_spray_context_get_type())
27 #define SP_SPRAY_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_SPRAY_CONTEXT, SPSprayContext))
28 #define SP_SPRAY_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SP_TYPE_SPRAY_CONTEXT, SPSprayContextClass))
29 #define SP_IS_SPRAY_CONTEXT(o) (GTK_CHECK_TYPE((o), SP_TYPE_SPRAY_CONTEXT))
30 #define SP_IS_SPRAY_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE((k), SP_TYPE_SPRAY_CONTEXT))
32 class SPSprayContext;
33 class SPSprayContextClass;
35 namespace Inkscape {
36 namespace UI {
37 namespace Dialog {
38 class Dialog;
39 }
40 }
41 }
44 #define SAMPLING_SIZE 8 /* fixme: ?? */
46 #define TC_MIN_PRESSURE 0.0
47 #define TC_MAX_PRESSURE 1.0
48 #define TC_DEFAULT_PRESSURE 0.35
50 enum {
51 SPRAY_MODE_COPY,
52 SPRAY_MODE_CLONE,
53 SPRAY_MODE_SINGLE_PATH,
54 SPRAY_OPTION,
55 };
57 struct SPSprayContext
58 {
59 SPEventContext event_context;
60 //Inkscape::UI::Dialog::Dialog *dialog_option;//Attribut de type SprayOptionClass, localisé dans scr/ui/dialog
61 /* extended input data */
62 gdouble pressure;
64 /* attributes */
65 guint dragging : 1; /* mouse state: mouse is dragging */
66 guint usepressure : 1;
67 guint usetilt : 1;
68 bool usetext ;
70 double width;
71 double ratio;
72 double tilt;
73 double rotation_variation;
74 double force;
75 double population;
76 double scale_variation;
77 double scale;
78 double mean;
79 double standard_deviation;
81 gint distrib;
83 gint mode;
85 Inkscape::MessageContext *_message_context;
87 bool is_drawing;
89 bool is_dilating;
90 bool has_dilated;
91 Geom::Point last_push;
92 SPCanvasItem *dilate_area;
94 bool do_h;
95 bool do_s;
96 bool do_l;
97 bool do_o;
99 sigc::connection style_set_connection;
100 };
102 struct SPSprayContextClass
103 {
104 SPEventContextClass parent_class;
105 };
107 GtkType sp_spray_context_get_type(void);
110 #endif
112 /*
113 Local Variables:
114 mode:c++
115 c-file-style:"stroustrup"
116 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
117 indent-tabs-mode:nil
118 fill-column:99
119 End:
120 */
121 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :