pepper: change touch APIs
authorJunghoon <jh13.son@samsung.com>
Mon, 2 Nov 2015 07:38:29 +0000 (16:38 +0900)
committerJunghoon <jh13.son@samsung.com>
Mon, 2 Nov 2015 07:38:29 +0000 (16:38 +0900)
    - change pepper_touch_point_get_position to pepper_touch_get_position
    - add pepper_touch_set_position

Change-Id: I2b5942599219f92b11cb716720c346a0ed6c02cf

src/lib/pepper/pepper.h
src/lib/pepper/touch.c

index 05e0ac008fc8b8d9a43c6df9a2f9dbb96e58b56c..44f3eacdb702699982439db960128f507b19ebfc 100644 (file)
@@ -1009,8 +1009,11 @@ pepper_touch_point_set_focus(pepper_touch_t *touch, uint32_t id, pepper_view_t *
 PEPPER_API pepper_view_t *
 pepper_touch_point_get_focus(pepper_touch_t *touch, uint32_t id);
 
-PEPPER_API void
-pepper_touch_point_get_position(pepper_touch_t *touch, uint32_t id, double *x, double *y);
+PEPPER_API pepper_bool_t
+pepper_touch_get_position(pepper_touch_t *touch, uint32_t id, double *x, double *y);
+
+PEPPER_API pepper_bool_t
+pepper_touch_set_position(pepper_touch_t *touch, uint32_t id, double x, double y);
 
 PEPPER_API void
 pepper_touch_send_down(pepper_touch_t *touch, pepper_view_t *view,
index a720feb57dd0569f49a31e9fefd7d025b09e2cc9..1070135f0d306fef36d8235b7bacb707cae79f94 100644 (file)
@@ -238,17 +238,31 @@ pepper_touch_point_get_focus(pepper_touch_t *touch, uint32_t id)
     return point->focus;
 }
 
-PEPPER_API void
-pepper_touch_point_get_position(pepper_touch_t *touch, uint32_t id, double *x, double *y)
+PEPPER_API pepper_bool_t
+pepper_touch_get_position(pepper_touch_t *touch, uint32_t id, double *x, double *y)
 {
     pepper_touch_point_t *point = get_touch_point(touch, id);
-    PEPPER_CHECK(point, return, "Touch point %d does not exist.\n", id);
+    PEPPER_CHECK(point, return PEPPER_FALSE, "Touch point %d does not exist.\n", id);
 
     if (x)
         *x = point->x;
 
     if (y)
         *y = point->y;
+
+    return PEPPER_TRUE;
+}
+
+PEPPER_API pepper_bool_t
+pepper_touch_set_position(pepper_touch_t *touch, uint32_t id, double x, double y)
+{
+    pepper_touch_point_t *point = get_touch_point(touch, id);
+    PEPPER_CHECK(point, return PEPPER_FALSE, "Touch point %d does not exist.\n", id);
+
+    point->x = x;
+    point->y = y;
+
+    return PEPPER_TRUE;
 }
 
 PEPPER_API void