diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-09-25 15:42:38 +0900 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2014-10-28 12:16:55 +0900 |
commit | 382d91bc7897363ae52cec27d975018ee3a2f81d (patch) | |
tree | fae6fbe773d75ee10275ea39eaff302bf159c794 | |
parent | 498ce7bbf5771b433d0683b952f13091509228d0 (diff) | |
download | weston-382d91bc7897363ae52cec27d975018ee3a2f81d.tar.gz |
ivi-shell: support xwayland
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
-rw-r--r-- | ivi-shell/ivi-shell.c | 116 |
1 files changed, 115 insertions, 1 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 514de8ea..d1fffe48 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -174,6 +174,106 @@ static const struct { { IVI_WARNING_IVI_ID_IN_USE, "surface_id is already assigned by another app" }, }; +static struct shell_surface* +create_shell_surface(void *shell, + struct weston_surface *weston_surface, + const struct weston_shell_client *client) +{ + struct ivi_shell_surface* ivisurf; + struct ivi_layout_surface* layout_surface; + static uint32_t id_surface = 0xffffffff; // FIXME + + ivisurf = zalloc(sizeof *ivisurf); + if (ivisurf == NULL) { + weston_log("no memory\n"); + return NULL; + } + + layout_surface = ivi_layout->surfaceCreate(weston_surface, id_surface); + + wl_list_init(&ivisurf->link); + wl_list_insert(&((struct ivi_shell*)shell)->ivi_surface_list, &ivisurf->link); + + ivisurf->shell = shell; + ivisurf->id_surface = id_surface; + + ivisurf->resource = NULL; + ivisurf->width = 0; + ivisurf->height = 0; + ivisurf->layout_surface = layout_surface; + ivisurf->configured_listener.notify = surface_configure_notify; + ivi_layout->add_surface_configured_listener(layout_surface, &ivisurf->configured_listener); + + ivisurf->surface = weston_surface; + + weston_surface->configure = ivi_shell_surface_configure; + weston_surface->configure_private = ivisurf; + +// !!! res is null !!! +// wl_resource_set_implementation(res, &surface_implementation, +// ivisurf, NULL); + + id_surface--; + + return NULL; +} + +static struct weston_view* +get_primary_view(void *shell, + struct shell_surface *shsurf) +{ + return NULL; +} + +static void +set_toplevel(struct shell_surface *shsurf) +{ +} + +static void +set_transient(struct shell_surface *shsurf, + struct weston_surface *parent, + int x, int y, uint32_t flags) +{ +} + +static void +set_fullscreen(struct shell_surface *shsurf, + uint32_t method, + uint32_t framerate, + struct weston_output *output) +{ +} + +static void +set_xwayland(struct shell_surface *shsurf, + int x, int y, uint32_t flags) +{ +} + +static int move +(struct shell_surface *shsurf, struct weston_seat *ws) +{ + return 0; // success +} + +static int resize(struct shell_surface *shsurf, + struct weston_seat *ws, uint32_t edges) +{ + return 0; // success +} + +static void set_title(struct shell_surface *shsurf, + const char *title) +{ +} + +static void set_margin(struct shell_surface *shsurf, + int32_t left, int32_t right, + int32_t top, int32_t bottom) +{ +} + /** * Implementation of ivi_application::surface_create. * Creating new ivi_shell_surface with identification to identify the surface @@ -331,6 +431,19 @@ init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell) weston_layer_init(&shell->panel_layer, &compositor->cursor_layer.link); weston_layer_init(&shell->input_panel_layer, NULL); + + compositor->shell_interface.shell = shell; + compositor->shell_interface.create_shell_surface = create_shell_surface; + compositor->shell_interface.get_primary_view = get_primary_view; + compositor->shell_interface.set_toplevel = set_toplevel; + compositor->shell_interface.set_transient = set_transient; + compositor->shell_interface.set_fullscreen = set_fullscreen; + compositor->shell_interface.set_xwayland = set_xwayland; + compositor->shell_interface.move = move; + compositor->shell_interface.resize = resize; + compositor->shell_interface.set_title = set_title; + compositor->shell_interface.set_margin = set_margin; + } static int @@ -402,7 +515,8 @@ surface_configure_notify(struct wl_listener *listener, void *data) int32_t dim[2] = {}; ivi_layout->get_surface_dimension(layout_surf, dim); - ivi_surface_send_configure(shell_surf->resource, dim[0], dim[1]); + if(shell_surf->resource) + ivi_surface_send_configure(shell_surf->resource, dim[0], dim[1]); } |