diff options
Diffstat (limited to 'meta-ivi/recipes-graphics/wayland/weston-1.6.0/0011-clients-support-ivi-application.xml-for-clients-simp.patch')
-rw-r--r-- | meta-ivi/recipes-graphics/wayland/weston-1.6.0/0011-clients-support-ivi-application.xml-for-clients-simp.patch | 397 |
1 files changed, 0 insertions, 397 deletions
diff --git a/meta-ivi/recipes-graphics/wayland/weston-1.6.0/0011-clients-support-ivi-application.xml-for-clients-simp.patch b/meta-ivi/recipes-graphics/wayland/weston-1.6.0/0011-clients-support-ivi-application.xml-for-clients-simp.patch deleted file mode 100644 index 7ff4a4d..0000000 --- a/meta-ivi/recipes-graphics/wayland/weston-1.6.0/0011-clients-support-ivi-application.xml-for-clients-simp.patch +++ /dev/null @@ -1,397 +0,0 @@ -From 072fc2e415ad7ba7e2737ee1a71c2ac1375a8f5f Mon Sep 17 00:00:00 2001 -From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> -Date: Wed, 15 Oct 2014 12:13:14 +0900 -Subject: [PATCH 11/15] clients: support ivi-application.xml for - clients/simple-egl.c - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - -remove NULL entry in listener - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl, remove listener of visibility event - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl, remove unnecesary roundtrip - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl, remove useless commented code - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl, Opening brace belongs on the previous line. - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl, Follow the style already in this file: 'else if - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl.c,Fix invalid function calling. - -> Calling handle_surface_configure() is detrimental here, you are -> confusing -> xdg_shell code paths with ivi_application code paths, and needing to -> modify -> the xdg_shell code path to cope with a bogus call. - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl.c, whitespace clean up - -> Why this change? Broken indentation. - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl.c,Rename variable name from fullscreen into maximized. - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl,whitespace clean up - -> Why these changes? - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl,clean up - -> Instead of reindenting everything, just do -> at the top. c - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl,Separate a messy function to two functions. - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl,whitespace clean up - -> Broken indentation - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl, replace 8 spaces to tab - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl,Delete unnecessary if condition. - -> You are still adding the 'if (states)' which was not there originally. -> What I meant was, you should not have done any modifications to this -> function. This is an xdg_shell event handler, not for ivi_application - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: simple-egl.c, clean up code - -> You shouldn't have changed this in the first place. - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> - ---------------------------------------------------------- -clients: cimple-egl, Delete unnecessary function call. - -> That's better, now the earlier original changes to -> handle_surface_configure() are not needed at all. - -Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> ---- - Makefile.am | 4 +- - clients/simple-egl.c | 114 ++++++++++++++++++++++++++++++++++++++++---------- - 2 files changed, 96 insertions(+), 22 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index df67cbc..081c854 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -441,7 +441,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..8e4433d 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,9 +100,10 @@ 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; -+ int maximized, opaque, buffer_size, frame_sync; - }; - - static const char *vert_shader_text = -@@ -255,7 +261,7 @@ init_gl(struct window *window) - } - - glUseProgram(program); -- -+ - window->gl.pos = 0; - window->gl.col = 1; - -@@ -275,24 +281,24 @@ handle_surface_configure(void *data, struct xdg_surface *surface, - struct window *window = data; - uint32_t *p; - -- window->fullscreen = 0; -+ window->maximized = 0; - wl_array_for_each(p, states) { - uint32_t state = *p; - switch (state) { -- case XDG_SURFACE_STATE_FULLSCREEN: -- window->fullscreen = 1; -- break; -+ case XDG_SURFACE_STATE_FULLSCREEN: -+ window->maximized = 1; -+ break; - } - } - - if (width > 0 && height > 0) { -- if (!window->fullscreen) { -+ if (!window->maximized) { - window->window_size.width = width; - window->window_size.height = height; - } - window->geometry.width = width; - window->geometry.height = height; -- } else if (!window->fullscreen) { -+ } else if (!window->maximized) { - window->geometry = window->window_size; - } - -@@ -301,6 +307,9 @@ handle_surface_configure(void *data, struct xdg_surface *surface, - window->geometry.width, - window->geometry.height, 0, 0); - -+ if (!window->display || !window->display->shell) -+ return; -+ - xdg_surface_ack_configure(surface, serial); - } - -@@ -316,18 +325,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->maximized) -+ 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 +389,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,7 +404,7 @@ create_surface(struct window *window) - if (!window->frame_sync) - eglSwapInterval(display->egl.dpy, 0); - -- if (window->fullscreen) -+ if (window->maximized) - xdg_surface_set_fullscreen(window->xdg_surface, NULL); - } - -@@ -443,7 +501,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) - glDisableVertexAttribArray(window->gl.pos); - glDisableVertexAttribArray(window->gl.col); - -- if (window->opaque || window->fullscreen) { -+ if (window->opaque || window->maximized) { - region = wl_compositor_create_region(window->display->compositor); - wl_region_add(region, 0, 0, - window->geometry.width, -@@ -478,7 +536,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, - struct wl_cursor *cursor = display->default_cursor; - struct wl_cursor_image *image; - -- if (display->window->fullscreen) -+ if (display->window->maximized) - wl_pointer_set_cursor(pointer, serial, NULL, 0, 0); - else if (cursor) { - image = display->default_cursor->images[0]; -@@ -516,8 +574,13 @@ pointer_handle_button(void *data, struct wl_pointer *wl_pointer, - struct display *display = data; - - if (button == BTN_LEFT && state == WL_POINTER_BUTTON_STATE_PRESSED) -+ { -+ if (!display->window->xdg_surface) -+ return; -+ - xdg_surface_move(display->window->xdg_surface, -- display->seat, serial); -+ display->seat, serial); -+ } - } - - static void -@@ -601,7 +664,7 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, - struct display *d = data; - - if (key == KEY_F11 && state) { -- if (d->window->fullscreen) -+ if (d->window->maximized) - xdg_surface_unset_fullscreen(d->window->xdg_surface); - else - xdg_surface_set_fullscreen(d->window->xdg_surface, NULL); -@@ -710,6 +773,10 @@ registry_handle_global(void *data, struct wl_registry *registry, - fprintf(stderr, "unable to load default left pointer\n"); - // TODO: abort ? - } -+ } else if (strcmp(interface, "ivi_application") == 0) { -+ d->ivi_application = -+ wl_registry_bind(registry, name, -+ &ivi_application_interface, 1); - } - } - -@@ -734,7 +801,7 @@ static void - usage(int error_code) - { - fprintf(stderr, "Usage: simple-egl [OPTIONS]\n\n" -- " -f\tRun in fullscreen mode\n" -+ " -f\tRun in maximized mode\n" - " -o\tCreate an opaque surface\n" - " -s\tUse a 16 bpp EGL config\n" - " -b\tDon't sync to compositor redraw (eglSwapInterval 0)\n" -@@ -761,7 +828,7 @@ main(int argc, char **argv) - - for (i = 1; i < argc; i++) { - if (strcmp("-f", argv[i]) == 0) -- window.fullscreen = 1; -+ window.maximized = 1; - else if (strcmp("-o", argv[i]) == 0) - window.opaque = 1; - else if (strcmp("-s", argv[i]) == 0) -@@ -806,6 +873,11 @@ main(int argc, char **argv) - - fprintf(stderr, "simple-egl exiting\n"); - -+ if (window.display->ivi_application) { -+ ivi_surface_destroy(window.ivi_surface); -+ ivi_application_destroy(window.display->ivi_application); -+ } -+ - destroy_surface(&window); - fini_egl(&display); - --- -1.7.9.5 - |