[PATCH weston] ivi-layout: apply opacity to weston_view correctly
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> update_opacity is only called when a ivi-surface is visible. But the previous code also checks event masks redundantly. However if the event happens when ivi-surface is invisible, opacity is not calculated. This patch removes this redundant check to fix potential bug. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> --- ivi-shell/ivi-layout.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index b90a437..3de1405 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -325,12 +325,9 @@ update_opacity(struct ivi_layout_layer *ivilayer, double layer_alpha = wl_fixed_to_double(ivilayer->prop.opacity); double surf_alpha = wl_fixed_to_double(ivisurf->prop.opacity); - if ((ivilayer->event_mask & IVI_NOTIFICATION_OPACITY) || - (ivisurf->event_mask & IVI_NOTIFICATION_OPACITY)) { - tmpview = get_weston_view(ivisurf); - assert(tmpview != NULL); - tmpview->alpha = layer_alpha * surf_alpha; - } + tmpview = get_weston_view(ivisurf); + assert(tmpview != NULL); + tmpview->alpha = layer_alpha * surf_alpha; } static void -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston] hmi-controller: remove duplicate commit_changes in random mode
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Previous code cleaned up surfaces in layer once and then added surfaces to a layer in random. In this flow, two commitchanges are required. This patch proposes that it avoids calling add_surface if a surface is already added to a layer in random. In this flow, cleaning up surfaces is not required. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> --- ivi-shell/hmi-controller.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 77426bc..8a81f5c 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -418,24 +418,18 @@ mode_random_replace(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface *ivisurf = NULL; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; int32_t i = 0; + int32_t j = 0; int32_t layer_idx = 0; + int32_t surface_len_on_layer = 0; + struct ivi_layout_surface **ivisurfs = NULL; layers = MEM_ALLOC(sizeof(*layers) * hmi_ctrl->screen_num); wl_list_for_each(application_layer, layer_list, link) { layers[layer_idx] = application_layer; - ivi_layout_interface->layer_set_render_order(layers[layer_idx]->ivilayer, - NULL, 0); layer_idx++; } - /* -* This commit change is needed because ivisurface can not belongs to several layers -* at the same time. So ivisurfaces shall be removed from layers once and then set them -* to layers randomly. -*/ - ivi_layout_interface->commit_changes(); - for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; @@ -463,6 +457,19 @@ mode_random_replace(struct hmi_controller *hmi_ctrl, surface_width, surface_height); + ivi_layout_interface + ->get_surfaces_on_layer(layers[layer_idx]->ivilayer, + _len_on_layer, + ); + + for (j = 0; j < surface_len_on_layer; j++) { + if (ivisurf == ivisurfs[j]) + break; + } + + if (j < surface_len_on_layer) + continue; + ivi_layout_interface->layer_add_surface(layers[layer_idx]->ivilayer, ivisurf); } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 01/11] ivi-shell: avoid update_prop() on invisible surfaces
For multi screen support, ivi_layout_screen to be taken account into property change in commitChanges. Property change is now done in update_prop so to consider ivi_screen property for caluculating transform of weston surface, ivi_layout_screen is added as a parameter of update_prop. However, update_prop of weston_view of a ivi_surface can not be done even if it is set on a screen. The propoerty change shall be done only when a visibility of ivi_surface or ivi_layer which contains the ivi_surface is ON. Such a condition shall be checked at commit_changes as well to avoid calling update_prop, which actually updates weston_views. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/ivi-layout.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 04fee7a..724ca6f 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -590,16 +590,17 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface( } static void -update_prop(struct ivi_layout_layer *ivilayer, +update_prop(struct ivi_layout_screen *iviscrn, + struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *ivisurf) { struct weston_view *tmpview; struct ivi_rectangle r; bool can_calc = true; - if (!ivilayer->event_mask && !ivisurf->event_mask) { + /*In case of no prop change, this just returns*/ + if (!ivilayer->event_mask && !ivisurf->event_mask) return; - } update_opacity(ivilayer, ivisurf); @@ -646,8 +647,22 @@ commit_changes(struct ivi_layout *layout) wl_list_for_each(iviscrn, >screen_list, link) { wl_list_for_each(ivilayer, >order.layer_list, order.link) { + /* +* If ivilayer is invisible, weston_view of ivisurf doesn't +* need to be modified. +*/ + if (ivilayer->prop.visibility == false) + continue; + wl_list_for_each(ivisurf, >order.surface_list, order.link) { - update_prop(ivilayer, ivisurf); + /* +* If ivilayer is invisible, weston_view of ivisurf doesn't +* need to be modified. +*/ + if (ivisurf->prop.visibility == false) + continue; + + update_prop(iviscrn, ivilayer, ivisurf); } } } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 05/11] hmi-controller: allocate base layers for multi-screen
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> A layer ID for screen is set by key: base-layer-id at weston.ini. To support multi screens. It also support offset to offset the layer ID to next ID for next screen. For example, base-layer-id=1000 base-layer-id-offset=1 Layer id for screen 0: 1000 Layer id for screen 1: 11000 Layer id for screen 2: 21000 To support multi screen, create layers for background and panel bar which located in the below per screens. At the moment, it is only layers. Surfaces to be created at next patch in the patch set. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 82 +++--- ivi-shell/weston.ini.in| 2 ++ 2 files changed, 65 insertions(+), 19 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 66dde79..7739aa7 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -72,6 +72,7 @@ struct hmi_controller_layer { int32_t y; int32_t width; int32_t height; + struct wl_list link; }; struct link_layer { @@ -89,6 +90,7 @@ struct hmi_server_setting { uint32_tapplication_layer_id; uint32_tworkspace_background_layer_id; uint32_tworkspace_layer_id; + uint32_tbase_layer_id_offset; int32_t panel_height; uint32_ttransition_duration; char *ivi_homescreen; @@ -107,7 +109,8 @@ struct ui_setting { struct hmi_controller { struct hmi_server_setting *hmi_setting; - struct hmi_controller_layer base_layer; + /* List of struct hmi_controller_layer */ + struct wl_list base_layer_list; struct hmi_controller_layer application_layer; struct hmi_controller_layer workspace_background_layer; struct hmi_controller_layer workspace_layer; @@ -654,6 +657,9 @@ hmi_server_setting_create(struct weston_compositor *ec) weston_config_section_get_uint(shell_section, "application-layer-id", >application_layer_id, 4000); + weston_config_section_get_uint(shell_section, "base-layer-id-offset", + >base_layer_id_offset, 1); + weston_config_section_get_uint(shell_section, "transition-duration", >transition_duration, 300); @@ -671,6 +677,8 @@ hmi_controller_destroy(struct wl_listener *listener, void *data) { struct link_layer *link = NULL; struct link_layer *next = NULL; + struct hmi_controller_layer *ctrl_layer_link = NULL; + struct hmi_controller_layer *ctrl_layer_next = NULL; struct hmi_controller *hmi_ctrl = container_of(listener, struct hmi_controller, destroy_listener); @@ -680,6 +688,12 @@ hmi_controller_destroy(struct wl_listener *listener, void *data) free(link); } + wl_list_for_each_safe(ctrl_layer_link, ctrl_layer_next, + _ctrl->base_layer_list, link) { + wl_list_remove(_layer_link->link); + free(ctrl_layer_link); + } + wl_array_release(_ctrl->ui_widgets); free(hmi_ctrl->hmi_setting); free(hmi_ctrl->pp_screen); @@ -710,6 +724,9 @@ hmi_controller_create(struct weston_compositor *ec) struct link_layer *tmp_link_layer = NULL; int32_t panel_height = 0; struct hmi_controller *hmi_ctrl = MEM_ALLOC(sizeof(*hmi_ctrl)); + struct hmi_controller_layer *base_layer = NULL; + + int32_t i = 0; wl_array_init(_ctrl->ui_widgets); hmi_ctrl->layout_mode = IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING; @@ -724,18 +741,29 @@ hmi_controller_create(struct weston_compositor *ec) } iviscrn = get_screen(0, hmi_ctrl); - ivi_layout_interface->get_screen_resolution(iviscrn, _width, -_height); /* init base ivi_layer*/ - hmi_ctrl->base_layer.x = 0; - hmi_ctrl->base_layer.y = 0; - hmi_ctrl->base_layer.width = screen_width; - hmi_ctrl->base_layer.height = screen_height; - hmi_ctrl->base_layer.id_layer = hmi_ctrl->hmi_setting->base_layer_id; - - create_layer(iviscrn, _ctrl->base_layer); + wl_list_init(_ctrl->base_layer_list); + for (i = 0; i < hmi_ctrl->screen_num; i++) { + ivi_layout_interface->get_screen_resolution(get_screen(i, hmi_ctrl), +_width, +_height); + + base_layer = MEM_ALLOC(1 * sizeof(struct hmi_controller_layer)); + base_layer->x = 0;
[PATCH weston 04/11] ivi-shell: hmi-controller implements internal method to get screen.
- get screens from weston core - provide screens as internel method - the iviscn is stored in array inverse order in index. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 60 -- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index e10f4ff..66dde79 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -124,6 +124,9 @@ struct hmi_controller { struct wl_client *user_interface; struct ui_setting ui_setting; + + int32_t screen_num; + struct ivi_layout_screen **pp_screen; }; struct launcher_info { @@ -462,6 +465,39 @@ switch_mode(struct hmi_controller *hmi_ctrl, } /** + * Internal method to get screens from weston core + * TODO: shall support hotplug of screens + */ +static int32_t +get_screens(struct hmi_controller *hmi_ctrl) +{ + hmi_ctrl->pp_screen = NULL; + hmi_ctrl->screen_num = 0; + ivi_layout_interface->get_screens(_ctrl->screen_num, _ctrl->pp_screen); + + if (hmi_ctrl->pp_screen == NULL) + return -1; + else + return 0; +} + +/** + * Internal method to get ivi_layout_screen + */ +static struct ivi_layout_screen * +get_screen(int32_t screen_idx, struct hmi_controller *hmi_ctrl) +{ + struct ivi_layout_screen *iviscrn = NULL; + + if (screen_idx > hmi_ctrl->screen_num - 1) + weston_log("Invalid index. Return NULL\n"); + else + iviscrn = hmi_ctrl->pp_screen[screen_idx]; + + return iviscrn; +} + +/** * Internal method for transition */ static void @@ -646,6 +682,7 @@ hmi_controller_destroy(struct wl_listener *listener, void *data) wl_array_release(_ctrl->ui_widgets); free(hmi_ctrl->hmi_setting); + free(hmi_ctrl->pp_screen); free(hmi_ctrl); } @@ -667,9 +704,7 @@ hmi_controller_destroy(struct wl_listener *listener, void *data) static struct hmi_controller * hmi_controller_create(struct weston_compositor *ec) { - struct ivi_layout_screen **pp_screen = NULL; struct ivi_layout_screen *iviscrn = NULL; - int32_t screen_length = 0; int32_t screen_width = 0; int32_t screen_height = 0; struct link_layer *tmp_link_layer = NULL; @@ -681,10 +716,14 @@ hmi_controller_create(struct weston_compositor *ec) hmi_ctrl->hmi_setting = hmi_server_setting_create(ec); hmi_ctrl->compositor = ec; - ivi_layout_interface->get_screens(_length, _screen); - - iviscrn = pp_screen[0]; + /* TODO: shall support hotplug of screens */ + if (get_screens(hmi_ctrl) < 0) { + weston_log("ivi-shell: Failed to get screens\n"); + hmi_ctrl = NULL; + return hmi_ctrl; + } + iviscrn = get_screen(0, hmi_ctrl); ivi_layout_interface->get_screen_resolution(iviscrn, _width, _height); @@ -744,9 +783,6 @@ hmi_controller_create(struct weston_compositor *ec) wl_signal_add(_ctrl->compositor->destroy_signal, _ctrl->destroy_listener); - free(pp_screen); - pp_screen = NULL; - return hmi_ctrl; } @@ -998,8 +1034,6 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, struct ivi_layout_screen *iviscrn = NULL; struct link_layer *tmp_link_layer = NULL; - struct ivi_layout_screen **pp_screen = NULL; - int32_t screen_length = 0; if (0 == x_count) x_count = 1; @@ -1099,9 +1133,7 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, hmi_ctrl->workspace_layer.id_layer = hmi_ctrl->hmi_setting->workspace_layer_id; - ivi_layout_interface->get_screens(_length, _screen); - iviscrn = pp_screen[0]; - free(pp_screen); + iviscrn = get_screen(0, hmi_ctrl); create_layer(iviscrn, _ctrl->workspace_layer); ivi_layout_interface->layer_set_opacity(hmi_ctrl->workspace_layer.ivilayer, 0); ivi_layout_interface->layer_set_visibility(hmi_ctrl->workspace_layer.ivilayer, @@ -1797,6 +1829,8 @@ controller_module_init(struct weston_compositor *ec, ivi_layout_interface = interface; hmi_ctrl = hmi_controller_create(ec); + if (hmi_ctrl == NULL) + return -1; if (!initialize(hmi_ctrl)) { return -1; -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 06/11] hmi-controller: allocate background surfaces for multi-screen
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> A surface ID for layer of background/panel image is set by key: background-id or panel-id at weston.ini. To support multi screens, it also support offset, surface-id-offset, to offset the surface ID to next ID for a layer on next screen. According to the above key, hmi-controller and ivi-shell-user-interface who increments the number of screens per notification of wl_output. crate surface and draw background/panel image on multi surface on screens. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- clients/ivi-shell-user-interface.c | 39 +-- ivi-shell/hmi-controller.c | 76 +- ivi-shell/weston.ini.in| 1 + 3 files changed, 72 insertions(+), 44 deletions(-) diff --git a/clients/ivi-shell-user-interface.c b/clients/ivi-shell-user-interface.c index 460ca27..2e0622b 100644 --- a/clients/ivi-shell-user-interface.c +++ b/clients/ivi-shell-user-interface.c @@ -158,6 +158,8 @@ hmi_homescreen_setting { char*cursor_theme; int32_t cursor_size; uint32_ttransition_duration; + uint32_tsurface_id_offset; + int32_t screen_num; }; static void * @@ -621,6 +623,8 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, ivi_hmi_controller_add_listener(p_wlCtx->hmiCtrl, _controller_listener, p_wlCtx); + } else if (!strcmp(interface, "wl_output")) { + p_wlCtx->hmi_setting->screen_num++; } } @@ -1161,6 +1165,9 @@ hmi_homescreen_setting_create(void) shellSection, "workspace-background-id", >workspace_background.id, 2001); + weston_config_section_get_uint( + shellSection, "surface-id-offset", >surface_id_offset, 10); + icon_surface_id = workspace_layer_id + 1; while (weston_config_next_section(config, , )) { @@ -1201,8 +1208,8 @@ hmi_homescreen_setting_create(void) int main(int argc, char **argv) { struct wlContextCommon wlCtxCommon; - struct wlContextStruct wlCtx_BackGround; - struct wlContextStruct wlCtx_Panel; + struct wlContextStruct *wlCtx_BackGround; + struct wlContextStruct *wlCtx_Panel; struct wlContextStruct wlCtx_Button_1; struct wlContextStruct wlCtx_Button_2; struct wlContextStruct wlCtx_Button_3; @@ -1213,12 +1220,11 @@ int main(int argc, char **argv) int ret = 0; struct hmi_homescreen_setting *hmi_setting; struct wlContextStruct *pWlCtxSt = NULL; + int i = 0; hmi_setting = hmi_homescreen_setting_create(); memset(, 0x00, sizeof(wlCtxCommon)); - memset(_BackGround, 0x00, sizeof(wlCtx_BackGround)); - memset(_Panel, 0x00, sizeof(wlCtx_Panel)); memset(_Button_1, 0x00, sizeof(wlCtx_Button_1)); memset(_Button_2, 0x00, sizeof(wlCtx_Button_2)); memset(_Button_3, 0x00, sizeof(wlCtx_Button_3)); @@ -1256,6 +1262,9 @@ int main(int argc, char **argv) exit(1); } + wlCtx_BackGround = MEM_ALLOC(hmi_setting->screen_num * sizeof(struct wlContextStruct)); + wlCtx_Panel= MEM_ALLOC(hmi_setting->screen_num * sizeof(struct wlContextStruct)); + if (wlCtxCommon.hmi_setting->cursor_theme) { create_cursors(); @@ -1265,8 +1274,6 @@ int main(int argc, char **argv) wlCtxCommon.current_cursor = CURSOR_LEFT_PTR; } - wlCtx_BackGround.cmm = - wlCtx_Panel.cmm = wlCtx_Button_1.cmm = wlCtx_Button_2.cmm = wlCtx_Button_3.cmm = @@ -1275,11 +1282,18 @@ int main(int argc, char **argv) wlCtx_WorkSpaceBackGround.cmm = /* create desktop widgets */ - create_background(_BackGround, hmi_setting->background.id, - hmi_setting->background.filePath); - - create_panel(_Panel, hmi_setting->panel.id, -hmi_setting->panel.filePath); + for (i = 0; i < hmi_setting->screen_num; i++) { + wlCtx_BackGround[i].cmm = + create_background(_BackGround[i], + hmi_setting->background.id + + (i * hmi_setting->surface_id_offset), + hmi_setting->background.filePath); + + wlCtx_Panel[i].cmm = + create_panel(_Panel[i], +hmi_setting->panel.id + (i * hmi_setting->surface_id_offset), +hmi_setting->panel.filePath); + } create_button(_Button_1, hmi_setting->tiling.id, hmi_setting->
[PATCH weston 10/11] ivi-shell: hmi-controller supports multi screens at fullscreen mode.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> It shows ivi applications in fullscreen per screen like, The first screen: Application 1,4,5,6 The seconed screen: Application 2, The third screen: Application 3 Thie mode assigns one application to each screen at first. And remaind applications more than screens will be assigned to the first screen. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 55e70fb..9b69dd2 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -367,6 +367,10 @@ mode_fullscreen_someone(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface *ivisurf = NULL; int32_t i = 0; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; + int32_t surf_num = 0; + struct ivi_layout_surface **surfaces; + + surfaces = MEM_ALLOC(sizeof(*surfaces) * surface_length); for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; @@ -375,6 +379,18 @@ mode_fullscreen_someone(struct hmi_controller *hmi_ctrl, if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; + surfaces[surf_num++] = ivisurf; + } + ivi_layout_interface->layer_set_render_order(layer->ivilayer, surfaces, surf_num); + + for (i = 0; i < surf_num; i++) { + ivisurf = surfaces[i]; + + if ((i > 0) && (i < hmi_ctrl->screen_num)) { + layer = wl_container_of(layer->link.prev, layer, link); + ivi_layout_interface->layer_set_render_order(layer->ivilayer, , 1); + } + ivi_layout_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); @@ -383,6 +399,8 @@ mode_fullscreen_someone(struct hmi_controller *hmi_ctrl, surface_width, surface_height); } + + free(surfaces); } static void -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 09/11] ivi-shell: hmi-controller supports multi screens at side-by-side mode.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> It shows 2 ivi application in a screen at side-by-side. It moves additinal application more than 2xN to next screen N+1. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 61 +- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index d5b11ed..55e70fb 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -299,7 +299,14 @@ mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; int32_t i = 0; - int32_t num = 1; + struct ivi_layout_surface **surfaces; + struct ivi_layout_surface **new_order; + struct ivi_layout_layer *ivilayer = NULL; + int32_t surf_num = 0; + int32_t idx = 0; + + surfaces = MEM_ALLOC(sizeof(*surfaces) * surface_length); + new_order = MEM_ALLOC(sizeof(*surfaces) * surface_length); for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; @@ -308,36 +315,44 @@ mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; - if (num == 1) { - ivi_layout_interface->surface_set_transition(ivisurf, - IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, - duration); - ivi_layout_interface->surface_set_visibility(ivisurf, true); - ivi_layout_interface->surface_set_destination_rectangle(ivisurf, - 0, 0, - surface_width, - surface_height); + surfaces[surf_num++] = ivisurf; + } + + wl_list_for_each_reverse(layer, layer_list, link) { + if (idx >= surf_num) + break; + + ivilayer = layer->ivilayer; + + for (i = 0; i < 2; i++, idx++) { + if (idx >= surf_num) + break; + + ivisurf = surfaces[idx]; + new_order[i] = ivisurf; - num++; - continue; - } else if (num == 2) { ivi_layout_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); ivi_layout_interface->surface_set_visibility(ivisurf, true); - ivi_layout_interface->surface_set_destination_rectangle(ivisurf, - surface_width, 0, - surface_width, - surface_height); - num++; - continue; + ivi_layout_interface->surface_set_destination_rectangle(ivisurf, + i * surface_width, 0, + surface_width, + surface_height); } - ivi_layout_interface->surface_set_transition(ivisurf, - IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, - duration); - ivi_layout_interface->surface_set_visibility(ivisurf, false); + ivi_layout_interface->layer_set_render_order(ivilayer, new_order, i); + } + + for (i = idx; i < surf_num; i++) { + ivi_layout_interface->surface_set_transition(surfaces[i], + IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, + duration); + ivi_layout_interface->surface_set_visibility(surfaces[i], false); } + + free(surfaces); + free(new_order); } static void -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 08/11] ivi-shell: hmi-controller supports multi screens at tiling mode.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> It shows 8 ivi applications in a screen at tiling. It moves additional application more than 8xN to next screen N+1. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 38 ++ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 4b20848..d5b11ed 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -224,10 +224,11 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **surfaces; struct ivi_layout_surface **new_order; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; + struct ivi_layout_layer *ivilayer = NULL; int32_t i = 0; int32_t surf_num = 0; - uint32_t num = 1; + int32_t idx = 0; surfaces = MEM_ALLOC(sizeof(*surfaces) * surface_length); new_order = MEM_ALLOC(sizeof(*surfaces) * surface_length); @@ -242,16 +243,23 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, surfaces[surf_num++] = ivisurf; } - for (i = 0; i < surf_num; i++) { - ivisurf = surfaces[i]; - new_order[i] = ivisurf; + wl_list_for_each_reverse(layer, layer_list, link) { + if (idx >= surf_num) + break; + + ivilayer = layer->ivilayer; - if (num <= 8) { - if (num < 5) { - surface_x = (int32_t)((num - 1) * (surface_width)); + for (i = 0; i < 8; i++, idx++) { + if (idx >= surf_num) + break; + + ivisurf = surfaces[idx]; + new_order[i] = ivisurf; + if (i < 4) { + surface_x = (int32_t)(i * (surface_width)); surface_y = 0; } else { - surface_x = (int32_t)((num - 5) * (surface_width)); + surface_x = (int32_t)((i - 4) * (surface_width)); surface_y = (int32_t)surface_height; } @@ -264,17 +272,15 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, (int32_t)surface_width, (int32_t)surface_height); - num++; - continue; } - ivi_layout_interface->surface_set_visibility(ivisurf, false); - } + ivi_layout_interface->layer_set_render_order(ivilayer, new_order, i); - if (surf_num > 0) { - ivi_layout_interface->layer_set_transition(layer->ivilayer, - IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, - duration); + ivi_layout_interface->layer_set_transition(ivilayer, + IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, + duration); } + for (i = idx; i < surf_num; i++) + ivi_layout_interface->surface_set_visibility(surfaces[i], false); free(surfaces); free(new_order); -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 09/11] ivi-shell: hmi-controller supports multi screens at side-by-side mode.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> It shows 2 ivi application in a screen at side-by-side. It moves additinal application more than 2xN to next screen N+1. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 61 +- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index d5b11ed..55e70fb 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -299,7 +299,14 @@ mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; int32_t i = 0; - int32_t num = 1; + struct ivi_layout_surface **surfaces; + struct ivi_layout_surface **new_order; + struct ivi_layout_layer *ivilayer = NULL; + int32_t surf_num = 0; + int32_t idx = 0; + + surfaces = MEM_ALLOC(sizeof(*surfaces) * surface_length); + new_order = MEM_ALLOC(sizeof(*surfaces) * surface_length); for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; @@ -308,36 +315,44 @@ mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; - if (num == 1) { - ivi_layout_interface->surface_set_transition(ivisurf, - IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, - duration); - ivi_layout_interface->surface_set_visibility(ivisurf, true); - ivi_layout_interface->surface_set_destination_rectangle(ivisurf, - 0, 0, - surface_width, - surface_height); + surfaces[surf_num++] = ivisurf; + } + + wl_list_for_each_reverse(layer, layer_list, link) { + if (idx >= surf_num) + break; + + ivilayer = layer->ivilayer; + + for (i = 0; i < 2; i++, idx++) { + if (idx >= surf_num) + break; + + ivisurf = surfaces[idx]; + new_order[i] = ivisurf; - num++; - continue; - } else if (num == 2) { ivi_layout_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); ivi_layout_interface->surface_set_visibility(ivisurf, true); - ivi_layout_interface->surface_set_destination_rectangle(ivisurf, - surface_width, 0, - surface_width, - surface_height); - num++; - continue; + ivi_layout_interface->surface_set_destination_rectangle(ivisurf, + i * surface_width, 0, + surface_width, + surface_height); } - ivi_layout_interface->surface_set_transition(ivisurf, - IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, - duration); - ivi_layout_interface->surface_set_visibility(ivisurf, false); + ivi_layout_interface->layer_set_render_order(ivilayer, new_order, i); + } + + for (i = idx; i < surf_num; i++) { + ivi_layout_interface->surface_set_transition(surfaces[i], + IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, + duration); + ivi_layout_interface->surface_set_visibility(surfaces[i], false); } + + free(surfaces); + free(new_order); } static void -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 11/11] ivi-shell: hmi-controller supports multi screens at random-mode.
It shows ivi applications at screensa randomly. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 39 ++- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 9b69dd2..77426bc 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -409,14 +409,32 @@ mode_random_replace(struct hmi_controller *hmi_ctrl, int32_t surface_length, struct wl_list *layer_list) { - struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); - const int32_t surface_width = (int32_t)(layer->width * 0.25f); - const int32_t surface_height = (int32_t)(layer->height * 0.25f); + struct hmi_controller_layer *application_layer = NULL; + struct hmi_controller_layer **layers = NULL; + int32_t surface_width = 0; + int32_t surface_height = 0; int32_t surface_x = 0; int32_t surface_y = 0; struct ivi_layout_surface *ivisurf = NULL; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; int32_t i = 0; + int32_t layer_idx = 0; + + layers = MEM_ALLOC(sizeof(*layers) * hmi_ctrl->screen_num); + + wl_list_for_each(application_layer, layer_list, link) { + layers[layer_idx] = application_layer; + ivi_layout_interface->layer_set_render_order(layers[layer_idx]->ivilayer, + NULL, 0); + layer_idx++; + } + + /* +* This commit change is needed because ivisurface can not belongs to several layers +* at the same time. So ivisurfaces shall be removed from layers once and then set them +* to layers randomly. +*/ + ivi_layout_interface->commit_changes(); for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; @@ -425,19 +443,30 @@ mode_random_replace(struct hmi_controller *hmi_ctrl, if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; + /* surface determined at random a layer that belongs */ + layer_idx = rand() % hmi_ctrl->screen_num; + ivi_layout_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); + ivi_layout_interface->surface_set_visibility(ivisurf, true); - surface_x = rand() % (layer->width - surface_width); - surface_y = rand() % (layer->height - surface_height); + + surface_width = (int32_t)(layers[layer_idx]->width * 0.25f); + surface_height = (int32_t)(layers[layer_idx]->height * 0.25f); + surface_x = rand() % (layers[layer_idx]->width - surface_width); + surface_y = rand() % (layers[layer_idx]->height - surface_height); ivi_layout_interface->surface_set_destination_rectangle(ivisurf, surface_x, surface_y, surface_width, surface_height); + + ivi_layout_interface->layer_add_surface(layers[layer_idx]->ivilayer, ivisurf); } + + free(layers); } static int32_t -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 03/11] ivi-shell: multi screen support to calcuration of a mask of weston_surface.
A weston_surface is transformed to multi screen coordinate, global coordinate by matrix:m now. Additionally, a mask needs to be calucated, taking account into, - multi screen coordination: a destination rectangle of layer in the coordination is easily calcurated by adding weston_output.{x,y} in simple. This is because there is no scaled and rotated transformation. - intersect inside of a screen the layer is assigned to. This is because overlapped region of weston surface in another screen shall not be displayed according to ivi use case. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/ivi-layout.c | 36 +++- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 6d01799..4ad7a5f 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -518,15 +518,24 @@ calc_inverse_matrix_transform(const struct weston_matrix *matrix, /** * This computes the whole transformation matrix:m from surface-local - * coordinates to global coordinates. It is assumed that - * weston_view::geometry.{x,y} are zero. + * coordinates to multi screens coordinate, which is global coordinates. + * It is assumed that weston_view::geometry.{x,y} are zero. * * Additionally, this computes the mask on surface-local coordinates as a * ivi_rectangle. This can be set to weston_view_set_mask. * * The mask is computed by following steps - * - destination rectangle of layer is inversed to surface-local cooodinates - * by inversed matrix:m. + * - destination rectangle of layer is tansformed to multi screen coordinate, + * global coordinates. This is done by adding weston_output.{x,y} in simple + * because there is no scaled and rotated transformation. + * - destination rectangle of layer in multi screens coordinate needs to be + * intersected inside of a screen the layer is assigned to. This is because + * overlapped region of weston surface in another screen shall not be + * displayed according to ivi use case. + * - destination rectangle of layer + * - in multi screen coordinates, + * - and intersected inside of an assigned screen, + * is inversed to surface-local cooodinates by inversed matrix:m. * - the area is intersected by intersected area between weston_surface and * source rectangle of ivi_surface. */ @@ -561,7 +570,17 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface( lp->dest_y, lp->dest_width, lp->dest_height }; + struct ivi_rectangle screen_dest_rect ={ output->x, +output->y, +output->width, +output->height }; + struct ivi_rectangle layer_dest_rect_in_global = + { lp->dest_x + output->x, +lp->dest_y + output->y, +lp->dest_width, +lp->dest_height }; struct ivi_rectangle surface_result; + struct ivi_rectangle layer_dest_rect_in_global_intersected; /* * the whole transformation matrix:m from surface-local @@ -588,9 +607,16 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface( ivi_rectangle_intersect(_source_rect, _surface_rect, _result); + /* +* destination rectangle of layer in multi screens coordinate +* is intersected to avoid displaying outside of an assigned screen. +*/ + ivi_rectangle_intersect(_dest_rect_in_global, _dest_rect, + _dest_rect_in_global_intersected); + /* calc masking area of weston_surface from m */ calc_inverse_matrix_transform(m, - _dest_rect, + _dest_rect_in_global_intersected, _result, result); } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 02/11] ivi-shell: convert from screen to global coordinates
In single screen, the coordinates of layer local coordinates are the same as global coordinates. However, to support multi screens, the layer-local coordinates shall be transformed to multi screen coordinates, which is global coordinates. The abosolute coordinates of a screen in global stored in (x,y) of output of its weston output so it shall be used to transform layer-local to global coordinates. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/ivi-layout.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 724ca6f..6d01799 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -532,6 +532,7 @@ calc_inverse_matrix_transform(const struct weston_matrix *matrix, */ static void calc_surface_to_global_matrix_and_mask_to_weston_surface( + struct ivi_layout_screen *iviscrn, struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *ivisurf, struct weston_matrix *m, @@ -539,6 +540,7 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface( { const struct ivi_layout_surface_properties *sp = >prop; const struct ivi_layout_layer_properties *lp = >prop; + struct weston_output *output = iviscrn->output; struct ivi_rectangle weston_surface_rect = { 0, 0, ivisurf->surface->width, @@ -566,7 +568,9 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface( * coordinates to global coordinates, which is computed by * two steps, * - surface-local coordinates to layer-local coordinates -* - layer-local coordinates to global coordinates +* - layer-local coordinates to a single screen-local coordinates +* - a single screen-local coordinates to multi screen coordinates, + * which is global coordinates. */ calc_transformation_matrix(_source_rect, _dest_rect, @@ -576,6 +580,8 @@ calc_surface_to_global_matrix_and_mask_to_weston_surface( _dest_rect, lp->orientation, m); + weston_matrix_translate(m, output->x, output->y, 0.0f); + /* this intersected ivi_rectangle would be used for masking * weston_surface */ @@ -622,7 +628,7 @@ update_prop(struct ivi_layout_screen *iviscrn, weston_matrix_init(>transform.matrix); calc_surface_to_global_matrix_and_mask_to_weston_surface( - ivilayer, ivisurf, >transform.matrix, ); + iviscrn, ivilayer, ivisurf, >transform.matrix, ); weston_view_set_mask(tmpview, r.x, r.y, r.width, r.height); wl_list_insert(>geometry.transformation_list, -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: activate weston surface with a seat when left click or touch.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Similar with Desktop shell, set activate to weston surface which is left-clicked by pointer or touched. This is needed to focus it with a seat. Without this, a feature who gets activated weston surface by using weston_surface_get_main_surface doesn't work correctly because it can not get correct focused weston surface. For example, input-panel uses weston_surface_get_main_surface to get a weston surface. With this weston surface, it get a member: output to decide which output shall show a input-panel, software keyboard. Without activation, input-panel-ivi can not find a correct output which shows e.g. weston-editor who uses input-method. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> --- ivi-shell/ivi-shell.c | 54 +++ 1 file changed, 54 insertions(+) diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 1720705..a767ccf 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -414,6 +414,59 @@ ivi_shell_setting_create(struct ivi_shell_setting *dest, return result; } +static void +activate_binding(struct weston_seat *seat, +struct weston_view *focus_view) +{ + struct weston_surface *focus = focus_view->surface; + struct weston_surface *main_surface = + weston_surface_get_main_surface(focus); + + if (get_ivi_shell_surface(main_surface) == NULL) + return; + + weston_surface_activate(focus, seat); +} + +static void +click_to_activate_binding(struct weston_pointer *pointer, uint32_t time, + uint32_t button, void *data) +{ + if (pointer->grab != >default_grab) + return; + if (pointer->focus == NULL) + return; + + activate_binding(pointer->seat, pointer->focus); +} + +static void +touch_to_activate_binding(struct weston_touch *touch, uint32_t time, + void *data) +{ + if (touch->grab != >default_grab) + return; + if (touch->focus == NULL) + return; + + activate_binding(touch->seat, touch->focus); +} + +static void +shell_add_bindings(struct weston_compositor *compositor, + struct ivi_shell *shell) +{ + weston_compositor_add_button_binding(compositor, BTN_LEFT, 0, +click_to_activate_binding, +shell); + weston_compositor_add_button_binding(compositor, BTN_RIGHT, 0, +click_to_activate_binding, +shell); + weston_compositor_add_touch_binding(compositor, 0, + touch_to_activate_binding, + shell); +} + /* * Initialization of ivi-shell. */ @@ -450,6 +503,7 @@ module_init(struct weston_compositor *compositor, goto out_settings; ivi_layout_init_with_compositor(compositor); + shell_add_bindings(compositor, shell); /* Call module_init of ivi-modules which are defined in weston.ini */ if (load_controller_modules(compositor, setting.ivi_module, -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 00/11] ivi-shell: multi screen supprot
Hi, This proposes multi screen support by ivi-shell. This allow user to manage a hierarchy; surface, layer, and screen. Current code expects single screen so user can not assign a layer to another display by using ivi-layout interface. This patch series also updates a reference code of controller; hmi-controller to manage surfaces in multi screen. It provide an example of layer inter multi screens. Best regards, Nobuhiko Tanibata clients/ivi-shell-user-interface.c | 39 -- ivi-shell/hmi-controller.c | 452 +--- ivi-shell/ivi-layout.c | 69 -- ivi-shell/weston.ini.in| 3 + 4 files changed, 410 insertions(+), 153 deletions(-) ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 07/11] hmi-controller: allocate application layers for multi-screen
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> To locate surfaces of application on multi screens, multi layers are created baseod on application-layer-id + base-layer-id-offset x N. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 98 +++--- 1 file changed, 66 insertions(+), 32 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 765d15f..4b20848 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -112,7 +112,7 @@ struct hmi_controller { struct hmi_server_setting *hmi_setting; /* List of struct hmi_controller_layer */ struct wl_list base_layer_list; - struct hmi_controller_layer application_layer; + struct wl_list application_layer_list; struct hmi_controller_layer workspace_background_layer; struct hmi_controller_layer workspace_layer; enum ivi_hmi_controller_layout_mode layout_mode; @@ -213,8 +213,9 @@ static void mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, -struct hmi_controller_layer *layer) +struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); const float surface_width = (float)layer->width * 0.25; const float surface_height = (float)layer->height * 0.5; int32_t surface_x = 0; @@ -283,8 +284,9 @@ static void mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, -struct hmi_controller_layer *layer) +struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); int32_t surface_width = layer->width / 2; int32_t surface_height = layer->height; struct ivi_layout_surface *ivisurf = NULL; @@ -336,8 +338,9 @@ static void mode_fullscreen_someone(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, - struct hmi_controller_layer *layer) + struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); const int32_t surface_width = layer->width; const int32_t surface_height = layer->height; struct ivi_layout_surface *ivisurf = NULL; @@ -365,8 +368,9 @@ static void mode_random_replace(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, - struct hmi_controller_layer *layer) + struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); const int32_t surface_width = (int32_t)(layer->width * 0.25f); const int32_t surface_height = (int32_t)(layer->height * 0.25f); int32_t surface_x = 0; @@ -426,7 +430,7 @@ static void switch_mode(struct hmi_controller *hmi_ctrl, enum ivi_hmi_controller_layout_mode layout_mode) { - struct hmi_controller_layer *layer = _ctrl->application_layer; + struct wl_list *layer = _ctrl->application_layer_list; struct ivi_layout_surface **pp_surface = NULL; int32_t surface_length = 0; int32_t ret = 0; @@ -560,8 +564,11 @@ set_notification_create_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; - struct ivi_layout_layer *application_layer = - hmi_ctrl->application_layer.ivilayer; + struct hmi_controller_layer *layer_link = + wl_container_of(hmi_ctrl->application_layer_list.prev, + layer_link, + link); + struct ivi_layout_layer *application_layer = layer_link->ivilayer; int32_t ret = 0; /* skip ui widgets */ @@ -586,8 +593,8 @@ set_notification_configure_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; - struct ivi_layout_layer *application_layer = - hmi_ctrl->application_layer.ivilayer; + struct hmi_controller_layer *laye
[PATCH weston 07/11] hmi-controller: allocate application layers for multi-screen
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> To locate surfaces of application on multi screens, multi layers are created baseod on application-layer-id + base-layer-id-offset x N. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/hmi-controller.c | 98 +++--- 1 file changed, 66 insertions(+), 32 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 765d15f..4b20848 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -112,7 +112,7 @@ struct hmi_controller { struct hmi_server_setting *hmi_setting; /* List of struct hmi_controller_layer */ struct wl_list base_layer_list; - struct hmi_controller_layer application_layer; + struct wl_list application_layer_list; struct hmi_controller_layer workspace_background_layer; struct hmi_controller_layer workspace_layer; enum ivi_hmi_controller_layout_mode layout_mode; @@ -213,8 +213,9 @@ static void mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, -struct hmi_controller_layer *layer) +struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); const float surface_width = (float)layer->width * 0.25; const float surface_height = (float)layer->height * 0.5; int32_t surface_x = 0; @@ -283,8 +284,9 @@ static void mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, -struct hmi_controller_layer *layer) +struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); int32_t surface_width = layer->width / 2; int32_t surface_height = layer->height; struct ivi_layout_surface *ivisurf = NULL; @@ -336,8 +338,9 @@ static void mode_fullscreen_someone(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, - struct hmi_controller_layer *layer) + struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); const int32_t surface_width = layer->width; const int32_t surface_height = layer->height; struct ivi_layout_surface *ivisurf = NULL; @@ -365,8 +368,9 @@ static void mode_random_replace(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, - struct hmi_controller_layer *layer) + struct wl_list *layer_list) { + struct hmi_controller_layer *layer = wl_container_of(layer_list->prev, layer, link); const int32_t surface_width = (int32_t)(layer->width * 0.25f); const int32_t surface_height = (int32_t)(layer->height * 0.25f); int32_t surface_x = 0; @@ -426,7 +430,7 @@ static void switch_mode(struct hmi_controller *hmi_ctrl, enum ivi_hmi_controller_layout_mode layout_mode) { - struct hmi_controller_layer *layer = _ctrl->application_layer; + struct wl_list *layer = _ctrl->application_layer_list; struct ivi_layout_surface **pp_surface = NULL; int32_t surface_length = 0; int32_t ret = 0; @@ -560,8 +564,11 @@ set_notification_create_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; - struct ivi_layout_layer *application_layer = - hmi_ctrl->application_layer.ivilayer; + struct hmi_controller_layer *layer_link = + wl_container_of(hmi_ctrl->application_layer_list.prev, + layer_link, + link); + struct ivi_layout_layer *application_layer = layer_link->ivilayer; int32_t ret = 0; /* skip ui widgets */ @@ -586,8 +593,8 @@ set_notification_configure_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; - struct ivi_layout_layer *application_layer = - hmi_ctrl->application_layer.ivilayer; + struct hmi_controller_layer *laye
[PATCH weston 3/4] ivi-shell: fix layout_layer.view_list is not initilized per a screen.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> This is potential bug when it supports several screens. If view_list is initilized here, the views, which are set by the previous screen, are cleared. So View list shall be initilized in front of wl_list_for_each of all screens. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/ivi-layout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 1a75348..732a557 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -805,6 +805,9 @@ commit_screen_list(struct ivi_layout *layout) struct ivi_layout_surface *ivisurf = NULL; struct weston_view *tmpview = NULL; + /* Clear view list of layout ivi_layer */ + wl_list_init(>layout_layer.view_list.link); + wl_list_for_each(iviscrn, >screen_list, link) { if (iviscrn->order.dirty) { wl_list_for_each_safe(ivilayer, next, @@ -831,9 +834,6 @@ commit_screen_list(struct ivi_layout *layout) iviscrn->order.dirty = 0; } - /* Clear view list of layout ivi_layer */ - wl_list_init(>layout_layer.view_list.link); - wl_list_for_each(ivilayer, >order.layer_list, order.link) { if (ivilayer->prop.visibility == false) continue; -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 0/4] fix bugs and TODO to support multi screens
Hi, I am proposing 4 patches to fix potential bugs and TODOs to support multi screens. Best Regards, Tanibata ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 1/4] ivi-shell: fix TODO which expects only one screen in the system.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> It just return the first screen found in screen list. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/ivi-layout.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index c6d4b90..23ce67b 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1323,9 +1323,8 @@ ivi_layout_get_screen_from_id(uint32_t id_screen) struct ivi_layout_screen *iviscrn = NULL; wl_list_for_each(iviscrn, >screen_list, link) { -/* FIXME : select iviscrn from screen_list by id_screen */ - return iviscrn; - break; + if (iviscrn->id_screen == id_screen) + return iviscrn; } return NULL; -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 2/4] ivi-shell: avoid inserting a ivi_layer to multiple screens.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> In just previous wl_list_for_each_safe, list of layer in a screen is cleaned up. And then, the list is re-constructed from pending.layer_list. In this re-construction, if order.link of a layer were inserted into a screen whose number is later one of current screen, the order.link will inserted into layer_list of two screens. This shall be avoided. However, if we want to implement a feature to allow a layer to be added to multiple screens. A layer shall have several order.link per screens. So, I marked here as TODO. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/ivi-layout.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 23ce67b..1a75348 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -819,6 +819,9 @@ commit_screen_list(struct ivi_layout *layout) wl_list_for_each(ivilayer, >pending.layer_list, pending.link) { + /* FIXME: avoid to insert order.link to multiple screens */ + wl_list_remove(>order.link); + wl_list_insert(>order.layer_list, >order.link); ivilayer->on_screen = iviscrn; -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 4/4] ivi-shell: remove a code which expects only a screen in the system.
From: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> It breaks from wl_list_for_each of screens when the frist screen found. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk> --- ivi-shell/ivi-layout.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 732a557..04fee7a 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -851,8 +851,6 @@ commit_screen_list(struct ivi_layout *layout) ivisurf->surface->output = iviscrn->output; } } - - break; } } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH 1/5] ivi-shell: remove struct link_screen
Hi, Tested-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> These constructors are reserved for a feature of 'a ivi-surface to several layers' and 'a ivi-layer to several screens'. This feature is required for - for example, car navigation application prepares junction guide on a surface, which shall be displayed in its own UI and cloned on instrumental cluster in another screen as well. In this case, a ivi-surface can be located in both. However, I have to modify weston core to realize it. So, for the time being, we can remove them at this time to simplify codes. BR, Nobuhiko Tanibata 2015-08-28 21:58 に Ucan, Emre (ADITG/SW1) さんは書きました: link_screen's sole purpose is to link a layer to multiple screens, if the layer should be shown in multiple screens. This can be only achieved, if surfaces of the layer have multiple weston_views dedicated to the different screens. Current implementation assumes in many places that a ivi_surface has only one weston_view. Therefore, a layer can be only shown on one screen. Although this (a layer on multiple screens) is a nice to have feature for ivi-shell, it is not very crucial. In any case, it is not an easy task to implement this feature, because it has lot of corner cases. I removed with this patch the link_screen data structure, because it does not have any purpose in current implementation. Signed-off-by: Emre Ucan <eu...@de.adit-jv.com> --- ivi-shell/ivi-layout-private.h |2 +- ivi-shell/ivi-layout.c | 67 +++- 2 files changed, 6 insertions(+), 63 deletions(-) diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index 074d598..a9dbdde 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -65,11 +65,11 @@ struct ivi_layout_surface { struct ivi_layout_layer { struct wl_list link; struct wl_signal property_changed; - struct wl_list screen_list; struct wl_list link_to_surface; uint32_t id_layer; struct ivi_layout *layout; + struct ivi_layout_screen *on_screen; struct ivi_layout_layer_properties prop; uint32_t event_mask; diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 24bd8dd..087f94c 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -75,12 +75,6 @@ struct link_layer { struct wl_list link_to_layer; }; -struct link_screen { - struct ivi_layout_screen *iviscrn; - struct wl_list link; - struct wl_list link_to_screen; -}; - struct listener_layout_notification { void *userdata; struct wl_listener listener; @@ -90,7 +84,6 @@ struct ivi_layout; struct ivi_layout_screen { struct wl_list link; - struct wl_list link_to_layer; uint32_t id_screen; struct ivi_layout *layout; @@ -165,16 +158,6 @@ remove_link_to_surface(struct ivi_layout_layer *ivilayer) } /** - * Internal API to add a link to ivi_layer from ivi_screen. - */ -static void -add_link_to_layer(struct ivi_layout_screen *iviscrn, - struct link_screen *link_screen) -{ - wl_list_insert(>link_to_layer, _screen->link_to_screen); -} - -/** * Internal API to add/remove a ivi_surface from ivi_layer. */ static void @@ -211,40 +194,6 @@ remove_ordersurface_from_layer(struct ivi_layout_surface *ivisurf) /** * Internal API to add/remove a ivi_layer to/from ivi_screen. */ -static void -add_orderlayer_to_screen(struct ivi_layout_layer *ivilayer, -struct ivi_layout_screen *iviscrn) -{ - struct link_screen *link_scrn = NULL; - - link_scrn = malloc(sizeof *link_scrn); - if (link_scrn == NULL) { - weston_log("fails to allocate memory\n"); - return; - } - - link_scrn->iviscrn = iviscrn; - wl_list_insert(>screen_list, _scrn->link); - add_link_to_layer(iviscrn, link_scrn); -} - -static void -remove_orderlayer_from_screen(struct ivi_layout_layer *ivilayer) -{ - struct link_screen *link_scrn = NULL; - struct link_screen *next = NULL; - - wl_list_for_each_safe(link_scrn, next, >screen_list, link) { - wl_list_remove(_scrn->link); - wl_list_remove(_scrn->link_to_screen); - free(link_scrn); - } - wl_list_init(>screen_list); -} - -/** - * Internal API to add/remove a ivi_layer to/from ivi_screen. - */ static struct ivi_layout_surface * get_surface(struct wl_list *surf_list, uint32_t id_surface) { @@ -422,8 +371,6 @@ create_screen(struct weston_compositor *ec) wl_list_init(>order.layer_list); wl_list_init(>order.link); - wl_list_init(>link_to_layer); - wl_list_insert(>screen_list, >link); } } @@ -964,7 +911,7 @@ commit_screen_li
Re: [PATCH 2/5] ivi-shell: remove struct link_layer
Hi, Tested-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> BR, Nobuhiko Tanibata 2015-08-28 21:58 に Ucan, Emre (ADITG/SW1) さんは書きました: link_layer's sole purpose is to link a surface to multiple layers, if the surface should be shown in multiple layers. This can be only achieved, if the surface has multiple weston_views with different transformation matrices. Current implementation assumes in many places that a ivi_surface has only one weston_view. Therefore, a surface can be only shown on one layer. Although this (a surface on multiple layers) is a nice to have feature for ivi-shell, it is not very crucial. In any case, it is not an easy task to implement this feature, because it has lot of corner cases. I removed with this patch the link_layer data structure, because it does not have any purpose in current implementation. Signed-off-by: Emre Ucan <eu...@de.adit-jv.com> --- ivi-shell/ivi-layout-private.h |3 +- ivi-shell/ivi-layout.c | 92 +++- 2 files changed, 7 insertions(+), 88 deletions(-) diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index a9dbdde..3244390 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -32,11 +32,11 @@ struct ivi_layout_surface { struct wl_list link; struct wl_signal property_changed; - struct wl_list layer_list; int32_t update_count; uint32_t id_surface; struct ivi_layout *layout; + struct ivi_layout_layer *on_layer; struct weston_surface *surface; struct weston_transform transform; @@ -65,7 +65,6 @@ struct ivi_layout_surface { struct ivi_layout_layer { struct wl_list link; struct wl_signal property_changed; - struct wl_list link_to_surface; uint32_t id_layer; struct ivi_layout *layout; diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 087f94c..2a33b3e 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -69,12 +69,6 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) -struct link_layer { - struct ivi_layout_layer *ivilayer; - struct wl_list link; - struct wl_list link_to_layer; -}; - struct listener_layout_notification { void *userdata; struct wl_listener listener; @@ -126,72 +120,6 @@ get_instance(void) } /** - * Internal API to add/remove a link to ivi_surface from ivi_layer. - */ -static void -add_link_to_surface(struct ivi_layout_layer *ivilayer, - struct link_layer *link_layer) -{ - struct link_layer *link = NULL; - - wl_list_for_each(link, >link_to_surface, link_to_layer) { - if (link == link_layer) - return; - } - - wl_list_insert(>link_to_surface, _layer->link_to_layer); -} - -static void -remove_link_to_surface(struct ivi_layout_layer *ivilayer) -{ - struct link_layer *link = NULL; - struct link_layer *next = NULL; - - wl_list_for_each_safe(link, next, >link_to_surface, link_to_layer) { - wl_list_remove(>link_to_layer); - wl_list_remove(>link); - free(link); - } - - wl_list_init(>link_to_surface); -} - -/** - * Internal API to add/remove a ivi_surface from ivi_layer. - */ -static void -add_ordersurface_to_layer(struct ivi_layout_surface *ivisurf, - struct ivi_layout_layer *ivilayer) -{ - struct link_layer *link_layer = NULL; - - link_layer = malloc(sizeof *link_layer); - if (link_layer == NULL) { - weston_log("fails to allocate memory\n"); - return; - } - - link_layer->ivilayer = ivilayer; - wl_list_insert(>layer_list, _layer->link); - add_link_to_surface(ivilayer, link_layer); -} - -static void -remove_ordersurface_from_layer(struct ivi_layout_surface *ivisurf) -{ - struct link_layer *link_layer = NULL; - struct link_layer *next = NULL; - - wl_list_for_each_safe(link_layer, next, >layer_list, link) { - wl_list_remove(_layer->link); - wl_list_remove(_layer->link_to_layer); - free(link_layer); - } - wl_list_init(>layer_list); -} - -/** * Internal API to add/remove a ivi_layer to/from ivi_screen. */ static struct ivi_layout_surface * @@ -294,7 +222,6 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) wl_list_remove(>pending.link); wl_list_remove(>order.link); wl_list_remove(>link); - remove_ordersurface_from_layer(ivisurf); wl_signal_emit(>surface_notification.removed, ivisurf); @@ -878,7 +805,7 @@ commit_layer_list(struct ivi_layout *layout) wl_list_for_each_safe(ivisurf, next, >order.surface_list,
Re: [PATCH 5/5] ivi-shell: introduce get_weston_view
Hi, Tested-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Best Regards, Nobuhiko Tanibata 2015-08-28 21:59 に Ucan, Emre (ADITG/SW1) さんは書きました: The internal API "get_weston_view" is introduced, which returns the weston_view of the given ivi_layout_surface. The API returns a NULL pointer, if the ivi_layout_surface does not have any weston_view. The weston_view is required in many places of ivi-shell implementation. Therefore, this API will reduce lines of code. Furthermore, it will increase the maintainability of the ivi-shell implementation. Old way of getting the weston_view was flawed, because the views list of the weston_surface is read without controlling the existence of the weston_surface. New implementation explicitly throws an error if the weston_surface does not exist. Signed-off-by: Emre Ucan <eu...@de.adit-jv.com> --- ivi-shell/ivi-layout.c | 75 +--- 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 49e789e..702878f 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -150,6 +150,22 @@ get_layer(struct wl_list *layer_list, uint32_t id_layer) return NULL; } +static struct weston_view * +get_weston_view(struct ivi_layout_surface *ivisurf) +{ + struct weston_view *view = NULL; + + assert(ivisurf->surface != NULL); + + /* One view per surface */ + if(wl_list_empty(>surface->views)) + view = NULL; + else + view = wl_container_of(ivisurf->surface->views.next, view, surface_link); + + return view; +} + static void remove_configured_listener(struct ivi_layout_surface *ivisurf) { @@ -302,18 +318,15 @@ static void update_opacity(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *ivisurf) { + struct weston_view *tmpview = NULL; double layer_alpha = wl_fixed_to_double(ivilayer->prop.opacity); double surf_alpha = wl_fixed_to_double(ivisurf->prop.opacity); if ((ivilayer->event_mask & IVI_NOTIFICATION_OPACITY) || (ivisurf->event_mask & IVI_NOTIFICATION_OPACITY)) { - struct weston_view *tmpview = NULL; - wl_list_for_each(tmpview, >surface->views, surface_link) { - if (tmpview == NULL) { - continue; - } - tmpview->alpha = layer_alpha * surf_alpha; - } + tmpview = get_weston_view(ivisurf); + assert(tmpview != NULL); + tmpview->alpha = layer_alpha * surf_alpha; } } @@ -590,11 +603,8 @@ update_prop(struct ivi_layout_layer *ivilayer, update_opacity(ivilayer, ivisurf); - wl_list_for_each(tmpview, >surface->views, surface_link) { - if (tmpview != NULL) { - break; - } - } + tmpview = get_weston_view(ivisurf); + assert(tmpview != NULL); if (ivisurf->prop.source_width == 0 || ivisurf->prop.source_height == 0) { weston_log("ivi-shell: source rectangle is not yet set by ivi_layout_surface_set_source_rectangle\n"); @@ -613,24 +623,18 @@ update_prop(struct ivi_layout_layer *ivilayer, calc_surface_to_global_matrix_and_mask_to_weston_surface( ivilayer, ivisurf, >transform.matrix, ); - if (tmpview != NULL) { - weston_view_set_mask(tmpview, r.x, r.y, r.width, r.height); - wl_list_insert(>geometry.transformation_list, - >transform.link); + weston_view_set_mask(tmpview, r.x, r.y, r.width, r.height); + wl_list_insert(>geometry.transformation_list, + >transform.link); - weston_view_set_transform_parent(tmpview, NULL); - } + weston_view_set_transform_parent(tmpview, NULL); } ivisurf->update_count++; - if (tmpview != NULL) { - weston_view_geometry_dirty(tmpview); - } + weston_view_geometry_dirty(tmpview); - if (ivisurf->surface != NULL) { - weston_surface_damage(ivisurf->surface); - } + weston_surface_damage(ivisurf->surface); } static void @@ -799,6 +803,7 @@ commit_screen_list(struct ivi_layout *layout) struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_layer *next = NULL; struct ivi_layout_surface *ivisurf = NULL; + struct weston_view *tmpview = NULL; wl_list_for_each(iviscrn, >screen_list, link) { if (iviscrn->order.dirty) { @@ -831,17 +836,11 @@ commit_s
Re: [PATCH 4/5] ivi-shell: remove is_surface_in_layer API
Hi, Tested-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> BR, Nobuhiko Tanibata 2015-08-28 21:59 に Ucan, Emre (ADITG/SW1) さんは書きました: This internal API is redundant, because a surface is allowed to be only on one layer. Signed-off-by: Emre Ucan <eu...@de.adit-jv.com> --- ivi-shell/ivi-layout.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 47c044a..49e789e 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -233,25 +233,6 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) } /** - * Internal API to check ivi_layer/ivi_surface already added in ivi_layer/ivi_screen. - * Called by ivi_layout_layer_add_surface/ivi_layout_screenAddLayer - */ -static int -is_surface_in_layer(struct ivi_layout_surface *ivisurf, - struct ivi_layout_layer *ivilayer) -{ - struct ivi_layout_surface *surf = NULL; - - wl_list_for_each(surf, >pending.surface_list, pending.link) { - if (surf->id_surface == ivisurf->id_surface) { - return 1; - } - } - - return 0; -} - -/** * Internal API to initialize ivi_screens found from output_list of weston_compositor. * Called by ivi_layout_init_with_compositor. */ @@ -2386,15 +2367,13 @@ ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer, struct ivi_layout *layout = get_instance(); struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_surface *next = NULL; - int is_surf_in_layer = 0; if (ivilayer == NULL || addsurf == NULL) { weston_log("ivi_layout_layer_add_surface: invalid argument\n"); return IVI_FAILED; } - is_surf_in_layer = is_surface_in_layer(addsurf, ivilayer); - if (is_surf_in_layer == 1) { + if (addsurf->on_layer == ivilayer) { weston_log("ivi_layout_layer_add_surface: addsurf is already available\n"); return IVI_SUCCEEDED; } ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH 3/5] ivi-shell: remove is_layer_in_screen API
Hi, Tested-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Best Regards, Nobuhiko Tanibata 2015-08-28 21:59 に Ucan, Emre (ADITG/SW1) さんは書きました: This internal API is redundant, because a layer is allowed to be only on one screen. Signed-off-by: Emre Ucan <eu...@de.adit-jv.com> --- ivi-shell/ivi-layout.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 2a33b3e..47c044a 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -251,21 +251,6 @@ is_surface_in_layer(struct ivi_layout_surface *ivisurf, return 0; } -static int -is_layer_in_screen(struct ivi_layout_layer *ivilayer, - struct ivi_layout_screen *iviscrn) -{ - struct ivi_layout_layer *layer = NULL; - - wl_list_for_each(layer, >pending.layer_list, pending.link) { - if (layer->id_layer == ivilayer->id_layer) { - return 1; - } - } - - return 0; -} - /** * Internal API to initialize ivi_screens found from output_list of weston_compositor. * Called by ivi_layout_init_with_compositor. @@ -2244,15 +2229,13 @@ ivi_layout_screen_add_layer(struct ivi_layout_screen *iviscrn, struct ivi_layout *layout = get_instance(); struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_layer *next = NULL; - int is_layer_in_scrn = 0; if (iviscrn == NULL || addlayer == NULL) { weston_log("ivi_layout_screen_add_layer: invalid argument\n"); return IVI_FAILED; } - is_layer_in_scrn = is_layer_in_screen(addlayer, iviscrn); - if (is_layer_in_scrn == 1) { + if (addlayer->on_screen == iviscrn) { weston_log("ivi_layout_screen_add_layer: addlayer is already available\n"); return IVI_SUCCEEDED; } ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston v2] ivi-layout: implement surface clipping
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp View clip region is set in surface-local coordinates. To compute that region, the ivi-layer destination rectangle in the global coordinates are transformed back into the surface-local coordinates. The transformation is computed by first forming the transformation matric for the forward mappings, and then inverting it. The inverse matric is used to transform the destination rectangles to the surface-local coordinate system. The intersection of the rectangles is the view clip mask. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Changes for v2 - fix whitespaces - rebase on master branch ivi-shell/ivi-layout.c | 147 +++-- 1 file changed, 141 insertions(+), 6 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 827359a..24bd8dd 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -67,6 +67,8 @@ #include shared/helpers.h #include shared/os-compatibility.h +#define max(a, b) ((a) (b) ? (a) : (b)) + struct link_layer { struct ivi_layout_layer *ivilayer; struct wl_list link; @@ -567,18 +569,127 @@ calc_transformation_matrix(struct ivi_rectangle *source_rect, weston_matrix_translate(m, translate_x, translate_y, 0.0f); } +/* + * This computes intersected rect_output from two ivi_rectangles + */ +static void +ivi_rectangle_intersect(const struct ivi_rectangle *rect1, + const struct ivi_rectangle *rect2, + struct ivi_rectangle *rect_output) +{ + int32_t rect1_right = rect1-x + rect1-width; + int32_t rect1_bottom = rect1-y + rect1-height; + int32_t rect2_right = rect2-x + rect2-width; + int32_t rect2_bottom = rect2-y + rect2-height; + + rect_output-x = max(rect1-x, rect2-x); + rect_output-y = max(rect1-y, rect2-y); + rect_output-width = rect1_right rect2_right ? +rect1_right - rect_output-x : +rect2_right - rect_output-x; + rect_output-height = rect1_bottom rect2_bottom ? + rect1_bottom - rect_output-y : + rect2_bottom - rect_output-y; + + if (rect_output-width 0 || rect_output-height 0) { + rect_output-width = 0; + rect_output-height = 0; + } +} + +/* + * Transform rect_input by the inverse of matrix, intersect with boundingbox, + * and store the result in rect_output. + * The boundingbox must be given in the same coordinate space as rect_output. + * Additionally, there are the following restrictions on the matrix: + * - no projective transformations + * - no skew + * - only multiples of 90-degree rotations supported + * + * In failure case of weston_matrix_invert, rect_output is set to boundingbox + * as a fail-safe with log. + */ +static void +calc_inverse_matrix_transform(const struct weston_matrix *matrix, + const struct ivi_rectangle *rect_input, + const struct ivi_rectangle *boundingbox, + struct ivi_rectangle *rect_output) +{ + struct weston_matrix m; + struct weston_vector top_left; + struct weston_vector bottom_right; + + assert(boundingbox != rect_output); + + if (weston_matrix_invert(m, matrix) 0) { + weston_log(ivi-shell: calc_inverse_matrix_transform fails to invert a matrix.\n); + weston_log(ivi-shell: boundingbox is set to the rect_output.\n); + rect_output-x = boundingbox-x; + rect_output-y = boundingbox-y; + rect_output-width = boundingbox-width; + rect_output-height = boundingbox-height; + } + + /* The vectors and matrices involved will always produce f[3] == 1.0. */ + top_left.f[0] = rect_input-x; + top_left.f[1] = rect_input-y; + top_left.f[2] = 0.0f; + top_left.f[3] = 1.0f; + + bottom_right.f[0] = rect_input-x + rect_input-width; + bottom_right.f[1] = rect_input-y + rect_input-height; + bottom_right.f[2] = 0.0f; + bottom_right.f[3] = 1.0f; + + weston_matrix_transform(m, top_left); + weston_matrix_transform(m, bottom_right); + + if (top_left.f[0] bottom_right.f[0]) { + rect_output-x = top_left.f[0]; + rect_output-width = bottom_right.f[0] - rect_output-x; + } else { + rect_output-x = bottom_right.f[0]; + rect_output-width = top_left.f[0] - rect_output-x; + } + + if (top_left.f[1] bottom_right.f[1]) { + rect_output-y = top_left.f[1]; + rect_output-height = bottom_right.f[1] - rect_output-y; + } else { + rect_output-y = bottom_right.f[1]; + rect_output-height = top_left.f[1
[PATCH weston] hmi-controller: fix the laucher layer width
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp A layer for workspace is used to display icons for invoking applications in several pages. These pages are swapped from one to next page. The width of the layer was decided as a size of screen before reading weston.ini. This worked correctly because there was no feature of clipping of layer so the width of layer was not taken account. Now clipping feature is supported. So the width shall be set to correct one after reading weston.ini. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/hmi-controller.c | 71 -- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 760bf06..19ceef2 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -725,27 +725,9 @@ hmi_controller_create(struct weston_compositor *ec) ivi_controller_interface-layer_set_visibility( hmi_ctrl-workspace_background_layer.ivilayer, false); - /* init workspace ivi_layer */ - hmi_ctrl-workspace_layer.x = hmi_ctrl-workspace_background_layer.x; - hmi_ctrl-workspace_layer.y = hmi_ctrl-workspace_background_layer.y; - hmi_ctrl-workspace_layer.width = - hmi_ctrl-workspace_background_layer.width; - hmi_ctrl-workspace_layer.height = - hmi_ctrl-workspace_background_layer.height; - hmi_ctrl-workspace_layer.id_layer = - hmi_ctrl-hmi_setting-workspace_layer_id; - - create_layer(iviscrn, hmi_ctrl-workspace_layer); - ivi_controller_interface-layer_set_opacity(hmi_ctrl-workspace_layer.ivilayer, 0); - ivi_controller_interface-layer_set_visibility(hmi_ctrl-workspace_layer.ivilayer, - false); wl_list_init(hmi_ctrl-workspace_fade.layer_list); tmp_link_layer = MEM_ALLOC(sizeof(*tmp_link_layer)); - tmp_link_layer-layout_layer = hmi_ctrl-workspace_layer.ivilayer; - wl_list_insert(hmi_ctrl-workspace_fade.layer_list, - tmp_link_layer-link); - tmp_link_layer = MEM_ALLOC(sizeof(*tmp_link_layer)); tmp_link_layer-layout_layer = hmi_ctrl-workspace_background_layer.ivilayer; wl_list_insert(hmi_ctrl-workspace_fade.layer_list, @@ -980,12 +962,11 @@ static void ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, int32_t icon_size) { - struct ivi_layout_layer *layer = hmi_ctrl-workspace_layer.ivilayer; int32_t minspace_x = 10; int32_t minspace_y = minspace_x; - int32_t width = hmi_ctrl-workspace_layer.width; - int32_t height = hmi_ctrl-workspace_layer.height; + int32_t width = hmi_ctrl-workspace_background_layer.width; + int32_t height = hmi_ctrl-workspace_background_layer.height; int32_t x_count = (width - minspace_x) / (minspace_x + icon_size); int32_t space_x = (int32_t)((width - x_count * icon_size) / (1.0 + x_count)); @@ -1015,6 +996,11 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface* layout_surface = NULL; uint32_t *add_surface_id = NULL; + struct ivi_layout_screen *iviscrn = NULL; + struct link_layer *tmp_link_layer = NULL; + struct ivi_layout_screen **pp_screen = NULL; + int32_t screen_length = 0; + if (0 == x_count) x_count = 1; @@ -1091,16 +1077,10 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, ivi_controller_interface-get_surface_from_id(data-surface_id); assert(layout_surface); - ret = ivi_controller_interface-layer_add_surface(layer, layout_surface); - assert(!ret); - ret = ivi_controller_interface-surface_set_destination_rectangle( layout_surface, x, y, icon_size, icon_size); assert(!ret); - ret = ivi_controller_interface-surface_set_visibility(layout_surface, true); - assert(!ret); - nx++; if (x_count == nx) { @@ -1109,6 +1089,43 @@ ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, } } + /* init workspace ivi_layer */ + hmi_ctrl-workspace_layer.x = hmi_ctrl-workspace_background_layer.x; + hmi_ctrl-workspace_layer.y = hmi_ctrl-workspace_background_layer.y; + hmi_ctrl-workspace_layer.width = + hmi_ctrl-workspace_background_layer.width * hmi_ctrl-workspace_count; + hmi_ctrl-workspace_layer.height = + hmi_ctrl-workspace_background_layer.height; + hmi_ctrl-workspace_layer.id_layer = + hmi_ctrl-hmi_setting-workspace_layer_id; + + ivi_controller_interface
[PATCH weston] hmi-controller: fix wrong width and height are set to a layer of workspace.
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/hmi-controller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 19ceef2..c388164 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -1287,8 +1287,8 @@ move_workspace_grab_end(struct move_grab *move, struct wl_resource* resource, duration); ivi_controller_interface-layer_set_destination_rectangle(layer, end_pos, pos_y, - hmi_ctrl-workspace_background_layer.width, - hmi_ctrl-workspace_background_layer.height); + hmi_ctrl-workspace_layer.width, + hmi_ctrl-workspace_layer.height); ivi_controller_interface-commit_changes(); } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston] ivi-layout: implement surface clipping
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp View clip region is set in surface-local coordinates. To compute that region, the ivi-layer destination rectangle in the global coordinates are transformed back into the surface-local coordinates. The transformation is computed by first forming the transformation matric for the forward mappings, and then inverting it. The inverse matric is used to transform the destination rectangles to the surface-local coordinate system. The intersection of the rectangles is the view clip mask. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 148 +++-- 1 file changed, 142 insertions(+), 6 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index d412069..69adac7 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -58,6 +58,7 @@ #include config.h #include string.h +#include assert.h #include compositor.h #include ivi-layout-export.h @@ -66,6 +67,8 @@ #include shared/helpers.h #include shared/os-compatibility.h +#define max(a, b) ((a) (b) ? (a) : (b)) + struct link_layer { struct ivi_layout_layer *ivilayer; struct wl_list link; @@ -586,18 +589,127 @@ calc_transformation_matrix(struct ivi_rectangle *source_rect, weston_matrix_translate(m, translate_x, translate_y, 0.0f); } +/* + * This computes intersected rect_output from two ivi_rectangles + */ +static void +ivi_rectangle_intersect(const struct ivi_rectangle *rect1, + const struct ivi_rectangle *rect2, + struct ivi_rectangle *rect_output) +{ + int32_t rect1_right = rect1-x + rect1-width; + int32_t rect1_bottom = rect1-y + rect1-height; + int32_t rect2_right = rect2-x + rect2-width; + int32_t rect2_bottom = rect2-y + rect2-height; + + rect_output-x = max(rect1-x, rect2-x); + rect_output-y = max(rect1-y, rect2-y); + rect_output-width = rect1_right rect2_right ? +rect1_right - rect_output-x : +rect2_right - rect_output-x; + rect_output-height = rect1_bottom rect2_bottom ? + rect1_bottom - rect_output-y : + rect2_bottom - rect_output-y; + + if (rect_output-width 0 || rect_output-height 0) { + rect_output-width = 0; + rect_output-height = 0; + } +} + +/* + * Transform rect_input by the inverse of matrix, intersect with boundingbox, + * and store the result in rect_output. + * The boundingbox must be given in the same coordinate space as rect_output. + * Additionally, there are the following restrictions on the matrix: + * - no projective transformations + * - no skew + * - only multiples of 90-degree rotations supported + * + * In failure case of weston_matrix_invert, rect_output is set to boundingbox + * as a fail-safe with log. + */ +static void +calc_inverse_matrix_transform(const struct weston_matrix *matrix, + const struct ivi_rectangle *rect_input, + const struct ivi_rectangle *boundingbox, + struct ivi_rectangle *rect_output) +{ + struct weston_matrix m; + struct weston_vector top_left; + struct weston_vector bottom_right; + + assert(boundingbox != rect_output); + + if (weston_matrix_invert(m, matrix) 0) { + weston_log(ivi-shell: calc_inverse_matrix_transform fails to invert a matrix.\n); + weston_log(ivi-shell: boundingbox is set to the rect_output.\n); + rect_output-x = boundingbox-x; + rect_output-y = boundingbox-y; + rect_output-width = boundingbox-width; + rect_output-height = boundingbox-height; + } + + /* The vectors and matrices involved will always produce f[3] == 1.0. */ + top_left.f[0] = rect_input-x; + top_left.f[1] = rect_input-y; + top_left.f[2] = 0.0f; + top_left.f[3] = 1.0f; + + bottom_right.f[0] = rect_input-x + rect_input-width; + bottom_right.f[1] = rect_input-y + rect_input-height; + bottom_right.f[2] = 0.0f; + bottom_right.f[3] = 1.0f; + + weston_matrix_transform(m, top_left); + weston_matrix_transform(m, bottom_right); + + if (top_left.f[0] bottom_right.f[0]) { + rect_output-x = top_left.f[0]; + rect_output-width = bottom_right.f[0] - rect_output-x; + } else { + rect_output-x = bottom_right.f[0]; + rect_output-width = top_left.f[0] - rect_output-x; + } + + if (top_left.f[1] bottom_right.f[1]) { + rect_output-y = top_left.f[1]; + rect_output-height = bottom_right.f[1] - rect_output-y; + } else { + rect_output-y
[PATCH weston v2] ivi-shell: bugfix, an ivi_surface is not removed from list of ivi_layer when the ivi_surface is removed from the compositor.
The api, ivi_layout_layer_remove_surface, shall remove a ivi_surface from a list of ivi_layer. In previous code, there is no trigger to refresh order of list, removing the ivi_surface, in commit_layer_list. To fix this bug, set a mask; IVI_NOTIFICATION_REMOVE in order to trigger refresh list of surface in commit_layer_list. In commit_layer_list, this patch also removes duplicated code in two conditions for IVI_NOTIFICATION_ADD/REMOVE. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- v2 changes: - fix 8 spaces to tab. - clean up duplicate code in commit_layer_list. - improve commit message. ivi-shell/ivi-layout.c | 28 +--- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 2974bb7..1b45003 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -812,25 +812,7 @@ commit_layer_list(struct ivi_layout *layout) if (!(ivilayer-event_mask (IVI_NOTIFICATION_ADD | IVI_NOTIFICATION_REMOVE)) ) { continue; - } - - if (ivilayer-event_mask IVI_NOTIFICATION_REMOVE) { - wl_list_for_each_safe(ivisurf, next, - ivilayer-order.surface_list, order.link) { - remove_ordersurface_from_layer(ivisurf); - - if (!wl_list_empty(ivisurf-order.link)) { - wl_list_remove(ivisurf-order.link); - } - - wl_list_init(ivisurf-order.link); - ivisurf-event_mask |= IVI_NOTIFICATION_REMOVE; - } - - wl_list_init(ivilayer-order.surface_list); - } - - if (ivilayer-event_mask IVI_NOTIFICATION_ADD) { + } else { wl_list_for_each_safe(ivisurf, next, ivilayer-order.surface_list, order.link) { remove_ordersurface_from_layer(ivisurf); @@ -843,6 +825,13 @@ commit_layer_list(struct ivi_layout *layout) } wl_list_init(ivilayer-order.surface_list); + + /** +* Following ivilayer-pending.surface_list must be maintained by +* a function who will set these masks. Order of surfaces in a +* layer is restructured here. if there is no surface in +* surface_list, the following code is skipped. +*/ wl_list_for_each(ivisurf, ivilayer-pending.surface_list, pending.link) { if(!wl_list_empty(ivisurf-order.link)){ @@ -2565,6 +2554,7 @@ ivi_layout_layer_remove_surface(struct ivi_layout_layer *ivilayer, } remsurf-event_mask |= IVI_NOTIFICATION_REMOVE; + ivilayer-event_mask |= IVI_NOTIFICATION_REMOVE; } static int32_t -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: bugfix, ivi_surface is not removed from list of a layer when the ivi_surface is removed from the compositor.
Set a mask value to event_mask of ivi_layout_layer, a removed ivi_surface belongs to, in order to trigger refreshing a list of surface in ivi_layout_layer. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/ivi-layout.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 2974bb7..bb175b0 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2565,6 +2565,7 @@ ivi_layout_layer_remove_surface(struct ivi_layout_layer *ivilayer, } remsurf-event_mask |= IVI_NOTIFICATION_REMOVE; +ivilayer-event_mask |= IVI_NOTIFICATION_REMOVE; } static int32_t -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: bugfix, list of surfaces on a layer are cumulated when set render order is called several time in one commitchanges.
The final list of surfaces of set render order shall be applied. So link of surfaces and list of surfaces in a layer shall be initialized. And then the order of surfaces shall be restructured. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/ivi-layout.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index bb175b0..2b61ff2 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2082,14 +2082,14 @@ ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, return IVI_FAILED; } - if (pSurface == NULL) { - wl_list_for_each_safe(ivisurf, next, ivilayer-pending.surface_list, pending.link) { - if (!wl_list_empty(ivisurf-pending.link)) { - wl_list_remove(ivisurf-pending.link); - } + wl_list_for_each_safe(ivisurf, next, + ivilayer-pending.surface_list, pending.link) { + wl_list_init(ivisurf-pending.link); + } - wl_list_init(ivisurf-pending.link); - } + wl_list_init(ivilayer-pending.surface_list); + + if (pSurface == NULL || number ==0) { ivilayer-event_mask |= IVI_NOTIFICATION_REMOVE; return IVI_SUCCEEDED; } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH] ivi-shell: bugfix, ivi_surface is not removed from list of a layer when the ivi_surface is removed from the compositor.
2015-08-06 02:15 に Derek Foreman さんは書きました: On 05/08/15 01:58 AM, Nobuhiko Tanibata wrote: Set a mask value to event_mask of ivi_layout_layer, a removed ivi_surface belongs to, in order to trigger refreshing a list of surface in ivi_layout_layer. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/ivi-layout.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 2974bb7..bb175b0 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2565,6 +2565,7 @@ ivi_layout_layer_remove_surface(struct ivi_layout_layer *ivilayer, } remsurf-event_mask |= IVI_NOTIFICATION_REMOVE; +ivilayer-event_mask |= IVI_NOTIFICATION_REMOVE; This should be a tab, not 8 spaces... Sorry I don't know enough to really review the code - to me it looks like this just ends up removing all the surfaces from that layer in commit_layer_list(). Thank you for review! I shall fix 8 spaces and add more clear commit message, and so on. I will improve this and send new one as V2. BR, Nobuhiko Tanibata } static int32_t ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: remove one indent level from update_prop()
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp There is no logic update. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 39 +-- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 5f9235c..fdba0dd 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -756,30 +756,33 @@ static void update_prop(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *ivisurf) { - if (ivilayer-event_mask | ivisurf-event_mask) { - struct weston_view *tmpview; - update_opacity(ivilayer, ivisurf); - update_layer_orientation(ivilayer, ivisurf); - update_layer_position(ivilayer, ivisurf); - update_surface_position(ivisurf); - update_surface_orientation(ivilayer, ivisurf); - update_scale(ivilayer, ivisurf); + struct weston_view *tmpview; - ivisurf-update_count++; + if (!ivilayer-event_mask !ivisurf-event_mask) { + return; + } - wl_list_for_each(tmpview, ivisurf-surface-views, surface_link) { - if (tmpview != NULL) { - break; - } - } + update_opacity(ivilayer, ivisurf); + update_layer_orientation(ivilayer, ivisurf); + update_layer_position(ivilayer, ivisurf); + update_surface_position(ivisurf); + update_surface_orientation(ivilayer, ivisurf); + update_scale(ivilayer, ivisurf); + + ivisurf-update_count++; + wl_list_for_each(tmpview, ivisurf-surface-views, surface_link) { if (tmpview != NULL) { - weston_view_geometry_dirty(tmpview); + break; } + } - if (ivisurf-surface != NULL) { - weston_surface_damage(ivisurf-surface); - } + if (tmpview != NULL) { + weston_view_geometry_dirty(tmpview); + } + + if (ivisurf-surface != NULL) { + weston_surface_damage(ivisurf-surface); } } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 1/2] ivi-shell: transform refactoring, remove transform part of ivi_layout_surface and ivi_layout_layer once
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp To refactor transform of ivi_layout_surface and ivi_layout_surface to be more readable logical flow. Remove following parts once, * definition of weston_transform in ivi_layout_surface * update_layer_orientation * update_layer_position * update_surface_position * update_surface_orientation * update_scale Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-private.h | 5 - ivi-shell/ivi-layout.c | 283 - 2 files changed, 288 deletions(-) diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index cf2db7d..4debfd6 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -39,11 +39,6 @@ struct ivi_layout_surface { struct ivi_layout *layout; struct weston_surface *surface; - struct weston_transform surface_rotation; - struct weston_transform layer_rotation; - struct weston_transform surface_pos; - struct weston_transform layer_pos; - struct weston_transform scaling; struct ivi_layout_surface_properties prop; uint32_t event_mask; diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index fdba0dd..8e0a9f1 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -348,12 +348,6 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) return; } - wl_list_remove(ivisurf-surface_rotation.link); - wl_list_remove(ivisurf-layer_rotation.link); - wl_list_remove(ivisurf-surface_pos.link); - wl_list_remove(ivisurf-layer_pos.link); - wl_list_remove(ivisurf-scaling.link); - wl_list_remove(ivisurf-pending.link); wl_list_remove(ivisurf-order.link); wl_list_remove(ivisurf-link); @@ -365,8 +359,6 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) ivi_layout_surface_remove_notification(ivisurf); - ivisurf-surface = NULL; - free(ivisurf); } @@ -494,265 +486,6 @@ update_opacity(struct ivi_layout_layer *ivilayer, } static void -update_surface_orientation(struct ivi_layout_layer *ivilayer, - struct ivi_layout_surface *ivisurf) -{ - struct weston_view *view; - struct weston_matrix *matrix = ivisurf-surface_rotation.matrix; - float width = 0.0f; - float height = 0.0f; - float v_sin = 0.0f; - float v_cos = 0.0f; - float cx = 0.0f; - float cy = 0.0f; - float sx = 1.0f; - float sy = 1.0f; - - wl_list_for_each(view, ivisurf-surface-views, surface_link) { - if (view != NULL) { - break; - } - } - - if (view == NULL) { - return; - } - - if ((ivilayer-prop.dest_width == 0) || - (ivilayer-prop.dest_height == 0)) { - return; - } - width = (float)ivilayer-prop.dest_width; - height = (float)ivilayer-prop.dest_height; - - switch (ivisurf-prop.orientation) { - case WL_OUTPUT_TRANSFORM_NORMAL: - v_sin = 0.0f; - v_cos = 1.0f; - break; - case WL_OUTPUT_TRANSFORM_90: - v_sin = 1.0f; - v_cos = 0.0f; - sx = width / height; - sy = height / width; - break; - case WL_OUTPUT_TRANSFORM_180: - v_sin = 0.0f; - v_cos = -1.0f; - break; - case WL_OUTPUT_TRANSFORM_270: - default: - v_sin = -1.0f; - v_cos = 0.0f; - sx = width / height; - sy = height / width; - break; - } - wl_list_remove(ivisurf-surface_rotation.link); - weston_view_geometry_dirty(view); - - weston_matrix_init(matrix); - cx = 0.5f * width; - cy = 0.5f * height; - weston_matrix_translate(matrix, -cx, -cy, 0.0f); - weston_matrix_rotate_xy(matrix, v_cos, v_sin); - weston_matrix_scale(matrix, sx, sy, 1.0); - weston_matrix_translate(matrix, cx, cy, 0.0f); - wl_list_insert(view-geometry.transformation_list, - ivisurf-surface_rotation.link); - - weston_view_set_transform_parent(view, NULL); - weston_view_update_transform(view); -} - -static void -update_layer_orientation(struct ivi_layout_layer *ivilayer, -struct ivi_layout_surface *ivisurf) -{ - struct weston_surface *es = ivisurf-surface; - struct weston_view*view; - struct weston_matrix *matrix = ivisurf-layer_rotation.matrix; - struct weston_output *output = NULL; - float width = 0.0f; - float height = 0.0f; - float v_sin = 0.0f; - float v_cos = 0.0f; - float cx = 0.0f; - float cy = 0.0f; - float sx
[PATCH weston 2/2] ivi-shell: transform refactoring to improve it to more readable code
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Transform matrix for transforming a surface to global_matrix is calculated from * ivi_layout_surface_properties * ivi_layout_layer_properties This patch pareares sub-method like following, 1/ calc_surface_to_global_matrix() calc_transformation_matrix() is called twice with ivi_layout_surface/layer_properties respectively. 2/ calc_transformation_matrix() This calcurates matrix from orientation, source rectangle and destination rectangle. 2-1/ To calculate rotation, fit centor of source rectangle to (0,0) temporarily. This is moved back in 2-4. 2-2/ Apply rotation variant 2-3/ Apply scale variant 2-4/ Apply positioning variant, taking account into 2-1 temporary positioning. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-private.h | 1 + ivi-shell/ivi-layout.c | 169 - 2 files changed, 168 insertions(+), 2 deletions(-) diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index 4debfd6..9c04c30 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -39,6 +39,7 @@ struct ivi_layout_surface { struct ivi_layout *layout; struct weston_surface *surface; + struct weston_transform transform; struct ivi_layout_surface_properties prop; uint32_t event_mask; diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 8e0a9f1..2974bb7 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -111,6 +111,14 @@ struct ivi_layout_notification_callback { void *data; }; +struct ivi_rectangle +{ + int32_t x; + int32_t y; + int32_t width; + int32_t height; +}; + static void remove_notification(struct wl_list *listener_list, void *callback, void *userdata); @@ -348,6 +356,7 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) return; } + wl_list_remove(ivisurf-transform.link); wl_list_remove(ivisurf-pending.link); wl_list_remove(ivisurf-order.link); wl_list_remove(ivisurf-link); @@ -486,10 +495,141 @@ update_opacity(struct ivi_layout_layer *ivilayer, } static void +get_rotate_values(enum wl_output_transform orientation, + float *v_sin, + float *v_cos) +{ + switch (orientation) { + case WL_OUTPUT_TRANSFORM_90: + *v_sin = 1.0f; + *v_cos = 0.0f; + break; + case WL_OUTPUT_TRANSFORM_180: + *v_sin = 0.0f; + *v_cos = -1.0f; + break; + case WL_OUTPUT_TRANSFORM_270: + *v_sin = -1.0f; + *v_cos = 0.0f; + break; + case WL_OUTPUT_TRANSFORM_NORMAL: + default: + *v_sin = 0.0f; + *v_cos = 1.0f; + break; + } +} + +static void +get_scale(enum wl_output_transform orientation, + float dest_width, + float dest_height, + float source_width, + float source_height, + float *scale_x, + float *scale_y) +{ + switch (orientation) { + case WL_OUTPUT_TRANSFORM_90: + *scale_x = dest_width / source_height; + *scale_y = dest_height / source_width; + break; + case WL_OUTPUT_TRANSFORM_180: + *scale_x = dest_width / source_width; + *scale_y = dest_height / source_height; + break; + case WL_OUTPUT_TRANSFORM_270: + *scale_x = dest_width / source_height; + *scale_y = dest_height / source_width; + break; + case WL_OUTPUT_TRANSFORM_NORMAL: + default: + *scale_x = dest_width / source_width; + *scale_y = dest_height / source_height; + break; + } +} + +static void +calc_transformation_matrix(struct ivi_rectangle *source_rect, + struct ivi_rectangle *dest_rect, + enum wl_output_transform orientation, + struct weston_matrix *m) +{ + float source_center_x; + float source_center_y; + float vsin; + float vcos; + float scale_x; + float scale_y; + float translate_x; + float translate_y; + + source_center_x = source_rect-x + source_rect-width * 0.5f; + source_center_y = source_rect-y + source_rect-height * 0.5f; + weston_matrix_translate(m, -source_center_x, -source_center_y, 0.0f); + + get_rotate_values(orientation, vsin, vcos); + weston_matrix_rotate_xy(m, vcos, vsin); + + get_scale(orientation, + dest_rect-width, + dest_rect-height, + source_rect-width, + source_rect-height, + scale_x
[PATCH weston 0/2] transform refactoring in ivi-shell
Hi, Current code in ivi-shell to transform a surface to global_matrix is not readable very much. This patch set improves it. This consists of two patches, - remove transform part once to add transform logic from scratch. - add transform logic as more readable way. BR, Nobuhiko Tanibata ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 03/14] tests: test set for ivi-surface with bad condition in server side
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp These tests are implemented on test suite framework, which provides internal method validation. Following features are tested for ivi-surface, - destination_rectangle with bad parameter - orientation with bad parameter - dimension with bad parameter - position with bad parameter - source_rectangle with bad parameter - properties with bad parameter Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- tests/ivi_layout-internal-test.c | 74 1 file changed, 74 insertions(+) diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c index 3fb5148..3b9d6b9 100644 --- a/tests/ivi_layout-internal-test.c +++ b/tests/ivi_layout-internal-test.c @@ -76,6 +76,74 @@ test_surface_bad_visibility(struct test_context *ctx) iassert(visibility == false); } +static void +test_surface_bad_destination_rectangle(struct test_context *ctx) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + iassert(ctl-surface_set_destination_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED); +} + +static void +test_surface_bad_orientation(struct test_context *ctx) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + iassert(ctl-surface_set_orientation(NULL, WL_OUTPUT_TRANSFORM_90) == IVI_FAILED); + + iassert(ctl-surface_get_orientation(NULL) == WL_OUTPUT_TRANSFORM_NORMAL); +} + +static void +test_surface_bad_dimension(struct test_context *ctx) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf = NULL; + int32_t dest_width; + int32_t dest_height; + + iassert(ctl-surface_set_dimension(NULL, 200, 300) == IVI_FAILED); + + ctl-commit_changes(); + + iassert(ctl-surface_get_dimension(NULL, dest_width, dest_height) == IVI_FAILED); + iassert(ctl-surface_get_dimension(ivisurf, NULL, dest_height) == IVI_FAILED); + iassert(ctl-surface_get_dimension(ivisurf, dest_width, NULL) == IVI_FAILED); +} + +static void +test_surface_bad_position(struct test_context *ctx) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf = NULL; + int32_t dest_x; + int32_t dest_y; + + iassert(ctl-surface_set_position(NULL, 20, 30) == IVI_FAILED); + + ctl-commit_changes(); + + iassert(ctl-surface_get_position(NULL, dest_x, dest_y) == IVI_FAILED); + iassert(ctl-surface_get_position(ivisurf, NULL, dest_y) == IVI_FAILED); + iassert(ctl-surface_get_position(ivisurf, dest_x, NULL) == IVI_FAILED); +} + +static void +test_surface_bad_source_rectangle(struct test_context *ctx) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + iassert(ctl-surface_set_source_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED); +} + +static void +test_surface_bad_properties(struct test_context *ctx) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + iassert(ctl-get_properties_of_surface(NULL) == NULL); +} + / tests end / static void @@ -84,6 +152,12 @@ run_internal_tests(void *data) struct test_context *ctx = data; test_surface_bad_visibility(ctx); + test_surface_bad_destination_rectangle(ctx); + test_surface_bad_orientation(ctx); + test_surface_bad_dimension(ctx); + test_surface_bad_position(ctx); + test_surface_bad_source_rectangle(ctx); + test_surface_bad_properties(ctx); weston_compositor_exit_with_code(ctx-compositor, EXIT_SUCCESS); free(ctx); -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 01/14] tests: test set for ivi-surface normal use case with helper client
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp These tests are implemented on test suite framework, which provides helper client. Following features are tested for ivi-surface - orientation - dimension - position - destination rectangle - source rectangle Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- tests/ivi_layout-test-plugin.c | 219 ++--- tests/ivi_layout-test.c| 5 + 2 files changed, 211 insertions(+), 13 deletions(-) diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c index b4abfbf..1d0ce02 100644 --- a/tests/ivi_layout-test-plugin.c +++ b/tests/ivi_layout-test-plugin.c @@ -303,16 +303,16 @@ RUNNER_TEST(surface_create_p1) uint32_t ivi_id; ivisurf[0] = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); - runner_assert_or_return(ivisurf[0]); + runner_assert(ivisurf[0]); ivisurf[1] = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(1)); - runner_assert_or_return(ivisurf[1]); + runner_assert(ivisurf[1]); ivi_id = ctl-get_id_of_surface(ivisurf[0]); - runner_assert_or_return(ivi_id == IVI_TEST_SURFACE_ID(0)); + runner_assert(ivi_id == IVI_TEST_SURFACE_ID(0)); ivi_id = ctl-get_id_of_surface(ivisurf[1]); - runner_assert_or_return(ivi_id == IVI_TEST_SURFACE_ID(1)); + runner_assert(ivi_id == IVI_TEST_SURFACE_ID(1)); } RUNNER_TEST(surface_create_p2) @@ -322,7 +322,7 @@ RUNNER_TEST(surface_create_p2) /* the ivi_surface was destroyed by the client */ ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); - runner_assert_or_return(ivisurf == NULL); + runner_assert(ivisurf == NULL); } RUNNER_TEST(surface_visibility) @@ -334,18 +334,18 @@ RUNNER_TEST(surface_visibility) const struct ivi_layout_surface_properties *prop; ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); - runner_assert_or_return(ivisurf); + runner_assert(ivisurf); ret = ctl-surface_set_visibility(ivisurf, true); - runner_assert_or_return(ret == IVI_SUCCEEDED); + runner_assert(ret == IVI_SUCCEEDED); ctl-commit_changes(); visibility = ctl-surface_get_visibility(ivisurf); - runner_assert_or_return(visibility == true); + runner_assert(visibility == true); prop = ctl-get_properties_of_surface(ivisurf); - runner_assert_or_return(prop-visibility == true); + runner_assert(prop-visibility == true); } RUNNER_TEST(surface_opacity) @@ -357,16 +357,209 @@ RUNNER_TEST(surface_opacity) const struct ivi_layout_surface_properties *prop; ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); - runner_assert_or_return(ivisurf); + runner_assert(ivisurf); + + runner_assert(ctl-surface_get_opacity(ivisurf) == + wl_fixed_from_double(1.0)); ret = ctl-surface_set_opacity(ivisurf, wl_fixed_from_double(0.5)); - runner_assert_or_return(ret == IVI_SUCCEEDED); + runner_assert(ret == IVI_SUCCEEDED); + + runner_assert(ctl-surface_get_opacity(ivisurf) == + wl_fixed_from_double(1.0)); ctl-commit_changes(); opacity = ctl-surface_get_opacity(ivisurf); - runner_assert_or_return(opacity == wl_fixed_from_double(0.5)); + runner_assert(opacity == wl_fixed_from_double(0.5)); + + prop = ctl-get_properties_of_surface(ivisurf); + runner_assert(prop-opacity == wl_fixed_from_double(0.5)); +} + +RUNNER_TEST(surface_orientation) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + const struct ivi_layout_surface_properties *prop; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert(ivisurf != NULL); + + runner_assert(ctl-surface_get_orientation(ivisurf) == + WL_OUTPUT_TRANSFORM_NORMAL); + + runner_assert(ctl-surface_set_orientation( + ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); + + runner_assert(ctl-surface_get_orientation(ivisurf) == + WL_OUTPUT_TRANSFORM_NORMAL); + + ctl-commit_changes(); + + runner_assert(ctl-surface_get_orientation( + ivisurf) == WL_OUTPUT_TRANSFORM_90); + + prop = ctl-get_properties_of_surface(ivisurf); + runner_assert_or_return(prop); + runner_assert(prop-orientation == WL_OUTPUT_TRANSFORM_90); +} + +RUNNER_TEST(surface_dimension) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + const struct ivi_layout_surface_properties *prop; + int32_t dest_width; + int32_t dest_height; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert
[PATCH 02/14] tests: test set for ivi-surface bad condition with helper client
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp These tests are implemented on test suite framework, which provides helper client. Following features are tested, - ivi_layout_runner with basic_test_names[] - surface with bad opacity - destroy ivi/wl_surface and call get_surface - commit_changes_after_properties_set_surface_destroy with surface_property_commit_changes_test_names[] - call set_visibility, destroy ivi-surface, and commit_changes - call set_opacity, destroy ivi-surface, and commit_changes - call set_orientation, destroy ivi-surface, and commit_changes - call set_dimension, destroy ivi-surface, and commit_changes - call set_position, destroy ivi-surface, and commit_changes - call set_source_rectangle, destroy ivi-surface, and commit_changes - call set_destination_rectangle, destroy ivi-surface, and commit_changes Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- tests/ivi_layout-test-plugin.c | 134 + tests/ivi_layout-test.c| 73 ++ 2 files changed, 207 insertions(+) diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c index 1d0ce02..fd57d06 100644 --- a/tests/ivi_layout-test-plugin.c +++ b/tests/ivi_layout-test-plugin.c @@ -563,3 +563,137 @@ RUNNER_TEST(surface_source_rectangle) runner_assert(prop-source_x == 20); runner_assert(prop-source_y == 30); } + +RUNNER_TEST(surface_bad_opacity) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + wl_fixed_t opacity; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert(ivisurf != NULL); + + runner_assert(ctl-surface_set_opacity( + NULL, wl_fixed_from_double(0.3)) == IVI_FAILED); + + runner_assert(ctl-surface_set_opacity( + ivisurf, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED); + + runner_assert(ctl-surface_set_opacity( + ivisurf, wl_fixed_from_double(-1)) == IVI_FAILED); + + ctl-commit_changes(); + + opacity = ctl-surface_get_opacity(ivisurf); + runner_assert(opacity == wl_fixed_from_double(0.3)); + + runner_assert(ctl-surface_set_opacity( + ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED); + + ctl-commit_changes(); + + opacity = ctl-surface_get_opacity(ivisurf); + runner_assert(opacity == wl_fixed_from_double(0.3)); + + runner_assert(ctl-surface_set_opacity( + NULL, wl_fixed_from_double(0.5)) == IVI_FAILED); + + ctl-commit_changes(); + + opacity = ctl-surface_get_opacity(NULL); + runner_assert(opacity == wl_fixed_from_double(0.0)); +} + +RUNNER_TEST(ivi_layout_commit_changes) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + ctl-commit_changes(); +} + +RUNNER_TEST(commit_changes_after_visibility_set_surface_destroy) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert(ivisurf != NULL); + runner_assert(ctl-surface_set_visibility( + ivisurf, true) == IVI_SUCCEEDED); +} + +RUNNER_TEST(commit_changes_after_opacity_set_surface_destroy) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert(ivisurf != NULL); + runner_assert(ctl-surface_set_opacity( + ivisurf, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED); +} + +RUNNER_TEST(commit_changes_after_orientation_set_surface_destroy) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert(ivisurf != NULL); + runner_assert(ctl-surface_set_orientation( + ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); +} + +RUNNER_TEST(commit_changes_after_dimension_set_surface_destroy) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert(ivisurf != NULL); + runner_assert(ctl-surface_set_dimension( + ivisurf, 200, 300) == IVI_SUCCEEDED); +} + +RUNNER_TEST(commit_changes_after_position_set_surface_destroy) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + struct ivi_layout_surface *ivisurf; + + ivisurf = ctl-get_surface_from_id(IVI_TEST_SURFACE_ID(0)); + runner_assert(ivisurf != NULL
[PATCH 12/13] ivi-shell: bugfix, update event_mask when new propertiy is not same as before.
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp In previous code, it sends notification whenever setter calls. This patch fixs that notification will not happens if there is no change of properties by setter. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 80 +- 1 file changed, 66 insertions(+), 14 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index c39e751..b4165a8 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1951,7 +1951,10 @@ ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, prop = ivilayer-pending.prop; prop-visibility = newVisibility; - ivilayer-event_mask |= IVI_NOTIFICATION_VISIBILITY; + if (ivilayer-prop.visibility != newVisibility) + ivilayer-event_mask |= IVI_NOTIFICATION_VISIBILITY; + else + ivilayer-event_mask = ~IVI_NOTIFICATION_VISIBILITY; return IVI_SUCCEEDED; } @@ -1983,7 +1986,10 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, prop = ivilayer-pending.prop; prop-opacity = opacity; - ivilayer-event_mask |= IVI_NOTIFICATION_OPACITY; + if (ivilayer-prop.opacity != opacity) + ivilayer-event_mask |= IVI_NOTIFICATION_OPACITY; + else + ivilayer-event_mask = ~IVI_NOTIFICATION_OPACITY; return IVI_SUCCEEDED; } @@ -2017,7 +2023,12 @@ ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer, prop-source_width = width; prop-source_height = height; - ivilayer-event_mask |= IVI_NOTIFICATION_SOURCE_RECT; + if (ivilayer-prop.source_x != x || ivilayer-prop.source_y != y || + ivilayer-prop.source_width != width || + ivilayer-prop.source_height != height) + ivilayer-event_mask |= IVI_NOTIFICATION_SOURCE_RECT; + else + ivilayer-event_mask = ~IVI_NOTIFICATION_SOURCE_RECT; return IVI_SUCCEEDED; } @@ -2040,7 +2051,12 @@ ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer, prop-dest_width = width; prop-dest_height = height; - ivilayer-event_mask |= IVI_NOTIFICATION_DEST_RECT; + if (ivilayer-prop.dest_x != x || ivilayer-prop.dest_y != y || + ivilayer-prop.dest_width != width || + ivilayer-prop.dest_height != height) + ivilayer-event_mask |= IVI_NOTIFICATION_DEST_RECT; + else + ivilayer-event_mask = ~IVI_NOTIFICATION_DEST_RECT; return IVI_SUCCEEDED; } @@ -2076,7 +2092,11 @@ ivi_layout_layer_set_dimension(struct ivi_layout_layer *ivilayer, prop-dest_width = dest_width; prop-dest_height = dest_height; - ivilayer-event_mask |= IVI_NOTIFICATION_DIMENSION; + if (ivilayer-prop.dest_width != dest_width || + ivilayer-prop.dest_height != dest_height) + ivilayer-event_mask |= IVI_NOTIFICATION_DIMENSION; + else + ivilayer-event_mask = ~IVI_NOTIFICATION_DIMENSION; return IVI_SUCCEEDED; } @@ -2111,7 +2131,10 @@ ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer, prop-dest_x = dest_x; prop-dest_y = dest_y; - ivilayer-event_mask |= IVI_NOTIFICATION_POSITION; + if (ivilayer-prop.dest_x != dest_x || ivilayer-prop.dest_y != dest_y) + ivilayer-event_mask |= IVI_NOTIFICATION_POSITION; + else + ivilayer-event_mask = ~IVI_NOTIFICATION_POSITION; return IVI_SUCCEEDED; } @@ -2130,7 +2153,10 @@ ivi_layout_layer_set_orientation(struct ivi_layout_layer *ivilayer, prop = ivilayer-pending.prop; prop-orientation = orientation; - ivilayer-event_mask |= IVI_NOTIFICATION_ORIENTATION; + if (ivilayer-prop.orientation != orientation) + ivilayer-event_mask |= IVI_NOTIFICATION_ORIENTATION; + else + ivilayer-event_mask = ~IVI_NOTIFICATION_ORIENTATION; return IVI_SUCCEEDED; } @@ -2211,7 +2237,10 @@ ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, prop = ivisurf-pending.prop; prop-visibility = newVisibility; - ivisurf-event_mask |= IVI_NOTIFICATION_VISIBILITY; + if (ivisurf-prop.visibility != newVisibility) + ivisurf-event_mask |= IVI_NOTIFICATION_VISIBILITY; + else + ivisurf-event_mask = ~IVI_NOTIFICATION_VISIBILITY; return IVI_SUCCEEDED; } @@ -2243,7 +2272,10 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, prop = ivisurf-pending.prop; prop-opacity = opacity; - ivisurf-event_mask |= IVI_NOTIFICATION_OPACITY; + if (ivisurf-prop.opacity != opacity) + ivisurf-event_mask |= IVI_NOTIFICATION_OPACITY; + else
[PATCH 10/13] ivi-shell: add interface to get screen ID
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp This interface is required for user to manage screens per IDs. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-export.h | 7 +++ ivi-shell/ivi-layout.c| 15 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index 2f93811..68d3760 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -797,6 +797,13 @@ struct ivi_controller_interface { layer_property_notification_func callback, void *userdata); + /** +* \brief get id of ivi_screen from ivi_layout_screen +* +* +* \return id of ivi_screen +*/ + uint32_t (*get_id_of_screen)(struct ivi_layout_screen *iviscrn); }; #ifdef __cplusplus diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index bfd9d32..a7f9e02 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1480,6 +1480,12 @@ ivi_layout_get_id_of_layer(struct ivi_layout_layer *ivilayer) return ivilayer-id_layer; } +static uint32_t +ivi_layout_get_id_of_screen(struct ivi_layout_screen *iviscrn) +{ + return iviscrn-id_screen; +} + static struct ivi_layout_layer * ivi_layout_get_layer_from_id(uint32_t id_layer) { @@ -2972,7 +2978,7 @@ static struct ivi_controller_interface ivi_controller_interface = { .layer_set_transition = ivi_layout_layer_set_transition, /** -* screen controller interfaces +* screen controller interfaces part1 */ .get_screen_from_id = ivi_layout_get_screen_from_id, .get_screen_resolution = ivi_layout_get_screen_resolution, @@ -2998,7 +3004,12 @@ static struct ivi_controller_interface ivi_controller_interface = { * remove notification by callback on property changes of ivi_surface/layer */ .surface_remove_notification_by_callback= ivi_layout_surface_remove_notification_by_callback, - .layer_remove_notification_by_callback = ivi_layout_layer_remove_notification_by_callback + .layer_remove_notification_by_callback = ivi_layout_layer_remove_notification_by_callback, + + /** +* screen controller interfaces part2 +*/ + .get_id_of_screen = ivi_layout_get_id_of_screen }; int -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 13/13] ivi-shell: rename to ivi_layout_layer_destroy()
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp remove is not proper name beacause it destorys a layer. The name of the api is changed from layer_remove to layer_destroy. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-export.h | 2 +- ivi-shell/ivi-layout.c| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index 68d3760..8a92009 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -470,7 +470,7 @@ struct ivi_controller_interface { /** * \brief Removes a ivi_layer which is currently managed by the service */ - void (*layer_remove)(struct ivi_layout_layer *ivilayer); + void (*layer_destroy)(struct ivi_layout_layer *ivilayer); /** * \brief Get all ivi_layers which are currently registered and managed diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index b4165a8..5f9235c 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1904,7 +1904,7 @@ ivi_layout_layer_remove_notification_by_callback(struct ivi_layout_layer *ivilay } static void -ivi_layout_layer_remove(struct ivi_layout_layer *ivilayer) +ivi_layout_layer_destroy(struct ivi_layout_layer *ivilayer) { struct ivi_layout *layout = get_instance(); @@ -3005,7 +3005,7 @@ static struct ivi_controller_interface ivi_controller_interface = { .add_notification_remove_layer = ivi_layout_add_notification_remove_layer, .remove_notification_remove_layer = ivi_layout_remove_notification_remove_layer, .layer_create_with_dimension= ivi_layout_layer_create_with_dimension, - .layer_remove = ivi_layout_layer_remove, + .layer_destroy = ivi_layout_layer_destroy, .get_layers = ivi_layout_get_layers, .get_id_of_layer= ivi_layout_get_id_of_layer, .get_layer_from_id = ivi_layout_get_layer_from_id, -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 09/13] ivi-shell: add new method to remove a callback to get notificaiton of ivi_layer property changes.
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp To get property changes of ivi_layer, callbacks can be registered. However there was no API to remove a callback rather than removing all callbacks by using layer_remove_notification. layer_remove_notification_by_callback can do it. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-export.h | 7 +++ ivi-shell/ivi-layout.c| 18 -- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index ed8db9d..2f93811 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -790,6 +790,13 @@ struct ivi_controller_interface { surface_property_notification_func callback, void *userdata); + /** +* \brief remove notification by callback on property changes of ivi_layer +*/ + void (*layer_remove_notification_by_callback)(struct ivi_layout_layer *ivilayer, + layer_property_notification_func callback, + void *userdata); + }; #ifdef __cplusplus diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 6dc5723..bfd9d32 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1883,6 +1883,19 @@ ivi_layout_layer_remove_notification(struct ivi_layout_layer *ivilayer) } static void +ivi_layout_layer_remove_notification_by_callback(struct ivi_layout_layer *ivilayer, + layer_property_notification_func callback, +void *userdata) +{ + if (ivilayer == NULL) { + weston_log(ivi_layout_layer_remove_notification_by_callback: invalid argument\n); + return; + } + + remove_notification(ivilayer-property_changed.listener_list, callback, userdata); +} + +static void ivi_layout_layer_remove(struct ivi_layout_layer *ivilayer) { struct ivi_layout *layout = get_instance(); @@ -2982,9 +2995,10 @@ static struct ivi_controller_interface ivi_controller_interface = { .surface_dump = ivi_layout_surface_dump, /** -* remove notification by callback on property changes of ivi_surface +* remove notification by callback on property changes of ivi_surface/layer */ - .surface_remove_notification_by_callback= ivi_layout_surface_remove_notification_by_callback + .surface_remove_notification_by_callback= ivi_layout_surface_remove_notification_by_callback, + .layer_remove_notification_by_callback = ivi_layout_layer_remove_notification_by_callback }; int -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 06/13] ivi-shell: fix ivi_shell_surface lifetime
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp ivi_shell_surface lifetime shall follow the ivi_surface protocol object lifetime, and frees the ivi-id by destroying the ivi_layout_surface from both wl_surface and ivi_surface destruction as the protocol specifies. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-shell.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index a147353..896ba1b 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -155,9 +155,18 @@ static void shell_destroy_shell_surface(struct wl_resource *resource) { struct ivi_shell_surface *ivisurf = wl_resource_get_user_data(resource); - if (ivisurf != NULL) { - ivisurf-resource = NULL; - } + + if (ivisurf == NULL) + return; + + assert(ivisurf-resource == resource); + + if (ivisurf-layout_surface != NULL) + layout_surface_cleanup(ivisurf); + + wl_list_remove(ivisurf-link); + + free(ivisurf); } /* Gets called through the weston_surface destroy signal. */ @@ -172,13 +181,6 @@ shell_handle_surface_destroy(struct wl_listener *listener, void *data) if (ivisurf-layout_surface != NULL) layout_surface_cleanup(ivisurf); - - if (ivisurf-resource != NULL) { - wl_resource_set_user_data(ivisurf-resource, NULL); - ivisurf-resource = NULL; - } - free(ivisurf); - } /* Gets called, when a client sends ivi_surface.destroy request. */ -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 04/13] ivi-shell: bugfix, SEVG by adding NULL check in ivi_layout_get_screen_resolution
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 7bc3aab..2cce2d3 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1535,7 +1535,7 @@ ivi_layout_get_screen_resolution(struct ivi_layout_screen *iviscrn, { struct weston_output *output = NULL; - if (pWidth == NULL || pHeight == NULL) { + if (iviscrn == NULL || pWidth == NULL || pHeight == NULL) { weston_log(ivi_layout_get_screen_resolution: invalid argument\n); return IVI_FAILED; } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 05/13] ivi-shell: make ivi_layout_surface destruction explicit
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-private.h | 3 ++- ivi-shell/ivi-layout.c | 54 -- ivi-shell/ivi-shell.c | 26 +--- 3 files changed, 35 insertions(+), 48 deletions(-) diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index 9cbaa8a..8b61963 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -39,7 +39,6 @@ struct ivi_layout_surface { struct ivi_layout *layout; struct weston_surface *surface; - struct wl_listener surface_destroy_listener; struct weston_transform surface_rotation; struct weston_transform layer_rotation; struct weston_transform surface_pos; @@ -226,4 +225,6 @@ ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer); int load_controller_modules(struct weston_compositor *compositor, const char *modules, int *argc, char *argv[]); +void +ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf); #endif diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 2cce2d3..079b3e3 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -320,28 +320,27 @@ ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf) } /** - * this shall not be called from controller because this is triggered by ivi_surface.destroy - * This means that this is called from westonsurface_destroy_from_ivisurface. + * Called at destruction of wl_surface/ivi_surface */ -static void -ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf) +void +ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) { struct ivi_layout *layout = get_instance(); if (ivisurf == NULL) { - weston_log(ivi_layout_surface_remove: invalid argument\n); + weston_log(%s: invalid argument\n, __func__); return; } - if (!wl_list_empty(ivisurf-pending.link)) { - wl_list_remove(ivisurf-pending.link); - } - if (!wl_list_empty(ivisurf-order.link)) { - wl_list_remove(ivisurf-order.link); - } - if (!wl_list_empty(ivisurf-link)) { - wl_list_remove(ivisurf-link); - } + wl_list_remove(ivisurf-surface_rotation.link); + wl_list_remove(ivisurf-layer_rotation.link); + wl_list_remove(ivisurf-surface_pos.link); + wl_list_remove(ivisurf-layer_pos.link); + wl_list_remove(ivisurf-scaling.link); + + wl_list_remove(ivisurf-pending.link); + wl_list_remove(ivisurf-order.link); + wl_list_remove(ivisurf-link); remove_ordersurface_from_layer(ivisurf); wl_signal_emit(layout-surface_notification.removed, ivisurf); @@ -350,28 +349,9 @@ ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf) ivi_layout_surface_remove_notification(ivisurf); - free(ivisurf); -} - -/** - * Called at destruction of ivi_surface - */ -static void -westonsurface_destroy_from_ivisurface(struct wl_listener *listener, void *data) -{ - struct ivi_layout_surface *ivisurf = NULL; - - ivisurf = container_of(listener, struct ivi_layout_surface, - surface_destroy_listener); - - wl_list_remove(ivisurf-surface_rotation.link); - wl_list_remove(ivisurf-layer_rotation.link); - wl_list_remove(ivisurf-surface_pos.link); - wl_list_remove(ivisurf-layer_pos.link); - wl_list_remove(ivisurf-scaling.link); - ivisurf-surface = NULL; - ivi_layout_surface_remove(ivisurf); + + free(ivisurf); } /** @@ -2812,10 +2792,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, ivisurf-layout = layout; ivisurf-surface = wl_surface; - ivisurf-surface_destroy_listener.notify = - westonsurface_destroy_from_ivisurface; - wl_resource_add_destroy_listener(wl_surface-resource, -ivisurf-surface_destroy_listener); tmpview = weston_view_create(wl_surface); if (tmpview == NULL) { diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index f9c2583..a147353 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -130,6 +130,22 @@ ivi_shell_surface_configure(struct weston_surface *surface, } } +static void +layout_surface_cleanup(struct ivi_shell_surface *ivisurf) +{ + assert(ivisurf-layout_surface != NULL); + + ivi_layout_surface_destroy(ivisurf-layout_surface); + ivisurf-layout_surface = NULL; + + ivisurf-surface-configure = NULL; + ivisurf-surface-configure_private = NULL; + ivisurf-surface = NULL; + + // destroy weston_surface destroy signal. + wl_list_remove(ivisurf
[PATCH 02/13] ivi-shell: bugfix, check limitation of ivi_layout_layer opacity
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 50ce22f..88629ad 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1951,7 +1951,9 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, { struct ivi_layout_layer_properties *prop = NULL; - if (ivilayer == NULL) { + if (ivilayer == NULL || + opacity wl_fixed_from_double(0.0) || + wl_fixed_from_double(1.0) opacity) { weston_log(ivi_layout_layer_set_opacity: invalid argument\n); return IVI_FAILED; } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 08/13] ivi-shell: add new method to remove a callback to get notification of ivi_surface property changes.
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp To get property changes of ivi_surface, callbacks can be registered. However there was no API to remove a callback rather than remove all callbacks by using surface_remove_notification. surface_remove_notification_by_callback can do it. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-export.h | 7 +++ ivi-shell/ivi-layout.c| 21 + 2 files changed, 28 insertions(+) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index 53c4b44..ed8db9d 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -783,6 +783,13 @@ struct ivi_controller_interface { int32_t x, int32_t y, int32_t width, int32_t height); + /** +* remove notification by callback on property changes of ivi_surface +*/ + void (*surface_remove_notification_by_callback)(struct ivi_layout_surface *ivisurf, + surface_property_notification_func callback, + void *userdata); + }; #ifdef __cplusplus diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index d7108b6..6dc5723 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -111,6 +111,9 @@ struct ivi_layout_notification_callback { void *data; }; +static void +remove_notification(struct wl_list *listener_list, void *callback, void *userdata); + static struct ivi_layout ivilayout = {0}; struct ivi_layout * @@ -319,6 +322,19 @@ ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf) remove_all_notification(ivisurf-property_changed.listener_list); } +static void +ivi_layout_surface_remove_notification_by_callback(struct ivi_layout_surface *ivisurf, + surface_property_notification_func callback, + void *userdata) +{ + if (ivisurf == NULL) { + weston_log(ivi_layout_surface_remove_notification_by_callback: invalid argument\n); + return; + } + + remove_notification(ivisurf-property_changed.listener_list, callback, userdata); +} + /** * Called at destruction of wl_surface/ivi_surface */ @@ -2964,6 +2980,11 @@ static struct ivi_controller_interface ivi_controller_interface = { */ .surface_get_size = ivi_layout_surface_get_size, .surface_dump = ivi_layout_surface_dump, + + /** +* remove notification by callback on property changes of ivi_surface +*/ + .surface_remove_notification_by_callback= ivi_layout_surface_remove_notification_by_callback }; int -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 07/13] ivi-shell: bugfix, add ref_count to ivi_layout_layer
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp if a controller calls ivi_layout_layer_create_with_demenstion with a ID which is already created before, the API returns exist ivi_layer. However addtionally, it shall count up ref count to destroy ivi_layer when ref count is 0. The previous code will destroy ivi_layer immediately even if the other code still refers ivi_layer. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-private.h | 2 ++ ivi-shell/ivi-layout.c | 5 + 2 files changed, 7 insertions(+) diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index 8b61963..cf2db7d 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -88,6 +88,8 @@ struct ivi_layout_layer { struct wl_list surface_list; struct wl_list link; } order; + + int32_t ref_count; }; struct ivi_layout { diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 079b3e3..d7108b6 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1820,6 +1820,7 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer, ivilayer = get_layer(layout-layer_list, id_layer); if (ivilayer != NULL) { weston_log(id_layer is already created\n); + ++ivilayer-ref_count; return ivilayer; } @@ -1829,6 +1830,7 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer, return NULL; } + ivilayer-ref_count = 1; wl_list_init(ivilayer-link); wl_signal_init(ivilayer-property_changed); wl_list_init(ivilayer-screen_list); @@ -1874,6 +1876,9 @@ ivi_layout_layer_remove(struct ivi_layout_layer *ivilayer) return; } + if (--ivilayer-ref_count 0) + return; + wl_signal_emit(layout-layer_notification.removed, ivilayer); clear_surface_pending_list(ivilayer); -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 11/13] ivi-shell: bugfix, send notification when properties are changed according to event mask.
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Previous code sends notification without event mask. So the notification Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index a7f9e02..c39e751 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1079,11 +1079,13 @@ send_prop(struct ivi_layout *layout) struct ivi_layout_surface *ivisurf = NULL; wl_list_for_each_reverse(ivilayer, layout-layer_list, link) { - send_layer_prop(ivilayer); + if (ivilayer-event_mask) + send_layer_prop(ivilayer); } wl_list_for_each_reverse(ivisurf, layout-surface_list, link) { - send_surface_prop(ivisurf); + if (ivisurf-event_mask) + send_surface_prop(ivisurf); } } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
ivi-shell test suite and bugfixes found by these test cases
Hi, I am proposing a set of patches; ivi-shell test suite and bug fixes found by these test cases. This test suite is implemented based on following test framework. http://lists.freedesktop.org/archives/wayland-devel/2015-March/020932.html This test suite consists of four parts to verify ivi-shell important functionalities. - ivi_surface - ivi_layer - ivi_screen - notification when properties of ivi_surface/layer are changed. Test set of ivi_surface) ivi_surface is created by client by using ivi_application::surface_create. So I am using helper client to verify lifetime of ivi_surface. http://cgit.freedesktop.org/wayland/weston/tree/protocol/ivi-application.xml This test set consists of three patches to verify normal use cases and bad condition. 36e2e4e tests: test set for ivi-surface normal use case with helper client a2aad7d tests: test set for ivi-surface with bad condition in server side 2d2def2 tests: test set for ivi-surface bad condition with helper client Test set of ivi_layer) ivi_layer is mainly used by controller module which works on server/weston. However some tests need client helper to create ivi_surfaces which are assigned to ivi_layer. 4e55d9d tests: test set for ivi-layer normal use case with helper client c420e06 tests: test set for ivi-layer normal use case in server side dde756d tests: test set for ivi-layer bad condition with helper-client 018e00d tests: test set for ivi-layer with bad condition in server side Test set of ivi_screen) ivi_screen is only used by controller module. So that test case of normal use cases and bad condition are implemented on server side only. b6b098e tests: test set for ivi-screen normal use case in server side cbd0aa2 tests: test set for ivi-screen with bad condition in server side Test set of notifications) ivi_shell supports features of receiving notification of properties change. These one needs client helper to create ivi_surfaces as well. These test set proposes verification of normal use case and bad condition. e722bab tests: test set for ivi-shell notification normal use case with helper client fcef111 tests: test set for ivi-shell notification normal use case in server side b89f6ea tests: test set for ivi-shell notification in bad condition with helper client 101eb7b tests: test set for ivi-shell notification with bad condition in server side Patches to fix bugs found by this test suite) The following 13 patches fixes bugs found by the test suite. 6e50c24 ivi-shell: bugfix, check limitation of ivi_layout_surface opacity f1d7418 ivi-shell: bugfix, check limitation of ivi_layout_layer opacity 9af51bd ivi-shell: Fix wrong link of wl_list_for_each() of ivilayer 1cb28f1 ivi-shell: bugfix, SEVG by adding NULL check in ivi_layout_get_screen_resolution 0d9e9da ivi-shell: make ivi_layout_surface destruction explicit 0432454 ivi-shell: fix ivi_shell_surface lifetime 4abdbae ivi-shell: bugfix, add ref_count to ivi_layout_layer 7c32128 ivi-shell: add new method to remove a callback to get notification of ivi_surface property changes. bca6b2c ivi-shell: add new method to remove a callback to get notificaiton of ivi_layer property changes. 332a401 ivi-shell: add interface to get screen ID d56257e ivi-shell: bugfix, send notification when properties are changed according to event mask. d5d1640 ivi-shell: bugfix, update event_mask when new propertiy is not same as before. f5675a7 ivi-shell: rename to ivi_layout_layer_destroy() Nobuhiko Tanibata (27): 6e50c24 ivi-shell: bugfix, check limitation of ivi_layout_surface opacity f1d7418 ivi-shell: bugfix, check limitation of ivi_layout_layer opacity 9af51bd ivi-shell: Fix wrong link of wl_list_for_each() of ivilayer 1cb28f1 ivi-shell: bugfix, SEVG by adding NULL check in ivi_layout_get_screen_resolution 0d9e9da ivi-shell: make ivi_layout_surface destruction explicit 0432454 ivi-shell: fix ivi_shell_surface lifetime 4abdbae ivi-shell: bugfix, add ref_count to ivi_layout_layer 7c32128 ivi-shell: add new method to remove a callback to get notification of ivi_surface property changes. bca6b2c ivi-shell: add new method to remove a callback to get notificaiton of ivi_layer property changes. 332a401 ivi-shell: add interface to get screen ID d56257e ivi-shell: bugfix, send notification when properties are changed according to event mask. d5d1640 ivi-shell: bugfix, update event_mask when new propertiy is not same as before. f5675a7 ivi-shell: rename to ivi_layout_layer_destroy() 36e2e4e tests: test set for ivi-surface normal use case with helper client 2d2def2 tests: test set for ivi-surface bad condition with helper client a2aad7d tests: test set for ivi-surface with bad condition in server side 4e55d9d tests: test set for ivi-layer normal use case with helper client c420e06 tests: test set for ivi-layer normal use case in server side dde756d tests: test set for ivi-layer bad condition
[PATCH 01/13] ivi-shell: bugfix, check limitation of ivi_layout_surface opacity
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 4aed4c8..50ce22f 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2209,7 +2209,9 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, { struct ivi_layout_surface_properties *prop = NULL; - if (ivisurf == NULL) { + if (ivisurf == NULL || + opacity wl_fixed_from_double(0.0) || + wl_fixed_from_double(1.0) opacity) { weston_log(ivi_layout_surface_set_opacity: invalid argument\n); return IVI_FAILED; } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 11/14] tests: test set for ivi-shell notification normal use case with helper client
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp These tests are implemented on test suite framework, which provides helper client. Following features are tested, - notification of adding ivi-surface - notification of ivi-surface configure - notification of creating ivi-surface - notification of removing ivi-surface Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- tests/ivi_layout-test-plugin.c | 172 + tests/ivi_layout-test.c| 79 +++ 2 files changed, 251 insertions(+) diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c index a134a14..28afac9 100644 --- a/tests/ivi_layout-test-plugin.c +++ b/tests/ivi_layout-test-plugin.c @@ -82,6 +82,7 @@ struct test_launcher { struct test_context { const struct ivi_controller_interface *controller_interface; struct wl_resource *runner_resource; + uint32_t user_flags; }; static struct test_context static_context; @@ -877,3 +878,174 @@ RUNNER_TEST(cleanup_layer) ctl-layer_destroy(ivilayer); } +static void +test_surface_properties_changed_notification_callback(struct ivi_layout_surface *ivisurf, + const struct ivi_layout_surface_properties *prop, + enum ivi_layout_notification_mask mask, + void *userdata) +{ + struct test_context *ctx = userdata; + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + runner_assert_or_return(ctl-get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0)); + + ctx-user_flags = 1; +} + +RUNNER_TEST(surface_properties_changed_notification) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + const uint32_t id_surface = IVI_TEST_SURFACE_ID(0); + struct ivi_layout_surface *ivisurf; + + ctx-user_flags = 0; + + ivisurf = ctl-get_surface_from_id(id_surface); + runner_assert(ivisurf != NULL); + + runner_assert(ctl-surface_add_notification( + ivisurf, test_surface_properties_changed_notification_callback, ctx) == IVI_SUCCEEDED); + + ctl-commit_changes(); + + runner_assert(ctx-user_flags == 0); + + runner_assert(ctl-surface_set_destination_rectangle( + ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); + + ctl-commit_changes(); + + runner_assert(ctx-user_flags == 1); + + ctx-user_flags = 0; + runner_assert(ctl-surface_set_destination_rectangle( + ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); + + ctl-commit_changes(); + + runner_assert(ctx-user_flags == 0); + + ctl-surface_remove_notification(ivisurf); + ctx-user_flags = 0; + runner_assert(ctl-surface_set_destination_rectangle( + ivisurf, 40, 50, 400, 500) == IVI_SUCCEEDED); + + ctl-commit_changes(); + + runner_assert(ctx-user_flags == 0); +} + +static void +test_surface_configure_notification_callback(struct ivi_layout_surface *ivisurf, +void *userdata) +{ + struct test_context *ctx = userdata; + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + runner_assert_or_return(ctl-get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0)); + + ctx-user_flags = 1; +} + +RUNNER_TEST(surface_configure_notification_p1) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + runner_assert(IVI_SUCCEEDED == ctl-add_notification_configure_surface(test_surface_configure_notification_callback, ctx)); + ctl-commit_changes(); + + ctx-user_flags = 0; +} + +RUNNER_TEST(surface_configure_notification_p2) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + runner_assert(ctx-user_flags == 1); + + ctl-remove_notification_configure_surface(test_surface_configure_notification_callback, ctx); + ctx-user_flags = 0; +} + +RUNNER_TEST(surface_configure_notification_p3) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + ctl-commit_changes(); + runner_assert(ctx-user_flags == 0); +} + +static void +test_surface_create_notification_callback(struct ivi_layout_surface *ivisurf, + void *userdata) +{ + struct test_context *ctx = userdata; + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + runner_assert_or_return(ctl-get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0)); + + ctx-user_flags = 1; +} + +RUNNER_TEST(surface_create_notification_p1) +{ + const struct ivi_controller_interface *ctl = ctx-controller_interface; + + runner_assert(ctl
[PATCH 10/14] tests: make the test context persistent
From: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp The TESTs in ivi_layout-test.c may have several server-side parts (RUNNER_TEST in ivi_layout-test-plugin.c) each. Sometimes we need to carry state from one RUNNER_TEST to another within one TEST, but not across multiple TESTs. The correct lifetime of that state would be the lifetime (and identity) of the runner_resource, as one TEST creates and uses at most one weston_test_runner during its lifetime. However, tests are executed one by one. Take a shortcut, and use a static global for storing that state. This turns the test_context into a singleton. To ensure it is not confused between multiple TESTs, add asserts to verify its identity. Following patches will add tests for notification callbacks. These will be using the carried state. [Pekka: add serialization checks, rename the global, rewrite commit message.] Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- tests/ivi_layout-test-plugin.c | 45 -- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/tests/ivi_layout-test-plugin.c b/tests/ivi_layout-test-plugin.c index d24c9a1..a134a14 100644 --- a/tests/ivi_layout-test-plugin.c +++ b/tests/ivi_layout-test-plugin.c @@ -30,6 +30,7 @@ #include unistd.h #include signal.h #include string.h +#include assert.h #include src/compositor.h #include weston-test-server-protocol.h @@ -78,28 +79,42 @@ struct test_launcher { const struct ivi_controller_interface *controller_interface; }; +struct test_context { + const struct ivi_controller_interface *controller_interface; + struct wl_resource *runner_resource; +}; + +static struct test_context static_context; + +static void +destroy_runner(struct wl_resource *resource) +{ + assert(static_context.runner_resource == NULL || + static_context.runner_resource == resource); + + static_context.controller_interface = NULL; + static_context.runner_resource = NULL; +} + static void runner_destroy_handler(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } -struct test_context { - const struct ivi_controller_interface *controller_interface; - struct wl_resource *runner_resource; -}; - static void runner_run_handler(struct wl_client *client, struct wl_resource *resource, const char *test_name) { struct test_launcher *launcher; const struct runner_test *t; - struct test_context ctx; + + assert(static_context.runner_resource == NULL || + static_context.runner_resource == resource); launcher = wl_resource_get_user_data(resource); - ctx.controller_interface = launcher-controller_interface; - ctx.runner_resource = resource; + static_context.controller_interface = launcher-controller_interface; + static_context.runner_resource = resource; t = find_runner_test(test_name); if (!t) { @@ -114,7 +129,7 @@ runner_run_handler(struct wl_client *client, struct wl_resource *resource, weston_log(weston_test_runner.run(\%s\)\n, test_name); - t-run(ctx); + t-run(static_context); weston_test_runner_send_finished(resource); } @@ -139,7 +154,15 @@ bind_runner(struct wl_client *client, void *data, } wl_resource_set_implementation(resource, runner_implementation, - launcher, NULL); + launcher, destroy_runner); + + if (static_context.runner_resource != NULL) { + weston_log(test FATAL: + attempting to run several tests in parallel.\n); + wl_resource_post_error(resource, + WESTON_TEST_RUNNER_ERROR_TEST_FAILED, + attempt to run parallel tests); + } } static void @@ -240,6 +263,8 @@ runner_assert_fail(const char *cond, const char *file, int line, { weston_log(Assert failure in %s:%d, %s: '%s'\n, file, line, func, cond); + + assert(ctx-runner_resource); wl_resource_post_error(ctx-runner_resource, WESTON_TEST_RUNNER_ERROR_TEST_FAILED, Assert failure in %s:%d, %s: '%s'\n, -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: remove unnecesary code in ivi_shell_surface_configure
This method should not update weston_view directly. This shall be done by controller via ivi_layout_*. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-shell.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index aef8e63..4a688cc 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -112,33 +112,15 @@ ivi_shell_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct ivi_shell_surface *ivisurf = get_ivi_shell_surface(surface); - struct weston_view *view; - float from_x; - float from_y; - float to_x; - float to_y; if (surface-width == 0 || surface-height == 0 || ivisurf == NULL) return; - view = ivi_layout_get_weston_view(ivisurf-layout_surface); - - if (view == NULL) - return; - if (ivisurf-width != surface-width || ivisurf-height != surface-height) { ivisurf-width = surface-width; ivisurf-height = surface-height; - weston_view_to_global_float(view, 0, 0, from_x, from_y); - weston_view_to_global_float(view, sx, sy, to_x, to_y); - - weston_view_set_position(view, -view-geometry.x + to_x - from_x, -view-geometry.y + to_y - from_y); - weston_view_update_transform(view); - ivi_layout_surface_configure(ivisurf-layout_surface, surface-width, surface-height); } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: set an initial value for ivi-surface.
Especially, the size of destination rectagle is set to (1,1). This is because the size will be used for caluculating scale and not to be 0 to avoid 0 dividing. I also remark this as FIXME. This shall be fixed at ivi-layout-tansition.c. In new invoded application, its property is initilized by (0,0) destination rectangle. So transition fucntion always calculates its scale as inf at first frame of fade-in with new invoked application. To fix this, restructing transition function is ideally needed. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 5 + 1 file changed, 5 insertions(+) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 9c05713..3eed021 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -464,6 +464,11 @@ init_surface_properties(struct ivi_layout_surface_properties *prop) { memset(prop, 0, sizeof *prop); prop-opacity = wl_fixed_from_double(1.0); + /* +* FIXME: this shall be finxed by ivi-layout-transition. +*/ + prop-dest_width = 1; + prop-dest_height = 1; } /** -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: remove unnecesary assignment of fail safe value.
Scale is calculated as float and to be inf. It shall be avoided by, ivi_layout_surface_set_source/destination_rectangle. So output log and then return this method to use prevous scale for fail safe. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index dc6053d..9c05713 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -719,9 +719,14 @@ update_scale(struct ivi_layout_layer *ivilayer, return; } - if (ivisurf-prop.dest_width == 0 ivisurf-prop.dest_height == 0) { - ivisurf-prop.dest_width = ivisurf-surface-width_from_buffer; - ivisurf-prop.dest_height = ivisurf-surface-height_from_buffer; + if (ivisurf-prop.source_width == 0 || ivisurf-prop.source_height == 0) { + weston_log(ivi-shell: source rectangle is not yet set by ivi_layout_surface_set_source_rectangle\n); + return; + } + + if (ivisurf-prop.dest_width == 0 || ivisurf-prop.dest_height == 0) { + weston_log(ivi-shell: destination rectangle is not yet set by ivi_layout_surface_set_destination_rectangle\n); + return; } lw = ((float)ivilayer-prop.dest_width / (float)ivilayer-prop.source_width ); -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: remove unnecesary code in ivi_layout_surface_configure
ivi_layout_surface_configure is called from ivi-shell when configure listener of weston surface is triggered. This function shall do, - emit signal to hmi-controller to notify the configuration change Other unnecesary logics are cleaned up. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout.c | 25 +++-- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index cd4a171..dc6053d 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2691,29 +2691,10 @@ ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, int32_t width, int32_t height) { struct ivi_layout *layout = get_instance(); - int32_t in_init = 0; - ivisurf-surface-width_from_buffer = width; - ivisurf-surface-height_from_buffer = height; - if (ivisurf-prop.source_width == 0 || ivisurf-prop.source_height == 0) { - in_init = 1; - } - - /* FIXME: when sourceHeight/Width is used as clipping range in image buffer */ - /* if (ivisurf-prop.sourceWidth == 0 || ivisurf-prop.sourceHeight == 0) { */ - ivisurf-pending.prop.source_width = width; - ivisurf-pending.prop.source_height = height; - ivisurf-prop.source_width = width; - ivisurf-prop.source_height = height; - /* } */ - - ivisurf-event_mask |= IVI_NOTIFICATION_CONFIGURE; - - if (in_init) { - wl_signal_emit(layout-surface_notification.configure_changed, ivisurf); - } else { - ivi_layout_commit_changes(); - } + /* emit callback which is set by ivi-layout api user */ + wl_signal_emit(layout-surface_notification.configure_changed, + ivisurf); } static int32_t -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: fit source rectangle of ivi-surface to the size of application content.
When application changes the size of its content, UI shall fit the source rectangle, view area, to the size of its content to show whole content. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/hmi-controller.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 2d15e06..cd79c38 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -542,6 +542,45 @@ set_notification_configure_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; + struct ivi_layout_layer *application_layer = + hmi_ctrl-application_layer.ivilayer; + struct weston_surface *surface; + struct ivi_layout_surface **ivisurfs; + int32_t length = 0; + int32_t i; + + /* return if the surface is not application content */ + if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) { + return; + } + + /* +* if application changes size of wl_buffer. The source rectangle shall be +* fit to the size. +*/ + surface = ivi_controller_interface-surface_get_weston_surface(ivisurf); + if (surface) { + ivi_controller_interface-surface_set_source_rectangle( + ivisurf, 0, 0, surface-width, + surface-height); + } + + /* +* search if the surface is already added to layer. +* If not yet, it is newly invoded application to go to switch_mode. +*/ + ivi_controller_interface-get_surfaces_on_layer(application_layer, + length, ivisurfs); + for (i = 0; i length; i++) { + if (ivisurf == ivisurfs[i]) { + /* +* if it is non new invoked application, just call +* commit_changes to apply source_rectangle. +*/ + ivi_controller_interface-commit_changes(); + return; + } + } switch_mode(hmi_ctrl, hmi_ctrl-layout_mode); } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: support surface screen shot of ivi_layout by using weston_surface_copy_content
The reason why the result is not output in the method is that it avoids to have dependency on CAIRO. If user want to output it to file, user shall link CAIRO on its controller. ivi_layout_surface_get_size is also supported here because user needs stride to call ivi_layout_surafce_dump. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/ivi-layout-export.h | 12 ++ ivi-shell/ivi-layout.c| 55 ++- 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index 8848fb1..4b4328c 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -768,6 +768,18 @@ struct ivi_controller_interface { uint32_t is_fade_in, double start_alpha, double end_alpha); + /** +* surface content dumping for debugging +*/ + int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf, + int32_t *width, int32_t *height, + int32_t *stride); + + int32_t (*surface_dump)(struct weston_surface *surface, + void *target, size_t size, + int32_t x, int32_t y, + int32_t width, int32_t height); + }; #ifdef __cplusplus diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 6b2604e..69c65a1 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2459,6 +2459,34 @@ ivi_layout_surface_get_weston_surface(struct ivi_layout_surface *ivisurf) } static int32_t +ivi_layout_surface_get_size(struct ivi_layout_surface *ivisurf, + int32_t *width, int32_t *height, + int32_t *stride) +{ + int32_t w; + int32_t h; + const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */ + + if (ivisurf == NULL || ivisurf-surface == NULL) { + weston_log(%s: invalid argument\n, __func__); + return IVI_FAILED; + } + + weston_surface_get_content_size(ivisurf-surface, w, h); + + if (width != NULL) + *width = w; + + if (height != NULL) + *height = h; + + if (stride != NULL) + *stride = w * bytespp; + + return IVI_SUCCEEDED; +} + +static int32_t ivi_layout_layer_add_notification(struct ivi_layout_layer *ivilayer, layer_property_notification_func callback, void *userdata) @@ -2666,6 +2694,25 @@ ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf, return 0; } +static int32_t +ivi_layout_surface_dump(struct weston_surface *surface, + void *target, size_t size,int32_t x, int32_t y, + int32_t width, int32_t height) +{ + int result = 0; + + if (surface == NULL) { + weston_log(%s: invalid argument\n, __func__); + return IVI_FAILED; + } + + result = weston_surface_copy_content( + surface, target, size, + x, y, width, height); + + return result == 0 ? IVI_SUCCEEDED : IVI_FAILED; +} + /** * methods of interaction between ivi-shell with ivi-layout */ @@ -2930,7 +2977,13 @@ static struct ivi_controller_interface ivi_controller_interface = { * animation */ .transition_move_layer_cancel = ivi_layout_transition_move_layer_cancel, - .layer_set_fade_info= ivi_layout_layer_set_fade_info + .layer_set_fade_info= ivi_layout_layer_set_fade_info, + + /** +* surface content dumping for debugging +*/ + .surface_get_size = ivi_layout_surface_get_size, + .surface_dump = ivi_layout_surface_dump, }; int -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: SEGV occurs when multi touch happens in transition
of application launching. This is because cancel callback is mistakenly set to weston_touch_grab_interface. To fix this issue, add a callback, touch_move_workspace_grab_frame and set it to the weston_touch_grab_interface like desktop-shell. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/hmi-controller.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 36a1b56..2d15e06 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -1389,6 +1389,11 @@ pointer_move_workspace_grab_cancel(struct weston_pointer_grab *grab) } static void +touch_move_workspace_grab_frame(struct weston_touch_grab *grab) +{ +} + +static void touch_move_workspace_grab_cancel(struct weston_touch_grab *grab) { struct touch_grab *tg = (struct touch_grab *)grab; @@ -1408,6 +1413,7 @@ static const struct weston_touch_grab_interface touch_move_grab_workspace_interf touch_nope_grab_down, touch_move_workspace_grab_up, touch_move_grab_motion, + touch_move_workspace_grab_frame, touch_move_workspace_grab_cancel }; -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: Fix wrong condition to check return value of controller_module_init
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/ivi-layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index a126483..6b2604e 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2954,9 +2954,9 @@ load_controller_modules(struct weston_compositor *compositor, const char *module controller_module_init = weston_load_module(buffer, controller_module_init); if (controller_module_init) - if(!controller_module_init(compositor, argc, argv, + if(controller_module_init(compositor, argc, argv, ivi_controller_interface, - sizeof(struct ivi_controller_interface))) { + sizeof(struct ivi_controller_interface)) != 0) { weston_log(ivi-shell: Initialization of controller module fails); return -1; } -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: clean-up transition animation code.
ivi_layout_transition_layer_render_order is not necesary called. Remove the method and methods called by it. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/hmi-controller.c| 5 - ivi-shell/ivi-layout-transition.c | 194 -- 2 files changed, 199 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 3a07a70..1ad63a2 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -254,11 +254,6 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, ivi_layout_layer_set_transition(layer-ivilayer, IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, duration); - //TODO: implement IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER later. - ivi_layout_transition_layer_render_order(layer-ivilayer, -new_order, -surf_num, -duration); } free(surfaces); diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c index e4ab5bb..6d4a655 100644 --- a/ivi-shell/ivi-layout-transition.c +++ b/ivi-shell/ivi-layout-transition.c @@ -849,200 +849,6 @@ ivi_layout_transition_fade_layer( return; } -/* render order transition */ -struct surface_reorder { - uint32_t id_surface; - uint32_t new_index; -}; - -struct change_order_data { - struct ivi_layout_layer *layer; - uint32_t surface_num; - struct surface_reorder *reorder; -}; - -struct surf_with_index { - uint32_t id_surface; - float surface_index; -}; - -static int -cmp_order_asc(const void *lhs, const void *rhs) -{ - const struct surf_with_index *l = lhs; - const struct surf_with_index *r = rhs; - - return l-surface_index r-surface_index; -} - -/* -render oerder transition - -index 0 1 2 -old surfA, surfB, surfC -new surfB, surfC, surfA - (-1) (-1) (+2) - -after 10% of time elapsed - 0.20.91.9 - surfA, surfB, surfC - -after 50% of time elapsed - 0.51.01.5 - surfB, surfA, surfC -*/ - -static void -transition_change_order_user_frame(struct ivi_layout_transition *transition) -{ - uint32_t i, old_index; - double current = time_to_nowpos(transition); - struct change_order_data *data = transition-private_data; - - struct surf_with_index *swi = malloc(sizeof(*swi) * data-surface_num); - struct ivi_layout_surface **new_surface_order = NULL; - uint32_t surface_num = 0; - - if (swi == NULL) { - weston_log(%s: memory allocation fails\n, __func__); - return; - } - - for (old_index = 0; old_index data-surface_num; old_index++) { - swi[old_index].id_surface = data-reorder[old_index].id_surface; - swi[old_index].surface_index = (float)old_index + - ((float)data-reorder[old_index].new_index - (float)old_index) * current; - } - - qsort(swi, data-surface_num, sizeof(*swi), cmp_order_asc); - - new_surface_order = - malloc(sizeof(*new_surface_order) * data-surface_num); - - if (new_surface_order == NULL) { - weston_log(%s: memory allocation fails\n, __func__); - return; - } - - for (i = 0; i data-surface_num; i++) { - struct ivi_layout_surface *surf = - ivi_layout_get_surface_from_id(swi[i].id_surface); - if(surf) - new_surface_order[surface_num++] = surf; - } - - ivi_layout_layer_set_render_order(data-layer, new_surface_order, - surface_num); - - free(new_surface_order); - free(swi); -} - -static void -transition_change_order_destroy(struct ivi_layout_transition *transition) -{ - struct change_order_data *data = transition-private_data; - - free(data-reorder); - free(data); -} - -static int32_t find_surface(struct ivi_layout_surface **surfaces, - uint32_t surface_num, - struct ivi_layout_surface *target) -{ - uint32_t i = 0; - - for(i = 0; i surface_num; i++) { - if (surfaces[i] == target) - return i; - } - - return -1; -} - -static int32_t -is_transition_change_order_func(struct change_order_data *data, - struct ivi_layout_layer *layer) -{ - return data-layer == layer; -} - -WL_EXPORT void -ivi_layout_transition_layer_render_order(struct ivi_layout_layer *layer, -struct ivi_layout_surface **new_order, -uint32_t surface_num
[PATCH] ivi-shell: clean up unnecesary header
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/ivi-layout.c | 5 - ivi-shell/ivi-shell.c | 5 - 2 files changed, 10 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 5d89eb0..67ccf6e 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -53,12 +53,7 @@ * */ -#include sys/wait.h -#include unistd.h -#include stdlib.h -#include stdio.h #include string.h -#include linux/input.h #include compositor.h #include ivi-layout-export.h diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index a14010e..1e068e2 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -32,12 +32,7 @@ */ #include config.h -#include sys/wait.h -#include unistd.h -#include stdlib.h -#include stdio.h #include string.h -#include linux/input.h #include dlfcn.h #include limits.h #include assert.h -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] ivi-shell: reordering method in ivi_layout.c
In the future, re-alignmenet of WL_EXPORT per method should be done. For that work, re-ordering is required to be used by another method. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/ivi-layout.c | 171 + 1 file changed, 86 insertions(+), 85 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 93a4144..ff5d014 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -273,6 +273,81 @@ get_layer(struct wl_list *layer_list, uint32_t id_layer) return NULL; } +static void +remove_configured_listener(struct ivi_layout_surface *ivisurf) +{ + struct wl_listener *link = NULL; + struct wl_listener *next = NULL; + + wl_list_for_each_safe(link, next, ivisurf-configured.listener_list, link) { + wl_list_remove(link-link); + } +} + + +static void +remove_all_notification(struct wl_list *listener_list) +{ + struct wl_listener *listener = NULL; + struct wl_listener *next = NULL; + + wl_list_for_each_safe(listener, next, listener_list, link) { + struct listener_layout_notification *notification = NULL; + if (!wl_list_empty(listener-link)) { + wl_list_remove(listener-link); + } + + notification = + container_of(listener, +struct listener_layout_notification, +listener); + + free(notification-userdata); + free(notification); + } +} + +WL_EXPORT void +ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf) +{ + if (ivisurf == NULL) { + weston_log(ivi_layout_surface_remove_notification: invalid argument\n); + return; + } + + remove_all_notification(ivisurf-property_changed.listener_list); +} + +void +ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf) +{ + struct ivi_layout *layout = get_instance(); + + if (ivisurf == NULL) { + weston_log(ivi_layout_surface_remove: invalid argument\n); + return; + } + + if (!wl_list_empty(ivisurf-pending.link)) { + wl_list_remove(ivisurf-pending.link); + } + if (!wl_list_empty(ivisurf-order.link)) { + wl_list_remove(ivisurf-order.link); + } + if (!wl_list_empty(ivisurf-link)) { + wl_list_remove(ivisurf-link); + } + remove_ordersurface_from_layer(ivisurf); + + wl_signal_emit(layout-surface_notification.removed, ivisurf); + + remove_configured_listener(ivisurf); + + ivi_layout_surface_remove_notification(ivisurf); + + free(ivisurf); +} + /** * Called at destruction of ivi_surface */ @@ -1210,28 +1285,6 @@ remove_notification(struct wl_list *listener_list, void *callback, void *userdat } } -static void -remove_all_notification(struct wl_list *listener_list) -{ - struct wl_listener *listener = NULL; - struct wl_listener *next = NULL; - - wl_list_for_each_safe(listener, next, listener_list, link) { - struct listener_layout_notification *notification = NULL; - if (!wl_list_empty(listener-link)) { - wl_list_remove(listener-link); - } - - notification = - container_of(listener, -struct listener_layout_notification, -listener); - - free(notification-userdata); - free(notification); - } -} - /** * Exported APIs of ivi-layout library are implemented from here. * Brief of APIs is described in ivi-layout-export.h. @@ -1515,58 +1568,6 @@ ivi_layout_surface_add_notification(struct ivi_layout_surface *ivisurf, return IVI_SUCCEEDED; } -WL_EXPORT void -ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf) -{ - if (ivisurf == NULL) { - weston_log(ivi_layout_surface_remove_notification: invalid argument\n); - return; - } - - remove_all_notification(ivisurf-property_changed.listener_list); -} - -static void -remove_configured_listener(struct ivi_layout_surface *ivisurf) -{ - struct wl_listener *link = NULL; - struct wl_listener *next = NULL; - - wl_list_for_each_safe(link, next, ivisurf-configured.listener_list, link) { - wl_list_remove(link-link); - } -} - -void -ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf) -{ - struct ivi_layout *layout = get_instance(); - - if (ivisurf == NULL) { - weston_log(ivi_layout_surface_remove: invalid argument\n); - return; - } - - if (!wl_list_empty(ivisurf-pending.link)) { - wl_list_remove(ivisurf-pending.link
[PATCH] ivi-shell: several ivi-layout interfaces moved accross source.
Interfaces for properties setting shall be implemented in ivi-layout. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/ivi-layout-transition.c | 66 -- ivi-shell/ivi-layout.c| 67 +++ 2 files changed, 67 insertions(+), 66 deletions(-) diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c index 6d4a655..8b8261e 100644 --- a/ivi-shell/ivi-layout-transition.c +++ b/ivi-shell/ivi-layout-transition.c @@ -849,69 +849,3 @@ ivi_layout_transition_fade_layer( return; } -WL_EXPORT int32_t -ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf, - enum ivi_layout_transition_type type, - uint32_t duration) -{ - struct ivi_layout_surface_properties *prop; - - if (ivisurf == NULL) { - weston_log(%s: invalid argument\n, __func__); - return -1; - } - - prop = ivisurf-pending.prop; - prop-transition_type = type; - prop-transition_duration = duration; - return 0; -} - -int32_t -ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf, - uint32_t duration) -{ - struct ivi_layout_surface_properties *prop; - - if (ivisurf == NULL) { - weston_log(%s: invalid argument\n, __func__); - return -1; - } - - prop = ivisurf-pending.prop; - prop-transition_duration = duration*10; - return 0; -} - -WL_EXPORT int32_t -ivi_layout_layer_set_transition(struct ivi_layout_layer *ivilayer, - enum ivi_layout_transition_type type, - uint32_t duration) -{ - if (ivilayer == NULL) { - weston_log(%s: invalid argument\n, __func__); - return -1; - } - - ivilayer-pending.prop.transition_type = type; - ivilayer-pending.prop.transition_duration = duration; - - return 0; -} - -WL_EXPORT int32_t -ivi_layout_layer_set_fade_info(struct ivi_layout_layer* ivilayer, - uint32_t is_fade_in, - double start_alpha, double end_alpha) -{ - if (ivilayer == NULL) { - weston_log(%s: invalid argument\n, __func__); - return -1; - } - - ivilayer-pending.prop.is_fade_in = is_fade_in; - ivilayer-pending.prop.start_alpha = start_alpha; - ivilayer-pending.prop.end_alpha = end_alpha; - - return 0; -} diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index ff5d014..5d89eb0 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2597,6 +2597,73 @@ ivi_layout_commit_changes(void) return IVI_SUCCEEDED; } +WL_EXPORT int32_t +ivi_layout_layer_set_transition(struct ivi_layout_layer *ivilayer, + enum ivi_layout_transition_type type, + uint32_t duration) +{ + if (ivilayer == NULL) { + weston_log(%s: invalid argument\n, __func__); + return -1; + } + + ivilayer-pending.prop.transition_type = type; + ivilayer-pending.prop.transition_duration = duration; + + return 0; +} + +WL_EXPORT int32_t +ivi_layout_layer_set_fade_info(struct ivi_layout_layer* ivilayer, + uint32_t is_fade_in, + double start_alpha, double end_alpha) +{ + if (ivilayer == NULL) { + weston_log(%s: invalid argument\n, __func__); + return -1; + } + + ivilayer-pending.prop.is_fade_in = is_fade_in; + ivilayer-pending.prop.start_alpha = start_alpha; + ivilayer-pending.prop.end_alpha = end_alpha; + + return 0; +} + +WL_EXPORT int32_t +ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf, + uint32_t duration) +{ + struct ivi_layout_surface_properties *prop; + + if (ivisurf == NULL) { + weston_log(%s: invalid argument\n, __func__); + return -1; + } + + prop = ivisurf-pending.prop; + prop-transition_duration = duration*10; + return 0; +} + +WL_EXPORT int32_t +ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf, + enum ivi_layout_transition_type type, + uint32_t duration) +{ + struct ivi_layout_surface_properties *prop; + + if (ivisurf == NULL) { + weston_log(%s: invalid argument\n, __func__); + return -1; + } + + prop = ivisurf-pending.prop; + prop-transition_type = type; + prop-transition_duration = duration; + return 0; +} + /***called from ivi-shell**/ static struct weston_view * ivi_layout_get_weston_view(struct
[PATCH 1/2] ivi-shell: make ivi-layout.c as a part of ivi-shell.so
ivi-layout.so is separately built and loaded by using dlopen with RTLD_GLOBAL. This was because these apis defined in ivi-layout.so shall be used by ivi-modules; e.g. hmi-controller. This shall be improved that a struct ivi_layout_api contains the whole exported API as function pointers to be exposed as module_init. This patch alone builds, but loading controller modules at runtime failes. This failure will be fixed by following patches. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Makefile.am| 16 +++- ivi-shell/ivi-layout-private.h | 43 ++ ivi-shell/ivi-layout.c | 24 +++-- ivi-shell/ivi-shell.c | 59 ++ ivi-shell/ivi-shell.h | 2 -- 5 files changed, 45 insertions(+), 99 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4f4bb28..e91378b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -767,28 +767,20 @@ endif if ENABLE_IVI_SHELL module_LTLIBRARIES += \ - $(ivi_layout) \ $(ivi_shell)\ $(hmi_controller) -ivi_layout = ivi-layout.la -ivi_layout_la_LDFLAGS = -module -avoid-version -ivi_layout_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la -ivi_layout_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) -ivi_layout_la_SOURCES =\ - ivi-shell/ivi-layout-export.h \ - ivi-shell/ivi-layout-private.h \ - ivi-shell/ivi-layout.c \ - ivi-shell/ivi-layout-transition.c - ivi_shell = ivi-shell.la ivi_shell_la_LDFLAGS = -module -avoid-version ivi_shell_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la ivi_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) ivi_shell_la_SOURCES = \ + ivi-shell/ivi-layout-export.h \ + ivi-shell/ivi-layout-private.h \ + ivi-shell/ivi-layout.c \ + ivi-shell/ivi-layout-transition.c \ ivi-shell/ivi-shell.h \ ivi-shell/ivi-shell.c \ - ivi-shell/ivi-layout-private.h \ ivi-shell/input-panel-ivi.c nodist_ivi_shell_la_SOURCES = \ protocol/ivi-application-protocol.c \ diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index 8287e93..df3ac98 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -292,28 +292,23 @@ ivi_layout_surface_set_transition_duration( struct ivi_layout_surface *ivisurf, uint32_t duration); -struct ivi_layout_interface { - struct weston_view *(*get_weston_view)( - struct ivi_layout_surface *surface); - - void (*surface_configure)(struct ivi_layout_surface *ivisurf, - int32_t width, - int32_t height); - - struct ivi_layout_surface *(*surface_create)( - struct weston_surface *wl_surface, - uint32_t id_surface); - - void (*init_with_compositor)(struct weston_compositor *ec); - - int32_t (*get_surface_dimension)( - struct ivi_layout_surface *ivisurf, - int32_t *dest_width, - int32_t *dest_height); - - void (*add_surface_configured_listener)( - struct ivi_layout_surface *ivisurf, - struct wl_listener* listener); -}; - +/** + * methods of interaction between ivi-shell with ivi-layout + */ +struct weston_view * +ivi_layout_get_weston_view(struct ivi_layout_surface *surface); +void +ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, +int32_t width, int32_t height); +struct ivi_layout_surface* +ivi_layout_surface_create(struct weston_surface *wl_surface, + uint32_t id_surface); +void +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 +ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf, + struct wl_listener* listener); #endif diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 67ccf6e..1772845 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -2659,8 +2659,10 @@ ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf, return 0; } -/***called from ivi-shell**/ -static struct weston_view * +/** + * methods of interaction between ivi-shell with ivi-layout + */ +struct weston_view * ivi_layout_get_weston_view(struct ivi_layout_surface
[PATCH 2/2] ivi-shell: rewrite controller API
This fixes the breakage caused by ivi-shell: make ivi-layout.c as a part of ivi-shell.so hmi-controller.c: A reference implementation of controller module does not use the layout functions directly. This get function pointers at controller_module_init which called by ivi-shell. ivi-layout-export.h: Definition of interfaces in a struction: ivi_controller_interface. function pointers are set at ivi-layout.c. ivi-layout-private.h: Definition of some interfaces are remove bucause it is implemented in ivi-layout.c and set it as function pointer. Several interfaces are kept here because they are implemented in ivi-layout.c/transition.c but used in other files. ivi-layout-transition.c: remove WL_EXPORT because export is not needed anymore. remove unnesesary unsed method. ivi-shell.c: call controller_module_init of hmi-controller to init it and set function pointers. If the interface_version is equal or greater than what hmi_controller was built with, things are pass. If the interface_version is smaller than what the controller expects, it has to fail because it cannot work. This is followed the manner, - never remove a function pointer - never modify an existing function signature - additions are allowed at the end of struct ivi_controller_interface - all function pointers must always be populated and working in ivi-shell.so (ivi-layout.c etc.) Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- ivi-shell/hmi-controller.c| 174 +++--- ivi-shell/ivi-layout-export.h | 1102 - ivi-shell/ivi-layout-private.h| 180 ++ ivi-shell/ivi-layout-transition.c | 16 +- ivi-shell/ivi-layout.c| 271 ++--- ivi-shell/ivi-shell.c | 33 +- 6 files changed, 951 insertions(+), 825 deletions(-) diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 1ad63a2..36a1b56 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -128,6 +128,14 @@ struct launcher_info { int32_t index; }; +const struct ivi_controller_interface *ivi_controller_interface; + +int +controller_module_init(struct weston_compositor *ec, + int *argc, char *argv[], + const struct ivi_controller_interface *interface, + size_t interface_version); + /* * local functions / @@ -154,7 +162,7 @@ static int32_t is_surf_in_ui_widget(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface *ivisurf) { - uint32_t id = ivi_layout_get_id_of_surface(ivisurf); + uint32_t id = ivi_controller_interface-get_id_of_surface(ivisurf); uint32_t *ui_widget_id = NULL; wl_array_for_each(ui_widget_id, hmi_ctrl-ui_widgets) { @@ -235,11 +243,11 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, surface_y = (int32_t)surface_height; } - ivi_layout_surface_set_transition(ivisurf, + ivi_controller_interface-surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); - ivi_layout_surface_set_visibility(ivisurf, true); - ivi_layout_surface_set_destination_rectangle(ivisurf, + ivi_controller_interface-surface_set_visibility(ivisurf, true); + ivi_controller_interface-surface_set_destination_rectangle(ivisurf, surface_x, surface_y, (int32_t)surface_width, (int32_t)surface_height); @@ -247,11 +255,11 @@ mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, num++; continue; } - ivi_layout_surface_set_visibility(ivisurf, false); + ivi_controller_interface-surface_set_visibility(ivisurf, false); } if (surf_num 0) { - ivi_layout_layer_set_transition(layer-ivilayer, + ivi_controller_interface-layer_set_transition(layer-ivilayer, IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, duration); } @@ -282,11 +290,11 @@ mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, continue; if (num == 1) { - ivi_layout_surface_set_transition(ivisurf, + ivi_controller_interface-surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration
[PATCH weston-ivi-shell v8 00/13] a reference shell for In-Vehicle Infotainment system
This is version 8 of ivi_shell patches reviewed by Pekka Paalanen pekka.paala...@collabora.co.uk. Vesion 7 can be found here: http://lists.freedesktop.org/archives/wayland-devel/2014-July/015971.html Version 1 can be found here and this overviews what ivi_shell is: http://lists.freedesktop.org/archives/wayland-devel/2014-March/013532.html and http://projects.genivi.org/wayland-ivi-extension Version 6 enclosed an updated picture for overviewing of ivi-shell: http://lists.freedesktop.org/archives/wayland-devel/2014-June/015616.html For easier testing/review, this patch series can be found in my github as well. https://github.com/ntanibata/weston-ivi-shell/tree/weston-ivi-shell-1.6.0-WIP-11 Overview of Changes since version v7: The patchset has been completely restructured so I don’t write all changed per each patch here. * Rebased on Weston master. * Improvement of README. * Coding sytle change, following http://cgit.freedesktop.org/wayland/wayland/tree/doc/Contributing * Clean up protocols and its descriptions, ivi-application.aml and ivi-hmi-controller. * Re-alignment of ivi-layout interfaces in ivi-layout-export.h. Which interfaces should be exported by WL_EXPORT is re-aligned by that they are needed by references of how to use ivi-layout interfaces; hmi-controller and ivi-controller. One reference; hmi-controller is a part of this patchset. Another one; ivi-controller is provided by GENIVI wayland-ivi-extension project. The link to the project can be find in REAME. * Refinement of destruction logic of ivi_surface in ivi-shell.c and ivi-layout.c * Authorization check to restrict access from client to hmi-controller. A client invoked by hmi-controller is allowed to access. * Clean up weston-ivi-shell-user-interface which is reference of how to use hmi-controller protocol. There are several unnecessary roundtrips. It is fixed referring simple-shm code. * Clean up clients; simpe-egl, simple-shm, and window to support ivi-application protocol. * This is not change yet. We are looking for merging ivi-layout.so into ivi-shell.so. BR, Nobuhiko Tanibata ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v8 01/13] ivi-shell: add README for ivi-shell
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- ivi-shell/README | 79 1 file changed, 79 insertions(+) create mode 100644 ivi-shell/README diff --git a/ivi-shell/README b/ivi-shell/README new file mode 100644 index 000..7f41291 --- /dev/null +++ b/ivi-shell/README @@ -0,0 +1,79 @@ + In-vehicle infotainment (information and entertainment) + graphical environment support modules for Weston + + +IVI-shell is an alternative shell for Weston, a Wayland display server. +Window management and application interaction with the display server +are very different to that of a normal desktop, which is why this is +a separate shell and not an extension to the desktop-shell suite with +xdg_shell. As such, applications need to be specifically written to use +IVI-shell. + +IVI-shell contains two main features: +- Common layout library for surface, which allow ivi-shell developer + to develop own shell, linking Common layout library. + For the time being, the library refers Genivi ilm interface. + + http://projects.genivi.org/wayland-ivi-extension/ + +- Extension protocal; ivi-application to tie wl_surface and a given ID. + With this ID, shell can identify which wl_surface is drawn by which + application. In in-vehicle infortainment system, a shell has to update + a property of a wl_surface. E.g. there may be a use case when vehicle + starts to move, the wl_surface drawn by Car navigation is expected to + move top of surfaces. + +The actual software components delivered with Weston are: + +- ivi-application.xml: + Wayland protocol extension for IVI-applications; the public + shell protocol (the same concept as xdg_shell). + Implemented by ivi-shell.so. + +- ivi-shell.so: + A Weston shell module that implements ivi-application.xml interfaces. + Loads ivi-layout.so. + +- ivi-layout.so: + Implements the IVI window management concepts: Screen, Layer, + Surface, groups of Layers, groups of Surfaces, see: + http://projects.genivi.org/ivi-layer-management/node/13 + Offers a stable API for writing IVI-controller modules like + hmi-controller.so against the IVI concepts. In other words, + it offers an API to write IVI window manager modules. + +- hmi-controller.so: + A sample implementation of an IVI-controller module, usually + replaced by IVI system vendors. + Uses ivi-layout.so to perform essentially window manager tasks. + This implementation keeps all window management inside the module, + while IVI-systems may use another module that exposes all window + management via Wayland or other protocol for an external process + to control: + http://git.projects.genivi.org/?p=wayland-ivi-extension.git;a=summary + +- ivi-hmi-controller.xml: + Wayland protocol extension for IVI display control; the private + shell protocol for weston-ivi-shell-user-interface client + (the same concept as desktop-shell.xml). + Implemented by hmi-controller.so, and usually replaced by IVI + system vendors. + +- weston-ivi-shell-user-interface: + A sample implementation of an IVI shell helper client, usually + replaced by IVI system vendors. + A helper client for basic display content, similar to + weston-desktop-shell. + + +How to compile: +same as weston. To disable, use option: --disable-ivi-shell for configure. + +How to configure weston.ini: +reference ini file will be generated in build_dir/ivi-shell. + +How to run: +same as weston. exec weston. + +How to use UI: +http://lists.freedesktop.org/archives/wayland-devel/attachments/20140625/abbfc064/attachment-0001.png -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v8 04/13] ivi-shell: add the shell plugin for In-Vehicle Infotainment system
- ivi-shell.so - introduces ivi-shell/ivi-shell.[ch] In-Vehicle Infotainment system traditionally manages surfaces with global identification. A protocol, ivi_application, supports such a feature by implementing a request, ivi_application::surface_creation defined in ivi_application.xml. The ivi-shell explicitly loads ivi-layout.so and a module to add business logic like how to layout surfaces by using ivi-layout APIs. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Makefile.am | 17 +- ivi-shell/ivi-shell.c | 468 ++ ivi-shell/ivi-shell.h | 36 3 files changed, 520 insertions(+), 1 deletion(-) create mode 100644 ivi-shell/ivi-shell.c create mode 100644 ivi-shell/ivi-shell.h diff --git a/Makefile.am b/Makefile.am index c4190d3..ece9d9b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -738,7 +738,8 @@ endif if ENABLE_IVI_SHELL module_LTLIBRARIES += \ - $(ivi_layout) + $(ivi_layout) \ + $(ivi_shell) ivi_layout = ivi-layout.la ivi_layout_la_LDFLAGS = -module -avoid-version @@ -750,6 +751,20 @@ ivi_layout_la_SOURCES =\ ivi-shell/ivi-layout.c \ ivi-shell/ivi-layout-transition.c +ivi_shell = ivi-shell.la +ivi_shell_la_LDFLAGS = -module -avoid-version +ivi_shell_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la +ivi_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) +ivi_shell_la_SOURCES = \ + ivi-shell/ivi-shell.h \ + ivi-shell/ivi-shell.c \ + ivi-shell/ivi-layout-private.h +nodist_ivi_shell_la_SOURCES = \ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-server-protocol.h + +BUILT_SOURCES += $(nodist_ivi_shell_la_SOURCES) + endif diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c new file mode 100644 index 000..50894fb --- /dev/null +++ b/ivi-shell/ivi-shell.c @@ -0,0 +1,468 @@ +/* + * Copyright (C) 2013 DENSO CORPORATION + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any + * purpose. It is provided as is without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * ivi-shell supports a type of shell for In-Vehicle Infotainment system. + * In-Vehicle Infotainment system traditionally manages surfaces with global + * identification. A protocol, ivi_application, supports such a feature + * by implementing a request, ivi_application::surface_creation defined in + * ivi_application.xml. + * + * The ivi-shell explicitly loads a module to add business logic like how to + * layout surfaces by using internal ivi-layout APIs. + */ +#include config.h + +#include sys/wait.h +#include unistd.h +#include stdlib.h +#include stdio.h +#include string.h +#include linux/input.h +#include dlfcn.h +#include limits.h +#include assert.h + +#include ivi-shell.h +#include ivi-application-server-protocol.h +#include ivi-layout-private.h + +#include ../shared/os-compatibility.h + +/* Representation of ivi_surface protocol object. */ +struct ivi_shell_surface +{ + struct wl_resource* resource; + struct ivi_shell *shell; + struct ivi_layout_surface *layout_surface; + + struct weston_surface *surface; + struct wl_listener surface_destroy_listener; + + uint32_t id_surface; + + int32_t width; + int32_t height; + + struct wl_list link; + + struct wl_listener configured_listener; +}; + +struct ivi_shell_setting +{ + char *ivi_module; +}; + +/* + * Implementation of ivi_surface + */ + +static void +surface_configure_notify(struct wl_listener *listener, void *data) +{ + struct ivi_layout_surface *layout_surf = + (struct ivi_layout_surface *)data; + + struct ivi_shell_surface *shell_surf
[PATCH weston-ivi-shell v8 06/13] ivi-shell: a reference implementation how to use ivi-layout internal APIs
- hmi-controller.so - introduces hmi-controller.so The library is used to manage layout of surfaces/layers. Layout change is triggered by ivi-hmi-controller protocol, ivi-hmi-controller.xml. A reference how to use the protocol, see ivi-shell-user-interface.c. In-Vehicle Infotainment system usually manages properties of surfaces/layers by only a central component which decide where surfaces/layers shall be. This is differenct use case from desktop style; each application can request property of its window via xdg-shell protocol, like fullscreen and set its to top level. In-Vehicle Infortainment system doesn't allow each application to chagen them from its application because of safty reasons. The concept of layer is simillar with a use case of cursor layer of Destop. For In-Vehicle Infortainment system, it is extended to all applications. For example, rearview camera application is assigned to a layer to group several surfaces, e.g. captured image and drawing lines separately. Central manaegr can control property of the layer of rearview camera. This reference show examples to implement the central component as a module of weston. Default Scene graph of UI is defined in hmi_controller_create. It consists of - In the bottom, a base layer to group surfaces of background, panel, and buttons - Next, a application layer to show application surfaces. - Workspace background layer to show a surface of background image. - Workspace layer to show launcher to launch application with icons. Paths to binary and icon are defined in weston.ini. The width of this layer is longer than the size of screen because a workspace has several pages and is controlled by motion of input. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Makefile.am| 16 +- ivi-shell/hmi-controller.c | 1718 2 files changed, 1733 insertions(+), 1 deletion(-) create mode 100644 ivi-shell/hmi-controller.c diff --git a/Makefile.am b/Makefile.am index a974a83..b7d646c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -739,7 +739,8 @@ if ENABLE_IVI_SHELL module_LTLIBRARIES += \ $(ivi_layout) \ - $(ivi_shell) + $(ivi_shell)\ + $(hmi_controller) ivi_layout = ivi-layout.la ivi_layout_la_LDFLAGS = -module -avoid-version @@ -765,6 +766,19 @@ nodist_ivi_shell_la_SOURCES = \ BUILT_SOURCES += $(nodist_ivi_shell_la_SOURCES) +hmi_controller = hmi-controller.la +hmi_controller_la_LDFLAGS = -module -avoid-version +hmi_controller_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la +hmi_controller_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) +hmi_controller_la_SOURCES =\ + ivi-shell/ivi-layout-export.h \ + ivi-shell/hmi-controller.c +nodist_hmi_controller_la_SOURCES = \ + protocol/ivi-hmi-controller-protocol.c \ + protocol/ivi-hmi-controller-server-protocol.h + +BUILT_SOURCES += $(nodist_hmi_controller_la_SOURCES) + endif diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c new file mode 100644 index 000..3a07a70 --- /dev/null +++ b/ivi-shell/hmi-controller.c @@ -0,0 +1,1718 @@ +/* + * Copyright (C) 2014 DENSO CORPORATION + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any + * purpose. It is provided as is without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * A reference implementation how to use ivi-layout APIs in order to manage + * layout of ivi_surfaces/ivi_layers. Layout change is triggered by + * ivi-hmi-controller protocol, ivi-hmi-controller.xml. A reference how to + * use the protocol, see hmi-controller-homescreen. + * + * In-Vehicle Infotainment system usually manage properties of + * ivi_surfaces/ivi_layers by only a central component
[PATCH weston-ivi-shell v8 08/13] data: add reference image files for weston-ivi-shell-user-interface
- introduces reference images used by weston-ivi-shell-user-interface. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Makefile.am | 14 +- data/COPYING | 28 +++- data/background.png | Bin 0 - 245579 bytes data/fullscreen.png | Bin 0 - 3406 bytes data/home.png| Bin 0 - 4629 bytes data/icon_ivi_clickdot.png | Bin 0 - 39523 bytes data/icon_ivi_flower.png | Bin 0 - 24475 bytes data/icon_ivi_simple-egl.png | Bin 0 - 29316 bytes data/icon_ivi_simple-shm.png | Bin 0 - 71120 bytes data/icon_ivi_smoke.png | Bin 0 - 46577 bytes data/panel.png | Bin 0 - 41955 bytes data/random.png | Bin 0 - 4891 bytes data/sidebyside.png | Bin 0 - 3929 bytes data/tiling.png | Bin 0 - 5620 bytes 14 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 data/background.png create mode 100644 data/fullscreen.png create mode 100644 data/home.png create mode 100644 data/icon_ivi_clickdot.png create mode 100644 data/icon_ivi_flower.png create mode 100644 data/icon_ivi_simple-egl.png create mode 100644 data/icon_ivi_simple-shm.png create mode 100644 data/icon_ivi_smoke.png create mode 100644 data/panel.png create mode 100644 data/random.png create mode 100644 data/sidebyside.png create mode 100644 data/tiling.png diff --git a/Makefile.am b/Makefile.am index f37b23d..a82ade3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -683,7 +683,19 @@ dist_westondata_DATA = \ data/icon_window.png\ data/sign_close.png \ data/sign_maximize.png \ - data/sign_minimize.png + data/sign_minimize.png \ + data/background.png \ + data/tiling.png \ + data/fullscreen.png \ + data/panel.png \ + data/random.png \ + data/sidebyside.png \ + data/home.png \ + data/icon_ivi_clickdot.png \ + data/icon_ivi_flower.png\ + data/icon_ivi_simple-egl.png\ + data/icon_ivi_simple-shm.png\ + data/icon_ivi_smoke.png if BUILD_WCAP_TOOLS diff --git a/data/COPYING b/data/COPYING index 430a864..3c10126 100644 --- a/data/COPYING +++ b/data/COPYING @@ -8,4 +8,30 @@ http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA. The terminal icon is taken from the gnome-icon-theme collection which -is also distributed under the Creative Commons BY-SA 3.0 license. \ No newline at end of file +is also distributed under the Creative Commons BY-SA 3.0 license. + + +(C) 2013 DENSO CORPORATION + +Permission to use, copy, modify, distribute, and sell following listed images +for any purpose is hereby granted without fee, provided +that the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of the copyright holders not be used in +advertising or publicity pertaining to distribution of the images +without specific, written prior permission. The copyright holders make +no representations about the suitability of these images for any +purpose. It is provided as is without express or implied warranty. + +background.png +tiling.png +fullscreen.png +panel.png +random.png +sidebyside.png +home.png +icon_ivi_clickdot.png +icon_ivi_flower.png +icon_ivi_simple-egl.png +icon_ivi_simple-shm.png +icon_ivi_smoke.png -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v8 11/13] clients: support ivi-application.xml for clients/simple-egl.c
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Makefile.am | 4 ++- clients/simple-egl.c | 95 +++- 2 files changed, 89 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index e5fe359..de1d768 100644 --- a/Makefile.am +++ b/Makefile.am @@ -451,7 +451,9 @@ demo_clients += weston-simple-egl weston_simple_egl_SOURCES = clients/simple-egl.c nodist_weston_simple_egl_SOURCES = \ protocol/xdg-shell-protocol.c \ - protocol/xdg-shell-client-protocol.h + protocol/xdg-shell-client-protocol.h\ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-client-protocol.h weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS) weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm endif diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 33e711c..d3c205f 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -41,6 +41,10 @@ #include EGL/eglext.h #include xdg-shell-client-protocol.h +#include sys/types.h +#include unistd.h +#include protocol/ivi-application-client-protocol.h +#define IVI_SURFACE_ID 9000 #ifndef EGL_EXT_swap_buffers_with_damage #define EGL_EXT_swap_buffers_with_damage 1 @@ -74,6 +78,7 @@ struct display { EGLConfig conf; } egl; struct window *window; + struct ivi_application *ivi_application; PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage; }; @@ -95,6 +100,7 @@ struct window { struct wl_egl_window *native; struct wl_surface *surface; struct xdg_surface *xdg_surface; + struct ivi_surface *ivi_surface; EGLSurface egl_surface; struct wl_callback *callback; int fullscreen, opaque, buffer_size, frame_sync; @@ -255,7 +261,7 @@ init_gl(struct window *window) } glUseProgram(program); - + window-gl.pos = 0; window-gl.col = 1; @@ -316,18 +322,61 @@ static const struct xdg_surface_listener xdg_surface_listener = { }; static void -create_surface(struct window *window) +handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, + int32_t width, int32_t height) +{ + struct window *window = data; + + wl_egl_window_resize(window-native, width, height, 0, 0); + + window-geometry.width = width; + window-geometry.height = height; + + if (!window-fullscreen) + window-window_size = window-geometry; +} + +static const struct ivi_surface_listener ivi_surface_listener = { + handle_ivi_surface_configure, +}; + +static void +create_xdg_surface(struct window *window, struct display *display) { - struct display *display = window-display; - EGLBoolean ret; - - window-surface = wl_compositor_create_surface(display-compositor); window-xdg_surface = xdg_shell_get_xdg_surface(display-shell, window-surface); xdg_surface_add_listener(window-xdg_surface, xdg_surface_listener, window); + xdg_surface_set_title(window-xdg_surface, simple-egl); +} + +static void +create_ivi_surface(struct window *window, struct display *display) +{ + uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); + window-ivi_surface = + ivi_application_surface_create(display-ivi_application, + id_ivisurf, window-surface); + + if (window-ivi_surface == NULL) { + fprintf(stderr, Failed to create ivi_client_surface\n); + abort(); + } + + ivi_surface_add_listener(window-ivi_surface, +ivi_surface_listener, window); +} + +static void +create_surface(struct window *window) +{ + struct display *display = window-display; + EGLBoolean ret; + + window-surface = wl_compositor_create_surface(display-compositor); + window-native = wl_egl_window_create(window-surface, window-geometry.width, @@ -337,7 +386,13 @@ create_surface(struct window *window) display-egl.conf, window-native, NULL); - xdg_surface_set_title(window-xdg_surface, simple-egl); + if (display-shell) { + create_xdg_surface(window, display); + } else if (display-ivi_application ) { + create_ivi_surface(window, display); + } else { + assert(0); + } ret = eglMakeCurrent(window-display-egl.dpy, window-egl_surface, window-egl_surface, window-display-egl.ctx); @@ -346,6 +401,9 @@ create_surface(struct window *window
[PATCH weston-ivi-shell v8 09/13] ivi-shell: a reference of weston.ini for ivi-shell and ivi-hmi-controller.
- introduces ivi-shell/weston.ini.in Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Makefile.am | 13 +-- ivi-shell/.gitignore| 1 + ivi-shell/weston.ini.in | 93 + 3 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 ivi-shell/.gitignore create mode 100644 ivi-shell/weston.ini.in diff --git a/Makefile.am b/Makefile.am index a82ade3..e91a125 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,7 @@ BUILT_SOURCES = # Do not run xwayland test while it is known broken. AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install --disable-xwayland-test -EXTRA_DIST = weston.ini.in +EXTRA_DIST = weston.ini.in ivi-shell/weston.ini.in weston.ini : $(srcdir)/weston.ini.in $(AM_V_GEN)$(SED) \ @@ -20,7 +20,14 @@ weston.ini : $(srcdir)/weston.ini.in -e 's|@libexecdir[@]|$(libexecdir)|g' \ $ $@ -all-local : weston.ini +ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in + $(AM_V_GEN)$(SED) \ + -e 's|@bindir[@]|$(bindir)|g' \ + -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ + -e 's|@libexecdir[@]|$(libexecdir)|g' \ + $ $@ + +all-local : weston.ini ivi-shell/weston.ini AM_CFLAGS = $(GCC_CFLAGS) @@ -36,7 +43,7 @@ AM_CPPFLAGS = \ -DLIBEXECDIR='$(libexecdir)' \ -DBINDIR='$(bindir)' -CLEANFILES = weston.ini $(BUILT_SOURCES) +CLEANFILES = weston.ini ivi-shell/weston.ini $(BUILT_SOURCES) bin_PROGRAMS += weston diff --git a/ivi-shell/.gitignore b/ivi-shell/.gitignore new file mode 100644 index 000..e690c59 --- /dev/null +++ b/ivi-shell/.gitignore @@ -0,0 +1 @@ +weston.ini diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in new file mode 100644 index 000..36b4470 --- /dev/null +++ b/ivi-shell/weston.ini.in @@ -0,0 +1,93 @@ +[core] +shell=ivi-shell.so + +[ivi-shell] +ivi-module=hmi-controller.so +ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface + +cursor-theme=default +cursor-size=32 + +base-layer-id=1000 +workspace-background-layer-id=2000 +workspace-layer-id=3000 +application-layer-id=4000 + +transition-duration=300 + +background-image=@abs_top_builddir@/data/background.png +background-id=1001 +panel-image=@abs_top_builddir@/data/panel.png +panel-id=1002 +tiling-image=@abs_top_builddir@/data/tiling.png +tiling-id=1003 +sidebyside-image=@abs_top_builddir@/data/sidebyside.png +sidebyside-id=1004 +fullscreen-image=@abs_top_builddir@/data/fullscreen.png +fullscreen-id=1005 +random-image=@abs_top_builddir@/data/random.png +random-id=1006 +home-image=@abs_top_builddir@/data/home.png +home-id=1007 +workspace-background-color=0x9900 +workspace-background-id=2001 + +[ivi-launcher] +workspace-id=0 +icon-id=4001 +icon=@abs_top_builddir@/data/icon_ivi_flower.png +path=@abs_top_builddir@/weston-flower + +[ivi-launcher] +workspace-id=0 +icon-id=4002 +icon=@abs_top_builddir@/data/icon_ivi_clickdot.png +path=@abs_top_builddir@/weston-clickdot + +[ivi-launcher] +workspace-id=1 +icon-id=4003 +icon=@abs_top_builddir@/data/icon_ivi_simple-egl.png +path=@abs_top_builddir@/weston-simple-egl + +[ivi-launcher] +workspace-id=1 +icon-id=4004 +icon=@abs_top_builddir@/data/icon_ivi_simple-shm.png +path=@abs_top_builddir@/weston-simple-shm + +[ivi-launcher] +workspace-id=2 +icon-id=4005 +icon=@abs_top_builddir@/data/icon_ivi_smoke.png +path=@abs_top_builddir@/weston-smoke + +[ivi-launcher] +workspace-id=3 +icon-id=4006 +icon=@abs_top_builddir@/data/icon_ivi_flower.png +path=@abs_top_builddir@/weston-flower + +[ivi-launcher] +workspace-id=3 +icon-id=4007 +icon=@abs_top_builddir@/data/icon_ivi_clickdot.png +path=@abs_top_builddir@/weston-clickdot + +[ivi-launcher] +workspace-id=3 +icon-id=4008 +icon=@abs_top_builddir@/data/icon_ivi_simple-egl.png +path=@abs_top_builddir@/weston-simple-egl + +[ivi-launcher] +workspace-id=3 +icon-id=4009 +icon=@abs_top_builddir@/data/icon_ivi_simple-shm.png +path=@abs_top_builddir@/weston-simple-shm + +[ivi-launcher] +workspace-id=3 +icon-id=4010 +icon=@abs_top_builddir@/data/icon_ivi_smoke.png +path=@abs_top_builddir@/weston-smoke -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v8 12/13] clients: support ivi-application.xml for clients/window.c
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- clients/window.c | 67 +++- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/clients/window.c b/clients/window.c index 5099004..f39150b 100644 --- a/clients/window.c +++ b/clients/window.c @@ -72,6 +72,10 @@ typedef void *EGLContext; #include window.h +#include sys/types.h +#include ivi-application-client-protocol.h +#define IVI_SURFACE_ID 9000 + struct shm_pool; struct global { @@ -91,6 +95,7 @@ struct display { struct text_cursor_position *text_cursor_position; struct workspace_manager *workspace_manager; struct xdg_shell *xdg_shell; + struct ivi_application *ivi_application; /* ivi style shell */ EGLDisplay dpy; EGLConfig argb_config; EGLContext argb_ctx; @@ -250,6 +255,8 @@ struct window { struct window *parent; struct wl_surface *last_parent_surface; + struct ivi_surface *ivi_surface; + struct window_frame *frame; /* struct surface::link, contains also main_surface */ @@ -1381,6 +1388,19 @@ window_get_display(struct window *window) } static void +handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, + int32_t width, int32_t height) +{ + struct window *window = data; + + window_schedule_resize(window, width, height); +} + +static const struct ivi_surface_listener ivi_surface_listener = { +handle_ivi_surface_configure, +}; + +static void surface_create_surface(struct surface *surface, uint32_t flags) { struct display *display = surface-window-display; @@ -1503,7 +1523,7 @@ window_destroy(struct window *window) wl_list_remove(window-redraw_task.link); - wl_list_for_each(input, display-input_list, link) { + wl_list_for_each(input, display-input_list, link) { if (input-touch_focus == window) input-touch_focus = NULL; if (input-pointer_focus == window) @@ -1528,6 +1548,9 @@ window_destroy(struct window *window) if (window-xdg_popup) xdg_popup_destroy(window-xdg_popup); + if (window-ivi_surface) + ivi_surface_destroy(window-ivi_surface); + surface_destroy(window-main_surface); wl_list_remove(window-link); @@ -3074,7 +3097,7 @@ touch_handle_down(void *data, struct wl_touch *wl_touch, wl_list_insert(input-touch_point_list, tp-link); if (widget-touch_down_handler) - (*widget-touch_down_handler)(widget, input, + (*widget-touch_down_handler)(widget, input, serial, time, id, sx, sy, widget-user_data); @@ -4512,7 +4535,7 @@ window_create_internal(struct display *display, int custom) surface = surface_create(window); window-main_surface = surface; - assert(custom || display-xdg_shell); + assert(custom || display-xdg_shell || display-ivi_application); window-custom = custom; window-preferred_format = WINDOW_PREFERRED_FORMAT_NONE; @@ -4532,17 +4555,30 @@ struct window * window_create(struct display *display) { struct window *window; + uint32_t id_ivisurf; window = window_create_internal(display, 0); - window-xdg_surface = - xdg_shell_get_xdg_surface(window-display-xdg_shell, - window-main_surface-surface); - fail_on_null(window-xdg_surface); + if (window-display-xdg_shell) { + window-xdg_surface = + xdg_shell_get_xdg_surface(window-display-xdg_shell, + window-main_surface-surface); + fail_on_null(window-xdg_surface); - xdg_surface_set_user_data(window-xdg_surface, window); - xdg_surface_add_listener(window-xdg_surface, -xdg_surface_listener, window); + xdg_surface_set_user_data(window-xdg_surface, window); + xdg_surface_add_listener(window-xdg_surface, +xdg_surface_listener, window); + } else if (display-ivi_application) { + /* auto generation of ivi_id based on process id + basement of id */ + id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); + window-ivi_surface = + ivi_application_surface_create(display-ivi_application, + id_ivisurf, window-main_surface-surface); + fail_on_null(window-ivi_surface
[PATCH weston-ivi-shell v8 10/13] clients: support ivi-application.xml for clients/simple-shm.c
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Reviewed-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Makefile.am | 4 +++- clients/simple-shm.c | 42 ++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index e91a125..e5fe359 100644 --- a/Makefile.am +++ b/Makefile.am @@ -413,7 +413,9 @@ nodist_weston_simple_shm_SOURCES = \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h\ protocol/fullscreen-shell-protocol.c\ - protocol/fullscreen-shell-client-protocol.h + protocol/fullscreen-shell-client-protocol.h \ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-client-protocol.h weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la diff --git a/clients/simple-shm.c b/clients/simple-shm.c index c1cb386..e6025aa 100644 --- a/clients/simple-shm.c +++ b/clients/simple-shm.c @@ -37,6 +37,10 @@ #include xdg-shell-client-protocol.h #include fullscreen-shell-client-protocol.h +#include sys/types.h +#include ivi-application-client-protocol.h +#define IVI_SURFACE_ID 9000 + struct display { struct wl_display *display; struct wl_registry *registry; @@ -45,6 +49,7 @@ struct display { struct _wl_fullscreen_shell *fshell; struct wl_shm *shm; uint32_t formats; + struct ivi_application *ivi_application; }; struct buffer { @@ -58,6 +63,7 @@ struct window { int width, height; struct wl_surface *surface; struct xdg_surface *xdg_surface; + struct ivi_surface *ivi_surface; struct buffer buffers[2]; struct buffer *prev_buffer; struct wl_callback *callback; @@ -134,6 +140,17 @@ static const struct xdg_surface_listener xdg_surface_listener = { handle_delete, }; +static void +handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, +int32_t width, int32_t height) +{ + /* Simple-shm is resizable */ +} + +static const struct ivi_surface_listener ivi_surface_listener = { + handle_ivi_surface_configure, +}; + static struct window * create_window(struct display *display, int width, int height) { @@ -160,11 +177,25 @@ create_window(struct display *display, int width, int height) xdg_surface_listener, window); xdg_surface_set_title(window-xdg_surface, simple-shm); + } else if (display-fshell) { _wl_fullscreen_shell_present_surface(display-fshell, window-surface, _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT, NULL); + } else if (display-ivi_application ) { + uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); + window-ivi_surface = + ivi_application_surface_create(display-ivi_application, + id_ivisurf, window-surface); + if (window-ivi_surface == NULL) { + fprintf(stderr, Failed to create ivi_client_surface\n); + abort(); + } + + ivi_surface_add_listener(window-ivi_surface, +ivi_surface_listener, window); + } else { assert(0); } @@ -350,6 +381,11 @@ registry_handle_global(void *data, struct wl_registry *registry, id, wl_shm_interface, 1); wl_shm_add_listener(d-shm, shm_listener, d); } + else if (strcmp(interface, ivi_application) == 0) { + d-ivi_application = + wl_registry_bind(registry, id, +ivi_application_interface, 1); + } } static void @@ -451,6 +487,12 @@ main(int argc, char **argv) ret = wl_display_dispatch(display-display); fprintf(stderr, simple-shm exiting\n); + + if (window-display-ivi_application) { + ivi_surface_destroy(window-ivi_surface); + ivi_application_destroy(window-display-ivi_application); + } + destroy_window(window); destroy_display(display); -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v8 13/13] ivi-shell: reference implementation of input panel for ivi-shell
- introduces ivi-shell/input-panel-ivi.c which is basically copied from desktop shell. It shall be improvaded to remove duplicate implementation. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp Acked-by: Pekka Paalanen pekka.paala...@collabora.co.uk --- Makefile.am | 3 +- ivi-shell/input-panel-ivi.c | 391 ivi-shell/ivi-shell.c | 30 ivi-shell/ivi-shell.h | 28 ivi-shell/weston.ini.in | 3 + 5 files changed, 454 insertions(+), 1 deletion(-) create mode 100644 ivi-shell/input-panel-ivi.c diff --git a/Makefile.am b/Makefile.am index de1d768..03a3c33 100644 --- a/Makefile.am +++ b/Makefile.am @@ -801,7 +801,8 @@ ivi_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) ivi_shell_la_SOURCES = \ ivi-shell/ivi-shell.h \ ivi-shell/ivi-shell.c \ - ivi-shell/ivi-layout-private.h + ivi-shell/ivi-layout-private.h \ + ivi-shell/input-panel-ivi.c nodist_ivi_shell_la_SOURCES = \ protocol/ivi-application-protocol.c \ protocol/ivi-application-server-protocol.h diff --git a/ivi-shell/input-panel-ivi.c b/ivi-shell/input-panel-ivi.c new file mode 100644 index 000..6b89177 --- /dev/null +++ b/ivi-shell/input-panel-ivi.c @@ -0,0 +1,391 @@ +/* + * Copyright © 2010-2012 Intel Corporation + * Copyright © 2011-2012 Collabora, Ltd. + * Copyright © 2013 Raspberry Pi Foundation + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any + * purpose. It is provided as is without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include config.h + +#include stdlib.h +#include stdio.h +#include string.h + +#include ivi-shell.h +#include input-method-server-protocol.h +#include ivi-layout-private.h + +struct input_panel_surface { + struct wl_resource *resource; + struct wl_signal destroy_signal; + + struct ivi_shell *shell; + + struct wl_list link; + struct weston_surface *surface; + struct weston_view *view; + struct wl_listener surface_destroy_listener; + + struct weston_view_animation *anim; + + struct weston_output *output; + uint32_t panel; +}; + +static void +input_panel_slide_done(struct weston_view_animation *animation, void *data) +{ + struct input_panel_surface *ipsurf = data; + + ipsurf-anim = NULL; +} + +static void +show_input_panel_surface(struct input_panel_surface *ipsurf) +{ + struct ivi_shell *shell = ipsurf-shell; + struct weston_seat *seat; + struct weston_surface *focus; + float x, y; + + wl_list_for_each(seat, shell-compositor-seat_list, link) { + if (!seat-keyboard || !seat-keyboard-focus) + continue; + focus = weston_surface_get_main_surface(seat-keyboard-focus); + ipsurf-output = focus-output; + x = ipsurf-output-x + (ipsurf-output-width - ipsurf-surface-width) / 2; + y = ipsurf-output-y + ipsurf-output-height - ipsurf-surface-height; + weston_view_set_position(ipsurf-view, x, y); + } + + weston_layer_entry_insert(shell-input_panel_layer.view_list, + ipsurf-view-layer_link); + weston_view_geometry_dirty(ipsurf-view); + weston_view_update_transform(ipsurf-view); + weston_surface_damage(ipsurf-surface); + + if (ipsurf-anim) + weston_view_animation_destroy(ipsurf-anim); + + ipsurf-anim = + weston_slide_run(ipsurf-view, +ipsurf-surface-height * 0.9, 0, +input_panel_slide_done, ipsurf); +} + +static void +show_input_panels(struct wl_listener *listener, void *data) +{ + struct ivi_shell *shell = + container_of(listener, struct ivi_shell
[PATCH weston-ivi-shell v7 1/9] protocol: add interface ivi_application extension
ivi_applicatoin extension creates ivi_surface objects tied to a given wl_surface with a given id. The given id can be used in a shell to identify which application is assigned to a wl_surface and layout the surface wherever the shell wants. ivi_surface objects can be used to receive status of wl_surface in the scenegraph of the compositor. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - Rename error to warning because meaning of error in wayland is fatal. Changes for v3: - Move warning from ivi_application to ivi_surface. - Squash Makefile. - Add description to ivi_surface:destroy. - Update description of ivi_application:surface_create. Changes for v4: - Remove detail description of server side from ivi_surface::destroy - Add clear discripton what client shall do if it encounters warning in ivi_surface ::warning. - Add decription what happens when client tries to tie a wl_surface to multiple ivi_surfaces. Changes for v5: - apply review comments from mailing list Changes for v6: - the same as v5 Changes for v7: - Remove event related to warning according to review of mailing list. protocol/Makefile.am | 3 +- protocol/ivi-application.xml | 70 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 protocol/ivi-application.xml diff --git a/protocol/Makefile.am b/protocol/Makefile.am index 5e331a7..9913f16 100644 --- a/protocol/Makefile.am +++ b/protocol/Makefile.am @@ -8,7 +8,8 @@ protocol_sources = \ text-cursor-position.xml\ wayland-test.xml\ xdg-shell.xml \ - scaler.xml + scaler.xml \ + ivi-application.xml if HAVE_XMLLINT .PHONY: validate diff --git a/protocol/ivi-application.xml b/protocol/ivi-application.xml new file mode 100644 index 000..80ab790 --- /dev/null +++ b/protocol/ivi-application.xml @@ -0,0 +1,70 @@ +?xml version=1.0 encoding=UTF-8? +protocol name=ivi_application + +copyright +Copyright (C) 2013 DENSO CORPORATION +Copyright (c) 2013 BMW Car IT GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +/copyright + +interface name=ivi_surface version=1 +description summary=application interface to surface in ivi compositor/ + +request name=destroy type=destructor +description summary=destroy ivi_surface +This removes link from ivi_id to wl_surface and destroys ivi_surface. +/description +/request + +event name=visibility +description summary=visibility of surface in ivi compositor has changed +The new visibility state is provided in argument visibility. +If visibility is 0, the surface has become invisible. +If visibility is not 0, the surface has become visible. +/description +arg name=visibility type=int/ +/event +/interface + +interface name=ivi_application version=1 +description summary=create ivi-style surfaces + This interface is implemented by servers that provide desktop-style user interfaces. + It allows clients to associate a ivi_surface with a basic surface. + /description + +request name=surface_create +description summary=create ivi_surface with numeric ID in ivi compositor +surface_create will create a interface:ivi_surface with numeric ID; ivi_id in +ivi compositor. These ivi_ids are defined as unique in the system to identify +it inside of ivi compositor. The ivi compositor implements business logic how to +set properties of the surface with ivi_id according to status of the system
[PATCH weston-ivi-shell v7 2/9] ivi-shell: add the shell plugin for In-Vehicle Infotainment system
In-Vehicle Infotainment system traditionally manages surfaces with global identification. A protocol, ivi_application, supports such a feature by implementing a request, ivi_application::surface_creation defined in ivi_application.xml. The ivi-shell explicitly loads ivi-layout.so and a module to add business logic like how to layout surfaces by using ivi-layout APIs. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - apply review comments of mailing list. - squash update of Makefile into this patch. - move this patch after patch of weston-layout. - support inherit propoerties of id_surface when client attaches another wl_surface with id_surface after destroying ivi_surface once. Changes for v3: - squash internal method, configure, to ivi_shell_surface_configure. Changes for v4: - nothing. Version number aligned to the first patch Changes for v5: - rebase weston v1.5 branch - apply review comments from mailing list Changes for v6: - apply bug fixes found in TIZEN IVI and GENIVI - apply review comments from Mailing list - use signed integers except flags, bitfields, object ids. Changes for v7: - Remove sending warnings via protocol according to modification of ivi-application.xml - Notify warnings to ivi-module by using wl_signal/wl_listener. Makefile.am| 22 +++ configure.ac | 12 ++ ivi-shell/ivi-layout.h | 82 ++ ivi-shell/ivi-shell.c | 416 + ivi-shell/ivi-shell.h | 35 + 5 files changed, 567 insertions(+) create mode 100644 ivi-shell/ivi-layout.h create mode 100644 ivi-shell/ivi-shell.c create mode 100644 ivi-shell/ivi-shell.h diff --git a/Makefile.am b/Makefile.am index 343adc6..279fffc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -700,6 +700,28 @@ nodist_fullscreen_shell_la_SOURCES = \ BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES) endif +if ENABLE_IVI_SHELL + +module_LTLIBRARIES += \ + $(ivi_shell) + +ivi_shell = ivi-shell.la +ivi_shell_la_LDFLAGS = -module -avoid-version +ivi_shell_la_LIBADD = $(COMPOSITOR_LIBS) $(IVI_SHELL_LIBS) libshared.la +ivi_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(IVI_SHELL_CFLAGS) +ivi_shell_la_SOURCES = \ + ivi-shell/ivi-shell.h \ + ivi-shell/ivi-shell.c \ + ivi-shell/ivi-layout.h +nodist_ivi_shell_la_SOURCES = \ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-server-protocol.h + +BUILT_SOURCES += $(nodist_ivi_shell_la_SOURCES) + +endif + + if ENABLE_SCREEN_SHARING module_LTLIBRARIES += screen-share.la diff --git a/configure.ac b/configure.ac index 031a26f..23e6ba5 100644 --- a/configure.ac +++ b/configure.ac @@ -433,6 +433,16 @@ if test x$enable_dbus != xno; then fi AM_CONDITIONAL(ENABLE_DBUS, test x$enable_dbus = xyes) +# ivi-shell support +AC_ARG_ENABLE(ivi-shell, + AS_HELP_STRING([--disable-ivi-shell], + [do not build ivi-shell server plugin and client]),, + enable_ivi_shell=yes) +AM_CONDITIONAL(ENABLE_IVI_SHELL, test x$enable_ivi_shell = xyes) +if test x$enable_ivi_shell = xyes; then + PKG_CHECK_MODULES(IVI_SHELL, [cairo]) +fi + AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes) AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes) if test x$enable_wcap_tools = xyes; then @@ -522,6 +532,8 @@ AC_MSG_RESULT([ XWayland${enable_xwayland} dbus${enable_dbus} + ivi-shell ${enable_ivi_shell} + Build wcap utility ${enable_wcap_tools} Build Fullscreen Shell ${enable_fullscreen_shell} diff --git a/ivi-shell/ivi-layout.h b/ivi-shell/ivi-layout.h new file mode 100644 index 000..5d7488a --- /dev/null +++ b/ivi-shell/ivi-layout.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2013 DENSO CORPORATION + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any + * purpose. It is provided as is without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL
Re: [PATCH weston-ivi-shell v5 2/9] The weston-layout library supports
2014-07-07 16:10 に Pekka Paalanen さんは書きました: On Tue, 20 May 2014 13:52:55 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: Hi, I apply review comments as v5 except following comments. + +struct link_layerPropertyNotification { +layerPropertyNotificationFunc callback; +void *userdata; +struct wl_list link; +}; + +struct link_surfacePropertyNotification { +surfacePropertyNotificationFunc callback; +void *userdata; +struct wl_list link; +}; + +struct link_layerCreateNotification { +layerCreateNotificationFunc callback; +void *userdata; +struct wl_list link; +}; + +struct link_layerRemoveNotification { +layerRemoveNotificationFunc callback; +void *userdata; +struct wl_list link; +}; + +struct link_surfaceCreateNotification { +surfaceCreateNotificationFunc callback; +void *userdata; +struct wl_list link; +}; + +struct link_surfaceRemoveNotification { +surfaceRemoveNotificationFunc callback; +void *userdata; +struct wl_list link; +}; + +struct link_surfaceConfigureNotification { +surfaceConfigureNotificationFunc callback; +void *userdata; +struct wl_list link; +}; Any reason you defined all these different structs, and didn't use the wl_signal/wl_listener pattern? I wants callback with some information. I think wl_signal/wl_listener can not give such a information. So I keep this. However if there is an another solution with wl_signal/wl_listener, I promise I would fix this code. Are you saying, that you could not see how to access a userdata pointer if you used wl_signal/wl_listener? Here is an example how it works: http://cgit.freedesktop.org/wayland/weston/tree/src/compositor-drm.c#n2572 The recorder_frame_notify digs the drm_output pointer from the wl_listener, since the wl_listener is embedded in struct drm_output. This is documented at wl_listener: http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-server.h#n132 (Hrm, looks like there is a slight confusion in the example.) So the trick is to use wl_container_of() on the listener pointer to get to your own data. OK, now I see. Thank you for your point! I try to do it. + +struct weston_layout; + +struct weston_layout_surface { +struct wl_list link; For link members, I would personally prefer some indication of which (kind of) list the link will belong to, if possible and especially if there are multiple links in a struct. +struct wl_list list_notification; +struct wl_list list_layer; The Weston convention is to say notification_list, layer_list. I would also add a comment saying what link the list will hold, e.g. ... foo_list; /* struct weston_layout_layer::link */ That explicitly says what the struct embedding the 'link' member is, as one list can only ever contain one type of objects, and explains how to access that object from a link pointer. Hmm... so one surface can be in multiple layers?? Yes. There is a use case to display a surface to several layer. E.g. lane guidance can be shown in a small panel in cluster. Hmm, and you can't use weston_view instead? One weston_surface can have several weston_views, and views are what you put in layers in weston core. Maybe I just don't remember what all is involved. IVI layer can group surfaces. It also has attribute its own viewport like clip region, opacity, orientation and son. Later one can not be realized by weston_view. The code finally use view of each surface by referring order and attribute of surface in a layer and order and attribute of layer. Thank you, ntanibata +uint32_t update_count; +uint32_t id_surface; + +struct weston_layout *layout; +struct weston_surface *surface; +struct weston_view *view; Why have the view pointer explicitly here? Can't you access that via weston_surface? + +uint32_t buffer_width; +uint32_t buffer_height; Would these perhaps happen to be the same as weston_surface::width_from_buffer and weston_surface::height_from_buffer? I promise I will fix it soon. Do you handle at all the case of hotplugging outputs? Does the IVI software architecture simply not support any kind of hotplug? No. there is no use case like hot plug. Okay. Error, or silently ignored? Do you plan to implement this function? There are a lot more similar functions which have the same not supported comment. ... Yes. I will plan to support soon. All these unsigned members seem like they are calling for mismatching signed and unsigned variables in computations, which can lead to surprising bugs. Is there a reason why these coordinate related members (position and size) are unsigned? Weston code base and even Wayland protocol categorically uses signed integers for everything that is computed with, like size which can never be legally negative. Only flags, bitfields, object ids and such are unsigned, because
Re: [PATCH weston-ivi-shell v4 3/9] ivi-shell supports a type of shell for In-Vehicle Infotainment system.
2014-07-07 16:34 に Pekka Paalanen さんは書きました: On Tue, 20 May 2014 14:05:10 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: Hi pq, I applied your comments except for several ones, +struct ivi_shell *shell = wl_resource_get_user_data(resource); +struct ivi_shell_surface *ivisurf = NULL; +struct weston_layout_surface *layout_surface = NULL; +struct weston_surface *es = wl_resource_get_user_data(surface_resource); +struct wl_resource *res; +int32_t warn_idx = -1; + +if (es != NULL) { +layout_surface = weston_layout_surfaceCreate(es, id_surface); +if (layout_surface == NULL) +warn_idx = 1; +} else { +warn_idx = 0; I think this case would be a compositor internal error, not a client error. Userdata of a surface resource should never be NULL. I.e. assert() kind of thing would be more approriate. I expect it would send warning to client. So I implement it like the above. Is there really a way that a client (malfunction) could cause this? I don't think so. Weston core always creates a weston_surface for a wl_surface, and if it ever does not or it disappears, you have a Weston bug or memory corruption. So I really don't think warning the client is a) sufficient, nor b) relevant as the client simply cannot have anything to do with triggering this. There is also nothing the client could do to avoid or remedy it. I believe this fits well on the definition of an internal error. I know you have much higher demands for dealing with internal errors than Weston usually does, so I would suggest using your own assert mechanism, which just gets rid of the client via the wl_display::error event. I think it would simplify your code. Do you think it would work for you? It would also serve a documentary purpose just like the plain assert() does: this condition is not expected to fail, and if it fails, there is a bug in *this* program somewhere, and not in its input (clients). Also, Weston already uses lots of plain asserts all over. Are those not a concern to you? OK, I understand. I will follow the above proposal. And I need to remove event from ivi-application.xml as well. +init_ivi_shell(ec, shell); +weston_layout_initWithCompositor(ec); + +shell-destroy_listener.notify = shell_destroy; +wl_signal_add(ec-destroy_signal, shell-destroy_listener); + +if (wl_global_create(ec-wl_display, ivi_application_interface, 1, + shell, bind_ivi_application) == NULL) { +return -1; +} You are not setting compositor-shell_interface, but OTOH those are only used for Xwayland, which probably doesn't make sense here. I was advised by kritian before it shall not support other shell in ivi-shell at the same time. Sorry? Sure, I understand you do not want/cannot to have any other shell loaded in Weston when ivi-shell is, but this is not about that. This is about compositor-shell_interface, which is a set of vfuncs set by the shell currently loaded. However, these vfuncs are only used by the XWayland support (XWM), and so might not be necessary. It's not a different shell, it is just about XWayland using the current shell. That was just an observation. I don't think you need to change anything here, but if you want, you could add a comment that XWayland is not supported here. That is all. OK I see. I also have use case of xwayland. But it may be next steps. I will follow the above steps. Thank you very much! BR, ntanibata Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston-ivi-shell v5 6/9] A reference implementation of UI client how to use ivi-hmi-controller.
2014-07-07 17:04 に Pekka Paalanen さんは書きました: On Tue, 20 May 2014 19:02:56 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: 2014-04-25 20:55 に Pekka Paalanen さんは書きました: On Thu, 20 Mar 2014 16:00:57 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: This is launched from hmi-controller by using hmi_client_start and create a pthread. The basic flow is as followed, 1/ create pthread 2/ read configuration from weston.ini. 3/ draw png file to surface according to configuration of weston.ini 4/ set up UI by using ivi-hmi-controller protocol 5/ Enter event loop 6/ If a surface receives touch/pointer event, followings are invoked according to type of event and surface 6-1/ If a surface to launch ivi_application receive touch up, it execs ivi-application configured in weston.ini. 6-2/ If a surface to switch layout mode receive touch up, it sends a request, ivi_hmi_controller_switch_mode, to hmi-controller. 6-3/ If a surface to show workspace having launchers, it sends a request, ivi_hmi_controller_home, to hmi-controller. 6-4/ If touch down events happens in workspace, ivi_hmi_controller_workspace_control is sent to slide workspace. When control finished, event: ivi_hmi_controller_workspace_end_control is received. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4: - nothing. Version number aligned to the first patch Changes for v5: - usleep with roundtrip uses CPU. replace them with wl_display_dispatch ivi-shell/Makefile.am |2 + ivi-shell/hmi-controller-homescreen.c | 1369 + ivi-shell/hmi-controller-homescreen.h | 36 + ivi-shell/hmi-controller.c|3 +- 4 files changed, 1409 insertions(+), 1 deletion(-) create mode 100644 ivi-shell/hmi-controller-homescreen.c create mode 100644 ivi-shell/hmi-controller-homescreen.h Would it not be simpler and more robust to make this an independent program like e.g. clients/desktop-shell.c is, rather than running it in a thread in the compositor? I would certainly prefer it to be. We would avoid threads in the compositor, and pulling in client side stuff. Now there is a huge risk you might be calling compositor functions from client code, and a crash in the client code would bring the whole compositor down. If we look at weston-desktop-shell, if it crashes, Weston will respawn it so fast that a user often does not even notice anything happened. ;-) I agree. I apply your comments in v5. it is now process. Before, I implemented it as a thread to reduce overhead of process dispatch. I experienced such a overhead before. However at first, I shall follow wayland current sample like desktop-shell, invoke it as process. If ivi vendor want to it as a thread with the same concerning, it can easily do it by itself. Hmm, would be interesting to hear a bit more about that overhead thing. In your code: - it is a thread, so it will be subject to scheduling anyway - it still uses a normal Wayland connections (wl_display_connect), so it will not skip any of the communication overheads I'm just curious about what overheads you intended to avoid here. Was it library loading at start-up? I can't think of anything else right now. Thanks for comment, pq! My concerning was that process dispatch vs thread dispatch. Threads share their memory space and the dispatch cost might be smaller than process ones. If I can implement IVI clinet in the same process, it can reduce dispatch code compare to process dispatching. BR, ntanibata Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston-ivi-shell v4 5/9] A reference implementation how to use weston-layout library.
2014-07-07 16:58 に Pekka Paalanen さんは書きました: On Tue, 20 May 2014 18:57:46 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: 2014-04-25 20:38 に Pekka Paalanen さんは書きました: On Mon, 17 Mar 2014 15:28:22 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: The library is used to manage layout of surfaces/layers. Layout change is triggered by ivi-hmi-controller protocol, ivi-hmi-controller.xml. A reference how to use the protocol, see hmi-controller-homescreen. In-Vehicle Infotainment system usually manage properties of surfaces/layers by only a central component which decide where surfaces/layers shall be. This reference show examples to implement the central component as a module of weston. Default Scene graph of UI is defined in hmi_controller_create. It consists of - In the bottom, a base layer to group surfaces of background, panel, and buttons - Next, a application layer to show application surfaces. - Workspace background layer to show a surface of background image. - Workspace layer to show launcher to launch application with icons. Paths to binary and icon are defined in weston.ini. The width of this layer is longer than the size of screen because a workspace has several pages and is controlled by motion of input. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4 - nothing. Version number aligned to the first patch ivi-shell/.gitignore |7 + ivi-shell/Makefile.am | 19 +- ivi-shell/hmi-controller.c | 1775 3 files changed, 1799 insertions(+), 2 deletions(-) create mode 100644 ivi-shell/.gitignore create mode 100644 ivi-shell/hmi-controller.c Hi, so this is the hmi-controller. This is the part that IVI vendors will be customizing, is it? Or replacing, actually? Yes. You are right. hmi-controller is just a reference how to use ivi-layout APIs. Each IVI vendors shall customize it or implement the same part from scratch to realize its business logic. The picture in your PDF has both ivi-controller.so and hmi-controller.so, where the ivi-controller.so is exposing the ivi-controller Wayland extension. These will be exclusive, right? Never used at the same time. It depends on vendor use case. If vendor want to use ivi-controller.so for debugging to retrieve properties of surface. it can be used with it. However basically, these will be exclusive. hmi-controller.so exposes the ivi_hmi_controller private Wayland protocol extension, right? So this patch series does not yet have the ivi-controller part at all, and ivi_hmi_controller is just a part of the demo that is hmi-controller et al.? And all that would be replaced by a real IVI thing? Yes. it would be replaced. Oh yeah, you said the ivi-controller stuff is at http://git.projects.genivi.org/?p=wayland-ivi-extension.git;a=summary Okay, I'm actually happy that part is not in this patch series, the protocol extension looks huge. ;-) I'm not going through this patch too carefully, just making some general observations. General observation is fine. There are lots of stuff using the weston-layout API, but I see also a lot stuff using Weston core API like the grab handlers and seat stuff. Since this is the part that vendors replace, would it not be better to have the Weston core related stuff back in ivi-shell.so? Or is the stuff used here such, that a real ivi-controller will not need it? Or is it just a work in progress to establish an abstraction and that part is still to do? It is in progress. however grab handlers and seat stuff can be used as Weston core API is. The motivation of this parts is that, view class is a little difficult for traditional IVI user who implement its UI controll by using layout APIs. So I would like to abstract such a APIs at first. How independent of a particular compositor implementation is the so called weston-layout abstraction supposed to be? Will it evolve into a completely compositor-agnostic API? Compositor is independent from ivi-layout APIs. Because it is implemented by using weston view. If weston view is independent on compositor, e.g. drm or x11. ivi-layout API can works with any compositor. Umm, my question was about Weston vs. gnome-shell vs. KWin vs. ..., not really about weston-on-x11 vs. weston-on-drm vs. weston-on-whatever. Other compositors have none of the weston_* structs, nor anything weston's compositor.h defines. Can the API depend on Weston definitions, or is it going to be compositor-agnostic and work if your compositor happens to be e.g. gnome-shell (if implemented)? Hi pq, I expect weston would be qualified by distribution, e.g. TIZEN IVI. So I prefer concentrating a shell part like ivi-shell to archive ivi use cases based on compositor APIs. BR, ntanibata Thanks, pq
Re: [PATCH weston-ivi-shell v5 7/9] data: add reference image files for weston-ivi-shell-user-interface
Hi Manuel, Thank you! I will resend my patches. BR, Nobuhiko 2014-06-25 18:48 に Manuel Bachmann さんは書きました: Hello Tanibata-San, I think your forget to include the changes to Makefile.am in this series. What is more, as Weston has now a unique Makefile.am in the root directory I modified the patch this way : --- a/Makefile.am +++ b/Makefile.am @@ -638,7 +638,19 @@ dist_westondata_DATA = data/icon_window.png data/sign_close.png data/sign_maximize.png - data/sign_minimize.png + data/sign_minimize.png + data/background.png + data/tiling.png + data/fullscreen.png + data/panel.png + data/random.png + data/sidebyside.png + data/home.png + data/icon_ivi_clickdot.png + data/icon_ivi_flower.png + data/icon_ivi_simple-egl.png + data/icon_ivi_simple-shm.png + data/icon_ivi_smoke.png Hope this helps ! Regards, 2014-05-20 6:35 GMT+02:00 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp: Hi, I removed binary from patch as review comment. Image files can be downloaded from, https://github.com/ntanibata/weston-ivi-shell/tree/weston-ivi-shell-1.4.93-v3/data [1] BR, Nobuhiko 2014-05-20 13:30 に Nobuhiko Tanibata さんは書きました: Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3, v4, and v5: - nothing. Version number aligned to the first patch data/Makefile.am | 14 +- data/background.png | Bin 0 - 245579 bytes data/fullscreen.png | Bin 0 - 3406 bytes data/home.png | Bin 0 - 4629 bytes data/icon_ivi_clickdot.png | Bin 0 - 39523 bytes data/icon_ivi_flower.png | Bin 0 - 24475 bytes data/icon_ivi_simple-egl.png | Bin 0 - 29316 bytes data/icon_ivi_simple-shm.png | Bin 0 - 71120 bytes data/icon_ivi_smoke.png | Bin 0 - 46577 bytes data/panel.png | Bin 0 - 41955 bytes data/random.png | Bin 0 - 4891 bytes data/sidebyside.png | Bin 0 - 3929 bytes data/tiling.png | Bin 0 - 5620 bytes 13 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 data/background.png create mode 100644 data/fullscreen.png create mode 100644 data/home.png create mode 100644 data/icon_ivi_clickdot.png create mode 100644 data/icon_ivi_flower.png create mode 100644 data/icon_ivi_simple-egl.png create mode 100644 data/icon_ivi_simple-shm.png create mode 100644 data/icon_ivi_smoke.png create mode 100644 data/panel.png create mode 100644 data/random.png create mode 100644 data/sidebyside.png create mode 100644 data/tiling.png ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel [2] -- Regards, MANUEL BACHMANN Tizen Project VANNES-FR Links: -- [1] https://github.com/ntanibata/weston-ivi-shell/tree/weston-ivi-shell-1.4.93-v3/data [2] http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v6 1/9] protocol: add interface ivi_application extension
ivi_applicatoin extension creates ivi_surface objects tied to a given wl_surface with a given id. The given id can be used in a shell to identify which application is assigned to a wl_surface and layout the surface wherever the shell wants. ivi_surface objects can be used to receive status of wl_surface in the scenegraph of the compositor. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - Rename error to warning because meaning of error in wayland is fatal. Changes for v3: - Move warning from ivi_application to ivi_surface. - Squash Makefile. - Add description to ivi_surface:destroy. - Update description of ivi_application:surface_create. Changes for v4: - Remove detail description of server side from ivi_surface::destroy - Add clear discripton what client shall do if it encounters warning in ivi_surface ::warning. - Add decription what happens when client tries to tie a wl_surface to multiple ivi_surfaces. Changes for v5: - apply review comments from mailing list Changes for v6: - the same as v5 protocol/Makefile.am | 3 +- protocol/ivi-application.xml | 101 +++ 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 protocol/ivi-application.xml diff --git a/protocol/Makefile.am b/protocol/Makefile.am index 5e331a7..9913f16 100644 --- a/protocol/Makefile.am +++ b/protocol/Makefile.am @@ -8,7 +8,8 @@ protocol_sources = \ text-cursor-position.xml\ wayland-test.xml\ xdg-shell.xml \ - scaler.xml + scaler.xml \ + ivi-application.xml if HAVE_XMLLINT .PHONY: validate diff --git a/protocol/ivi-application.xml b/protocol/ivi-application.xml new file mode 100644 index 000..833fd38 --- /dev/null +++ b/protocol/ivi-application.xml @@ -0,0 +1,101 @@ +?xml version=1.0 encoding=UTF-8? +protocol name=ivi_application + +copyright +Copyright (C) 2013 DENSO CORPORATION +Copyright (c) 2013 BMW Car IT GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +/copyright + +interface name=ivi_surface version=1 +description summary=application interface to surface in ivi compositor/ + +request name=destroy type=destructor +description summary=destroy ivi_surface +This removes link from ivi_id to wl_surface and destroys ivi_surface. +/description +/request + +event name=visibility +description summary=visibility of surface in ivi compositor has changed +The new visibility state is provided in argument visibility. +If visibility is 0, the surface has become invisible. +If visibility is not 0, the surface has become visible. +/description +arg name=visibility type=int/ +/event + +enum name=warning_code +description summary=possible warning codes returned by ivi compositor +These define all possible warning codes returned by ivi compositor on server-side warnings. +invalid_wl_surface: +- wl_surface already has a another role. + - wl_surface is destroyed before the ivi_surface is destroyed. +ivi_id_in_use: ivi_id is already assigned by another application. +/description +entry name=invalid_wl_surface value=1 summary=wl_surface is invalid/ +entry name=ivi_id_in_use value=2 summary=ivi_id is in use and can not be shared/ +/enum + +event name=warning +description summary=server-side warning detected +The ivi compositor encountered warning while processing a request by this +application
[PATCH weston-ivi-shell v6 2/9] ivi-shell: add the shell plugin for In-Vehicle Infotainment system
In-Vehicle Infotainment system traditionally manages surfaces with global identification. A protocol, ivi_application, supports such a feature by implementing a request, ivi_application::surface_creation defined in ivi_application.xml. The ivi-shell explicitly loads ivi-layout.so and a module to add business logic like how to layout surfaces by using ivi-layout APIs. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - apply review comments of mailing list. - squash update of Makefile into this patch. - move this patch after patch of weston-layout. - support inherit propoerties of id_surface when client attaches another wl_surface with id_surface after destroying ivi_surface once. Changes for v3: - squash internal method, configure, to ivi_shell_surface_configure. Changes for v4: - nothing. Version number aligned to the first patch Changes for v5: - rebase weston v1.5 branch - apply review comments from mailing list Changes for v6: - apply bug fixes found in TIZEN IVI and GENIVI - apply review comments from Mailing list - use signed integers except flags, bitfields, object ids. Makefile.am| 22 +++ configure.ac | 12 ++ ivi-shell/ivi-layout.h | 75 + ivi-shell/ivi-shell.c | 413 + ivi-shell/ivi-shell.h | 35 + 5 files changed, 557 insertions(+) create mode 100644 ivi-shell/ivi-layout.h create mode 100644 ivi-shell/ivi-shell.c create mode 100644 ivi-shell/ivi-shell.h diff --git a/Makefile.am b/Makefile.am index 343adc6..279fffc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -700,6 +700,28 @@ nodist_fullscreen_shell_la_SOURCES = \ BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES) endif +if ENABLE_IVI_SHELL + +module_LTLIBRARIES += \ + $(ivi_shell) + +ivi_shell = ivi-shell.la +ivi_shell_la_LDFLAGS = -module -avoid-version +ivi_shell_la_LIBADD = $(COMPOSITOR_LIBS) $(IVI_SHELL_LIBS) libshared.la +ivi_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(IVI_SHELL_CFLAGS) +ivi_shell_la_SOURCES = \ + ivi-shell/ivi-shell.h \ + ivi-shell/ivi-shell.c \ + ivi-shell/ivi-layout.h +nodist_ivi_shell_la_SOURCES = \ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-server-protocol.h + +BUILT_SOURCES += $(nodist_ivi_shell_la_SOURCES) + +endif + + if ENABLE_SCREEN_SHARING module_LTLIBRARIES += screen-share.la diff --git a/configure.ac b/configure.ac index 031a26f..23e6ba5 100644 --- a/configure.ac +++ b/configure.ac @@ -433,6 +433,16 @@ if test x$enable_dbus != xno; then fi AM_CONDITIONAL(ENABLE_DBUS, test x$enable_dbus = xyes) +# ivi-shell support +AC_ARG_ENABLE(ivi-shell, + AS_HELP_STRING([--disable-ivi-shell], + [do not build ivi-shell server plugin and client]),, + enable_ivi_shell=yes) +AM_CONDITIONAL(ENABLE_IVI_SHELL, test x$enable_ivi_shell = xyes) +if test x$enable_ivi_shell = xyes; then + PKG_CHECK_MODULES(IVI_SHELL, [cairo]) +fi + AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes) AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes) if test x$enable_wcap_tools = xyes; then @@ -522,6 +532,8 @@ AC_MSG_RESULT([ XWayland${enable_xwayland} dbus${enable_dbus} + ivi-shell ${enable_ivi_shell} + Build wcap utility ${enable_wcap_tools} Build Fullscreen Shell ${enable_fullscreen_shell} diff --git a/ivi-shell/ivi-layout.h b/ivi-shell/ivi-layout.h new file mode 100644 index 000..2027d89 --- /dev/null +++ b/ivi-shell/ivi-layout.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2013 DENSO CORPORATION + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any + * purpose. It is provided as is without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER
[PATCH weston-ivi-shell v6 4/9] protocol: ivi hmi controller protocol to set up IVI style UI
This protocol realizes following features, - UI ready - changing modes; tiling, side by side, full_screen, and random - Give control a surface; workspace to be controlled by using ivi layout APIs - Display/undisplay a surface; home contains sevaral workspaces to launch application Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4 - nothing. Version number aligned to the first patch Changes for v5: - rebase weston v1.5 branch - apply review comments from mailing list Changes for v6: - the same as v5 protocol/Makefile.am| 3 +- protocol/ivi-hmi-controller.xml | 96 + 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 protocol/ivi-hmi-controller.xml diff --git a/protocol/Makefile.am b/protocol/Makefile.am index 9913f16..140aef5 100644 --- a/protocol/Makefile.am +++ b/protocol/Makefile.am @@ -9,7 +9,8 @@ protocol_sources = \ wayland-test.xml\ xdg-shell.xml \ scaler.xml \ - ivi-application.xml + ivi-application.xml \ + ivi-hmi-controller.xml if HAVE_XMLLINT .PHONY: validate diff --git a/protocol/ivi-hmi-controller.xml b/protocol/ivi-hmi-controller.xml new file mode 100644 index 000..fd5ce2b --- /dev/null +++ b/protocol/ivi-hmi-controller.xml @@ -0,0 +1,96 @@ +?xml version=1.0 encoding=UTF-8? +protocol name=ivi_hmi_controller + +copyright +Copyright (C) 2013 DENSO CORPORATION + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +/copyright + +interface name=ivi_hmi_controller version=1 +description summary=set up and control IVI style UI/ + +request name=UI_ready +description summary=inform the ready for drawing desktop. / +/request + +request name=workspace_control +description summary=start controlling a surface by server +Reference protocol to control a surface by server. +To control a surface by server, it gives seat to the server + to e.g. control Home screen. Home screen has several workspaces + to group launchers of wayland application. These workspaces + are drawn on a horizontally long surface to be controlled + by motion of input device. E.g. A motion from right to left + happens, the viewport of surface is controlled in the ivi-shell + by using ivi-layout. client can recognizes the end of controlling + by event workspace_end_control. +/description +arg name=seat type=object interface=wl_seat/ +arg name=serial type=uint/ +/request + +enum name=layout_mode +entry name=tiling value=0/ +entry name=side_by_side value=1/ +entry name=full_screen value=2/ +entry name=random value=3 / +/enum + +request name=switch_mode +description summary=request mode switch of application layout + hmi-controller loaded to ivi-shall implements 4 types of layout + as a reference; tiling, side by side, full_screen, and random. + /description +arg name=layout_mode type=uint/ +/request + +enum name=home +entry name=off value=0/ +entry name=on value=1/ +/enum + +request name=home +description summary=request displaying/undisplaying home screen + home screen is a reference implementation of launcher to launch + wayland applications. The home screen has several workspaces to + group wayland applications. By defining the following keys in + weston.ini, user
[PATCH weston-ivi-shell v6 6/9] clients: a reference implementation of UI client how to use ivi-hmi-controller.
This is launched from hmi-controller by launch_hmi_client_process and invoke a client process. The basic flow is as followed, 1/ process invoked 2/ read configuration from weston.ini. 3/ draw png file to surface according to configuration of weston.ini 4/ all parts of UI are ready. request UI_ready to draw UI. 5/ Enter event loop 6/ If a surface receives touch/pointer event, followings are invoked according to type of event and surface 6-1/ If a surface to launch ivi_application receive touch up, it execs ivi-application configured in weston.ini. 6-2/ If a surface to switch layout mode receive touch up, it sends a request, ivi_hmi_controller_switch_mode, to hmi-controller. 6-3/ If a surface to show workspace having launchers, it sends a request, ivi_hmi_controller_home, to hmi-controller. 6-4/ If touch down events happens in workspace, ivi_hmi_controller_workspace_control is sent to slide workspace. When control finished, event: ivi_hmi_controller_workspace_end_control is received. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp data: add reference image files for weston-ivi-shell-user-interface Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4 - nothing. Version number aligned to the first patch Changes for v5: - rebase weston v1.5 branch - apply review comments from mailing list Changes for v6: - apply review comments from mailing list - disable compling ivi-shell-user-interface with --disable-ivi-shell - add protocol/ivi-application-protocol.c Makefile.am| 15 + clients/ivi-shell-user-interface.c | 1332 ivi-shell/hmi-controller.c | 41 +- 3 files changed, 1385 insertions(+), 3 deletions(-) create mode 100644 clients/ivi-shell-user-interface.c diff --git a/Makefile.am b/Makefile.am index 1f75cc3..64bdf6d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -361,6 +361,11 @@ libexec_PROGRAMS +=\ weston-keyboard \ weston-simple-im +if ENABLE_IVI_SHELL +libexec_PROGRAMS +=\ + weston-ivi-shell-user-interface +endif + demo_clients = \ weston-flower \ weston-image\ @@ -570,6 +575,16 @@ nodist_weston_desktop_shell_SOURCES = \ weston_desktop_shell_LDADD = libtoytoolkit.la weston_desktop_shell_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) +if ENABLE_IVI_SHELL +weston_ivi_shell_user_interface_SOURCES = clients/ivi-shell-user-interface.c +nodist_weston_ivi_shell_user_interface_SOURCES = \ + protocol/ivi-hmi-controller-client-protocol.h \ + protocol/ivi-hmi-controller-protocol.c \ +protocol/ivi-application-protocol.c +weston_ivi_shell_user_interface_LDADD = libtoytoolkit.la +weston_ivi_shell_user_interface_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) +endif + if BUILD_FULL_GL_CLIENTS demo_clients += weston-gears weston_gears_SOURCES = clients/gears.c diff --git a/clients/ivi-shell-user-interface.c b/clients/ivi-shell-user-interface.c new file mode 100644 index 000..70b854b --- /dev/null +++ b/clients/ivi-shell-user-interface.c @@ -0,0 +1,1332 @@ +/* + * Copyright (C) 2013 DENSO CORPORATION + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any + * purpose. It is provided as is without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include sys/wait.h +#include unistd.h +#include stdlib.h +#include stdio.h +#include string.h +#include linux/input.h +#include assert.h +#include fcntl.h +#include signal.h +#include sys/mman.h +#include getopt.h +#include pthread.h +#include wayland-cursor.h +#include ../shared/cairo-util.h +#include ../shared/config-parser.h +#include
[PATCH weston-ivi-shell v6 7/9] data: add reference image files for weston-ivi-shell-user-interface
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3, v4, and v5: - nothing. Version number aligned to the first patch Changes for v6: - apply review comment from mailing list; Makefile.am. Makefile.am | 14 +- data/Makefile.am | 14 +- data/background.png | Bin 0 - 245579 bytes data/fullscreen.png | Bin 0 - 3406 bytes data/home.png| Bin 0 - 4629 bytes data/icon_ivi_clickdot.png | Bin 0 - 39523 bytes data/icon_ivi_flower.png | Bin 0 - 24475 bytes data/icon_ivi_simple-egl.png | Bin 0 - 29316 bytes data/icon_ivi_simple-shm.png | Bin 0 - 71120 bytes data/icon_ivi_smoke.png | Bin 0 - 46577 bytes data/panel.png | Bin 0 - 41955 bytes data/random.png | Bin 0 - 4891 bytes data/sidebyside.png | Bin 0 - 3929 bytes data/tiling.png | Bin 0 - 5620 bytes 14 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 data/background.png create mode 100644 data/fullscreen.png create mode 100644 data/home.png create mode 100644 data/icon_ivi_clickdot.png create mode 100644 data/icon_ivi_flower.png create mode 100644 data/icon_ivi_simple-egl.png create mode 100644 data/icon_ivi_simple-shm.png create mode 100644 data/icon_ivi_smoke.png create mode 100644 data/panel.png create mode 100644 data/random.png create mode 100644 data/sidebyside.png create mode 100644 data/tiling.png diff --git a/Makefile.am b/Makefile.am index 64bdf6d..4c28200 100644 --- a/Makefile.am +++ b/Makefile.am @@ -644,7 +644,19 @@ dist_westondata_DATA = \ data/icon_window.png\ data/sign_close.png \ data/sign_maximize.png \ - data/sign_minimize.png + data/sign_minimize.png \ + data/background.png \ + data/tiling.png \ + data/fullscreen.png \ + data/panel.png \ + data/random.png \ + data/sidebyside.png \ + data/home.png \ + data/icon_ivi_clickdot.png \ + data/icon_ivi_flower.png\ + data/icon_ivi_simple-egl.png\ + data/icon_ivi_simple-shm.png\ + data/icon_ivi_smoke.png if BUILD_WCAP_TOOLS diff --git a/data/Makefile.am b/data/Makefile.am index a7cc944..2aa6e5c 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -9,7 +9,19 @@ dist_westondata_DATA = \ icon_window.png \ sign_close.png \ sign_maximize.png \ - sign_minimize.png + sign_minimize.png \ + background.png \ + tiling.png \ + fullscreen.png \ + panel.png \ + random.png \ + sidebyside.png \ + home.png\ + icon_ivi_clickdot.png \ + icon_ivi_flower.png \ + icon_ivi_simple-egl.png \ + icon_ivi_simple-shm.png \ + icon_ivi_smoke.png if HAVE_RSVG_CONVERT wayland_icon_png = wayland.png -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v6 8/9] ivi-shell: a reference of weston.ini for ivi-shell and ivi-hmi-controller.
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4: - nothing. Version number aligned to the first patch Changes for v5: - rebase weston v1.5 branch Changes for v6: - the same as v5 Makefile.am | 13 +-- ivi-shell/weston.ini.in | 91 + 2 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 ivi-shell/weston.ini.in diff --git a/Makefile.am b/Makefile.am index 4c28200..fe0c115 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ BUILT_SOURCES = DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install -EXTRA_DIST = weston.ini.in +EXTRA_DIST = weston.ini.in ivi-shell/weston.ini.in weston.ini : $(srcdir)/weston.ini.in $(AM_V_GEN)$(SED) \ @@ -17,7 +17,14 @@ weston.ini : $(srcdir)/weston.ini.in -e 's|@libexecdir[@]|$(libexecdir)|g' \ $ $@ -all-local : weston.ini +ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in + $(AM_V_GEN)$(SED) \ + -e 's|@bindir[@]|$(bindir)|g' \ + -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ + -e 's|@libexecdir[@]|$(libexecdir)|g' \ + $ $@ + +all-local : weston.ini ivi-shell/weston.ini AM_CFLAGS = $(GCC_CFLAGS) @@ -33,7 +40,7 @@ AM_CPPFLAGS = \ -DLIBEXECDIR='$(libexecdir)' \ -DBINDIR='$(bindir)' -CLEANFILES = weston.ini $(BUILT_SOURCES) +CLEANFILES = weston.ini ivi-shell/weston.ini $(BUILT_SOURCES) bin_PROGRAMS += weston diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in new file mode 100644 index 000..3c9fb6a --- /dev/null +++ b/ivi-shell/weston.ini.in @@ -0,0 +1,91 @@ +[core] +shell=ivi-shell.so + +[ivi-shell] +ivi-module=hmi-controller.so +ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface + +cursor-theme=default +cursor-size=32 + +base-layer-id=1000 +workspace-background-layer-id=2000 +workspace-layer-id=3000 +application-layer-id=4000 + +background-image=@abs_top_builddir@/data/background.png +background-id=1001 +panel-image=@abs_top_builddir@/data/panel.png +panel-id=1002 +tiling-image=@abs_top_builddir@/data/tiling.png +tiling-id=1003 +sidebyside-image=@abs_top_builddir@/data/sidebyside.png +sidebyside-id=1004 +fullscreen-image=@abs_top_builddir@/data/fullscreen.png +fullscreen-id=1005 +random-image=@abs_top_builddir@/data/random.png +random-id=1006 +home-image=@abs_top_builddir@/data/home.png +home-id=1007 +workspace-background-color=0x9900 +workspace-background-id=2001 + +[ivi-launcher] +workspace-id=0 +icon-id=4001 +icon=@abs_top_builddir@/data/icon_ivi_flower.png +path=@abs_top_builddir@/clients/weston-flower + +[ivi-launcher] +workspace-id=0 +icon-id=4002 +icon=@abs_top_builddir@/data/icon_ivi_clickdot.png +path=@abs_top_builddir@/clients/weston-clickdot + +[ivi-launcher] +workspace-id=1 +icon-id=4003 +icon=@abs_top_builddir@/data/icon_ivi_simple-egl.png +path=@abs_top_builddir@/clients/weston-simple-egl + +[ivi-launcher] +workspace-id=1 +icon-id=4004 +icon=@abs_top_builddir@/data/icon_ivi_simple-shm.png +path=@abs_top_builddir@/clients/weston-simple-shm + +[ivi-launcher] +workspace-id=2 +icon-id=4005 +icon=@abs_top_builddir@/data/icon_ivi_smoke.png +path=@abs_top_builddir@/clients/weston-smoke + +[ivi-launcher] +workspace-id=3 +icon-id=4006 +icon=@abs_top_builddir@/data/icon_ivi_flower.png +path=@abs_top_builddir@/clients/weston-flower + +[ivi-launcher] +workspace-id=3 +icon-id=4007 +icon=@abs_top_builddir@/data/icon_ivi_clickdot.png +path=@abs_top_builddir@/clients/weston-clickdot + +[ivi-launcher] +workspace-id=3 +icon-id=4008 +icon=@abs_top_builddir@/data/icon_ivi_simple-egl.png +path=@abs_top_builddir@/clients/weston-simple-egl + +[ivi-launcher] +workspace-id=3 +icon-id=4009 +icon=@abs_top_builddir@/data/icon_ivi_simple-shm.png +path=@abs_top_builddir@/clients/weston-simple-shm + +[ivi-launcher] +workspace-id=3 +icon-id=4010 +icon=@abs_top_builddir@/data/icon_ivi_smoke.png +path=@abs_top_builddir@/clients/weston-smoke -- 1.8.3.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v6 9/9] clients: modify example clients to support ivi-application.xml
Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2, v3 and v4: - nothing. Version number aligned to the first patch Changes for v5: - rebase weston v1.5 branch - remove Macros to enable ivi-application Changes for v6: - the same as v5 Makefile.am | 12 ++-- clients/simple-egl.c | 70 +++ clients/simple-shm.c | 34 - clients/window.c | 84 ++-- 4 files changed, 161 insertions(+), 39 deletions(-) diff --git a/Makefile.am b/Makefile.am index fe0c115..e2f1642 100644 --- a/Makefile.am +++ b/Makefile.am @@ -406,7 +406,9 @@ nodist_weston_simple_shm_SOURCES = \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h\ protocol/fullscreen-shell-protocol.c\ - protocol/fullscreen-shell-client-protocol.h + protocol/fullscreen-shell-client-protocol.h \ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-client-protocol.h weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la @@ -424,7 +426,9 @@ demo_clients += weston-simple-egl weston_simple_egl_SOURCES = clients/simple-egl.c nodist_weston_simple_egl_SOURCES = \ protocol/xdg-shell-protocol.c \ - protocol/xdg-shell-client-protocol.h + protocol/xdg-shell-client-protocol.h\ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-client-protocol.h weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS) weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm endif @@ -443,7 +447,9 @@ nodist_libtoytoolkit_la_SOURCES = \ protocol/workspaces-protocol.c \ protocol/workspaces-client-protocol.h \ protocol/xdg-shell-protocol.c \ - protocol/xdg-shell-client-protocol.h + protocol/xdg-shell-client-protocol.h\ + protocol/ivi-application-protocol.c \ + protocol/ivi-application-client-protocol.h BUILT_SOURCES += $(nodist_libtoytoolkit_la_SOURCES) diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 0d4673b..92f2dc2 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -41,6 +41,10 @@ #include EGL/eglext.h #include xdg-shell-client-protocol.h +#include sys/types.h +#include unistd.h +#include protocol/ivi-application-client-protocol.h +#define IVI_SURFACE_ID 9000 #ifndef EGL_EXT_swap_buffers_with_damage #define EGL_EXT_swap_buffers_with_damage 1 @@ -74,6 +78,7 @@ struct display { EGLConfig conf; } egl; struct window *window; + struct ivi_application *ivi_application; PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage; }; @@ -95,6 +100,7 @@ struct window { struct wl_egl_window *native; struct wl_surface *surface; struct xdg_surface *xdg_surface; + struct ivi_surface *ivi_surface; EGLSurface egl_surface; struct wl_callback *callback; int fullscreen, opaque, buffer_size, frame_sync; @@ -254,7 +260,7 @@ init_gl(struct window *window) } glUseProgram(program); - + window-gl.pos = 0; window-gl.col = 1; @@ -333,13 +339,8 @@ create_surface(struct window *window) { struct display *display = window-display; EGLBoolean ret; - - window-surface = wl_compositor_create_surface(display-compositor); - window-xdg_surface = xdg_shell_get_xdg_surface(display-shell, - window-surface); - xdg_surface_add_listener(window-xdg_surface, -xdg_surface_listener, window); + window-surface = wl_compositor_create_surface(display-compositor); window-native = wl_egl_window_create(window-surface, @@ -350,7 +351,28 @@ create_surface(struct window *window) display-egl.conf, window-native, NULL); - xdg_surface_set_title(window-xdg_surface, simple-egl); + if (display-shell) { + window-xdg_surface = xdg_shell_get_xdg_surface(display-shell, + window-surface); + + xdg_surface_add_listener(window-xdg_surface, +xdg_surface_listener, window); + + xdg_surface_set_title(window-xdg_surface, simple-egl); + } else if (display-ivi_application ) { + uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); + window-ivi_surface = + ivi_application_surface_create(display-ivi_application
Re: [PATCH weston-ivi-shell v4 5/9] A reference implementation how to use weston-layout library.
2014-04-25 20:38 に Pekka Paalanen さんは書きました: On Mon, 17 Mar 2014 15:28:22 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: The library is used to manage layout of surfaces/layers. Layout change is triggered by ivi-hmi-controller protocol, ivi-hmi-controller.xml. A reference how to use the protocol, see hmi-controller-homescreen. In-Vehicle Infotainment system usually manage properties of surfaces/layers by only a central component which decide where surfaces/layers shall be. This reference show examples to implement the central component as a module of weston. Default Scene graph of UI is defined in hmi_controller_create. It consists of - In the bottom, a base layer to group surfaces of background, panel, and buttons - Next, a application layer to show application surfaces. - Workspace background layer to show a surface of background image. - Workspace layer to show launcher to launch application with icons. Paths to binary and icon are defined in weston.ini. The width of this layer is longer than the size of screen because a workspace has several pages and is controlled by motion of input. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4 - nothing. Version number aligned to the first patch ivi-shell/.gitignore |7 + ivi-shell/Makefile.am | 19 +- ivi-shell/hmi-controller.c | 1775 3 files changed, 1799 insertions(+), 2 deletions(-) create mode 100644 ivi-shell/.gitignore create mode 100644 ivi-shell/hmi-controller.c Hi, so this is the hmi-controller. This is the part that IVI vendors will be customizing, is it? Or replacing, actually? Yes. You are right. hmi-controller is just a reference how to use ivi-layout APIs. Each IVI vendors shall customize it or implement the same part from scratch to realize its business logic. The picture in your PDF has both ivi-controller.so and hmi-controller.so, where the ivi-controller.so is exposing the ivi-controller Wayland extension. These will be exclusive, right? Never used at the same time. It depends on vendor use case. If vendor want to use ivi-controller.so for debugging to retrieve properties of surface. it can be used with it. However basically, these will be exclusive. hmi-controller.so exposes the ivi_hmi_controller private Wayland protocol extension, right? So this patch series does not yet have the ivi-controller part at all, and ivi_hmi_controller is just a part of the demo that is hmi-controller et al.? And all that would be replaced by a real IVI thing? Yes. it would be replaced. Oh yeah, you said the ivi-controller stuff is at http://git.projects.genivi.org/?p=wayland-ivi-extension.git;a=summary Okay, I'm actually happy that part is not in this patch series, the protocol extension looks huge. ;-) I'm not going through this patch too carefully, just making some general observations. General observation is fine. There are lots of stuff using the weston-layout API, but I see also a lot stuff using Weston core API like the grab handlers and seat stuff. Since this is the part that vendors replace, would it not be better to have the Weston core related stuff back in ivi-shell.so? Or is the stuff used here such, that a real ivi-controller will not need it? Or is it just a work in progress to establish an abstraction and that part is still to do? It is in progress. however grab handlers and seat stuff can be used as Weston core API is. The motivation of this parts is that, view class is a little difficult for traditional IVI user who implement its UI controll by using layout APIs. So I would like to abstract such a APIs at first. How independent of a particular compositor implementation is the so called weston-layout abstraction supposed to be? Will it evolve into a completely compositor-agnostic API? Compositor is independent from ivi-layout APIs. Because it is implemented by using weston view. If weston view is independent on compositor, e.g. drm or x11. ivi-layout API can works with any compositor. I am just trying to understand what exactly the API surface is, that external modules like ivi-controller.so will be using. Are they allowed to use Weston core API, ivi-shell.so exported API, only weston-layout API? I said it before, that I think you should pay attention to proper versioning of the weston-layout API, or tie that to Weston core versioning. Again, I would suggest: - document what APIs the external modules can use - write a header for the API that ivi-shell.so will export for the external modules; this would replace the weston-layout.h and be smaller Thank you for comments. I prepare ivi-layout-export.h with description per API in v5. - let ivi-shell.so export the above mentioned API, so you get rid of the library interfaces between libweston-layout and ivi-shell; just merge the code
Re: [PATCH weston-ivi-shell v5 6/9] A reference implementation of UI client how to use ivi-hmi-controller.
2014-04-25 20:55 に Pekka Paalanen さんは書きました: On Thu, 20 Mar 2014 16:00:57 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: This is launched from hmi-controller by using hmi_client_start and create a pthread. The basic flow is as followed, 1/ create pthread 2/ read configuration from weston.ini. 3/ draw png file to surface according to configuration of weston.ini 4/ set up UI by using ivi-hmi-controller protocol 5/ Enter event loop 6/ If a surface receives touch/pointer event, followings are invoked according to type of event and surface 6-1/ If a surface to launch ivi_application receive touch up, it execs ivi-application configured in weston.ini. 6-2/ If a surface to switch layout mode receive touch up, it sends a request, ivi_hmi_controller_switch_mode, to hmi-controller. 6-3/ If a surface to show workspace having launchers, it sends a request, ivi_hmi_controller_home, to hmi-controller. 6-4/ If touch down events happens in workspace, ivi_hmi_controller_workspace_control is sent to slide workspace. When control finished, event: ivi_hmi_controller_workspace_end_control is received. Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4: - nothing. Version number aligned to the first patch Changes for v5: - usleep with roundtrip uses CPU. replace them with wl_display_dispatch ivi-shell/Makefile.am |2 + ivi-shell/hmi-controller-homescreen.c | 1369 + ivi-shell/hmi-controller-homescreen.h | 36 + ivi-shell/hmi-controller.c|3 +- 4 files changed, 1409 insertions(+), 1 deletion(-) create mode 100644 ivi-shell/hmi-controller-homescreen.c create mode 100644 ivi-shell/hmi-controller-homescreen.h Would it not be simpler and more robust to make this an independent program like e.g. clients/desktop-shell.c is, rather than running it in a thread in the compositor? I would certainly prefer it to be. We would avoid threads in the compositor, and pulling in client side stuff. Now there is a huge risk you might be calling compositor functions from client code, and a crash in the client code would bring the whole compositor down. If we look at weston-desktop-shell, if it crashes, Weston will respawn it so fast that a user often does not even notice anything happened. ;-) I agree. I apply your comments in v5. it is now process. Before, I implemented it as a thread to reduce overhead of process dispatch. I experienced such a overhead before. However at first, I shall follow wayland current sample like desktop-shell, invoke it as process. If ivi vendor want to it as a thread with the same concerning, it can easily do it by itself. BR, Nobohiko And when you attach gdb, it won't stop also the compositor. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston-ivi-shell v4 8/9] Add a reference of weston.ini for ivi-shell and ivi-hmi-controller.
2014-04-25 19:41 に Pekka Paalanen さんは書きました: On Mon, 17 Mar 2014 15:31:09 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2: - squash Makefile to this patch Changes for v3 and v4 - nothing. Version number aligned to the first patch ivi-shell/Makefile.am | 12 ivi-shell/weston.ini.in | 79 + 2 files changed, 91 insertions(+) create mode 100644 ivi-shell/weston.ini.in diff --git a/ivi-shell/Makefile.am b/ivi-shell/Makefile.am index afaa5e3..333abb7 100644 --- a/ivi-shell/Makefile.am +++ b/ivi-shell/Makefile.am @@ -67,3 +67,15 @@ CLEANFILES = $(BUILT_SOURCES) wayland_protocoldir = $(top_srcdir)/protocol include $(top_srcdir)/wayland-scanner.mk + + +weston.ini : $(srcdir)/weston.ini.in + $(AM_V_GEN)$(SED) \ + -e 's|@bindir[@]|$(bindir)|g' \ + -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ + -e 's|@libexecdir[@]|$(libexecdir)|g' \ + $ $@ + +all-local : weston.ini + +CLEANFILES += weston.ini diff --git a/ivi-shell/weston.ini.in b/ivi-shell/weston.ini.in new file mode 100644 index 000..c9a6861 --- /dev/null +++ b/ivi-shell/weston.ini.in @@ -0,0 +1,79 @@ +[core] +shell=ivi-shell.so +modules=hmi-controller.so Ooh, I see, this is how you get hmi-controller.so loaded. Since both ivi-shell.so and hmi-controller.so both link to libweston-layout.la at build time and both are dlopen'd at runtime, what guarantees that both use the same instance of the global 'ivilayout' defined in weston-layout.c? My knowledge of runtime dynamic linking is a bit weak, but personally I'd just avoid that global there. It is a bit much of magic. AFAICS, you might be implicitly depending on the loading order of ivi-shell.so first, hmi-controller.so next. Weston does do it that way, but I'd hope the dependency was more obvious than both secretly using the same global in a yet third library. What happens, if hmi-controller.so is loaded, but shell is not ivi-shell.so? What happens, if ivi-shell.so is the shell, but hmi-controller.so is not loaded? Would it be better if ivi-shell.so loaded the whatever hmi-controller plugin that is appropriate? weston_load_module() is exported, and that would make the dependency explicit, allowing you to nicely exit weston with an error if something doesn't load right. Thank you for comments. I modified module_init of ivi-shell to explicitly load hmi-controller.so which depends on ivi-layout.so. hmi-controller.so is specified by key: ivi-module in weston.ini to avoid your concerning. BR, Nobouhiko After all, hmi-controller.so seems like a plugin to ivi-shell than anything else. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston-ivi-shell v5 9/9] Modify example clients to support ivi-application.xml
2014-04-25 21:43 に Pekka Paalanen さんは書きました: On Tue, 18 Mar 2014 23:57:32 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: Signed-off-by: Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp --- Changes for v2, v3 and v4 - nothing. Version number aligned to the first patch Changes for v5 - support weston-dnd-ivi to verify wl_pointer::set_cursor and wl_data_device::start_drag clients/.gitignore | 6 + clients/Makefile.am | 72 clients/simple-egl.c | 70 ++ clients/simple-shm.c | 53 +- clients/window.c | 45 ++-- 5 files changed, 228 insertions(+), 18 deletions(-) I don't like the #ifdeffery, but any other solution to achieve the same would probably copy a lot of code. There is also the controversial Hi pq, I remove #ifdeffery. I support them by the same way like fullscreen-shell. BR, Nobuhiko question of keeping the simple clients simple while still being useful. If they don't support ivi-shell, they won't be useful on ivi-shell environment. But I suppose we have kind of crossed that line already. What I wonder is, if it would be better to just add ivi-shell support to these two simple clients and toytoolkit as a first class feature. Not by #ifdeffing and compiling another set of executables, but by having the support always built in, and detect the shell at runtime. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston-ivi-shell v5 0/9] a reference shell for In-Vehicle Infotainment system
2014-04-26 01:05 に Pekka Paalanen さんは書きました: On Fri, 25 Apr 2014 22:34:27 +0900 Nobuhiko Tanibata nobuhiko_tanib...@xddp.denso.co.jp wrote: 2014-04-23 19:40 に Pekka Paalanen さんは書きました: This is looking good, mostly just some details in the wording to be tuned. :-) I will see if I can review more of the patches, but I would also suggest the following, in case you are still interested in pushing this upstream. Wait for Weston 1.5 to be released. We are currently in freeze, so there is no point in re-sending until that is done. Check that the 1.5 stable branch has been created, or at least the release has been made, before you rebase and re-send this series. Hi pq, Yes, I am still interested in pushing them. I will rabase them and re-send them after weston 1.5 branch has been created. I am also confirming your comments for other patches as well. Btw, do you have a date when the branch is made? Hi, good to hear. :-) I don't know of a date, but I suppose early May, perhaps. Hi, I am re-sending them which are re-based based on Weston 1.5. Additionally, I applied review comments from pq. Thank you for many comments. They are very use full for me! BR, Nobuhiko Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel