summaryrefslogtreecommitdiffstats
path: root/src/draw-context.h
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2006-01-16 02:36:01 +0000
committermental <mental@users.sourceforge.net>2006-01-16 02:36:01 +0000
commit179fa413b047bede6e32109e2ce82437c5fb8d34 (patch)
treea5a6ac2c1708bd02288fbd8edb2ff500ff2e0916 /src/draw-context.h
downloadinkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.tar.gz
inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.zip
moving trunk for module inkscape
(bzr r1)
Diffstat (limited to 'src/draw-context.h')
-rw-r--r--src/draw-context.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/src/draw-context.h b/src/draw-context.h
new file mode 100644
index 000000000..59ec5a92f
--- /dev/null
+++ b/src/draw-context.h
@@ -0,0 +1,100 @@
+#ifndef __SP_DRAW_CONTEXT_H__
+#define __SP_DRAW_CONTEXT_H__
+
+/*
+ * Generic drawing context
+ *
+ * Author:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ *
+ * Copyright (C) 2000 Lauris Kaplinski
+ * Copyright (C) 2000-2001 Ximian, Inc.
+ * Copyright (C) 2002 Lauris Kaplinski
+ *
+ * Released under GNU GPL
+ */
+
+#include <sigc++/sigc++.h>
+#include "display/curve.h"
+#include "event-context.h"
+#include <forward.h>
+#include <display/display-forward.h>
+#include <libnr/nr-point.h>
+
+/* Freehand context */
+
+#define SP_TYPE_DRAW_CONTEXT (sp_draw_context_get_type())
+#define SP_DRAW_CONTEXT(o) (GTK_CHECK_CAST((o), SP_TYPE_DRAW_CONTEXT, SPDrawContext))
+#define SP_DRAW_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), SP_TYPE_DRAW_CONTEXT, SPDrawContextClass))
+#define SP_IS_DRAW_CONTEXT(o) (GTK_CHECK_TYPE((o), SP_TYPE_DRAW_CONTEXT))
+#define SP_IS_DRAW_CONTEXT_CLASS(k) (GTK_CHECK_CLASS_TYPE((k), SP_TYPE_DRAW_CONTEXT))
+
+struct SPDrawAnchor;
+namespace Inkscape
+{
+ class Selection;
+}
+
+struct SPDrawContext : public SPEventContext{
+ Inkscape::Selection *selection;
+ SPCanvasItem *grab;
+
+ guint attach : 1;
+
+ guint32 red_color;
+ guint32 blue_color;
+ guint32 green_color;
+
+ /* Red */
+ SPCanvasItem *red_bpath;
+ SPCurve *red_curve;
+
+ /* Blue */
+ SPCanvasItem *blue_bpath;
+ SPCurve *blue_curve;
+
+ /* Green */
+ GSList *green_bpaths;
+ SPCurve *green_curve;
+ SPDrawAnchor *green_anchor;
+ gboolean green_closed; // a flag meaning we hit the green anchor, so close the path on itself
+
+ /* White */
+ SPItem *white_item;
+ GSList *white_curves;
+ GSList *white_anchors;
+
+ /* Start anchor */
+ SPDrawAnchor *sa;
+ /* End anchor */
+ SPDrawAnchor *ea;
+
+ sigc::connection sel_changed_connection;
+ sigc::connection sel_modified_connection;
+
+ bool red_curve_is_valid;
+
+ bool anchor_statusbar;
+};
+
+struct SPDrawContextClass : public SPEventContextClass{};
+
+GType sp_draw_context_get_type(void);
+SPDrawAnchor *spdc_test_inside(SPDrawContext *dc, NR::Point p);
+void spdc_concat_colors_and_flush(SPDrawContext *dc, gboolean forceclosed);
+void spdc_endpoint_snap_rotation(SPEventContext const *const ec, NR::Point &p, NR::Point const o, guint state);
+void spdc_endpoint_snap_free(SPEventContext const *ec, NR::Point &p, guint state);
+
+
+#endif
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :