diff options
Diffstat (limited to 'libraries/evas/src/lib/canvas/evas_touch_point.c')
-rw-r--r-- | libraries/evas/src/lib/canvas/evas_touch_point.c | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/libraries/evas/src/lib/canvas/evas_touch_point.c b/libraries/evas/src/lib/canvas/evas_touch_point.c deleted file mode 100644 index bdea73f..0000000 --- a/libraries/evas/src/lib/canvas/evas_touch_point.c +++ /dev/null | |||
@@ -1,110 +0,0 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_private.h" | ||
3 | |||
4 | void | ||
5 | _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y) | ||
6 | { | ||
7 | Evas_Coord_Touch_Point *point; | ||
8 | |||
9 | /* create new Evas_Coord_Touch_Point */ | ||
10 | point = (Evas_Coord_Touch_Point *)calloc(1, sizeof(Evas_Coord_Touch_Point)); | ||
11 | point->x = x; | ||
12 | point->y = y; | ||
13 | point->id = id; | ||
14 | point->state = EVAS_TOUCH_POINT_DOWN; | ||
15 | e->touch_points = eina_list_append(e->touch_points, point); | ||
16 | } | ||
17 | |||
18 | void | ||
19 | _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state) | ||
20 | { | ||
21 | Eina_List *l; | ||
22 | Evas_Coord_Touch_Point *point = NULL; | ||
23 | |||
24 | EINA_LIST_FOREACH(e->touch_points, l, point) | ||
25 | { | ||
26 | if (point->id == id) | ||
27 | { | ||
28 | point->x = x; | ||
29 | point->y = y; | ||
30 | point->state = state; | ||
31 | break; | ||
32 | } | ||
33 | } | ||
34 | } | ||
35 | |||
36 | void | ||
37 | _evas_touch_point_remove(Evas *e, int id) | ||
38 | { | ||
39 | Eina_List *l; | ||
40 | Evas_Coord_Touch_Point *point = NULL; | ||
41 | |||
42 | EINA_LIST_FOREACH(e->touch_points, l, point) | ||
43 | { | ||
44 | if (point->id == id) | ||
45 | { | ||
46 | e->touch_points = eina_list_remove(e->touch_points, point); | ||
47 | free(point); | ||
48 | break; | ||
49 | } | ||
50 | } | ||
51 | } | ||
52 | |||
53 | EAPI unsigned int | ||
54 | evas_touch_point_list_count(Evas *e) | ||
55 | { | ||
56 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
57 | return 0; | ||
58 | MAGIC_CHECK_END(); | ||
59 | return eina_list_count(e->touch_points); | ||
60 | } | ||
61 | |||
62 | EAPI void | ||
63 | evas_touch_point_list_nth_xy_get(Evas *e, unsigned int n, Evas_Coord *x, Evas_Coord *y) | ||
64 | { | ||
65 | Evas_Coord_Touch_Point *point = NULL; | ||
66 | |||
67 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
68 | if (x) *x = 0; | ||
69 | if (y) *y = 0; | ||
70 | return; | ||
71 | MAGIC_CHECK_END(); | ||
72 | |||
73 | point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n); | ||
74 | if (!point) | ||
75 | { | ||
76 | if (x) *x = 0; | ||
77 | if (y) *y = 0; | ||
78 | return; | ||
79 | } | ||
80 | if (x) *x = point->x; | ||
81 | if (y) *y = point->y; | ||
82 | } | ||
83 | |||
84 | EAPI int | ||
85 | evas_touch_point_list_nth_id_get(Evas *e, unsigned int n) | ||
86 | { | ||
87 | Evas_Coord_Touch_Point *point = NULL; | ||
88 | |||
89 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
90 | return -1; | ||
91 | MAGIC_CHECK_END(); | ||
92 | |||
93 | point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n); | ||
94 | if (!point) return -1; | ||
95 | return point->id; | ||
96 | } | ||
97 | |||
98 | EAPI Evas_Touch_Point_State | ||
99 | evas_touch_point_list_nth_state_get(Evas *e, unsigned int n) | ||
100 | { | ||
101 | Evas_Coord_Touch_Point *point = NULL; | ||
102 | |||
103 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
104 | return EVAS_TOUCH_POINT_CANCEL; | ||
105 | MAGIC_CHECK_END(); | ||
106 | |||
107 | point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n); | ||
108 | if (!point) return EVAS_TOUCH_POINT_CANCEL; | ||
109 | return point->state; | ||
110 | } | ||