Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/wayland/include/protocol/wayland-client-protocol.h

Issue 1628333004: Update Wayland to version 1.9.91. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright © 2008-2011 Kristian Høgsberg 2 * Copyright © 2008-2011 Kristian Høgsberg
3 * Copyright © 2010-2011 Intel Corporation 3 * Copyright © 2010-2011 Intel Corporation
4 * Copyright © 2012-2013 Collabora, Ltd. 4 * Copyright © 2012-2013 Collabora, Ltd.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person 6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation files 7 * obtaining a copy of this software and associated documentation files
8 * (the "Software"), to deal in the Software without restriction, 8 * (the "Software"), to deal in the Software without restriction,
9 * including without limitation the rights to use, copy, modify, merge, 9 * including without limitation the rights to use, copy, modify, merge,
10 * publish, distribute, sublicense, and/or sell copies of the Software, 10 * publish, distribute, sublicense, and/or sell copies of the Software,
11 * and to permit persons to whom the Software is furnished to do so, 11 * and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions: 12 * subject to the following conditions:
13 * 13 *
14 * The above copyright notice and this permission notice (including the 14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial 15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software. 16 * portions of the Software.
17 * 17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE. 25 * SOFTWARE.
26 */ 26 */
27 27
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 wl_display_add_listener(struct wl_display *wl_display, 151 wl_display_add_listener(struct wl_display *wl_display,
152 const struct wl_display_listener *listener, void *data) 152 const struct wl_display_listener *listener, void *data)
153 { 153 {
154 return wl_proxy_add_listener((struct wl_proxy *) wl_display, 154 return wl_proxy_add_listener((struct wl_proxy *) wl_display,
155 (void (**)(void)) listener, data); 155 (void (**)(void)) listener, data);
156 } 156 }
157 157
158 #define WL_DISPLAY_SYNC 0 158 #define WL_DISPLAY_SYNC 0
159 #define WL_DISPLAY_GET_REGISTRY 1 159 #define WL_DISPLAY_GET_REGISTRY 1
160 160
161 #define WL_DISPLAY_SYNC_SINCE_VERSION 1
162 #define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1
163
161 static inline void 164 static inline void
162 wl_display_set_user_data(struct wl_display *wl_display, void *user_data) 165 wl_display_set_user_data(struct wl_display *wl_display, void *user_data)
163 { 166 {
164 wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data); 167 wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data);
165 } 168 }
166 169
167 static inline void * 170 static inline void *
168 wl_display_get_user_data(struct wl_display *wl_display) 171 wl_display_get_user_data(struct wl_display *wl_display)
169 { 172 {
170 return wl_proxy_get_user_data((struct wl_proxy *) wl_display); 173 return wl_proxy_get_user_data((struct wl_proxy *) wl_display);
171 } 174 }
172 175
176 static inline uint32_t
177 wl_display_get_version(struct wl_display *wl_display)
178 {
179 return wl_proxy_get_version((struct wl_proxy *) wl_display);
180 }
181
173 static inline struct wl_callback * 182 static inline struct wl_callback *
174 wl_display_sync(struct wl_display *wl_display) 183 wl_display_sync(struct wl_display *wl_display)
175 { 184 {
176 struct wl_proxy *callback; 185 struct wl_proxy *callback;
177 186
178 callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display, 187 callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display,
179 WL_DISPLAY_SYNC, &wl_callback_interface, NULL); 188 WL_DISPLAY_SYNC, &wl_callback_interface, NULL);
180 189
181 return (struct wl_callback *) callback; 190 return (struct wl_callback *) callback;
182 } 191 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 static inline int 264 static inline int
256 wl_registry_add_listener(struct wl_registry *wl_registry, 265 wl_registry_add_listener(struct wl_registry *wl_registry,
257 const struct wl_registry_listener *listener, void *data ) 266 const struct wl_registry_listener *listener, void *data )
258 { 267 {
259 return wl_proxy_add_listener((struct wl_proxy *) wl_registry, 268 return wl_proxy_add_listener((struct wl_proxy *) wl_registry,
260 (void (**)(void)) listener, data); 269 (void (**)(void)) listener, data);
261 } 270 }
262 271
263 #define WL_REGISTRY_BIND 0 272 #define WL_REGISTRY_BIND 0
264 273
274 #define WL_REGISTRY_BIND_SINCE_VERSION 1
275
265 static inline void 276 static inline void
266 wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data) 277 wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data)
267 { 278 {
268 wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data); 279 wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data);
269 } 280 }
270 281
271 static inline void * 282 static inline void *
272 wl_registry_get_user_data(struct wl_registry *wl_registry) 283 wl_registry_get_user_data(struct wl_registry *wl_registry)
273 { 284 {
274 return wl_proxy_get_user_data((struct wl_proxy *) wl_registry); 285 return wl_proxy_get_user_data((struct wl_proxy *) wl_registry);
275 } 286 }
276 287
288 static inline uint32_t
289 wl_registry_get_version(struct wl_registry *wl_registry)
290 {
291 return wl_proxy_get_version((struct wl_proxy *) wl_registry);
292 }
293
277 static inline void 294 static inline void
278 wl_registry_destroy(struct wl_registry *wl_registry) 295 wl_registry_destroy(struct wl_registry *wl_registry)
279 { 296 {
280 wl_proxy_destroy((struct wl_proxy *) wl_registry); 297 wl_proxy_destroy((struct wl_proxy *) wl_registry);
281 } 298 }
282 299
283 static inline void * 300 static inline void *
284 wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl _interface *interface, uint32_t version) 301 wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl _interface *interface, uint32_t version)
285 { 302 {
286 struct wl_proxy *id; 303 struct wl_proxy *id;
287 304
288 » id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_registry, 305 » id = wl_proxy_marshal_constructor_versioned((struct wl_proxy *) wl_regis try,
289 » » » WL_REGISTRY_BIND, interface, name, interface->name, ver sion, NULL); 306 » » » WL_REGISTRY_BIND, interface, version, name, interface-> name, version, NULL);
290 307
291 return (void *) id; 308 return (void *) id;
292 } 309 }
293 310
294 /** 311 /**
295 * wl_callback - callback object 312 * wl_callback - callback object
296 * @done: done event 313 * @done: done event
297 * 314 *
298 * Clients can handle the 'done' event to get notified when the related 315 * Clients can handle the 'done' event to get notified when the related
299 * request is done. 316 * request is done.
(...skipping 11 matching lines...) Expand all
311 }; 328 };
312 329
313 static inline int 330 static inline int
314 wl_callback_add_listener(struct wl_callback *wl_callback, 331 wl_callback_add_listener(struct wl_callback *wl_callback,
315 const struct wl_callback_listener *listener, void *data ) 332 const struct wl_callback_listener *listener, void *data )
316 { 333 {
317 return wl_proxy_add_listener((struct wl_proxy *) wl_callback, 334 return wl_proxy_add_listener((struct wl_proxy *) wl_callback,
318 (void (**)(void)) listener, data); 335 (void (**)(void)) listener, data);
319 } 336 }
320 337
338
321 static inline void 339 static inline void
322 wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data) 340 wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data)
323 { 341 {
324 wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data); 342 wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data);
325 } 343 }
326 344
327 static inline void * 345 static inline void *
328 wl_callback_get_user_data(struct wl_callback *wl_callback) 346 wl_callback_get_user_data(struct wl_callback *wl_callback)
329 { 347 {
330 return wl_proxy_get_user_data((struct wl_proxy *) wl_callback); 348 return wl_proxy_get_user_data((struct wl_proxy *) wl_callback);
331 } 349 }
332 350
351 static inline uint32_t
352 wl_callback_get_version(struct wl_callback *wl_callback)
353 {
354 return wl_proxy_get_version((struct wl_proxy *) wl_callback);
355 }
356
333 static inline void 357 static inline void
334 wl_callback_destroy(struct wl_callback *wl_callback) 358 wl_callback_destroy(struct wl_callback *wl_callback)
335 { 359 {
336 wl_proxy_destroy((struct wl_proxy *) wl_callback); 360 wl_proxy_destroy((struct wl_proxy *) wl_callback);
337 } 361 }
338 362
339 #define WL_COMPOSITOR_CREATE_SURFACE 0 363 #define WL_COMPOSITOR_CREATE_SURFACE 0
340 #define WL_COMPOSITOR_CREATE_REGION 1 364 #define WL_COMPOSITOR_CREATE_REGION 1
341 365
366 #define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1
367 #define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1
368
342 static inline void 369 static inline void
343 wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data ) 370 wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data )
344 { 371 {
345 wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data); 372 wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data);
346 } 373 }
347 374
348 static inline void * 375 static inline void *
349 wl_compositor_get_user_data(struct wl_compositor *wl_compositor) 376 wl_compositor_get_user_data(struct wl_compositor *wl_compositor)
350 { 377 {
351 return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor); 378 return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor);
352 } 379 }
353 380
381 static inline uint32_t
382 wl_compositor_get_version(struct wl_compositor *wl_compositor)
383 {
384 return wl_proxy_get_version((struct wl_proxy *) wl_compositor);
385 }
386
354 static inline void 387 static inline void
355 wl_compositor_destroy(struct wl_compositor *wl_compositor) 388 wl_compositor_destroy(struct wl_compositor *wl_compositor)
356 { 389 {
357 wl_proxy_destroy((struct wl_proxy *) wl_compositor); 390 wl_proxy_destroy((struct wl_proxy *) wl_compositor);
358 } 391 }
359 392
360 static inline struct wl_surface * 393 static inline struct wl_surface *
361 wl_compositor_create_surface(struct wl_compositor *wl_compositor) 394 wl_compositor_create_surface(struct wl_compositor *wl_compositor)
362 { 395 {
363 struct wl_proxy *id; 396 struct wl_proxy *id;
(...skipping 12 matching lines...) Expand all
376 id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor, 409 id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor,
377 WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, NULL ); 410 WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, NULL );
378 411
379 return (struct wl_region *) id; 412 return (struct wl_region *) id;
380 } 413 }
381 414
382 #define WL_SHM_POOL_CREATE_BUFFER 0 415 #define WL_SHM_POOL_CREATE_BUFFER 0
383 #define WL_SHM_POOL_DESTROY 1 416 #define WL_SHM_POOL_DESTROY 1
384 #define WL_SHM_POOL_RESIZE 2 417 #define WL_SHM_POOL_RESIZE 2
385 418
419 #define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1
420 #define WL_SHM_POOL_DESTROY_SINCE_VERSION 1
421 #define WL_SHM_POOL_RESIZE_SINCE_VERSION 1
422
386 static inline void 423 static inline void
387 wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data) 424 wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data)
388 { 425 {
389 wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data); 426 wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data);
390 } 427 }
391 428
392 static inline void * 429 static inline void *
393 wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool) 430 wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool)
394 { 431 {
395 return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool); 432 return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool);
396 } 433 }
397 434
435 static inline uint32_t
436 wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool)
437 {
438 return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool);
439 }
440
398 static inline struct wl_buffer * 441 static inline struct wl_buffer *
399 wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32 _t width, int32_t height, int32_t stride, uint32_t format) 442 wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32 _t width, int32_t height, int32_t stride, uint32_t format)
400 { 443 {
401 struct wl_proxy *id; 444 struct wl_proxy *id;
402 445
403 id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm_pool, 446 id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm_pool,
404 WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, NULL, offset, width, height, stride, format); 447 WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, NULL, offset, width, height, stride, format);
405 448
406 return (struct wl_buffer *) id; 449 return (struct wl_buffer *) id;
407 } 450 }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 static inline int 641 static inline int
599 wl_shm_add_listener(struct wl_shm *wl_shm, 642 wl_shm_add_listener(struct wl_shm *wl_shm,
600 const struct wl_shm_listener *listener, void *data) 643 const struct wl_shm_listener *listener, void *data)
601 { 644 {
602 return wl_proxy_add_listener((struct wl_proxy *) wl_shm, 645 return wl_proxy_add_listener((struct wl_proxy *) wl_shm,
603 (void (**)(void)) listener, data); 646 (void (**)(void)) listener, data);
604 } 647 }
605 648
606 #define WL_SHM_CREATE_POOL 0 649 #define WL_SHM_CREATE_POOL 0
607 650
651 #define WL_SHM_CREATE_POOL_SINCE_VERSION 1
652
608 static inline void 653 static inline void
609 wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data) 654 wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data)
610 { 655 {
611 wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data); 656 wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data);
612 } 657 }
613 658
614 static inline void * 659 static inline void *
615 wl_shm_get_user_data(struct wl_shm *wl_shm) 660 wl_shm_get_user_data(struct wl_shm *wl_shm)
616 { 661 {
617 return wl_proxy_get_user_data((struct wl_proxy *) wl_shm); 662 return wl_proxy_get_user_data((struct wl_proxy *) wl_shm);
618 } 663 }
619 664
665 static inline uint32_t
666 wl_shm_get_version(struct wl_shm *wl_shm)
667 {
668 return wl_proxy_get_version((struct wl_proxy *) wl_shm);
669 }
670
620 static inline void 671 static inline void
621 wl_shm_destroy(struct wl_shm *wl_shm) 672 wl_shm_destroy(struct wl_shm *wl_shm)
622 { 673 {
623 wl_proxy_destroy((struct wl_proxy *) wl_shm); 674 wl_proxy_destroy((struct wl_proxy *) wl_shm);
624 } 675 }
625 676
626 static inline struct wl_shm_pool * 677 static inline struct wl_shm_pool *
627 wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size) 678 wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size)
628 { 679 {
629 struct wl_proxy *id; 680 struct wl_proxy *id;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 static inline int 719 static inline int
669 wl_buffer_add_listener(struct wl_buffer *wl_buffer, 720 wl_buffer_add_listener(struct wl_buffer *wl_buffer,
670 const struct wl_buffer_listener *listener, void *data) 721 const struct wl_buffer_listener *listener, void *data)
671 { 722 {
672 return wl_proxy_add_listener((struct wl_proxy *) wl_buffer, 723 return wl_proxy_add_listener((struct wl_proxy *) wl_buffer,
673 (void (**)(void)) listener, data); 724 (void (**)(void)) listener, data);
674 } 725 }
675 726
676 #define WL_BUFFER_DESTROY 0 727 #define WL_BUFFER_DESTROY 0
677 728
729 #define WL_BUFFER_DESTROY_SINCE_VERSION 1
730
678 static inline void 731 static inline void
679 wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data) 732 wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data)
680 { 733 {
681 wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data); 734 wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data);
682 } 735 }
683 736
684 static inline void * 737 static inline void *
685 wl_buffer_get_user_data(struct wl_buffer *wl_buffer) 738 wl_buffer_get_user_data(struct wl_buffer *wl_buffer)
686 { 739 {
687 return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer); 740 return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer);
688 } 741 }
689 742
743 static inline uint32_t
744 wl_buffer_get_version(struct wl_buffer *wl_buffer)
745 {
746 return wl_proxy_get_version((struct wl_proxy *) wl_buffer);
747 }
748
690 static inline void 749 static inline void
691 wl_buffer_destroy(struct wl_buffer *wl_buffer) 750 wl_buffer_destroy(struct wl_buffer *wl_buffer)
692 { 751 {
693 wl_proxy_marshal((struct wl_proxy *) wl_buffer, 752 wl_proxy_marshal((struct wl_proxy *) wl_buffer,
694 WL_BUFFER_DESTROY); 753 WL_BUFFER_DESTROY);
695 754
696 wl_proxy_destroy((struct wl_proxy *) wl_buffer); 755 wl_proxy_destroy((struct wl_proxy *) wl_buffer);
697 } 756 }
698 757
758 #ifndef WL_DATA_OFFER_ERROR_ENUM
759 #define WL_DATA_OFFER_ERROR_ENUM
760 enum wl_data_offer_error {
761 WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,
762 WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,
763 WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,
764 WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,
765 };
766 #endif /* WL_DATA_OFFER_ERROR_ENUM */
767
699 /** 768 /**
700 * wl_data_offer - offer to transfer data 769 * wl_data_offer - offer to transfer data
701 * @offer: advertise offered mime type 770 * @offer: advertise offered mime type
771 * @source_actions: notify the source-side available actions
772 * @action: notify the selected action
702 * 773 *
703 * A wl_data_offer represents a piece of data offered for transfer by 774 * A wl_data_offer represents a piece of data offered for transfer by
704 * another client (the source client). It is used by the copy-and-paste and 775 * another client (the source client). It is used by the copy-and-paste and
705 * drag-and-drop mechanisms. The offer describes the different mime types 776 * drag-and-drop mechanisms. The offer describes the different mime types
706 * that the data can be converted to and provides the mechanism for 777 * that the data can be converted to and provides the mechanism for
707 * transferring the data directly from the source client. 778 * transferring the data directly from the source client.
708 */ 779 */
709 struct wl_data_offer_listener { 780 struct wl_data_offer_listener {
710 /** 781 /**
711 * offer - advertise offered mime type 782 * offer - advertise offered mime type
712 * @mime_type: (none) 783 * @mime_type: (none)
713 * 784 *
714 * Sent immediately after creating the wl_data_offer object. One 785 * Sent immediately after creating the wl_data_offer object. One
715 * event per offered mime type. 786 * event per offered mime type.
716 */ 787 */
717 void (*offer)(void *data, 788 void (*offer)(void *data,
718 struct wl_data_offer *wl_data_offer, 789 struct wl_data_offer *wl_data_offer,
719 const char *mime_type); 790 const char *mime_type);
791 /**
792 * source_actions - notify the source-side available actions
793 * @source_actions: (none)
794 *
795 * This event indicates the actions offered by the data source.
796 * It will be sent right after wl_data_device.enter, or anytime the
797 * source side changes its offered actions through
798 * wl_data_source.set_actions.
799 * @since: 3
800 */
801 void (*source_actions)(void *data,
802 struct wl_data_offer *wl_data_offer,
803 uint32_t source_actions);
804 /**
805 * action - notify the selected action
806 * @dnd_action: (none)
807 *
808 * This event indicates the action selected by the compositor
809 * after matching the source/destination side actions. Only one
810 * action (or none) will be offered here.
811 *
812 * This event can be emitted multiple times during the
813 * drag-and-drop operation in response to destination side action
814 * changes through wl_data_offer.set_actions.
815 *
816 * This event will no longer be emitted after wl_data_device.drop
817 * happened on the drag-and-drop destination, the client must honor
818 * the last action received, or the last preferred one set through
819 * wl_data_offer.set_actions when handling an "ask" action.
820 *
821 * Compositors may also change the selected action on the fly,
822 * mainly in response to keyboard modifier changes during the
823 * drag-and-drop operation.
824 *
825 * The most recent action received is always the valid one. Prior
826 * to receiving wl_data_device.drop, the chosen action may change
827 * (e.g. due to keyboard modifiers being pressed). At the time of
828 * receiving wl_data_device.drop the drag-and-drop destination must
829 * honor the last action received.
830 *
831 * Action changes may still happen after wl_data_device.drop,
832 * especially on "ask" actions, where the drag-and-drop destination
833 * may choose another action afterwards. Action changes happening
834 * at this stage are always the result of inter-client negotiation,
835 * the compositor shall no longer be able to induce a different
836 * action.
837 *
838 * Upon "ask" actions, it is expected that the drag-and-drop
839 * destination may potentially choose different a different action
840 * and/or mime type, based on wl_data_offer.source_actions and
841 * finally chosen by the user (e.g. popping up a menu with the
842 * available options). The final wl_data_offer.set_actions and
843 * wl_data_offer.accept requests must happen before the call to
844 * wl_data_offer.finish.
845 * @since: 3
846 */
847 void (*action)(void *data,
848 struct wl_data_offer *wl_data_offer,
849 uint32_t dnd_action);
720 }; 850 };
721 851
722 static inline int 852 static inline int
723 wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer, 853 wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer,
724 const struct wl_data_offer_listener *listener, void * data) 854 const struct wl_data_offer_listener *listener, void * data)
725 { 855 {
726 return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer, 856 return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer,
727 (void (**)(void)) listener, data); 857 (void (**)(void)) listener, data);
728 } 858 }
729 859
730 #define WL_DATA_OFFER_ACCEPT 0 860 #define WL_DATA_OFFER_ACCEPT 0
731 #define WL_DATA_OFFER_RECEIVE 1 861 #define WL_DATA_OFFER_RECEIVE 1
732 #define WL_DATA_OFFER_DESTROY 2 862 #define WL_DATA_OFFER_DESTROY 2
863 #define WL_DATA_OFFER_FINISH 3
864 #define WL_DATA_OFFER_SET_ACTIONS 4
865
866 #define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1
867 #define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1
868 #define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1
869 #define WL_DATA_OFFER_FINISH_SINCE_VERSION 3
870 #define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3
733 871
734 static inline void 872 static inline void
735 wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data ) 873 wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data )
736 { 874 {
737 wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data); 875 wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data);
738 } 876 }
739 877
740 static inline void * 878 static inline void *
741 wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer) 879 wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer)
742 { 880 {
743 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer); 881 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer);
744 } 882 }
745 883
884 static inline uint32_t
885 wl_data_offer_get_version(struct wl_data_offer *wl_data_offer)
886 {
887 return wl_proxy_get_version((struct wl_proxy *) wl_data_offer);
888 }
889
746 static inline void 890 static inline void
747 wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type) 891 wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type)
748 { 892 {
749 wl_proxy_marshal((struct wl_proxy *) wl_data_offer, 893 wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
750 WL_DATA_OFFER_ACCEPT, serial, mime_type); 894 WL_DATA_OFFER_ACCEPT, serial, mime_type);
751 } 895 }
752 896
753 static inline void 897 static inline void
754 wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type , int32_t fd) 898 wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type , int32_t fd)
755 { 899 {
756 wl_proxy_marshal((struct wl_proxy *) wl_data_offer, 900 wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
757 WL_DATA_OFFER_RECEIVE, mime_type, fd); 901 WL_DATA_OFFER_RECEIVE, mime_type, fd);
758 } 902 }
759 903
760 static inline void 904 static inline void
761 wl_data_offer_destroy(struct wl_data_offer *wl_data_offer) 905 wl_data_offer_destroy(struct wl_data_offer *wl_data_offer)
762 { 906 {
763 wl_proxy_marshal((struct wl_proxy *) wl_data_offer, 907 wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
764 WL_DATA_OFFER_DESTROY); 908 WL_DATA_OFFER_DESTROY);
765 909
766 wl_proxy_destroy((struct wl_proxy *) wl_data_offer); 910 wl_proxy_destroy((struct wl_proxy *) wl_data_offer);
767 } 911 }
768 912
913 static inline void
914 wl_data_offer_finish(struct wl_data_offer *wl_data_offer)
915 {
916 wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
917 WL_DATA_OFFER_FINISH);
918 }
919
920 static inline void
921 wl_data_offer_set_actions(struct wl_data_offer *wl_data_offer, uint32_t dnd_acti ons, uint32_t preferred_action)
922 {
923 wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
924 WL_DATA_OFFER_SET_ACTIONS, dnd_actions, preferred_actio n);
925 }
926
927 #ifndef WL_DATA_SOURCE_ERROR_ENUM
928 #define WL_DATA_SOURCE_ERROR_ENUM
929 enum wl_data_source_error {
930 WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,
931 WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,
932 };
933 #endif /* WL_DATA_SOURCE_ERROR_ENUM */
934
769 /** 935 /**
770 * wl_data_source - offer to transfer data 936 * wl_data_source - offer to transfer data
771 * @target: a target accepts an offered mime type 937 * @target: a target accepts an offered mime type
772 * @send: send the data 938 * @send: send the data
773 * @cancelled: selection was cancelled 939 * @cancelled: selection was cancelled
940 * @dnd_drop_performed: the drag-and-drop operation physically finished
941 * @dnd_finished: the drag-and-drop operation concluded
942 * @action: notify the selected action
774 * 943 *
775 * The wl_data_source object is the source side of a wl_data_offer. It is 944 * The wl_data_source object is the source side of a wl_data_offer. It is
776 * created by the source client in a data transfer and provides a way to 945 * created by the source client in a data transfer and provides a way to
777 * describe the offered data and a way to respond to requests to transfer 946 * describe the offered data and a way to respond to requests to transfer
778 * the data. 947 * the data.
779 */ 948 */
780 struct wl_data_source_listener { 949 struct wl_data_source_listener {
781 /** 950 /**
782 * target - a target accepts an offered mime type 951 * target - a target accepts an offered mime type
783 * @mime_type: (none) 952 * @mime_type: (none)
(...skipping 15 matching lines...) Expand all
799 * specified mime type over the passed file descriptor, then close 968 * specified mime type over the passed file descriptor, then close
800 * it. 969 * it.
801 */ 970 */
802 void (*send)(void *data, 971 void (*send)(void *data,
803 struct wl_data_source *wl_data_source, 972 struct wl_data_source *wl_data_source,
804 const char *mime_type, 973 const char *mime_type,
805 int32_t fd); 974 int32_t fd);
806 /** 975 /**
807 * cancelled - selection was cancelled 976 * cancelled - selection was cancelled
808 * 977 *
809 » * This data source has been replaced by another data source. The 978 » * This data source is no longer valid. There are several reasons
810 » * client should clean up and destroy this data source. 979 » * why this could happen:
980 » *
981 » * - The data source has been replaced by another data source. -
982 » * The drag-and-drop operation was performed, but the drop
983 » * destination did not accept any of the mimetypes offered through
984 » * wl_data_source.target. - The drag-and-drop operation was
985 » * performed, but the drop destination did not select any of the
986 » * actions present in the mask offered through
987 » * wl_data_source.action. - The drag-and-drop operation was
988 » * performed but didn't happen over a surface. - The compositor
989 » * cancelled the drag-and-drop operation (e.g. compositor dependent
990 » * timeouts to avoid stale drag-and-drop transfers).
991 » *
992 » * The client should clean up and destroy this data source.
993 » *
994 » * For objects of version 2 or older, wl_data_source.cancelled will
995 » * only be emitted if the data source was replaced by another data
996 » * source.
811 */ 997 */
812 void (*cancelled)(void *data, 998 void (*cancelled)(void *data,
813 struct wl_data_source *wl_data_source); 999 struct wl_data_source *wl_data_source);
1000 /**
1001 * dnd_drop_performed - the drag-and-drop operation physically
1002 * finished
1003 *
1004 * The user performed the drop action. This event does not
1005 * indicate acceptance, wl_data_source.cancelled may still be
1006 * emitted afterwards if the drop destination does not accept any
1007 * mimetype.
1008 *
1009 * However, this event might however not be received if the
1010 * compositor cancelled the drag-and-drop operation before this
1011 * event could happen.
1012 *
1013 * Note that the data_source may still be used in the future and
1014 * should not be destroyed here.
1015 * @since: 3
1016 */
1017 void (*dnd_drop_performed)(void *data,
1018 struct wl_data_source *wl_data_source);
1019 /**
1020 * dnd_finished - the drag-and-drop operation concluded
1021 *
1022 * The drop destination finished interoperating with this data
1023 * source, so the client is now free to destroy this data source
1024 * and free all associated data.
1025 *
1026 * If the action used to perform the operation was "move", the
1027 * source can now delete the transferred data.
1028 * @since: 3
1029 */
1030 void (*dnd_finished)(void *data,
1031 struct wl_data_source *wl_data_source);
1032 /**
1033 * action - notify the selected action
1034 * @dnd_action: (none)
1035 *
1036 * This event indicates the action selected by the compositor
1037 * after matching the source/destination side actions. Only one
1038 * action (or none) will be offered here.
1039 *
1040 * This event can be emitted multiple times during the
1041 * drag-and-drop operation, mainly in response to destination side
1042 * changes through wl_data_offer.set_actions, and as the data
1043 * device enters/leaves surfaces.
1044 *
1045 * It is only possible to receive this event after
1046 * wl_data_source.dnd_drop_performed if the drag-and-drop operation
1047 * ended in an "ask" action, in which case the final
1048 * wl_data_source.action event will happen immediately before
1049 * wl_data_source.dnd_finished.
1050 *
1051 * Compositors may also change the selected action on the fly,
1052 * mainly in response to keyboard modifier changes during the
1053 * drag-and-drop operation.
1054 *
1055 * The most recent action received is always the valid one. The
1056 * chosen action may change alongside negotiation (e.g. an "ask"
1057 * action can turn into a "move" operation), so the effects of the
1058 * final action must always be applied in
1059 * wl_data_offer.dnd_finished.
1060 *
1061 * Clients can trigger cursor surface changes from this point, so
1062 * they reflect the current action.
1063 * @since: 3
1064 */
1065 void (*action)(void *data,
1066 struct wl_data_source *wl_data_source,
1067 uint32_t dnd_action);
814 }; 1068 };
815 1069
816 static inline int 1070 static inline int
817 wl_data_source_add_listener(struct wl_data_source *wl_data_source, 1071 wl_data_source_add_listener(struct wl_data_source *wl_data_source,
818 const struct wl_data_source_listener *listener, void *data) 1072 const struct wl_data_source_listener *listener, void *data)
819 { 1073 {
820 return wl_proxy_add_listener((struct wl_proxy *) wl_data_source, 1074 return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,
821 (void (**)(void)) listener, data); 1075 (void (**)(void)) listener, data);
822 } 1076 }
823 1077
824 #define WL_DATA_SOURCE_OFFER 0 1078 #define WL_DATA_SOURCE_OFFER 0
825 #define WL_DATA_SOURCE_DESTROY 1 1079 #define WL_DATA_SOURCE_DESTROY 1
1080 #define WL_DATA_SOURCE_SET_ACTIONS 2
1081
1082 #define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1
1083 #define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1
1084 #define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3
826 1085
827 static inline void 1086 static inline void
828 wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_d ata) 1087 wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_d ata)
829 { 1088 {
830 wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data); 1089 wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);
831 } 1090 }
832 1091
833 static inline void * 1092 static inline void *
834 wl_data_source_get_user_data(struct wl_data_source *wl_data_source) 1093 wl_data_source_get_user_data(struct wl_data_source *wl_data_source)
835 { 1094 {
836 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source); 1095 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);
837 } 1096 }
838 1097
1098 static inline uint32_t
1099 wl_data_source_get_version(struct wl_data_source *wl_data_source)
1100 {
1101 return wl_proxy_get_version((struct wl_proxy *) wl_data_source);
1102 }
1103
839 static inline void 1104 static inline void
840 wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_typ e) 1105 wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_typ e)
841 { 1106 {
842 wl_proxy_marshal((struct wl_proxy *) wl_data_source, 1107 wl_proxy_marshal((struct wl_proxy *) wl_data_source,
843 WL_DATA_SOURCE_OFFER, mime_type); 1108 WL_DATA_SOURCE_OFFER, mime_type);
844 } 1109 }
845 1110
846 static inline void 1111 static inline void
847 wl_data_source_destroy(struct wl_data_source *wl_data_source) 1112 wl_data_source_destroy(struct wl_data_source *wl_data_source)
848 { 1113 {
849 wl_proxy_marshal((struct wl_proxy *) wl_data_source, 1114 wl_proxy_marshal((struct wl_proxy *) wl_data_source,
850 WL_DATA_SOURCE_DESTROY); 1115 WL_DATA_SOURCE_DESTROY);
851 1116
852 wl_proxy_destroy((struct wl_proxy *) wl_data_source); 1117 wl_proxy_destroy((struct wl_proxy *) wl_data_source);
853 } 1118 }
854 1119
1120 static inline void
1121 wl_data_source_set_actions(struct wl_data_source *wl_data_source, uint32_t dnd_a ctions)
1122 {
1123 wl_proxy_marshal((struct wl_proxy *) wl_data_source,
1124 WL_DATA_SOURCE_SET_ACTIONS, dnd_actions);
1125 }
1126
855 #ifndef WL_DATA_DEVICE_ERROR_ENUM 1127 #ifndef WL_DATA_DEVICE_ERROR_ENUM
856 #define WL_DATA_DEVICE_ERROR_ENUM 1128 #define WL_DATA_DEVICE_ERROR_ENUM
857 enum wl_data_device_error { 1129 enum wl_data_device_error {
858 WL_DATA_DEVICE_ERROR_ROLE = 0, 1130 WL_DATA_DEVICE_ERROR_ROLE = 0,
859 }; 1131 };
860 #endif /* WL_DATA_DEVICE_ERROR_ENUM */ 1132 #endif /* WL_DATA_DEVICE_ERROR_ENUM */
861 1133
862 /** 1134 /**
863 * wl_data_device - data transfer device 1135 * wl_data_device - data transfer device
864 * @data_offer: introduce a new wl_data_offer 1136 * @data_offer: introduce a new wl_data_offer
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 void (*motion)(void *data, 1205 void (*motion)(void *data,
934 struct wl_data_device *wl_data_device, 1206 struct wl_data_device *wl_data_device,
935 uint32_t time, 1207 uint32_t time,
936 wl_fixed_t x, 1208 wl_fixed_t x,
937 wl_fixed_t y); 1209 wl_fixed_t y);
938 /** 1210 /**
939 * drop - end drag-and-drag session successfully 1211 * drop - end drag-and-drag session successfully
940 * 1212 *
941 * The event is sent when a drag-and-drop operation is ended 1213 * The event is sent when a drag-and-drop operation is ended
942 * because the implicit grab is removed. 1214 * because the implicit grab is removed.
1215 *
1216 * The drag-and-drop destination is expected to honor the last
1217 * action received through wl_data_offer.action, if the resulting
1218 * action is "copy" or "move", the destination can still perform
1219 * wl_data_offer.receive requests, and is expected to end all
1220 * transfers with a wl_data_offer.finish request.
1221 *
1222 * If the resulting action is "ask", the action will not be
1223 * considered final. The drag-and-drop destination is expected to
1224 * perform one last wl_data_offer.set_actions request, or
1225 * wl_data_offer.destroy in order to cancel the operation.
943 */ 1226 */
944 void (*drop)(void *data, 1227 void (*drop)(void *data,
945 struct wl_data_device *wl_data_device); 1228 struct wl_data_device *wl_data_device);
946 /** 1229 /**
947 * selection - advertise new selection 1230 * selection - advertise new selection
948 * @id: (none) 1231 * @id: (none)
949 * 1232 *
950 * The selection event is sent out to notify the client of a new 1233 * The selection event is sent out to notify the client of a new
951 * wl_data_offer for the selection for this device. The 1234 * wl_data_offer for the selection for this device. The
952 * data_device.data_offer and the data_offer.offer events are sent 1235 * data_device.data_offer and the data_offer.offer events are sent
(...skipping 15 matching lines...) Expand all
968 const struct wl_data_device_listener *listener, void *data) 1251 const struct wl_data_device_listener *listener, void *data)
969 { 1252 {
970 return wl_proxy_add_listener((struct wl_proxy *) wl_data_device, 1253 return wl_proxy_add_listener((struct wl_proxy *) wl_data_device,
971 (void (**)(void)) listener, data); 1254 (void (**)(void)) listener, data);
972 } 1255 }
973 1256
974 #define WL_DATA_DEVICE_START_DRAG 0 1257 #define WL_DATA_DEVICE_START_DRAG 0
975 #define WL_DATA_DEVICE_SET_SELECTION 1 1258 #define WL_DATA_DEVICE_SET_SELECTION 1
976 #define WL_DATA_DEVICE_RELEASE 2 1259 #define WL_DATA_DEVICE_RELEASE 2
977 1260
1261 #define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1
1262 #define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1
1263 #define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2
1264
978 static inline void 1265 static inline void
979 wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_d ata) 1266 wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_d ata)
980 { 1267 {
981 wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data); 1268 wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data);
982 } 1269 }
983 1270
984 static inline void * 1271 static inline void *
985 wl_data_device_get_user_data(struct wl_data_device *wl_data_device) 1272 wl_data_device_get_user_data(struct wl_data_device *wl_data_device)
986 { 1273 {
987 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device); 1274 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device);
988 } 1275 }
989 1276
1277 static inline uint32_t
1278 wl_data_device_get_version(struct wl_data_device *wl_data_device)
1279 {
1280 return wl_proxy_get_version((struct wl_proxy *) wl_data_device);
1281 }
1282
990 static inline void 1283 static inline void
991 wl_data_device_destroy(struct wl_data_device *wl_data_device) 1284 wl_data_device_destroy(struct wl_data_device *wl_data_device)
992 { 1285 {
993 wl_proxy_destroy((struct wl_proxy *) wl_data_device); 1286 wl_proxy_destroy((struct wl_proxy *) wl_data_device);
994 } 1287 }
995 1288
996 static inline void 1289 static inline void
997 wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_ source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t ser ial) 1290 wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_ source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t ser ial)
998 { 1291 {
999 wl_proxy_marshal((struct wl_proxy *) wl_data_device, 1292 wl_proxy_marshal((struct wl_proxy *) wl_data_device,
1000 WL_DATA_DEVICE_START_DRAG, source, origin, icon, serial ); 1293 WL_DATA_DEVICE_START_DRAG, source, origin, icon, serial );
1001 } 1294 }
1002 1295
1003 static inline void 1296 static inline void
1004 wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_da ta_source *source, uint32_t serial) 1297 wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_da ta_source *source, uint32_t serial)
1005 { 1298 {
1006 wl_proxy_marshal((struct wl_proxy *) wl_data_device, 1299 wl_proxy_marshal((struct wl_proxy *) wl_data_device,
1007 WL_DATA_DEVICE_SET_SELECTION, source, serial); 1300 WL_DATA_DEVICE_SET_SELECTION, source, serial);
1008 } 1301 }
1009 1302
1010 static inline void 1303 static inline void
1011 wl_data_device_release(struct wl_data_device *wl_data_device) 1304 wl_data_device_release(struct wl_data_device *wl_data_device)
1012 { 1305 {
1013 wl_proxy_marshal((struct wl_proxy *) wl_data_device, 1306 wl_proxy_marshal((struct wl_proxy *) wl_data_device,
1014 WL_DATA_DEVICE_RELEASE); 1307 WL_DATA_DEVICE_RELEASE);
1015 1308
1016 wl_proxy_destroy((struct wl_proxy *) wl_data_device); 1309 wl_proxy_destroy((struct wl_proxy *) wl_data_device);
1017 } 1310 }
1018 1311
1312 #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
1313 #define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
1314 /**
1315 * wl_data_device_manager_dnd_action - drag and drop actions
1316 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE: (none)
1317 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY: (none)
1318 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE: (none)
1319 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK: (none)
1320 *
1321 * This is a bitmask of the available/preferred actions in a
1322 * drag-and-drop operation.
1323 *
1324 * In the compositor, the selected action is a result of matching the
1325 * actions offered by the source and destination sides. "action" events
1326 * with a "none" action will be sent to both source and destination if
1327 * there is no match. All further checks will effectively happen on (source
1328 * actions ∩ destination actions).
1329 *
1330 * In addition, compositors may also pick different actions in reaction to
1331 * key modifiers being pressed, one common design that is used in major
1332 * toolkits (and the behavior recommended for compositors) is:
1333 *
1334 * - If no modifiers are pressed, the first match (in bit order) will be
1335 * used. - Pressing Shift selects "move", if enabled in the mask. -
1336 * Pressing Control selects "copy", if enabled in the mask.
1337 *
1338 * Behavior beyond that is considered implementation-dependent. Compositors
1339 * may for example bind other modifiers (like Alt/Meta) or drags initiated
1340 * with other buttons than BTN_LEFT to specific actions (e.g. "ask").
1341 */
1342 enum wl_data_device_manager_dnd_action {
1343 WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
1344 WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
1345 WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
1346 WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,
1347 };
1348 #endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
1349
1019 #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 0 1350 #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 0
1020 #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1 1351 #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1
1021 1352
1353 #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1
1354 #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1
1355
1022 static inline void 1356 static inline void
1023 wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_devi ce_manager, void *user_data) 1357 wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_devi ce_manager, void *user_data)
1024 { 1358 {
1025 wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_ data); 1359 wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_ data);
1026 } 1360 }
1027 1361
1028 static inline void * 1362 static inline void *
1029 wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_devi ce_manager) 1363 wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_devi ce_manager)
1030 { 1364 {
1031 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager ); 1365 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager );
1032 } 1366 }
1033 1367
1368 static inline uint32_t
1369 wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device _manager)
1370 {
1371 return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager);
1372 }
1373
1034 static inline void 1374 static inline void
1035 wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_man ager) 1375 wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_man ager)
1036 { 1376 {
1037 wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager); 1377 wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager);
1038 } 1378 }
1039 1379
1040 static inline struct wl_data_source * 1380 static inline struct wl_data_source *
1041 wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data _device_manager) 1381 wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data _device_manager)
1042 { 1382 {
1043 struct wl_proxy *id; 1383 struct wl_proxy *id;
(...skipping 17 matching lines...) Expand all
1061 1401
1062 #ifndef WL_SHELL_ERROR_ENUM 1402 #ifndef WL_SHELL_ERROR_ENUM
1063 #define WL_SHELL_ERROR_ENUM 1403 #define WL_SHELL_ERROR_ENUM
1064 enum wl_shell_error { 1404 enum wl_shell_error {
1065 WL_SHELL_ERROR_ROLE = 0, 1405 WL_SHELL_ERROR_ROLE = 0,
1066 }; 1406 };
1067 #endif /* WL_SHELL_ERROR_ENUM */ 1407 #endif /* WL_SHELL_ERROR_ENUM */
1068 1408
1069 #define WL_SHELL_GET_SHELL_SURFACE 0 1409 #define WL_SHELL_GET_SHELL_SURFACE 0
1070 1410
1411 #define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1
1412
1071 static inline void 1413 static inline void
1072 wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data) 1414 wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data)
1073 { 1415 {
1074 wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data); 1416 wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data);
1075 } 1417 }
1076 1418
1077 static inline void * 1419 static inline void *
1078 wl_shell_get_user_data(struct wl_shell *wl_shell) 1420 wl_shell_get_user_data(struct wl_shell *wl_shell)
1079 { 1421 {
1080 return wl_proxy_get_user_data((struct wl_proxy *) wl_shell); 1422 return wl_proxy_get_user_data((struct wl_proxy *) wl_shell);
1081 } 1423 }
1082 1424
1425 static inline uint32_t
1426 wl_shell_get_version(struct wl_shell *wl_shell)
1427 {
1428 return wl_proxy_get_version((struct wl_proxy *) wl_shell);
1429 }
1430
1083 static inline void 1431 static inline void
1084 wl_shell_destroy(struct wl_shell *wl_shell) 1432 wl_shell_destroy(struct wl_shell *wl_shell)
1085 { 1433 {
1086 wl_proxy_destroy((struct wl_proxy *) wl_shell); 1434 wl_proxy_destroy((struct wl_proxy *) wl_shell);
1087 } 1435 }
1088 1436
1089 static inline struct wl_shell_surface * 1437 static inline struct wl_shell_surface *
1090 wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface ) 1438 wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface )
1091 { 1439 {
1092 struct wl_proxy *id; 1440 struct wl_proxy *id;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 #define WL_SHELL_SURFACE_MOVE 1 1598 #define WL_SHELL_SURFACE_MOVE 1
1251 #define WL_SHELL_SURFACE_RESIZE 2 1599 #define WL_SHELL_SURFACE_RESIZE 2
1252 #define WL_SHELL_SURFACE_SET_TOPLEVEL 3 1600 #define WL_SHELL_SURFACE_SET_TOPLEVEL 3
1253 #define WL_SHELL_SURFACE_SET_TRANSIENT 4 1601 #define WL_SHELL_SURFACE_SET_TRANSIENT 4
1254 #define WL_SHELL_SURFACE_SET_FULLSCREEN 5 1602 #define WL_SHELL_SURFACE_SET_FULLSCREEN 5
1255 #define WL_SHELL_SURFACE_SET_POPUP 6 1603 #define WL_SHELL_SURFACE_SET_POPUP 6
1256 #define WL_SHELL_SURFACE_SET_MAXIMIZED 7 1604 #define WL_SHELL_SURFACE_SET_MAXIMIZED 7
1257 #define WL_SHELL_SURFACE_SET_TITLE 8 1605 #define WL_SHELL_SURFACE_SET_TITLE 8
1258 #define WL_SHELL_SURFACE_SET_CLASS 9 1606 #define WL_SHELL_SURFACE_SET_CLASS 9
1259 1607
1608 #define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1
1609 #define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1
1610 #define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1
1611 #define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1
1612 #define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1
1613 #define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
1614 #define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1
1615 #define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
1616 #define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1
1617 #define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1
1618
1260 static inline void 1619 static inline void
1261 wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void * user_data) 1620 wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void * user_data)
1262 { 1621 {
1263 wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data); 1622 wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data);
1264 } 1623 }
1265 1624
1266 static inline void * 1625 static inline void *
1267 wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface) 1626 wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface)
1268 { 1627 {
1269 return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface); 1628 return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface);
1270 } 1629 }
1271 1630
1631 static inline uint32_t
1632 wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface)
1633 {
1634 return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface);
1635 }
1636
1272 static inline void 1637 static inline void
1273 wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface) 1638 wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface)
1274 { 1639 {
1275 wl_proxy_destroy((struct wl_proxy *) wl_shell_surface); 1640 wl_proxy_destroy((struct wl_proxy *) wl_shell_surface);
1276 } 1641 }
1277 1642
1278 static inline void 1643 static inline void
1279 wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial ) 1644 wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial )
1280 { 1645 {
1281 wl_proxy_marshal((struct wl_proxy *) wl_shell_surface, 1646 wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 1804
1440 #define WL_SURFACE_DESTROY 0 1805 #define WL_SURFACE_DESTROY 0
1441 #define WL_SURFACE_ATTACH 1 1806 #define WL_SURFACE_ATTACH 1
1442 #define WL_SURFACE_DAMAGE 2 1807 #define WL_SURFACE_DAMAGE 2
1443 #define WL_SURFACE_FRAME 3 1808 #define WL_SURFACE_FRAME 3
1444 #define WL_SURFACE_SET_OPAQUE_REGION 4 1809 #define WL_SURFACE_SET_OPAQUE_REGION 4
1445 #define WL_SURFACE_SET_INPUT_REGION 5 1810 #define WL_SURFACE_SET_INPUT_REGION 5
1446 #define WL_SURFACE_COMMIT 6 1811 #define WL_SURFACE_COMMIT 6
1447 #define WL_SURFACE_SET_BUFFER_TRANSFORM 7 1812 #define WL_SURFACE_SET_BUFFER_TRANSFORM 7
1448 #define WL_SURFACE_SET_BUFFER_SCALE 8 1813 #define WL_SURFACE_SET_BUFFER_SCALE 8
1814 #define WL_SURFACE_DAMAGE_BUFFER 9
1815
1816 #define WL_SURFACE_DESTROY_SINCE_VERSION 1
1817 #define WL_SURFACE_ATTACH_SINCE_VERSION 1
1818 #define WL_SURFACE_DAMAGE_SINCE_VERSION 1
1819 #define WL_SURFACE_FRAME_SINCE_VERSION 1
1820 #define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1
1821 #define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1
1822 #define WL_SURFACE_COMMIT_SINCE_VERSION 1
1823 #define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2
1824 #define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3
1825 #define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4
1449 1826
1450 static inline void 1827 static inline void
1451 wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data) 1828 wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data)
1452 { 1829 {
1453 wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data); 1830 wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data);
1454 } 1831 }
1455 1832
1456 static inline void * 1833 static inline void *
1457 wl_surface_get_user_data(struct wl_surface *wl_surface) 1834 wl_surface_get_user_data(struct wl_surface *wl_surface)
1458 { 1835 {
1459 return wl_proxy_get_user_data((struct wl_proxy *) wl_surface); 1836 return wl_proxy_get_user_data((struct wl_proxy *) wl_surface);
1460 } 1837 }
1461 1838
1839 static inline uint32_t
1840 wl_surface_get_version(struct wl_surface *wl_surface)
1841 {
1842 return wl_proxy_get_version((struct wl_proxy *) wl_surface);
1843 }
1844
1462 static inline void 1845 static inline void
1463 wl_surface_destroy(struct wl_surface *wl_surface) 1846 wl_surface_destroy(struct wl_surface *wl_surface)
1464 { 1847 {
1465 wl_proxy_marshal((struct wl_proxy *) wl_surface, 1848 wl_proxy_marshal((struct wl_proxy *) wl_surface,
1466 WL_SURFACE_DESTROY); 1849 WL_SURFACE_DESTROY);
1467 1850
1468 wl_proxy_destroy((struct wl_proxy *) wl_surface); 1851 wl_proxy_destroy((struct wl_proxy *) wl_surface);
1469 } 1852 }
1470 1853
1471 static inline void 1854 static inline void
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 WL_SURFACE_SET_BUFFER_TRANSFORM, transform); 1904 WL_SURFACE_SET_BUFFER_TRANSFORM, transform);
1522 } 1905 }
1523 1906
1524 static inline void 1907 static inline void
1525 wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale) 1908 wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale)
1526 { 1909 {
1527 wl_proxy_marshal((struct wl_proxy *) wl_surface, 1910 wl_proxy_marshal((struct wl_proxy *) wl_surface,
1528 WL_SURFACE_SET_BUFFER_SCALE, scale); 1911 WL_SURFACE_SET_BUFFER_SCALE, scale);
1529 } 1912 }
1530 1913
1914 static inline void
1915 wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x, int32_t y, in t32_t width, int32_t height)
1916 {
1917 wl_proxy_marshal((struct wl_proxy *) wl_surface,
1918 WL_SURFACE_DAMAGE_BUFFER, x, y, width, height);
1919 }
1920
1531 #ifndef WL_SEAT_CAPABILITY_ENUM 1921 #ifndef WL_SEAT_CAPABILITY_ENUM
1532 #define WL_SEAT_CAPABILITY_ENUM 1922 #define WL_SEAT_CAPABILITY_ENUM
1533 /** 1923 /**
1534 * wl_seat_capability - seat capability bitmask 1924 * wl_seat_capability - seat capability bitmask
1535 * @WL_SEAT_CAPABILITY_POINTER: The seat has pointer devices 1925 * @WL_SEAT_CAPABILITY_POINTER: The seat has pointer devices
1536 * @WL_SEAT_CAPABILITY_KEYBOARD: The seat has one or more keyboards 1926 * @WL_SEAT_CAPABILITY_KEYBOARD: The seat has one or more keyboards
1537 * @WL_SEAT_CAPABILITY_TOUCH: The seat has touch devices 1927 * @WL_SEAT_CAPABILITY_TOUCH: The seat has touch devices
1538 * 1928 *
1539 * This is a bitmask of capabilities this seat has; if a member is set, 1929 * This is a bitmask of capabilities this seat has; if a member is set,
1540 * then it is present on the seat. 1930 * then it is present on the seat.
(...skipping 16 matching lines...) Expand all
1557 * and a pointer focus. 1947 * and a pointer focus.
1558 */ 1948 */
1559 struct wl_seat_listener { 1949 struct wl_seat_listener {
1560 /** 1950 /**
1561 * capabilities - seat capabilities changed 1951 * capabilities - seat capabilities changed
1562 * @capabilities: (none) 1952 * @capabilities: (none)
1563 * 1953 *
1564 * This is emitted whenever a seat gains or loses the pointer, 1954 * This is emitted whenever a seat gains or loses the pointer,
1565 * keyboard or touch capabilities. The argument is a capability 1955 * keyboard or touch capabilities. The argument is a capability
1566 * enum containing the complete set of capabilities this seat has. 1956 * enum containing the complete set of capabilities this seat has.
1957 *
1958 * When the pointer capability is added, a client may create a
1959 * wl_pointer object using the wl_seat.get_pointer request. This
1960 * object will receive pointer events until the capability is
1961 * removed in the future.
1962 *
1963 * When the pointer capability is removed, a client should destroy
1964 * the wl_pointer objects associated with the seat where the
1965 * capability was removed, using the wl_pointer.release request. No
1966 * further pointer events will be received on these objects.
1967 *
1968 * In some compositors, if a seat regains the pointer capability
1969 * and a client has a previously obtained wl_pointer object of
1970 * version 4 or less, that object may start sending pointer events
1971 * again. This behavior is considered a misinterpretation of the
1972 * intended behavior and must not be relied upon by the client.
1973 * wl_pointer objects of version 5 or later must not send events if
1974 * created before the most recent event notifying the client of an
1975 * added pointer capability.
1976 *
1977 * The above behavior also applies to wl_keyboard and wl_touch with
1978 * the keyboard and touch capabilities, respectively.
1567 */ 1979 */
1568 void (*capabilities)(void *data, 1980 void (*capabilities)(void *data,
1569 struct wl_seat *wl_seat, 1981 struct wl_seat *wl_seat,
1570 uint32_t capabilities); 1982 uint32_t capabilities);
1571 /** 1983 /**
1572 * name - unique identifier for this seat 1984 * name - unique identifier for this seat
1573 * @name: (none) 1985 * @name: (none)
1574 * 1986 *
1575 * In a multiseat configuration this can be used by the client to 1987 * In a multiseat configuration this can be used by the client to
1576 * help identify which physical devices the seat represents. Based 1988 * help identify which physical devices the seat represents. Based
1577 * on the seat configuration used by the compositor. 1989 * on the seat configuration used by the compositor.
1578 * @since: 2 1990 * @since: 2
1579 */ 1991 */
1580 void (*name)(void *data, 1992 void (*name)(void *data,
1581 struct wl_seat *wl_seat, 1993 struct wl_seat *wl_seat,
1582 const char *name); 1994 const char *name);
1583 }; 1995 };
1584 1996
1585 static inline int 1997 static inline int
1586 wl_seat_add_listener(struct wl_seat *wl_seat, 1998 wl_seat_add_listener(struct wl_seat *wl_seat,
1587 const struct wl_seat_listener *listener, void *data) 1999 const struct wl_seat_listener *listener, void *data)
1588 { 2000 {
1589 return wl_proxy_add_listener((struct wl_proxy *) wl_seat, 2001 return wl_proxy_add_listener((struct wl_proxy *) wl_seat,
1590 (void (**)(void)) listener, data); 2002 (void (**)(void)) listener, data);
1591 } 2003 }
1592 2004
1593 #define WL_SEAT_GET_POINTER 0 2005 #define WL_SEAT_GET_POINTER 0
1594 #define WL_SEAT_GET_KEYBOARD 1 2006 #define WL_SEAT_GET_KEYBOARD 1
1595 #define WL_SEAT_GET_TOUCH 2 2007 #define WL_SEAT_GET_TOUCH 2
2008 #define WL_SEAT_RELEASE 3
2009
2010 #define WL_SEAT_GET_POINTER_SINCE_VERSION 1
2011 #define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1
2012 #define WL_SEAT_GET_TOUCH_SINCE_VERSION 1
2013 #define WL_SEAT_RELEASE_SINCE_VERSION 5
1596 2014
1597 static inline void 2015 static inline void
1598 wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data) 2016 wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data)
1599 { 2017 {
1600 wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data); 2018 wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data);
1601 } 2019 }
1602 2020
1603 static inline void * 2021 static inline void *
1604 wl_seat_get_user_data(struct wl_seat *wl_seat) 2022 wl_seat_get_user_data(struct wl_seat *wl_seat)
1605 { 2023 {
1606 return wl_proxy_get_user_data((struct wl_proxy *) wl_seat); 2024 return wl_proxy_get_user_data((struct wl_proxy *) wl_seat);
1607 } 2025 }
1608 2026
2027 static inline uint32_t
2028 wl_seat_get_version(struct wl_seat *wl_seat)
2029 {
2030 return wl_proxy_get_version((struct wl_proxy *) wl_seat);
2031 }
2032
1609 static inline void 2033 static inline void
1610 wl_seat_destroy(struct wl_seat *wl_seat) 2034 wl_seat_destroy(struct wl_seat *wl_seat)
1611 { 2035 {
1612 wl_proxy_destroy((struct wl_proxy *) wl_seat); 2036 wl_proxy_destroy((struct wl_proxy *) wl_seat);
1613 } 2037 }
1614 2038
1615 static inline struct wl_pointer * 2039 static inline struct wl_pointer *
1616 wl_seat_get_pointer(struct wl_seat *wl_seat) 2040 wl_seat_get_pointer(struct wl_seat *wl_seat)
1617 { 2041 {
1618 struct wl_proxy *id; 2042 struct wl_proxy *id;
(...skipping 19 matching lines...) Expand all
1638 wl_seat_get_touch(struct wl_seat *wl_seat) 2062 wl_seat_get_touch(struct wl_seat *wl_seat)
1639 { 2063 {
1640 struct wl_proxy *id; 2064 struct wl_proxy *id;
1641 2065
1642 id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat, 2066 id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat,
1643 WL_SEAT_GET_TOUCH, &wl_touch_interface, NULL); 2067 WL_SEAT_GET_TOUCH, &wl_touch_interface, NULL);
1644 2068
1645 return (struct wl_touch *) id; 2069 return (struct wl_touch *) id;
1646 } 2070 }
1647 2071
2072 static inline void
2073 wl_seat_release(struct wl_seat *wl_seat)
2074 {
2075 wl_proxy_marshal((struct wl_proxy *) wl_seat,
2076 WL_SEAT_RELEASE);
2077
2078 wl_proxy_destroy((struct wl_proxy *) wl_seat);
2079 }
2080
1648 #ifndef WL_POINTER_ERROR_ENUM 2081 #ifndef WL_POINTER_ERROR_ENUM
1649 #define WL_POINTER_ERROR_ENUM 2082 #define WL_POINTER_ERROR_ENUM
1650 enum wl_pointer_error { 2083 enum wl_pointer_error {
1651 WL_POINTER_ERROR_ROLE = 0, 2084 WL_POINTER_ERROR_ROLE = 0,
1652 }; 2085 };
1653 #endif /* WL_POINTER_ERROR_ENUM */ 2086 #endif /* WL_POINTER_ERROR_ENUM */
1654 2087
1655 #ifndef WL_POINTER_BUTTON_STATE_ENUM 2088 #ifndef WL_POINTER_BUTTON_STATE_ENUM
1656 #define WL_POINTER_BUTTON_STATE_ENUM 2089 #define WL_POINTER_BUTTON_STATE_ENUM
1657 /** 2090 /**
(...skipping 18 matching lines...) Expand all
1676 * @WL_POINTER_AXIS_HORIZONTAL_SCROLL: (none) 2109 * @WL_POINTER_AXIS_HORIZONTAL_SCROLL: (none)
1677 * 2110 *
1678 * Describes the axis types of scroll events. 2111 * Describes the axis types of scroll events.
1679 */ 2112 */
1680 enum wl_pointer_axis { 2113 enum wl_pointer_axis {
1681 WL_POINTER_AXIS_VERTICAL_SCROLL = 0, 2114 WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
1682 WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, 2115 WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
1683 }; 2116 };
1684 #endif /* WL_POINTER_AXIS_ENUM */ 2117 #endif /* WL_POINTER_AXIS_ENUM */
1685 2118
2119 #ifndef WL_POINTER_AXIS_SOURCE_ENUM
2120 #define WL_POINTER_AXIS_SOURCE_ENUM
2121 /**
2122 * wl_pointer_axis_source - axis source types
2123 * @WL_POINTER_AXIS_SOURCE_WHEEL: A physical wheel
2124 * @WL_POINTER_AXIS_SOURCE_FINGER: Finger on a touch surface
2125 * @WL_POINTER_AXIS_SOURCE_CONTINUOUS: Continuous coordinate space
2126 *
2127 * Describes the source types for axis events. This indicates to the
2128 * client how an axis event was physically generated; a client may adjust
2129 * the user interface accordingly. For example, scroll events from a
2130 * "finger" source may be in a smooth coordinate space with kinetic
2131 * scrolling whereas a "wheel" source may be in discrete steps of a number
2132 * of lines.
2133 *
2134 * The "continuous" axis source is a device generating events in a
2135 * continuous coordinate space, but using something other than a finger.
2136 * One example for this source is button-based scrolling where the vertical
2137 * motion of a device is converted to scroll events while a button is held
2138 * down.
2139 */
2140 enum wl_pointer_axis_source {
2141 WL_POINTER_AXIS_SOURCE_WHEEL = 0,
2142 WL_POINTER_AXIS_SOURCE_FINGER = 1,
2143 WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
2144 };
2145 #endif /* WL_POINTER_AXIS_SOURCE_ENUM */
2146
1686 /** 2147 /**
1687 * wl_pointer - pointer input device 2148 * wl_pointer - pointer input device
1688 * @enter: enter event 2149 * @enter: enter event
1689 * @leave: leave event 2150 * @leave: leave event
1690 * @motion: pointer motion event 2151 * @motion: pointer motion event
1691 * @button: pointer button event 2152 * @button: pointer button event
1692 * @axis: axis event 2153 * @axis: axis event
2154 * @frame: end of a pointer event sequence
2155 * @axis_source: axis source event
2156 * @axis_stop: axis stop event
2157 * @axis_discrete: axis click event
1693 * 2158 *
1694 * The wl_pointer interface represents one or more input devices, such as 2159 * The wl_pointer interface represents one or more input devices, such as
1695 * mice, which control the pointer location and pointer_focus of a seat. 2160 * mice, which control the pointer location and pointer_focus of a seat.
1696 * 2161 *
1697 * The wl_pointer interface generates motion, enter and leave events for 2162 * The wl_pointer interface generates motion, enter and leave events for
1698 * the surfaces that the pointer is located over, and button and axis 2163 * the surfaces that the pointer is located over, and button and axis
1699 * events for button presses, button releases and scrolling. 2164 * events for button presses, button releases and scrolling.
1700 */ 2165 */
1701 struct wl_pointer_listener { 2166 struct wl_pointer_listener {
1702 /** 2167 /**
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 * equivalent to a motion event vector. 2254 * equivalent to a motion event vector.
1790 * 2255 *
1791 * When applicable, clients can transform its view relative to the 2256 * When applicable, clients can transform its view relative to the
1792 * scroll distance. 2257 * scroll distance.
1793 */ 2258 */
1794 void (*axis)(void *data, 2259 void (*axis)(void *data,
1795 struct wl_pointer *wl_pointer, 2260 struct wl_pointer *wl_pointer,
1796 uint32_t time, 2261 uint32_t time,
1797 uint32_t axis, 2262 uint32_t axis,
1798 wl_fixed_t value); 2263 wl_fixed_t value);
2264 /**
2265 * frame - end of a pointer event sequence
2266 *
2267 * Indicates the end of a set of events that logically belong
2268 * together. A client is expected to accumulate the data in all
2269 * events within the frame before proceeding.
2270 *
2271 * All wl_pointer events before a wl_pointer.frame event belong
2272 * logically together. For example, in a diagonal scroll motion the
2273 * compositor will send an optional wl_pointer.axis_source event,
2274 * two wl_pointer.axis events (horizontal and vertical) and finally
2275 * a wl_pointer.frame event. The client may use this information to
2276 * calculate a diagonal vector for scrolling.
2277 *
2278 * When multiple wl_pointer.axis events occur within the same
2279 * frame, the motion vector is the combined motion of all events.
2280 * When a wl_pointer.axis and a wl_pointer.axis_stop event occur
2281 * within the same frame, this indicates that axis movement in one
2282 * axis has stopped but continues in the other axis. When multiple
2283 * wl_pointer.axis_stop events occur within in the same frame, this
2284 * indicates that these axes stopped in the same instance.
2285 *
2286 * A wl_pointer.frame event is sent for every logical event group,
2287 * even if the group only contains a single wl_pointer event.
2288 * Specifically, a client may get a sequence: motion, frame,
2289 * button, frame, axis, frame, axis_stop, frame.
2290 *
2291 * The wl_pointer.enter and wl_pointer.leave events are logical
2292 * events generated by the compositor and not the hardware. These
2293 * events are also grouped by a wl_pointer.frame. When a pointer
2294 * moves from one surface to the another, a compositor should group
2295 * the wl_pointer.leave event within the same wl_pointer.frame.
2296 * However, a client must not rely on wl_pointer.leave and
2297 * wl_pointer.enter being in the same wl_pointer.frame.
2298 * Compositor-specific policies may require the wl_pointer.leave
2299 * and wl_pointer.enter event being split across multiple
2300 * wl_pointer.frame groups.
2301 * @since: 5
2302 */
2303 void (*frame)(void *data,
2304 struct wl_pointer *wl_pointer);
2305 /**
2306 * axis_source - axis source event
2307 * @axis_source: (none)
2308 *
2309 * Source information for scroll and other axes.
2310 *
2311 * This event does not occur on its own. It is sent before a
2312 * wl_pointer.frame event and carries the source information for
2313 * all events within that frame.
2314 *
2315 * The source specifies how this event was generated. If the source
2316 * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event
2317 * will be sent when the user lifts the finger off the device.
2318 *
2319 * If the source is wl_pointer axis_source.wheel or
2320 * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event
2321 * may or may not be sent. Whether a compositor sends a axis_stop
2322 * event for these sources is hardware-specific and
2323 * implementation-dependent; clients must not rely on receiving an
2324 * axis_stop event for these scroll sources and should treat scroll
2325 * sequences from these scroll sources as unterminated by default.
2326 *
2327 * This event is optional. If the source is unknown for a
2328 * particular axis event sequence, no event is sent. Only one
2329 * wl_pointer.axis_source event is permitted per frame.
2330 *
2331 * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
2332 * is not guaranteed.
2333 * @since: 5
2334 */
2335 void (*axis_source)(void *data,
2336 struct wl_pointer *wl_pointer,
2337 uint32_t axis_source);
2338 /**
2339 * axis_stop - axis stop event
2340 * @time: timestamp with millisecond granularity
2341 * @axis: the axis stopped with this event
2342 *
2343 * Stop notification for scroll and other axes.
2344 *
2345 * For some wl_pointer.axis_source types, a wl_pointer.axis_stop
2346 * event is sent to notify a client that the axis sequence has
2347 * terminated. This enables the client to implement kinetic
2348 * scrolling. See the wl_pointer.axis_source documentation for
2349 * information on when this event may be generated.
2350 *
2351 * Any wl_pointer.axis events with the same axis_source after this
2352 * event should be considered as the start of a new axis motion.
2353 *
2354 * The timestamp is to be interpreted identical to the timestamp in
2355 * the wl_pointer.axis event. The timestamp value may be the same
2356 * as a preceeding wl_pointer.axis event.
2357 * @since: 5
2358 */
2359 void (*axis_stop)(void *data,
2360 struct wl_pointer *wl_pointer,
2361 uint32_t time,
2362 uint32_t axis);
2363 /**
2364 * axis_discrete - axis click event
2365 * @axis: (none)
2366 * @discrete: (none)
2367 *
2368 * Discrete step information for scroll and other axes.
2369 *
2370 * This event carries the axis value of the wl_pointer.axis event
2371 * in discrete steps (e.g. mouse wheel clicks).
2372 *
2373 * This event does not occur on its own, it is coupled with a
2374 * wl_pointer.axis event that represents this axis value on a
2375 * continuous scale. The protocol guarantees that each
2376 * axis_discrete event is always followed by exactly one axis event
2377 * with the same axis number within the same wl_pointer.frame. Note
2378 * that the protocol allows for other events to occur between the
2379 * axis_discrete and its coupled axis event, including other
2380 * axis_discrete or axis events.
2381 *
2382 * This event is optional; continuous scrolling devices like
2383 * two-finger scrolling on touchpads do not have discrete steps and
2384 * do not generate this event.
2385 *
2386 * The discrete value carries the directional information. e.g. a
2387 * value of -2 is two steps towards the negative direction of this
2388 * axis.
2389 *
2390 * The axis number is identical to the axis number in the associate
2391 * axis event.
2392 *
2393 * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
2394 * is not guaranteed.
2395 * @since: 5
2396 */
2397 void (*axis_discrete)(void *data,
2398 struct wl_pointer *wl_pointer,
2399 uint32_t axis,
2400 int32_t discrete);
1799 }; 2401 };
1800 2402
1801 static inline int 2403 static inline int
1802 wl_pointer_add_listener(struct wl_pointer *wl_pointer, 2404 wl_pointer_add_listener(struct wl_pointer *wl_pointer,
1803 const struct wl_pointer_listener *listener, void *data) 2405 const struct wl_pointer_listener *listener, void *data)
1804 { 2406 {
1805 return wl_proxy_add_listener((struct wl_proxy *) wl_pointer, 2407 return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,
1806 (void (**)(void)) listener, data); 2408 (void (**)(void)) listener, data);
1807 } 2409 }
1808 2410
1809 #define WL_POINTER_SET_CURSOR 0 2411 #define WL_POINTER_SET_CURSOR 0
1810 #define WL_POINTER_RELEASE 1 2412 #define WL_POINTER_RELEASE 1
1811 2413
2414 #define WL_POINTER_SET_CURSOR_SINCE_VERSION 1
2415 #define WL_POINTER_RELEASE_SINCE_VERSION 3
2416
1812 static inline void 2417 static inline void
1813 wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data) 2418 wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data)
1814 { 2419 {
1815 wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data); 2420 wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data);
1816 } 2421 }
1817 2422
1818 static inline void * 2423 static inline void *
1819 wl_pointer_get_user_data(struct wl_pointer *wl_pointer) 2424 wl_pointer_get_user_data(struct wl_pointer *wl_pointer)
1820 { 2425 {
1821 return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer); 2426 return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);
1822 } 2427 }
1823 2428
2429 static inline uint32_t
2430 wl_pointer_get_version(struct wl_pointer *wl_pointer)
2431 {
2432 return wl_proxy_get_version((struct wl_proxy *) wl_pointer);
2433 }
2434
1824 static inline void 2435 static inline void
1825 wl_pointer_destroy(struct wl_pointer *wl_pointer) 2436 wl_pointer_destroy(struct wl_pointer *wl_pointer)
1826 { 2437 {
1827 wl_proxy_destroy((struct wl_proxy *) wl_pointer); 2438 wl_proxy_destroy((struct wl_proxy *) wl_pointer);
1828 } 2439 }
1829 2440
1830 static inline void 2441 static inline void
1831 wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_ surface *surface, int32_t hotspot_x, int32_t hotspot_y) 2442 wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_ surface *surface, int32_t hotspot_x, int32_t hotspot_y)
1832 { 2443 {
1833 wl_proxy_marshal((struct wl_proxy *) wl_pointer, 2444 wl_proxy_marshal((struct wl_proxy *) wl_pointer,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 static inline int 2607 static inline int
1997 wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard, 2608 wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard,
1998 const struct wl_keyboard_listener *listener, void *data ) 2609 const struct wl_keyboard_listener *listener, void *data )
1999 { 2610 {
2000 return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard, 2611 return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard,
2001 (void (**)(void)) listener, data); 2612 (void (**)(void)) listener, data);
2002 } 2613 }
2003 2614
2004 #define WL_KEYBOARD_RELEASE 0 2615 #define WL_KEYBOARD_RELEASE 0
2005 2616
2617 #define WL_KEYBOARD_RELEASE_SINCE_VERSION 3
2618
2006 static inline void 2619 static inline void
2007 wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data) 2620 wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data)
2008 { 2621 {
2009 wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data); 2622 wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data);
2010 } 2623 }
2011 2624
2012 static inline void * 2625 static inline void *
2013 wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard) 2626 wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard)
2014 { 2627 {
2015 return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard); 2628 return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard);
2016 } 2629 }
2017 2630
2631 static inline uint32_t
2632 wl_keyboard_get_version(struct wl_keyboard *wl_keyboard)
2633 {
2634 return wl_proxy_get_version((struct wl_proxy *) wl_keyboard);
2635 }
2636
2018 static inline void 2637 static inline void
2019 wl_keyboard_destroy(struct wl_keyboard *wl_keyboard) 2638 wl_keyboard_destroy(struct wl_keyboard *wl_keyboard)
2020 { 2639 {
2021 wl_proxy_destroy((struct wl_proxy *) wl_keyboard); 2640 wl_proxy_destroy((struct wl_proxy *) wl_keyboard);
2022 } 2641 }
2023 2642
2024 static inline void 2643 static inline void
2025 wl_keyboard_release(struct wl_keyboard *wl_keyboard) 2644 wl_keyboard_release(struct wl_keyboard *wl_keyboard)
2026 { 2645 {
2027 wl_proxy_marshal((struct wl_proxy *) wl_keyboard, 2646 wl_proxy_marshal((struct wl_proxy *) wl_keyboard,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 static inline int 2743 static inline int
2125 wl_touch_add_listener(struct wl_touch *wl_touch, 2744 wl_touch_add_listener(struct wl_touch *wl_touch,
2126 const struct wl_touch_listener *listener, void *data) 2745 const struct wl_touch_listener *listener, void *data)
2127 { 2746 {
2128 return wl_proxy_add_listener((struct wl_proxy *) wl_touch, 2747 return wl_proxy_add_listener((struct wl_proxy *) wl_touch,
2129 (void (**)(void)) listener, data); 2748 (void (**)(void)) listener, data);
2130 } 2749 }
2131 2750
2132 #define WL_TOUCH_RELEASE 0 2751 #define WL_TOUCH_RELEASE 0
2133 2752
2753 #define WL_TOUCH_RELEASE_SINCE_VERSION 3
2754
2134 static inline void 2755 static inline void
2135 wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data) 2756 wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data)
2136 { 2757 {
2137 wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data); 2758 wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data);
2138 } 2759 }
2139 2760
2140 static inline void * 2761 static inline void *
2141 wl_touch_get_user_data(struct wl_touch *wl_touch) 2762 wl_touch_get_user_data(struct wl_touch *wl_touch)
2142 { 2763 {
2143 return wl_proxy_get_user_data((struct wl_proxy *) wl_touch); 2764 return wl_proxy_get_user_data((struct wl_proxy *) wl_touch);
2144 } 2765 }
2145 2766
2767 static inline uint32_t
2768 wl_touch_get_version(struct wl_touch *wl_touch)
2769 {
2770 return wl_proxy_get_version((struct wl_proxy *) wl_touch);
2771 }
2772
2146 static inline void 2773 static inline void
2147 wl_touch_destroy(struct wl_touch *wl_touch) 2774 wl_touch_destroy(struct wl_touch *wl_touch)
2148 { 2775 {
2149 wl_proxy_destroy((struct wl_proxy *) wl_touch); 2776 wl_proxy_destroy((struct wl_proxy *) wl_touch);
2150 } 2777 }
2151 2778
2152 static inline void 2779 static inline void
2153 wl_touch_release(struct wl_touch *wl_touch) 2780 wl_touch_release(struct wl_touch *wl_touch)
2154 { 2781 {
2155 wl_proxy_marshal((struct wl_proxy *) wl_touch, 2782 wl_proxy_marshal((struct wl_proxy *) wl_touch,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
2340 }; 2967 };
2341 2968
2342 static inline int 2969 static inline int
2343 wl_output_add_listener(struct wl_output *wl_output, 2970 wl_output_add_listener(struct wl_output *wl_output,
2344 const struct wl_output_listener *listener, void *data) 2971 const struct wl_output_listener *listener, void *data)
2345 { 2972 {
2346 return wl_proxy_add_listener((struct wl_proxy *) wl_output, 2973 return wl_proxy_add_listener((struct wl_proxy *) wl_output,
2347 (void (**)(void)) listener, data); 2974 (void (**)(void)) listener, data);
2348 } 2975 }
2349 2976
2977
2350 static inline void 2978 static inline void
2351 wl_output_set_user_data(struct wl_output *wl_output, void *user_data) 2979 wl_output_set_user_data(struct wl_output *wl_output, void *user_data)
2352 { 2980 {
2353 wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data); 2981 wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data);
2354 } 2982 }
2355 2983
2356 static inline void * 2984 static inline void *
2357 wl_output_get_user_data(struct wl_output *wl_output) 2985 wl_output_get_user_data(struct wl_output *wl_output)
2358 { 2986 {
2359 return wl_proxy_get_user_data((struct wl_proxy *) wl_output); 2987 return wl_proxy_get_user_data((struct wl_proxy *) wl_output);
2360 } 2988 }
2361 2989
2990 static inline uint32_t
2991 wl_output_get_version(struct wl_output *wl_output)
2992 {
2993 return wl_proxy_get_version((struct wl_proxy *) wl_output);
2994 }
2995
2362 static inline void 2996 static inline void
2363 wl_output_destroy(struct wl_output *wl_output) 2997 wl_output_destroy(struct wl_output *wl_output)
2364 { 2998 {
2365 wl_proxy_destroy((struct wl_proxy *) wl_output); 2999 wl_proxy_destroy((struct wl_proxy *) wl_output);
2366 } 3000 }
2367 3001
2368 #define WL_REGION_DESTROY 0 3002 #define WL_REGION_DESTROY 0
2369 #define WL_REGION_ADD 1 3003 #define WL_REGION_ADD 1
2370 #define WL_REGION_SUBTRACT 2 3004 #define WL_REGION_SUBTRACT 2
2371 3005
3006 #define WL_REGION_DESTROY_SINCE_VERSION 1
3007 #define WL_REGION_ADD_SINCE_VERSION 1
3008 #define WL_REGION_SUBTRACT_SINCE_VERSION 1
3009
2372 static inline void 3010 static inline void
2373 wl_region_set_user_data(struct wl_region *wl_region, void *user_data) 3011 wl_region_set_user_data(struct wl_region *wl_region, void *user_data)
2374 { 3012 {
2375 wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data); 3013 wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data);
2376 } 3014 }
2377 3015
2378 static inline void * 3016 static inline void *
2379 wl_region_get_user_data(struct wl_region *wl_region) 3017 wl_region_get_user_data(struct wl_region *wl_region)
2380 { 3018 {
2381 return wl_proxy_get_user_data((struct wl_proxy *) wl_region); 3019 return wl_proxy_get_user_data((struct wl_proxy *) wl_region);
2382 } 3020 }
2383 3021
3022 static inline uint32_t
3023 wl_region_get_version(struct wl_region *wl_region)
3024 {
3025 return wl_proxy_get_version((struct wl_proxy *) wl_region);
3026 }
3027
2384 static inline void 3028 static inline void
2385 wl_region_destroy(struct wl_region *wl_region) 3029 wl_region_destroy(struct wl_region *wl_region)
2386 { 3030 {
2387 wl_proxy_marshal((struct wl_proxy *) wl_region, 3031 wl_proxy_marshal((struct wl_proxy *) wl_region,
2388 WL_REGION_DESTROY); 3032 WL_REGION_DESTROY);
2389 3033
2390 wl_proxy_destroy((struct wl_proxy *) wl_region); 3034 wl_proxy_destroy((struct wl_proxy *) wl_region);
2391 } 3035 }
2392 3036
2393 static inline void 3037 static inline void
(...skipping 13 matching lines...) Expand all
2407 #ifndef WL_SUBCOMPOSITOR_ERROR_ENUM 3051 #ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
2408 #define WL_SUBCOMPOSITOR_ERROR_ENUM 3052 #define WL_SUBCOMPOSITOR_ERROR_ENUM
2409 enum wl_subcompositor_error { 3053 enum wl_subcompositor_error {
2410 WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0, 3054 WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
2411 }; 3055 };
2412 #endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */ 3056 #endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
2413 3057
2414 #define WL_SUBCOMPOSITOR_DESTROY 0 3058 #define WL_SUBCOMPOSITOR_DESTROY 0
2415 #define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1 3059 #define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1
2416 3060
3061 #define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1
3062 #define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1
3063
2417 static inline void 3064 static inline void
2418 wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void * user_data) 3065 wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void * user_data)
2419 { 3066 {
2420 wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data); 3067 wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);
2421 } 3068 }
2422 3069
2423 static inline void * 3070 static inline void *
2424 wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor) 3071 wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)
2425 { 3072 {
2426 return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor); 3073 return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);
2427 } 3074 }
2428 3075
3076 static inline uint32_t
3077 wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor)
3078 {
3079 return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor);
3080 }
3081
2429 static inline void 3082 static inline void
2430 wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor) 3083 wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)
2431 { 3084 {
2432 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor, 3085 wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
2433 WL_SUBCOMPOSITOR_DESTROY); 3086 WL_SUBCOMPOSITOR_DESTROY);
2434 3087
2435 wl_proxy_destroy((struct wl_proxy *) wl_subcompositor); 3088 wl_proxy_destroy((struct wl_proxy *) wl_subcompositor);
2436 } 3089 }
2437 3090
2438 static inline struct wl_subsurface * 3091 static inline struct wl_subsurface *
(...skipping 14 matching lines...) Expand all
2453 }; 3106 };
2454 #endif /* WL_SUBSURFACE_ERROR_ENUM */ 3107 #endif /* WL_SUBSURFACE_ERROR_ENUM */
2455 3108
2456 #define WL_SUBSURFACE_DESTROY 0 3109 #define WL_SUBSURFACE_DESTROY 0
2457 #define WL_SUBSURFACE_SET_POSITION 1 3110 #define WL_SUBSURFACE_SET_POSITION 1
2458 #define WL_SUBSURFACE_PLACE_ABOVE 2 3111 #define WL_SUBSURFACE_PLACE_ABOVE 2
2459 #define WL_SUBSURFACE_PLACE_BELOW 3 3112 #define WL_SUBSURFACE_PLACE_BELOW 3
2460 #define WL_SUBSURFACE_SET_SYNC 4 3113 #define WL_SUBSURFACE_SET_SYNC 4
2461 #define WL_SUBSURFACE_SET_DESYNC 5 3114 #define WL_SUBSURFACE_SET_DESYNC 5
2462 3115
3116 #define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1
3117 #define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1
3118 #define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1
3119 #define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1
3120 #define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1
3121 #define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1
3122
2463 static inline void 3123 static inline void
2464 wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data ) 3124 wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data )
2465 { 3125 {
2466 wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data); 3126 wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);
2467 } 3127 }
2468 3128
2469 static inline void * 3129 static inline void *
2470 wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface) 3130 wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)
2471 { 3131 {
2472 return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface); 3132 return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);
2473 } 3133 }
2474 3134
3135 static inline uint32_t
3136 wl_subsurface_get_version(struct wl_subsurface *wl_subsurface)
3137 {
3138 return wl_proxy_get_version((struct wl_proxy *) wl_subsurface);
3139 }
3140
2475 static inline void 3141 static inline void
2476 wl_subsurface_destroy(struct wl_subsurface *wl_subsurface) 3142 wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)
2477 { 3143 {
2478 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 3144 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
2479 WL_SUBSURFACE_DESTROY); 3145 WL_SUBSURFACE_DESTROY);
2480 3146
2481 wl_proxy_destroy((struct wl_proxy *) wl_subsurface); 3147 wl_proxy_destroy((struct wl_proxy *) wl_subsurface);
2482 } 3148 }
2483 3149
2484 static inline void 3150 static inline void
(...skipping 29 matching lines...) Expand all
2514 { 3180 {
2515 wl_proxy_marshal((struct wl_proxy *) wl_subsurface, 3181 wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
2516 WL_SUBSURFACE_SET_DESYNC); 3182 WL_SUBSURFACE_SET_DESYNC);
2517 } 3183 }
2518 3184
2519 #ifdef __cplusplus 3185 #ifdef __cplusplus
2520 } 3186 }
2521 #endif 3187 #endif
2522 3188
2523 #endif 3189 #endif
OLDNEW
« no previous file with comments | « third_party/wayland/include/config.h ('k') | third_party/wayland/include/protocol/wayland-client-protocol-core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698