[PATCH weston v2 07/14] ivi-shell: remove ivi_layout_surface_get_dimension API

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Fri Mar 4 12:50:28 UTC 2016


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

diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index 6428ef0..b5c6627 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -330,15 +330,6 @@ struct ivi_layout_interface {
 					 int32_t dest_width, int32_t dest_height);
 
 	/**
-	 * \brief Get the horizontal and vertical dimension 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_dimension)(struct ivi_layout_surface *ivisurf,
-					 int32_t *dest_width, int32_t *dest_height);
-
-	/**
 	 * \brief Sets the orientation of a ivi_surface.
 	 *
 	 * \return IVI_SUCCEEDED if the method call was successful
diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h
index 913bb0c..f0dba91 100644
--- a/ivi-shell/ivi-layout-private.h
+++ b/ivi-shell/ivi-layout-private.h
@@ -171,9 +171,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
 			  uint32_t id_surface);
 void
 ivi_layout_init_with_compositor(struct weston_compositor *ec);
-int32_t
-ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf,
-				 int32_t *dest_width, int32_t *dest_height);
 void
 ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
 					   struct wl_listener* listener);
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 8119af4..5552f5d 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2102,21 +2102,6 @@ ivi_layout_surface_set_dimension(struct ivi_layout_surface *ivisurf,
 	return IVI_SUCCEEDED;
 }
 
-int32_t
-ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf,
-				 int32_t *dest_width, int32_t *dest_height)
-{
-	if (ivisurf == NULL || dest_width == NULL ||  dest_height == NULL) {
-		weston_log("ivi_layout_surface_get_dimension: invalid argument\n");
-		return IVI_FAILED;
-	}
-
-	*dest_width = ivisurf->prop.dest_width;
-	*dest_height = ivisurf->prop.dest_height;
-
-	return IVI_SUCCEEDED;
-}
-
 static int32_t
 ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf,
 				int32_t dest_x, int32_t dest_y)
@@ -2678,7 +2663,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
 	.surface_set_destination_rectangle	= ivi_layout_surface_set_destination_rectangle,
 	.surface_set_position			= ivi_layout_surface_set_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,
 	.surface_get_orientation		= ivi_layout_surface_get_orientation,
 	.surface_set_content_observer		= ivi_layout_surface_set_content_observer,
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index a767ccf..19140ce 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -88,11 +88,8 @@ surface_configure_notify(struct wl_listener *listener, void *data)
 			     struct ivi_shell_surface,
 			     configured_listener);
 
-	int32_t dest_width = 0;
-	int32_t dest_height = 0;
-
-	ivi_layout_surface_get_dimension(layout_surf,
-					 &dest_width, &dest_height);
+	int32_t dest_width = layout_surf->prop.dest_width;
+	int32_t dest_height = layout_surf->prop.dest_height;
 
 	if (shell_surf->resource)
 		ivi_surface_send_configure(shell_surf->resource,
diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
index 2c52ed4..78ac7de 100644
--- a/tests/ivi_layout-internal-test.c
+++ b/tests/ivi_layout-internal-test.c
@@ -96,17 +96,10 @@ static void
 test_surface_bad_dimension(struct test_context *ctx)
 {
 	const struct ivi_layout_interface *lyt = ctx->layout_interface;
-	struct ivi_layout_surface *ivisurf = NULL;
-	int32_t dest_width;
-	int32_t dest_height;
 
 	iassert(lyt->surface_set_dimension(NULL, 200, 300) == IVI_FAILED);
 
 	lyt->commit_changes();
-
-	iassert(lyt->surface_get_dimension(NULL, &dest_width, &dest_height) == IVI_FAILED);
-	iassert(lyt->surface_get_dimension(ivisurf, NULL, &dest_height) == IVI_FAILED);
-	iassert(lyt->surface_get_dimension(ivisurf, &dest_width, NULL) == IVI_FAILED);
 }
 
 static void
diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c
index ed31635..44913d6 100644
--- a/tests/ivi_layout-test-plugin.c
+++ b/tests/ivi_layout-test-plugin.c
@@ -426,32 +426,23 @@ RUNNER_TEST(surface_dimension)
 	const struct ivi_layout_interface *lyt = ctx->layout_interface;
 	struct ivi_layout_surface *ivisurf;
 	const struct ivi_layout_surface_properties *prop;
-	int32_t dest_width;
-	int32_t dest_height;
 
 	ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
 	runner_assert(ivisurf != NULL);
 
-	runner_assert(lyt->surface_get_dimension(
-		      ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED);
-	runner_assert(dest_width == 1);
-	runner_assert(dest_height == 1);
+	prop = lyt->get_properties_of_surface(ivisurf);
+	runner_assert_or_return(prop);
+	runner_assert(prop->dest_width == 1);
+	runner_assert(prop->dest_height == 1);
 
 	runner_assert(IVI_SUCCEEDED ==
 		      lyt->surface_set_dimension(ivisurf, 200, 300));
 
-	runner_assert(lyt->surface_get_dimension(
-		      ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED);
-	runner_assert(dest_width == 1);
-	runner_assert(dest_height == 1);
+	runner_assert(prop->dest_width == 1);
+	runner_assert(prop->dest_height == 1);
 
 	lyt->commit_changes();
 
-	runner_assert(lyt->surface_get_dimension(
-		      ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED);
-	runner_assert(dest_width == 200);
-	runner_assert(dest_height == 300);
-
 	prop = lyt->get_properties_of_surface(ivisurf);
 	runner_assert_or_return(prop);
 	runner_assert(prop->dest_width == 200);
@@ -491,8 +482,6 @@ RUNNER_TEST(surface_destination_rectangle)
 	const struct ivi_layout_interface *lyt = ctx->layout_interface;
 	struct ivi_layout_surface *ivisurf;
 	const struct ivi_layout_surface_properties *prop;
-	int32_t dest_width;
-	int32_t dest_height;
 
 	ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
 	runner_assert(ivisurf != NULL);
@@ -516,11 +505,6 @@ RUNNER_TEST(surface_destination_rectangle)
 
 	lyt->commit_changes();
 
-	runner_assert(lyt->surface_get_dimension(
-		      ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED);
-	runner_assert(dest_width == 200);
-	runner_assert(dest_height == 300);
-
 	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