Replace gdk_event_get_touch_id

Change this to gdk_event_get_touch_sequence, and make it
return an opaque pointer instead of an integer.
This commit is contained in:
Matthias Clasen
2012-02-24 13:16:09 -05:00
parent 02fc18f34c
commit cca0efbdf0
4 changed files with 17 additions and 26 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
/**

View File

@@ -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);