1 #ifndef SP_DYNA_DRAW_CONTEXT_H_SEEN
2 #define SP_DYNA_DRAW_CONTEXT_H_SEEN
4 /*
5 * Handwriting-like drawing mode
6 *
7 * Authors:
8 * Mitsuru Oka <oka326@parkcity.ne.jp>
9 * Lauris Kaplinski <lauris@kaplinski.com>
10 *
11 * The original dynadraw code:
12 * Paul Haeberli <paul@sgi.com>
13 *
14 * Copyright (C) 1998 The Free Software Foundation
15 * Copyright (C) 1999-2002 authors
16 * Copyright (C) 2001-2002 Ximian, Inc.
17 *
18 * Released under GNU GPL, read the file 'COPYING' for more information
19 */
21 #include "common-context.h"
22 #include "splivarot.h"
24 #define SP_TYPE_DYNA_DRAW_CONTEXT (sp_dyna_draw_context_get_type())
25 #define SP_DYNA_DRAW_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_DYNA_DRAW_CONTEXT, SPDynaDrawContext))
26 #define SP_DYNA_DRAW_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SP_TYPE_DYNA_DRAW_CONTEXT, SPDynaDrawContextClass))
27 #define SP_IS_DYNA_DRAW_CONTEXT(o) (GTK_CHECK_TYPE((o), SP_TYPE_DYNA_DRAW_CONTEXT))
28 #define SP_IS_DYNA_DRAW_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE((k), SP_TYPE_DYNA_DRAW_CONTEXT))
30 class SPDynaDrawContext;
31 class SPDynaDrawContextClass;
33 #define DDC_MIN_PRESSURE 0.0
34 #define DDC_MAX_PRESSURE 1.0
35 #define DDC_DEFAULT_PRESSURE 1.0
37 #define DDC_MIN_TILT -1.0
38 #define DDC_MAX_TILT 1.0
39 #define DDC_DEFAULT_TILT 0.0
41 struct SPDynaDrawContext : public SPCommonContext {
42 /** newly created object remain selected */
43 bool keep_selected;
45 double hatch_spacing;
46 double hatch_spacing_step;
47 SPItem *hatch_item;
48 Path *hatch_livarot_path;
49 std::list<double> hatch_nearest_past;
50 std::list<double> hatch_pointer_past;
51 Geom::Point hatch_last_nearest, hatch_last_pointer;
52 Geom::Point hatch_vector_accumulated;
53 bool hatch_escaped;
54 SPCanvasItem *hatch_area;
56 bool trace_bg;
57 };
59 struct SPDynaDrawContextClass : public SPEventContextClass{};
61 GType sp_dyna_draw_context_get_type(void);
63 #endif // SP_DYNA_DRAW_CONTEXT_H_SEEN
65 /*
66 Local Variables:
67 mode:c++
68 c-file-style:"stroustrup"
69 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
70 indent-tabs-mode:nil
71 fill-column:99
72 End:
73 */
74 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :