simple-egl: remove ivi-application support
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
This commit is contained in:
committed by
Daniel Stone
parent
e894b3e4a3
commit
111d3d8fb4
+1
-3
@@ -648,9 +648,7 @@ demo_clients += weston-simple-egl
|
|||||||
weston_simple_egl_SOURCES = clients/simple-egl.c
|
weston_simple_egl_SOURCES = clients/simple-egl.c
|
||||||
nodist_weston_simple_egl_SOURCES = \
|
nodist_weston_simple_egl_SOURCES = \
|
||||||
protocol/xdg-shell-unstable-v6-protocol.c \
|
protocol/xdg-shell-unstable-v6-protocol.c \
|
||||||
protocol/xdg-shell-unstable-v6-client-protocol.h \
|
protocol/xdg-shell-unstable-v6-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_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
|
||||||
weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
|
weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm
|
||||||
endif
|
endif
|
||||||
|
|||||||
+13
-75
@@ -45,8 +45,6 @@
|
|||||||
#include "xdg-shell-unstable-v6-client-protocol.h"
|
#include "xdg-shell-unstable-v6-client-protocol.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "ivi-application-client-protocol.h"
|
|
||||||
#define IVI_SURFACE_ID 9000
|
|
||||||
|
|
||||||
#include "shared/helpers.h"
|
#include "shared/helpers.h"
|
||||||
#include "shared/platform.h"
|
#include "shared/platform.h"
|
||||||
@@ -74,7 +72,6 @@ struct display {
|
|||||||
EGLConfig conf;
|
EGLConfig conf;
|
||||||
} egl;
|
} egl;
|
||||||
struct window *window;
|
struct window *window;
|
||||||
struct ivi_application *ivi_application;
|
|
||||||
|
|
||||||
PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
|
PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage;
|
||||||
};
|
};
|
||||||
@@ -97,7 +94,6 @@ struct window {
|
|||||||
struct wl_surface *surface;
|
struct wl_surface *surface;
|
||||||
struct zxdg_surface_v6 *xdg_surface;
|
struct zxdg_surface_v6 *xdg_surface;
|
||||||
struct zxdg_toplevel_v6 *xdg_toplevel;
|
struct zxdg_toplevel_v6 *xdg_toplevel;
|
||||||
struct ivi_surface *ivi_surface;
|
|
||||||
EGLSurface egl_surface;
|
EGLSurface egl_surface;
|
||||||
struct wl_callback *callback;
|
struct wl_callback *callback;
|
||||||
int fullscreen, maximized, opaque, buffer_size, frame_sync, delay;
|
int fullscreen, maximized, opaque, buffer_size, frame_sync, delay;
|
||||||
@@ -358,61 +354,6 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = {
|
|||||||
handle_toplevel_close,
|
handle_toplevel_close,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
window->xdg_surface = zxdg_shell_v6_get_xdg_surface(display->shell,
|
|
||||||
window->surface);
|
|
||||||
zxdg_surface_v6_add_listener(window->xdg_surface,
|
|
||||||
&xdg_surface_listener, window);
|
|
||||||
|
|
||||||
window->xdg_toplevel =
|
|
||||||
zxdg_surface_v6_get_toplevel(window->xdg_surface);
|
|
||||||
zxdg_toplevel_v6_add_listener(window->xdg_toplevel,
|
|
||||||
&xdg_toplevel_listener, window);
|
|
||||||
|
|
||||||
zxdg_toplevel_v6_set_title(window->xdg_toplevel, "simple-egl");
|
|
||||||
|
|
||||||
window->wait_for_configure = true;
|
|
||||||
wl_surface_commit(window->surface);
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
static void
|
||||||
create_surface(struct window *window)
|
create_surface(struct window *window)
|
||||||
{
|
{
|
||||||
@@ -430,14 +371,20 @@ create_surface(struct window *window)
|
|||||||
display->egl.conf,
|
display->egl.conf,
|
||||||
window->native, NULL);
|
window->native, NULL);
|
||||||
|
|
||||||
|
window->xdg_surface = zxdg_shell_v6_get_xdg_surface(display->shell,
|
||||||
|
window->surface);
|
||||||
|
zxdg_surface_v6_add_listener(window->xdg_surface,
|
||||||
|
&xdg_surface_listener, window);
|
||||||
|
|
||||||
if (display->shell) {
|
window->xdg_toplevel =
|
||||||
create_xdg_surface(window, display);
|
zxdg_surface_v6_get_toplevel(window->xdg_surface);
|
||||||
} else if (display->ivi_application ) {
|
zxdg_toplevel_v6_add_listener(window->xdg_toplevel,
|
||||||
create_ivi_surface(window, display);
|
&xdg_toplevel_listener, window);
|
||||||
} else {
|
|
||||||
assert(0);
|
zxdg_toplevel_v6_set_title(window->xdg_toplevel, "simple-egl");
|
||||||
}
|
|
||||||
|
window->wait_for_configure = true;
|
||||||
|
wl_surface_commit(window->surface);
|
||||||
|
|
||||||
ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
|
ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
|
||||||
window->egl_surface, window->display->egl.ctx);
|
window->egl_surface, window->display->egl.ctx);
|
||||||
@@ -469,8 +416,6 @@ destroy_surface(struct window *window)
|
|||||||
zxdg_toplevel_v6_destroy(window->xdg_toplevel);
|
zxdg_toplevel_v6_destroy(window->xdg_toplevel);
|
||||||
if (window->xdg_surface)
|
if (window->xdg_surface)
|
||||||
zxdg_surface_v6_destroy(window->xdg_surface);
|
zxdg_surface_v6_destroy(window->xdg_surface);
|
||||||
if (window->display->ivi_application)
|
|
||||||
ivi_surface_destroy(window->ivi_surface);
|
|
||||||
wl_surface_destroy(window->surface);
|
wl_surface_destroy(window->surface);
|
||||||
|
|
||||||
if (window->callback)
|
if (window->callback)
|
||||||
@@ -825,10 +770,6 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
|||||||
fprintf(stderr, "unable to load default left pointer\n");
|
fprintf(stderr, "unable to load default left pointer\n");
|
||||||
// TODO: abort ?
|
// TODO: abort ?
|
||||||
}
|
}
|
||||||
} else if (strcmp(interface, "ivi_application") == 0) {
|
|
||||||
d->ivi_application =
|
|
||||||
wl_registry_bind(registry, name,
|
|
||||||
&ivi_application_interface, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -943,9 +884,6 @@ main(int argc, char **argv)
|
|||||||
if (display.shell)
|
if (display.shell)
|
||||||
zxdg_shell_v6_destroy(display.shell);
|
zxdg_shell_v6_destroy(display.shell);
|
||||||
|
|
||||||
if (display.ivi_application)
|
|
||||||
ivi_application_destroy(display.ivi_application);
|
|
||||||
|
|
||||||
if (display.compositor)
|
if (display.compositor)
|
||||||
wl_compositor_destroy(display.compositor);
|
wl_compositor_destroy(display.compositor);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user