From fbdc8b84ff670c684dafc7d7d403ed01e7077e70 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 13 Apr 2013 18:13:17 +0200 Subject: Replaced casting macros for EventContext tree; added contructors. (bzr r11608.1.96) --- src/pencil-context.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/pencil-context.cpp') diff --git a/src/pencil-context.cpp b/src/pencil-context.cpp index 0b3955a0c..3c2269bd2 100644 --- a/src/pencil-context.cpp +++ b/src/pencil-context.cpp @@ -68,6 +68,20 @@ static bool pencil_within_tolerance = false; static bool in_svg_plane(Geom::Point const &p) { return Geom::LInfty(p) < 1e18; } +#include "sp-factory.h" + +namespace { + SPEventContext* createPencilContext() { + return new SPPencilContext(); + } + + bool pencilContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pencil", createPencilContext); +} + +const std::string& CPencilContext::getPrefsPath() { + return SPPencilContext::prefsPath; +} + const std::string SPPencilContext::prefsPath = "/tools/freehand/pencil"; G_DEFINE_TYPE(SPPencilContext, sp_pencil_context, SP_TYPE_DRAW_CONTEXT); @@ -101,6 +115,7 @@ SPPencilContext::SPPencilContext() : SPDrawContext() { delete pc->cdrawcontext; pc->cdrawcontext = pc->cpencilcontext; pc->ceventcontext = pc->cpencilcontext; + types.insert(typeid(SPPencilContext)); pc->is_drawing = false; -- cgit v1.2.3