diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-06-16 18:36:17 +0900 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-06-30 11:35:26 +0900 |
commit | e5991dd245cc1a142f5a1b725611a482db1586a1 (patch) | |
tree | 82dc5ca3793d4ba20542c2326be96cdb18c295d7 | |
parent | fdac838b596336f28c5e98346917d8d6050623fa (diff) | |
download | wayland-ivi-extension-e5991dd245cc1a142f5a1b725611a482db1586a1.tar.gz |
ilmControl: Add listener of wl_output for child context.
This is because an event; ivi-controller.ivi-controller_layer.screen needs wl_output so wl_output shall be binded.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rw-r--r-- | ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c index 6a1ce8c..888924c 100644 --- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c @@ -336,6 +336,7 @@ struct wayland_context { struct wl_registry *registry; struct wl_compositor *compositor; struct ivi_controller *controller; + uint32_t num_screen; struct wl_list list_surface; struct wl_list list_layer; @@ -1778,6 +1779,33 @@ registry_handle_control_for_child(void *data, fprintf(stderr, "Failed to add ivi_controller listener\n"); return; } + } else if (strcmp(interface, "wl_output") == 0) { + struct screen_context *ctx_scrn = calloc(1, sizeof *ctx_scrn); + if (ctx_scrn == NULL) { + fprintf(stderr, "Failed to allocate memory for screen_context\n"); + return; + } + wl_list_init(&ctx_scrn->link); + ctx_scrn->output = wl_registry_bind(registry, name, + &wl_output_interface, 1); + if (ctx_scrn->output == NULL) { + free(ctx_scrn); + fprintf(stderr, "Failed to registry bind wl_output\n"); + return; + } + + if (wl_output_add_listener(ctx_scrn->output, + &output_listener, + ctx_scrn)) { + free(ctx_scrn); + fprintf(stderr, "Failed to add wl_output listener\n"); + return; + } + + ctx_scrn->id_screen = ctx->num_screen; + ctx->num_screen++; + wl_list_init(&ctx_scrn->order.list_layer); + wl_list_insert(&ctx->list_screen, &ctx_scrn->link); } } |