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/pen-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/pen-context.cpp')
| -rw-r--r-- | src/pen-context.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp index 180152642..7e85b46af 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -80,6 +80,21 @@ static void pen_set_to_nearest_horiz_vert(const SPPenContext *const pc, Geom::Po static int pen_last_paraxial_dir = 0; // last used direction in horizontal/vertical mode; 0 = horizontal, 1 = vertical + +#include "sp-factory.h" + +namespace { + SPEventContext* createPenContext() { + return new SPPenContext(); + } + + bool penContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pen", createPenContext); +} + +const std::string& CPenContext::getPrefsPath() { + return SPPenContext::prefsPath; +} + const std::string SPPenContext::prefsPath = "/tools/freehand/pen"; G_DEFINE_TYPE(SPPenContext, sp_pen_context, SP_TYPE_DRAW_CONTEXT); @@ -115,6 +130,7 @@ SPPenContext::SPPenContext() : SPDrawContext() { delete pc->cdrawcontext; pc->cdrawcontext = pc->cpencontext; pc->ceventcontext = pc->cpencontext; + types.insert(typeid(SPPenContext)); pc->polylines_only = false; pc->polylines_paraxial = false; |
