Add a function to get the event type

This is useful for language bindings, who can't easily
access the struct field directly.

https://bugzilla.gnome.org/show_bug.cgi?id=700029
This commit is contained in:
Matthias Clasen 2013-08-13 19:06:48 -04:00
parent 35a4bba902
commit 7d48c3b2c7
3 changed files with 24 additions and 2 deletions

View File

@ -808,6 +808,7 @@ gdk_event_get_scroll_direction
gdk_event_get_scroll_deltas
gdk_event_get_state
gdk_event_get_time
gdk_event_get_type
GdkEventSequence
gdk_event_get_event_sequence
gdk_event_request_motions

View File

@ -2184,3 +2184,21 @@ gdk_setting_get (const gchar *name,
{
return gdk_screen_get_setting (gdk_screen_get_default (), name, value);
}
/**
* gdk_event_get_event_type:
* @event: a #GdkEvent
*
* Retrieves the type of the event.
*
* Return value: a #GdkEventType
*
* Since: 3.10
*/
GdkEventType
gdk_event_get_event_type (const GdkEvent *event)
{
g_return_val_if_fail (event != NULL, GDK_NOTHING);
return event->type;
}

View File

@ -1289,6 +1289,9 @@ GdkScreen *gdk_event_get_screen (const GdkEvent *event);
GDK_AVAILABLE_IN_3_4
GdkEventSequence *gdk_event_get_event_sequence (const GdkEvent *event);
GDK_AVAILABLE_IN_3_10
GdkEventType gdk_event_get_event_type (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_set_show_events (gboolean show_events);
GDK_AVAILABLE_IN_ALL
@ -1297,8 +1300,8 @@ gboolean gdk_get_show_events (void);
#ifndef GDK_MULTIHEAD_SAFE
GDK_AVAILABLE_IN_ALL
gboolean gdk_setting_get (const gchar *name,
GValue *value);
gboolean gdk_setting_get (const gchar *name,
GValue *value);
#endif /* GDK_MULTIHEAD_SAFE */