index d3fb332e51dad80d35102638a7dc6459369c0ff3..438258cb3dd2810feb20e23022153ce8668583e4 100644 (file)
--- a/src/lpe-tool-context.cpp
+++ b/src/lpe-tool-context.cpp
#include "macros.h"
#include "forward.h"
-#include "pixmaps/cursor-node.xpm"
#include "pixmaps/cursor-crosshairs.xpm"
#include <gtk/gtk.h>
#include "desktop.h"
@@ -54,15 +53,16 @@ void sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpoint
const int num_subtools = 8;
-Inkscape::LivePathEffect::EffectType lpesubtools[] = {
- Inkscape::LivePathEffect::INVALID_LPE, // this must be here to account for the "all inactive" action
- Inkscape::LivePathEffect::LINE_SEGMENT,
- Inkscape::LivePathEffect::CIRCLE_3PTS,
- Inkscape::LivePathEffect::CIRCLE_WITH_RADIUS,
- Inkscape::LivePathEffect::PARALLEL,
- Inkscape::LivePathEffect::PERP_BISECTOR,
- Inkscape::LivePathEffect::ANGLE_BISECTOR,
- Inkscape::LivePathEffect::MIRROR_SYMMETRY,
+SubtoolEntry lpesubtools[] = {
+ // this must be here to account for the "all inactive" action
+ {Inkscape::LivePathEffect::INVALID_LPE, "draw-geometry-inactive"},
+ {Inkscape::LivePathEffect::LINE_SEGMENT, "draw-geometry-line-segment"},
+ {Inkscape::LivePathEffect::CIRCLE_3PTS, "draw-geometry-circle-from-three-points"},
+ {Inkscape::LivePathEffect::CIRCLE_WITH_RADIUS, "draw-geometry-circle-from-radius"},
+ {Inkscape::LivePathEffect::PARALLEL, "draw-geometry-line-parallel"},
+ {Inkscape::LivePathEffect::PERP_BISECTOR, "draw-geometry-line-perpendicular"},
+ {Inkscape::LivePathEffect::ANGLE_BISECTOR, "draw-geometry-angle-bisector"},
+ {Inkscape::LivePathEffect::MIRROR_SYMMETRY, "draw-geometry-mirror"}
};
static SPPenContextClass *lpetool_parent_class = 0;
}
lc->_lpetool_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack());
-
-
- lc->shape_editor->update_statusbar();
}
/**
@@ -192,13 +189,9 @@ sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer da
{
SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(data);
- // TODO: update ShapeEditorsCollective instead
- lc->shape_editor->unset_item(SH_NODEPATH);
lc->shape_editor->unset_item(SH_KNOTHOLDER);
SPItem *item = selection->singleItem();
- lc->shape_editor->set_item(item, SH_NODEPATH);
lc->shape_editor->set_item(item, SH_KNOTHOLDER);
- lc->shape_editor->update_statusbar();
}
static void
@@ -279,13 +272,12 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
event_context->xp = (gint) event->button.x;
event_context->yp = (gint) event->button.y;
event_context->within_tolerance = true;
- lc->shape_editor->cancel_hit();
using namespace Inkscape::LivePathEffect;
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int mode = prefs->getInt("/tools/lpetool/mode");
- EffectType type = lpesubtools[mode];
+ EffectType type = lpesubtools[mode].type;
//bool over_stroke = lc->shape_editor->is_over_stroke(Geom::Point(event->button.x, event->button.y), true);
@@ -295,28 +287,6 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
ret = ((SPEventContextClass *) lpetool_parent_class)->root_handler(event_context, event);
}
break;
- case GDK_MOTION_NOTIFY:
- {
- if (!lc->shape_editor->has_nodepath() || selection->singleItem() == NULL) {
- break;
- }
-
- bool over_stroke = false;
- over_stroke = lc->shape_editor->is_over_stroke(Geom::Point(event->motion.x, event->motion.y), false);
-
- if (over_stroke) {
- event_context->cursor_shape = cursor_node_xpm;
- event_context->hot_x = 1;
- event_context->hot_y = 1;
- sp_event_context_update_cursor(event_context);
- } else {
- lc->cursor_shape = cursor_crosshairs_xpm;
- lc->hot_x = 7;
- lc->hot_y = 7;
- sp_event_context_update_cursor(event_context);
- }
- }
- break;
case GDK_BUTTON_RELEASE:
int
lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type) {
for (int i = 0; i < num_subtools; ++i) {
- if (lpesubtools[i] == type) {
+ if (lpesubtools[i].type == type) {
return i;
}
}