1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef ALPHA_COMPOSITING_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define ALPHA_COMPOSITING_UNSTABLE_V1_CLIENT_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /**
15 * @page page_alpha_compositing_unstable_v1 The alpha_compositing_unstable_v1 protocol
16 * Protocol for more advanced compositing and blending
17 *
18 * @section page_desc_alpha_compositing_unstable_v1 Description
19 *
20 * This protocol specifies a set of interfaces used to control the alpha
21 * compositing and blending of contents.
22 *
23 * Warning! The protocol described in this file is experimental and backward
24 * incompatible changes may be made. Backward compatible changes may be added
25 * together with the corresponding interface version bump. Backward
26 * incompatible changes are done by bumping the version number in the protocol
27 * and interface names and resetting the interface version. Once the protocol
28 * is to be declared stable, the 'z' prefix and the version number in the
29 * protocol and interface names are removed and the interface version number is
30 * reset.
31 *
32 * @section page_ifaces_alpha_compositing_unstable_v1 Interfaces
33 * - @subpage page_iface_zcr_alpha_compositing_v1 - alpha_compositing
34 * - @subpage page_iface_zcr_blending_v1 - blending interface to a wl_surface
35 * @section page_copyright_alpha_compositing_unstable_v1 Copyright
36 * <pre>
37 *
38 * Copyright 2016 The Chromium Authors
39 *
40 * Permission is hereby granted, free of charge, to any person obtaining a
41 * copy of this software and associated documentation files (the "Software"),
42 * to deal in the Software without restriction, including without limitation
43 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
44 * and/or sell copies of the Software, and to permit persons to whom the
45 * Software is furnished to do so, subject to the following conditions:
46 *
47 * The above copyright notice and this permission notice (including the next
48 * paragraph) shall be included in all copies or substantial portions of the
49 * Software.
50 *
51 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
54 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
56 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
57 * DEALINGS IN THE SOFTWARE.
58 * </pre>
59 */
60 struct wl_surface;
61 struct zcr_alpha_compositing_v1;
62 struct zcr_blending_v1;
63
64 #ifndef ZCR_ALPHA_COMPOSITING_V1_INTERFACE
65 #define ZCR_ALPHA_COMPOSITING_V1_INTERFACE
66 /**
67 * @page page_iface_zcr_alpha_compositing_v1 zcr_alpha_compositing_v1
68 * @section page_iface_zcr_alpha_compositing_v1_desc Description
69 *
70 * The global interface exposing compositing and blending capabilities is
71 * used to instantiate an interface extension for a wl_surface object.
72 * This extended interface will then allow the client to specify the
73 * blending equation and alpha value used for compositing the wl_surface.
74 * @section page_iface_zcr_alpha_compositing_v1_api API
75 * See @ref iface_zcr_alpha_compositing_v1.
76 */
77 /**
78 * @defgroup iface_zcr_alpha_compositing_v1 The zcr_alpha_compositing_v1 interface
79 *
80 * The global interface exposing compositing and blending capabilities is
81 * used to instantiate an interface extension for a wl_surface object.
82 * This extended interface will then allow the client to specify the
83 * blending equation and alpha value used for compositing the wl_surface.
84 */
85 extern const struct wl_interface zcr_alpha_compositing_v1_interface;
86 #endif
87 #ifndef ZCR_BLENDING_V1_INTERFACE
88 #define ZCR_BLENDING_V1_INTERFACE
89 /**
90 * @page page_iface_zcr_blending_v1 zcr_blending_v1
91 * @section page_iface_zcr_blending_v1_desc Description
92 *
93 * An additional interface to a wl_surface object, which allows the
94 * client to specify the blending equation used for compositing and
95 * an alpha value applied to the whole surface.
96 *
97 * If the wl_surface associated with the bledning object is destroyed,
98 * the blending object becomes inert.
99 *
100 * If the blending object is destroyed, the blending state is removed
101 * from the wl_surface. The change will be applied on the next
102 * wl_surface.commit.
103 * @section page_iface_zcr_blending_v1_api API
104 * See @ref iface_zcr_blending_v1.
105 */
106 /**
107 * @defgroup iface_zcr_blending_v1 The zcr_blending_v1 interface
108 *
109 * An additional interface to a wl_surface object, which allows the
110 * client to specify the blending equation used for compositing and
111 * an alpha value applied to the whole surface.
112 *
113 * If the wl_surface associated with the bledning object is destroyed,
114 * the blending object becomes inert.
115 *
116 * If the blending object is destroyed, the blending state is removed
117 * from the wl_surface. The change will be applied on the next
118 * wl_surface.commit.
119 */
120 extern const struct wl_interface zcr_blending_v1_interface;
121 #endif
122
123 #ifndef ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM
124 #define ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM
125 enum zcr_alpha_compositing_v1_error {
126 /**
127 * the surface already has a blending object associated
128 */
129 ZCR_ALPHA_COMPOSITING_V1_ERROR_BLENDING_EXISTS = 0,
130 };
131 #endif /* ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM */
132
133 #define ZCR_ALPHA_COMPOSITING_V1_DESTROY 0
134 #define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING 1
135
136
137 /**
138 * @ingroup iface_zcr_alpha_compositing_v1
139 */
140 #define ZCR_ALPHA_COMPOSITING_V1_DESTROY_SINCE_VERSION 1
141 /**
142 * @ingroup iface_zcr_alpha_compositing_v1
143 */
144 #define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING_SINCE_VERSION 1
145
146 /** @ingroup iface_zcr_alpha_compositing_v1 */
147 static inline void
zcr_alpha_compositing_v1_set_user_data(struct zcr_alpha_compositing_v1 * zcr_alpha_compositing_v1,void * user_data)148 zcr_alpha_compositing_v1_set_user_data(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1, void *user_data)
149 {
150 wl_proxy_set_user_data((struct wl_proxy *) zcr_alpha_compositing_v1, user_data);
151 }
152
153 /** @ingroup iface_zcr_alpha_compositing_v1 */
154 static inline void *
zcr_alpha_compositing_v1_get_user_data(struct zcr_alpha_compositing_v1 * zcr_alpha_compositing_v1)155 zcr_alpha_compositing_v1_get_user_data(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1)
156 {
157 return wl_proxy_get_user_data((struct wl_proxy *) zcr_alpha_compositing_v1);
158 }
159
160 static inline uint32_t
zcr_alpha_compositing_v1_get_version(struct zcr_alpha_compositing_v1 * zcr_alpha_compositing_v1)161 zcr_alpha_compositing_v1_get_version(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1)
162 {
163 return wl_proxy_get_version((struct wl_proxy *) zcr_alpha_compositing_v1);
164 }
165
166 /**
167 * @ingroup iface_zcr_alpha_compositing_v1
168 *
169 * Informs the server that the client will not be using this
170 * protocol object anymore. This does not affect any other objects,
171 * blending objects included.
172 */
173 static inline void
zcr_alpha_compositing_v1_destroy(struct zcr_alpha_compositing_v1 * zcr_alpha_compositing_v1)174 zcr_alpha_compositing_v1_destroy(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1)
175 {
176 wl_proxy_marshal_flags((struct wl_proxy *) zcr_alpha_compositing_v1,
177 ZCR_ALPHA_COMPOSITING_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_alpha_compositing_v1), WL_MARSHAL_FLAG_DESTROY);
178 }
179
180 /**
181 * @ingroup iface_zcr_alpha_compositing_v1
182 *
183 * Instantiate an interface extension for the given wl_surface to
184 * provide surface blending. If the given wl_surface already has
185 * a blending object associated, the blending_exists protocol error
186 * is raised.
187 */
188 static inline struct zcr_blending_v1 *
zcr_alpha_compositing_v1_get_blending(struct zcr_alpha_compositing_v1 * zcr_alpha_compositing_v1,struct wl_surface * surface)189 zcr_alpha_compositing_v1_get_blending(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1, struct wl_surface *surface)
190 {
191 struct wl_proxy *id;
192
193 id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_alpha_compositing_v1,
194 ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING, &zcr_blending_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_alpha_compositing_v1), 0, NULL, surface);
195
196 return (struct zcr_blending_v1 *) id;
197 }
198
199 #ifndef ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM
200 #define ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM
201 /**
202 * @ingroup iface_zcr_blending_v1
203 * different blending equations for compositing
204 *
205 * Blending equations that can be used when compositing a surface.
206 */
207 enum zcr_blending_v1_blending_equation {
208 /**
209 * no blending
210 */
211 ZCR_BLENDING_V1_BLENDING_EQUATION_NONE = 0,
212 /**
213 * one / one_minus_src_alpha
214 */
215 ZCR_BLENDING_V1_BLENDING_EQUATION_PREMULT = 1,
216 /**
217 * src_alpha / one_minus_src_alpha
218 */
219 ZCR_BLENDING_V1_BLENDING_EQUATION_COVERAGE = 2,
220 };
221 #endif /* ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM */
222
223 #define ZCR_BLENDING_V1_DESTROY 0
224 #define ZCR_BLENDING_V1_SET_BLENDING 1
225 #define ZCR_BLENDING_V1_SET_ALPHA 2
226
227
228 /**
229 * @ingroup iface_zcr_blending_v1
230 */
231 #define ZCR_BLENDING_V1_DESTROY_SINCE_VERSION 1
232 /**
233 * @ingroup iface_zcr_blending_v1
234 */
235 #define ZCR_BLENDING_V1_SET_BLENDING_SINCE_VERSION 1
236 /**
237 * @ingroup iface_zcr_blending_v1
238 */
239 #define ZCR_BLENDING_V1_SET_ALPHA_SINCE_VERSION 1
240
241 /** @ingroup iface_zcr_blending_v1 */
242 static inline void
zcr_blending_v1_set_user_data(struct zcr_blending_v1 * zcr_blending_v1,void * user_data)243 zcr_blending_v1_set_user_data(struct zcr_blending_v1 *zcr_blending_v1, void *user_data)
244 {
245 wl_proxy_set_user_data((struct wl_proxy *) zcr_blending_v1, user_data);
246 }
247
248 /** @ingroup iface_zcr_blending_v1 */
249 static inline void *
zcr_blending_v1_get_user_data(struct zcr_blending_v1 * zcr_blending_v1)250 zcr_blending_v1_get_user_data(struct zcr_blending_v1 *zcr_blending_v1)
251 {
252 return wl_proxy_get_user_data((struct wl_proxy *) zcr_blending_v1);
253 }
254
255 static inline uint32_t
zcr_blending_v1_get_version(struct zcr_blending_v1 * zcr_blending_v1)256 zcr_blending_v1_get_version(struct zcr_blending_v1 *zcr_blending_v1)
257 {
258 return wl_proxy_get_version((struct wl_proxy *) zcr_blending_v1);
259 }
260
261 /**
262 * @ingroup iface_zcr_blending_v1
263 *
264 * The associated wl_surface's blending state is removed.
265 * The change is applied on the next wl_surface.commit.
266 */
267 static inline void
zcr_blending_v1_destroy(struct zcr_blending_v1 * zcr_blending_v1)268 zcr_blending_v1_destroy(struct zcr_blending_v1 *zcr_blending_v1)
269 {
270 wl_proxy_marshal_flags((struct wl_proxy *) zcr_blending_v1,
271 ZCR_BLENDING_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_blending_v1), WL_MARSHAL_FLAG_DESTROY);
272 }
273
274 /**
275 * @ingroup iface_zcr_blending_v1
276 *
277 * Set the blending equation for compositing the wl_surface.
278 * See wp_alpha_compositing for the description.
279 *
280 * The blending equation state is double-buffered state,
281 * and will be applied on the next wl_surface.commit.
282 */
283 static inline void
zcr_blending_v1_set_blending(struct zcr_blending_v1 * zcr_blending_v1,uint32_t equation)284 zcr_blending_v1_set_blending(struct zcr_blending_v1 *zcr_blending_v1, uint32_t equation)
285 {
286 wl_proxy_marshal_flags((struct wl_proxy *) zcr_blending_v1,
287 ZCR_BLENDING_V1_SET_BLENDING, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_blending_v1), 0, equation);
288 }
289
290 /**
291 * @ingroup iface_zcr_blending_v1
292 *
293 * Set the alpha value applied to the whole surface for compositing.
294 * See wp_alpha_compositing for the description.
295 *
296 * The alpha value state is double-buffered state,
297 * and will be applied on the next wl_surface.commit.
298 */
299 static inline void
zcr_blending_v1_set_alpha(struct zcr_blending_v1 * zcr_blending_v1,wl_fixed_t value)300 zcr_blending_v1_set_alpha(struct zcr_blending_v1 *zcr_blending_v1, wl_fixed_t value)
301 {
302 wl_proxy_marshal_flags((struct wl_proxy *) zcr_blending_v1,
303 ZCR_BLENDING_V1_SET_ALPHA, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_blending_v1), 0, value);
304 }
305
306 #ifdef __cplusplus
307 }
308 #endif
309
310 #endif
311