From 70829da1b189d6d8f07f12d97b9273d56dbd789e Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 17 Apr 2011 14:51:06 +0200 Subject: add new preference widget for a number with a unit. change Preferences > Steps to this new widget (bzr r10177) --- src/select-context.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index e6d78975b..640aae9ee 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -867,8 +867,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) } } - gdouble const nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000); // in px - gdouble const offset = prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000); + gdouble const nudge = prefs->getDoubleLimited("/options/nudgedistance/value", 2, 0, 1000, "px"); // in px + gdouble const offset = prefs->getDoubleLimited("/options/defaultscale/value", 2, 0, 1000, "px"); int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12); switch (get_group0_keyval (&event->key)) { -- cgit v1.2.3 From 4d8bf28dbebbc70325c75c0501ed192ae330c63b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Fri, 24 Jun 2011 11:23:41 +0100 Subject: Switch to GObject (bzr r10350.1.3) --- src/select-context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index 640aae9ee..143fb1ae2 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -69,7 +69,7 @@ static gint xp = 0, yp = 0; // where drag started static gint tolerance = 0; static bool within_tolerance = false; -GtkType +GType sp_select_context_get_type(void) { static GType type = 0; -- cgit v1.2.3 From 4dd33aa4d5c57706c7f64f63391174954160a308 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 6 Aug 2011 14:18:32 +0200 Subject: Rewrite NRArenaItem hierarchy into C++ (bzr r10347.1.21) --- src/select-context.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index 143fb1ae2..b3e38bf7b 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -43,7 +43,7 @@ #include "seltrans.h" #include "box3d.h" #include "display/sp-canvas.h" -#include "display/nr-arena-item.h" +#include "display/drawing-item.h" using Inkscape::DocumentUndo; @@ -414,7 +414,7 @@ sp_select_context_cycle_through_items(SPSelectContext *sc, Inkscape::Selection * if (!sc->cycling_cur_item) return; - NRArenaItem *arenaitem; + Inkscape::DrawingItem *arenaitem; SPDesktop *desktop = SP_EVENT_CONTEXT(sc)->desktop; SPItem *item = SP_ITEM(sc->cycling_cur_item->data); @@ -422,7 +422,7 @@ sp_select_context_cycle_through_items(SPSelectContext *sc, Inkscape::Selection * if (!g_list_find(sc->cycling_items_selected_before, item) && selection->includes(item)) selection->remove(item); arenaitem = item->get_arenaitem(desktop->dkey); - nr_arena_item_set_opacity (arenaitem, 0.3); + arenaitem->setOpacity(0.3); // Find next item and activate it GList *next; @@ -438,7 +438,7 @@ sp_select_context_cycle_through_items(SPSelectContext *sc, Inkscape::Selection * sc->cycling_cur_item = next; item = SP_ITEM(sc->cycling_cur_item->data); arenaitem = item->get_arenaitem(desktop->dkey); - nr_arena_item_set_opacity (arenaitem, 1.0); + arenaitem->setOpacity(1.0); if (shift_pressed) selection->add(item); @@ -788,10 +788,10 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) g_assert(sc->cycling_cur_item != NULL || sc->cycling_items == NULL); } else { // ... otherwise reset opacities for outdated items ... - NRArenaItem *arenaitem; + Inkscape::DrawingItem *arenaitem; for(GList *l = sc->cycling_items_cmp; l != NULL; l = l->next) { arenaitem = SP_ITEM(l->data)->get_arenaitem(desktop->dkey); - nr_arena_item_set_opacity (arenaitem, 1.0); + arenaitem->setOpacity(1.0); //if (!shift_pressed && !g_list_find(sc->cycling_items_selected_before, SP_ITEM(l->data)) && selection->includes(SP_ITEM(l->data))) if (!g_list_find(sc->cycling_items_selected_before, SP_ITEM(l->data)) && selection->includes(SP_ITEM(l->data))) selection->remove(SP_ITEM(l->data)); @@ -810,7 +810,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) for(GList *l = sc->cycling_items; l != NULL; l = l->next) { item = SP_ITEM(l->data); arenaitem = item->get_arenaitem(desktop->dkey); - nr_arena_item_set_opacity (arenaitem, 0.3); + arenaitem->setOpacity(0.3); if (selection->includes(item)) { // already selected items are stored separately, too sc->cycling_items_selected_before = g_list_append(sc->cycling_items_selected_before, item); @@ -1085,10 +1085,10 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) if (alt) { // TODO: Should we have a variable like is_cycling or is it harmless to run this piece of code each time? // quit cycle-selection and reset opacities SPSelectContext *sc = SP_SELECT_CONTEXT(event_context); - NRArenaItem *arenaitem; + Inkscape::DrawingItem *arenaitem; for (GList *l = sc->cycling_items; l != NULL; l = g_list_next(l)) { arenaitem = SP_ITEM(l->data)->get_arenaitem(desktop->dkey); - nr_arena_item_set_opacity (arenaitem, 1.0); + arenaitem->setOpacity(1.0); } g_list_free(sc->cycling_items); g_list_free(sc->cycling_items_selected_before); -- cgit v1.2.3 From cf0c689f665675b976215e80ec7c9acf1b2e49e6 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 21 Aug 2011 09:42:08 +0200 Subject: DBUS. Merging lp:~joakim-verona/inkscape/dbus-fixes changes. (bzr r10559) --- src/select-context.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index 143fb1ae2..1ce3ccd25 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -33,6 +33,9 @@ #include "select-context.h" #include "selection-chemistry.h" +#ifdef WITH_DBUS +#include "extension/dbus/document-interface.h" +#endif #include "desktop.h" #include "desktop-handles.h" #include "sp-root.h" @@ -47,6 +50,7 @@ using Inkscape::DocumentUndo; + static void sp_select_context_class_init(SPSelectContextClass *klass); static void sp_select_context_init(SPSelectContext *select_context); static void sp_select_context_dispose(GObject *object); @@ -622,6 +626,10 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) // item has been moved seltrans->ungrab(); sc->moved = FALSE; +#ifdef WITH_DBUS + g_print("moved!\n");//JAVE + dbus_send_ping(desktop, sc->item); +#endif } else if (sc->item && !drag_escaped) { // item has not been moved -> simply a click, do selecting if (!selection->isEmpty()) { -- cgit v1.2.3 From c3dc05e9ba3ce3199bc839304626f3914fc81a69 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Mon, 19 Sep 2011 14:50:42 -0300 Subject: removing useless messages to stdout. (bzr r10640) --- src/select-context.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index ca0ed2438..99ad35124 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -627,7 +627,6 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) seltrans->ungrab(); sc->moved = FALSE; #ifdef WITH_DBUS - g_print("moved!\n");//JAVE dbus_send_ping(desktop, sc->item); #endif } else if (sc->item && !drag_escaped) { -- cgit v1.2.3 From 224a99dc216119d34eb3ed13d12f123158acfe3c Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 4 Nov 2011 22:30:19 +0100 Subject: 1) Cycle to the next-closest-snap-source when pressing tab, if the snap-closest-point-only-option has been activated. Works for the selector tool, but also when scaling/stretching/skewing a selection of nodes in the node tool 2) Cleanup and simplification of the code that finds the closest snapsource (bzr r10720) --- src/select-context.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index 99ad35124..3803b7d07 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -398,6 +398,16 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE seltrans->stamp(); ret = TRUE; } + } else if (get_group0_keyval (&event->key) == GDK_Tab) { + if (sc->dragging && sc->grabbed) { + seltrans->getNextClosestPoint(false); + ret = TRUE; + } + } else if (get_group0_keyval (&event->key) == GDK_ISO_Left_Tab) { + if (sc->dragging && sc->grabbed) { + seltrans->getNextClosestPoint(true); + ret = TRUE; + } } break; @@ -531,8 +541,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) case GDK_MOTION_NOTIFY: { - tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); - if (event->motion.state & GDK_BUTTON1_MASK && !event_context->space_panning) { + tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); + if ((event->motion.state & GDK_BUTTON1_MASK) && !event_context->space_panning) { Geom::Point const motion_pt(event->motion.x, event->motion.y); Geom::Point const p(desktop->w2d(motion_pt)); @@ -549,7 +559,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) if (sc->button_press_ctrl || (sc->button_press_alt && !sc->button_press_shift && !selection->isEmpty())) { // if it's not click and ctrl or alt was pressed (the latter with some selection // but not with shift) we want to drag rather than rubberband - sc->dragging = TRUE; + sc->dragging = TRUE; gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectDragging); sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5); -- cgit v1.2.3