diff --git a/src/node-context.cpp b/src/node-context.cpp
index 96b562a3fb2e46b70a001d164454b60dafa497fb..9ff7257cef1646c91c8226a69cf1e7f8858c5a49 100644 (file)
--- a/src/node-context.cpp
+++ b/src/node-context.cpp
#include "message-context.h"
#include "node-context.h"
#include "pixmaps/cursor-node-d.xpm"
-#include "prefs-utils.h"
+#include "preferences.h"
#include "xml/node-event-vector.h"
#include "style.h"
#include "splivarot.h"
nc->shape_editor->set_item(item, SH_KNOTHOLDER);
}
- if (prefs_get_int_attribute("tools.nodes", "selcue", 0) != 0) {
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ if (prefs->getBool("/tools/nodes/selcue")) {
ec->enableSelectionCue();
}
-
- if (prefs_get_int_attribute("tools.nodes", "gradientdrag", 0) != 0) {
+ if (prefs->getBool("/tools/nodes/gradientdrag")) {
ec->enableGrDrag();
}
static void
sp_node_context_flash_path(SPEventContext *event_context, SPItem *item, guint timeout) {
- g_print ("-----> sp_node_context_flash_path(): TODO: generate the helper path!!\n");
SPNodeContext *nc = SP_NODE_CONTEXT(event_context);
nc->remove_flash_counter = 3; // for some reason root_handler is called twice after each item_handler...
@@ -190,8 +189,14 @@ sp_node_context_flash_path(SPEventContext *event_context, SPItem *item, guint ti
nc->flash_tempitem = NULL;
}
+ SPCanvasItem *canvasitem = NULL;
if (SP_IS_PATH(item)) {
- SPCanvasItem *canvasitem = sp_nodepath_helperpath_from_path(desktop, SP_PATH(item));
+ canvasitem = sp_nodepath_helperpath_from_path(desktop, SP_PATH(item));
+ } else {
+ g_print ("-----> sp_node_context_flash_path(): TODO: generate the helper path!!\n");
+ }
+
+ if (canvasitem) {
nc->flash_tempitem = desktop->add_temporary_canvasitem (canvasitem, timeout);
}
}
sp_node_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event)
{
gint ret = FALSE;
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- if (prefs_get_int_attribute ("tools.nodes", "pathflash_enabled", 0) == 1) {
- guint timeout = prefs_get_int_attribute("tools.nodes", "pathflash_timeout", 500);
+ if (prefs->getBool("/tools/nodes/pathflash_enabled")) {
+ guint timeout = prefs->getInt("/tools/nodes/pathflash_timeout", 500);
if (SP_IS_LPE_ITEM(item)) {
Inkscape::LivePathEffect::Effect *lpe = sp_lpe_item_get_current_lpe(SP_LPE_ITEM(item));
if (lpe && (lpe->providesOwnFlashPaths() ||
{
SPDesktop *desktop = event_context->desktop;
Inkscape::Selection *selection = sp_desktop_selection (desktop);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
SPNodeContext *nc = SP_NODE_CONTEXT(event_context);
- double const nudge = prefs_get_double_attribute_limited("options.nudgedistance", "value", 2, 0, 1000); // in px
- event_context->tolerance = prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100); // read every time, to make prefs changes really live
- int const snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12);
- double const offset = prefs_get_double_attribute_limited("options.defaultscale", "value", 2, 0, 1000);
+ double const nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000); // in px
+ event_context->tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); // read every time, to make prefs changes really live
+ int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12);
+ double const offset = prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000);
if ( (nc->flash_tempitem) && (nc->remove_flash_counter <= 0) ) {
desktop->remove_temporary_canvasitem(nc->flash_tempitem);
NR::Point const button_w(event->button.x,
event->button.y);
NR::Point const button_dt(desktop->w2d(button_w));
- Inkscape::Rubberband::get()->start(desktop, button_dt);
+ Inkscape::Rubberband::get(desktop)->start(desktop, button_dt);
nc->current_state = SP_NODE_CONTEXT_INACTIVE;
desktop->updateNow();
ret = TRUE;
break;
}
case SP_NODE_CONTEXT_RUBBERBAND_DRAGGING:
- if (Inkscape::Rubberband::get()->is_started()) {
+ if (Inkscape::Rubberband::get(desktop)->is_started()) {
NR::Point const motion_w(event->motion.x,
event->motion.y);
NR::Point const motion_dt(desktop->w2d(motion_w));
- Inkscape::Rubberband::get()->move(motion_dt);
+ Inkscape::Rubberband::get(desktop)->move(motion_dt);
}
break;
}
selection->set(item_clicked);
desktop->updateNow();
}
- Inkscape::Rubberband::get()->stop();
+ Inkscape::Rubberband::get(desktop)->stop();
ret = TRUE;
break;
}
if (event->type == GDK_BUTTON_RELEASE) {
event_context->xp = event_context->yp = 0;
if (event->button.button == 1) {
- boost::optional<NR::Rect> b = Inkscape::Rubberband::get()->getRectangle();
+ boost::optional<Geom::Rect> b = Inkscape::Rubberband::get(desktop)->getRectangle();
if (nc->shape_editor->hits_curve() && !event_context->within_tolerance) { //drag curve
nc->shape_editor->finish_drag();
}
}
ret = TRUE;
- Inkscape::Rubberband::get()->stop();
+ Inkscape::Rubberband::get(desktop)->stop();
desktop->updateNow();
nc->rb_escaped = false;
nc->drag = FALSE;
ret = TRUE;
}
break;
+ case GDK_A:
+ case GDK_a:
+ if (MOD__SHIFT_ONLY) {
+ nc->shape_editor->set_node_type(Inkscape::NodePath::NODE_AUTO);
+ ret = TRUE;
+ }
+ break;
case GDK_Y:
case GDK_y:
if (MOD__SHIFT_ONLY) {
case GDK_r:
if (MOD__SHIFT_ONLY) {
// FIXME: add top panel button
- sp_selected_path_reverse();
+ sp_selected_path_reverse(desktop);
ret = TRUE;
}
break;
break;
case GDK_Escape:
{
- boost::optional<NR::Rect> const b = Inkscape::Rubberband::get()->getRectangle();
+ boost::optional<Geom::Rect> const b = Inkscape::Rubberband::get(desktop)->getRectangle();
if (b) {
- Inkscape::Rubberband::get()->stop();
+ Inkscape::Rubberband::get(desktop)->stop();
nc->current_state = SP_NODE_CONTEXT_INACTIVE;
nc->rb_escaped = true;
} else {