| OLD | NEW |
| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 #define WL_BUFFER_RELEASE 0 | 532 #define WL_BUFFER_RELEASE 0 |
| 533 | 533 |
| 534 #define WL_BUFFER_RELEASE_SINCE_VERSION 1 | 534 #define WL_BUFFER_RELEASE_SINCE_VERSION 1 |
| 535 | 535 |
| 536 static inline void | 536 static inline void |
| 537 wl_buffer_send_release(struct wl_resource *resource_) | 537 wl_buffer_send_release(struct wl_resource *resource_) |
| 538 { | 538 { |
| 539 wl_resource_post_event(resource_, WL_BUFFER_RELEASE); | 539 wl_resource_post_event(resource_, WL_BUFFER_RELEASE); |
| 540 } | 540 } |
| 541 | 541 |
| 542 #ifndef WL_DATA_OFFER_ERROR_ENUM |
| 543 #define WL_DATA_OFFER_ERROR_ENUM |
| 544 enum wl_data_offer_error { |
| 545 WL_DATA_OFFER_ERROR_INVALID_FINISH = 0, |
| 546 WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1, |
| 547 WL_DATA_OFFER_ERROR_INVALID_ACTION = 2, |
| 548 WL_DATA_OFFER_ERROR_INVALID_OFFER = 3, |
| 549 }; |
| 550 #endif /* WL_DATA_OFFER_ERROR_ENUM */ |
| 551 |
| 542 /** | 552 /** |
| 543 * wl_data_offer - offer to transfer data | 553 * wl_data_offer - offer to transfer data |
| 544 * @accept: accept one of the offered mime types | 554 * @accept: accept one of the offered mime types |
| 545 * @receive: request that the data is transferred | 555 * @receive: request that the data is transferred |
| 546 * @destroy: destroy data offer | 556 * @destroy: destroy data offer |
| 557 * @finish: the offer will no longer be used |
| 558 * @set_actions: set the available/preferred drag-and-drop actions |
| 547 * | 559 * |
| 548 * A wl_data_offer represents a piece of data offered for transfer by | 560 * A wl_data_offer represents a piece of data offered for transfer by |
| 549 * another client (the source client). It is used by the copy-and-paste and | 561 * another client (the source client). It is used by the copy-and-paste and |
| 550 * drag-and-drop mechanisms. The offer describes the different mime types | 562 * drag-and-drop mechanisms. The offer describes the different mime types |
| 551 * that the data can be converted to and provides the mechanism for | 563 * that the data can be converted to and provides the mechanism for |
| 552 * transferring the data directly from the source client. | 564 * transferring the data directly from the source client. |
| 553 */ | 565 */ |
| 554 struct wl_data_offer_interface { | 566 struct wl_data_offer_interface { |
| 555 /** | 567 /** |
| 556 * accept - accept one of the offered mime types | 568 * accept - accept one of the offered mime types |
| 557 * @serial: (none) | 569 * @serial: (none) |
| 558 * @mime_type: (none) | 570 * @mime_type: (none) |
| 559 * | 571 * |
| 560 * Indicate that the client can accept the given mime type, or | 572 * Indicate that the client can accept the given mime type, or |
| 561 * NULL for not accepted. | 573 * NULL for not accepted. |
| 562 * | 574 * |
| 563 » * Used for feedback during drag-and-drop. | 575 » * For objects of version 2 or older, this request is used by the |
| 576 » * client to give feedback whether the client can receive the given |
| 577 » * mime type, or NULL if none is accepted; the feedback does not |
| 578 » * determine whether the drag-and-drop operation succeeds or not. |
| 579 » * |
| 580 » * For objects of version 3 or newer, this request determines the |
| 581 » * final result of the drag-and-drop operation. If the end result |
| 582 » * is that no mime types were accepted, the drag-and-drop operation |
| 583 » * will be cancelled and the corresponding drag source will receive |
| 584 » * wl_data_source.cancelled. Clients may still use this event in |
| 585 » * conjunction with wl_data_source.action for feedback. |
| 564 */ | 586 */ |
| 565 void (*accept)(struct wl_client *client, | 587 void (*accept)(struct wl_client *client, |
| 566 struct wl_resource *resource, | 588 struct wl_resource *resource, |
| 567 uint32_t serial, | 589 uint32_t serial, |
| 568 const char *mime_type); | 590 const char *mime_type); |
| 569 /** | 591 /** |
| 570 * receive - request that the data is transferred | 592 * receive - request that the data is transferred |
| 571 * @mime_type: (none) | 593 * @mime_type: (none) |
| 572 * @fd: (none) | 594 * @fd: (none) |
| 573 * | 595 * |
| 574 * To transfer the offered data, the client issues this request | 596 * To transfer the offered data, the client issues this request |
| 575 * and indicates the mime type it wants to receive. The transfer | 597 * and indicates the mime type it wants to receive. The transfer |
| 576 * happens through the passed file descriptor (typically created | 598 * happens through the passed file descriptor (typically created |
| 577 * with the pipe system call). The source client writes the data in | 599 * with the pipe system call). The source client writes the data in |
| 578 * the mime type representation requested and then closes the file | 600 * the mime type representation requested and then closes the file |
| 579 * descriptor. | 601 * descriptor. |
| 580 * | 602 * |
| 581 * The receiving client reads from the read end of the pipe until | 603 * The receiving client reads from the read end of the pipe until |
| 582 * EOF and then closes its end, at which point the transfer is | 604 * EOF and then closes its end, at which point the transfer is |
| 583 * complete. | 605 * complete. |
| 606 * |
| 607 * This request may happen multiple times for different mimetypes, |
| 608 * both before and after wl_data_device.drop. Drag-and-drop |
| 609 * destination clients may preemptively fetch data or examine it |
| 610 * more closely to determine acceptance. |
| 584 */ | 611 */ |
| 585 void (*receive)(struct wl_client *client, | 612 void (*receive)(struct wl_client *client, |
| 586 struct wl_resource *resource, | 613 struct wl_resource *resource, |
| 587 const char *mime_type, | 614 const char *mime_type, |
| 588 int32_t fd); | 615 int32_t fd); |
| 589 /** | 616 /** |
| 590 * destroy - destroy data offer | 617 * destroy - destroy data offer |
| 591 * | 618 * |
| 592 * Destroy the data offer. | 619 * Destroy the data offer. |
| 593 */ | 620 */ |
| 594 void (*destroy)(struct wl_client *client, | 621 void (*destroy)(struct wl_client *client, |
| 595 struct wl_resource *resource); | 622 struct wl_resource *resource); |
| 623 /** |
| 624 * finish - the offer will no longer be used |
| 625 * |
| 626 * Notifies the compositor that the drag destination successfully |
| 627 * finished the drag-and-drop operation. |
| 628 * |
| 629 * Upon receiving this request, the compositor will emit |
| 630 * wl_data_source.dnd_finished on the drag source client. |
| 631 * |
| 632 * It is a client error to perform other requests than |
| 633 * wl_data_offer.destroy after this one. It is also an error to |
| 634 * perform this request after a NULL mime type has been set in |
| 635 * wl_data_offer.accept or no action was received through |
| 636 * wl_data_offer.action. |
| 637 * @since: 3 |
| 638 */ |
| 639 void (*finish)(struct wl_client *client, |
| 640 struct wl_resource *resource); |
| 641 /** |
| 642 * set_actions - set the available/preferred drag-and-drop |
| 643 * actions |
| 644 * @dnd_actions: (none) |
| 645 * @preferred_action: (none) |
| 646 * |
| 647 * Sets the actions that the destination side client supports for |
| 648 * this operation. This request may trigger the emission of |
| 649 * wl_data_source.action and wl_data_offer.action events if the |
| 650 * compositor need to change the selected action. |
| 651 * |
| 652 * This request can be called multiple times throughout the |
| 653 * drag-and-drop operation, typically in response to |
| 654 * wl_data_device.enter or wl_data_device.motion events. |
| 655 * |
| 656 * This request determines the final result of the drag-and-drop |
| 657 * operation. If the end result is that no action is accepted, the |
| 658 * drag source will receive wl_drag_source.cancelled. |
| 659 * |
| 660 * The dnd_actions argument must contain only values expressed in |
| 661 * the wl_data_device_manager.dnd_actions enum, and the |
| 662 * preferred_action argument must only contain one of those values |
| 663 * set, otherwise it will result in a protocol error. |
| 664 * |
| 665 * While managing an "ask" action, the destination drag-and-drop |
| 666 * client may perform further wl_data_offer.receive requests, and |
| 667 * is expected to perform one last wl_data_offer.set_actions |
| 668 * request with a preferred action other than "ask" (and optionally |
| 669 * wl_data_offer.accept) before requesting wl_data_offer.finish, in |
| 670 * order to convey the action selected by the user. If the |
| 671 * preferred action is not in the wl_data_offer.source_actions |
| 672 * mask, an error will be raised. |
| 673 * |
| 674 * If the "ask" action is dismissed (e.g. user cancellation), the |
| 675 * client is expected to perform wl_data_offer.destroy right away. |
| 676 * |
| 677 * This request can only be made on drag-and-drop offers, a |
| 678 * protocol error will be raised otherwise. |
| 679 * @since: 3 |
| 680 */ |
| 681 void (*set_actions)(struct wl_client *client, |
| 682 struct wl_resource *resource, |
| 683 uint32_t dnd_actions, |
| 684 uint32_t preferred_action); |
| 596 }; | 685 }; |
| 597 | 686 |
| 598 #define WL_DATA_OFFER_OFFER 0 | 687 #define WL_DATA_OFFER_OFFER 0 |
| 688 #define WL_DATA_OFFER_SOURCE_ACTIONS 1 |
| 689 #define WL_DATA_OFFER_ACTION 2 |
| 599 | 690 |
| 600 #define WL_DATA_OFFER_OFFER_SINCE_VERSION 1 | 691 #define WL_DATA_OFFER_OFFER_SINCE_VERSION 1 |
| 692 #define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3 |
| 693 #define WL_DATA_OFFER_ACTION_SINCE_VERSION 3 |
| 601 | 694 |
| 602 static inline void | 695 static inline void |
| 603 wl_data_offer_send_offer(struct wl_resource *resource_, const char *mime_type) | 696 wl_data_offer_send_offer(struct wl_resource *resource_, const char *mime_type) |
| 604 { | 697 { |
| 605 wl_resource_post_event(resource_, WL_DATA_OFFER_OFFER, mime_type); | 698 wl_resource_post_event(resource_, WL_DATA_OFFER_OFFER, mime_type); |
| 606 } | 699 } |
| 607 | 700 |
| 701 static inline void |
| 702 wl_data_offer_send_source_actions(struct wl_resource *resource_, uint32_t source
_actions) |
| 703 { |
| 704 wl_resource_post_event(resource_, WL_DATA_OFFER_SOURCE_ACTIONS, source_a
ctions); |
| 705 } |
| 706 |
| 707 static inline void |
| 708 wl_data_offer_send_action(struct wl_resource *resource_, uint32_t dnd_action) |
| 709 { |
| 710 wl_resource_post_event(resource_, WL_DATA_OFFER_ACTION, dnd_action); |
| 711 } |
| 712 |
| 713 #ifndef WL_DATA_SOURCE_ERROR_ENUM |
| 714 #define WL_DATA_SOURCE_ERROR_ENUM |
| 715 enum wl_data_source_error { |
| 716 WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0, |
| 717 WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1, |
| 718 }; |
| 719 #endif /* WL_DATA_SOURCE_ERROR_ENUM */ |
| 720 |
| 608 /** | 721 /** |
| 609 * wl_data_source - offer to transfer data | 722 * wl_data_source - offer to transfer data |
| 610 * @offer: add an offered mime type | 723 * @offer: add an offered mime type |
| 611 * @destroy: destroy the data source | 724 * @destroy: destroy the data source |
| 725 * @set_actions: set the available drag-and-drop actions |
| 612 * | 726 * |
| 613 * The wl_data_source object is the source side of a wl_data_offer. It is | 727 * The wl_data_source object is the source side of a wl_data_offer. It is |
| 614 * created by the source client in a data transfer and provides a way to | 728 * created by the source client in a data transfer and provides a way to |
| 615 * describe the offered data and a way to respond to requests to transfer | 729 * describe the offered data and a way to respond to requests to transfer |
| 616 * the data. | 730 * the data. |
| 617 */ | 731 */ |
| 618 struct wl_data_source_interface { | 732 struct wl_data_source_interface { |
| 619 /** | 733 /** |
| 620 * offer - add an offered mime type | 734 * offer - add an offered mime type |
| 621 * @mime_type: (none) | 735 * @mime_type: (none) |
| 622 * | 736 * |
| 623 * This request adds a mime type to the set of mime types | 737 * This request adds a mime type to the set of mime types |
| 624 * advertised to targets. Can be called several times to offer | 738 * advertised to targets. Can be called several times to offer |
| 625 * multiple types. | 739 * multiple types. |
| 626 */ | 740 */ |
| 627 void (*offer)(struct wl_client *client, | 741 void (*offer)(struct wl_client *client, |
| 628 struct wl_resource *resource, | 742 struct wl_resource *resource, |
| 629 const char *mime_type); | 743 const char *mime_type); |
| 630 /** | 744 /** |
| 631 * destroy - destroy the data source | 745 * destroy - destroy the data source |
| 632 * | 746 * |
| 633 * Destroy the data source. | 747 * Destroy the data source. |
| 634 */ | 748 */ |
| 635 void (*destroy)(struct wl_client *client, | 749 void (*destroy)(struct wl_client *client, |
| 636 struct wl_resource *resource); | 750 struct wl_resource *resource); |
| 751 /** |
| 752 * set_actions - set the available drag-and-drop actions |
| 753 * @dnd_actions: (none) |
| 754 * |
| 755 * Sets the actions that the source side client supports for this |
| 756 * operation. This request may trigger wl_data_source.action and |
| 757 * wl_data_offer.action events if the compositor needs to change |
| 758 * the selected action. |
| 759 * |
| 760 * The dnd_actions argument must contain only values expressed in |
| 761 * the wl_data_device_manager.dnd_actions enum, otherwise it will |
| 762 * result in a protocol error. |
| 763 * |
| 764 * This request must be made once only, and can only be made on |
| 765 * sources used in drag-and-drop, so it must be performed before |
| 766 * wl_data_device.start_drag. Attempting to use the source other |
| 767 * than for drag-and-drop will raise a protocol error. |
| 768 * @since: 3 |
| 769 */ |
| 770 void (*set_actions)(struct wl_client *client, |
| 771 struct wl_resource *resource, |
| 772 uint32_t dnd_actions); |
| 637 }; | 773 }; |
| 638 | 774 |
| 639 #define WL_DATA_SOURCE_TARGET 0 | 775 #define WL_DATA_SOURCE_TARGET 0 |
| 640 #define WL_DATA_SOURCE_SEND 1 | 776 #define WL_DATA_SOURCE_SEND 1 |
| 641 #define WL_DATA_SOURCE_CANCELLED 2 | 777 #define WL_DATA_SOURCE_CANCELLED 2 |
| 778 #define WL_DATA_SOURCE_DND_DROP_PERFORMED 3 |
| 779 #define WL_DATA_SOURCE_DND_FINISHED 4 |
| 780 #define WL_DATA_SOURCE_ACTION 5 |
| 642 | 781 |
| 643 #define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1 | 782 #define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1 |
| 644 #define WL_DATA_SOURCE_SEND_SINCE_VERSION 1 | 783 #define WL_DATA_SOURCE_SEND_SINCE_VERSION 1 |
| 645 #define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1 | 784 #define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1 |
| 785 #define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3 |
| 786 #define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3 |
| 787 #define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3 |
| 646 | 788 |
| 647 static inline void | 789 static inline void |
| 648 wl_data_source_send_target(struct wl_resource *resource_, const char *mime_type) | 790 wl_data_source_send_target(struct wl_resource *resource_, const char *mime_type) |
| 649 { | 791 { |
| 650 wl_resource_post_event(resource_, WL_DATA_SOURCE_TARGET, mime_type); | 792 wl_resource_post_event(resource_, WL_DATA_SOURCE_TARGET, mime_type); |
| 651 } | 793 } |
| 652 | 794 |
| 653 static inline void | 795 static inline void |
| 654 wl_data_source_send_send(struct wl_resource *resource_, const char *mime_type, i
nt32_t fd) | 796 wl_data_source_send_send(struct wl_resource *resource_, const char *mime_type, i
nt32_t fd) |
| 655 { | 797 { |
| 656 wl_resource_post_event(resource_, WL_DATA_SOURCE_SEND, mime_type, fd); | 798 wl_resource_post_event(resource_, WL_DATA_SOURCE_SEND, mime_type, fd); |
| 657 } | 799 } |
| 658 | 800 |
| 659 static inline void | 801 static inline void |
| 660 wl_data_source_send_cancelled(struct wl_resource *resource_) | 802 wl_data_source_send_cancelled(struct wl_resource *resource_) |
| 661 { | 803 { |
| 662 wl_resource_post_event(resource_, WL_DATA_SOURCE_CANCELLED); | 804 wl_resource_post_event(resource_, WL_DATA_SOURCE_CANCELLED); |
| 663 } | 805 } |
| 664 | 806 |
| 807 static inline void |
| 808 wl_data_source_send_dnd_drop_performed(struct wl_resource *resource_) |
| 809 { |
| 810 wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_DROP_PERFORMED); |
| 811 } |
| 812 |
| 813 static inline void |
| 814 wl_data_source_send_dnd_finished(struct wl_resource *resource_) |
| 815 { |
| 816 wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_FINISHED); |
| 817 } |
| 818 |
| 819 static inline void |
| 820 wl_data_source_send_action(struct wl_resource *resource_, uint32_t dnd_action) |
| 821 { |
| 822 wl_resource_post_event(resource_, WL_DATA_SOURCE_ACTION, dnd_action); |
| 823 } |
| 824 |
| 665 #ifndef WL_DATA_DEVICE_ERROR_ENUM | 825 #ifndef WL_DATA_DEVICE_ERROR_ENUM |
| 666 #define WL_DATA_DEVICE_ERROR_ENUM | 826 #define WL_DATA_DEVICE_ERROR_ENUM |
| 667 enum wl_data_device_error { | 827 enum wl_data_device_error { |
| 668 WL_DATA_DEVICE_ERROR_ROLE = 0, | 828 WL_DATA_DEVICE_ERROR_ROLE = 0, |
| 669 }; | 829 }; |
| 670 #endif /* WL_DATA_DEVICE_ERROR_ENUM */ | 830 #endif /* WL_DATA_DEVICE_ERROR_ENUM */ |
| 671 | 831 |
| 672 /** | 832 /** |
| 673 * wl_data_device - data transfer device | 833 * wl_data_device - data transfer device |
| 674 * @start_drag: start drag-and-drop operation | 834 * @start_drag: start drag-and-drop operation |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 { | 950 { |
| 791 wl_resource_post_event(resource_, WL_DATA_DEVICE_DROP); | 951 wl_resource_post_event(resource_, WL_DATA_DEVICE_DROP); |
| 792 } | 952 } |
| 793 | 953 |
| 794 static inline void | 954 static inline void |
| 795 wl_data_device_send_selection(struct wl_resource *resource_, struct wl_resource
*id) | 955 wl_data_device_send_selection(struct wl_resource *resource_, struct wl_resource
*id) |
| 796 { | 956 { |
| 797 wl_resource_post_event(resource_, WL_DATA_DEVICE_SELECTION, id); | 957 wl_resource_post_event(resource_, WL_DATA_DEVICE_SELECTION, id); |
| 798 } | 958 } |
| 799 | 959 |
| 960 #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM |
| 961 #define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM |
| 962 /** |
| 963 * wl_data_device_manager_dnd_action - drag and drop actions |
| 964 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE: (none) |
| 965 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY: (none) |
| 966 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE: (none) |
| 967 * @WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK: (none) |
| 968 * |
| 969 * This is a bitmask of the available/preferred actions in a |
| 970 * drag-and-drop operation. |
| 971 * |
| 972 * In the compositor, the selected action is a result of matching the |
| 973 * actions offered by the source and destination sides. "action" events |
| 974 * with a "none" action will be sent to both source and destination if |
| 975 * there is no match. All further checks will effectively happen on (source |
| 976 * actions ∩ destination actions). |
| 977 * |
| 978 * In addition, compositors may also pick different actions in reaction to |
| 979 * key modifiers being pressed, one common design that is used in major |
| 980 * toolkits (and the behavior recommended for compositors) is: |
| 981 * |
| 982 * - If no modifiers are pressed, the first match (in bit order) will be |
| 983 * used. - Pressing Shift selects "move", if enabled in the mask. - |
| 984 * Pressing Control selects "copy", if enabled in the mask. |
| 985 * |
| 986 * Behavior beyond that is considered implementation-dependent. Compositors |
| 987 * may for example bind other modifiers (like Alt/Meta) or drags initiated |
| 988 * with other buttons than BTN_LEFT to specific actions (e.g. "ask"). |
| 989 */ |
| 990 enum wl_data_device_manager_dnd_action { |
| 991 WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, |
| 992 WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1, |
| 993 WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2, |
| 994 WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4, |
| 995 }; |
| 996 #endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */ |
| 997 |
| 800 /** | 998 /** |
| 801 * wl_data_device_manager - data transfer interface | 999 * wl_data_device_manager - data transfer interface |
| 802 * @create_data_source: create a new data source | 1000 * @create_data_source: create a new data source |
| 803 * @get_data_device: create a new data device | 1001 * @get_data_device: create a new data device |
| 804 * | 1002 * |
| 805 * The wl_data_device_manager is a singleton global object that provides | 1003 * The wl_data_device_manager is a singleton global object that provides |
| 806 * access to inter-client data transfer mechanisms such as copy-and-paste | 1004 * access to inter-client data transfer mechanisms such as copy-and-paste |
| 807 * and drag-and-drop. These mechanisms are tied to a wl_seat and this | 1005 * and drag-and-drop. These mechanisms are tied to a wl_seat and this |
| 808 * interface lets a client get a wl_data_device corresponding to a wl_seat. | 1006 * interface lets a client get a wl_data_device corresponding to a wl_seat. |
| 809 */ | 1007 */ |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 * wl_surface - an onscreen surface | 1419 * wl_surface - an onscreen surface |
| 1222 * @destroy: delete surface | 1420 * @destroy: delete surface |
| 1223 * @attach: set the surface contents | 1421 * @attach: set the surface contents |
| 1224 * @damage: mark part of the surface damaged | 1422 * @damage: mark part of the surface damaged |
| 1225 * @frame: request a frame throttling hint | 1423 * @frame: request a frame throttling hint |
| 1226 * @set_opaque_region: set opaque region | 1424 * @set_opaque_region: set opaque region |
| 1227 * @set_input_region: set input region | 1425 * @set_input_region: set input region |
| 1228 * @commit: commit pending surface state | 1426 * @commit: commit pending surface state |
| 1229 * @set_buffer_transform: sets the buffer transformation | 1427 * @set_buffer_transform: sets the buffer transformation |
| 1230 * @set_buffer_scale: sets the buffer scaling factor | 1428 * @set_buffer_scale: sets the buffer scaling factor |
| 1429 * @damage_buffer: mark part of the surface damaged using buffer |
| 1430 * co-ordinates |
| 1231 * | 1431 * |
| 1232 * A surface is a rectangular area that is displayed on the screen. It | 1432 * A surface is a rectangular area that is displayed on the screen. It |
| 1233 * has a location, size and pixel contents. | 1433 * has a location, size and pixel contents. |
| 1234 * | 1434 * |
| 1235 * The size of a surface (and relative positions on it) is described in | 1435 * The size of a surface (and relative positions on it) is described in |
| 1236 * surface local coordinates, which may differ from the buffer local | 1436 * surface local coordinates, which may differ from the buffer local |
| 1237 * coordinates of the pixel content, in case a buffer_transform or a | 1437 * coordinates of the pixel content, in case a buffer_transform or a |
| 1238 * buffer_scale is used. | 1438 * buffer_scale is used. |
| 1239 * | 1439 * |
| 1240 * A surface without a "role" is fairly useless, a compositor does not know | 1440 * A surface without a "role" is fairly useless, a compositor does not know |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1327 int32_t y); | 1527 int32_t y); |
| 1328 /** | 1528 /** |
| 1329 * damage - mark part of the surface damaged | 1529 * damage - mark part of the surface damaged |
| 1330 * @x: (none) | 1530 * @x: (none) |
| 1331 * @y: (none) | 1531 * @y: (none) |
| 1332 * @width: (none) | 1532 * @width: (none) |
| 1333 * @height: (none) | 1533 * @height: (none) |
| 1334 * | 1534 * |
| 1335 * This request is used to describe the regions where the pending | 1535 * This request is used to describe the regions where the pending |
| 1336 * buffer is different from the current surface contents, and where | 1536 * buffer is different from the current surface contents, and where |
| 1337 » * the surface therefore needs to be repainted. The pending buffer | 1537 » * the surface therefore needs to be repainted. The compositor |
| 1338 » * must be set by wl_surface.attach before sending damage. The | 1538 » * ignores the parts of the damage that fall outside of the |
| 1339 » * compositor ignores the parts of the damage that fall outside of | 1539 » * surface. |
| 1340 » * the surface. | |
| 1341 * | 1540 * |
| 1342 * Damage is double-buffered state, see wl_surface.commit. | 1541 * Damage is double-buffered state, see wl_surface.commit. |
| 1343 * | 1542 * |
| 1344 * The damage rectangle is specified in surface local coordinates. | 1543 * The damage rectangle is specified in surface local coordinates. |
| 1345 * | 1544 * |
| 1346 * The initial value for pending damage is empty: no damage. | 1545 * The initial value for pending damage is empty: no damage. |
| 1347 * wl_surface.damage adds pending damage: the new pending damage is | 1546 * wl_surface.damage adds pending damage: the new pending damage is |
| 1348 * the union of old pending damage and the given rectangle. | 1547 * the union of old pending damage and the given rectangle. |
| 1349 * | 1548 * |
| 1350 * wl_surface.commit assigns pending damage as the current damage, | 1549 * wl_surface.commit assigns pending damage as the current damage, |
| 1351 * and clears pending damage. The server will clear the current | 1550 * and clears pending damage. The server will clear the current |
| 1352 * damage as it repaints the surface. | 1551 * damage as it repaints the surface. |
| 1552 * |
| 1553 * Alternatively, damage can be posted with |
| 1554 * wl_surface.damage_buffer which uses buffer co-ordinates instead |
| 1555 * of surface co-ordinates, and is probably the preferred and |
| 1556 * intuitive way of doing this. |
| 1353 */ | 1557 */ |
| 1354 void (*damage)(struct wl_client *client, | 1558 void (*damage)(struct wl_client *client, |
| 1355 struct wl_resource *resource, | 1559 struct wl_resource *resource, |
| 1356 int32_t x, | 1560 int32_t x, |
| 1357 int32_t y, | 1561 int32_t y, |
| 1358 int32_t width, | 1562 int32_t width, |
| 1359 int32_t height); | 1563 int32_t height); |
| 1360 /** | 1564 /** |
| 1361 * frame - request a frame throttling hint | 1565 * frame - request a frame throttling hint |
| 1362 * @callback: (none) | 1566 * @callback: (none) |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 * a buffer that is larger (by a factor of scale in each dimension) | 1758 * a buffer that is larger (by a factor of scale in each dimension) |
| 1555 * than the desired surface size. | 1759 * than the desired surface size. |
| 1556 * | 1760 * |
| 1557 * If scale is not positive the invalid_scale protocol error is | 1761 * If scale is not positive the invalid_scale protocol error is |
| 1558 * raised. | 1762 * raised. |
| 1559 * @since: 3 | 1763 * @since: 3 |
| 1560 */ | 1764 */ |
| 1561 void (*set_buffer_scale)(struct wl_client *client, | 1765 void (*set_buffer_scale)(struct wl_client *client, |
| 1562 struct wl_resource *resource, | 1766 struct wl_resource *resource, |
| 1563 int32_t scale); | 1767 int32_t scale); |
| 1768 /** |
| 1769 * damage_buffer - mark part of the surface damaged using buffer |
| 1770 * co-ordinates |
| 1771 * @x: (none) |
| 1772 * @y: (none) |
| 1773 * @width: (none) |
| 1774 * @height: (none) |
| 1775 * |
| 1776 * This request is used to describe the regions where the pending |
| 1777 * buffer is different from the current surface contents, and where |
| 1778 * the surface therefore needs to be repainted. The compositor |
| 1779 * ignores the parts of the damage that fall outside of the |
| 1780 * surface. |
| 1781 * |
| 1782 * Damage is double-buffered state, see wl_surface.commit. |
| 1783 * |
| 1784 * The damage rectangle is specified in buffer coordinates. |
| 1785 * |
| 1786 * The initial value for pending damage is empty: no damage. |
| 1787 * wl_surface.damage_buffer adds pending damage: the new pending |
| 1788 * damage is the union of old pending damage and the given |
| 1789 * rectangle. |
| 1790 * |
| 1791 * wl_surface.commit assigns pending damage as the current damage, |
| 1792 * and clears pending damage. The server will clear the current |
| 1793 * damage as it repaints the surface. |
| 1794 * |
| 1795 * This request differs from wl_surface.damage in only one way - it |
| 1796 * takes damage in buffer co-ordinates instead of surface local |
| 1797 * co-ordinates. While this generally is more intuitive than |
| 1798 * surface co-ordinates, it is especially desirable when using |
| 1799 * wp_viewport or when a drawing library (like EGL) is unaware of |
| 1800 * buffer scale and buffer transform. |
| 1801 * |
| 1802 * Note: Because buffer transformation changes and damage requests |
| 1803 * may be interleaved in the protocol stream, It is impossible to |
| 1804 * determine the actual mapping between surface and buffer damage |
| 1805 * until wl_surface.commit time. Therefore, compositors wishing to |
| 1806 * take both kinds of damage into account will have to accumulate |
| 1807 * damage from the two requests separately and only transform from |
| 1808 * one to the other after receiving the wl_surface.commit. |
| 1809 * @since: 4 |
| 1810 */ |
| 1811 void (*damage_buffer)(struct wl_client *client, |
| 1812 struct wl_resource *resource, |
| 1813 int32_t x, |
| 1814 int32_t y, |
| 1815 int32_t width, |
| 1816 int32_t height); |
| 1564 }; | 1817 }; |
| 1565 | 1818 |
| 1566 #define WL_SURFACE_ENTER 0 | 1819 #define WL_SURFACE_ENTER 0 |
| 1567 #define WL_SURFACE_LEAVE 1 | 1820 #define WL_SURFACE_LEAVE 1 |
| 1568 | 1821 |
| 1569 #define WL_SURFACE_ENTER_SINCE_VERSION 1 | 1822 #define WL_SURFACE_ENTER_SINCE_VERSION 1 |
| 1570 #define WL_SURFACE_LEAVE_SINCE_VERSION 1 | 1823 #define WL_SURFACE_LEAVE_SINCE_VERSION 1 |
| 1571 | 1824 |
| 1572 static inline void | 1825 static inline void |
| 1573 wl_surface_send_enter(struct wl_resource *resource_, struct wl_resource *output) | 1826 wl_surface_send_enter(struct wl_resource *resource_, struct wl_resource *output) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1597 WL_SEAT_CAPABILITY_KEYBOARD = 2, | 1850 WL_SEAT_CAPABILITY_KEYBOARD = 2, |
| 1598 WL_SEAT_CAPABILITY_TOUCH = 4, | 1851 WL_SEAT_CAPABILITY_TOUCH = 4, |
| 1599 }; | 1852 }; |
| 1600 #endif /* WL_SEAT_CAPABILITY_ENUM */ | 1853 #endif /* WL_SEAT_CAPABILITY_ENUM */ |
| 1601 | 1854 |
| 1602 /** | 1855 /** |
| 1603 * wl_seat - group of input devices | 1856 * wl_seat - group of input devices |
| 1604 * @get_pointer: return pointer object | 1857 * @get_pointer: return pointer object |
| 1605 * @get_keyboard: return keyboard object | 1858 * @get_keyboard: return keyboard object |
| 1606 * @get_touch: return touch object | 1859 * @get_touch: return touch object |
| 1860 * @release: release the seat object |
| 1607 * | 1861 * |
| 1608 * A seat is a group of keyboards, pointer and touch devices. This object | 1862 * A seat is a group of keyboards, pointer and touch devices. This object |
| 1609 * is published as a global during start up, or when such a device is hot | 1863 * is published as a global during start up, or when such a device is hot |
| 1610 * plugged. A seat typically has a pointer and maintains a keyboard focus | 1864 * plugged. A seat typically has a pointer and maintains a keyboard focus |
| 1611 * and a pointer focus. | 1865 * and a pointer focus. |
| 1612 */ | 1866 */ |
| 1613 struct wl_seat_interface { | 1867 struct wl_seat_interface { |
| 1614 /** | 1868 /** |
| 1615 * get_pointer - return pointer object | 1869 * get_pointer - return pointer object |
| 1616 * @id: (none) | 1870 * @id: (none) |
| 1617 * | 1871 * |
| 1618 * The ID provided will be initialized to the wl_pointer | 1872 * The ID provided will be initialized to the wl_pointer |
| 1619 * interface for this seat. | 1873 * interface for this seat. |
| 1620 * | 1874 * |
| 1621 * This request only takes effect if the seat has the pointer | 1875 * This request only takes effect if the seat has the pointer |
| 1622 » * capability. | 1876 » * capability, or has had the pointer capability in the past. It is |
| 1877 » * a protocol violation to issue this request on a seat that has |
| 1878 » * never had the pointer capability. |
| 1623 */ | 1879 */ |
| 1624 void (*get_pointer)(struct wl_client *client, | 1880 void (*get_pointer)(struct wl_client *client, |
| 1625 struct wl_resource *resource, | 1881 struct wl_resource *resource, |
| 1626 uint32_t id); | 1882 uint32_t id); |
| 1627 /** | 1883 /** |
| 1628 * get_keyboard - return keyboard object | 1884 * get_keyboard - return keyboard object |
| 1629 * @id: (none) | 1885 * @id: (none) |
| 1630 * | 1886 * |
| 1631 * The ID provided will be initialized to the wl_keyboard | 1887 * The ID provided will be initialized to the wl_keyboard |
| 1632 * interface for this seat. | 1888 * interface for this seat. |
| 1633 * | 1889 * |
| 1634 * This request only takes effect if the seat has the keyboard | 1890 * This request only takes effect if the seat has the keyboard |
| 1635 » * capability. | 1891 » * capability, or has had the keyboard capability in the past. It |
| 1892 » * is a protocol violation to issue this request on a seat that has |
| 1893 » * never had the keyboard capability. |
| 1636 */ | 1894 */ |
| 1637 void (*get_keyboard)(struct wl_client *client, | 1895 void (*get_keyboard)(struct wl_client *client, |
| 1638 struct wl_resource *resource, | 1896 struct wl_resource *resource, |
| 1639 uint32_t id); | 1897 uint32_t id); |
| 1640 /** | 1898 /** |
| 1641 * get_touch - return touch object | 1899 * get_touch - return touch object |
| 1642 * @id: (none) | 1900 * @id: (none) |
| 1643 * | 1901 * |
| 1644 * The ID provided will be initialized to the wl_touch interface | 1902 * The ID provided will be initialized to the wl_touch interface |
| 1645 * for this seat. | 1903 * for this seat. |
| 1646 * | 1904 * |
| 1647 * This request only takes effect if the seat has the touch | 1905 * This request only takes effect if the seat has the touch |
| 1648 » * capability. | 1906 » * capability, or has had the touch capability in the past. It is a |
| 1907 » * protocol violation to issue this request on a seat that has |
| 1908 » * never had the touch capability. |
| 1649 */ | 1909 */ |
| 1650 void (*get_touch)(struct wl_client *client, | 1910 void (*get_touch)(struct wl_client *client, |
| 1651 struct wl_resource *resource, | 1911 struct wl_resource *resource, |
| 1652 uint32_t id); | 1912 uint32_t id); |
| 1913 /** |
| 1914 * release - release the seat object |
| 1915 * |
| 1916 * Using this request client can tell the server that it is not |
| 1917 * going to use the seat object anymore. |
| 1918 * @since: 5 |
| 1919 */ |
| 1920 void (*release)(struct wl_client *client, |
| 1921 struct wl_resource *resource); |
| 1653 }; | 1922 }; |
| 1654 | 1923 |
| 1655 #define WL_SEAT_CAPABILITIES 0 | 1924 #define WL_SEAT_CAPABILITIES 0 |
| 1656 #define WL_SEAT_NAME 1 | 1925 #define WL_SEAT_NAME 1 |
| 1657 | 1926 |
| 1658 #define WL_SEAT_CAPABILITIES_SINCE_VERSION 1 | 1927 #define WL_SEAT_CAPABILITIES_SINCE_VERSION 1 |
| 1659 #define WL_SEAT_NAME_SINCE_VERSION 2 | 1928 #define WL_SEAT_NAME_SINCE_VERSION 2 |
| 1660 | 1929 |
| 1661 static inline void | 1930 static inline void |
| 1662 wl_seat_send_capabilities(struct wl_resource *resource_, uint32_t capabilities) | 1931 wl_seat_send_capabilities(struct wl_resource *resource_, uint32_t capabilities) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 * @WL_POINTER_AXIS_HORIZONTAL_SCROLL: (none) | 1970 * @WL_POINTER_AXIS_HORIZONTAL_SCROLL: (none) |
| 1702 * | 1971 * |
| 1703 * Describes the axis types of scroll events. | 1972 * Describes the axis types of scroll events. |
| 1704 */ | 1973 */ |
| 1705 enum wl_pointer_axis { | 1974 enum wl_pointer_axis { |
| 1706 WL_POINTER_AXIS_VERTICAL_SCROLL = 0, | 1975 WL_POINTER_AXIS_VERTICAL_SCROLL = 0, |
| 1707 WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, | 1976 WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, |
| 1708 }; | 1977 }; |
| 1709 #endif /* WL_POINTER_AXIS_ENUM */ | 1978 #endif /* WL_POINTER_AXIS_ENUM */ |
| 1710 | 1979 |
| 1980 #ifndef WL_POINTER_AXIS_SOURCE_ENUM |
| 1981 #define WL_POINTER_AXIS_SOURCE_ENUM |
| 1982 /** |
| 1983 * wl_pointer_axis_source - axis source types |
| 1984 * @WL_POINTER_AXIS_SOURCE_WHEEL: A physical wheel |
| 1985 * @WL_POINTER_AXIS_SOURCE_FINGER: Finger on a touch surface |
| 1986 * @WL_POINTER_AXIS_SOURCE_CONTINUOUS: Continuous coordinate space |
| 1987 * |
| 1988 * Describes the source types for axis events. This indicates to the |
| 1989 * client how an axis event was physically generated; a client may adjust |
| 1990 * the user interface accordingly. For example, scroll events from a |
| 1991 * "finger" source may be in a smooth coordinate space with kinetic |
| 1992 * scrolling whereas a "wheel" source may be in discrete steps of a number |
| 1993 * of lines. |
| 1994 * |
| 1995 * The "continuous" axis source is a device generating events in a |
| 1996 * continuous coordinate space, but using something other than a finger. |
| 1997 * One example for this source is button-based scrolling where the vertical |
| 1998 * motion of a device is converted to scroll events while a button is held |
| 1999 * down. |
| 2000 */ |
| 2001 enum wl_pointer_axis_source { |
| 2002 WL_POINTER_AXIS_SOURCE_WHEEL = 0, |
| 2003 WL_POINTER_AXIS_SOURCE_FINGER = 1, |
| 2004 WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, |
| 2005 }; |
| 2006 #endif /* WL_POINTER_AXIS_SOURCE_ENUM */ |
| 2007 |
| 1711 /** | 2008 /** |
| 1712 * wl_pointer - pointer input device | 2009 * wl_pointer - pointer input device |
| 1713 * @set_cursor: set the pointer surface | 2010 * @set_cursor: set the pointer surface |
| 1714 * @release: release the pointer object | 2011 * @release: release the pointer object |
| 1715 * | 2012 * |
| 1716 * The wl_pointer interface represents one or more input devices, such as | 2013 * The wl_pointer interface represents one or more input devices, such as |
| 1717 * mice, which control the pointer location and pointer_focus of a seat. | 2014 * mice, which control the pointer location and pointer_focus of a seat. |
| 1718 * | 2015 * |
| 1719 * The wl_pointer interface generates motion, enter and leave events for | 2016 * The wl_pointer interface generates motion, enter and leave events for |
| 1720 * the surfaces that the pointer is located over, and button and axis | 2017 * the surfaces that the pointer is located over, and button and axis |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 */ | 2075 */ |
| 1779 void (*release)(struct wl_client *client, | 2076 void (*release)(struct wl_client *client, |
| 1780 struct wl_resource *resource); | 2077 struct wl_resource *resource); |
| 1781 }; | 2078 }; |
| 1782 | 2079 |
| 1783 #define WL_POINTER_ENTER 0 | 2080 #define WL_POINTER_ENTER 0 |
| 1784 #define WL_POINTER_LEAVE 1 | 2081 #define WL_POINTER_LEAVE 1 |
| 1785 #define WL_POINTER_MOTION 2 | 2082 #define WL_POINTER_MOTION 2 |
| 1786 #define WL_POINTER_BUTTON 3 | 2083 #define WL_POINTER_BUTTON 3 |
| 1787 #define WL_POINTER_AXIS 4 | 2084 #define WL_POINTER_AXIS 4 |
| 2085 #define WL_POINTER_FRAME 5 |
| 2086 #define WL_POINTER_AXIS_SOURCE 6 |
| 2087 #define WL_POINTER_AXIS_STOP 7 |
| 2088 #define WL_POINTER_AXIS_DISCRETE 8 |
| 1788 | 2089 |
| 1789 #define WL_POINTER_ENTER_SINCE_VERSION 1 | 2090 #define WL_POINTER_ENTER_SINCE_VERSION 1 |
| 1790 #define WL_POINTER_LEAVE_SINCE_VERSION 1 | 2091 #define WL_POINTER_LEAVE_SINCE_VERSION 1 |
| 1791 #define WL_POINTER_MOTION_SINCE_VERSION 1 | 2092 #define WL_POINTER_MOTION_SINCE_VERSION 1 |
| 1792 #define WL_POINTER_BUTTON_SINCE_VERSION 1 | 2093 #define WL_POINTER_BUTTON_SINCE_VERSION 1 |
| 1793 #define WL_POINTER_AXIS_SINCE_VERSION 1 | 2094 #define WL_POINTER_AXIS_SINCE_VERSION 1 |
| 2095 #define WL_POINTER_FRAME_SINCE_VERSION 5 |
| 2096 #define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5 |
| 2097 #define WL_POINTER_AXIS_STOP_SINCE_VERSION 5 |
| 2098 #define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5 |
| 1794 | 2099 |
| 1795 static inline void | 2100 static inline void |
| 1796 wl_pointer_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_
resource *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) | 2101 wl_pointer_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_
resource *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) |
| 1797 { | 2102 { |
| 1798 wl_resource_post_event(resource_, WL_POINTER_ENTER, serial, surface, sur
face_x, surface_y); | 2103 wl_resource_post_event(resource_, WL_POINTER_ENTER, serial, surface, sur
face_x, surface_y); |
| 1799 } | 2104 } |
| 1800 | 2105 |
| 1801 static inline void | 2106 static inline void |
| 1802 wl_pointer_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_
resource *surface) | 2107 wl_pointer_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_
resource *surface) |
| 1803 { | 2108 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1815 { | 2120 { |
| 1816 wl_resource_post_event(resource_, WL_POINTER_BUTTON, serial, time, butto
n, state); | 2121 wl_resource_post_event(resource_, WL_POINTER_BUTTON, serial, time, butto
n, state); |
| 1817 } | 2122 } |
| 1818 | 2123 |
| 1819 static inline void | 2124 static inline void |
| 1820 wl_pointer_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis
, wl_fixed_t value) | 2125 wl_pointer_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis
, wl_fixed_t value) |
| 1821 { | 2126 { |
| 1822 wl_resource_post_event(resource_, WL_POINTER_AXIS, time, axis, value); | 2127 wl_resource_post_event(resource_, WL_POINTER_AXIS, time, axis, value); |
| 1823 } | 2128 } |
| 1824 | 2129 |
| 2130 static inline void |
| 2131 wl_pointer_send_frame(struct wl_resource *resource_) |
| 2132 { |
| 2133 wl_resource_post_event(resource_, WL_POINTER_FRAME); |
| 2134 } |
| 2135 |
| 2136 static inline void |
| 2137 wl_pointer_send_axis_source(struct wl_resource *resource_, uint32_t axis_source) |
| 2138 { |
| 2139 wl_resource_post_event(resource_, WL_POINTER_AXIS_SOURCE, axis_source); |
| 2140 } |
| 2141 |
| 2142 static inline void |
| 2143 wl_pointer_send_axis_stop(struct wl_resource *resource_, uint32_t time, uint32_t
axis) |
| 2144 { |
| 2145 wl_resource_post_event(resource_, WL_POINTER_AXIS_STOP, time, axis); |
| 2146 } |
| 2147 |
| 2148 static inline void |
| 2149 wl_pointer_send_axis_discrete(struct wl_resource *resource_, uint32_t axis, int3
2_t discrete) |
| 2150 { |
| 2151 wl_resource_post_event(resource_, WL_POINTER_AXIS_DISCRETE, axis, discre
te); |
| 2152 } |
| 2153 |
| 1825 #ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM | 2154 #ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM |
| 1826 #define WL_KEYBOARD_KEYMAP_FORMAT_ENUM | 2155 #define WL_KEYBOARD_KEYMAP_FORMAT_ENUM |
| 1827 /** | 2156 /** |
| 1828 * wl_keyboard_keymap_format - keyboard mapping format | 2157 * wl_keyboard_keymap_format - keyboard mapping format |
| 1829 * @WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP: no keymap; client must | 2158 * @WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP: no keymap; client must |
| 1830 * understand how to interpret the raw keycode | 2159 * understand how to interpret the raw keycode |
| 1831 * @WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1: libxkbcommon compatible; to | 2160 * @WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1: libxkbcommon compatible; to |
| 1832 * determine the xkb keycode, clients must add 8 to the key event keycode | 2161 * determine the xkb keycode, clients must add 8 to the key event keycode |
| 1833 * | 2162 * |
| 1834 * This specifies the format of the keymap provided to the client with | 2163 * This specifies the format of the keymap provided to the client with |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 void (*set_desync)(struct wl_client *client, | 2724 void (*set_desync)(struct wl_client *client, |
| 2396 struct wl_resource *resource); | 2725 struct wl_resource *resource); |
| 2397 }; | 2726 }; |
| 2398 | 2727 |
| 2399 | 2728 |
| 2400 #ifdef __cplusplus | 2729 #ifdef __cplusplus |
| 2401 } | 2730 } |
| 2402 #endif | 2731 #endif |
| 2403 | 2732 |
| 2404 #endif | 2733 #endif |
| OLD | NEW |