Esempio n. 1
0
static gboolean
button_pressed(GtkButton *button, GdkEventButton *event, GtkWidget *widget)
{
    gint toolbar_type, button_type;

    switch (event->button) {
    case 3:
        toolbar_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
                                       OBJECT_DATA_TOOLBAR_TYPE));
        if (toolbar_type == TYPE_APPLET)
            gtk_propagate_event(gtk_widget_get_parent(GTK_WIDGET(button)),
                                (GdkEvent *)event);
        else
            right_button_pressed(button, event, widget);
        break;
    case 2:
        gtk_propagate_event(gtk_widget_get_parent(GTK_WIDGET(button)),
                            (GdkEvent *)event);
        break;
    case 1:
    default:
        button_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),
                                      OBJECT_DATA_BUTTON_TYPE));
        if (button_type == BUTTON_PROP)
            popup_prop_menu(button, event, widget);
        break;
    }

    return FALSE;
}
Esempio n. 2
0
static gboolean
egg_tree_multi_drag_button_release_event (GtkWidget      *widget,
					  GdkEventButton *event,
					  gpointer        data)
{
  EggTreeMultiDndData *priv_data;
  GSList *l;

  priv_data = g_object_get_data (G_OBJECT (widget), EGG_TREE_MULTI_DND_STRING);

  /* disconnect before sending all queued events to avoid a warning with
   * GtkFileChooserDialog and double click. */
  if (priv_data->motion_notify_handler) {
    g_signal_handler_disconnect (widget, priv_data->motion_notify_handler);
    priv_data->motion_notify_handler = 0;
  }
  if (priv_data->button_release_handler) {
    g_signal_handler_disconnect (widget, priv_data->button_release_handler);
    priv_data->button_release_handler = 0;
  }

  for (l = priv_data->event_list; l != NULL && gtk_widget_get_realized (widget); l = l->next)
    gtk_propagate_event (widget, l->data);

  stop_drag_check (widget);

  return FALSE;
}
Esempio n. 3
0
/* This is a hack around the fact that gtk+ doesn't
 * propogate button presses on button2/3.
 */
static gboolean
button_press_hack (GtkWidget      *widget,
		   GdkEventButton *event,
		   MCData         *mc)
{
    if (event->button == 3 || event->button == 2) {
	gtk_propagate_event (GTK_WIDGET (mc->applet), (GdkEvent *) event);
	return TRUE;
    }

    return FALSE;
}
Esempio n. 4
0
/* This is a hack around the fact that gtk+ doesn't
 * propogate button presses on button2/3.
 */
static gboolean
button_press_hack (GtkWidget      *widget,
		   GdkEventButton *event,
		   GtkWidget      *applet)
{
    if (event->button == 3 || event->button == 2) {
	gtk_propagate_event (applet, (GdkEvent *) event);

	return TRUE;
    }

    return FALSE;
}
Esempio n. 5
0
static gboolean
prop_button_released(GtkButton *button, GdkEventButton *event,
                     GtkWidget *widget)
{
    switch (event->button) {
    case 2:
    case 3:
        gtk_propagate_event(gtk_widget_get_parent(GTK_WIDGET(button)),
                            (GdkEvent *)event);
        break;
    default:
        break;
    }

    return FALSE;
}
Esempio n. 6
0
static gboolean
on_button_release_event( GtkWidget *widget, GdkEventButton *event, EggTreeMultiDragSource *drag_source )
{
	EggTreeMultiDndData *priv_data;
	GSList *l;

	priv_data = g_object_get_data( G_OBJECT( widget ), EGG_TREE_MULTI_DND_STRING );

	for( l = priv_data->event_list ; l != NULL ; l = l->next ){
		gtk_propagate_event( widget, l->data );
	}

	stop_drag_check( widget );

	return( FALSE );
}
Esempio n. 7
0
static gboolean
egg_tree_multi_drag_button_release_event (GtkWidget      *widget,
					  GdkEventButton *event,
					  gpointer        data)
{
  EggTreeMultiDndData *priv_data;
  GSList *l;

  priv_data = g_object_get_data (G_OBJECT (widget), EGG_TREE_MULTI_DND_STRING);

  for (l = priv_data->event_list; l != NULL; l = l->next)
    gtk_propagate_event (widget, l->data);

  stop_drag_check (widget);

  return FALSE;
}
static gboolean
rb_tree_dnd_button_release_event_cb (GtkWidget      *widget,
				   GdkEventButton *event,
				   gpointer        data)
{
	RbTreeDndData *priv_data;
	GSList *l;

	priv_data = g_object_get_data (G_OBJECT (widget), RB_TREE_DND_STRING);

	for (l = priv_data->event_list; l != NULL; l = l->next)
		gtk_propagate_event (widget, l->data);

	stop_drag_check (widget);

	return FALSE;
}
Esempio n. 9
0
/* handles the mouse moving in the drawing area
   only calls the appropriate tool function if the mouse button is down.
   always sets the cursor to the appropriate symbol */
static gint
motion_notify_event( GtkWidget *widget, GdkEventMotion *event )
{
  int x, y;
  GdkModifierType state;
  static char label_buffer[255];
  static carmen_map_point_t map_point;
  static carmen_world_point_t world_point;


  gtk_propagate_event(GTK_WIDGET(vrule), (GdkEvent *)event);
  gtk_propagate_event(GTK_WIDGET(hrule), (GdkEvent *)event);

  map_to_tmp();

  if (event->is_hint)
    gdk_window_get_pointer (event->window, &x, &y, &state);
  else
    {
      x = event->x;
      y = event->y;
      state = event->state;
    }

  map_point.x = pix_x_to_map(x);
  map_point.y = pix_y_to_map(y);
  map_point.map = map;
  carmen_map_to_world(&map_point, &world_point);
  sprintf(label_buffer, "X: %6.2f Y: %6.2f", world_point.pose.x,
	  world_point.pose.y);
  gtk_label_set_text(GTK_LABEL(coords_label), label_buffer);

  if (tmp_pixmap == NULL)
    return TRUE;

  if (deleting_placename)
    {
      handle_deleting_placename_move(map_point.x, map_point.y);
    }
  else if ((state & GDK_BUTTON1_MASK))
    {
      switch(utensil)
	{
	case CARMEN_MAP_BRUSH:
	  draw_brush (widget, x, y);
	  x = x/mult - brush_size + .5;
	  y = y/mult - brush_size + .5;
	  break;
	case CARMEN_MAP_RECTANGLE:
	  creating_rectangle(widget, 1, x, y);
	  break;
	case CARMEN_MAP_CROP:
	  cropping(widget, 1, x, y);
	  break;
	case CARMEN_MAP_LINE:
	  creating_line(1, x, y);
	  break;
	case CARMEN_MAP_EYEDROPPER:
	  sample(x, y);
	  break;
	case CARMEN_MAP_MOVER:
	  move(1, x, y);
	default:
	  break;
	}
    }

  redraw();

  return TRUE;
}
Esempio n. 10
0
static VALUE
rg_s_propagate_event(G_GNUC_UNUSED VALUE self, VALUE widget, VALUE event)
{
    gtk_propagate_event(RVAL2GTKWIDGET(widget), RVAL2GEV(event));
    return Qnil;
}