ivi-shell: remove ivi_layout_surface_get_dimension API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
dev
Ucan, Emre \(ADITG/SW1\) 9 years ago committed by Bryce Harrington
parent dfc2d76432
commit c507f67f9e
  1. 9
      ivi-shell/ivi-layout-export.h
  2. 3
      ivi-shell/ivi-layout-private.h
  3. 16
      ivi-shell/ivi-layout.c
  4. 7
      ivi-shell/ivi-shell.c
  5. 7
      tests/ivi_layout-internal-test.c
  6. 28
      tests/ivi_layout-test-plugin.c

@ -329,15 +329,6 @@ struct ivi_layout_interface {
int32_t (*surface_set_dimension)(struct ivi_layout_surface *ivisurf, int32_t (*surface_set_dimension)(struct ivi_layout_surface *ivisurf,
int32_t dest_width, int32_t dest_height); 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. * \brief Sets the orientation of a ivi_surface.
* *

@ -171,9 +171,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
uint32_t id_surface); uint32_t id_surface);
void void
ivi_layout_init_with_compositor(struct weston_compositor *ec); 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 void
ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf, ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf,
struct wl_listener* listener); struct wl_listener* listener);

@ -2102,21 +2102,6 @@ ivi_layout_surface_set_dimension(struct ivi_layout_surface *ivisurf,
return IVI_SUCCEEDED; 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 static int32_t
ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf,
int32_t dest_x, int32_t dest_y) int32_t dest_x, int32_t dest_y)
@ -2676,7 +2661,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
.surface_set_destination_rectangle = ivi_layout_surface_set_destination_rectangle, .surface_set_destination_rectangle = ivi_layout_surface_set_destination_rectangle,
.surface_set_position = ivi_layout_surface_set_position, .surface_set_position = ivi_layout_surface_set_position,
.surface_set_dimension = ivi_layout_surface_set_dimension, .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_set_orientation = ivi_layout_surface_set_orientation,
.surface_get_orientation = ivi_layout_surface_get_orientation, .surface_get_orientation = ivi_layout_surface_get_orientation,
.surface_set_content_observer = ivi_layout_surface_set_content_observer, .surface_set_content_observer = ivi_layout_surface_set_content_observer,

@ -88,11 +88,8 @@ surface_configure_notify(struct wl_listener *listener, void *data)
struct ivi_shell_surface, struct ivi_shell_surface,
configured_listener); configured_listener);
int32_t dest_width = 0; int32_t dest_width = layout_surf->prop.dest_width;
int32_t dest_height = 0; int32_t dest_height = layout_surf->prop.dest_height;
ivi_layout_surface_get_dimension(layout_surf,
&dest_width, &dest_height);
if (shell_surf->resource) if (shell_surf->resource)
ivi_surface_send_configure(shell_surf->resource, ivi_surface_send_configure(shell_surf->resource,

@ -96,17 +96,10 @@ static void
test_surface_bad_dimension(struct test_context *ctx) test_surface_bad_dimension(struct test_context *ctx)
{ {
const struct ivi_layout_interface *lyt = ctx->layout_interface; 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); iassert(lyt->surface_set_dimension(NULL, 200, 300) == IVI_FAILED);
lyt->commit_changes(); 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 static void

@ -426,32 +426,23 @@ RUNNER_TEST(surface_dimension)
const struct ivi_layout_interface *lyt = ctx->layout_interface; const struct ivi_layout_interface *lyt = ctx->layout_interface;
struct ivi_layout_surface *ivisurf; struct ivi_layout_surface *ivisurf;
const struct ivi_layout_surface_properties *prop; 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)); ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
runner_assert(ivisurf != NULL); runner_assert(ivisurf != NULL);
runner_assert(lyt->surface_get_dimension( prop = lyt->get_properties_of_surface(ivisurf);
ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED); runner_assert_or_return(prop);
runner_assert(dest_width == 1); runner_assert(prop->dest_width == 1);
runner_assert(dest_height == 1); runner_assert(prop->dest_height == 1);
runner_assert(IVI_SUCCEEDED == runner_assert(IVI_SUCCEEDED ==
lyt->surface_set_dimension(ivisurf, 200, 300)); lyt->surface_set_dimension(ivisurf, 200, 300));
runner_assert(lyt->surface_get_dimension( runner_assert(prop->dest_width == 1);
ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED); runner_assert(prop->dest_height == 1);
runner_assert(dest_width == 1);
runner_assert(dest_height == 1);
lyt->commit_changes(); 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); prop = lyt->get_properties_of_surface(ivisurf);
runner_assert_or_return(prop); runner_assert_or_return(prop);
runner_assert(prop->dest_width == 200); runner_assert(prop->dest_width == 200);
@ -491,8 +482,6 @@ RUNNER_TEST(surface_destination_rectangle)
const struct ivi_layout_interface *lyt = ctx->layout_interface; const struct ivi_layout_interface *lyt = ctx->layout_interface;
struct ivi_layout_surface *ivisurf; struct ivi_layout_surface *ivisurf;
const struct ivi_layout_surface_properties *prop; 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)); ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
runner_assert(ivisurf != NULL); runner_assert(ivisurf != NULL);
@ -516,11 +505,6 @@ RUNNER_TEST(surface_destination_rectangle)
lyt->commit_changes(); 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); prop = lyt->get_properties_of_surface(ivisurf);
runner_assert_or_return(prop); runner_assert_or_return(prop);
runner_assert(prop->dest_width == 200); runner_assert(prop->dest_width == 200);

Loading…
Cancel
Save