From 09ce234c1fc367a2607936e6cf106cb24c60e94f Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Wed, 3 Jul 2013 20:06:11 +0100 Subject: Modified dbus interface so that it works in console mode (--dbus-listen) Modified action context setup so that in console mode, when a document is added to the main inkscape app instance, it gets a selection model and layer model automatically set up for it Made a couple more verbs work in console mode (bzr r12387.1.4) --- src/select-context.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index 1dd3b08d7..3df047368 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -921,12 +921,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, mul*-10, 0); // shift - else sp_selection_move_screen(desktop, mul*-1, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), mul*-10, 0); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), mul*-1, 0); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, mul*-10*nudge, 0); // shift - else sp_selection_move(desktop, mul*-nudge, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), mul*-10*nudge, 0); // shift + else sp_selection_move(sp_desktop_selection(desktop), mul*-nudge, 0); // no shift } ret = TRUE; } @@ -937,12 +937,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, 0, mul*10); // shift - else sp_selection_move_screen(desktop, 0, mul*1); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*10); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*1); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, 0, mul*10*nudge); // shift - else sp_selection_move(desktop, 0, mul*nudge); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), 0, mul*10*nudge); // shift + else sp_selection_move(sp_desktop_selection(desktop), 0, mul*nudge); // no shift } ret = TRUE; } @@ -953,12 +953,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, mul*10, 0); // shift - else sp_selection_move_screen(desktop, mul*1, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), mul*10, 0); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), mul*1, 0); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, mul*10*nudge, 0); // shift - else sp_selection_move(desktop, mul*nudge, 0); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), mul*10*nudge, 0); // shift + else sp_selection_move(sp_desktop_selection(desktop), mul*nudge, 0); // no shift } ret = TRUE; } @@ -969,12 +969,12 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event) gint mul = 1 + gobble_key_events( get_group0_keyval(&event->key), 0); // with any mask if (MOD__ALT(event)) { // alt - if (MOD__SHIFT(event)) sp_selection_move_screen(desktop, 0, mul*-10); // shift - else sp_selection_move_screen(desktop, 0, mul*-1); // no shift + if (MOD__SHIFT(event)) sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*-10); // shift + else sp_selection_move_screen(sp_desktop_selection(desktop), 0, mul*-1); // no shift } else { // no alt - if (MOD__SHIFT(event)) sp_selection_move(desktop, 0, mul*-10*nudge); // shift - else sp_selection_move(desktop, 0, mul*-nudge); // no shift + if (MOD__SHIFT(event)) sp_selection_move(sp_desktop_selection(desktop), 0, mul*-10*nudge); // shift + else sp_selection_move(sp_desktop_selection(desktop), 0, mul*-nudge); // no shift } ret = TRUE; } -- cgit v1.2.3 From 6c31882fb2319fcbfbc3e17ac368deac2edd2e79 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Thu, 4 Jul 2013 18:58:42 -0400 Subject: Improve handle xpm loading using rotate (bzr r12401.1.1) --- src/select-context.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/select-context.cpp') diff --git a/src/select-context.cpp b/src/select-context.cpp index 1dd3b08d7..6c130ec96 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -62,7 +62,7 @@ static void sp_select_context_reset_opacities(SPEventContext *event_context); static GdkCursor *CursorSelectMouseover = NULL; static GdkCursor *CursorSelectDragging = NULL; -GdkPixbuf *handles[13]; +GdkPixbuf *handles[18]; static gint rb_escaped = 0; // if non-zero, rubberband was canceled by esc, so the next button release should not deselect static gint drag_escaped = 0; // if non-zero, drag was canceled by esc @@ -91,6 +91,16 @@ sp_select_context_class_init(SPSelectContextClass *klass) event_context_class->item_handler = sp_select_context_item_handler; } +//Creates rotated variations for handles +static void +sp_load_handles(int start, int count, char const **xpm) { + handles[start] = gdk_pixbuf_new_from_xpm_data((gchar const **)xpm); + for(int i = start + 1; i < start + count; i++) { + // We use either the original at *start or previous loop item to rotate + handles[i] = gdk_pixbuf_rotate_simple(handles[i-1], GDK_PIXBUF_ROTATE_CLOCKWISE); + } +} + static void sp_select_context_init(SPSelectContext *sc) { @@ -111,19 +121,11 @@ sp_select_context_init(SPSelectContext *sc) CursorSelectMouseover = sp_cursor_new_from_xpm(cursor_select_m_xpm , 1, 1); CursorSelectDragging = sp_cursor_new_from_xpm(cursor_select_d_xpm , 1, 1); // selection handles - handles[0] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_nw_xpm); - handles[1] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_ne_xpm); - handles[2] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_h_xpm); - handles[3] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_scale_v_xpm); - handles[4] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_nw_xpm); - handles[5] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_n_xpm); - handles[6] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_ne_xpm); - handles[7] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_e_xpm); - handles[8] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_se_xpm); - handles[9] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_s_xpm); - handles[10] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_sw_xpm); - handles[11] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_w_xpm); - handles[12] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_center_xpm); + sp_load_handles(0, 2, handle_scale_xpm); + sp_load_handles(2, 2, handle_stretch_xpm); + sp_load_handles(4, 4, handle_rotate_xpm); + sp_load_handles(8, 4, handle_skew_xpm); + sp_load_handles(12, 1, handle_center_xpm); } static void -- cgit v1.2.3 From c09c9da090325f4f639843510635b1d8f6b39494 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 5 Jul 2013 08:21:03 -0400 Subject: Adjust sizes of lists (bzr r12401.1.2) --- 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 6c130ec96..27667d639 100644 --- a/src/select-context.cpp +++ b/src/select-context.cpp @@ -62,7 +62,7 @@ static void sp_select_context_reset_opacities(SPEventContext *event_context); static GdkCursor *CursorSelectMouseover = NULL; static GdkCursor *CursorSelectDragging = NULL; -GdkPixbuf *handles[18]; +GdkPixbuf *handles[13]; static gint rb_escaped = 0; // if non-zero, rubberband was canceled by esc, so the next button release should not deselect static gint drag_escaped = 0; // if non-zero, drag was canceled by esc -- cgit v1.2.3