1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef SECURE_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define SECURE_OUTPUT_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_secure_output_unstable_v1 The secure_output_unstable_v1 protocol
16 * Protocol for providing secure output
17 *
18 * @section page_desc_secure_output_unstable_v1 Description
19 *
20 * This protocol specifies a set of interfaces used to prevent surface
21 * contents from appearing in screenshots or from being visible on non-secure
22 * outputs.
23 *
24 * In order to prevent surface contents from appearing in screenshots or from
25 * being visible on non-secure outputs, a client must first bind the global
26 * interface "wp_secure_output" which, if a compositor supports secure output,
27 * is exposed by the registry. Using the bound global object, the client uses
28 * the "get_security" request to instantiate an interface extension for a
29 * wl_surface object. This extended interface will then allow surfaces
30 * to be marked as only visible on secure outputs.
31 *
32 * Warning! The protocol described in this file is experimental and backward
33 * incompatible changes may be made. Backward compatible changes may be added
34 * together with the corresponding interface version bump. Backward
35 * incompatible changes are done by bumping the version number in the protocol
36 * and interface names and resetting the interface version. Once the protocol
37 * is to be declared stable, the 'z' prefix and the version number in the
38 * protocol and interface names are removed and the interface version number is
39 * reset.
40 *
41 * @section page_ifaces_secure_output_unstable_v1 Interfaces
42 * - @subpage page_iface_zcr_secure_output_v1 - secure output
43 * - @subpage page_iface_zcr_security_v1 - security interface to a wl_surface
44 * @section page_copyright_secure_output_unstable_v1 Copyright
45 * <pre>
46 *
47 * Copyright 2016 The Chromium Authors
48 *
49 * Permission is hereby granted, free of charge, to any person obtaining a
50 * copy of this software and associated documentation files (the "Software"),
51 * to deal in the Software without restriction, including without limitation
52 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
53 * and/or sell copies of the Software, and to permit persons to whom the
54 * Software is furnished to do so, subject to the following conditions:
55 *
56 * The above copyright notice and this permission notice (including the next
57 * paragraph) shall be included in all copies or substantial portions of the
58 * Software.
59 *
60 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
61 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
63 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
64 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
65 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
66 * DEALINGS IN THE SOFTWARE.
67 * </pre>
68 */
69 struct wl_surface;
70 struct zcr_secure_output_v1;
71 struct zcr_security_v1;
72
73 #ifndef ZCR_SECURE_OUTPUT_V1_INTERFACE
74 #define ZCR_SECURE_OUTPUT_V1_INTERFACE
75 /**
76 * @page page_iface_zcr_secure_output_v1 zcr_secure_output_v1
77 * @section page_iface_zcr_secure_output_v1_desc Description
78 *
79 * The global interface exposing secure output capabilities is used
80 * to instantiate an interface extension for a wl_surface object.
81 * This extended interface will then allow surfaces to be marked as
82 * as only visible on secure outputs.
83 * @section page_iface_zcr_secure_output_v1_api API
84 * See @ref iface_zcr_secure_output_v1.
85 */
86 /**
87 * @defgroup iface_zcr_secure_output_v1 The zcr_secure_output_v1 interface
88 *
89 * The global interface exposing secure output capabilities is used
90 * to instantiate an interface extension for a wl_surface object.
91 * This extended interface will then allow surfaces to be marked as
92 * as only visible on secure outputs.
93 */
94 extern const struct wl_interface zcr_secure_output_v1_interface;
95 #endif
96 #ifndef ZCR_SECURITY_V1_INTERFACE
97 #define ZCR_SECURITY_V1_INTERFACE
98 /**
99 * @page page_iface_zcr_security_v1 zcr_security_v1
100 * @section page_iface_zcr_security_v1_desc Description
101 *
102 * An additional interface to a wl_surface object, which allows the
103 * client to specify that a surface should not appear in screenshots
104 * or be visible on non-secure outputs.
105 *
106 * If the wl_surface associated with the security object is destroyed,
107 * the security object becomes inert.
108 *
109 * If the security object is destroyed, the security state is removed
110 * from the wl_surface. The change will be applied on the next
111 * wl_surface.commit.
112 * @section page_iface_zcr_security_v1_api API
113 * See @ref iface_zcr_security_v1.
114 */
115 /**
116 * @defgroup iface_zcr_security_v1 The zcr_security_v1 interface
117 *
118 * An additional interface to a wl_surface object, which allows the
119 * client to specify that a surface should not appear in screenshots
120 * or be visible on non-secure outputs.
121 *
122 * If the wl_surface associated with the security object is destroyed,
123 * the security object becomes inert.
124 *
125 * If the security object is destroyed, the security state is removed
126 * from the wl_surface. The change will be applied on the next
127 * wl_surface.commit.
128 */
129 extern const struct wl_interface zcr_security_v1_interface;
130 #endif
131
132 #ifndef ZCR_SECURE_OUTPUT_V1_ERROR_ENUM
133 #define ZCR_SECURE_OUTPUT_V1_ERROR_ENUM
134 enum zcr_secure_output_v1_error {
135 /**
136 * the surface already has a security object associated
137 */
138 ZCR_SECURE_OUTPUT_V1_ERROR_SECURITY_EXISTS = 0,
139 };
140 #endif /* ZCR_SECURE_OUTPUT_V1_ERROR_ENUM */
141
142 #define ZCR_SECURE_OUTPUT_V1_DESTROY 0
143 #define ZCR_SECURE_OUTPUT_V1_GET_SECURITY 1
144
145
146 /**
147 * @ingroup iface_zcr_secure_output_v1
148 */
149 #define ZCR_SECURE_OUTPUT_V1_DESTROY_SINCE_VERSION 1
150 /**
151 * @ingroup iface_zcr_secure_output_v1
152 */
153 #define ZCR_SECURE_OUTPUT_V1_GET_SECURITY_SINCE_VERSION 1
154
155 /** @ingroup iface_zcr_secure_output_v1 */
156 static inline void
zcr_secure_output_v1_set_user_data(struct zcr_secure_output_v1 * zcr_secure_output_v1,void * user_data)157 zcr_secure_output_v1_set_user_data(struct zcr_secure_output_v1 *zcr_secure_output_v1, void *user_data)
158 {
159 wl_proxy_set_user_data((struct wl_proxy *) zcr_secure_output_v1, user_data);
160 }
161
162 /** @ingroup iface_zcr_secure_output_v1 */
163 static inline void *
zcr_secure_output_v1_get_user_data(struct zcr_secure_output_v1 * zcr_secure_output_v1)164 zcr_secure_output_v1_get_user_data(struct zcr_secure_output_v1 *zcr_secure_output_v1)
165 {
166 return wl_proxy_get_user_data((struct wl_proxy *) zcr_secure_output_v1);
167 }
168
169 static inline uint32_t
zcr_secure_output_v1_get_version(struct zcr_secure_output_v1 * zcr_secure_output_v1)170 zcr_secure_output_v1_get_version(struct zcr_secure_output_v1 *zcr_secure_output_v1)
171 {
172 return wl_proxy_get_version((struct wl_proxy *) zcr_secure_output_v1);
173 }
174
175 /**
176 * @ingroup iface_zcr_secure_output_v1
177 *
178 * Informs the server that the client will not be using this
179 * protocol object anymore. This does not affect any other objects,
180 * security objects included.
181 */
182 static inline void
zcr_secure_output_v1_destroy(struct zcr_secure_output_v1 * zcr_secure_output_v1)183 zcr_secure_output_v1_destroy(struct zcr_secure_output_v1 *zcr_secure_output_v1)
184 {
185 wl_proxy_marshal_flags((struct wl_proxy *) zcr_secure_output_v1,
186 ZCR_SECURE_OUTPUT_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_secure_output_v1), WL_MARSHAL_FLAG_DESTROY);
187 }
188
189 /**
190 * @ingroup iface_zcr_secure_output_v1
191 *
192 * Instantiate an interface extension for the given wl_surface to
193 * provide surface security. If the given wl_surface already has
194 * a security object associated, the security_exists protocol error
195 * is raised.
196 */
197 static inline struct zcr_security_v1 *
zcr_secure_output_v1_get_security(struct zcr_secure_output_v1 * zcr_secure_output_v1,struct wl_surface * surface)198 zcr_secure_output_v1_get_security(struct zcr_secure_output_v1 *zcr_secure_output_v1, struct wl_surface *surface)
199 {
200 struct wl_proxy *id;
201
202 id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_secure_output_v1,
203 ZCR_SECURE_OUTPUT_V1_GET_SECURITY, &zcr_security_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_secure_output_v1), 0, NULL, surface);
204
205 return (struct zcr_security_v1 *) id;
206 }
207
208 #define ZCR_SECURITY_V1_DESTROY 0
209 #define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT 1
210
211
212 /**
213 * @ingroup iface_zcr_security_v1
214 */
215 #define ZCR_SECURITY_V1_DESTROY_SINCE_VERSION 1
216 /**
217 * @ingroup iface_zcr_security_v1
218 */
219 #define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT_SINCE_VERSION 1
220
221 /** @ingroup iface_zcr_security_v1 */
222 static inline void
zcr_security_v1_set_user_data(struct zcr_security_v1 * zcr_security_v1,void * user_data)223 zcr_security_v1_set_user_data(struct zcr_security_v1 *zcr_security_v1, void *user_data)
224 {
225 wl_proxy_set_user_data((struct wl_proxy *) zcr_security_v1, user_data);
226 }
227
228 /** @ingroup iface_zcr_security_v1 */
229 static inline void *
zcr_security_v1_get_user_data(struct zcr_security_v1 * zcr_security_v1)230 zcr_security_v1_get_user_data(struct zcr_security_v1 *zcr_security_v1)
231 {
232 return wl_proxy_get_user_data((struct wl_proxy *) zcr_security_v1);
233 }
234
235 static inline uint32_t
zcr_security_v1_get_version(struct zcr_security_v1 * zcr_security_v1)236 zcr_security_v1_get_version(struct zcr_security_v1 *zcr_security_v1)
237 {
238 return wl_proxy_get_version((struct wl_proxy *) zcr_security_v1);
239 }
240
241 /**
242 * @ingroup iface_zcr_security_v1
243 *
244 * The associated wl_surface's security state is removed.
245 * The change is applied on the next wl_surface.commit.
246 */
247 static inline void
zcr_security_v1_destroy(struct zcr_security_v1 * zcr_security_v1)248 zcr_security_v1_destroy(struct zcr_security_v1 *zcr_security_v1)
249 {
250 wl_proxy_marshal_flags((struct wl_proxy *) zcr_security_v1,
251 ZCR_SECURITY_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_security_v1), WL_MARSHAL_FLAG_DESTROY);
252 }
253
254 /**
255 * @ingroup iface_zcr_security_v1
256 *
257 * Constrain visibility of wl_surface contents to secure outputs.
258 * See wp_secure_output for the description.
259 *
260 * The only visible on secure output state is double-buffered state,
261 * and will be applied on the next wl_surface.commit.
262 */
263 static inline void
zcr_security_v1_only_visible_on_secure_output(struct zcr_security_v1 * zcr_security_v1)264 zcr_security_v1_only_visible_on_secure_output(struct zcr_security_v1 *zcr_security_v1)
265 {
266 wl_proxy_marshal_flags((struct wl_proxy *) zcr_security_v1,
267 ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_security_v1), 0);
268 }
269
270 #ifdef __cplusplus
271 }
272 #endif
273
274 #endif
275