Code

Use subdirectories with icon sizes.
[inkscape.git] / src / draw-context.h
1 #ifndef __SP_DRAW_CONTEXT_H__
2 #define __SP_DRAW_CONTEXT_H__
4 /*
5  * Generic drawing context
6  *
7  * Author:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *
10  * Copyright (C) 2000 Lauris Kaplinski
11  * Copyright (C) 2000-2001 Ximian, Inc.
12  * Copyright (C) 2002 Lauris Kaplinski
13  *
14  * Released under GNU GPL
15  */
17 #include <sigc++/sigc++.h>
18 #include "event-context.h"
19 #include <forward.h>
20 #include <display/display-forward.h>
21 #include <libnr/nr-point.h>
22 #include "live_effects/effect.h"
24 /* Freehand context */
26 #define SP_TYPE_DRAW_CONTEXT (sp_draw_context_get_type())
27 #define SP_DRAW_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_DRAW_CONTEXT, SPDrawContext))
28 #define SP_DRAW_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SP_TYPE_DRAW_CONTEXT, SPDrawContextClass))
29 #define SP_IS_DRAW_CONTEXT(o) (GTK_CHECK_TYPE((o), SP_TYPE_DRAW_CONTEXT))
30 #define SP_IS_DRAW_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE((k), SP_TYPE_DRAW_CONTEXT))
32 struct SPDrawAnchor;
33 namespace Inkscape
34 {
35   class Selection;
36 }
38 struct SPDrawContext : public SPEventContext{
39     Inkscape::Selection *selection;
40     SPCanvasItem *grab;
42     guint attach : 1;
44     guint32 red_color;
45     guint32 blue_color;
46     guint32 green_color;
48     /* Red */
49     SPCanvasItem *red_bpath;
50     SPCurve *red_curve;
52     /* Blue */
53     SPCanvasItem *blue_bpath;
54     SPCurve *blue_curve;
56     /* Green */
57     GSList *green_bpaths;
58     SPCurve *green_curve;
59     SPDrawAnchor *green_anchor;
60     gboolean green_closed; // a flag meaning we hit the green anchor, so close the path on itself
62     /* White */
63     SPItem *white_item;
64     GSList *white_curves;
65     GSList *white_anchors;
67     /* Start anchor */
68     SPDrawAnchor *sa;
69     /* End anchor */
70     SPDrawAnchor *ea;
72     /* type of the LPE that is to be applied automatically to a finished path (if any) */
73     Inkscape::LivePathEffect::EffectType waiting_LPE_type;
75     sigc::connection sel_changed_connection;
76     sigc::connection sel_modified_connection;
78     bool red_curve_is_valid;
80     bool anchor_statusbar;
81 };
83 struct SPDrawContextClass : public SPEventContextClass{};
85 GType sp_draw_context_get_type(void);
86 SPDrawAnchor *spdc_test_inside(SPDrawContext *dc, Geom::Point p);
87 void spdc_concat_colors_and_flush(SPDrawContext *dc, gboolean forceclosed);
88 void spdc_endpoint_snap_rotation(SPEventContext const *const ec, Geom::Point &p, Geom::Point const &o, guint state);
89 void spdc_endpoint_snap_free(SPEventContext const *ec, Geom::Point &p, guint state);
90 void spdc_check_for_and_apply_waiting_LPE(SPDrawContext *dc, SPItem *item);
91 void spdc_create_single_dot(SPEventContext *ec, Geom::Point const &pt, char const *tool, guint event_state);
93 #endif
95 /*
96   Local Variables:
97   mode:c++
98   c-file-style:"stroustrup"
99   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
100   indent-tabs-mode:nil
101   fill-column:99
102   End:
103 */
104 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :