GdkEvent: Add GdkSeat getter and internal setter

https://bugzilla.gnome.org/show_bug.cgi?id=759309
This commit is contained in:
Carlos Garnacho 2015-11-26 19:53:09 +01:00
parent 6f4edc091b
commit da6d52711a
4 changed files with 43 additions and 0 deletions

View File

@ -864,6 +864,7 @@ gdk_events_get_angle
gdk_events_get_center
gdk_events_get_distance
gdk_event_triggers_context_menu
gdk_event_get_seat
<SUBSECTION>
gdk_event_handler_set

View File

@ -2314,3 +2314,38 @@ gdk_event_get_event_type (const GdkEvent *event)
return event->type;
}
/**
* gdk_event_get_seat:
* @event: a #GdkEvent
*
* Returns the #GdkSeat this event was generated for.
*
* Returns: (transfer none): The #GdkSeat of this event
*
* Since: 3.20
**/
GdkSeat *
gdk_event_get_seat (const GdkEvent *event)
{
const GdkEventPrivate *priv;
if (!gdk_event_is_allocated (event))
return NULL;
priv = (const GdkEventPrivate *) event;
return priv->seat;
}
void
gdk_event_set_seat (GdkEvent *event,
GdkSeat *seat)
{
GdkEventPrivate *priv;
if (gdk_event_is_allocated (event))
{
priv = (GdkEventPrivate *) event;
priv->seat = seat;
}
}

View File

@ -1427,6 +1427,9 @@ 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_3_20
GdkSeat *gdk_event_get_seat (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL
void gdk_set_show_events (gboolean show_events);
GDK_AVAILABLE_IN_ALL

View File

@ -185,6 +185,7 @@ struct _GdkEventPrivate
gpointer windowing_data;
GdkDevice *device;
GdkDevice *source_device;
GdkSeat *seat;
};
typedef struct _GdkWindowPaint GdkWindowPaint;
@ -390,6 +391,9 @@ void _gdk_event_set_pointer_emulated (GdkEvent *event,
gboolean emulated);
gboolean _gdk_event_get_pointer_emulated (GdkEvent *event);
void gdk_event_set_seat (GdkEvent *event,
GdkSeat *seat);
void _gdk_event_emit (GdkEvent *event);
GList* _gdk_event_queue_find_first (GdkDisplay *display);
void _gdk_event_queue_remove_link (GdkDisplay *display,