diff options
author | Emre Ucan <eucan@de.adit-jv.com> | 2015-07-01 11:17:59 +0200 |
---|---|---|
committer | Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> | 2015-07-06 18:41:04 +0900 |
commit | ab794a09394f80ef93f7acb3e32922c820de81b3 (patch) | |
tree | 14787f0c41f69ef279edafe3eb5f677274476dd3 /ivi-layermanagement-api/ilmClient | |
parent | 6c8c6efd3a4564b09b83f577035d46d56556b431 (diff) | |
download | wayland-ivi-extension-ab794a09394f80ef93f7acb3e32922c820de81b3.tar.gz |
ilmClient: remove ilm_getScreenResolution related implementation
it is moved to ilmControl, because clients do not need this API to get
screen resolution. They can use wl_output protocol to get this information.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Diffstat (limited to 'ivi-layermanagement-api/ilmClient')
-rw-r--r-- | ivi-layermanagement-api/ilmClient/src/ilm_client.c | 8 | ||||
-rw-r--r-- | ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c | 206 |
2 files changed, 0 insertions, 214 deletions
diff --git a/ivi-layermanagement-api/ilmClient/src/ilm_client.c b/ivi-layermanagement-api/ilmClient/src/ilm_client.c index 5110f11..374ecf4 100644 --- a/ivi-layermanagement-api/ilmClient/src/ilm_client.c +++ b/ivi-layermanagement-api/ilmClient/src/ilm_client.c @@ -49,14 +49,6 @@ ilmClient_destroy(void) } ILM_EXPORT ilmErrorTypes -ilm_getScreenResolution(t_ilm_uint screenID, - t_ilm_uint* pWidth, t_ilm_uint* pHeight) -{ - return gIlmClientPlatformFunc.getScreenResolution( - screenID, pWidth, pHeight); -} - -ILM_EXPORT ilmErrorTypes ilm_surfaceCreate(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, ilmPixelFormat pixelFormat, t_ilm_surface* pSurfaceId) diff --git a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c index 67e86f7..960dfa8 100644 --- a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c +++ b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c @@ -27,8 +27,6 @@ #include "wayland-util.h" #include "ivi-application-client-protocol.h" -static ilmErrorTypes wayland_getScreenResolution(t_ilm_uint screenID, - t_ilm_uint* pWidth, t_ilm_uint* pHeight); static ilmErrorTypes wayland_surfaceCreate(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, ilmPixelFormat pixelFormat, @@ -40,8 +38,6 @@ static ilmErrorTypes wayland_surfaceInitialize(t_ilm_surface *pSurfaceId); void init_ilmClientPlatformTable(void) { - gIlmClientPlatformFunc.getScreenResolution = - wayland_getScreenResolution; gIlmClientPlatformFunc.surfaceCreate = wayland_surfaceCreate; gIlmClientPlatformFunc.surfaceRemove = @@ -62,16 +58,6 @@ struct surface_context { struct wl_list link; }; -struct screen_context { - struct wl_output *output; - t_ilm_uint id_screen; - - uint32_t width; - uint32_t height; - - struct wl_list link; -}; - struct ilm_client_context { int32_t valid; struct wl_display *display; @@ -80,15 +66,10 @@ struct ilm_client_context { struct ivi_application *ivi_application; struct wl_event_queue *queue; - int32_t num_screen; struct wl_list list_surface; - struct wl_list list_screen; uint32_t internal_id_surface; uint32_t name_controller; - - struct wl_registry *registry_for_output; - struct wl_display *display_for_output; }; static void @@ -122,73 +103,6 @@ wayland_client_gen_surface_id(struct ilm_client_context *ctx) } static void -output_listener_geometry(void *data, - struct wl_output *wl_output, - int32_t x, - int32_t y, - int32_t physical_width, - int32_t physical_height, - int32_t subpixel, - const char *make, - const char *model, - int32_t transform) -{ - struct screen_context *ctx_scrn = data; - (void)wl_output; - (void)x; - (void)y; - (void)subpixel; - (void)make; - (void)model; - (void)transform; - - ctx_scrn->width = physical_width; - ctx_scrn->height = physical_height; -} - -static void -output_listener_mode(void *data, - struct wl_output *wl_output, - uint32_t flags, - int32_t width, - int32_t height, - int32_t refresh) -{ - (void)data; - (void)wl_output; - (void)flags; - (void)width; - (void)height; - (void)refresh; -} - -static void -output_listener_done(void *data, - struct wl_output *output) -{ - (void)data; - (void)output; -} - -static void -output_listener_scale(void *data, - struct wl_output *output, - int32_t factor) -{ - (void)data; - (void)output; - (void)factor; -} - -static struct -wl_output_listener output_listener = { - output_listener_geometry, - output_listener_mode, - output_listener_done, - output_listener_scale -}; - -static void registry_handle_client(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) @@ -217,54 +131,6 @@ static const struct wl_registry_listener registry_client_listener = { registry_handle_client_remove }; -static void -registry_handle_client_for_output(void *data, struct wl_registry *registry, - uint32_t name, const char *interface, - uint32_t version) -{ - struct ilm_client_context *ctx = data; - (void)version; - - 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_insert(&ctx->list_screen, &ctx_scrn->link); - } -} - -static void -registry_handle_client_for_output_remove(void *data, struct wl_registry *registry, - uint32_t name) -{ -} - -static const struct wl_registry_listener registry_client_listener_for_output = { - registry_handle_client_for_output, - registry_handle_client_for_output_remove -}; - static struct ilm_client_context ilm_context = {0}; static void @@ -296,19 +162,6 @@ destroy_client_resouses(void) } } - { - struct screen_context *ctx_scrn = NULL; - struct screen_context *next = NULL; - wl_list_for_each_safe(ctx_scrn, next, &ctx->list_screen, link) { - if (ctx_scrn->output != NULL) { - wl_output_destroy(ctx_scrn->output); - } - - wl_list_remove(&ctx_scrn->link); - free(ctx_scrn); - } - } - if (ctx->ivi_application != NULL) { ivi_application_destroy(ctx->ivi_application); ctx->ivi_application = NULL; @@ -325,13 +178,6 @@ destroy_client_resouses(void) wl_registry_destroy(ctx->registry); ctx->registry = NULL; } - - if (ctx->registry_for_output) { - wl_registry_destroy(ctx->registry_for_output); - ctx->registry_for_output = NULL; - wl_display_disconnect(ctx->display_for_output); - ctx->display_for_output = NULL; - } } static ilmErrorTypes @@ -355,9 +201,6 @@ init_client(void) ctx->display = wl_display_connect(NULL); } - ctx->num_screen = 0; - - wl_list_init(&ctx->list_screen); wl_list_init(&ctx->list_surface); ctx->queue = wl_display_create_queue(ctx->display); @@ -381,31 +224,6 @@ init_client(void) return; } - { - /* For output, use independent display connection. - Because threre are duplicate wl_output bindings in a client, - when using a display connection that is shared - between ilmClient and ilmContol. */ - ctx->display_for_output = wl_display_connect(NULL); - if (ctx->display_for_output == NULL) { - fprintf(stderr, "Failed to connect display for output at ilm_client\n"); - return; - } - - ctx->registry_for_output = wl_display_get_registry(ctx->display_for_output); - if (ctx->registry_for_output == NULL) { - fprintf(stderr, "Failed to get registry for output\n"); - return; - } - if (wl_registry_add_listener(ctx->registry_for_output, - ®istry_client_listener_for_output, ctx)) { - fprintf(stderr, "Failed to add registry listener\n"); - return; - } - wl_display_dispatch(ctx->display_for_output); - wl_display_roundtrip(ctx->display_for_output); - } - ctx->valid = 1; } @@ -446,30 +264,6 @@ create_client_surface(struct ilm_client_context *ctx, } static ilmErrorTypes -wayland_getScreenResolution(t_ilm_uint screenID, - t_ilm_uint* pWidth, - t_ilm_uint* pHeight) -{ - ilmErrorTypes returnValue = ILM_FAILED; - struct ilm_client_context *ctx = get_client_instance(); - - if ((pWidth != NULL) && (pHeight != NULL)) - { - struct screen_context *ctx_scrn; - wl_list_for_each(ctx_scrn, &ctx->list_screen, link) { - if (screenID == ctx_scrn->id_screen) { - *pWidth = ctx_scrn->width; - *pHeight = ctx_scrn->height; - returnValue = ILM_SUCCESS; - break; - } - } - } - - return returnValue; -} - -static ilmErrorTypes wayland_surfaceCreate(t_ilm_nativehandle nativehandle, t_ilm_int width, t_ilm_int height, |