120
120
find_limits (lim1, lim2);
121
121
if (lim1 == point ()) return false;
122
122
frame f= find_frame ();
123
if (nil (f)) return false;
123
if (is_nil (f)) return false;
124
124
point p1= f (point (lim1[0], lim1[1]));
125
125
point p2= f (point (lim2[0], lim2[1]));
126
126
x1= (SI) p1[0]; y1= (SI) p1[1];
249
249
double x1, double y1, double x2, double y2)
251
251
frame f= find_frame ();
252
if (nil (f)) return tuple ();
252
if (is_nil (f)) return tuple ();
253
253
gr_selections sels;
254
254
point p1 = f (point (x1, y1)), p2= f (point (x2, y2));
255
255
sels= eb->graphical_select ((SI)p1[0], (SI)p1[1], (SI)p2[0], (SI)p2[1]);
297
297
edit_graphics_rep::invalidate_graphical_object () {
298
298
SI gx1, gy1, gx2, gy2;
299
if (find_graphical_region (gx1, gy1, gx2, gy2) && !nil (go_box)) {
299
if (find_graphical_region (gx1, gy1, gx2, gy2) && !is_nil (go_box)) {
302
302
rectangle gr (gx1, gy1, gx2, gy2);
313
edit_graphics_rep::draw_graphical_object (ps_device dev) {
314
if (nil (go_box)) set_graphical_object (graphical_object);
315
if (nil (go_box)) return;
313
edit_graphics_rep::draw_graphical_object (renderer ren) {
314
if (is_nil (go_box)) set_graphical_object (graphical_object);
315
if (is_nil (go_box)) return;
316
316
SI ox1, oy1, ox2, oy2;
317
dev->get_clipping (ox1, oy1, ox2, oy2);
317
ren->get_clipping (ox1, oy1, ox2, oy2);
318
318
SI gx1, gy1, gx2, gy2;
319
319
if (find_graphical_region (gx1, gy1, gx2, gy2))
320
dev->extra_clipping (gx1, gy1, gx2, gy2);
320
ren->extra_clipping (gx1, gy1, gx2, gy2);
322
322
for (i=0; i<go_box->subnr(); i++) {
323
323
box b= go_box->subbox (i);
324
324
if ((tree)b=="point" || (tree)b=="curve")
328
b->redraw (dev, path (), rs);
328
b->redraw (ren, path (), rs);
331
dev->set_clipping (ox1, oy1, ox2, oy2);
331
ren->set_clipping (ox1, oy1, ox2, oy2);
335
edit_graphics_rep::mouse_graphics (string type, SI x, SI y, time_t t) {
335
edit_graphics_rep::mouse_graphics (string type, SI x, SI y, int m, time_t t) {
337
337
// apply_changes (); // FIXME: remove after review of synchronization
338
338
frame f= find_frame ();
340
340
if (!over_graphics (x, y)) return false;
341
341
if (type == "move" || type == "dragging")
342
if (dis->check_event (MOTION_EVENT))
342
if (check_event (MOTION_EVENT))
344
344
point p = f [point (x, y)];
345
345
graphical_select (p[0], p[1]); // init the caching for adjust().
349
349
string sx= as_string (p[0]);
350
350
string sy= as_string (p[1]);
351
351
invalidate_graphical_object ();
352
if (type == "move" ) call ("graphics-move-point" , sx, sy);
353
if (type == "release-left" ) call ("graphics-insert-point" , sx, sy);
354
if (type == "release-middle" ) call ("graphics-remove-point" , sx, sy);
355
if (type == "release-right" ) call ("graphics-last-point" , sx, sy);
356
if (type == "start-drag" ) call ("graphics-start-drag" , sx, sy);
357
if (type == "dragging" ) call ("graphics-dragging" , sx, sy);
358
if (type == "end-drag" ) call ("graphics-end-drag" , sx, sy);
359
if (type == "start-right-drag") call ("graphics-start-right-drag", sx, sy);
360
if (type == "right-dragging" ) call ("graphics-right-dragging" , sx, sy);
361
if (type == "end-right-drag" ) call ("graphics-end-right-drag" , sx, sy);
352
call ("set-keyboard-modifiers", object (m));
354
call ("graphics-move-point", sx, sy);
355
else if (type == "release-left")
356
call ("graphics-insert-point", sx, sy);
357
else if (type == "release-middle")
358
call ("graphics-remove-point", sx, sy);
359
else if (type == "release-right")
360
call ("graphics-last-point", sx, sy);
361
else if (type == "start-drag")
362
call ("graphics-start-drag", sx, sy);
363
else if (type == "dragging")
364
call ("graphics-dragging", sx, sy);
365
else if (type == "end-drag")
366
call ("graphics-end-drag", sx, sy);
367
else if (type == "start-right-drag")
368
call ("graphics-start-right-drag", sx, sy);
369
else if (type == "right-dragging")
370
call ("graphics-right-dragging", sx, sy);
371
else if (type == "end-right-drag")
372
call ("graphics-end-right-drag", sx, sy);
362
373
invalidate_graphical_object ();
363
374
notify_change (THE_CURSOR);