1 index 84db2c97..e797e4f9 100644
2 --- a/ivi-shell/ivi-shell.c
3 +++ b/ivi-shell/ivi-shell.c
4 @@ -489,6 +489,162 @@ shell_add_bindings(struct weston_compositor *compositor,
13 +desktop_surface_ping_timeout(struct weston_desktop_client *client,
16 + weston_log("ivi-shell: desktop_surface_ping_timeout is not supported\n");
20 +desktop_surface_pong(struct weston_desktop_client *client,
23 + weston_log("ivi-shell: desktop_surface_pong is not supported\n");
27 +desktop_surface_added(struct weston_desktop_surface *surface,
30 + struct ivi_shell *shell = (struct ivi_shell *) user_data;
31 + struct ivi_layout_surface *layout_surface;
32 + struct ivi_shell_surface *ivisurf;
33 + struct weston_surface *weston_surf =
34 + weston_desktop_surface_get_surface(surface);
36 + layout_surface = ivi_layout_desktop_surface_create(weston_surf,
38 + if (!layout_surface) {
42 + layout_surface->weston_desktop_surface = surface;
44 + ivisurf = zalloc(sizeof *ivisurf);
49 + ivisurf->shell = shell;
50 + ivisurf->id_surface = IVI_INVALID_ID;
53 + ivisurf->height = 0;
54 + ivisurf->layout_surface = layout_surface;
55 + ivisurf->surface = weston_surf;
57 + weston_desktop_surface_set_user_data(surface, ivisurf);
61 +desktop_surface_removed(struct weston_desktop_surface *surface,
64 + struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *)
65 + weston_desktop_surface_get_user_data(surface);
67 + assert(ivisurf != NULL);
69 + if (ivisurf->layout_surface)
70 + layout_surface_cleanup(ivisurf);
74 +desktop_surface_committed(struct weston_desktop_surface *surface,
75 + int32_t sx, int32_t sy, void *user_data)
77 + struct ivi_shell_surface *ivisurf = (struct ivi_shell_surface *)
78 + weston_desktop_surface_get_user_data(surface);
79 + struct weston_surface *weston_surf =
80 + weston_desktop_surface_get_surface(surface);
85 + if (weston_surf->width == 0 || weston_surf->height == 0)
88 + if (ivisurf->width != weston_surf->width ||
89 + ivisurf->height != weston_surf->height) {
90 + ivisurf->width = weston_surf->width;
91 + ivisurf->height = weston_surf->height;
93 + ivi_layout_desktop_surface_configure(ivisurf->layout_surface,
95 + weston_surf->height);
100 +desktop_surface_move(struct weston_desktop_surface *surface,
101 + struct weston_seat *seat, uint32_t serial, void *user_data)
103 + weston_log("ivi-shell: desktop_surface_move is not supported\n");
107 +desktop_surface_resize(struct weston_desktop_surface *surface,
108 + struct weston_seat *seat, uint32_t serial,
109 + enum weston_desktop_surface_edge edges, void *user_data)
111 + weston_log("ivi-shell: desktop_surface_resize is not supported\n");
115 +desktop_surface_fullscreen_requested(struct weston_desktop_surface *surface,
117 + struct weston_output *output,
120 + weston_log("ivi-shell: desktop_surface_fullscreen_requested is not supported\n");
124 +desktop_surface_maximized_requested(struct weston_desktop_surface *surface,
125 + bool maximized, void *user_data)
127 + weston_log("ivi-shell: desktop_surface_maximized_requested is not supported\n");
131 +desktop_surface_minimized_requested(struct weston_desktop_surface *surface,
134 + weston_log("ivi-shell: desktop_surface_minimized_requested is not supported\n");
138 +desktop_surface_set_xwayland_position(struct weston_desktop_surface *surface,
139 + int32_t x, int32_t y, void *user_data)
141 + weston_log("ivi-shell: desktop_surface_set_xwayland_position is not supported\n");
144 +static const struct weston_desktop_api shell_desktop_api = {
145 + .struct_size = sizeof(struct weston_desktop_api),
146 + .ping_timeout = desktop_surface_ping_timeout,
147 + .pong = desktop_surface_pong,
148 + .surface_added = desktop_surface_added,
149 + .surface_removed = desktop_surface_removed,
150 + .committed = desktop_surface_committed,
152 + .move = desktop_surface_move,
153 + .resize = desktop_surface_resize,
154 + .fullscreen_requested = desktop_surface_fullscreen_requested,
155 + .maximized_requested = desktop_surface_maximized_requested,
156 + .minimized_requested = desktop_surface_minimized_requested,
157 + .set_xwayland_position = desktop_surface_set_xwayland_position,
161 + * end of libweston-desktop
165 * Initialization of ivi-shell.