ecore_wl: Add generated session-recovery-protocol files to build
authorStefan Schmidt <s.schmidt@samsung.com>
Fri, 20 Mar 2015 12:28:08 +0000 (13:28 +0100)
committerStefan Schmidt <stefan@osg.samsung.com>
Mon, 29 Jun 2015 15:09:57 +0000 (17:09 +0200)
For now these are generated externally by wayland-scanner and added here.
Also keep the original xml protocol file here for now.

This covers the client side for applications while the server side code
sits with E as compositor.

src/Makefile_Ecore_Wayland.am
src/lib/ecore_wayland/session-recovery-client-protocol.h [new file with mode: 0644]
src/lib/ecore_wayland/session-recovery-protocol.c [new file with mode: 0644]
src/lib/ecore_wayland/session-recovery.xml [new file with mode: 0644]

index f9bb362..6099f34 100644 (file)
@@ -21,7 +21,9 @@ lib/ecore_wayland/subsurface-client-protocol.h \
 lib/ecore_wayland/ivi-application-protocol.c \
 lib/ecore_wayland/ivi-application-client-protocol.h \
 lib/ecore_wayland/xdg-shell-client-protocol.h \
-lib/ecore_wayland/xdg-shell-protocol.c
+lib/ecore_wayland/xdg-shell-protocol.c \
+lib/ecore_wayland/session-recovery-client-protocol.h \
+lib/ecore_wayland/session-recovery-protocol.c
 
 lib_ecore_wayland_libecore_wayland_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WAYLAND_CFLAGS@
 lib_ecore_wayland_libecore_wayland_la_LIBADD = @ECORE_WAYLAND_LIBS@
diff --git a/src/lib/ecore_wayland/session-recovery-client-protocol.h b/src/lib/ecore_wayland/session-recovery-client-protocol.h
new file mode 100644 (file)
index 0000000..97848c8
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef SESSION_RECOVERY_CLIENT_PROTOCOL_H
+#define SESSION_RECOVERY_CLIENT_PROTOCOL_H
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct session_recovery;
+
+extern const struct wl_interface session_recovery_interface;
+
+struct session_recovery_listener {
+       /**
+        * uuid - (none)
+        * @uuid: (none)
+        */
+       void (*uuid)(void *data,
+                    struct session_recovery *session_recovery,
+                    const char *uuid);
+};
+
+static inline int
+session_recovery_add_listener(struct session_recovery *session_recovery,
+                             const struct session_recovery_listener *listener, void *data)
+{
+       return wl_proxy_add_listener((struct wl_proxy *) session_recovery,
+                                    (void (**)(void)) listener, data);
+}
+
+#define SESSION_RECOVERY_PROVIDE_UUID  0
+
+static inline void
+session_recovery_set_user_data(struct session_recovery *session_recovery, void *user_data)
+{
+       wl_proxy_set_user_data((struct wl_proxy *) session_recovery, user_data);
+}
+
+static inline void *
+session_recovery_get_user_data(struct session_recovery *session_recovery)
+{
+       return wl_proxy_get_user_data((struct wl_proxy *) session_recovery);
+}
+
+static inline void
+session_recovery_destroy(struct session_recovery *session_recovery)
+{
+       wl_proxy_destroy((struct wl_proxy *) session_recovery);
+}
+
+static inline void
+session_recovery_provide_uuid(struct session_recovery *session_recovery, const char *uuid)
+{
+       wl_proxy_marshal((struct wl_proxy *) session_recovery,
+                        SESSION_RECOVERY_PROVIDE_UUID, uuid);
+}
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/lib/ecore_wayland/session-recovery-protocol.c b/src/lib/ecore_wayland/session-recovery-protocol.c
new file mode 100644 (file)
index 0000000..5e0a835
--- /dev/null
@@ -0,0 +1,23 @@
+#include <stdlib.h>
+#include <stdint.h>
+#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/lib/ecore_wayland/session-recovery.xml b/src/lib/ecore_wayland/session-recovery.xml
new file mode 100644 (file)
index 0000000..d996b6d
--- /dev/null
@@ -0,0 +1,12 @@
+<protocol name="session_recovery">
+
+  <interface name="session_recovery" version="1">
+    <request name="provide_uuid">
+      <arg name="uuid" type="string"/>
+    </request>
+    <event name="uuid">
+      <arg name="uuid" type="string"/>
+    </event>
+  </interface>
+
+</protocol>