From 0bf5619e6388466b8caaddaf490acc557804f236 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Mon, 18 Aug 2008 00:38:00 +0000 Subject: Add a ShapeEditor to LPEToolContext which allows us to edit nodes (switching selections doesn't work right yet; changing the cursor would also be nice) (bzr r6656) --- src/event-context.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/event-context.cpp') diff --git a/src/event-context.cpp b/src/event-context.cpp index 450d1994d..b1c4f87ef 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -53,6 +53,8 @@ #include "attributes.h" #include "rubberband.h" #include "selcue.h" +#include "node-context.h" +#include "lpe-tool-context.h" #include "event-context.h" @@ -1036,6 +1038,19 @@ sp_event_context_over_item (SPDesktop *desktop, SPItem *item, NR::Point const p) return item_at_point; } +ShapeEditor * +sp_event_context_get_shape_editor (SPEventContext *ec) +{ + if (SP_IS_NODE_CONTEXT(ec)) { + return SP_NODE_CONTEXT(ec)->shape_editor; + } else if (SP_IS_LPETOOL_CONTEXT(ec)) { + return SP_LPETOOL_CONTEXT(ec)->shape_editor; + } else { + g_warning("ShapeEditor only exists in Node and Geometric Tool."); + return NULL; + } +} + /** * Called when SPEventContext subclass node attribute changed. */ -- cgit v1.2.3