summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-15 15:17:38 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-05-15 16:21:20 +0900
commitda229e34aa7e17a9e003dd72685b9d31bbec5a15 (patch)
tree49846ee3fea597e462a9223d972c81c0d242b8ba
parent9a251d6d5d8ce01be2588bb6bed41c84d49f0f83 (diff)
downloadefl-da229e34aa7e17a9e003dd72685b9d31bbec5a15.tar.gz
evas: Remove evas touch_point from EO
Note: it seems the EAPI evas_touch_point_list_xy_get() was lst at some point, as it doesn't appear in the headers anymore. It looks like we fail to catch an ABI break! abi_checker didn't catch this!? Ref T5312
-rw-r--r--src/lib/elementary/efl_ui_win.c6
-rw-r--r--src/lib/evas/Evas_Common.h13
-rw-r--r--src/lib/evas/Evas_Legacy.h80
-rw-r--r--src/lib/evas/canvas/evas_canvas.eo38
-rw-r--r--src/lib/evas/canvas/evas_touch_point.c46
-rw-r--r--src/lib/evas/canvas/evas_types.eot11
6 files changed, 113 insertions, 81 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 0feb119eb6..30d424098b 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2404,7 +2404,7 @@ _efl_ui_win_efl_input_interface_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- cnt = evas_canvas_touch_point_list_count(sd->evas);
+ cnt = evas_touch_point_list_count(sd->evas);
if (!cnt) return NULL;
it = calloc(1, sizeof(*it));
@@ -2422,11 +2422,11 @@ _efl_ui_win_efl_input_interface_pointer_iterate(const Eo *obj, Efl_Ui_Win_Data *
ptr = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, (Eo *) obj, (void **) &ptrdata);
if (!ptrdata) break;
- ptrdata->tool = evas_canvas_touch_point_list_nth_id_get(sd->evas, i);
+ ptrdata->tool = evas_touch_point_list_nth_id_get(sd->evas, i);
_efl_input_value_mark(ptrdata, EFL_INPUT_VALUE_TOOL);
// Note that "still" maps to "down" here.
- state = evas_canvas_touch_point_list_nth_state_get(sd->evas, i);
+ state = evas_touch_point_list_nth_state_get(sd->evas, i);
switch (state)
{
case EVAS_TOUCH_POINT_DOWN: ptrdata->action = EFL_POINTER_ACTION_DOWN; break;
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 4e7d7a741a..0711c75d6a 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -3603,19 +3603,6 @@ EAPI Eina_Bool evas_seat_key_lock_is_set(const Evas_Lock *l, const ch
*/
/**
- * @defgroup Evas_Touch_Point_List Touch Point List Functions
- *
- * 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.
- *
- * @ingroup Evas_Canvas
- */
-
-/**
* @ingroup Evas_Font_Group
*
* @{
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 004e594319..559055a877 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -596,6 +596,86 @@ EAPI void evas_event_refeed_event(Evas *obj, void *event_copy, Evas_
*/
/**
+ * @defgroup Evas_Touch_Point_List Touch Point List Functions
+ *
+ * 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.
+ *
+ * @ingroup Evas_Canvas
+ *
+ * @{
+ */
+
+/**
+ * State of Evas_Coord_Touch_Point
+ */
+typedef enum
+{
+ EVAS_TOUCH_POINT_DOWN = 0, /**< Touch point is pressed down */
+ EVAS_TOUCH_POINT_UP, /**< Touch point is released */
+ EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
+ EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
+ EVAS_TOUCH_POINT_CANCEL /**< Touch point is cancelled */
+} Evas_Touch_Point_State;
+
+/**
+ * @brief Get the number of touched point in 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.
+ *
+ * @return The number of touched point on the evas.
+ */
+EAPI unsigned int evas_touch_point_list_count(Evas *obj);
+
+/**
+ * @brief This function returns the @c id of nth touch point.
+ *
+ * The point which comes from Mouse Event has @c id 0 and The point which comes
+ * from Multi Event has @c id that is same as Multi Event's device id.
+ *
+ * @param[in] n The number of the touched point (0 being the first).
+ *
+ * @return id of nth touch point, if the call succeeded, -1 otherwise.
+ */
+EAPI int evas_touch_point_list_nth_id_get(Evas *obj, unsigned int n);
+
+/**
+ * @brief This function returns the @c state of nth touch point.
+ *
+ * The point's @c 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.
+ *
+ * @param[in] n The number of the touched point (0 being the first).
+ *
+ * @return @c state of nth touch point, if the call succeeded,
+ * EVAS_TOUCH_POINT_CANCEL otherwise.
+ */
+EAPI Evas_Touch_Point_State evas_touch_point_list_nth_state_get(Evas *obj, unsigned int n);
+
+/**
+ * @brief This function returns the nth touch point's coordinates.
+ *
+ * Touch point's coordinates is updated whenever moving that point on the
+ * canvas.
+ *
+ * @param[in] n The number of the touched point (0 being the first).
+ * @param[out] x The pointer to a Evas_Coord to be filled in.
+ * @param[out] y The pointer to a Evas_Coord to be filled in.
+ */
+EAPI void evas_touch_point_list_nth_xy_get(Evas *eo_e, unsigned int n, Evas_Coord *x, Evas_Coord *y);
+
+/**
+ * @}
+ */
+
+/**
* @ingroup Evas_Font_Group
*
* @{
diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo
index 3e6298bd3a..af7e9155d1 100644
--- a/src/lib/evas/canvas/evas_canvas.eo
+++ b/src/lib/evas/canvas/evas_canvas.eo
@@ -661,15 +661,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
should be used.
]]
}
- touch_point_list_count {
- [[Get the number of touched point in 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.
- ]]
- return: uint; [[The number of touched point on the evas.]]
- }
nochange_pop {
[[Pop the nochange flag down 1.
@@ -839,18 +830,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
@in path: string @nonull; [[The new font path.]]
}
}
- touch_point_list_nth_id_get {
- [[This function returns the $id of nth touch point.
-
- 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.
- ]]
- return: int; [[id of nth touch point, if the call succeeded, -1 otherwise.]]
- params {
- @in n: uint; [[The number of the touched point (0 being the first).]]
- }
- }
font_path_clear {
[[Removes all font paths loaded into memory for the given evas.]]
}
@@ -860,6 +839,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
all smart objects in the canvas.
]]
}
+ /* FIXME: The below function is only for efl.ui.win */
touch_point_list_nth_xy_get {
[[This function returns the nth touch point's coordinates.
@@ -1007,22 +987,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
@in keyname: string @nonull; [[The name of the key to remove from the modifiers list.]]
}
}
- touch_point_list_nth_state_get {
- [[This function returns the $state of nth touch point.
-
- 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.
- ]]
- return: Evas.Touch_Point_State; [[
- $state of nth touch point, if the call succeeded,
- EVAS_TOUCH_POINT_CANCEL otherwise.
- ]]
- params {
- @in n: uint; [[The number of the touched point (0 being the first).]]
- }
- }
focus_in {
[[Inform to the evas that it got the focus from the default seat.]]
}
diff --git a/src/lib/evas/canvas/evas_touch_point.c b/src/lib/evas/canvas/evas_touch_point.c
index 8d0575302e..db7d4c2734 100644
--- a/src/lib/evas/canvas/evas_touch_point.c
+++ b/src/lib/evas/canvas/evas_touch_point.c
@@ -1,6 +1,11 @@
#include "evas_common_private.h"
#include "evas_private.h"
+#define EVAS_LEGACY_API(_obj, _e, ...) \
+ Evas_Public_Data *_e = (_obj && efl_isa(_obj, EVAS_CANVAS_CLASS)) ? \
+ efl_data_scope_get(_obj, EVAS_CANVAS_CLASS) : NULL; \
+ if (!_e) return __VA_ARGS__
+
void
_evas_touch_point_append(Evas *eo_e, int id, Evas_Coord x, Evas_Coord y)
{
@@ -53,19 +58,22 @@ _evas_touch_point_remove(Evas *eo_e, int id)
}
}
-EOLIAN unsigned int
-_evas_canvas_touch_point_list_count(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
+EAPI unsigned int
+evas_touch_point_list_count(Eo *eo_e)
{
+ EVAS_LEGACY_API(eo_e, e, 0);
return eina_list_count(e->touch_points);
}
+/* For Efl.Ui.Win only */
EOLIAN void
-_evas_canvas_touch_point_list_nth_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e,
- unsigned int n, double *x, double *y)
+_evas_canvas_touch_point_list_nth_xy_get(Evas_Canvas *eo_e EINA_UNUSED,
+ Evas_Public_Data *e, unsigned int n,
+ double *x, double *y)
{
- Evas_Coord_Touch_Point *point = NULL;
+ Evas_Coord_Touch_Point *point;
- point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
+ point = eina_list_nth(e->touch_points, n);
if (!point)
{
if (x) *x = 0;
@@ -77,31 +85,35 @@ _evas_canvas_touch_point_list_nth_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data
}
EAPI void
-evas_touch_point_list_nth_xy_get(Evas_Canvas *obj, unsigned int n, Evas_Coord *x, Evas_Coord *y)
+evas_touch_point_list_nth_xy_get(Evas *eo_e, unsigned int n,
+ Evas_Coord *x, Evas_Coord *y)
{
- double X = 0, Y = 0;
+ double X, Y;
- evas_canvas_touch_point_list_nth_xy_get(obj, n, &X, &Y);
+ EVAS_LEGACY_API(eo_e, e);
+ _evas_canvas_touch_point_list_nth_xy_get(eo_e, e, n, &X, &Y);
if (x) *x = X;
if (y) *y = Y;
}
-EOLIAN int
-_evas_canvas_touch_point_list_nth_id_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, unsigned int n)
+EAPI int
+evas_touch_point_list_nth_id_get(Evas *eo_e, unsigned int n)
{
- Evas_Coord_Touch_Point *point = NULL;
+ Evas_Coord_Touch_Point *point;
- point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
+ EVAS_LEGACY_API(eo_e, e, -1);
+ point = eina_list_nth(e->touch_points, n);
if (!point) return -1;
else return point->id;
}
-EOLIAN Evas_Touch_Point_State
-_evas_canvas_touch_point_list_nth_state_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, unsigned int n)
+EAPI Evas_Touch_Point_State
+evas_touch_point_list_nth_state_get(Evas *eo_e, unsigned int n)
{
- Evas_Coord_Touch_Point *point = NULL;
+ Evas_Coord_Touch_Point *point;
- point = (Evas_Coord_Touch_Point *)eina_list_nth(e->touch_points, n);
+ EVAS_LEGACY_API(eo_e, e, EVAS_TOUCH_POINT_CANCEL);
+ point = eina_list_nth(e->touch_points, n);
if (!point) return EVAS_TOUCH_POINT_CANCEL;
else return point->state;
}
diff --git a/src/lib/evas/canvas/evas_types.eot b/src/lib/evas/canvas/evas_types.eot
index 277de4afdc..38aab6e425 100644
--- a/src/lib/evas/canvas/evas_types.eot
+++ b/src/lib/evas/canvas/evas_types.eot
@@ -12,17 +12,6 @@ enum Evas.Font.Hinting_Flags {
bytecode [[Bytecode font hinting]]
}
-enum Evas.Touch_Point_State {
- [[State of Evas_Coord_Touch_Point]]
- legacy: Evas_Touch_Point;
-
- down, [[Touch point is pressed down]]
- up, [[Touch point is released]]
- move, [[Touch point is moved]]
- still, [[Touch point is not moved after pressed]]
- cancel [[Touch point is cancelled]]
-}
-
struct Evas.Modifier; [[An opaque type containing information on which modifier keys are registered in an Evas canvas]]
struct Evas.Lock; [[An opaque type containing information on which lock keys are registered in an Evas canvas]]