From df041fe77b5ee660b430ee63b3941911636fd196 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 20 Mar 2015 19:07:43 +0100 Subject: [PATCH] session_recovery: Add wayland extension protocol prototype for session recovery Like with all other wayland protocols I add the files generated with wayland scanner here. Also the xml so we have the source around for updating and modifications. We might want to think about wayland-scanner support in our build system but this works for now. The protocol prototype is hold simple and does only have a uuid signal and provide call to handle the uuid assignment from compositor to app and app providing its uuid if present already. --- src/bin/Makefile.mk | 2 + src/bin/session-recovery-protocol.c | 23 ++++++++++++ src/bin/session-recovery-server-protocol.h | 43 ++++++++++++++++++++++ src/bin/session-recovery.xml | 12 ++++++ 4 files changed, 80 insertions(+) create mode 100644 src/bin/session-recovery-protocol.c create mode 100644 src/bin/session-recovery-server-protocol.h create mode 100644 src/bin/session-recovery.xml diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk index 8fe07060c..4a24ea156 100644 --- a/src/bin/Makefile.mk +++ b/src/bin/Makefile.mk @@ -368,6 +368,8 @@ endif if HAVE_WAYLAND enlightenment_src += \ src/bin/e_uuid_store.c \ +src/bin/session-recovery-protocol.c \ +src/bin/session-recovery-server-protocol.h \ src/bin/e_comp_wl_data.c \ src/bin/e_comp_wl_input.c \ src/bin/e_comp_wl.c diff --git a/src/bin/session-recovery-protocol.c b/src/bin/session-recovery-protocol.c new file mode 100644 index 000000000..5e0a835f4 --- /dev/null +++ b/src/bin/session-recovery-protocol.c @@ -0,0 +1,23 @@ +#include +#include +#include "wayland-util.h" + + +static const struct wl_interface *types[] = { + NULL, +}; + +static const struct wl_message session_recovery_requests[] = { + { "provide_uuid", "s", types + 0 }, +}; + +static const struct wl_message session_recovery_events[] = { + { "uuid", "s", types + 0 }, +}; + +WL_EXPORT const struct wl_interface session_recovery_interface = { + "session_recovery", 1, + 1, session_recovery_requests, + 1, session_recovery_events, +}; + diff --git a/src/bin/session-recovery-server-protocol.h b/src/bin/session-recovery-server-protocol.h new file mode 100644 index 000000000..4b5f5d02c --- /dev/null +++ b/src/bin/session-recovery-server-protocol.h @@ -0,0 +1,43 @@ +#ifndef SESSION_RECOVERY_SERVER_PROTOCOL_H +#define SESSION_RECOVERY_SERVER_PROTOCOL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include "wayland-util.h" + +struct wl_client; +struct wl_resource; + +struct session_recovery; + +extern const struct wl_interface session_recovery_interface; + +struct session_recovery_interface { + /** + * provide_uuid - (none) + * @uuid: (none) + */ + void (*provide_uuid)(struct wl_client *client, + struct wl_resource *resource, + const char *uuid); +}; + +#define SESSION_RECOVERY_UUID 0 + +#define SESSION_RECOVERY_UUID_SINCE_VERSION 1 + +static inline void +session_recovery_send_uuid(struct wl_resource *resource_, const char *uuid) +{ + wl_resource_post_event(resource_, SESSION_RECOVERY_UUID, uuid); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/bin/session-recovery.xml b/src/bin/session-recovery.xml new file mode 100644 index 000000000..d996b6dae --- /dev/null +++ b/src/bin/session-recovery.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + +