derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2aa8b5acadceaa7815d7320b7a2322f64c44a313

commit 2aa8b5acadceaa7815d7320b7a2322f64c44a313
Author: Derek Foreman <[email protected]>
Date:   Wed Jan 18 10:03:44 2017 -0600

    ecore_wl2: Auto generate teamwork protocol
    
    The name was non-standard and we didn't have the xml in tree,
    xml has been copied from Enlightenment.
---
 .gitignore                            |   2 +
 src/Makefile_Ecore_Wl2.am             |   6 +-
 src/lib/ecore_wl2/ecore_wl2_private.h |   2 +-
 src/lib/ecore_wl2/teamwork_protocol.c |  46 ------------
 src/lib/ecore_wl2/teamwork_protocol.h | 128 ----------------------------------
 src/wayland_protocol/teamwork.xml     |  39 +++++++++++
 6 files changed, 46 insertions(+), 177 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3bfc9f3..6e5804c 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/teamwork-client-protocol.h
+/src/lib/ecore_wl2/teamwork-protocol.c
 /src/lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h
 /src/lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c
 /src/lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h
diff --git a/src/Makefile_Ecore_Wl2.am b/src/Makefile_Ecore_Wl2.am
index 1f1b17f..56d2ebe 100644
--- a/src/Makefile_Ecore_Wl2.am
+++ b/src/Makefile_Ecore_Wl2.am
@@ -8,8 +8,8 @@ installed_ecorewl2mainheadersdir = 
$(includedir)/ecore-wl2-@VMAJ@
 dist_installed_ecorewl2mainheaders_DATA = lib/ecore_wl2/Ecore_Wl2.h
 
 lib_ecore_wl2_libecore_wl2_la_SOURCES = \
-lib/ecore_wl2/teamwork_protocol.c \
-lib/ecore_wl2/teamwork_protocol.h \
+lib/ecore_wl2/teamwork-protocol.c \
+lib/ecore_wl2/teamwork-client-protocol.h \
 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 \
@@ -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/teamwork-protocol.c \
+ lib/ecore_wl2/teamwork-client-protocol.h \
  lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
  lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \
  lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \
diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h 
b/src/lib/ecore_wl2/ecore_wl2_private.h
index 57ecf1c..5ea5bab 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -7,7 +7,7 @@
 # include "www-protocol.h"
 
 #define EFL_TEAMWORK_VERSION 2
-# include "teamwork_protocol.h"
+# include "teamwork-client-protocol.h"
 
 # include "xdg-shell-unstable-v5-client-protocol.h"
 # define XDG_V5_UNSTABLE_VERSION 5
diff --git a/src/lib/ecore_wl2/teamwork_protocol.c 
b/src/lib/ecore_wl2/teamwork_protocol.c
deleted file mode 100644
index baca23d..0000000
--- a/src/lib/ecore_wl2/teamwork_protocol.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-extern const struct wl_interface wl_surface_interface;
-
-static const struct wl_interface *types[] = {
-       &wl_surface_interface,
-       NULL,
-       &wl_surface_interface,
-       NULL,
-       NULL,
-       NULL,
-       &wl_surface_interface,
-       NULL,
-       &wl_surface_interface,
-       NULL,
-       &wl_surface_interface,
-       NULL,
-       &wl_surface_interface,
-       NULL,
-       NULL,
-       &wl_surface_interface,
-       NULL,
-       NULL,
-};
-
-static const struct wl_message zwp_teamwork_requests[] = {
-       { "preload_uri", "os", types + 0 },
-       { "activate_uri", "osff", types + 2 },
-       { "deactivate_uri", "os", types + 6 },
-       { "open_uri", "os", types + 8 },
-};
-
-static const struct wl_message zwp_teamwork_events[] = {
-       { "fetching_uri", "os", types + 10 },
-       { "completed_uri", "osi", types + 12 },
-       { "fetch_info", "osu", types + 15 },
-};
-
-WL_EXPORT const struct wl_interface zwp_teamwork_interface = {
-       "zwp_teamwork", 2,
-       4, zwp_teamwork_requests,
-       3, zwp_teamwork_events,
-};
-
diff --git a/src/lib/ecore_wl2/teamwork_protocol.h 
b/src/lib/ecore_wl2/teamwork_protocol.h
deleted file mode 100644
index 129aa2d..0000000
--- a/src/lib/ecore_wl2/teamwork_protocol.h
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef TEAMWORK_CLIENT_PROTOCOL_H
-#define TEAMWORK_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 zwp_teamwork;
-
-extern const struct wl_interface zwp_teamwork_interface;
-
-struct zwp_teamwork_listener {
-       /**
-        * fetching_uri - (none)
-        * @surface: (none)
-        * @uri: (none)
-        */
-       void (*fetching_uri)(void *data,
-                            struct zwp_teamwork *zwp_teamwork,
-                            struct wl_surface *surface,
-                            const char *uri);
-       /**
-        * completed_uri - (none)
-        * @surface: (none)
-        * @uri: (none)
-        * @valid: 1 if uri can be displayed, else 0
-        */
-       void (*completed_uri)(void *data,
-                             struct zwp_teamwork *zwp_teamwork,
-                             struct wl_surface *surface,
-                             const char *uri,
-                             int32_t valid);
-       /**
-        * fetch_info - (none)
-        * @surface: (none)
-        * @uri: (none)
-        * @progress: percentage of download
-        */
-       void (*fetch_info)(void *data,
-                          struct zwp_teamwork *zwp_teamwork,
-                          struct wl_surface *surface,
-                          const char *uri,
-                          uint32_t progress);
-};
-
-static inline int
-zwp_teamwork_add_listener(struct zwp_teamwork *zwp_teamwork,
-                         const struct zwp_teamwork_listener *listener, void 
*data)
-{
-       return wl_proxy_add_listener((struct wl_proxy *) zwp_teamwork,
-                                    (void (**)(void)) listener, data);
-}
-
-#define ZWP_TEAMWORK_PRELOAD_URI       0
-#define ZWP_TEAMWORK_ACTIVATE_URI      1
-#define ZWP_TEAMWORK_DEACTIVATE_URI    2
-#define ZWP_TEAMWORK_OPEN_URI  3
-
-#define ZWP_TEAMWORK_PRELOAD_URI_SINCE_VERSION 1
-#define ZWP_TEAMWORK_ACTIVATE_URI_SINCE_VERSION        1
-#define ZWP_TEAMWORK_DEACTIVATE_URI_SINCE_VERSION      1
-#define ZWP_TEAMWORK_OPEN_URI_SINCE_VERSION    1
-
-static inline void
-zwp_teamwork_set_user_data(struct zwp_teamwork *zwp_teamwork, void *user_data)
-{
-       wl_proxy_set_user_data((struct wl_proxy *) zwp_teamwork, user_data);
-}
-
-static inline void *
-zwp_teamwork_get_user_data(struct zwp_teamwork *zwp_teamwork)
-{
-       return wl_proxy_get_user_data((struct wl_proxy *) zwp_teamwork);
-}
-
-static inline uint32_t
-zwp_teamwork_get_version(struct zwp_teamwork *zwp_teamwork)
-{
-       return wl_proxy_get_version((struct wl_proxy *) zwp_teamwork);
-}
-
-static inline void
-zwp_teamwork_destroy(struct zwp_teamwork *zwp_teamwork)
-{
-       wl_proxy_destroy((struct wl_proxy *) zwp_teamwork);
-}
-
-static inline void
-zwp_teamwork_preload_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface 
*surface, const char *uri)
-{
-       wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
-                        ZWP_TEAMWORK_PRELOAD_URI, surface, uri);
-}
-
-static inline void
-zwp_teamwork_activate_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface 
*surface, const char *uri, wl_fixed_t x, wl_fixed_t y)
-{
-       wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
-                        ZWP_TEAMWORK_ACTIVATE_URI, surface, uri, x, y);
-}
-
-static inline void
-zwp_teamwork_deactivate_uri(struct zwp_teamwork *zwp_teamwork, struct 
wl_surface *surface, const char *uri)
-{
-       wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
-                        ZWP_TEAMWORK_DEACTIVATE_URI, surface, uri);
-}
-
-static inline void
-zwp_teamwork_open_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface 
*surface, const char *uri)
-{
-       wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
-                        ZWP_TEAMWORK_OPEN_URI, surface, uri);
-}
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/wayland_protocol/teamwork.xml 
b/src/wayland_protocol/teamwork.xml
new file mode 100644
index 0000000..99e2f33
--- /dev/null
+++ b/src/wayland_protocol/teamwork.xml
@@ -0,0 +1,39 @@
+<protocol name="teamwork">
+
+  <interface name="zwp_teamwork" version="2">
+    <request name="preload_uri">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="uri" type="string"/>
+    </request>
+    <request name="activate_uri">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="uri" type="string"/>
+      <arg name="x" type="fixed" summary="surface local coords"/>
+      <arg name="y" type="fixed" summary="surface local coords"/>
+    </request>
+    <request name="deactivate_uri">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="uri" type="string"/>
+    </request>
+    <request name="open_uri">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="uri" type="string"/>
+    </request>
+
+    <event name="fetching_uri">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="uri" type="string"/>
+    </event>
+    <event name="completed_uri">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="uri" type="string"/>
+      <arg name="valid" type="int" summary="1 if uri can be displayed, else 
0"/>
+    </event>
+    <event name="fetch_info">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="uri" type="string"/>
+      <arg name="progress" type="uint" summary="percentage of download"/>
+    </event>
+  </interface>
+
+</protocol>

-- 


Reply via email to