ivi-layout: simplify API

Use assert() to check for invalid NULL arguments. Something like that happens
during development and assert() makes it easier to find the error. And it avoids
unnecessary additional error handling.
The hmi-controller asserted anyways so this just moves the assert on level
deeper. Other controller probably do the same thing, or don't check the return
values at all.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2023-02-27 11:19:54 +01:00 committed by Marius Vlad
parent 3805bcad90
commit a3a8431634
3 changed files with 157 additions and 363 deletions

View file

@ -187,7 +187,7 @@ struct ivi_layout_interface {
* The pointer of the created ivi_surface is sent as the void *data argument * The pointer of the created ivi_surface is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*/ */
int32_t (*add_listener_create_surface)(struct wl_listener *listener); void (*add_listener_create_surface)(struct wl_listener *listener);
/** /**
* \brief add a listener for notification when ivi_surface is removed * \brief add a listener for notification when ivi_surface is removed
@ -197,7 +197,7 @@ struct ivi_layout_interface {
* The pointer of the removed ivi_surface is sent as the void *data argument * The pointer of the removed ivi_surface is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*/ */
int32_t (*add_listener_remove_surface)(struct wl_listener *listener); void (*add_listener_remove_surface)(struct wl_listener *listener);
/** /**
* \brief add a listener for notification when ivi_surface is configured * \brief add a listener for notification when ivi_surface is configured
@ -207,7 +207,7 @@ struct ivi_layout_interface {
* The pointer of the configured ivi_surface is sent as the void *data argument * The pointer of the configured ivi_surface is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*/ */
int32_t (*add_listener_configure_surface)(struct wl_listener *listener); void (*add_listener_configure_surface)(struct wl_listener *listener);
/** /**
* \brief add a listener for notification when desktop_surface is configured * \brief add a listener for notification when desktop_surface is configured
@ -217,16 +217,13 @@ struct ivi_layout_interface {
* The pointer of the configured desktop_surface is sent as the void *data argument * The pointer of the configured desktop_surface is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*/ */
int32_t (*add_listener_configure_desktop_surface)(struct wl_listener *listener); void (*add_listener_configure_desktop_surface)(struct wl_listener *listener);
/** /**
* \brief Get all ivi_surfaces which are currently registered and managed * \brief Get all ivi_surfaces which are currently registered and managed
* by the services * by the services
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray); void (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray);
/** /**
* \brief get id of ivi_surface from ivi_layout_surface * \brief get id of ivi_surface from ivi_layout_surface
@ -258,56 +255,44 @@ struct ivi_layout_interface {
/** /**
* \brief Get all Surfaces which are currently registered to a given * \brief Get all Surfaces which are currently registered to a given
* layer and are managed by the services * layer and are managed by the services
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer, void (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer,
int32_t *pLength, int32_t *pLength,
struct ivi_layout_surface ***ppArray); struct ivi_layout_surface ***ppArray);
/** /**
* \brief Set the visibility of a ivi_surface. * \brief Set the visibility of a ivi_surface.
* *
* If a surface is not visible it will not be rendered. * If a surface is not visible it will not be rendered.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf, void (*surface_set_visibility)(struct ivi_layout_surface *ivisurf,
bool newVisibility); bool newVisibility);
/** /**
* \brief Set the opacity of a surface. * \brief Set the opacity of a surface.
* *
* \return IVI_SUCCEEDED if the method call was successful * \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed * \return IVI_FAILED if the specified opacity is out of bounds
*/ */
int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf, int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf,
wl_fixed_t opacity); wl_fixed_t opacity);
/** /**
* \brief Set the area of a ivi_surface which should be used for the rendering. * \brief Set the area of a ivi_surface which should be used for the rendering.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf, void (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height); int32_t width, int32_t height);
/** /**
* \brief Set the destination area of a ivi_surface within a ivi_layer * \brief Set the destination area of a ivi_surface within a ivi_layer
* for rendering. * for rendering.
* *
* The surface will be scaled to this rectangle for rendering. * The surface will be scaled to this rectangle for rendering.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf, void (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height); int32_t width, int32_t height);
/** /**
* \brief add a listener to listen property changes of ivi_surface * \brief add a listener to listen property changes of ivi_surface
@ -316,11 +301,8 @@ struct ivi_layout_interface {
* signal is emitted to the listening controller plugins. * signal is emitted to the listening controller plugins.
* The pointer of the ivi_surface is sent as the void *data argument * The pointer of the ivi_surface is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*surface_add_listener)(struct ivi_layout_surface *ivisurf, void (*surface_add_listener)(struct ivi_layout_surface *ivisurf,
struct wl_listener *listener); struct wl_listener *listener);
/** /**
@ -332,16 +314,15 @@ struct ivi_layout_interface {
/** /**
* \brief set type of transition animation * \brief set type of transition animation
*/ */
int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf, void (*surface_set_transition)(struct ivi_layout_surface *ivisurf,
enum ivi_layout_transition_type type, enum ivi_layout_transition_type type,
uint32_t duration); uint32_t duration);
/** /**
* \brief set duration of transition animation * \brief set duration of transition animation
*/ */
int32_t (*surface_set_transition_duration)( void (*surface_set_transition_duration)(struct ivi_layout_surface *ivisurf,
struct ivi_layout_surface *ivisurf, uint32_t duration);
uint32_t duration);
/** /**
* \brief set id of ivi_layout_surface * \brief set id of ivi_layout_surface
@ -361,7 +342,7 @@ struct ivi_layout_interface {
* The pointer of the created ivi_layer is sent as the void *data argument * The pointer of the created ivi_layer is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*/ */
int32_t (*add_listener_create_layer)(struct wl_listener *listener); void (*add_listener_create_layer)(struct wl_listener *listener);
/** /**
* \brief add a listener for notification when ivi_layer is removed * \brief add a listener for notification when ivi_layer is removed
@ -371,7 +352,7 @@ struct ivi_layout_interface {
* The pointer of the removed ivi_layer is sent as the void *data argument * The pointer of the removed ivi_layer is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*/ */
int32_t (*add_listener_remove_layer)(struct wl_listener *listener); void (*add_listener_remove_layer)(struct wl_listener *listener);
/** /**
* \brief Create a ivi_layer which should be managed by the service * \brief Create a ivi_layer which should be managed by the service
@ -392,11 +373,8 @@ struct ivi_layout_interface {
/** /**
* \brief Get all ivi_layers which are currently registered and managed * \brief Get all ivi_layers which are currently registered and managed
* by the services * by the services
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray); void (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray);
/** /**
* \brief get id of ivi_layer from ivi_layout_layer * \brief get id of ivi_layer from ivi_layout_layer
@ -430,39 +408,30 @@ struct ivi_layout_interface {
* *
* This means all the ivi-layers the ivi-surface was added to. It has * This means all the ivi-layers the ivi-surface was added to. It has
* no relation to geometric overlaps. * no relation to geometric overlaps.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf, void (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf,
int32_t *pLength, int32_t *pLength,
struct ivi_layout_layer ***ppArray); struct ivi_layout_layer ***ppArray);
/** /**
* \brief Get all Layers of the given weston_output * \brief Get all Layers of the given weston_output
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*get_layers_on_screen)(struct weston_output *output, void (*get_layers_on_screen)(struct weston_output *output,
int32_t *pLength, int32_t *pLength,
struct ivi_layout_layer ***ppArray); struct ivi_layout_layer ***ppArray);
/** /**
* \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible, * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible,
* the ivi_layer and its ivi_surfaces will not be rendered. * the ivi_layer and its ivi_surfaces will not be rendered.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer, void (*layer_set_visibility)(struct ivi_layout_layer *ivilayer,
bool newVisibility); bool newVisibility);
/** /**
* \brief Set the opacity of a ivi_layer. * \brief Set the opacity of a ivi_layer.
* *
* \return IVI_SUCCEEDED if the method call was successful * \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed * \return IVI_FAILED if the specified opacity is out of bounds
*/ */
int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer, int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer,
wl_fixed_t opacity); wl_fixed_t opacity);
@ -471,34 +440,25 @@ struct ivi_layout_interface {
* \brief Set the area of a ivi_layer which should be used for the rendering. * \brief Set the area of a ivi_layer which should be used for the rendering.
* *
* Only this part will be visible. * Only this part will be visible.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer, void (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height); int32_t width, int32_t height);
/** /**
* \brief Set the destination area on the display for a ivi_layer. * \brief Set the destination area on the display for a ivi_layer.
* *
* The ivi_layer will be scaled and positioned to this rectangle * The ivi_layer will be scaled and positioned to this rectangle
* for rendering * for rendering
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer, void (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height); int32_t width, int32_t height);
/** /**
* \brief Add a ivi_surface to a ivi_layer which is currently managed by the service * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer, void (*layer_add_surface)(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface *addsurf); struct ivi_layout_surface *addsurf);
/** /**
@ -509,13 +469,10 @@ struct ivi_layout_interface {
/** /**
* \brief Sets render order of ivi_surfaces within a ivi_layer * \brief Sets render order of ivi_surfaces within a ivi_layer
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer, void (*layer_set_render_order)(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface **pSurface, struct ivi_layout_surface **pSurface,
int32_t number); int32_t number);
/** /**
* \brief add a listener to listen property changes of ivi_layer * \brief add a listener to listen property changes of ivi_layer
@ -524,19 +481,16 @@ struct ivi_layout_interface {
* signal is emitted to the listening controller plugins. * signal is emitted to the listening controller plugins.
* The pointer of the ivi_layer is sent as the void *data argument * The pointer of the ivi_layer is sent as the void *data argument
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*layer_add_listener)(struct ivi_layout_layer *ivilayer, void (*layer_add_listener)(struct ivi_layout_layer *ivilayer,
struct wl_listener *listener); struct wl_listener *listener);
/** /**
* \brief set type of transition animation * \brief set type of transition animation
*/ */
int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer, void (*layer_set_transition)(struct ivi_layout_layer *ivilayer,
enum ivi_layout_transition_type type, enum ivi_layout_transition_type type,
uint32_t duration); uint32_t duration);
/** /**
* screen controller interface * screen controller interface
@ -544,31 +498,22 @@ struct ivi_layout_interface {
/** /**
* \brief Get the weston_outputs under the given ivi_layer * \brief Get the weston_outputs under the given ivi_layer
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer, void (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer,
int32_t *pLength, int32_t *pLength,
struct weston_output ***ppArray); struct weston_output ***ppArray);
/** /**
* \brief Add a ivi_layer to a weston_output which is currently managed * \brief Add a ivi_layer to a weston_output which is currently managed
* by the service * by the service
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*screen_add_layer)(struct weston_output *output, void (*screen_add_layer)(struct weston_output *output,
struct ivi_layout_layer *addlayer); struct ivi_layout_layer *addlayer);
/** /**
* \brief Sets render order of ivi_layers on a weston_output * \brief Sets render order of ivi_layers on a weston_output
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*screen_set_render_order)(struct weston_output *output, void (*screen_set_render_order)(struct weston_output *output,
struct ivi_layout_layer **pLayer, struct ivi_layout_layer **pLayer,
const int32_t number); const int32_t number);
@ -576,16 +521,16 @@ struct ivi_layout_interface {
* transition animation for layer * transition animation for layer
*/ */
void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer); void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer);
int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer, void (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer,
uint32_t is_fade_in, uint32_t is_fade_in,
double start_alpha, double end_alpha); double start_alpha, double end_alpha);
/** /**
* surface content dumping for debugging * surface content dumping for debugging
*/ */
int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf, void (*surface_get_size)(struct ivi_layout_surface *ivisurf,
int32_t *width, int32_t *height, int32_t *width, int32_t *height,
int32_t *stride); int32_t *stride);
int32_t (*surface_dump)(struct weston_surface *surface, int32_t (*surface_dump)(struct weston_surface *surface,
void *target, size_t size, void *target, size_t size,
@ -604,12 +549,9 @@ struct ivi_layout_interface {
/** /**
* \brief Remove a ivi_layer to a weston_output which is currently managed * \brief Remove a ivi_layer to a weston_output which is currently managed
* by the service * by the service
*
* \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed
*/ */
int32_t (*screen_remove_layer)(struct weston_output *output, void (*screen_remove_layer)(struct weston_output *output,
struct ivi_layout_layer *removelayer); struct ivi_layout_layer *removelayer);
/** /**
* \brief Add a shell destroy listener only once. * \brief Add a shell destroy listener only once.
@ -620,7 +562,7 @@ struct ivi_layout_interface {
* to the wl_listener::notify callback function of the listener. * to the wl_listener::notify callback function of the listener.
* *
* \return IVI_SUCCEEDED if the method call was successful * \return IVI_SUCCEEDED if the method call was successful
* \return IVI_FAILED if the method call was failed * \return IVI_FAILED if the method was called before
*/ */
int32_t (*shell_add_destroy_listener_once)(struct wl_listener *listener, int32_t (*shell_add_destroy_listener_once)(struct wl_listener *listener,
wl_notify_func_t destroy_handler); wl_notify_func_t destroy_handler);

View file

@ -191,14 +191,14 @@ int32_t
ivi_layout_commit_changes(void); ivi_layout_commit_changes(void);
uint32_t uint32_t
ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf); ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf);
int32_t void
ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height); int32_t width, int32_t height);
int32_t int32_t
ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
wl_fixed_t opacity); wl_fixed_t opacity);
int32_t void
ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
bool newVisibility); bool newVisibility);
void void
@ -209,14 +209,14 @@ ivi_layout_get_surface_from_id(uint32_t id_surface);
int32_t int32_t
ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
wl_fixed_t opacity); wl_fixed_t opacity);
int32_t void
ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
bool newVisibility); bool newVisibility);
int32_t void
ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height); int32_t width, int32_t height);
int32_t void
ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface **pSurface, struct ivi_layout_surface **pSurface,
int32_t number); int32_t number);

View file

@ -938,104 +938,73 @@ clear_view_pending_list(struct ivi_layout_layer *ivilayer)
* Exported APIs of ivi-layout library are implemented from here. * Exported APIs of ivi-layout library are implemented from here.
* Brief of APIs is described in ivi-layout-export.h. * Brief of APIs is described in ivi-layout-export.h.
*/ */
static int32_t static void
ivi_layout_add_listener_create_layer(struct wl_listener *listener) ivi_layout_add_listener_create_layer(struct wl_listener *listener)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
if (listener == NULL) { assert(listener);
weston_log("ivi_layout_add_listener_create_layer: invalid argument\n");
return IVI_FAILED;
}
wl_signal_add(&layout->layer_notification.created, listener); wl_signal_add(&layout->layer_notification.created, listener);
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_add_listener_remove_layer(struct wl_listener *listener) ivi_layout_add_listener_remove_layer(struct wl_listener *listener)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
if (listener == NULL) { assert(listener);
weston_log("ivi_layout_add_listener_remove_layer: invalid argument\n");
return IVI_FAILED;
}
wl_signal_add(&layout->layer_notification.removed, listener); wl_signal_add(&layout->layer_notification.removed, listener);
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_add_listener_create_surface(struct wl_listener *listener) ivi_layout_add_listener_create_surface(struct wl_listener *listener)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
if (listener == NULL) { assert(listener);
weston_log("ivi_layout_add_listener_create_surface: invalid argument\n");
return IVI_FAILED;
}
wl_signal_add(&layout->surface_notification.created, listener); wl_signal_add(&layout->surface_notification.created, listener);
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_add_listener_remove_surface(struct wl_listener *listener) ivi_layout_add_listener_remove_surface(struct wl_listener *listener)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
if (listener == NULL) { assert(listener);
weston_log("ivi_layout_add_listener_remove_surface: invalid argument\n");
return IVI_FAILED;
}
wl_signal_add(&layout->surface_notification.removed, listener); wl_signal_add(&layout->surface_notification.removed, listener);
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_add_listener_configure_surface(struct wl_listener *listener) ivi_layout_add_listener_configure_surface(struct wl_listener *listener)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
if (listener == NULL) { assert(listener);
weston_log("ivi_layout_add_listener_configure_surface: invalid argument\n");
return IVI_FAILED;
}
wl_signal_add(&layout->surface_notification.configure_changed, listener); wl_signal_add(&layout->surface_notification.configure_changed, listener);
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_add_listener_configure_desktop_surface(struct wl_listener *listener) ivi_layout_add_listener_configure_desktop_surface(struct wl_listener *listener)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
if (!listener) { assert(listener);
weston_log("ivi_layout_add_listener_configure_desktop_surface: invalid argument\n");
return IVI_FAILED;
}
wl_signal_add(&layout->surface_notification.configure_desktop_changed, listener); wl_signal_add(&layout->surface_notification.configure_desktop_changed, listener);
return IVI_SUCCEEDED;
} }
static int32_t static int32_t
ivi_layout_shell_add_destroy_listener_once(struct wl_listener *listener, wl_notify_func_t destroy_handler) ivi_layout_shell_add_destroy_listener_once(struct wl_listener *listener, wl_notify_func_t destroy_handler)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
if (!listener || !destroy_handler) {
weston_log("ivi_layout_shell_add_destroy_listener_once: invalid argument\n"); assert(listener);
return IVI_FAILED; assert(destroy_handler);
}
if (wl_signal_get(&layout->shell_notification.destroy_signal, destroy_handler)) if (wl_signal_get(&layout->shell_notification.destroy_signal, destroy_handler))
return IVI_FAILED; return IVI_FAILED;
@ -1087,32 +1056,25 @@ ivi_layout_get_surface_from_id(uint32_t id_surface)
return NULL; return NULL;
} }
static int32_t static void
ivi_layout_surface_add_listener(struct ivi_layout_surface *ivisurf, ivi_layout_surface_add_listener(struct ivi_layout_surface *ivisurf,
struct wl_listener *listener) struct wl_listener *listener)
{ {
if (ivisurf == NULL || listener == NULL) { assert(ivisurf);
weston_log("ivi_layout_surface_add_listener: invalid argument\n"); assert(listener);
return IVI_FAILED;
}
wl_signal_add(&ivisurf->property_changed, listener); wl_signal_add(&ivisurf->property_changed, listener);
return IVI_SUCCEEDED;
} }
static const struct ivi_layout_layer_properties * static const struct ivi_layout_layer_properties *
ivi_layout_get_properties_of_layer(struct ivi_layout_layer *ivilayer) ivi_layout_get_properties_of_layer(struct ivi_layout_layer *ivilayer)
{ {
if (ivilayer == NULL) { assert(ivilayer);
weston_log("ivi_layout_get_properties_of_layer: invalid argument\n");
return NULL;
}
return &ivilayer->prop; return &ivilayer->prop;
} }
static int32_t static void
ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer, ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
int32_t *pLength, int32_t *pLength,
struct weston_output ***ppArray) struct weston_output ***ppArray)
@ -1120,10 +1082,9 @@ ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
int32_t length = 0; int32_t length = 0;
int32_t n = 0; int32_t n = 0;
if (ivilayer == NULL || pLength == NULL || ppArray == NULL) { assert(ivilayer);
weston_log("ivi_layout_get_screens_under_layer: invalid argument\n"); assert(pLength);
return IVI_FAILED; assert(ppArray);
}
if (ivilayer->on_screen != NULL) if (ivilayer->on_screen != NULL)
length = 1; length = 1;
@ -1136,11 +1097,9 @@ ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
} }
*pLength = length; *pLength = length;
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_get_layers(int32_t *pLength, struct ivi_layout_layer ***ppArray) ivi_layout_get_layers(int32_t *pLength, struct ivi_layout_layer ***ppArray)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
@ -1148,10 +1107,8 @@ ivi_layout_get_layers(int32_t *pLength, struct ivi_layout_layer ***ppArray)
int32_t length = 0; int32_t length = 0;
int32_t n = 0; int32_t n = 0;
if (pLength == NULL || ppArray == NULL) { assert(pLength);
weston_log("ivi_layout_get_layers: invalid argument\n"); assert(ppArray);
return IVI_FAILED;
}
length = wl_list_length(&layout->layer_list); length = wl_list_length(&layout->layer_list);
@ -1165,11 +1122,9 @@ ivi_layout_get_layers(int32_t *pLength, struct ivi_layout_layer ***ppArray)
} }
*pLength = length; *pLength = length;
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_get_layers_on_screen(struct weston_output *output, ivi_layout_get_layers_on_screen(struct weston_output *output,
int32_t *pLength, int32_t *pLength,
struct ivi_layout_layer ***ppArray) struct ivi_layout_layer ***ppArray)
@ -1179,10 +1134,9 @@ ivi_layout_get_layers_on_screen(struct weston_output *output,
int32_t length = 0; int32_t length = 0;
int32_t n = 0; int32_t n = 0;
if (output == NULL || pLength == NULL || ppArray == NULL) { assert(output);
weston_log("ivi_layout_get_layers_on_screen: invalid argument\n"); assert(pLength);
return IVI_FAILED; assert(ppArray);
}
iviscrn = get_screen_from_output(output); iviscrn = get_screen_from_output(output);
length = wl_list_length(&iviscrn->order.layer_list); length = wl_list_length(&iviscrn->order.layer_list);
@ -1197,11 +1151,9 @@ ivi_layout_get_layers_on_screen(struct weston_output *output,
} }
*pLength = length; *pLength = length;
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_get_layers_under_surface(struct ivi_layout_surface *ivisurf, ivi_layout_get_layers_under_surface(struct ivi_layout_surface *ivisurf,
int32_t *pLength, int32_t *pLength,
struct ivi_layout_layer ***ppArray) struct ivi_layout_layer ***ppArray)
@ -1210,10 +1162,9 @@ ivi_layout_get_layers_under_surface(struct ivi_layout_surface *ivisurf,
int32_t length = 0; int32_t length = 0;
int32_t n = 0; int32_t n = 0;
if (ivisurf == NULL || pLength == NULL || ppArray == NULL) { assert(ivisurf);
weston_log("ivi_layout_getLayers: invalid argument\n"); assert(pLength);
return IVI_FAILED; assert(ppArray);
}
if (!wl_list_empty(&ivisurf->view_list)) { if (!wl_list_empty(&ivisurf->view_list)) {
/* the Array must be free by module which called this function */ /* the Array must be free by module which called this function */
@ -1233,12 +1184,9 @@ ivi_layout_get_layers_under_surface(struct ivi_layout_surface *ivisurf,
} }
*pLength = length; *pLength = length;
return IVI_SUCCEEDED;
} }
static static void
int32_t
ivi_layout_get_surfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray) ivi_layout_get_surfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray)
{ {
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
@ -1246,10 +1194,8 @@ ivi_layout_get_surfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray)
int32_t length = 0; int32_t length = 0;
int32_t n = 0; int32_t n = 0;
if (pLength == NULL || ppArray == NULL) { assert(pLength);
weston_log("ivi_layout_get_surfaces: invalid argument\n"); assert(ppArray);
return IVI_FAILED;
}
length = wl_list_length(&layout->surface_list); length = wl_list_length(&layout->surface_list);
@ -1263,11 +1209,9 @@ ivi_layout_get_surfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray)
} }
*pLength = length; *pLength = length;
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_get_surfaces_on_layer(struct ivi_layout_layer *ivilayer, ivi_layout_get_surfaces_on_layer(struct ivi_layout_layer *ivilayer,
int32_t *pLength, int32_t *pLength,
struct ivi_layout_surface ***ppArray) struct ivi_layout_surface ***ppArray)
@ -1276,10 +1220,9 @@ ivi_layout_get_surfaces_on_layer(struct ivi_layout_layer *ivilayer,
int32_t length = 0; int32_t length = 0;
int32_t n = 0; int32_t n = 0;
if (ivilayer == NULL || pLength == NULL || ppArray == NULL) { assert(ivilayer);
weston_log("ivi_layout_getSurfaceIDsOnLayer: invalid argument\n"); assert(pLength);
return IVI_FAILED; assert(ppArray);
}
length = wl_list_length(&ivilayer->order.view_list); length = wl_list_length(&ivilayer->order.view_list);
@ -1293,8 +1236,6 @@ ivi_layout_get_surfaces_on_layer(struct ivi_layout_layer *ivilayer,
} }
*pLength = length; *pLength = length;
return IVI_SUCCEEDED;
} }
static struct ivi_layout_layer * static struct ivi_layout_layer *
@ -1340,10 +1281,7 @@ ivi_layout_layer_destroy(struct ivi_layout_layer *ivilayer)
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
struct ivi_layout_view *ivi_view, *next; struct ivi_layout_view *ivi_view, *next;
if (ivilayer == NULL) { assert(ivilayer);
weston_log("ivi_layout_layer_destroy: invalid argument\n");
return;
}
if (--ivilayer->ref_count > 0) if (--ivilayer->ref_count > 0)
return; return;
@ -1363,16 +1301,13 @@ ivi_layout_layer_destroy(struct ivi_layout_layer *ivilayer)
free(ivilayer); free(ivilayer);
} }
int32_t void
ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
bool newVisibility) bool newVisibility)
{ {
struct ivi_layout_layer_properties *prop = NULL; struct ivi_layout_layer_properties *prop = NULL;
if (ivilayer == NULL) { assert(ivilayer);
weston_log("ivi_layout_layer_set_visibility: invalid argument\n");
return IVI_FAILED;
}
prop = &ivilayer->pending.prop; prop = &ivilayer->pending.prop;
prop->visibility = newVisibility; prop->visibility = newVisibility;
@ -1381,8 +1316,6 @@ ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
prop->event_mask |= IVI_NOTIFICATION_VISIBILITY; prop->event_mask |= IVI_NOTIFICATION_VISIBILITY;
else else
prop->event_mask &= ~IVI_NOTIFICATION_VISIBILITY; prop->event_mask &= ~IVI_NOTIFICATION_VISIBILITY;
return IVI_SUCCEEDED;
} }
int32_t int32_t
@ -1391,8 +1324,9 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
{ {
struct ivi_layout_layer_properties *prop = NULL; struct ivi_layout_layer_properties *prop = NULL;
if (ivilayer == NULL || assert(ivilayer);
opacity < wl_fixed_from_double(0.0) ||
if (opacity < wl_fixed_from_double(0.0) ||
wl_fixed_from_double(1.0) < opacity) { wl_fixed_from_double(1.0) < opacity) {
weston_log("ivi_layout_layer_set_opacity: invalid argument\n"); weston_log("ivi_layout_layer_set_opacity: invalid argument\n");
return IVI_FAILED; return IVI_FAILED;
@ -1409,17 +1343,14 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height) int32_t width, int32_t height)
{ {
struct ivi_layout_layer_properties *prop = NULL; struct ivi_layout_layer_properties *prop = NULL;
if (ivilayer == NULL) { assert(ivilayer);
weston_log("ivi_layout_layer_set_source_rectangle: invalid argument\n");
return IVI_FAILED;
}
prop = &ivilayer->pending.prop; prop = &ivilayer->pending.prop;
prop->source_x = x; prop->source_x = x;
@ -1433,21 +1364,16 @@ ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer,
prop->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; prop->event_mask |= IVI_NOTIFICATION_SOURCE_RECT;
else else
prop->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT; prop->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT;
return IVI_SUCCEEDED;
} }
int32_t void
ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height) int32_t width, int32_t height)
{ {
struct ivi_layout_layer_properties *prop = NULL; struct ivi_layout_layer_properties *prop = NULL;
if (ivilayer == NULL) { assert(ivilayer);
weston_log("ivi_layout_layer_set_destination_rectangle: invalid argument\n");
return IVI_FAILED;
}
prop = &ivilayer->pending.prop; prop = &ivilayer->pending.prop;
prop->dest_x = x; prop->dest_x = x;
@ -1461,11 +1387,9 @@ ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
prop->event_mask |= IVI_NOTIFICATION_DEST_RECT; prop->event_mask |= IVI_NOTIFICATION_DEST_RECT;
else else
prop->event_mask &= ~IVI_NOTIFICATION_DEST_RECT; prop->event_mask &= ~IVI_NOTIFICATION_DEST_RECT;
return IVI_SUCCEEDED;
} }
int32_t void
ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface **pSurface, struct ivi_layout_surface **pSurface,
int32_t number) int32_t number)
@ -1473,10 +1397,7 @@ ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
int32_t i = 0; int32_t i = 0;
struct ivi_layout_view * ivi_view; struct ivi_layout_view * ivi_view;
if (ivilayer == NULL) { assert(ivilayer);
weston_log("ivi_layout_layer_set_render_order: invalid argument\n");
return IVI_FAILED;
}
clear_view_pending_list(ivilayer); clear_view_pending_list(ivilayer);
@ -1492,20 +1413,15 @@ ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer,
} }
ivilayer->order.dirty = 1; ivilayer->order.dirty = 1;
return IVI_SUCCEEDED;
} }
int32_t void
ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
bool newVisibility) bool newVisibility)
{ {
struct ivi_layout_surface_properties *prop = NULL; struct ivi_layout_surface_properties *prop = NULL;
if (ivisurf == NULL) { assert(ivisurf);
weston_log("ivi_layout_surface_set_visibility: invalid argument\n");
return IVI_FAILED;
}
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->visibility = newVisibility; prop->visibility = newVisibility;
@ -1514,8 +1430,6 @@ ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
prop->event_mask |= IVI_NOTIFICATION_VISIBILITY; prop->event_mask |= IVI_NOTIFICATION_VISIBILITY;
else else
prop->event_mask &= ~IVI_NOTIFICATION_VISIBILITY; prop->event_mask &= ~IVI_NOTIFICATION_VISIBILITY;
return IVI_SUCCEEDED;
} }
int32_t int32_t
@ -1524,8 +1438,9 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
{ {
struct ivi_layout_surface_properties *prop = NULL; struct ivi_layout_surface_properties *prop = NULL;
if (ivisurf == NULL || assert(ivisurf);
opacity < wl_fixed_from_double(0.0) ||
if (opacity < wl_fixed_from_double(0.0) ||
wl_fixed_from_double(1.0) < opacity) { wl_fixed_from_double(1.0) < opacity) {
weston_log("ivi_layout_surface_set_opacity: invalid argument\n"); weston_log("ivi_layout_surface_set_opacity: invalid argument\n");
return IVI_FAILED; return IVI_FAILED;
@ -1542,17 +1457,14 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
int32_t void
ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height) int32_t width, int32_t height)
{ {
struct ivi_layout_surface_properties *prop = NULL; struct ivi_layout_surface_properties *prop = NULL;
if (ivisurf == NULL) { assert(ivisurf);
weston_log("ivi_layout_surface_set_destination_rectangle: invalid argument\n");
return IVI_FAILED;
}
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->start_x = prop->dest_x; prop->start_x = prop->dest_x;
@ -1570,8 +1482,6 @@ ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
prop->event_mask |= IVI_NOTIFICATION_DEST_RECT; prop->event_mask |= IVI_NOTIFICATION_DEST_RECT;
else else
prop->event_mask &= ~IVI_NOTIFICATION_DEST_RECT; prop->event_mask &= ~IVI_NOTIFICATION_DEST_RECT;
return IVI_SUCCEEDED;
} }
void void
@ -1594,16 +1504,14 @@ ivi_layout_surface_set_size(struct ivi_layout_surface *ivisurf,
assert(0); assert(0);
} }
static int32_t static void
ivi_layout_screen_add_layer(struct weston_output *output, ivi_layout_screen_add_layer(struct weston_output *output,
struct ivi_layout_layer *addlayer) struct ivi_layout_layer *addlayer)
{ {
struct ivi_layout_screen *iviscrn; struct ivi_layout_screen *iviscrn;
if (output == NULL || addlayer == NULL) { assert(output);
weston_log("ivi_layout_screen_add_layer: invalid argument\n"); assert(addlayer);
return IVI_FAILED;
}
iviscrn = get_screen_from_output(output); iviscrn = get_screen_from_output(output);
@ -1616,20 +1524,16 @@ ivi_layout_screen_add_layer(struct weston_output *output,
wl_list_insert(&iviscrn->pending.layer_list, &addlayer->pending.link); wl_list_insert(&iviscrn->pending.layer_list, &addlayer->pending.link);
iviscrn->order.dirty = 1; iviscrn->order.dirty = 1;
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_screen_remove_layer(struct weston_output *output, ivi_layout_screen_remove_layer(struct weston_output *output,
struct ivi_layout_layer *removelayer) struct ivi_layout_layer *removelayer)
{ {
struct ivi_layout_screen *iviscrn; struct ivi_layout_screen *iviscrn;
if (output == NULL || removelayer == NULL) { assert(output);
weston_log("ivi_layout_screen_remove_layer: invalid argument\n"); assert(removelayer);
return IVI_FAILED;
}
iviscrn = get_screen_from_output(output); iviscrn = get_screen_from_output(output);
@ -1637,11 +1541,9 @@ ivi_layout_screen_remove_layer(struct weston_output *output,
wl_list_init(&removelayer->pending.link); wl_list_init(&removelayer->pending.link);
iviscrn->order.dirty = 1; iviscrn->order.dirty = 1;
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_screen_set_render_order(struct weston_output *output, ivi_layout_screen_set_render_order(struct weston_output *output,
struct ivi_layout_layer **pLayer, struct ivi_layout_layer **pLayer,
const int32_t number) const int32_t number)
@ -1651,10 +1553,7 @@ ivi_layout_screen_set_render_order(struct weston_output *output,
struct ivi_layout_layer *next = NULL; struct ivi_layout_layer *next = NULL;
int32_t i = 0; int32_t i = 0;
if (output == NULL) { assert(output);
weston_log("ivi_layout_screen_set_render_order: invalid argument\n");
return IVI_FAILED;
}
iviscrn = get_screen_from_output(output); iviscrn = get_screen_from_output(output);
@ -1673,8 +1572,6 @@ ivi_layout_screen_set_render_order(struct weston_output *output,
} }
iviscrn->order.dirty = 1; iviscrn->order.dirty = 1;
return IVI_SUCCEEDED;
} }
/** /**
@ -1688,7 +1585,7 @@ ivi_layout_surface_get_weston_surface(struct ivi_layout_surface *ivisurf)
return ivisurf != NULL ? ivisurf->surface : NULL; return ivisurf != NULL ? ivisurf->surface : NULL;
} }
static int32_t static void
ivi_layout_surface_get_size(struct ivi_layout_surface *ivisurf, ivi_layout_surface_get_size(struct ivi_layout_surface *ivisurf,
int32_t *width, int32_t *height, int32_t *width, int32_t *height,
int32_t *stride) int32_t *stride)
@ -1697,10 +1594,7 @@ ivi_layout_surface_get_size(struct ivi_layout_surface *ivisurf,
int32_t h; int32_t h;
const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */ const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */
if (ivisurf == NULL || ivisurf->surface == NULL) { assert(ivisurf);
weston_log("%s: invalid argument\n", __func__);
return IVI_FAILED;
}
weston_surface_get_content_size(ivisurf->surface, &w, &h); weston_surface_get_content_size(ivisurf->surface, &w, &h);
@ -1712,45 +1606,34 @@ ivi_layout_surface_get_size(struct ivi_layout_surface *ivisurf,
if (stride != NULL) if (stride != NULL)
*stride = w * bytespp; *stride = w * bytespp;
return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_layer_add_listener(struct ivi_layout_layer *ivilayer, ivi_layout_layer_add_listener(struct ivi_layout_layer *ivilayer,
struct wl_listener *listener) struct wl_listener *listener)
{ {
if (ivilayer == NULL || listener == NULL) { assert(ivilayer);
weston_log("ivi_layout_layer_add_listener: invalid argument\n"); assert(listener);
return IVI_FAILED;
}
wl_signal_add(&ivilayer->property_changed, listener); wl_signal_add(&ivilayer->property_changed, listener);
return IVI_SUCCEEDED;
} }
static const struct ivi_layout_surface_properties * static const struct ivi_layout_surface_properties *
ivi_layout_get_properties_of_surface(struct ivi_layout_surface *ivisurf) ivi_layout_get_properties_of_surface(struct ivi_layout_surface *ivisurf)
{ {
if (ivisurf == NULL) { assert(ivisurf);
weston_log("ivi_layout_get_properties_of_surface: invalid argument\n");
return NULL;
}
return &ivisurf->prop; return &ivisurf->prop;
} }
static int32_t static void
ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer, ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface *addsurf) struct ivi_layout_surface *addsurf)
{ {
struct ivi_layout_view *ivi_view; struct ivi_layout_view *ivi_view;
if (ivilayer == NULL || addsurf == NULL) { assert(ivilayer);
weston_log("ivi_layout_layer_add_surface: invalid argument\n"); assert(addsurf);
return IVI_FAILED;
}
ivi_view = get_ivi_view(ivilayer, addsurf); ivi_view = get_ivi_view(ivilayer, addsurf);
if (!ivi_view) if (!ivi_view)
@ -1760,8 +1643,6 @@ ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer,
wl_list_insert(&ivilayer->pending.view_list, &ivi_view->pending_link); wl_list_insert(&ivilayer->pending.view_list, &ivi_view->pending_link);
ivilayer->order.dirty = 1; ivilayer->order.dirty = 1;
return IVI_SUCCEEDED;
} }
static void static void
@ -1784,17 +1665,14 @@ ivi_layout_layer_remove_surface(struct ivi_layout_layer *ivilayer,
} }
} }
static int32_t static void
ivi_layout_surface_set_source_rectangle(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_source_rectangle(struct ivi_layout_surface *ivisurf,
int32_t x, int32_t y, int32_t x, int32_t y,
int32_t width, int32_t height) int32_t width, int32_t height)
{ {
struct ivi_layout_surface_properties *prop = NULL; struct ivi_layout_surface_properties *prop = NULL;
if (ivisurf == NULL) { assert(ivisurf);
weston_log("ivi_layout_surface_set_source_rectangle: invalid argument\n");
return IVI_FAILED;
}
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->source_x = x; prop->source_x = x;
@ -1808,8 +1686,6 @@ ivi_layout_surface_set_source_rectangle(struct ivi_layout_surface *ivisurf,
prop->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; prop->event_mask |= IVI_NOTIFICATION_SOURCE_RECT;
else else
prop->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT; prop->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT;
return IVI_SUCCEEDED;
} }
int32_t int32_t
@ -1840,53 +1716,39 @@ ivi_layout_commit_current(void)
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_layer_set_transition(struct ivi_layout_layer *ivilayer, ivi_layout_layer_set_transition(struct ivi_layout_layer *ivilayer,
enum ivi_layout_transition_type type, enum ivi_layout_transition_type type,
uint32_t duration) uint32_t duration)
{ {
if (ivilayer == NULL) { assert(ivilayer);
weston_log("%s: invalid argument\n", __func__);
return -1;
}
ivilayer->pending.prop.transition_type = type; ivilayer->pending.prop.transition_type = type;
ivilayer->pending.prop.transition_duration = duration; ivilayer->pending.prop.transition_duration = duration;
return 0;
} }
static int32_t static void
ivi_layout_layer_set_fade_info(struct ivi_layout_layer* ivilayer, ivi_layout_layer_set_fade_info(struct ivi_layout_layer* ivilayer,
uint32_t is_fade_in, uint32_t is_fade_in,
double start_alpha, double end_alpha) double start_alpha, double end_alpha)
{ {
if (ivilayer == NULL) { assert(ivilayer);
weston_log("%s: invalid argument\n", __func__);
return -1;
}
ivilayer->pending.prop.is_fade_in = is_fade_in; ivilayer->pending.prop.is_fade_in = is_fade_in;
ivilayer->pending.prop.start_alpha = start_alpha; ivilayer->pending.prop.start_alpha = start_alpha;
ivilayer->pending.prop.end_alpha = end_alpha; ivilayer->pending.prop.end_alpha = end_alpha;
return 0;
} }
static int32_t static void
ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf,
uint32_t duration) uint32_t duration)
{ {
struct ivi_layout_surface_properties *prop; struct ivi_layout_surface_properties *prop;
if (ivisurf == NULL) { assert(ivisurf);
weston_log("%s: invalid argument\n", __func__);
return -1;
}
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->transition_duration = duration*10; prop->transition_duration = duration*10;
return 0;
} }
/* /*
@ -1902,10 +1764,7 @@ ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf,
struct ivi_layout *layout = get_instance(); struct ivi_layout *layout = get_instance();
struct ivi_layout_surface *search_ivisurf = NULL; struct ivi_layout_surface *search_ivisurf = NULL;
if (!ivisurf) { assert(ivisurf);
weston_log("%s: invalid argument\n", __func__);
return IVI_FAILED;
}
if (ivisurf->id_surface != IVI_INVALID_ID) { if (ivisurf->id_surface != IVI_INVALID_ID) {
weston_log("surface id can only be set once\n"); weston_log("surface id can only be set once\n");
@ -1926,22 +1785,18 @@ ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf,
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
static int32_t static void
ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf, ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf,
enum ivi_layout_transition_type type, enum ivi_layout_transition_type type,
uint32_t duration) uint32_t duration)
{ {
struct ivi_layout_surface_properties *prop; struct ivi_layout_surface_properties *prop;
if (ivisurf == NULL) { assert(ivisurf);
weston_log("%s: invalid argument\n", __func__);
return -1;
}
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->transition_type = type; prop->transition_type = type;
prop->transition_duration = duration; prop->transition_duration = duration;
return 0;
} }
static int32_t static int32_t
@ -1951,10 +1806,7 @@ ivi_layout_surface_dump(struct weston_surface *surface,
{ {
int result = 0; int result = 0;
if (surface == NULL) { assert(surface);
weston_log("%s: invalid argument\n", __func__);
return IVI_FAILED;
}
result = weston_surface_copy_content( result = weston_surface_copy_content(
surface, target, size, surface, target, size,