diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt index bcbe15a6f5..edcd409228 100644 --- a/docs/reference/gdk/gdk3-sections.txt +++ b/docs/reference/gdk/gdk3-sections.txt @@ -782,7 +782,7 @@ gdk_event_get_root_coords gdk_event_get_scroll_direction gdk_event_get_state gdk_event_get_time -gdk_event_get_touch_id +gdk_event_get_touch_sequence gdk_event_get_touch_area gdk_event_request_motions gdk_events_get_angle diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index f73ce401cf..c461d0558d 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -168,7 +168,7 @@ gdk_event_get_scroll_direction gdk_event_get_source_device gdk_event_get_state gdk_event_get_time -gdk_event_get_touch_id +gdk_event_get_touch_sequence gdk_event_get_touch_area gdk_event_get_type gdk_event_handler_set diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index a6123d6448..47cff7fc19 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -1791,40 +1791,30 @@ gdk_event_get_screen (const GdkEvent *event) } /** - * gdk_event_get_touch_id: + * gdk_event_get_touch_sequence: * @event: a #GdkEvent - * @touch_id: return location of the touch ID of a touch event * * If @event if of type %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE, - * %GDK_TOUCH_END or %GDK_TOUCH_CANCEL, fills in @touch_id and - * returns %TRUE, else it returns %FALSE. + * %GDK_TOUCH_END or %GDK_TOUCH_CANCEL, returns the #GdkTouchSequence + * to which the event belongs. Otherwise, return %NULL. * - * Returns: %TRUE if the touch ID can be extracted from @event. + * Returns: the touch sequence that the event belongs to * * Since: 3.4 */ -gboolean -gdk_event_get_touch_id (const GdkEvent *event, - guint *touch_id) +GdkTouchSequence * +gdk_event_get_touch_sequence (const GdkEvent *event) { if (!event) - return FALSE; + return NULL; if (event->type == GDK_TOUCH_BEGIN || event->type == GDK_TOUCH_UPDATE || event->type == GDK_TOUCH_END || event->type == GDK_TOUCH_CANCEL) - { - if (touch_id) - *touch_id = event->touch.touch_id; - return TRUE; - } + return event->touch.sequence; else - { - if (touch_id) - *touch_id = 0; - return FALSE; - } + return NULL; } /** diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index 8b59e67833..529a96ce90 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -145,6 +145,8 @@ typedef struct _GdkEventWindowState GdkEventWindowState; typedef struct _GdkEventSetting GdkEventSetting; typedef struct _GdkEventGrabBroken GdkEventGrabBroken; +typedef struct _GdkTouchSequence GdkTouchSequence; + typedef union _GdkEvent GdkEvent; /** @@ -656,7 +658,7 @@ struct _GdkEventMotion * * If the event has a type of %GDK_TOUCH_PRESS or %GDK_TOUCH_RELEASE, * this event will pertain to a sequence identified by - * gdk_event_get_touch_id(). With multitouch devices, there may be + * gdk_event_get_touch_sequence(). With multitouch devices, there may be * several ongoing sequences. */ struct _GdkEventButton @@ -689,7 +691,7 @@ struct _GdkEventButton * @state: (type GdkModifierType): a bit-mask representing the state of * the modifier keys (e.g. Control, Shift and Alt) and the pointer * buttons. See #GdkModifierType. - * @touch_id: touch ID + * @sequence: the touch sequence that the event belongs to * @device: the device where the event originated. * @x_root: the x coordinate of the pointer relative to the root of the * screen. @@ -710,7 +712,7 @@ struct _GdkEventTouch gdouble y; gdouble *axes; guint state; - guint touch_id; + GdkTouchSequence *sequence; GdkDevice *device; gdouble x_root, y_root; }; @@ -1221,8 +1223,7 @@ void gdk_event_set_screen (GdkEvent *event, GdkScreen *screen); GdkScreen *gdk_event_get_screen (const GdkEvent *event); -gboolean gdk_event_get_touch_id (const GdkEvent *event, - guint *touch_id); +GdkTouchSequence *gdk_event_get_touch_sequence (const GdkEvent *event); cairo_region_t * gdk_event_get_touch_area (GdkEvent *event); void gdk_set_show_events (gboolean show_events);