[PATCH weston 05/14] ivi-shell: remove ivi_layout_surface_get_position API

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Fri Feb 26 15:58:13 UTC 2016


Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
---
 ivi-shell/ivi-layout-export.h    |    9 ---------
 ivi-shell/ivi-layout.c           |   16 ----------------
 tests/ivi_layout-internal-test.c |    7 -------
 tests/ivi_layout-test-plugin.c   |   27 ++++++---------------------
 4 files changed, 6 insertions(+), 53 deletions(-)

diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index f58f5af..4dbac50 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -321,15 +321,6 @@ struct ivi_layout_interface {
 					int32_t dest_x, int32_t dest_y);
 
 	/**
-	 * \brief Get the horizontal and vertical position of the surface.
-	 *
-	 * \return IVI_SUCCEEDED if the method call was successful
-	 * \return IVI_FAILED if the method call was failed
-	 */
-	int32_t (*surface_get_position)(struct ivi_layout_surface *ivisurf,
-					int32_t *dest_x, int32_t *dest_y);
-
-	/**
 	 * \brief Set the horizontal and vertical dimension of the surface.
 	 *
 	 * \return IVI_SUCCEEDED if the method call was successful
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 4475c94..81fea95 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2156,21 +2156,6 @@ ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf,
 }
 
 static int32_t
-ivi_layout_surface_get_position(struct ivi_layout_surface *ivisurf,
-				int32_t *dest_x, int32_t *dest_y)
-{
-	if (ivisurf == NULL || dest_x == NULL || dest_y == NULL) {
-		weston_log("ivi_layout_surface_get_position: invalid argument\n");
-		return IVI_FAILED;
-	}
-
-	*dest_x = ivisurf->prop.dest_x;
-	*dest_y = ivisurf->prop.dest_y;
-
-	return IVI_SUCCEEDED;
-}
-
-static int32_t
 ivi_layout_surface_set_orientation(struct ivi_layout_surface *ivisurf,
 				   enum wl_output_transform orientation)
 {
@@ -2707,7 +2692,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
 	.surface_set_source_rectangle		= ivi_layout_surface_set_source_rectangle,
 	.surface_set_destination_rectangle	= ivi_layout_surface_set_destination_rectangle,
 	.surface_set_position			= ivi_layout_surface_set_position,
-	.surface_get_position			= ivi_layout_surface_get_position,
 	.surface_set_dimension			= ivi_layout_surface_set_dimension,
 	.surface_get_dimension			= ivi_layout_surface_get_dimension,
 	.surface_set_orientation		= ivi_layout_surface_set_orientation,
diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
index 4e1df28..c8693c7 100644
--- a/tests/ivi_layout-internal-test.c
+++ b/tests/ivi_layout-internal-test.c
@@ -113,17 +113,10 @@ static void
 test_surface_bad_position(struct test_context *ctx)
 {
 	const struct ivi_layout_interface *lyt = ctx->layout_interface;
-	struct ivi_layout_surface *ivisurf = NULL;
-	int32_t dest_x;
-	int32_t dest_y;
 
 	iassert(lyt->surface_set_position(NULL, 20, 30) == IVI_FAILED);
 
 	lyt->commit_changes();
-
-	iassert(lyt->surface_get_position(NULL, &dest_x, &dest_y) == IVI_FAILED);
-	iassert(lyt->surface_get_position(ivisurf, NULL, &dest_y) == IVI_FAILED);
-	iassert(lyt->surface_get_position(ivisurf, &dest_x, NULL) == IVI_FAILED);
 }
 
 static void
diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
index db6155b..72a5363 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi_layout-test-plugin.c
@@ -463,32 +463,23 @@ RUNNER_TEST(surface_position)
 	const struct ivi_layout_interface *lyt = ctx->layout_interface;
 	struct ivi_layout_surface *ivisurf;
 	const struct ivi_layout_surface_properties *prop;
-	int32_t dest_x;
-	int32_t dest_y;
 
 	ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
 	runner_assert(ivisurf != NULL);
 
-	runner_assert(lyt->surface_get_position(
-		      ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED);
-	runner_assert(dest_x == 0);
-	runner_assert(dest_y == 0);
+	prop = lyt->get_properties_of_surface(ivisurf);
+	runner_assert_or_return(prop);
+	runner_assert(prop->dest_x == 20);
+	runner_assert(prop->dest_y == 30);
 
 	runner_assert(lyt->surface_set_position(
 		      ivisurf, 20, 30) == IVI_SUCCEEDED);
 
-	runner_assert(lyt->surface_get_position(
-		      ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED);
-	runner_assert(dest_x == 0);
-	runner_assert(dest_y == 0);
+	runner_assert(prop->dest_x == 0);
+	runner_assert(prop->dest_y == 0);
 
 	lyt->commit_changes();
 
-	runner_assert(lyt->surface_get_position(
-		      ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED);
-	runner_assert(dest_x == 20);
-	runner_assert(dest_y == 30);
-
 	prop = lyt->get_properties_of_surface(ivisurf);
 	runner_assert_or_return(prop);
 	runner_assert(prop->dest_x == 20);
@@ -502,8 +493,6 @@ RUNNER_TEST(surface_destination_rectangle)
 	const struct ivi_layout_surface_properties *prop;
 	int32_t dest_width;
 	int32_t dest_height;
-	int32_t dest_x;
-	int32_t dest_y;
 
 	ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
 	runner_assert(ivisurf != NULL);
@@ -532,10 +521,6 @@ RUNNER_TEST(surface_destination_rectangle)
 	runner_assert(dest_width == 200);
 	runner_assert(dest_height == 300);
 
-	runner_assert(lyt->surface_get_position(ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED);
-	runner_assert(dest_x == 20);
-	runner_assert(dest_y == 30);
-
 	prop = lyt->get_properties_of_surface(ivisurf);
 	runner_assert_or_return(prop);
 	runner_assert(prop->dest_width == 200);
-- 
1.7.9.5



More information about the wayland-devel mailing list