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/eraser-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/eraser-context.cpp')
| -rw-r--r-- | src/eraser-context.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index 00fb41004..cf6d8021d 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -101,6 +101,20 @@ static Geom::Point sp_eraser_get_npoint(SPEraserContext const *erc, Geom::Point static Geom::Point sp_eraser_get_vpoint(SPEraserContext const *erc, Geom::Point n); static void draw_temporary_box(SPEraserContext *dc); +#include "sp-factory.h" + +namespace { + SPEventContext* createEraserContext() { + return new SPEraserContext(); + } + + bool eraserContextRegistered = ToolFactory::instance().registerObject("/tools/eraser", createEraserContext); +} + +const std::string& CEraserContext::getPrefsPath() { + return SPEraserContext::prefsPath; +} + const std::string SPEraserContext::prefsPath = "/tools/eraser"; G_DEFINE_TYPE(SPEraserContext, sp_eraser_context, SP_TYPE_COMMON_CONTEXT); @@ -129,6 +143,7 @@ SPEraserContext::SPEraserContext() : SPCommonContext() { delete erc->ccommoncontext; erc->ccommoncontext = erc->cerasercontext; erc->ceventcontext = erc->cerasercontext; + types.insert(typeid(SPEraserContext)); erc->cursor_shape = cursor_eraser_xpm; erc->hot_x = 4; |
