Touch Point List Functions

Functions to get information of touched points in the Evas. More...

#define evas_canvas_touch_point_list_count(ret)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_COUNT), EO_TYPECHECK(unsigned int *, ret)
 
#define evas_canvas_touch_point_list_nth_xy_get(n, x, y)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_NTH_XY_GET), EO_TYPECHECK(unsigned int, n), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
 
#define evas_canvas_touch_point_list_nth_id_get(n, ret)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_NTH_ID_GET), EO_TYPECHECK(unsigned int, n), EO_TYPECHECK(int *, ret)
 
#define evas_canvas_touch_point_list_nth_state_get(n, ret)   EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_NTH_STATE_GET), EO_TYPECHECK(unsigned int, n), EO_TYPECHECK(Evas_Touch_Point_State *, ret)
 
unsigned int evas_touch_point_list_count (Evas *e)
 Get the number of touched point in the evas. More...
 
void evas_touch_point_list_nth_xy_get (Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y)
 This function returns the nth touch point's co-ordinates. More...
 
int evas_touch_point_list_nth_id_get (Evas *e, unsigned int n)
 This function returns the id of nth touch point. More...
 
Evas_Touch_Point_State evas_touch_point_list_nth_state_get (Evas *e, unsigned int n)
 This function returns the state of nth touch point. More...
 

Detailed Description

Functions to get information of touched points in the Evas.

Evas maintains list of touched points on the canvas. Each point has its co-ordinates, id and state. You can get the number of touched points and information of each point using evas_touch_point_list functions.

Macro Definition Documentation

#define evas_canvas_touch_point_list_count (   ret)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_COUNT), EO_TYPECHECK(unsigned int *, ret)
Since
1.8

Get the number of touched point in the evas.

Parameters
[out]ret
See also
evas_touch_point_list_count

Referenced by evas_touch_point_list_count().

#define evas_canvas_touch_point_list_nth_xy_get (   n,
  x,
 
)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_NTH_XY_GET), EO_TYPECHECK(unsigned int, n), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
Since
1.8

This function returns the nth touch point's co-ordinates.

Parameters
[in]n
[out]x
[out]y
See also
evas_touch_point_list_nth_xy_get

Referenced by evas_touch_point_list_nth_xy_get().

#define evas_canvas_touch_point_list_nth_id_get (   n,
  ret 
)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_NTH_ID_GET), EO_TYPECHECK(unsigned int, n), EO_TYPECHECK(int *, ret)
Since
1.8

This function returns the id of nth touch point.

Parameters
[in]n
[out]ret
See also
evas_touch_point_list_nth_id_get

Referenced by evas_touch_point_list_nth_id_get().

#define evas_canvas_touch_point_list_nth_state_get (   n,
  ret 
)    EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TOUCH_POINT_LIST_NTH_STATE_GET), EO_TYPECHECK(unsigned int, n), EO_TYPECHECK(Evas_Touch_Point_State *, ret)
Since
1.8

This function returns the state of nth touch point.

Parameters
[in]n
[out]ret
See also
evas_touch_point_list_nth_state_get

Referenced by evas_touch_point_list_nth_state_get().

Function Documentation

unsigned int evas_touch_point_list_count ( Evas e)

Get the number of touched point in the evas.

Parameters
eThe pointer to the Evas canvas.
Returns
The number of touched point on the evas.

New touched point is added to the list whenever touching the evas and point is removed whenever removing touched point from the evas.

Example:

1 extern Evas *evas;
2 int count;
3 
4 count = evas_touch_point_list_count(evas);
5 printf("The count of touch points: %i\n", count);
See also
evas_touch_point_list_nth_xy_get()
evas_touch_point_list_nth_id_get()
evas_touch_point_list_nth_state_get()

References evas_canvas_touch_point_list_count.

void evas_touch_point_list_nth_xy_get ( Evas e,
unsigned int  n,
Evas_Coord *  x,
Evas_Coord *  y 
)

This function returns the nth touch point's co-ordinates.

Parameters
eThe pointer to the Evas canvas.
nThe number of the touched point (0 being the first).
xThe pointer to a Evas_Coord to be filled in.
yThe pointer to a Evas_Coord to be filled in.

Touch point's co-ordinates is updated whenever moving that point on the canvas.

Example:

1 extern Evas *evas;
2 Evas_Coord x, y;
3 
4 if (evas_touch_point_list_count(evas))
5  {
6  evas_touch_point_nth_xy_get(evas, 0, &x, &y);
7  printf("The first touch point's co-ordinate: (%i, %i)\n", x, y);
8  }
See also
evas_touch_point_list_count()
evas_touch_point_list_nth_id_get()
evas_touch_point_list_nth_state_get()

References evas_canvas_touch_point_list_nth_xy_get.

int evas_touch_point_list_nth_id_get ( Evas e,
unsigned int  n 
)

This function returns the id of nth touch point.

Parameters
eThe pointer to the Evas canvas.
nThe number of the touched point (0 being the first).
Returns
id of nth touch point, if the call succeeded, -1 otherwise.

The point which comes from Mouse Event has id 0 and The point which comes from Multi Event has id that is same as Multi Event's device id.

Example:

1 extern Evas *evas;
2 int id;
3 
4 if (evas_touch_point_list_count(evas))
5  {
6  id = evas_touch_point_nth_id_get(evas, 0);
7  printf("The first touch point's id: %i\n", id);
8  }
See also
evas_touch_point_list_count()
evas_touch_point_list_nth_xy_get()
evas_touch_point_list_nth_state_get()

References evas_canvas_touch_point_list_nth_id_get.

Evas_Touch_Point_State evas_touch_point_list_nth_state_get ( Evas e,
unsigned int  n 
)

This function returns the state of nth touch point.

Parameters
eThe pointer to the Evas canvas.
nThe number of the touched point (0 being the first).
Returns
state of nth touch point, if the call succeeded, EVAS_TOUCH_POINT_CANCEL otherwise.

The point's state is EVAS_TOUCH_POINT_DOWN when pressed, EVAS_TOUCH_POINT_STILL when the point is not moved after pressed, EVAS_TOUCH_POINT_MOVE when moved at least once after pressed and EVAS_TOUCH_POINT_UP when released.

Example:

1 extern Evas *evas;
2 Evas_Touch_Point_State state;
3 
4 if (evas_touch_point_list_count(evas))
5  {
6  state = evas_touch_point_nth_state_get(evas, 0);
7  printf("The first touch point's state: %i\n", state);
8  }
See also
evas_touch_point_list_count()
evas_touch_point_list_nth_xy_get()
evas_touch_point_list_nth_id_get()

References evas_canvas_touch_point_list_nth_state_get, and EVAS_TOUCH_POINT_CANCEL.