1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef WP_VIRTIO_GPU_METADATA_V1_CLIENT_PROTOCOL_H
4 #define WP_VIRTIO_GPU_METADATA_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_wp_virtio_gpu_metadata_v1 The wp_virtio_gpu_metadata_v1 protocol
16 * @section page_ifaces_wp_virtio_gpu_metadata_v1 Interfaces
17 * - @subpage page_iface_wp_virtio_gpu_metadata_v1 - attach virtio gpu metadata
18 * - @subpage page_iface_wp_virtio_gpu_surface_metadata_v1 - interface to attach virtio gpu metadata to a wl_surface
19 * @section page_copyright_wp_virtio_gpu_metadata_v1 Copyright
20 * <pre>
21 *
22 * Copyright 2021 The Chromium Authors.
23 * Permission is hereby granted, free of charge, to any person obtaining a
24 * copy of this software and associated documentation files (the "Software"),
25 * to deal in the Software without restriction, including without limitation
26 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
27 * and/or sell copies of the Software, and to permit persons to whom the
28 * Software is furnished to do so, subject to the following conditions:
29 * The above copyright notice and this permission notice (including the next
30 * paragraph) shall be included in all copies or substantial portions of the
31 * Software.
32 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
35 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
38 * DEALINGS IN THE SOFTWARE.
39 * </pre>
40 */
41 struct wl_surface;
42 struct wp_virtio_gpu_metadata_v1;
43 struct wp_virtio_gpu_surface_metadata_v1;
44
45 #ifndef WP_VIRTIO_GPU_METADATA_V1_INTERFACE
46 #define WP_VIRTIO_GPU_METADATA_V1_INTERFACE
47 /**
48 * @page page_iface_wp_virtio_gpu_metadata_v1 wp_virtio_gpu_metadata_v1
49 * @section page_iface_wp_virtio_gpu_metadata_v1_desc Description
50 *
51 * The global interface which allows attaching virtio-gpu metadata
52 * to wl_surface objects.
53 * @section page_iface_wp_virtio_gpu_metadata_v1_api API
54 * See @ref iface_wp_virtio_gpu_metadata_v1.
55 */
56 /**
57 * @defgroup iface_wp_virtio_gpu_metadata_v1 The wp_virtio_gpu_metadata_v1 interface
58 *
59 * The global interface which allows attaching virtio-gpu metadata
60 * to wl_surface objects.
61 */
62 extern const struct wl_interface wp_virtio_gpu_metadata_v1_interface;
63 #endif
64 #ifndef WP_VIRTIO_GPU_SURFACE_METADATA_V1_INTERFACE
65 #define WP_VIRTIO_GPU_SURFACE_METADATA_V1_INTERFACE
66 /**
67 * @page page_iface_wp_virtio_gpu_surface_metadata_v1 wp_virtio_gpu_surface_metadata_v1
68 * @section page_iface_wp_virtio_gpu_surface_metadata_v1_desc Description
69 *
70 * An additional interface to a wl_surface object, which allows the
71 * client to attach additional metadata to the surface.
72 *
73 * If the wl_surface associated with the virtio_gpu_surface_metadata_v1 is
74 * destroyed, all virtio_gpu_surface_metadata_v1 requests except 'destroy'
75 * raise the protocol error no_surface.
76 *
77 * If the virtio_gpu_surface_metadata_v1 object is destroyed, the metadata
78 * state is removed from the wl_surface. The change will be applied
79 * on the next wl_surface.commit.
80 * @section page_iface_wp_virtio_gpu_surface_metadata_v1_api API
81 * See @ref iface_wp_virtio_gpu_surface_metadata_v1.
82 */
83 /**
84 * @defgroup iface_wp_virtio_gpu_surface_metadata_v1 The wp_virtio_gpu_surface_metadata_v1 interface
85 *
86 * An additional interface to a wl_surface object, which allows the
87 * client to attach additional metadata to the surface.
88 *
89 * If the wl_surface associated with the virtio_gpu_surface_metadata_v1 is
90 * destroyed, all virtio_gpu_surface_metadata_v1 requests except 'destroy'
91 * raise the protocol error no_surface.
92 *
93 * If the virtio_gpu_surface_metadata_v1 object is destroyed, the metadata
94 * state is removed from the wl_surface. The change will be applied
95 * on the next wl_surface.commit.
96 */
97 extern const struct wl_interface wp_virtio_gpu_surface_metadata_v1_interface;
98 #endif
99
100 #ifndef WP_VIRTIO_GPU_METADATA_V1_ERROR_ENUM
101 #define WP_VIRTIO_GPU_METADATA_V1_ERROR_ENUM
102 enum wp_virtio_gpu_metadata_v1_error {
103 /**
104 * the surface already has a metadata object associated
105 */
106 WP_VIRTIO_GPU_METADATA_V1_ERROR_SURFACE_METADATA_EXISTS = 0,
107 };
108 #endif /* WP_VIRTIO_GPU_METADATA_V1_ERROR_ENUM */
109
110 #define WP_VIRTIO_GPU_METADATA_V1_GET_SURFACE_METADATA 0
111
112
113 /**
114 * @ingroup iface_wp_virtio_gpu_metadata_v1
115 */
116 #define WP_VIRTIO_GPU_METADATA_V1_GET_SURFACE_METADATA_SINCE_VERSION 1
117
118 /** @ingroup iface_wp_virtio_gpu_metadata_v1 */
119 static inline void
wp_virtio_gpu_metadata_v1_set_user_data(struct wp_virtio_gpu_metadata_v1 * wp_virtio_gpu_metadata_v1,void * user_data)120 wp_virtio_gpu_metadata_v1_set_user_data(struct wp_virtio_gpu_metadata_v1 *wp_virtio_gpu_metadata_v1, void *user_data)
121 {
122 wl_proxy_set_user_data((struct wl_proxy *) wp_virtio_gpu_metadata_v1, user_data);
123 }
124
125 /** @ingroup iface_wp_virtio_gpu_metadata_v1 */
126 static inline void *
wp_virtio_gpu_metadata_v1_get_user_data(struct wp_virtio_gpu_metadata_v1 * wp_virtio_gpu_metadata_v1)127 wp_virtio_gpu_metadata_v1_get_user_data(struct wp_virtio_gpu_metadata_v1 *wp_virtio_gpu_metadata_v1)
128 {
129 return wl_proxy_get_user_data((struct wl_proxy *) wp_virtio_gpu_metadata_v1);
130 }
131
132 static inline uint32_t
wp_virtio_gpu_metadata_v1_get_version(struct wp_virtio_gpu_metadata_v1 * wp_virtio_gpu_metadata_v1)133 wp_virtio_gpu_metadata_v1_get_version(struct wp_virtio_gpu_metadata_v1 *wp_virtio_gpu_metadata_v1)
134 {
135 return wl_proxy_get_version((struct wl_proxy *) wp_virtio_gpu_metadata_v1);
136 }
137
138 /** @ingroup iface_wp_virtio_gpu_metadata_v1 */
139 static inline void
wp_virtio_gpu_metadata_v1_destroy(struct wp_virtio_gpu_metadata_v1 * wp_virtio_gpu_metadata_v1)140 wp_virtio_gpu_metadata_v1_destroy(struct wp_virtio_gpu_metadata_v1 *wp_virtio_gpu_metadata_v1)
141 {
142 wl_proxy_destroy((struct wl_proxy *) wp_virtio_gpu_metadata_v1);
143 }
144
145 /**
146 * @ingroup iface_wp_virtio_gpu_metadata_v1
147 *
148 * Instantiate an virtio_gpu_surface_metadata_v1 extension for the given
149 * wl_surface to attach virtio gpu metadata. If the given wl_surface
150 * already has a surface metadata object associated, the
151 * surface_metadata_exists protocol error is raised.
152 */
153 static inline struct wp_virtio_gpu_surface_metadata_v1 *
wp_virtio_gpu_metadata_v1_get_surface_metadata(struct wp_virtio_gpu_metadata_v1 * wp_virtio_gpu_metadata_v1,struct wl_surface * surface)154 wp_virtio_gpu_metadata_v1_get_surface_metadata(struct wp_virtio_gpu_metadata_v1 *wp_virtio_gpu_metadata_v1, struct wl_surface *surface)
155 {
156 struct wl_proxy *id;
157
158 id = wl_proxy_marshal_flags((struct wl_proxy *) wp_virtio_gpu_metadata_v1,
159 WP_VIRTIO_GPU_METADATA_V1_GET_SURFACE_METADATA, &wp_virtio_gpu_surface_metadata_v1_interface, wl_proxy_get_version((struct wl_proxy *) wp_virtio_gpu_metadata_v1), 0, NULL, surface);
160
161 return (struct wp_virtio_gpu_surface_metadata_v1 *) id;
162 }
163
164 #ifndef WP_VIRTIO_GPU_SURFACE_METADATA_V1_ERROR_ENUM
165 #define WP_VIRTIO_GPU_SURFACE_METADATA_V1_ERROR_ENUM
166 enum wp_virtio_gpu_surface_metadata_v1_error {
167 /**
168 * the wl_surface was destroyed
169 */
170 WP_VIRTIO_GPU_SURFACE_METADATA_V1_ERROR_NO_SURFACE = 0,
171 };
172 #endif /* WP_VIRTIO_GPU_SURFACE_METADATA_V1_ERROR_ENUM */
173
174 #define WP_VIRTIO_GPU_SURFACE_METADATA_V1_SET_SCANOUT_ID 0
175
176
177 /**
178 * @ingroup iface_wp_virtio_gpu_surface_metadata_v1
179 */
180 #define WP_VIRTIO_GPU_SURFACE_METADATA_V1_SET_SCANOUT_ID_SINCE_VERSION 1
181
182 /** @ingroup iface_wp_virtio_gpu_surface_metadata_v1 */
183 static inline void
wp_virtio_gpu_surface_metadata_v1_set_user_data(struct wp_virtio_gpu_surface_metadata_v1 * wp_virtio_gpu_surface_metadata_v1,void * user_data)184 wp_virtio_gpu_surface_metadata_v1_set_user_data(struct wp_virtio_gpu_surface_metadata_v1 *wp_virtio_gpu_surface_metadata_v1, void *user_data)
185 {
186 wl_proxy_set_user_data((struct wl_proxy *) wp_virtio_gpu_surface_metadata_v1, user_data);
187 }
188
189 /** @ingroup iface_wp_virtio_gpu_surface_metadata_v1 */
190 static inline void *
wp_virtio_gpu_surface_metadata_v1_get_user_data(struct wp_virtio_gpu_surface_metadata_v1 * wp_virtio_gpu_surface_metadata_v1)191 wp_virtio_gpu_surface_metadata_v1_get_user_data(struct wp_virtio_gpu_surface_metadata_v1 *wp_virtio_gpu_surface_metadata_v1)
192 {
193 return wl_proxy_get_user_data((struct wl_proxy *) wp_virtio_gpu_surface_metadata_v1);
194 }
195
196 static inline uint32_t
wp_virtio_gpu_surface_metadata_v1_get_version(struct wp_virtio_gpu_surface_metadata_v1 * wp_virtio_gpu_surface_metadata_v1)197 wp_virtio_gpu_surface_metadata_v1_get_version(struct wp_virtio_gpu_surface_metadata_v1 *wp_virtio_gpu_surface_metadata_v1)
198 {
199 return wl_proxy_get_version((struct wl_proxy *) wp_virtio_gpu_surface_metadata_v1);
200 }
201
202 /** @ingroup iface_wp_virtio_gpu_surface_metadata_v1 */
203 static inline void
wp_virtio_gpu_surface_metadata_v1_destroy(struct wp_virtio_gpu_surface_metadata_v1 * wp_virtio_gpu_surface_metadata_v1)204 wp_virtio_gpu_surface_metadata_v1_destroy(struct wp_virtio_gpu_surface_metadata_v1 *wp_virtio_gpu_surface_metadata_v1)
205 {
206 wl_proxy_destroy((struct wl_proxy *) wp_virtio_gpu_surface_metadata_v1);
207 }
208
209 /**
210 * @ingroup iface_wp_virtio_gpu_surface_metadata_v1
211 *
212 * Set the virtio gpu scanout id of the associated wl_surface.
213 */
214 static inline void
wp_virtio_gpu_surface_metadata_v1_set_scanout_id(struct wp_virtio_gpu_surface_metadata_v1 * wp_virtio_gpu_surface_metadata_v1,uint32_t scanout_id)215 wp_virtio_gpu_surface_metadata_v1_set_scanout_id(struct wp_virtio_gpu_surface_metadata_v1 *wp_virtio_gpu_surface_metadata_v1, uint32_t scanout_id)
216 {
217 wl_proxy_marshal_flags((struct wl_proxy *) wp_virtio_gpu_surface_metadata_v1,
218 WP_VIRTIO_GPU_SURFACE_METADATA_V1_SET_SCANOUT_ID, NULL, wl_proxy_get_version((struct wl_proxy *) wp_virtio_gpu_surface_metadata_v1), 0, scanout_id);
219 }
220
221 #ifdef __cplusplus
222 }
223 #endif
224
225 #endif
226