summaryrefslogtreecommitdiffstats
path: root/src/event-context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/event-context.cpp')
-rw-r--r--src/event-context.cpp15
1 files changed, 15 insertions, 0 deletions
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.
*/