gint
ghid_port_window_motion_cb (GtkWidget * widget,
			    GdkEventMotion * ev, GHidPort * out)
{
  gdouble dx, dy;
  static gint x_prev = -1, y_prev = -1;

  gdk_event_request_motions (ev);

  if (out->panning)
    {
      dx = gport->view.coord_per_px * (x_prev - ev->x);
      dy = gport->view.coord_per_px * (y_prev - ev->y);
      if (x_prev > 0)
        ghid_pan_view_rel (dx, dy);
      x_prev = ev->x;
      y_prev = ev->y;
      return FALSE;
    }
  x_prev = y_prev = -1;
  ghid_note_event_location ((GdkEventButton *)ev);

  queue_tooltip_update (out);

  return FALSE;
}
Beispiel #2
0
gint
ghid_port_window_motion_cb (GtkWidget * widget,
			    GdkEventButton * ev, GHidPort * out)
{
  gdouble dx, dy;
  static gint x_prev = -1, y_prev = -1;
  gboolean moved;

  if (out->panning)
    {
      if (gtk_events_pending ())
	return FALSE;
      dx = gport->zoom * (x_prev - ev->x);
      dy = gport->zoom * (y_prev - ev->y);
      if (x_prev > 0)
	ghid_port_ranges_pan (dx, dy, TRUE);
      x_prev = ev->x;
      y_prev = ev->y;
      return FALSE;
    }
  x_prev = y_prev = -1;
  moved = ghid_note_event_location (ev);

#if ENABLE_TOOLTIPS
  queue_tooltip_update (out);
#endif

  ghid_show_crosshair (TRUE);
  if (moved && have_crosshair_attachments ())
    ghid_draw_area_update (gport, NULL);
  return FALSE;
}