controller_layer_listener_destroyed_child
};
-static void
-controller_layer_listener_visibility_main(void *data,
- struct ivi_controller_layer *controller,
- int32_t visibility)
-{
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- ctx_layer->prop.visibility = (t_ilm_bool)visibility;
-}
-
-static void
-controller_layer_listener_opacity_main(void *data,
- struct ivi_controller_layer *controller,
- wl_fixed_t opacity)
-{
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- ctx_layer->prop.opacity = (t_ilm_float)wl_fixed_to_double(opacity);
-}
-
-static void
-controller_layer_listener_source_rectangle_main(void *data,
- struct ivi_controller_layer *controller,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height)
-{
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- ctx_layer->prop.sourceX = (t_ilm_uint)x;
- ctx_layer->prop.sourceY = (t_ilm_uint)y;
- ctx_layer->prop.sourceWidth = (t_ilm_uint)width;
- ctx_layer->prop.sourceHeight = (t_ilm_uint)height;
- if (ctx_layer->prop.origSourceWidth == 0) {
- ctx_layer->prop.origSourceWidth = (t_ilm_uint)width;
- }
- if (ctx_layer->prop.origSourceHeight == 0) {
- ctx_layer->prop.origSourceHeight = (t_ilm_uint)height;
- }
-}
-
-static void
-controller_layer_listener_destination_rectangle_main(void *data,
- struct ivi_controller_layer *controller,
- int32_t x,
- int32_t y,
- int32_t width,
- int32_t height)
-{
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- ctx_layer->prop.destX = (t_ilm_uint)x;
- ctx_layer->prop.destY = (t_ilm_uint)y;
- ctx_layer->prop.destWidth = (t_ilm_uint)width;
- ctx_layer->prop.destHeight = (t_ilm_uint)height;
-}
-
-static void
-controller_layer_listener_configuration_main(void *data,
- struct ivi_controller_layer *controller,
- int32_t width,
- int32_t height)
-{
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- ctx_layer->prop.sourceWidth = (t_ilm_uint)width;
- ctx_layer->prop.sourceHeight = (t_ilm_uint)height;
-}
-
-static void
-controller_layer_listener_orientation_main(void *data,
- struct ivi_controller_layer *controller,
- int32_t orientation)
-{
- ilmOrientation ilmorientation = ILM_ZERO;
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- switch(orientation) {
- case IVI_CONTROLLER_SURFACE_ORIENTATION_0_DEGREES:
- ilmorientation = ILM_ZERO;
- break;
- case IVI_CONTROLLER_SURFACE_ORIENTATION_90_DEGREES:
- ilmorientation = ILM_NINETY;
- break;
- case IVI_CONTROLLER_SURFACE_ORIENTATION_180_DEGREES:
- ilmorientation = ILM_ONEHUNDREDEIGHTY;
- break;
- case IVI_CONTROLLER_SURFACE_ORIENTATION_270_DEGREES:
- ilmorientation = ILM_TWOHUNDREDSEVENTY;
- break;
- default:
- break;
- }
-
- ctx_layer->prop.orientation = ilmorientation;
-}
-
-static void
-controller_layer_listener_screen_main(void *data,
- struct ivi_controller_layer *controller,
- struct wl_output *output)
-{
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- if (output == NULL) {
- remove_orderlayer_from_screen(&ctx->main_ctx, ctx_layer);
- } else {
- add_orderlayer_to_screen(&ctx->main_ctx, ctx_layer, output);
- }
-}
-
-static void
-controller_layer_listener_destroyed_main(void *data,
- struct ivi_controller_layer *controller)
-{
- struct ilm_control_context *ctx = data;
- struct layer_context *ctx_layer = NULL;
-
- ctx_layer = get_layer_context(&ctx->main_ctx, controller);
- if (ctx_layer == NULL) {
- fprintf(stderr, "Invalid controller_layer in %s\n", __FUNCTION__);
- return;
- }
-
- wl_list_remove(&ctx_layer->link);
- free(ctx_layer);
-}
-
-static struct ivi_controller_layer_listener controller_layer_listener_main =
-{
- controller_layer_listener_visibility_main,
- controller_layer_listener_opacity_main,
- controller_layer_listener_source_rectangle_main,
- controller_layer_listener_destination_rectangle_main,
- controller_layer_listener_configuration_main,
- controller_layer_listener_orientation_main,
- controller_layer_listener_screen_main,
- controller_layer_listener_destroyed_main
-};
-
-
static struct layer_context*
get_layer_context(struct wayland_context *ctx,
struct ivi_controller_layer *ivi_layer)