~ubuntu-branches/ubuntu/precise/inkscape/precise-updates

« back to all changes in this revision

Viewing changes to src/select-context.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    event_context_class->set = sp_select_context_set;
99
99
    event_context_class->root_handler = sp_select_context_root_handler;
100
100
    event_context_class->item_handler = sp_select_context_item_handler;
 
101
}
 
102
 
 
103
static void
 
104
sp_select_context_init(SPSelectContext *sc)
 
105
{
 
106
    sc->dragging = FALSE;
 
107
    sc->moved = FALSE;
 
108
    sc->button_press_shift = false;
 
109
    sc->button_press_ctrl = false;
 
110
    sc->button_press_alt = false;
 
111
    sc->_seltrans = NULL;
 
112
    sc->_describer = NULL;
101
113
 
102
114
    // cursors in select context
103
115
    CursorSelectMouseover = sp_cursor_new_from_xpm(cursor_select_m_xpm , 1, 1);
116
128
    handles[10] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_sw_xpm);
117
129
    handles[11] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_rotate_w_xpm);
118
130
    handles[12] = gdk_pixbuf_new_from_xpm_data((gchar const **)handle_center_xpm);
119
 
 
120
 
}
121
 
 
122
 
static void
123
 
sp_select_context_init(SPSelectContext *sc)
124
 
{
125
 
    sc->dragging = FALSE;
126
 
    sc->moved = FALSE;
127
 
    sc->button_press_shift = false;
128
 
    sc->button_press_ctrl = false;
129
 
    sc->button_press_alt = false;
130
 
    sc->_seltrans = NULL;
131
 
    sc->_describer = NULL;
132
131
}
133
132
 
134
133
static void
172
171
 
173
172
    SPDesktop *desktop = ec->desktop;
174
173
 
175
 
    select_context->_describer = new Inkscape::SelectionDescriber(desktop->selection, desktop->messageStack());
 
174
    select_context->_describer = new Inkscape::SelectionDescriber(
 
175
                desktop->selection, 
 
176
                desktop->messageStack(),
 
177
                _("Click selection to toggle scale/rotation handles"),
 
178
                _("No objects selected. Click, Shift+click, or drag around objects to select.")
 
179
        );
176
180
 
177
181
    select_context->_seltrans = new Inkscape::SelTrans(desktop);
178
182
 
326
330
                    sc->dragging = TRUE;
327
331
                    sc->moved = FALSE;
328
332
 
 
333
                    gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectDragging);
 
334
 
329
335
                    sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
330
336
 
331
337
                    // remember the clicked item in sc->item:
361
367
 
362
368
        case GDK_ENTER_NOTIFY:
363
369
        {
364
 
            if (!desktop->isWaitingCursor()) {
365
 
                GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR);
366
 
                gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, cursor);
367
 
                gdk_cursor_destroy(cursor);
 
370
            if (!desktop->isWaitingCursor() && !sc->dragging) {
 
371
                gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectMouseover);
368
372
            }
369
373
            break;
370
374
        }
371
375
 
372
376
        case GDK_LEAVE_NOTIFY:
373
 
            if (!desktop->isWaitingCursor())
 
377
            if (!desktop->isWaitingCursor() && !sc->dragging)
374
378
                gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
375
379
            break;
376
380
 
494
498
                if (sc->button_press_ctrl || (sc->button_press_alt && !sc->button_press_shift && !selection->isEmpty())) {
495
499
                    // if it's not click and ctrl or alt was pressed (the latter with some selection
496
500
                    // but not with shift) we want to drag rather than rubberband
497
 
                        sc->dragging = TRUE;
 
501
                        sc->dragging = TRUE;
 
502
                    gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectDragging);
498
503
 
499
504
                    sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 5);
500
505
                }
594
599
                        }
595
600
                    }
596
601
                    sc->dragging = FALSE;
 
602
                    gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectMouseover);
597
603
                    sp_event_context_discard_delayed_snap_event(event_context);
598
604
                    sp_canvas_end_forced_full_redraws(desktop->canvas);
599
605
 
602
608
                    }
603
609
                    sc->item = NULL;
604
610
                } else {
605
 
                    Inkscape::Rubberband::Rubberband *r = Inkscape::Rubberband::get(desktop);
 
611
                    Inkscape::Rubberband *r = Inkscape::Rubberband::get(desktop);
606
612
                    if (r->is_started() && !within_tolerance) {
607
613
                        // this was a rubberband drag
608
614
                        GSList *items = NULL;
723
729
                                                _("<b>Alt</b>: click to select under; drag to move selected or select by touch"));
724
730
                    // if Alt and nonempty selection, show moving cursor ("move selected"):
725
731
                    if (alt && !selection->isEmpty() && !desktop->isWaitingCursor()) {
726
 
                        GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR);
727
 
                        gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, cursor);
728
 
                        gdk_cursor_destroy(cursor);
 
732
                        gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, CursorSelectDragging);
729
733
                    }
730
734
                    //*/
731
735
                    break;