1 | /* Generated by wayland-scanner 1.20.0 */
|
---|
2 |
|
---|
3 | /* wayland-scanner --include-core-only --strict client-header ./wlr-data-control-unstable-v1.xml wlr-data-control-unstable-v1.h */
|
---|
4 |
|
---|
5 | #ifndef WLR_DATA_CONTROL_UNSTABLE_V1_CLIENT_PROTOCOL_H
|
---|
6 | #define WLR_DATA_CONTROL_UNSTABLE_V1_CLIENT_PROTOCOL_H
|
---|
7 |
|
---|
8 | #include <stdint.h>
|
---|
9 | #include <stddef.h>
|
---|
10 | #include "wayland-client-core.h"
|
---|
11 |
|
---|
12 | #ifdef __cplusplus
|
---|
13 | extern "C" {
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | /**
|
---|
17 | * @page page_wlr_data_control_unstable_v1 The wlr_data_control_unstable_v1 protocol
|
---|
18 | * control data devices
|
---|
19 | *
|
---|
20 | * @section page_desc_wlr_data_control_unstable_v1 Description
|
---|
21 | *
|
---|
22 | * This protocol allows a privileged client to control data devices. In
|
---|
23 | * particular, the client will be able to manage the current selection and take
|
---|
24 | * the role of a clipboard manager.
|
---|
25 | *
|
---|
26 | * Warning! The protocol described in this file is experimental and
|
---|
27 | * backward incompatible changes may be made. Backward compatible changes
|
---|
28 | * may be added together with the corresponding interface version bump.
|
---|
29 | * Backward incompatible changes are done by bumping the version number in
|
---|
30 | * the protocol and interface names and resetting the interface version.
|
---|
31 | * Once the protocol is to be declared stable, the 'z' prefix and the
|
---|
32 | * version number in the protocol and interface names are removed and the
|
---|
33 | * interface version number is reset.
|
---|
34 | *
|
---|
35 | * @section page_ifaces_wlr_data_control_unstable_v1 Interfaces
|
---|
36 | * - @subpage page_iface_zwlr_data_control_manager_v1 - manager to control data devices
|
---|
37 | * - @subpage page_iface_zwlr_data_control_device_v1 - manage a data device for a seat
|
---|
38 | * - @subpage page_iface_zwlr_data_control_source_v1 - offer to transfer data
|
---|
39 | * - @subpage page_iface_zwlr_data_control_offer_v1 - offer to transfer data
|
---|
40 | * @section page_copyright_wlr_data_control_unstable_v1 Copyright
|
---|
41 | * <pre>
|
---|
42 | *
|
---|
43 | * Copyright © 2018 Simon Ser
|
---|
44 | * Copyright © 2019 Ivan Molodetskikh
|
---|
45 | *
|
---|
46 | * Permission to use, copy, modify, distribute, and sell this
|
---|
47 | * software and its documentation for any purpose is hereby granted
|
---|
48 | * without fee, provided that the above copyright notice appear in
|
---|
49 | * all copies and that both that copyright notice and this permission
|
---|
50 | * notice appear in supporting documentation, and that the name of
|
---|
51 | * the copyright holders not be used in advertising or publicity
|
---|
52 | * pertaining to distribution of the software without specific,
|
---|
53 | * written prior permission. The copyright holders make no
|
---|
54 | * representations about the suitability of this software for any
|
---|
55 | * purpose. It is provided "as is" without express or implied
|
---|
56 | * warranty.
|
---|
57 | *
|
---|
58 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
---|
59 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
---|
60 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
---|
61 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
---|
62 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
---|
63 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
64 | * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
---|
65 | * THIS SOFTWARE.
|
---|
66 | * </pre>
|
---|
67 | */
|
---|
68 | struct wl_seat;
|
---|
69 | struct zwlr_data_control_device_v1;
|
---|
70 | struct zwlr_data_control_manager_v1;
|
---|
71 | struct zwlr_data_control_offer_v1;
|
---|
72 | struct zwlr_data_control_source_v1;
|
---|
73 |
|
---|
74 | #ifndef ZWLR_DATA_CONTROL_MANAGER_V1_INTERFACE
|
---|
75 | #define ZWLR_DATA_CONTROL_MANAGER_V1_INTERFACE
|
---|
76 | /**
|
---|
77 | * @page page_iface_zwlr_data_control_manager_v1 zwlr_data_control_manager_v1
|
---|
78 | * @section page_iface_zwlr_data_control_manager_v1_desc Description
|
---|
79 | *
|
---|
80 | * This interface is a manager that allows creating per-seat data device
|
---|
81 | * controls.
|
---|
82 | * @section page_iface_zwlr_data_control_manager_v1_api API
|
---|
83 | * See @ref iface_zwlr_data_control_manager_v1.
|
---|
84 | */
|
---|
85 | /**
|
---|
86 | * @defgroup iface_zwlr_data_control_manager_v1 The zwlr_data_control_manager_v1 interface
|
---|
87 | *
|
---|
88 | * This interface is a manager that allows creating per-seat data device
|
---|
89 | * controls.
|
---|
90 | */
|
---|
91 | extern const struct wl_interface zwlr_data_control_manager_v1_interface;
|
---|
92 | #endif
|
---|
93 | #ifndef ZWLR_DATA_CONTROL_DEVICE_V1_INTERFACE
|
---|
94 | #define ZWLR_DATA_CONTROL_DEVICE_V1_INTERFACE
|
---|
95 | /**
|
---|
96 | * @page page_iface_zwlr_data_control_device_v1 zwlr_data_control_device_v1
|
---|
97 | * @section page_iface_zwlr_data_control_device_v1_desc Description
|
---|
98 | *
|
---|
99 | * This interface allows a client to manage a seat's selection.
|
---|
100 | *
|
---|
101 | * When the seat is destroyed, this object becomes inert.
|
---|
102 | * @section page_iface_zwlr_data_control_device_v1_api API
|
---|
103 | * See @ref iface_zwlr_data_control_device_v1.
|
---|
104 | */
|
---|
105 | /**
|
---|
106 | * @defgroup iface_zwlr_data_control_device_v1 The zwlr_data_control_device_v1 interface
|
---|
107 | *
|
---|
108 | * This interface allows a client to manage a seat's selection.
|
---|
109 | *
|
---|
110 | * When the seat is destroyed, this object becomes inert.
|
---|
111 | */
|
---|
112 | extern const struct wl_interface zwlr_data_control_device_v1_interface;
|
---|
113 | #endif
|
---|
114 | #ifndef ZWLR_DATA_CONTROL_SOURCE_V1_INTERFACE
|
---|
115 | #define ZWLR_DATA_CONTROL_SOURCE_V1_INTERFACE
|
---|
116 | /**
|
---|
117 | * @page page_iface_zwlr_data_control_source_v1 zwlr_data_control_source_v1
|
---|
118 | * @section page_iface_zwlr_data_control_source_v1_desc Description
|
---|
119 | *
|
---|
120 | * The wlr_data_control_source object is the source side of a
|
---|
121 | * wlr_data_control_offer. It is created by the source client in a data
|
---|
122 | * transfer and provides a way to describe the offered data and a way to
|
---|
123 | * respond to requests to transfer the data.
|
---|
124 | * @section page_iface_zwlr_data_control_source_v1_api API
|
---|
125 | * See @ref iface_zwlr_data_control_source_v1.
|
---|
126 | */
|
---|
127 | /**
|
---|
128 | * @defgroup iface_zwlr_data_control_source_v1 The zwlr_data_control_source_v1 interface
|
---|
129 | *
|
---|
130 | * The wlr_data_control_source object is the source side of a
|
---|
131 | * wlr_data_control_offer. It is created by the source client in a data
|
---|
132 | * transfer and provides a way to describe the offered data and a way to
|
---|
133 | * respond to requests to transfer the data.
|
---|
134 | */
|
---|
135 | extern const struct wl_interface zwlr_data_control_source_v1_interface;
|
---|
136 | #endif
|
---|
137 | #ifndef ZWLR_DATA_CONTROL_OFFER_V1_INTERFACE
|
---|
138 | #define ZWLR_DATA_CONTROL_OFFER_V1_INTERFACE
|
---|
139 | /**
|
---|
140 | * @page page_iface_zwlr_data_control_offer_v1 zwlr_data_control_offer_v1
|
---|
141 | * @section page_iface_zwlr_data_control_offer_v1_desc Description
|
---|
142 | *
|
---|
143 | * A wlr_data_control_offer represents a piece of data offered for transfer
|
---|
144 | * by another client (the source client). The offer describes the different
|
---|
145 | * MIME types that the data can be converted to and provides the mechanism
|
---|
146 | * for transferring the data directly from the source client.
|
---|
147 | * @section page_iface_zwlr_data_control_offer_v1_api API
|
---|
148 | * See @ref iface_zwlr_data_control_offer_v1.
|
---|
149 | */
|
---|
150 | /**
|
---|
151 | * @defgroup iface_zwlr_data_control_offer_v1 The zwlr_data_control_offer_v1 interface
|
---|
152 | *
|
---|
153 | * A wlr_data_control_offer represents a piece of data offered for transfer
|
---|
154 | * by another client (the source client). The offer describes the different
|
---|
155 | * MIME types that the data can be converted to and provides the mechanism
|
---|
156 | * for transferring the data directly from the source client.
|
---|
157 | */
|
---|
158 | extern const struct wl_interface zwlr_data_control_offer_v1_interface;
|
---|
159 | #endif
|
---|
160 |
|
---|
161 | #define ZWLR_DATA_CONTROL_MANAGER_V1_CREATE_DATA_SOURCE 0
|
---|
162 | #define ZWLR_DATA_CONTROL_MANAGER_V1_GET_DATA_DEVICE 1
|
---|
163 | #define ZWLR_DATA_CONTROL_MANAGER_V1_DESTROY 2
|
---|
164 |
|
---|
165 |
|
---|
166 | /**
|
---|
167 | * @ingroup iface_zwlr_data_control_manager_v1
|
---|
168 | */
|
---|
169 | #define ZWLR_DATA_CONTROL_MANAGER_V1_CREATE_DATA_SOURCE_SINCE_VERSION 1
|
---|
170 | /**
|
---|
171 | * @ingroup iface_zwlr_data_control_manager_v1
|
---|
172 | */
|
---|
173 | #define ZWLR_DATA_CONTROL_MANAGER_V1_GET_DATA_DEVICE_SINCE_VERSION 1
|
---|
174 | /**
|
---|
175 | * @ingroup iface_zwlr_data_control_manager_v1
|
---|
176 | */
|
---|
177 | #define ZWLR_DATA_CONTROL_MANAGER_V1_DESTROY_SINCE_VERSION 1
|
---|
178 |
|
---|
179 | /** @ingroup iface_zwlr_data_control_manager_v1 */
|
---|
180 | static inline void
|
---|
181 | zwlr_data_control_manager_v1_set_user_data(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1, void *user_data)
|
---|
182 | {
|
---|
183 | wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_manager_v1, user_data);
|
---|
184 | }
|
---|
185 |
|
---|
186 | /** @ingroup iface_zwlr_data_control_manager_v1 */
|
---|
187 | static inline void *
|
---|
188 | zwlr_data_control_manager_v1_get_user_data(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
---|
189 | {
|
---|
190 | return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_manager_v1);
|
---|
191 | }
|
---|
192 |
|
---|
193 | static inline uint32_t
|
---|
194 | zwlr_data_control_manager_v1_get_version(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
---|
195 | {
|
---|
196 | return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1);
|
---|
197 | }
|
---|
198 |
|
---|
199 | /**
|
---|
200 | * @ingroup iface_zwlr_data_control_manager_v1
|
---|
201 | *
|
---|
202 | * Create a new data source.
|
---|
203 | */
|
---|
204 | static inline struct zwlr_data_control_source_v1 *
|
---|
205 | zwlr_data_control_manager_v1_create_data_source(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
---|
206 | {
|
---|
207 | struct wl_proxy *id;
|
---|
208 |
|
---|
209 | id = wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_manager_v1,
|
---|
210 | ZWLR_DATA_CONTROL_MANAGER_V1_CREATE_DATA_SOURCE, &zwlr_data_control_source_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1), 0, NULL);
|
---|
211 |
|
---|
212 | return (struct zwlr_data_control_source_v1 *) id;
|
---|
213 | }
|
---|
214 |
|
---|
215 | /**
|
---|
216 | * @ingroup iface_zwlr_data_control_manager_v1
|
---|
217 | *
|
---|
218 | * Create a data device that can be used to manage a seat's selection.
|
---|
219 | */
|
---|
220 | static inline struct zwlr_data_control_device_v1 *
|
---|
221 | zwlr_data_control_manager_v1_get_data_device(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1, struct wl_seat *seat)
|
---|
222 | {
|
---|
223 | struct wl_proxy *id;
|
---|
224 |
|
---|
225 | id = wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_manager_v1,
|
---|
226 | ZWLR_DATA_CONTROL_MANAGER_V1_GET_DATA_DEVICE, &zwlr_data_control_device_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1), 0, NULL, seat);
|
---|
227 |
|
---|
228 | return (struct zwlr_data_control_device_v1 *) id;
|
---|
229 | }
|
---|
230 |
|
---|
231 | /**
|
---|
232 | * @ingroup iface_zwlr_data_control_manager_v1
|
---|
233 | *
|
---|
234 | * All objects created by the manager will still remain valid, until their
|
---|
235 | * appropriate destroy request has been called.
|
---|
236 | */
|
---|
237 | static inline void
|
---|
238 | zwlr_data_control_manager_v1_destroy(struct zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1)
|
---|
239 | {
|
---|
240 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_manager_v1,
|
---|
241 | ZWLR_DATA_CONTROL_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_manager_v1), WL_MARSHAL_FLAG_DESTROY);
|
---|
242 | }
|
---|
243 |
|
---|
244 | #ifndef ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM
|
---|
245 | #define ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM
|
---|
246 | enum zwlr_data_control_device_v1_error {
|
---|
247 | /**
|
---|
248 | * source given to set_selection or set_primary_selection was already used before
|
---|
249 | */
|
---|
250 | ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_USED_SOURCE = 1
|
---|
251 | };
|
---|
252 | #endif /* ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM */
|
---|
253 |
|
---|
254 | /**
|
---|
255 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
256 | * @struct zwlr_data_control_device_v1_listener
|
---|
257 | */
|
---|
258 | struct zwlr_data_control_device_v1_listener {
|
---|
259 | /**
|
---|
260 | * introduce a new wlr_data_control_offer
|
---|
261 | *
|
---|
262 | * The data_offer event introduces a new wlr_data_control_offer
|
---|
263 | * object, which will subsequently be used in either the
|
---|
264 | * wlr_data_control_device.selection event (for the regular
|
---|
265 | * clipboard selections) or the
|
---|
266 | * wlr_data_control_device.primary_selection event (for the primary
|
---|
267 | * clipboard selections). Immediately following the
|
---|
268 | * wlr_data_control_device.data_offer event, the new data_offer
|
---|
269 | * object will send out wlr_data_control_offer.offer events to
|
---|
270 | * describe the MIME types it offers.
|
---|
271 | */
|
---|
272 | void (*data_offer)(void *data,
|
---|
273 | struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
---|
274 | struct zwlr_data_control_offer_v1 *id);
|
---|
275 | /**
|
---|
276 | * advertise new selection
|
---|
277 | *
|
---|
278 | * The selection event is sent out to notify the client of a new
|
---|
279 | * wlr_data_control_offer for the selection for this device. The
|
---|
280 | * wlr_data_control_device.data_offer and the
|
---|
281 | * wlr_data_control_offer.offer events are sent out immediately
|
---|
282 | * before this event to introduce the data offer object. The
|
---|
283 | * selection event is sent to a client when a new selection is set.
|
---|
284 | * The wlr_data_control_offer is valid until a new
|
---|
285 | * wlr_data_control_offer or NULL is received. The client must
|
---|
286 | * destroy the previous selection wlr_data_control_offer, if any,
|
---|
287 | * upon receiving this event.
|
---|
288 | *
|
---|
289 | * The first selection event is sent upon binding the
|
---|
290 | * wlr_data_control_device object.
|
---|
291 | */
|
---|
292 | void (*selection)(void *data,
|
---|
293 | struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
---|
294 | struct zwlr_data_control_offer_v1 *id);
|
---|
295 | /**
|
---|
296 | * this data control is no longer valid
|
---|
297 | *
|
---|
298 | * This data control object is no longer valid and should be
|
---|
299 | * destroyed by the client.
|
---|
300 | */
|
---|
301 | void (*finished)(void *data,
|
---|
302 | struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1);
|
---|
303 | /**
|
---|
304 | * advertise new primary selection
|
---|
305 | *
|
---|
306 | * The primary_selection event is sent out to notify the client
|
---|
307 | * of a new wlr_data_control_offer for the primary selection for
|
---|
308 | * this device. The wlr_data_control_device.data_offer and the
|
---|
309 | * wlr_data_control_offer.offer events are sent out immediately
|
---|
310 | * before this event to introduce the data offer object. The
|
---|
311 | * primary_selection event is sent to a client when a new primary
|
---|
312 | * selection is set. The wlr_data_control_offer is valid until a
|
---|
313 | * new wlr_data_control_offer or NULL is received. The client must
|
---|
314 | * destroy the previous primary selection wlr_data_control_offer,
|
---|
315 | * if any, upon receiving this event.
|
---|
316 | *
|
---|
317 | * If the compositor supports primary selection, the first
|
---|
318 | * primary_selection event is sent upon binding the
|
---|
319 | * wlr_data_control_device object.
|
---|
320 | * @since 2
|
---|
321 | */
|
---|
322 | void (*primary_selection)(void *data,
|
---|
323 | struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
---|
324 | struct zwlr_data_control_offer_v1 *id);
|
---|
325 | };
|
---|
326 |
|
---|
327 | /**
|
---|
328 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
329 | */
|
---|
330 | static inline int
|
---|
331 | zwlr_data_control_device_v1_add_listener(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1,
|
---|
332 | const struct zwlr_data_control_device_v1_listener *listener, void *data)
|
---|
333 | {
|
---|
334 | return wl_proxy_add_listener((struct wl_proxy *) zwlr_data_control_device_v1,
|
---|
335 | (void (**)(void)) listener, data);
|
---|
336 | }
|
---|
337 |
|
---|
338 | #define ZWLR_DATA_CONTROL_DEVICE_V1_SET_SELECTION 0
|
---|
339 | #define ZWLR_DATA_CONTROL_DEVICE_V1_DESTROY 1
|
---|
340 | #define ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION 2
|
---|
341 |
|
---|
342 | /**
|
---|
343 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
344 | */
|
---|
345 | #define ZWLR_DATA_CONTROL_DEVICE_V1_DATA_OFFER_SINCE_VERSION 1
|
---|
346 | /**
|
---|
347 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
348 | */
|
---|
349 | #define ZWLR_DATA_CONTROL_DEVICE_V1_SELECTION_SINCE_VERSION 1
|
---|
350 | /**
|
---|
351 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
352 | */
|
---|
353 | #define ZWLR_DATA_CONTROL_DEVICE_V1_FINISHED_SINCE_VERSION 1
|
---|
354 | /**
|
---|
355 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
356 | */
|
---|
357 | #define ZWLR_DATA_CONTROL_DEVICE_V1_PRIMARY_SELECTION_SINCE_VERSION 2
|
---|
358 |
|
---|
359 | /**
|
---|
360 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
361 | */
|
---|
362 | #define ZWLR_DATA_CONTROL_DEVICE_V1_SET_SELECTION_SINCE_VERSION 1
|
---|
363 | /**
|
---|
364 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
365 | */
|
---|
366 | #define ZWLR_DATA_CONTROL_DEVICE_V1_DESTROY_SINCE_VERSION 1
|
---|
367 | /**
|
---|
368 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
369 | */
|
---|
370 | #define ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION_SINCE_VERSION 2
|
---|
371 |
|
---|
372 | /** @ingroup iface_zwlr_data_control_device_v1 */
|
---|
373 | static inline void
|
---|
374 | zwlr_data_control_device_v1_set_user_data(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1, void *user_data)
|
---|
375 | {
|
---|
376 | wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_device_v1, user_data);
|
---|
377 | }
|
---|
378 |
|
---|
379 | /** @ingroup iface_zwlr_data_control_device_v1 */
|
---|
380 | static inline void *
|
---|
381 | zwlr_data_control_device_v1_get_user_data(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1)
|
---|
382 | {
|
---|
383 | return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_device_v1);
|
---|
384 | }
|
---|
385 |
|
---|
386 | static inline uint32_t
|
---|
387 | zwlr_data_control_device_v1_get_version(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1)
|
---|
388 | {
|
---|
389 | return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1);
|
---|
390 | }
|
---|
391 |
|
---|
392 | /**
|
---|
393 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
394 | *
|
---|
395 | * This request asks the compositor to set the selection to the data from
|
---|
396 | * the source on behalf of the client.
|
---|
397 | *
|
---|
398 | * The given source may not be used in any further set_selection or
|
---|
399 | * set_primary_selection requests. Attempting to use a previously used
|
---|
400 | * source is a protocol error.
|
---|
401 | *
|
---|
402 | * To unset the selection, set the source to NULL.
|
---|
403 | */
|
---|
404 | static inline void
|
---|
405 | zwlr_data_control_device_v1_set_selection(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1, struct zwlr_data_control_source_v1 *source)
|
---|
406 | {
|
---|
407 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_device_v1,
|
---|
408 | ZWLR_DATA_CONTROL_DEVICE_V1_SET_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1), 0, source);
|
---|
409 | }
|
---|
410 |
|
---|
411 | /**
|
---|
412 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
413 | *
|
---|
414 | * Destroys the data device object.
|
---|
415 | */
|
---|
416 | static inline void
|
---|
417 | zwlr_data_control_device_v1_destroy(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1)
|
---|
418 | {
|
---|
419 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_device_v1,
|
---|
420 | ZWLR_DATA_CONTROL_DEVICE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1), WL_MARSHAL_FLAG_DESTROY);
|
---|
421 | }
|
---|
422 |
|
---|
423 | /**
|
---|
424 | * @ingroup iface_zwlr_data_control_device_v1
|
---|
425 | *
|
---|
426 | * This request asks the compositor to set the primary selection to the
|
---|
427 | * data from the source on behalf of the client.
|
---|
428 | *
|
---|
429 | * The given source may not be used in any further set_selection or
|
---|
430 | * set_primary_selection requests. Attempting to use a previously used
|
---|
431 | * source is a protocol error.
|
---|
432 | *
|
---|
433 | * To unset the primary selection, set the source to NULL.
|
---|
434 | *
|
---|
435 | * The compositor will ignore this request if it does not support primary
|
---|
436 | * selection.
|
---|
437 | */
|
---|
438 | static inline void
|
---|
439 | zwlr_data_control_device_v1_set_primary_selection(struct zwlr_data_control_device_v1 *zwlr_data_control_device_v1, struct zwlr_data_control_source_v1 *source)
|
---|
440 | {
|
---|
441 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_device_v1,
|
---|
442 | ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_device_v1), 0, source);
|
---|
443 | }
|
---|
444 |
|
---|
445 | #ifndef ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM
|
---|
446 | #define ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM
|
---|
447 | enum zwlr_data_control_source_v1_error {
|
---|
448 | /**
|
---|
449 | * offer sent after wlr_data_control_device.set_selection
|
---|
450 | */
|
---|
451 | ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_INVALID_OFFER = 1
|
---|
452 | };
|
---|
453 | #endif /* ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM */
|
---|
454 |
|
---|
455 | /**
|
---|
456 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
457 | * @struct zwlr_data_control_source_v1_listener
|
---|
458 | */
|
---|
459 | struct zwlr_data_control_source_v1_listener {
|
---|
460 | /**
|
---|
461 | * send the data
|
---|
462 | *
|
---|
463 | * Request for data from the client. Send the data as the
|
---|
464 | * specified MIME type over the passed file descriptor, then close
|
---|
465 | * it.
|
---|
466 | * @param mime_type MIME type for the data
|
---|
467 | * @param fd file descriptor for the data
|
---|
468 | */
|
---|
469 | void (*send)(void *data,
|
---|
470 | struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1,
|
---|
471 | const char *mime_type,
|
---|
472 | int32_t fd);
|
---|
473 | /**
|
---|
474 | * selection was cancelled
|
---|
475 | *
|
---|
476 | * This data source is no longer valid. The data source has been
|
---|
477 | * replaced by another data source.
|
---|
478 | *
|
---|
479 | * The client should clean up and destroy this data source.
|
---|
480 | */
|
---|
481 | void (*cancelled)(void *data,
|
---|
482 | struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1);
|
---|
483 | };
|
---|
484 |
|
---|
485 | /**
|
---|
486 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
487 | */
|
---|
488 | static inline int
|
---|
489 | zwlr_data_control_source_v1_add_listener(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1,
|
---|
490 | const struct zwlr_data_control_source_v1_listener *listener, void *data)
|
---|
491 | {
|
---|
492 | return wl_proxy_add_listener((struct wl_proxy *) zwlr_data_control_source_v1,
|
---|
493 | (void (**)(void)) listener, data);
|
---|
494 | }
|
---|
495 |
|
---|
496 | #define ZWLR_DATA_CONTROL_SOURCE_V1_OFFER 0
|
---|
497 | #define ZWLR_DATA_CONTROL_SOURCE_V1_DESTROY 1
|
---|
498 |
|
---|
499 | /**
|
---|
500 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
501 | */
|
---|
502 | #define ZWLR_DATA_CONTROL_SOURCE_V1_SEND_SINCE_VERSION 1
|
---|
503 | /**
|
---|
504 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
505 | */
|
---|
506 | #define ZWLR_DATA_CONTROL_SOURCE_V1_CANCELLED_SINCE_VERSION 1
|
---|
507 |
|
---|
508 | /**
|
---|
509 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
510 | */
|
---|
511 | #define ZWLR_DATA_CONTROL_SOURCE_V1_OFFER_SINCE_VERSION 1
|
---|
512 | /**
|
---|
513 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
514 | */
|
---|
515 | #define ZWLR_DATA_CONTROL_SOURCE_V1_DESTROY_SINCE_VERSION 1
|
---|
516 |
|
---|
517 | /** @ingroup iface_zwlr_data_control_source_v1 */
|
---|
518 | static inline void
|
---|
519 | zwlr_data_control_source_v1_set_user_data(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1, void *user_data)
|
---|
520 | {
|
---|
521 | wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_source_v1, user_data);
|
---|
522 | }
|
---|
523 |
|
---|
524 | /** @ingroup iface_zwlr_data_control_source_v1 */
|
---|
525 | static inline void *
|
---|
526 | zwlr_data_control_source_v1_get_user_data(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1)
|
---|
527 | {
|
---|
528 | return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_source_v1);
|
---|
529 | }
|
---|
530 |
|
---|
531 | static inline uint32_t
|
---|
532 | zwlr_data_control_source_v1_get_version(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1)
|
---|
533 | {
|
---|
534 | return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_source_v1);
|
---|
535 | }
|
---|
536 |
|
---|
537 | /**
|
---|
538 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
539 | *
|
---|
540 | * This request adds a MIME type to the set of MIME types advertised to
|
---|
541 | * targets. Can be called several times to offer multiple types.
|
---|
542 | *
|
---|
543 | * Calling this after wlr_data_control_device.set_selection is a protocol
|
---|
544 | * error.
|
---|
545 | */
|
---|
546 | static inline void
|
---|
547 | zwlr_data_control_source_v1_offer(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1, const char *mime_type)
|
---|
548 | {
|
---|
549 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_source_v1,
|
---|
550 | ZWLR_DATA_CONTROL_SOURCE_V1_OFFER, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_source_v1), 0, mime_type);
|
---|
551 | }
|
---|
552 |
|
---|
553 | /**
|
---|
554 | * @ingroup iface_zwlr_data_control_source_v1
|
---|
555 | *
|
---|
556 | * Destroys the data source object.
|
---|
557 | */
|
---|
558 | static inline void
|
---|
559 | zwlr_data_control_source_v1_destroy(struct zwlr_data_control_source_v1 *zwlr_data_control_source_v1)
|
---|
560 | {
|
---|
561 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_source_v1,
|
---|
562 | ZWLR_DATA_CONTROL_SOURCE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_source_v1), WL_MARSHAL_FLAG_DESTROY);
|
---|
563 | }
|
---|
564 |
|
---|
565 | /**
|
---|
566 | * @ingroup iface_zwlr_data_control_offer_v1
|
---|
567 | * @struct zwlr_data_control_offer_v1_listener
|
---|
568 | */
|
---|
569 | struct zwlr_data_control_offer_v1_listener {
|
---|
570 | /**
|
---|
571 | * advertise offered MIME type
|
---|
572 | *
|
---|
573 | * Sent immediately after creating the wlr_data_control_offer
|
---|
574 | * object. One event per offered MIME type.
|
---|
575 | * @param mime_type offered MIME type
|
---|
576 | */
|
---|
577 | void (*offer)(void *data,
|
---|
578 | struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1,
|
---|
579 | const char *mime_type);
|
---|
580 | };
|
---|
581 |
|
---|
582 | /**
|
---|
583 | * @ingroup iface_zwlr_data_control_offer_v1
|
---|
584 | */
|
---|
585 | static inline int
|
---|
586 | zwlr_data_control_offer_v1_add_listener(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1,
|
---|
587 | const struct zwlr_data_control_offer_v1_listener *listener, void *data)
|
---|
588 | {
|
---|
589 | return wl_proxy_add_listener((struct wl_proxy *) zwlr_data_control_offer_v1,
|
---|
590 | (void (**)(void)) listener, data);
|
---|
591 | }
|
---|
592 |
|
---|
593 | #define ZWLR_DATA_CONTROL_OFFER_V1_RECEIVE 0
|
---|
594 | #define ZWLR_DATA_CONTROL_OFFER_V1_DESTROY 1
|
---|
595 |
|
---|
596 | /**
|
---|
597 | * @ingroup iface_zwlr_data_control_offer_v1
|
---|
598 | */
|
---|
599 | #define ZWLR_DATA_CONTROL_OFFER_V1_OFFER_SINCE_VERSION 1
|
---|
600 |
|
---|
601 | /**
|
---|
602 | * @ingroup iface_zwlr_data_control_offer_v1
|
---|
603 | */
|
---|
604 | #define ZWLR_DATA_CONTROL_OFFER_V1_RECEIVE_SINCE_VERSION 1
|
---|
605 | /**
|
---|
606 | * @ingroup iface_zwlr_data_control_offer_v1
|
---|
607 | */
|
---|
608 | #define ZWLR_DATA_CONTROL_OFFER_V1_DESTROY_SINCE_VERSION 1
|
---|
609 |
|
---|
610 | /** @ingroup iface_zwlr_data_control_offer_v1 */
|
---|
611 | static inline void
|
---|
612 | zwlr_data_control_offer_v1_set_user_data(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1, void *user_data)
|
---|
613 | {
|
---|
614 | wl_proxy_set_user_data((struct wl_proxy *) zwlr_data_control_offer_v1, user_data);
|
---|
615 | }
|
---|
616 |
|
---|
617 | /** @ingroup iface_zwlr_data_control_offer_v1 */
|
---|
618 | static inline void *
|
---|
619 | zwlr_data_control_offer_v1_get_user_data(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1)
|
---|
620 | {
|
---|
621 | return wl_proxy_get_user_data((struct wl_proxy *) zwlr_data_control_offer_v1);
|
---|
622 | }
|
---|
623 |
|
---|
624 | static inline uint32_t
|
---|
625 | zwlr_data_control_offer_v1_get_version(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1)
|
---|
626 | {
|
---|
627 | return wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_offer_v1);
|
---|
628 | }
|
---|
629 |
|
---|
630 | /**
|
---|
631 | * @ingroup iface_zwlr_data_control_offer_v1
|
---|
632 | *
|
---|
633 | * To transfer the offered data, the client issues this request and
|
---|
634 | * indicates the MIME type it wants to receive. The transfer happens
|
---|
635 | * through the passed file descriptor (typically created with the pipe
|
---|
636 | * system call). The source client writes the data in the MIME type
|
---|
637 | * representation requested and then closes the file descriptor.
|
---|
638 | *
|
---|
639 | * The receiving client reads from the read end of the pipe until EOF and
|
---|
640 | * then closes its end, at which point the transfer is complete.
|
---|
641 | *
|
---|
642 | * This request may happen multiple times for different MIME types.
|
---|
643 | */
|
---|
644 | static inline void
|
---|
645 | zwlr_data_control_offer_v1_receive(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1, const char *mime_type, int32_t fd)
|
---|
646 | {
|
---|
647 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_offer_v1,
|
---|
648 | ZWLR_DATA_CONTROL_OFFER_V1_RECEIVE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_offer_v1), 0, mime_type, fd);
|
---|
649 | }
|
---|
650 |
|
---|
651 | /**
|
---|
652 | * @ingroup iface_zwlr_data_control_offer_v1
|
---|
653 | *
|
---|
654 | * Destroys the data offer object.
|
---|
655 | */
|
---|
656 | static inline void
|
---|
657 | zwlr_data_control_offer_v1_destroy(struct zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1)
|
---|
658 | {
|
---|
659 | wl_proxy_marshal_flags((struct wl_proxy *) zwlr_data_control_offer_v1,
|
---|
660 | ZWLR_DATA_CONTROL_OFFER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_data_control_offer_v1), WL_MARSHAL_FLAG_DESTROY);
|
---|
661 | }
|
---|
662 |
|
---|
663 | #ifdef __cplusplus
|
---|
664 | }
|
---|
665 | #endif
|
---|
666 |
|
---|
667 | #endif
|
---|