summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-01-18 10:45:22 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-01-18 13:04:48 -0600
commitf162f47297db9c6191a54aa9540ddb4801ec07d7 (patch)
tree649666452a8aec39300cc469d48becd5cff048ed
parent2aa8b5acadceaa7815d7320b7a2322f64c44a313 (diff)
downloadefl-f162f47297db9c6191a54aa9540ddb4801ec07d7.tar.gz
ecore_wl2: Auto generate www protocol
Needed to copy the protocol file from Enlightenment.
-rw-r--r--.gitignore2
-rw-r--r--src/Makefile_Ecore_Wl2.am4
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h2
-rw-r--r--src/lib/ecore_wl2/www-protocol.c41
-rw-r--r--src/lib/ecore_wl2/www-protocol.h134
-rw-r--r--src/wayland_protocol/www.xml28
6 files changed, 34 insertions, 177 deletions
diff --git a/.gitignore b/.gitignore
index 6e5804c12f..445848295a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,6 +79,8 @@ Session.vim
/src/bin/ecore_con/efl_net_proxy_helper
#Once all protocols are generated these will use wildcards
+/src/lib/ecore_wl2/www-client-protocol.h
+/src/lib/ecore_wl2/www-protocol.c
/src/lib/ecore_wl2/teamwork-client-protocol.h
/src/lib/ecore_wl2/teamwork-protocol.c
/src/lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h
diff --git a/src/Makefile_Ecore_Wl2.am b/src/Makefile_Ecore_Wl2.am
index 56d2ebe58a..7e0789ff2e 100644
--- a/src/Makefile_Ecore_Wl2.am
+++ b/src/Makefile_Ecore_Wl2.am
@@ -14,7 +14,7 @@ lib/ecore_wl2/session-recovery-client-protocol.h \
lib/ecore_wl2/session-recovery-protocol.c \
lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v5-protocol.c \
-lib/ecore_wl2/www-protocol.h \
+lib/ecore_wl2/www-client-protocol.h \
lib/ecore_wl2/www-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h \
@@ -36,6 +36,8 @@ lib_ecore_wl2_libecore_wl2_la_DEPENDENCIES = @ECORE_WL2_INTERNAL_LIBS@
lib_ecore_wl2_libecore_wl2_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
BUILT_SOURCES += \
+ lib/ecore_wl2/www-client-protocol.h \
+ lib/ecore_wl2/www-protocol.c \
lib/ecore_wl2/teamwork-protocol.c \
lib/ecore_wl2/teamwork-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h
index 5ea5babc1b..c601e59c00 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -4,7 +4,7 @@
# include <unistd.h>
# include "Ecore_Wl2.h"
# include "Ecore_Input.h"
-# include "www-protocol.h"
+# include "www-client-protocol.h"
#define EFL_TEAMWORK_VERSION 2
# include "teamwork-client-protocol.h"
diff --git a/src/lib/ecore_wl2/www-protocol.c b/src/lib/ecore_wl2/www-protocol.c
deleted file mode 100644
index 952b333b58..0000000000
--- a/src/lib/ecore_wl2/www-protocol.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-extern const struct wl_interface wl_surface_interface;
-extern const struct wl_interface www_surface_interface;
-
-static const struct wl_interface *types[] = {
- NULL,
- NULL,
- NULL,
- &www_surface_interface,
- &wl_surface_interface,
-};
-
-static const struct wl_message www_requests[] = {
- { "create", "no", types + 3 },
-};
-
-WL_EXPORT const struct wl_interface www_interface = {
- "www", 1,
- 1, www_requests,
- 0, NULL,
-};
-
-static const struct wl_message www_surface_requests[] = {
- { "destroy", "", types + 0 },
-};
-
-static const struct wl_message www_surface_events[] = {
- { "status", "iiu", types + 0 },
- { "start_drag", "", types + 0 },
- { "end_drag", "", types + 0 },
-};
-
-WL_EXPORT const struct wl_interface www_surface_interface = {
- "www_surface", 1,
- 1, www_surface_requests,
- 3, www_surface_events,
-};
-
diff --git a/src/lib/ecore_wl2/www-protocol.h b/src/lib/ecore_wl2/www-protocol.h
deleted file mode 100644
index b7d553d795..0000000000
--- a/src/lib/ecore_wl2/www-protocol.h
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef ZWP_WWW_CLIENT_PROTOCOL_H
-#define ZWP_WWW_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 wl_surface;
-struct www;
-struct www_surface;
-
-extern const struct wl_interface www_interface;
-extern const struct wl_interface www_surface_interface;
-
-#define WWW_CREATE 0
-
-#define WWW_CREATE_SINCE_VERSION 1
-
-static inline void
-www_set_user_data(struct www *www, void *user_data)
-{
- wl_proxy_set_user_data((struct wl_proxy *) www, user_data);
-}
-
-static inline void *
-www_get_user_data(struct www *www)
-{
- return wl_proxy_get_user_data((struct wl_proxy *) www);
-}
-
-static inline uint32_t
-www_get_version(struct www *www)
-{
- return wl_proxy_get_version((struct wl_proxy *) www);
-}
-
-static inline void
-www_destroy(struct www *www)
-{
- wl_proxy_destroy((struct wl_proxy *) www);
-}
-
-static inline struct www_surface *
-www_create(struct www *www, struct wl_surface *surface)
-{
- struct wl_proxy *id;
-
- id = wl_proxy_marshal_constructor((struct wl_proxy *) www,
- WWW_CREATE, &www_surface_interface, NULL, surface);
-
- return (struct www_surface *) id;
-}
-
-struct www_surface_listener {
- /**
- * status - Status update on a www_surface
- * @x_rel: (none)
- * @y_rel: (none)
- * @timestamp: (none)
- *
- *
- */
- void (*status)(void *data,
- struct www_surface *www_surface,
- int32_t x_rel,
- int32_t y_rel,
- uint32_t timestamp);
- /**
- * start_drag - Drag has started
- *
- *
- */
- void (*start_drag)(void *data,
- struct www_surface *www_surface);
- /**
- * end_drag - Drag has ended
- *
- *
- */
- void (*end_drag)(void *data,
- struct www_surface *www_surface);
-};
-
-static inline int
-www_surface_add_listener(struct www_surface *www_surface,
- const struct www_surface_listener *listener, void *data)
-{
- return wl_proxy_add_listener((struct wl_proxy *) www_surface,
- (void (**)(void)) listener, data);
-}
-
-#define WWW_SURFACE_DESTROY 0
-
-#define WWW_SURFACE_DESTROY_SINCE_VERSION 1
-
-static inline void
-www_surface_set_user_data(struct www_surface *www_surface, void *user_data)
-{
- wl_proxy_set_user_data((struct wl_proxy *) www_surface, user_data);
-}
-
-static inline void *
-www_surface_get_user_data(struct www_surface *www_surface)
-{
- return wl_proxy_get_user_data((struct wl_proxy *) www_surface);
-}
-
-static inline uint32_t
-www_surface_get_version(struct www_surface *www_surface)
-{
- return wl_proxy_get_version((struct wl_proxy *) www_surface);
-}
-
-static inline void
-www_surface_destroy(struct www_surface *www_surface)
-{
- wl_proxy_marshal((struct wl_proxy *) www_surface,
- WWW_SURFACE_DESTROY);
-
- wl_proxy_destroy((struct wl_proxy *) www_surface);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/wayland_protocol/www.xml b/src/wayland_protocol/www.xml
new file mode 100644
index 0000000000..8d455178de
--- /dev/null
+++ b/src/wayland_protocol/www.xml
@@ -0,0 +1,28 @@
+<protocol name="zwp_www">
+ <interface name="www" version="1">
+ <request name="create">
+ <description summary="Create an object for WWW notifications">
+ </description>
+ <arg name="id" type="new_id" interface="www_surface"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+ </interface>
+ <interface name="www_surface" version="1">
+ <event name="status">
+ <description summary="Status update on a www_surface"></description>
+ <arg name="x_rel" type="int"/>
+ <arg name="y_rel" type="int"/>
+ <arg name="timestamp" type="uint"/>
+ </event>
+ <event name="start_drag">
+ <description summary="Drag has started"></description>
+ </event>
+ <event name="end_drag">
+ <description summary="Drag has ended"></description>
+ </event>
+ <request name="destroy" type="destructor">
+ <description summary="Destroy a www_surface">
+ </description>
+ </request>
+ </interface>
+</protocol>