aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas/src/lib/canvas/evas_touch_point.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/evas/src/lib/canvas/evas_touch_point.c')
-rw-r--r--legacy/evas/src/lib/canvas/evas_touch_point.c89
1 files changed, 67 insertions, 22 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_touch_point.c b/legacy/evas/src/lib/canvas/evas_touch_point.c
index bdea73fe31..603756a2f2 100644
--- a/legacy/evas/src/lib/canvas/evas_touch_point.c
+++ b/legacy/evas/src/lib/canvas/evas_touch_point.c
@@ -2,8 +2,9 @@
#include "evas_private.h"
void
-_evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y)
+_evas_touch_point_append(Evas *eo_e, int id, Evas_Coord x, Evas_Coord y)
{
+ Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
Evas_Coord_Touch_Point *point;
/* create new Evas_Coord_Touch_Point */
@@ -16,8 +17,9 @@ _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y)
}
void
-_evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state)
+_evas_touch_point_update(Evas *eo_e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state)
{
+ Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
Eina_List *l;
Evas_Coord_Touch_Point *point = NULL;
@@ -34,8 +36,9 @@ _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch
}
void
-_evas_touch_point_remove(Evas *e, int id)
+_evas_touch_point_remove(Evas *eo_e, int id)
{
+ Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
Eina_List *l;
Evas_Coord_Touch_Point *point = NULL;
@@ -51,25 +54,45 @@ _evas_touch_point_remove(Evas *e, int id)
}
EAPI unsigned int
-evas_touch_point_list_count(Evas *e)
+evas_touch_point_list_count(Evas *eo_e)
{
- MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+ MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
return 0;
MAGIC_CHECK_END();
- return eina_list_count(e->touch_points);
+ unsigned int ret = 0;
+ eo_do((Eo *)eo_e, evas_canvas_touch_point_list_count(&ret));
+ return ret;
}
-EAPI void
-evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y)
+void
+_canvas_touch_point_list_count(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list)
{
- Evas_Coord_Touch_Point *point = NULL;
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ const Evas_Public_Data *e = _pd;
+ *ret = eina_list_count(e->touch_points);
+}
- MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+EAPI void
+evas_touch_point_list_nth_xy_get(Evas *eo_e, unsigned int n, Evas_Coord *x, Evas_Coord *y)
+{
+ MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
if (x) *x = 0;
if (y) *y = 0;
return;
MAGIC_CHECK_END();
+ eo_do(eo_e, evas_canvas_touch_point_list_nth_xy_get(n, x, y));
+}
+void
+_canvas_touch_point_list_nth_xy_get(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int n = va_arg(*list, unsigned int);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+
+ Evas_Coord_Touch_Point *point = NULL;
+
+ Evas_Public_Data *e = _pd;
point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
if (!point)
{
@@ -82,29 +105,51 @@ evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Co
}
EAPI int
-evas_touch_point_list_nth_id_get(Evas *e, unsigned int n)
+evas_touch_point_list_nth_id_get(Evas *eo_e, unsigned int n)
{
- Evas_Coord_Touch_Point *point = NULL;
-
- MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+ MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
return -1;
MAGIC_CHECK_END();
+ int ret = -1;
+ eo_do(eo_e, evas_canvas_touch_point_list_nth_id_get(n, &ret));
+ return ret;
+}
+
+void
+_canvas_touch_point_list_nth_id_get(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int n = va_arg(*list, unsigned int);
+ int *ret = va_arg(*list, int *);
+ Evas_Coord_Touch_Point *point = NULL;
+
+ Evas_Public_Data *e = _pd;
point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
- if (!point) return -1;
- return point->id;
+ if (!point) *ret = -1;
+ else *ret = point->id;
}
EAPI Evas_Touch_Point_State
-evas_touch_point_list_nth_state_get(Evas *e, unsigned int n)
+evas_touch_point_list_nth_state_get(Evas *eo_e, unsigned int n)
{
- Evas_Coord_Touch_Point *point = NULL;
-
- MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+ MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
return EVAS_TOUCH_POINT_CANCEL;
MAGIC_CHECK_END();
+ Evas_Touch_Point_State ret = EVAS_TOUCH_POINT_CANCEL;
+ eo_do(eo_e, evas_canvas_touch_point_list_nth_state_get(n, &ret));
+ return ret;
+}
+
+void
+_canvas_touch_point_list_nth_state_get(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int n = va_arg(*list, unsigned int);
+ Evas_Touch_Point_State *ret = va_arg(*list, Evas_Touch_Point_State *);
+
+ Evas_Coord_Touch_Point *point = NULL;
+ Evas_Public_Data *e = _pd;
point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
- if (!point) return EVAS_TOUCH_POINT_CANCEL;
- return point->state;
+ if (!point) *ret = EVAS_TOUCH_POINT_CANCEL;
+ else *ret = point->state;
}