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)
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 6e5804c..4458482 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,6 +79,8 @@ Session.vim
79/src/bin/ecore_con/efl_net_proxy_helper 79/src/bin/ecore_con/efl_net_proxy_helper
80 80
81#Once all protocols are generated these will use wildcards 81#Once all protocols are generated these will use wildcards
82/src/lib/ecore_wl2/www-client-protocol.h
83/src/lib/ecore_wl2/www-protocol.c
82/src/lib/ecore_wl2/teamwork-client-protocol.h 84/src/lib/ecore_wl2/teamwork-client-protocol.h
83/src/lib/ecore_wl2/teamwork-protocol.c 85/src/lib/ecore_wl2/teamwork-protocol.c
84/src/lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h 86/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 56d2ebe..7e0789f 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 \
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 \
16lib/ecore_wl2/xdg-shell-unstable-v5-protocol.c \ 16lib/ecore_wl2/xdg-shell-unstable-v5-protocol.c \
17lib/ecore_wl2/www-protocol.h \ 17lib/ecore_wl2/www-client-protocol.h \
18lib/ecore_wl2/www-protocol.c \ 18lib/ecore_wl2/www-protocol.c \
19lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \ 19lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
20lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h \ 20lib/ecore_wl2/linux-dmabuf-unstable-v1-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/www-client-protocol.h \
40 lib/ecore_wl2/www-protocol.c \
39 lib/ecore_wl2/teamwork-protocol.c \ 41 lib/ecore_wl2/teamwork-protocol.c \
40 lib/ecore_wl2/teamwork-client-protocol.h \ 42 lib/ecore_wl2/teamwork-client-protocol.h \
41 lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \ 43 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 5ea5bab..c601e59 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -4,7 +4,7 @@
4# include <unistd.h> 4# include <unistd.h>
5# include "Ecore_Wl2.h" 5# include "Ecore_Wl2.h"
6# include "Ecore_Input.h" 6# include "Ecore_Input.h"
7# include "www-protocol.h" 7# include "www-client-protocol.h"
8 8
9#define EFL_TEAMWORK_VERSION 2 9#define EFL_TEAMWORK_VERSION 2
10# include "teamwork-client-protocol.h" 10# 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 952b333..0000000
--- a/src/lib/ecore_wl2/www-protocol.c
+++ /dev/null
@@ -1,41 +0,0 @@
1#include <stdlib.h>
2#include <stdint.h>
3#include "wayland-util.h"
4
5extern const struct wl_interface wl_surface_interface;
6extern const struct wl_interface www_surface_interface;
7
8static const struct wl_interface *types[] = {
9 NULL,
10 NULL,
11 NULL,
12 &www_surface_interface,
13 &wl_surface_interface,
14};
15
16static const struct wl_message www_requests[] = {
17 { "create", "no", types + 3 },
18};
19
20WL_EXPORT const struct wl_interface www_interface = {
21 "www", 1,
22 1, www_requests,
23 0, NULL,
24};
25
26static const struct wl_message www_surface_requests[] = {
27 { "destroy", "", types + 0 },
28};
29
30static const struct wl_message www_surface_events[] = {
31 { "status", "iiu", types + 0 },
32 { "start_drag", "", types + 0 },
33 { "end_drag", "", types + 0 },
34};
35
36WL_EXPORT const struct wl_interface www_surface_interface = {
37 "www_surface", 1,
38 1, www_surface_requests,
39 3, www_surface_events,
40};
41
diff --git a/src/lib/ecore_wl2/www-protocol.h b/src/lib/ecore_wl2/www-protocol.h
deleted file mode 100644
index b7d553d..0000000
--- a/src/lib/ecore_wl2/www-protocol.h
+++ /dev/null
@@ -1,134 +0,0 @@
1#ifndef ZWP_WWW_CLIENT_PROTOCOL_H
2#define ZWP_WWW_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 www;
17struct www_surface;
18
19extern const struct wl_interface www_interface;
20extern const struct wl_interface www_surface_interface;
21
22#define WWW_CREATE 0
23
24#define WWW_CREATE_SINCE_VERSION 1
25
26static inline void
27www_set_user_data(struct www *www, void *user_data)
28{
29 wl_proxy_set_user_data((struct wl_proxy *) www, user_data);
30}
31
32static inline void *
33www_get_user_data(struct www *www)
34{
35 return wl_proxy_get_user_data((struct wl_proxy *) www);
36}
37
38static inline uint32_t
39www_get_version(struct www *www)
40{
41 return wl_proxy_get_version((struct wl_proxy *) www);
42}
43
44static inline void
45www_destroy(struct www *www)
46{
47 wl_proxy_destroy((struct wl_proxy *) www);
48}
49
50static inline struct www_surface *
51www_create(struct www *www, struct wl_surface *surface)
52{
53 struct wl_proxy *id;
54
55 id = wl_proxy_marshal_constructor((struct wl_proxy *) www,
56 WWW_CREATE, &www_surface_interface, NULL, surface);
57
58 return (struct www_surface *) id;
59}
60
61struct www_surface_listener {
62 /**
63 * status - Status update on a www_surface
64 * @x_rel: (none)
65 * @y_rel: (none)
66 * @timestamp: (none)
67 *
68 *
69 */
70 void (*status)(void *data,
71 struct www_surface *www_surface,
72 int32_t x_rel,
73 int32_t y_rel,
74 uint32_t timestamp);
75 /**
76 * start_drag - Drag has started
77 *
78 *
79 */
80 void (*start_drag)(void *data,
81 struct www_surface *www_surface);
82 /**
83 * end_drag - Drag has ended
84 *
85 *
86 */
87 void (*end_drag)(void *data,
88 struct www_surface *www_surface);
89};
90
91static inline int
92www_surface_add_listener(struct www_surface *www_surface,
93 const struct www_surface_listener *listener, void *data)
94{
95 return wl_proxy_add_listener((struct wl_proxy *) www_surface,
96 (void (**)(void)) listener, data);
97}
98
99#define WWW_SURFACE_DESTROY 0
100
101#define WWW_SURFACE_DESTROY_SINCE_VERSION 1
102
103static inline void
104www_surface_set_user_data(struct www_surface *www_surface, void *user_data)
105{
106 wl_proxy_set_user_data((struct wl_proxy *) www_surface, user_data);
107}
108
109static inline void *
110www_surface_get_user_data(struct www_surface *www_surface)
111{
112 return wl_proxy_get_user_data((struct wl_proxy *) www_surface);
113}
114
115static inline uint32_t
116www_surface_get_version(struct www_surface *www_surface)
117{
118 return wl_proxy_get_version((struct wl_proxy *) www_surface);
119}
120
121static inline void
122www_surface_destroy(struct www_surface *www_surface)
123{
124 wl_proxy_marshal((struct wl_proxy *) www_surface,
125 WWW_SURFACE_DESTROY);
126
127 wl_proxy_destroy((struct wl_proxy *) www_surface);
128}
129
130#ifdef __cplusplus
131}
132#endif
133
134#endif
diff --git a/src/wayland_protocol/www.xml b/src/wayland_protocol/www.xml
new file mode 100644
index 0000000..8d45517
--- /dev/null
+++ b/src/wayland_protocol/www.xml
@@ -0,0 +1,28 @@
1<protocol name="zwp_www">
2 <interface name="www" version="1">
3 <request name="create">
4 <description summary="Create an object for WWW notifications">
5 </description>
6 <arg name="id" type="new_id" interface="www_surface"/>
7 <arg name="surface" type="object" interface="wl_surface"/>
8 </request>
9 </interface>
10 <interface name="www_surface" version="1">
11 <event name="status">
12 <description summary="Status update on a www_surface"></description>
13 <arg name="x_rel" type="int"/>
14 <arg name="y_rel" type="int"/>
15 <arg name="timestamp" type="uint"/>
16 </event>
17 <event name="start_drag">
18 <description summary="Drag has started"></description>
19 </event>
20 <event name="end_drag">
21 <description summary="Drag has ended"></description>
22 </event>
23 <request name="destroy" type="destructor">
24 <description summary="Destroy a www_surface">
25 </description>
26 </request>
27 </interface>
28</protocol>