summaryrefslogtreecommitdiffstats
path: root/src/spiral-context.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-08 22:23:07 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-08 22:23:07 +0000
commite58cac52b258e64c2cc88b0044bf9cfbaecedce2 (patch)
treef2a5d2992b8658a583e740321b1a4b461aad54a9 /src/spiral-context.cpp
parentReactivated independent reference counting in the SPObject tree. (diff)
downloadinkscape-e58cac52b258e64c2cc88b0044bf9cfbaecedce2.tar.gz
inkscape-e58cac52b258e64c2cc88b0044bf9cfbaecedce2.zip
Started conversion of SPEventContext tree; added virtual pads to all classes.
(bzr r11608.1.89)
Diffstat (limited to 'src/spiral-context.cpp')
-rw-r--r--src/spiral-context.cpp49
1 files changed, 42 insertions, 7 deletions
diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp
index c54e7c487..fb5a85089 100644
--- a/src/spiral-context.cpp
+++ b/src/spiral-context.cpp
@@ -73,9 +73,17 @@ sp_spiral_context_class_init(SPSpiralContextClass *klass)
event_context_class->root_handler = sp_spiral_context_root_handler;
}
+CSpiralContext::CSpiralContext(SPSpiralContext* spiralcontext) : CEventContext(spiralcontext) {
+ this->spspiralcontext = spiralcontext;
+}
+
static void
sp_spiral_context_init(SPSpiralContext *spiral_context)
{
+ spiral_context->cspiralcontext = new CSpiralContext(spiral_context);
+ delete spiral_context->ceventcontext;
+ spiral_context->ceventcontext = spiral_context->cspiralcontext;
+
SPEventContext *event_context = SP_EVENT_CONTEXT(spiral_context);
event_context->cursor_shape = cursor_spiral_xpm;
@@ -98,6 +106,12 @@ sp_spiral_context_init(SPSpiralContext *spiral_context)
static void sp_spiral_context_finish(SPEventContext *ec)
{
+ ec->ceventcontext->finish();
+}
+
+void CSpiralContext::finish() {
+ SPEventContext* ec = this->speventcontext;
+
SPSpiralContext *sc = SP_SPIRAL_CONTEXT(ec);
SPDesktop *desktop = ec->desktop;
@@ -105,9 +119,10 @@ static void sp_spiral_context_finish(SPEventContext *ec)
sp_spiral_finish(sc);
sc->sel_changed_connection.disconnect();
- if ((SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->finish) {
- (SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->finish(ec);
- }
+// if ((SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->finish) {
+// (SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->finish(ec);
+// }
+ CEventContext::finish();
}
static void
@@ -151,10 +166,17 @@ static void sp_spiral_context_selection_changed(Inkscape::Selection *selection,
static void
sp_spiral_context_setup(SPEventContext *ec)
{
+ ec->ceventcontext->setup();
+}
+
+void CSpiralContext::setup() {
+ SPEventContext* ec = this->speventcontext;
+
SPSpiralContext *sc = SP_SPIRAL_CONTEXT(ec);
- if ((SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->setup)
- (SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->setup(ec);
+// if ((SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->setup)
+// (SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->setup(ec);
+ CEventContext::setup();
sp_event_context_read(ec, "expansion");
sp_event_context_read(ec, "revolution");
@@ -185,6 +207,12 @@ sp_spiral_context_setup(SPEventContext *ec)
static void
sp_spiral_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val)
{
+ ec->ceventcontext->set(val);
+}
+
+void CSpiralContext::set(Inkscape::Preferences::Entry* val) {
+ SPEventContext* ec = this->speventcontext;
+
SPSpiralContext *sc = SP_SPIRAL_CONTEXT(ec);
Glib::ustring name = val->getEntryName();
@@ -200,6 +228,12 @@ sp_spiral_context_set(SPEventContext *ec, Inkscape::Preferences::Entry *val)
static gint
sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event)
{
+ return event_context->ceventcontext->root_handler(event);
+}
+
+gint CSpiralContext::root_handler(GdkEvent* event) {
+ SPEventContext* event_context = this->speventcontext;
+
static gboolean dragging;
SPDesktop *desktop = event_context->desktop;
@@ -374,8 +408,9 @@ sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event)
}
if (!ret) {
- if ((SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->root_handler)
- ret = (SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->root_handler(event_context, event);
+// if ((SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->root_handler)
+// ret = (SP_EVENT_CONTEXT_CLASS(sp_spiral_context_parent_class))->root_handler(event_context, event);
+ ret = CEventContext::root_handler(event);
}
return ret;