1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef WP_PRIMARY_SELECTION_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define WP_PRIMARY_SELECTION_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_wp_primary_selection_unstable_v1 The wp_primary_selection_unstable_v1 protocol
16 * Primary selection protocol
17 *
18 * @section page_desc_wp_primary_selection_unstable_v1 Description
19 *
20 * This protocol provides the ability to have a primary selection device to
21 * match that of the X server. This primary selection is a shortcut to the
22 * common clipboard selection, where text just needs to be selected in order
23 * to allow copying it elsewhere. The de facto way to perform this action
24 * is the middle mouse button, although it is not limited to this one.
25 *
26 * Clients wishing to honor primary selection should create a primary
27 * selection source and set it as the selection through
28 * wp_primary_selection_device.set_selection whenever the text selection
29 * changes. In order to minimize calls in pointer-driven text selection,
30 * it should happen only once after the operation finished. Similarly,
31 * a NULL source should be set when text is unselected.
32 *
33 * wp_primary_selection_offer objects are first announced through the
34 * wp_primary_selection_device.data_offer event. Immediately after this event,
35 * the primary data offer will emit wp_primary_selection_offer.offer events
36 * to let know of the mime types being offered.
37 *
38 * When the primary selection changes, the client with the keyboard focus
39 * will receive wp_primary_selection_device.selection events. Only the client
40 * with the keyboard focus will receive such events with a non-NULL
41 * wp_primary_selection_offer. Across keyboard focus changes, previously
42 * focused clients will receive wp_primary_selection_device.events with a
43 * NULL wp_primary_selection_offer.
44 *
45 * In order to request the primary selection data, the client must pass
46 * a recent serial pertaining to the press event that is triggering the
47 * operation, if the compositor deems the serial valid and recent, the
48 * wp_primary_selection_source.send event will happen in the other end
49 * to let the transfer begin. The client owning the primary selection
50 * should write the requested data, and close the file descriptor
51 * immediately.
52 *
53 * If the primary selection owner client disappeared during the transfer,
54 * the client reading the data will receive a
55 * wp_primary_selection_device.selection event with a NULL
56 * wp_primary_selection_offer, the client should take this as a hint
57 * to finish the reads related to the no longer existing offer.
58 *
59 * The primary selection owner should be checking for errors during
60 * writes, merely cancelling the ongoing transfer if any happened.
61 *
62 * @section page_ifaces_wp_primary_selection_unstable_v1 Interfaces
63 * - @subpage page_iface_zwp_primary_selection_device_manager_v1 - X primary selection emulation
64 * - @subpage page_iface_zwp_primary_selection_device_v1 -
65 * - @subpage page_iface_zwp_primary_selection_offer_v1 - offer to transfer primary selection contents
66 * - @subpage page_iface_zwp_primary_selection_source_v1 - offer to replace the contents of the primary selection
67 * @section page_copyright_wp_primary_selection_unstable_v1 Copyright
68 * <pre>
69 *
70 * Copyright © 2015, 2016 Red Hat
71 *
72 * Permission is hereby granted, free of charge, to any person obtaining a
73 * copy of this software and associated documentation files (the "Software"),
74 * to deal in the Software without restriction, including without limitation
75 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
76 * and/or sell copies of the Software, and to permit persons to whom the
77 * Software is furnished to do so, subject to the following conditions:
78 *
79 * The above copyright notice and this permission notice (including the next
80 * paragraph) shall be included in all copies or substantial portions of the
81 * Software.
82 *
83 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
84 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
85 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
86 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
87 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
88 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
89 * DEALINGS IN THE SOFTWARE.
90 * </pre>
91 */
92 struct wl_seat;
93 struct zwp_primary_selection_device_manager_v1;
94 struct zwp_primary_selection_device_v1;
95 struct zwp_primary_selection_offer_v1;
96 struct zwp_primary_selection_source_v1;
97
98 #ifndef ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_INTERFACE
99 #define ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_INTERFACE
100 /**
101 * @page page_iface_zwp_primary_selection_device_manager_v1 zwp_primary_selection_device_manager_v1
102 * @section page_iface_zwp_primary_selection_device_manager_v1_desc Description
103 *
104 * The primary selection device manager is a singleton global object that
105 * provides access to the primary selection. It allows to create
106 * wp_primary_selection_source objects, as well as retrieving the per-seat
107 * wp_primary_selection_device objects.
108 * @section page_iface_zwp_primary_selection_device_manager_v1_api API
109 * See @ref iface_zwp_primary_selection_device_manager_v1.
110 */
111 /**
112 * @defgroup iface_zwp_primary_selection_device_manager_v1 The zwp_primary_selection_device_manager_v1 interface
113 *
114 * The primary selection device manager is a singleton global object that
115 * provides access to the primary selection. It allows to create
116 * wp_primary_selection_source objects, as well as retrieving the per-seat
117 * wp_primary_selection_device objects.
118 */
119 extern const struct wl_interface zwp_primary_selection_device_manager_v1_interface;
120 #endif
121 #ifndef ZWP_PRIMARY_SELECTION_DEVICE_V1_INTERFACE
122 #define ZWP_PRIMARY_SELECTION_DEVICE_V1_INTERFACE
123 /**
124 * @page page_iface_zwp_primary_selection_device_v1 zwp_primary_selection_device_v1
125 * @section page_iface_zwp_primary_selection_device_v1_api API
126 * See @ref iface_zwp_primary_selection_device_v1.
127 */
128 /**
129 * @defgroup iface_zwp_primary_selection_device_v1 The zwp_primary_selection_device_v1 interface
130 */
131 extern const struct wl_interface zwp_primary_selection_device_v1_interface;
132 #endif
133 #ifndef ZWP_PRIMARY_SELECTION_OFFER_V1_INTERFACE
134 #define ZWP_PRIMARY_SELECTION_OFFER_V1_INTERFACE
135 /**
136 * @page page_iface_zwp_primary_selection_offer_v1 zwp_primary_selection_offer_v1
137 * @section page_iface_zwp_primary_selection_offer_v1_desc Description
138 *
139 * A wp_primary_selection_offer represents an offer to transfer the contents
140 * of the primary selection clipboard to the client. Similar to
141 * wl_data_offer, the offer also describes the mime types that the data can
142 * be converted to and provides the mechanisms for transferring the data
143 * directly to the client.
144 * @section page_iface_zwp_primary_selection_offer_v1_api API
145 * See @ref iface_zwp_primary_selection_offer_v1.
146 */
147 /**
148 * @defgroup iface_zwp_primary_selection_offer_v1 The zwp_primary_selection_offer_v1 interface
149 *
150 * A wp_primary_selection_offer represents an offer to transfer the contents
151 * of the primary selection clipboard to the client. Similar to
152 * wl_data_offer, the offer also describes the mime types that the data can
153 * be converted to and provides the mechanisms for transferring the data
154 * directly to the client.
155 */
156 extern const struct wl_interface zwp_primary_selection_offer_v1_interface;
157 #endif
158 #ifndef ZWP_PRIMARY_SELECTION_SOURCE_V1_INTERFACE
159 #define ZWP_PRIMARY_SELECTION_SOURCE_V1_INTERFACE
160 /**
161 * @page page_iface_zwp_primary_selection_source_v1 zwp_primary_selection_source_v1
162 * @section page_iface_zwp_primary_selection_source_v1_desc Description
163 *
164 * The source side of a wp_primary_selection_offer, it provides a way to
165 * describe the offered data and respond to requests to transfer the
166 * requested contents of the primary selection clipboard.
167 * @section page_iface_zwp_primary_selection_source_v1_api API
168 * See @ref iface_zwp_primary_selection_source_v1.
169 */
170 /**
171 * @defgroup iface_zwp_primary_selection_source_v1 The zwp_primary_selection_source_v1 interface
172 *
173 * The source side of a wp_primary_selection_offer, it provides a way to
174 * describe the offered data and respond to requests to transfer the
175 * requested contents of the primary selection clipboard.
176 */
177 extern const struct wl_interface zwp_primary_selection_source_v1_interface;
178 #endif
179
180 #define ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_CREATE_SOURCE 0
181 #define ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_GET_DEVICE 1
182 #define ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_DESTROY 2
183
184
185 /**
186 * @ingroup iface_zwp_primary_selection_device_manager_v1
187 */
188 #define ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_CREATE_SOURCE_SINCE_VERSION 1
189 /**
190 * @ingroup iface_zwp_primary_selection_device_manager_v1
191 */
192 #define ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_GET_DEVICE_SINCE_VERSION 1
193 /**
194 * @ingroup iface_zwp_primary_selection_device_manager_v1
195 */
196 #define ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_DESTROY_SINCE_VERSION 1
197
198 /** @ingroup iface_zwp_primary_selection_device_manager_v1 */
199 static inline void
zwp_primary_selection_device_manager_v1_set_user_data(struct zwp_primary_selection_device_manager_v1 * zwp_primary_selection_device_manager_v1,void * user_data)200 zwp_primary_selection_device_manager_v1_set_user_data(struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_device_manager_v1, void *user_data)
201 {
202 wl_proxy_set_user_data((struct wl_proxy *) zwp_primary_selection_device_manager_v1, user_data);
203 }
204
205 /** @ingroup iface_zwp_primary_selection_device_manager_v1 */
206 static inline void *
zwp_primary_selection_device_manager_v1_get_user_data(struct zwp_primary_selection_device_manager_v1 * zwp_primary_selection_device_manager_v1)207 zwp_primary_selection_device_manager_v1_get_user_data(struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_device_manager_v1)
208 {
209 return wl_proxy_get_user_data((struct wl_proxy *) zwp_primary_selection_device_manager_v1);
210 }
211
212 static inline uint32_t
zwp_primary_selection_device_manager_v1_get_version(struct zwp_primary_selection_device_manager_v1 * zwp_primary_selection_device_manager_v1)213 zwp_primary_selection_device_manager_v1_get_version(struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_device_manager_v1)
214 {
215 return wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_device_manager_v1);
216 }
217
218 /**
219 * @ingroup iface_zwp_primary_selection_device_manager_v1
220 *
221 * Create a new primary selection source.
222 */
223 static inline struct zwp_primary_selection_source_v1 *
zwp_primary_selection_device_manager_v1_create_source(struct zwp_primary_selection_device_manager_v1 * zwp_primary_selection_device_manager_v1)224 zwp_primary_selection_device_manager_v1_create_source(struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_device_manager_v1)
225 {
226 struct wl_proxy *id;
227
228 id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_device_manager_v1,
229 ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_CREATE_SOURCE, &zwp_primary_selection_source_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_device_manager_v1), 0, NULL);
230
231 return (struct zwp_primary_selection_source_v1 *) id;
232 }
233
234 /**
235 * @ingroup iface_zwp_primary_selection_device_manager_v1
236 *
237 * Create a new data device for a given seat.
238 */
239 static inline struct zwp_primary_selection_device_v1 *
zwp_primary_selection_device_manager_v1_get_device(struct zwp_primary_selection_device_manager_v1 * zwp_primary_selection_device_manager_v1,struct wl_seat * seat)240 zwp_primary_selection_device_manager_v1_get_device(struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_device_manager_v1, struct wl_seat *seat)
241 {
242 struct wl_proxy *id;
243
244 id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_device_manager_v1,
245 ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_GET_DEVICE, &zwp_primary_selection_device_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_device_manager_v1), 0, NULL, seat);
246
247 return (struct zwp_primary_selection_device_v1 *) id;
248 }
249
250 /**
251 * @ingroup iface_zwp_primary_selection_device_manager_v1
252 *
253 * Destroy the primary selection device manager.
254 */
255 static inline void
zwp_primary_selection_device_manager_v1_destroy(struct zwp_primary_selection_device_manager_v1 * zwp_primary_selection_device_manager_v1)256 zwp_primary_selection_device_manager_v1_destroy(struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_device_manager_v1)
257 {
258 wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_device_manager_v1,
259 ZWP_PRIMARY_SELECTION_DEVICE_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_device_manager_v1), WL_MARSHAL_FLAG_DESTROY);
260 }
261
262 /**
263 * @ingroup iface_zwp_primary_selection_device_v1
264 * @struct zwp_primary_selection_device_v1_listener
265 */
266 struct zwp_primary_selection_device_v1_listener {
267 /**
268 * introduce a new wp_primary_selection_offer
269 *
270 * Introduces a new wp_primary_selection_offer object that may be
271 * used to receive the current primary selection. Immediately
272 * following this event, the new wp_primary_selection_offer object
273 * will send wp_primary_selection_offer.offer events to describe
274 * the offered mime types.
275 */
276 void (*data_offer)(void *data,
277 struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1,
278 struct zwp_primary_selection_offer_v1 *offer);
279 /**
280 * advertise a new primary selection
281 *
282 * The wp_primary_selection_device.selection event is sent to
283 * notify the client of a new primary selection. This event is sent
284 * after the wp_primary_selection.data_offer event introducing this
285 * object, and after the offer has announced its mimetypes through
286 * wp_primary_selection_offer.offer.
287 *
288 * The data_offer is valid until a new offer or NULL is received or
289 * until the client loses keyboard focus. The client must destroy
290 * the previous selection data_offer, if any, upon receiving this
291 * event.
292 */
293 void (*selection)(void *data,
294 struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1,
295 struct zwp_primary_selection_offer_v1 *id);
296 };
297
298 /**
299 * @ingroup iface_zwp_primary_selection_device_v1
300 */
301 static inline int
zwp_primary_selection_device_v1_add_listener(struct zwp_primary_selection_device_v1 * zwp_primary_selection_device_v1,const struct zwp_primary_selection_device_v1_listener * listener,void * data)302 zwp_primary_selection_device_v1_add_listener(struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1,
303 const struct zwp_primary_selection_device_v1_listener *listener, void *data)
304 {
305 return wl_proxy_add_listener((struct wl_proxy *) zwp_primary_selection_device_v1,
306 (void (**)(void)) listener, data);
307 }
308
309 #define ZWP_PRIMARY_SELECTION_DEVICE_V1_SET_SELECTION 0
310 #define ZWP_PRIMARY_SELECTION_DEVICE_V1_DESTROY 1
311
312 /**
313 * @ingroup iface_zwp_primary_selection_device_v1
314 */
315 #define ZWP_PRIMARY_SELECTION_DEVICE_V1_DATA_OFFER_SINCE_VERSION 1
316 /**
317 * @ingroup iface_zwp_primary_selection_device_v1
318 */
319 #define ZWP_PRIMARY_SELECTION_DEVICE_V1_SELECTION_SINCE_VERSION 1
320
321 /**
322 * @ingroup iface_zwp_primary_selection_device_v1
323 */
324 #define ZWP_PRIMARY_SELECTION_DEVICE_V1_SET_SELECTION_SINCE_VERSION 1
325 /**
326 * @ingroup iface_zwp_primary_selection_device_v1
327 */
328 #define ZWP_PRIMARY_SELECTION_DEVICE_V1_DESTROY_SINCE_VERSION 1
329
330 /** @ingroup iface_zwp_primary_selection_device_v1 */
331 static inline void
zwp_primary_selection_device_v1_set_user_data(struct zwp_primary_selection_device_v1 * zwp_primary_selection_device_v1,void * user_data)332 zwp_primary_selection_device_v1_set_user_data(struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1, void *user_data)
333 {
334 wl_proxy_set_user_data((struct wl_proxy *) zwp_primary_selection_device_v1, user_data);
335 }
336
337 /** @ingroup iface_zwp_primary_selection_device_v1 */
338 static inline void *
zwp_primary_selection_device_v1_get_user_data(struct zwp_primary_selection_device_v1 * zwp_primary_selection_device_v1)339 zwp_primary_selection_device_v1_get_user_data(struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1)
340 {
341 return wl_proxy_get_user_data((struct wl_proxy *) zwp_primary_selection_device_v1);
342 }
343
344 static inline uint32_t
zwp_primary_selection_device_v1_get_version(struct zwp_primary_selection_device_v1 * zwp_primary_selection_device_v1)345 zwp_primary_selection_device_v1_get_version(struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1)
346 {
347 return wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_device_v1);
348 }
349
350 /**
351 * @ingroup iface_zwp_primary_selection_device_v1
352 *
353 * Replaces the current selection. The previous owner of the primary
354 * selection will receive a wp_primary_selection_source.cancelled event.
355 *
356 * To unset the selection, set the source to NULL.
357 */
358 static inline void
zwp_primary_selection_device_v1_set_selection(struct zwp_primary_selection_device_v1 * zwp_primary_selection_device_v1,struct zwp_primary_selection_source_v1 * source,uint32_t serial)359 zwp_primary_selection_device_v1_set_selection(struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1, struct zwp_primary_selection_source_v1 *source, uint32_t serial)
360 {
361 wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_device_v1,
362 ZWP_PRIMARY_SELECTION_DEVICE_V1_SET_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_device_v1), 0, source, serial);
363 }
364
365 /**
366 * @ingroup iface_zwp_primary_selection_device_v1
367 *
368 * Destroy the primary selection device.
369 */
370 static inline void
zwp_primary_selection_device_v1_destroy(struct zwp_primary_selection_device_v1 * zwp_primary_selection_device_v1)371 zwp_primary_selection_device_v1_destroy(struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1)
372 {
373 wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_device_v1,
374 ZWP_PRIMARY_SELECTION_DEVICE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_device_v1), WL_MARSHAL_FLAG_DESTROY);
375 }
376
377 /**
378 * @ingroup iface_zwp_primary_selection_offer_v1
379 * @struct zwp_primary_selection_offer_v1_listener
380 */
381 struct zwp_primary_selection_offer_v1_listener {
382 /**
383 * advertise offered mime type
384 *
385 * Sent immediately after creating announcing the
386 * wp_primary_selection_offer through
387 * wp_primary_selection_device.data_offer. One event is sent per
388 * offered mime type.
389 */
390 void (*offer)(void *data,
391 struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1,
392 const char *mime_type);
393 };
394
395 /**
396 * @ingroup iface_zwp_primary_selection_offer_v1
397 */
398 static inline int
zwp_primary_selection_offer_v1_add_listener(struct zwp_primary_selection_offer_v1 * zwp_primary_selection_offer_v1,const struct zwp_primary_selection_offer_v1_listener * listener,void * data)399 zwp_primary_selection_offer_v1_add_listener(struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1,
400 const struct zwp_primary_selection_offer_v1_listener *listener, void *data)
401 {
402 return wl_proxy_add_listener((struct wl_proxy *) zwp_primary_selection_offer_v1,
403 (void (**)(void)) listener, data);
404 }
405
406 #define ZWP_PRIMARY_SELECTION_OFFER_V1_RECEIVE 0
407 #define ZWP_PRIMARY_SELECTION_OFFER_V1_DESTROY 1
408
409 /**
410 * @ingroup iface_zwp_primary_selection_offer_v1
411 */
412 #define ZWP_PRIMARY_SELECTION_OFFER_V1_OFFER_SINCE_VERSION 1
413
414 /**
415 * @ingroup iface_zwp_primary_selection_offer_v1
416 */
417 #define ZWP_PRIMARY_SELECTION_OFFER_V1_RECEIVE_SINCE_VERSION 1
418 /**
419 * @ingroup iface_zwp_primary_selection_offer_v1
420 */
421 #define ZWP_PRIMARY_SELECTION_OFFER_V1_DESTROY_SINCE_VERSION 1
422
423 /** @ingroup iface_zwp_primary_selection_offer_v1 */
424 static inline void
zwp_primary_selection_offer_v1_set_user_data(struct zwp_primary_selection_offer_v1 * zwp_primary_selection_offer_v1,void * user_data)425 zwp_primary_selection_offer_v1_set_user_data(struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1, void *user_data)
426 {
427 wl_proxy_set_user_data((struct wl_proxy *) zwp_primary_selection_offer_v1, user_data);
428 }
429
430 /** @ingroup iface_zwp_primary_selection_offer_v1 */
431 static inline void *
zwp_primary_selection_offer_v1_get_user_data(struct zwp_primary_selection_offer_v1 * zwp_primary_selection_offer_v1)432 zwp_primary_selection_offer_v1_get_user_data(struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1)
433 {
434 return wl_proxy_get_user_data((struct wl_proxy *) zwp_primary_selection_offer_v1);
435 }
436
437 static inline uint32_t
zwp_primary_selection_offer_v1_get_version(struct zwp_primary_selection_offer_v1 * zwp_primary_selection_offer_v1)438 zwp_primary_selection_offer_v1_get_version(struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1)
439 {
440 return wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_offer_v1);
441 }
442
443 /**
444 * @ingroup iface_zwp_primary_selection_offer_v1
445 *
446 * To transfer the contents of the primary selection clipboard, the client
447 * issues this request and indicates the mime type that it wants to
448 * receive. The transfer happens through the passed file descriptor
449 * (typically created with the pipe system call). The source client writes
450 * the data in the mime type representation requested and then closes the
451 * file descriptor.
452 *
453 * The receiving client reads from the read end of the pipe until EOF and
454 * closes its end, at which point the transfer is complete.
455 */
456 static inline void
zwp_primary_selection_offer_v1_receive(struct zwp_primary_selection_offer_v1 * zwp_primary_selection_offer_v1,const char * mime_type,int32_t fd)457 zwp_primary_selection_offer_v1_receive(struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1, const char *mime_type, int32_t fd)
458 {
459 wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_offer_v1,
460 ZWP_PRIMARY_SELECTION_OFFER_V1_RECEIVE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_offer_v1), 0, mime_type, fd);
461 }
462
463 /**
464 * @ingroup iface_zwp_primary_selection_offer_v1
465 *
466 * Destroy the primary selection offer.
467 */
468 static inline void
zwp_primary_selection_offer_v1_destroy(struct zwp_primary_selection_offer_v1 * zwp_primary_selection_offer_v1)469 zwp_primary_selection_offer_v1_destroy(struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1)
470 {
471 wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_offer_v1,
472 ZWP_PRIMARY_SELECTION_OFFER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_offer_v1), WL_MARSHAL_FLAG_DESTROY);
473 }
474
475 /**
476 * @ingroup iface_zwp_primary_selection_source_v1
477 * @struct zwp_primary_selection_source_v1_listener
478 */
479 struct zwp_primary_selection_source_v1_listener {
480 /**
481 * send the primary selection contents
482 *
483 * Request for the current primary selection contents from the
484 * client. Send the specified mime type over the passed file
485 * descriptor, then close it.
486 */
487 void (*send)(void *data,
488 struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1,
489 const char *mime_type,
490 int32_t fd);
491 /**
492 * request for primary selection contents was canceled
493 *
494 * This primary selection source is no longer valid. The client
495 * should clean up and destroy this primary selection source.
496 */
497 void (*cancelled)(void *data,
498 struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1);
499 };
500
501 /**
502 * @ingroup iface_zwp_primary_selection_source_v1
503 */
504 static inline int
zwp_primary_selection_source_v1_add_listener(struct zwp_primary_selection_source_v1 * zwp_primary_selection_source_v1,const struct zwp_primary_selection_source_v1_listener * listener,void * data)505 zwp_primary_selection_source_v1_add_listener(struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1,
506 const struct zwp_primary_selection_source_v1_listener *listener, void *data)
507 {
508 return wl_proxy_add_listener((struct wl_proxy *) zwp_primary_selection_source_v1,
509 (void (**)(void)) listener, data);
510 }
511
512 #define ZWP_PRIMARY_SELECTION_SOURCE_V1_OFFER 0
513 #define ZWP_PRIMARY_SELECTION_SOURCE_V1_DESTROY 1
514
515 /**
516 * @ingroup iface_zwp_primary_selection_source_v1
517 */
518 #define ZWP_PRIMARY_SELECTION_SOURCE_V1_SEND_SINCE_VERSION 1
519 /**
520 * @ingroup iface_zwp_primary_selection_source_v1
521 */
522 #define ZWP_PRIMARY_SELECTION_SOURCE_V1_CANCELLED_SINCE_VERSION 1
523
524 /**
525 * @ingroup iface_zwp_primary_selection_source_v1
526 */
527 #define ZWP_PRIMARY_SELECTION_SOURCE_V1_OFFER_SINCE_VERSION 1
528 /**
529 * @ingroup iface_zwp_primary_selection_source_v1
530 */
531 #define ZWP_PRIMARY_SELECTION_SOURCE_V1_DESTROY_SINCE_VERSION 1
532
533 /** @ingroup iface_zwp_primary_selection_source_v1 */
534 static inline void
zwp_primary_selection_source_v1_set_user_data(struct zwp_primary_selection_source_v1 * zwp_primary_selection_source_v1,void * user_data)535 zwp_primary_selection_source_v1_set_user_data(struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1, void *user_data)
536 {
537 wl_proxy_set_user_data((struct wl_proxy *) zwp_primary_selection_source_v1, user_data);
538 }
539
540 /** @ingroup iface_zwp_primary_selection_source_v1 */
541 static inline void *
zwp_primary_selection_source_v1_get_user_data(struct zwp_primary_selection_source_v1 * zwp_primary_selection_source_v1)542 zwp_primary_selection_source_v1_get_user_data(struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1)
543 {
544 return wl_proxy_get_user_data((struct wl_proxy *) zwp_primary_selection_source_v1);
545 }
546
547 static inline uint32_t
zwp_primary_selection_source_v1_get_version(struct zwp_primary_selection_source_v1 * zwp_primary_selection_source_v1)548 zwp_primary_selection_source_v1_get_version(struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1)
549 {
550 return wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_source_v1);
551 }
552
553 /**
554 * @ingroup iface_zwp_primary_selection_source_v1
555 *
556 * This request adds a mime type to the set of mime types advertised to
557 * targets. Can be called several times to offer multiple types.
558 */
559 static inline void
zwp_primary_selection_source_v1_offer(struct zwp_primary_selection_source_v1 * zwp_primary_selection_source_v1,const char * mime_type)560 zwp_primary_selection_source_v1_offer(struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1, const char *mime_type)
561 {
562 wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_source_v1,
563 ZWP_PRIMARY_SELECTION_SOURCE_V1_OFFER, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_source_v1), 0, mime_type);
564 }
565
566 /**
567 * @ingroup iface_zwp_primary_selection_source_v1
568 *
569 * Destroy the primary selection source.
570 */
571 static inline void
zwp_primary_selection_source_v1_destroy(struct zwp_primary_selection_source_v1 * zwp_primary_selection_source_v1)572 zwp_primary_selection_source_v1_destroy(struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1)
573 {
574 wl_proxy_marshal_flags((struct wl_proxy *) zwp_primary_selection_source_v1,
575 ZWP_PRIMARY_SELECTION_SOURCE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_primary_selection_source_v1), WL_MARSHAL_FLAG_DESTROY);
576 }
577
578 #ifdef __cplusplus
579 }
580 #endif
581
582 #endif
583