summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-01-18 10:03:44 -0600
committerDerek Foreman <derekf@osg.samsung.com>2017-01-18 13:04:48 -0600
commit2aa8b5acadceaa7815d7320b7a2322f64c44a313 (patch)
treefb5472bc264bb7aebc5acfd72d649172217dafd8 /src
parent5b25ff3281d072746b1414f4c9b8ab5a4b0fbd6a (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Ecore_Wl2.am6
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_private.h2
-rw-r--r--src/lib/ecore_wl2/teamwork_protocol.c46
-rw-r--r--src/lib/ecore_wl2/teamwork_protocol.h128
-rw-r--r--src/wayland_protocol/teamwork.xml39
5 files changed, 44 insertions, 177 deletions
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@
8dist_installed_ecorewl2mainheaders_DATA = lib/ecore_wl2/Ecore_Wl2.h 8dist_installed_ecorewl2mainheaders_DATA = lib/ecore_wl2/Ecore_Wl2.h
9 9
10lib_ecore_wl2_libecore_wl2_la_SOURCES = \ 10lib_ecore_wl2_libecore_wl2_la_SOURCES = \
11lib/ecore_wl2/teamwork_protocol.c \ 11lib/ecore_wl2/teamwork-protocol.c \
12lib/ecore_wl2/teamwork_protocol.h \ 12lib/ecore_wl2/teamwork-client-protocol.h \
13lib/ecore_wl2/session-recovery-client-protocol.h \ 13lib/ecore_wl2/session-recovery-client-protocol.h \
14lib/ecore_wl2/session-recovery-protocol.c \ 14lib/ecore_wl2/session-recovery-protocol.c \
15lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \ 15lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \
@@ -36,6 +36,8 @@ lib_ecore_wl2_libecore_wl2_la_DEPENDENCIES = @ECORE_WL2_INTERNAL_LIBS@
36lib_ecore_wl2_libecore_wl2_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ 36lib_ecore_wl2_libecore_wl2_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
37 37
38BUILT_SOURCES += \ 38BUILT_SOURCES += \
39 lib/ecore_wl2/teamwork-protocol.c \
40 lib/ecore_wl2/teamwork-client-protocol.h \
39 lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \ 41 lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
40 lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \ 42 lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \
41 lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \ 43 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 @@
7# include "www-protocol.h" 7# include "www-protocol.h"
8 8
9#define EFL_TEAMWORK_VERSION 2 9#define EFL_TEAMWORK_VERSION 2
10# include "teamwork_protocol.h" 10# include "teamwork-client-protocol.h"
11 11
12# include "xdg-shell-unstable-v5-client-protocol.h" 12# include "xdg-shell-unstable-v5-client-protocol.h"
13# define XDG_V5_UNSTABLE_VERSION 5 13# 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 @@
1#include <stdlib.h>
2#include <stdint.h>
3#include "wayland-util.h"
4
5extern const struct wl_interface wl_surface_interface;
6
7static const struct wl_interface *types[] = {
8 &wl_surface_interface,
9 NULL,
10 &wl_surface_interface,
11 NULL,
12 NULL,
13 NULL,
14 &wl_surface_interface,
15 NULL,
16 &wl_surface_interface,
17 NULL,
18 &wl_surface_interface,
19 NULL,
20 &wl_surface_interface,
21 NULL,
22 NULL,
23 &wl_surface_interface,
24 NULL,
25 NULL,
26};
27
28static const struct wl_message zwp_teamwork_requests[] = {
29 { "preload_uri", "os", types + 0 },
30 { "activate_uri", "osff", types + 2 },
31 { "deactivate_uri", "os", types + 6 },
32 { "open_uri", "os", types + 8 },
33};
34
35static const struct wl_message zwp_teamwork_events[] = {
36 { "fetching_uri", "os", types + 10 },
37 { "completed_uri", "osi", types + 12 },
38 { "fetch_info", "osu", types + 15 },
39};
40
41WL_EXPORT const struct wl_interface zwp_teamwork_interface = {
42 "zwp_teamwork", 2,
43 4, zwp_teamwork_requests,
44 3, zwp_teamwork_events,
45};
46
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 @@
1#ifndef TEAMWORK_CLIENT_PROTOCOL_H
2#define TEAMWORK_CLIENT_PROTOCOL_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9#include <stddef.h>
10#include "wayland-client.h"
11
12struct wl_client;
13struct wl_resource;
14
15struct wl_surface;
16struct zwp_teamwork;
17
18extern const struct wl_interface zwp_teamwork_interface;
19
20struct zwp_teamwork_listener {
21 /**
22 * fetching_uri - (none)
23 * @surface: (none)
24 * @uri: (none)
25 */
26 void (*fetching_uri)(void *data,
27 struct zwp_teamwork *zwp_teamwork,
28 struct wl_surface *surface,
29 const char *uri);
30 /**
31 * completed_uri - (none)
32 * @surface: (none)
33 * @uri: (none)
34 * @valid: 1 if uri can be displayed, else 0
35 */
36 void (*completed_uri)(void *data,
37 struct zwp_teamwork *zwp_teamwork,
38 struct wl_surface *surface,
39 const char *uri,
40 int32_t valid);
41 /**
42 * fetch_info - (none)
43 * @surface: (none)
44 * @uri: (none)
45 * @progress: percentage of download
46 */
47 void (*fetch_info)(void *data,
48 struct zwp_teamwork *zwp_teamwork,
49 struct wl_surface *surface,
50 const char *uri,
51 uint32_t progress);
52};
53
54static inline int
55zwp_teamwork_add_listener(struct zwp_teamwork *zwp_teamwork,
56 const struct zwp_teamwork_listener *listener, void *data)
57{
58 return wl_proxy_add_listener((struct wl_proxy *) zwp_teamwork,
59 (void (**)(void)) listener, data);
60}
61
62#define ZWP_TEAMWORK_PRELOAD_URI 0
63#define ZWP_TEAMWORK_ACTIVATE_URI 1
64#define ZWP_TEAMWORK_DEACTIVATE_URI 2
65#define ZWP_TEAMWORK_OPEN_URI 3
66
67#define ZWP_TEAMWORK_PRELOAD_URI_SINCE_VERSION 1
68#define ZWP_TEAMWORK_ACTIVATE_URI_SINCE_VERSION 1
69#define ZWP_TEAMWORK_DEACTIVATE_URI_SINCE_VERSION 1
70#define ZWP_TEAMWORK_OPEN_URI_SINCE_VERSION 1
71
72static inline void
73zwp_teamwork_set_user_data(struct zwp_teamwork *zwp_teamwork, void *user_data)
74{
75 wl_proxy_set_user_data((struct wl_proxy *) zwp_teamwork, user_data);
76}
77
78static inline void *
79zwp_teamwork_get_user_data(struct zwp_teamwork *zwp_teamwork)
80{
81 return wl_proxy_get_user_data((struct wl_proxy *) zwp_teamwork);
82}
83
84static inline uint32_t
85zwp_teamwork_get_version(struct zwp_teamwork *zwp_teamwork)
86{
87 return wl_proxy_get_version((struct wl_proxy *) zwp_teamwork);
88}
89
90static inline void
91zwp_teamwork_destroy(struct zwp_teamwork *zwp_teamwork)
92{
93 wl_proxy_destroy((struct wl_proxy *) zwp_teamwork);
94}
95
96static inline void
97zwp_teamwork_preload_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri)
98{
99 wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
100 ZWP_TEAMWORK_PRELOAD_URI, surface, uri);
101}
102
103static inline void
104zwp_teamwork_activate_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri, wl_fixed_t x, wl_fixed_t y)
105{
106 wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
107 ZWP_TEAMWORK_ACTIVATE_URI, surface, uri, x, y);
108}
109
110static inline void
111zwp_teamwork_deactivate_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri)
112{
113 wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
114 ZWP_TEAMWORK_DEACTIVATE_URI, surface, uri);
115}
116
117static inline void
118zwp_teamwork_open_uri(struct zwp_teamwork *zwp_teamwork, struct wl_surface *surface, const char *uri)
119{
120 wl_proxy_marshal((struct wl_proxy *) zwp_teamwork,
121 ZWP_TEAMWORK_OPEN_URI, surface, uri);
122}
123
124#ifdef __cplusplus
125}
126#endif
127
128#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 @@
1<protocol name="teamwork">
2
3 <interface name="zwp_teamwork" version="2">
4 <request name="preload_uri">
5 <arg name="surface" type="object" interface="wl_surface"/>
6 <arg name="uri" type="string"/>
7 </request>
8 <request name="activate_uri">
9 <arg name="surface" type="object" interface="wl_surface"/>
10 <arg name="uri" type="string"/>
11 <arg name="x" type="fixed" summary="surface local coords"/>
12 <arg name="y" type="fixed" summary="surface local coords"/>
13 </request>
14 <request name="deactivate_uri">
15 <arg name="surface" type="object" interface="wl_surface"/>
16 <arg name="uri" type="string"/>
17 </request>
18 <request name="open_uri">
19 <arg name="surface" type="object" interface="wl_surface"/>
20 <arg name="uri" type="string"/>
21 </request>
22
23 <event name="fetching_uri">
24 <arg name="surface" type="object" interface="wl_surface"/>
25 <arg name="uri" type="string"/>
26 </event>
27 <event name="completed_uri">
28 <arg name="surface" type="object" interface="wl_surface"/>
29 <arg name="uri" type="string"/>
30 <arg name="valid" type="int" summary="1 if uri can be displayed, else 0"/>
31 </event>
32 <event name="fetch_info">
33 <arg name="surface" type="object" interface="wl_surface"/>
34 <arg name="uri" type="string"/>
35 <arg name="progress" type="uint" summary="percentage of download"/>
36 </event>
37 </interface>
38
39</protocol>