summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-10-11 14:10:30 -0300
committerRafael Antognolli <rafael.antognolli@intel.com>2013-10-11 14:26:34 -0300
commitc4f1e67686d05fa29215a173d40be6f973f91840 (patch)
tree0e23f0750b45867696c447435e9c05cd34815bdb
parentac89c082a4962cae00e5d1b92e633bc0f36f5f34 (diff)
ecore/wayland: Do not generate subsurface source files.
Add them to the tree, so they don't need to be generated again on each build. Also remove the autofoo code used for generating them.
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile_Ecore_Wayland.am18
-rw-r--r--src/lib/ecore_wayland/.gitignore2
-rw-r--r--src/lib/ecore_wayland/subsurface-client-protocol.h167
-rw-r--r--src/lib/ecore_wayland/subsurface-protocol.c71
5 files changed, 239 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index 8938381bcc..74331770f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1008,7 +1008,6 @@ AC_ARG_ENABLE([wayland],
1008 1008
1009if test "${want_wayland}" = "yes"; then 1009if test "${want_wayland}" = "yes"; then
1010 EFL_PKG_CHECK_STRICT([wayland-client]) 1010 EFL_PKG_CHECK_STRICT([wayland-client])
1011 AC_PATH_PROG([wayland_scanner], [wayland-scanner], [AC_MSG_ERROR("wayland-scanner is needed to compile ecore_wayland protocol")])
1012fi 1011fi
1013 1012
1014# Fb 1013# Fb
diff --git a/src/Makefile_Ecore_Wayland.am b/src/Makefile_Ecore_Wayland.am
index b2c66a19cb..f11c3a5f74 100644
--- a/src/Makefile_Ecore_Wayland.am
+++ b/src/Makefile_Ecore_Wayland.am
@@ -15,29 +15,13 @@ lib/ecore_wayland/ecore_wl_input.c \
15lib/ecore_wayland/ecore_wl_output.c \ 15lib/ecore_wayland/ecore_wl_output.c \
16lib/ecore_wayland/ecore_wl_window.c \ 16lib/ecore_wayland/ecore_wl_window.c \
17lib/ecore_wayland/ecore_wl_subsurf.c \ 17lib/ecore_wayland/ecore_wl_subsurf.c \
18lib/ecore_wayland/ecore_wl_private.h 18lib/ecore_wayland/ecore_wl_private.h \
19
20lib_ecore_wayland_libecore_wayland_la_BUILT_SOURCES = \
21lib/ecore_wayland/subsurface-protocol.c \ 19lib/ecore_wayland/subsurface-protocol.c \
22lib/ecore_wayland/subsurface-client-protocol.h 20lib/ecore_wayland/subsurface-client-protocol.h
23 21
24CLEANFILES += $(lib_ecore_wayland_libecore_wayland_la_BUILT_SOURCES)
25
26lib_ecore_wayland_libecore_wayland_la_SOURCES += $(lib_ecore_wayland_libecore_wayland_la_BUILT_SOURCES)
27
28BUILT_SOURCES += $(lib_ecore_wayland_libecore_wayland_la_BUILT_SOURCES)
29
30lib_ecore_wayland_libecore_wayland_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WAYLAND_CFLAGS@ 22lib_ecore_wayland_libecore_wayland_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WAYLAND_CFLAGS@
31lib_ecore_wayland_libecore_wayland_la_LIBADD = @ECORE_WAYLAND_LIBS@ 23lib_ecore_wayland_libecore_wayland_la_LIBADD = @ECORE_WAYLAND_LIBS@
32lib_ecore_wayland_libecore_wayland_la_DEPENDENCIES = @ECORE_WAYLAND_INTERNAL_LIBS@ 24lib_ecore_wayland_libecore_wayland_la_DEPENDENCIES = @ECORE_WAYLAND_INTERNAL_LIBS@
33lib_ecore_wayland_libecore_wayland_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ 25lib_ecore_wayland_libecore_wayland_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
34 26
35wayland_protocoldir = $(top_srcdir)/data/ecore/ecore_wayland/protocol
36
37lib/ecore_wayland/subsurface-protocol.c: $(wayland_protocoldir)/subsurface.xml
38 $(AM_V_GEN)$(wayland_scanner) code < $< > $@
39
40lib/ecore_wayland/subsurface-client-protocol.h: $(wayland_protocoldir)/subsurface.xml
41 $(AM_V_GEN)$(wayland_scanner) client-header < $< > $@
42
43endif 27endif
diff --git a/src/lib/ecore_wayland/.gitignore b/src/lib/ecore_wayland/.gitignore
deleted file mode 100644
index ce73befd85..0000000000
--- a/src/lib/ecore_wayland/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
1subsurface-protocol.c
2subsurface-client-protocol.h
diff --git a/src/lib/ecore_wayland/subsurface-client-protocol.h b/src/lib/ecore_wayland/subsurface-client-protocol.h
new file mode 100644
index 0000000000..5161589552
--- /dev/null
+++ b/src/lib/ecore_wayland/subsurface-client-protocol.h
@@ -0,0 +1,167 @@
1/*
2 * Copyright © 2012-2013 Collabora, Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this
5 * software and its documentation for any purpose is hereby granted
6 * without fee, provided that the above copyright notice appear in
7 * all copies and that both that copyright notice and this permission
8 * notice appear in supporting documentation, and that the name of
9 * the copyright holders not be used in advertising or publicity
10 * pertaining to distribution of the software without specific,
11 * written prior permission. The copyright holders make no
12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied
14 * warranty.
15 *
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
21 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
23 * THIS SOFTWARE.
24 */
25
26#ifndef SUBSURFACE_CLIENT_PROTOCOL_H
27#define SUBSURFACE_CLIENT_PROTOCOL_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <stdint.h>
34#include <stddef.h>
35#include "wayland-client.h"
36
37struct wl_client;
38struct wl_resource;
39
40struct wl_subcompositor;
41struct wl_subsurface;
42
43extern const struct wl_interface wl_subcompositor_interface;
44extern const struct wl_interface wl_subsurface_interface;
45
46#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
47#define WL_SUBCOMPOSITOR_ERROR_ENUM
48enum wl_subcompositor_error {
49 WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
50};
51#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
52
53#define WL_SUBCOMPOSITOR_DESTROY 0
54#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1
55
56static inline void
57wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)
58{
59 wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);
60}
61
62static inline void *
63wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)
64{
65 return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);
66}
67
68static inline void
69wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)
70{
71 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
72 WL_SUBCOMPOSITOR_DESTROY);
73
74 wl_proxy_destroy((struct wl_proxy *) wl_subcompositor);
75}
76
77static inline struct wl_subsurface *
78wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)
79{
80 struct wl_proxy *id;
81
82 id = wl_proxy_create((struct wl_proxy *) wl_subcompositor,
83 &wl_subsurface_interface);
84 if (!id)
85 return NULL;
86
87 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
88 WL_SUBCOMPOSITOR_GET_SUBSURFACE, id, surface, parent);
89
90 return (struct wl_subsurface *) id;
91}
92
93#ifndef WL_SUBSURFACE_ERROR_ENUM
94#define WL_SUBSURFACE_ERROR_ENUM
95enum wl_subsurface_error {
96 WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
97};
98#endif /* WL_SUBSURFACE_ERROR_ENUM */
99
100#define WL_SUBSURFACE_DESTROY 0
101#define WL_SUBSURFACE_SET_POSITION 1
102#define WL_SUBSURFACE_PLACE_ABOVE 2
103#define WL_SUBSURFACE_PLACE_BELOW 3
104#define WL_SUBSURFACE_SET_SYNC 4
105#define WL_SUBSURFACE_SET_DESYNC 5
106
107static inline void
108wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)
109{
110 wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);
111}
112
113static inline void *
114wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)
115{
116 return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);
117}
118
119static inline void
120wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)
121{
122 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
123 WL_SUBSURFACE_DESTROY);
124
125 wl_proxy_destroy((struct wl_proxy *) wl_subsurface);
126}
127
128static inline void
129wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)
130{
131 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
132 WL_SUBSURFACE_SET_POSITION, x, y);
133}
134
135static inline void
136wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
137{
138 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
139 WL_SUBSURFACE_PLACE_ABOVE, sibling);
140}
141
142static inline void
143wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
144{
145 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
146 WL_SUBSURFACE_PLACE_BELOW, sibling);
147}
148
149static inline void
150wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)
151{
152 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
153 WL_SUBSURFACE_SET_SYNC);
154}
155
156static inline void
157wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)
158{
159 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
160 WL_SUBSURFACE_SET_DESYNC);
161}
162
163#ifdef __cplusplus
164}
165#endif
166
167#endif
diff --git a/src/lib/ecore_wayland/subsurface-protocol.c b/src/lib/ecore_wayland/subsurface-protocol.c
new file mode 100644
index 0000000000..986c72a66c
--- /dev/null
+++ b/src/lib/ecore_wayland/subsurface-protocol.c
@@ -0,0 +1,71 @@
1/*
2 * Copyright © 2012-2013 Collabora, Ltd.
3 *
4 * Permission to use, copy, modify, distribute, and sell this
5 * software and its documentation for any purpose is hereby granted
6 * without fee, provided that the above copyright notice appear in
7 * all copies and that both that copyright notice and this permission
8 * notice appear in supporting documentation, and that the name of
9 * the copyright holders not be used in advertising or publicity
10 * pertaining to distribution of the software without specific,
11 * written prior permission. The copyright holders make no
12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied
14 * warranty.
15 *
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
21 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
23 * THIS SOFTWARE.
24 */
25
26#include <stdlib.h>
27#include <stdint.h>
28#include "wayland-util.h"
29
30extern const struct wl_interface wl_subsurface_interface;
31extern const struct wl_interface wl_surface_interface;
32extern const struct wl_interface wl_surface_interface;
33extern const struct wl_interface wl_surface_interface;
34extern const struct wl_interface wl_surface_interface;
35
36static const struct wl_interface *types[] = {
37 NULL,
38 NULL,
39 &wl_subsurface_interface,
40 &wl_surface_interface,
41 &wl_surface_interface,
42 &wl_surface_interface,
43 &wl_surface_interface,
44};
45
46static const struct wl_message wl_subcompositor_requests[] = {
47 { "destroy", "", types + 0 },
48 { "get_subsurface", "noo", types + 2 },
49};
50
51WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
52 "wl_subcompositor", 1,
53 2, wl_subcompositor_requests,
54 0, NULL,
55};
56
57static const struct wl_message wl_subsurface_requests[] = {
58 { "destroy", "", types + 0 },
59 { "set_position", "ii", types + 0 },
60 { "place_above", "o", types + 5 },
61 { "place_below", "o", types + 6 },
62 { "set_sync", "", types + 0 },
63 { "set_desync", "", types + 0 },
64};
65
66WL_EXPORT const struct wl_interface wl_subsurface_interface = {
67 "wl_subsurface", 1,
68 6, wl_subsurface_requests,
69 0, NULL,
70};
71