summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-10-27 15:41:29 +0300
committerMarius Vlad <marius.vlad@collabora.com>2022-10-27 17:24:29 +0300
commitdcb11eebdba956e567c7421b0511a6e6f0298931 (patch)
treeae5a491184d0a44da24158a8d47eecab00ef3fbb
parent4df12ac75fc5b65b7cfbf9d1829c0f780595d43e (diff)
meson.build: Remove all traces of agl-shell-desktop
This patch removes support for agl-shell-desktop. Bug-AGL: SPEC-4503 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I1ad69a4fc4c8ccdc9c659ec1a50526fc9f3a8d81
-rw-r--r--meson.build56
-rw-r--r--src/main.cpp195
2 files changed, 0 insertions, 251 deletions
diff --git a/meson.build b/meson.build
index fa7b1bb..321f130 100644
--- a/meson.build
+++ b/meson.build
@@ -49,67 +49,11 @@ grpc_deps = [
]
-env_modmap = ''
-
-libwayland_dep = dependency('wayland-client')
-agl_compositor_dep = dependency('agl-compositor-0.0.20-protocols')
-
-dep_scanner = dependency('wayland-scanner', native: true)
-prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
-dep_wp = dependency('wayland-protocols', version: '>= 1.18')
-dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
-dir_agl_compositor_base = agl_compositor_dep.get_pkgconfig_variable('pkgdatadir')
-
-protocols = [
- { 'name': 'agl-shell-desktop', 'source': 'agl-compositor' },
-]
-
-foreach proto: protocols
- proto_name = proto['name']
- if proto['source'] == 'internal'
- base_file = proto_name
- xml_path = join_paths('protocol', '@0@.xml'.format(base_file))
- elif proto['source'] == 'wp-stable'
- base_file = proto_name
- xml_path = join_paths(dir_wp_base, 'stable', proto_name, '@0@.xml'.format(base_file))
- elif proto['source'] == 'agl-compositor'
- base_file = proto_name
- xml_path = join_paths(dir_agl_compositor_base, '@0@.xml'.format(base_file))
- else
- base_file = '@0@-unstable-@1@'.format(proto_name, proto['version'])
- xml_path = join_paths(dir_wp_base, 'unstable', proto_name, '@0@.xml'.format(base_file))
- endif
-
- foreach output_type: [ 'client-header', 'server-header', 'private-code' ]
- if output_type == 'client-header'
- output_file = '@0@-client-protocol.h'.format(base_file)
- elif output_type == 'server-header'
- output_file = '@0@-server-protocol.h'.format(base_file)
- else
- output_file = '@0@-protocol.c'.format(base_file)
- if dep_scanner.version().version_compare('< 1.14.91')
- output_type = 'code'
- endif
- endif
-
- var_name = output_file.underscorify()
- target = custom_target(
- '@0@ @1@'.format(base_file, output_type),
- command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
- input: xml_path,
- output: output_file,
- )
-
- set_variable(var_name, target)
- endforeach
-endforeach
-
prefix_path = get_option('prefix')
binplugin_dir = join_paths(prefix_path, get_option('bindir'))
common_inc = include_directories('include')
deps_agl_activator = [
- libwayland_dep,
grpc_deps,
]
diff --git a/src/main.cpp b/src/main.cpp
index 079001f..2df7421 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -34,205 +34,10 @@
#include <wayland-util.h>
#include "AglShellGrpcClient.h"
-#include "agl-shell-desktop-client-protocol.h"
-
-#ifndef MIN
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-#ifndef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
static int running = 1;
const char *app_id_to_activate = NULL;
-struct display;
-
-struct window_output {
- struct display *display;
- struct wl_output *output;
- char *name;
- struct wl_list link; /** display::output_list */
-};
-
-struct display {
- struct wl_display *display;
- struct wl_registry *registry;
- struct agl_shell_desktop *agl_shell_desktop;
-
- struct wl_list output_list; /** window_output::link */
-};
-
-static void
-display_handle_geometry(void *data, struct wl_output *wl_output,
- int x, int y, int physical_width, int physical_height,
- int subpixel, const char *make, const char *model, int transform)
-{
-}
-
-static void
-display_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
- int width, int height, int refresh)
-{
-}
-
-static void
-display_handle_done(void *data, struct wl_output *wl_output)
-{
-}
-
-static void
-display_handle_scale(void *data, struct wl_output *wl_output, int32_t factor)
-{
-}
-
-static void
-display_handle_name(void *data, struct wl_output *wl_output, const char *name)
-{
- struct window_output *woutput = static_cast<struct window_output *>(data);
- woutput->name = strdup(name);
-
- fprintf(stderr, "Adding output '%s'\n", name);
-}
-
-static void
-display_handle_description(void *data, struct wl_output *wl_output, const char *description)
-{
-}
-
-static const struct wl_output_listener output_listener = {
- display_handle_geometry,
- display_handle_mode,
- display_handle_done,
- display_handle_scale,
- display_handle_name,
- display_handle_description,
-};
-
-
-static void
-display_add_output(struct display *display, uint32_t id, uint32_t version)
-{
- struct window_output *w_output;
-
- w_output = static_cast<struct window_output *>(calloc(1, sizeof(*w_output)));
- w_output->display = display;
-
- if (version < 4)
- w_output->output =
- static_cast<struct wl_output *>(wl_registry_bind(display->registry, id, &wl_output_interface, MAX(version, 3)));
- else
- w_output->output =
- static_cast<struct wl_output *>(wl_registry_bind(display->registry, id, &wl_output_interface, MIN(version, 4)));
-
- wl_list_insert(&display->output_list, &w_output->link);
- wl_output_add_listener(w_output->output, &output_listener, w_output);
-}
-
-static void
-destroy_output(struct window_output *w_output)
-{
- free(w_output->name);
- wl_list_remove(&w_output->link);
- free(w_output);
-}
-
-static void app(void *data, struct agl_shell_desktop *agl_shell_desktop,
- const char *appid)
-{
- /* UNUSED */
-}
-
-static void state_app(void *data, struct agl_shell_desktop *agl_shell_desktop,
- const char *app_id, const char *app_data, uint32_t state,
- uint32_t role)
-{
- if (strcmp(app_id, app_id_to_activate) == 0 &&
- state == AGL_SHELL_DESKTOP_APP_STATE_ACTIVATED) {
- running = 0;
- }
-}
-
-static const struct agl_shell_desktop_listener desktop_shell_listener = {
- app,
- state_app,
-};
-
-static void
-registry_handle_global(void *data, struct wl_registry *registry,
- uint32_t id, const char *interface, uint32_t version)
-{
- struct display *d = static_cast<struct display *>(data);
-
- if (strcmp(interface, "agl_shell_desktop") == 0) {
- d->agl_shell_desktop =
- static_cast<struct agl_shell_desktop *>(wl_registry_bind(registry, id, &agl_shell_desktop_interface, 1));
- agl_shell_desktop_add_listener(d->agl_shell_desktop,
- &desktop_shell_listener, d);
- } else if (strcmp(interface, "wl_output") == 0) {
- if (version < 4)
- fprintf(stderr, "Failed to bind to version 4. "
- "Current version %d\n", version);
- display_add_output(d, id, version);
- }
-}
-
-static void
-registry_handle_global_remove(void *data, struct wl_registry *registry,
- uint32_t name)
-{
-
-}
-
-static const struct wl_registry_listener registry_listener = {
- registry_handle_global,
- registry_handle_global_remove
-};
-
-static struct display *
-create_display(void)
-{
- struct display *display;
-
- display = static_cast<struct display *>(malloc(sizeof *display));
- if (display == NULL) {
- fprintf(stderr, "out of memory\n");
- exit(1);
- }
-
- wl_list_init(&display->output_list);
- display->display = wl_display_connect(NULL);
- assert(display->display);
-
- display->registry = wl_display_get_registry(display->display);
-
- wl_registry_add_listener(display->registry, &registry_listener, display);
- wl_display_roundtrip(display->display);
-
- if (display->agl_shell_desktop == NULL) {
- fprintf(stderr, "No agl_shell_desktop extension present\n");
- }
-
- wl_display_roundtrip(display->display);
- return display;
-}
-
-static void
-destroy_display(struct display *display)
-{
- struct window_output *w_output, *w_output_next;
-
- wl_list_for_each_safe(w_output, w_output_next, &display->output_list, link)
- destroy_output(w_output);
-
- wl_registry_destroy(display->registry);
-
- wl_display_flush(display->display);
- wl_display_disconnect(display->display);
-
- free(display);
-}
-
static void
run_in_thread(GrpcClient *client)
{