diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-13 16:13:17 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-13 16:13:17 +0000 |
| commit | fbdc8b84ff670c684dafc7d7d403ed01e7077e70 (patch) | |
| tree | 964a82e4e94d8d6602e90893ac51ac9e2f7ec362 /src/pencil-context.cpp | |
| parent | Made factory a template. (diff) | |
| download | inkscape-fbdc8b84ff670c684dafc7d7d403ed01e7077e70.tar.gz inkscape-fbdc8b84ff670c684dafc7d7d403ed01e7077e70.zip | |
Replaced casting macros for EventContext tree; added contructors.
(bzr r11608.1.96)
Diffstat (limited to 'src/pencil-context.cpp')
| -rw-r--r-- | src/pencil-context.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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; |
