Commit 462648d9 authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte
Browse files

Added glade_widget_get_device_from_event()

parent 4f60cf6a
......@@ -4000,6 +4000,30 @@ glade_widget_is_ancestor (GladeWidget * widget, GladeWidget * ancestor)
return FALSE;
}
/**
* glade_widget_get_device_from_event:
* @event: a GdkEvent
*
* Currently only motion and button events are handled (see IS_GLADE_WIDGET_EVENT)
*
* Returns: the asociated GdkDevice for this glade widget event.
*/
GdkDevice *
glade_widget_get_device_from_event (GdkEvent *event)
{
g_return_val_if_fail (event, NULL);
switch (event->type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
return event->button.device;
case GDK_MOTION_NOTIFY:
return event->motion.device;
default:
return NULL;
}
}
static gint glade_widget_su_stack = 0;
......
......@@ -216,6 +216,8 @@ gchar *glade_widget_generate_path_name (GladeWidget *w
gboolean glade_widget_is_ancestor (GladeWidget *widget,
GladeWidget *ancestor);
GdkDevice *glade_widget_get_device_from_event (GdkEvent *event);
/*******************************************************************************
Project, object property references
*******************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment