OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /** | 6 /** |
7 * This file defines the Input Event interfaces. | 7 * This file defines the Input Event interfaces. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 * | 126 * |
127 * Register for this event using the PP_INPUTEVENT_CLASS_IME class. | 127 * Register for this event using the PP_INPUTEVENT_CLASS_IME class. |
128 */ | 128 */ |
129 PP_INPUTEVENT_TYPE_IME_COMPOSITION_END = 13, | 129 PP_INPUTEVENT_TYPE_IME_COMPOSITION_END = 13, |
130 | 130 |
131 /** | 131 /** |
132 * Notification that an input method committed a string. | 132 * Notification that an input method committed a string. |
133 * | 133 * |
134 * Register for this event using the PP_INPUTEVENT_CLASS_IME class. | 134 * Register for this event using the PP_INPUTEVENT_CLASS_IME class. |
135 */ | 135 */ |
136 PP_INPUTEVENT_TYPE_IME_TEXT = 14 | 136 PP_INPUTEVENT_TYPE_IME_TEXT = 14, |
| 137 |
| 138 /** |
| 139 * Notification that a finger was placed on a touch-enabled device. |
| 140 * |
| 141 * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. |
| 142 */ |
| 143 PP_INPUTEVENT_TYPE_TOUCHSTART = 15, |
| 144 |
| 145 /** |
| 146 * Notification that a finger was moved on a touch-enabled device. |
| 147 * |
| 148 * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. |
| 149 */ |
| 150 PP_INPUTEVENT_TYPE_TOUCHMOVE = 16, |
| 151 |
| 152 /** |
| 153 * Notification that a finger was released on a touch-enabled device. |
| 154 * |
| 155 * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. |
| 156 */ |
| 157 PP_INPUTEVENT_TYPE_TOUCHEND = 17, |
| 158 |
| 159 /** |
| 160 * Notification that a touch event was canceled. |
| 161 * |
| 162 * Register for this event using the PP_INPUTEVENT_CLASS_TOUCH class. |
| 163 */ |
| 164 PP_INPUTEVENT_TYPE_TOUCHCANCEL = 18 |
137 }; | 165 }; |
138 | 166 |
139 /** | 167 /** |
140 * This enumeration contains event modifier constants. Each modifier is one | 168 * This enumeration contains event modifier constants. Each modifier is one |
141 * bit. Retrieve the modifiers from an input event using the GetEventModifiers | 169 * bit. Retrieve the modifiers from an input event using the GetEventModifiers |
142 * function on PPB_InputEvent. | 170 * function on PPB_InputEvent. |
143 */ | 171 */ |
144 [assert_size(4)] | 172 [assert_size(4)] |
145 enum PP_InputEvent_Modifier { | 173 enum PP_InputEvent_Modifier { |
146 PP_INPUTEVENT_MODIFIER_SHIFTKEY = 1 << 0, | 174 PP_INPUTEVENT_MODIFIER_SHIFTKEY = 1 << 0, |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 * @param[in] character_event A <code>PP_Resource</code> corresponding to a | 751 * @param[in] character_event A <code>PP_Resource</code> corresponding to a |
724 * keyboard event. | 752 * keyboard event. |
725 * | 753 * |
726 * @return A string var representing a single typed character for character | 754 * @return A string var representing a single typed character for character |
727 * input events. For non-character input events the return value will be an | 755 * input events. For non-character input events the return value will be an |
728 * undefined var. | 756 * undefined var. |
729 */ | 757 */ |
730 PP_Var GetCharacterText([in] PP_Resource character_event); | 758 PP_Var GetCharacterText([in] PP_Resource character_event); |
731 }; | 759 }; |
732 | 760 |
| 761 [assert_size(4)] |
| 762 enum PP_TouchListType { |
| 763 /** |
| 764 * The list of all TouchPoints which are currently down. |
| 765 */ |
| 766 PP_TOUCHLIST_TYPE_TOUCHES = 0, |
| 767 |
| 768 /** |
| 769 * The list of all TouchPoints whose state has changed since the last |
| 770 * TouchInputEvent. |
| 771 */ |
| 772 PP_TOUCHLIST_TYPE_CHANGEDTOUCHES = 1, |
| 773 |
| 774 /** |
| 775 * The list of all TouchPoints which are targeting this plugin. This is a |
| 776 * subset of Touches. |
| 777 */ |
| 778 PP_TOUCHLIST_TYPE_TARGETTOUCHES = 2 |
| 779 }; |
| 780 |
| 781 /** |
| 782 * The <code>PPB_TouchInputEvent</code> interface contains pointers to several |
| 783 * functions related to touch events. |
| 784 */ |
| 785 [version=1.0, macro="PPB_TOUCH_INPUT_EVENT_INTERFACE"] |
| 786 interface PPB_TouchInputEvent { |
| 787 /** |
| 788 * Creates a touch input event with the given parameters. Normally you |
| 789 * will get a touch event passed through the HandleInputEvent and will not |
| 790 * need to create them, but some applications may want to create their own |
| 791 * for internal use. The type must be one of the touch event types. |
| 792 * This newly created touch input event does not have any touch point in any |
| 793 * of the touch-point lists. <code>AddTouchPoint</code> should be called to |
| 794 * add the touch-points. |
| 795 * |
| 796 * @param[in] instance The instance for which this event occurred. |
| 797 * |
| 798 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of |
| 799 * input event. |
| 800 * |
| 801 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time |
| 802 * when the event occurred. |
| 803 * |
| 804 * @param[in] modifiers A bit field combination of the |
| 805 * <code>PP_InputEvent_Modifier</code> flags. |
| 806 * |
| 807 * @return A <code>PP_Resource</code> containing the new touch input event. |
| 808 */ |
| 809 PP_Resource Create([in] PP_Instance instance, |
| 810 [in] PP_InputEvent_Type type, |
| 811 [in] PP_TimeTicks time_stamp, |
| 812 [in] uint32_t modifiers); |
| 813 |
| 814 /** |
| 815 * Adds a touch point to the touch event in the specified touch-list. |
| 816 * |
| 817 * @param[in] touch_event A <code>PP_Resource</code> corresponding to a touch |
| 818 * event. |
| 819 * |
| 820 * @param[in] list The list to add the touch point to. |
| 821 * |
| 822 * @param[in] point The point to add to the list. |
| 823 */ |
| 824 void AddTouchPoint([in] PP_Resource touch_event, |
| 825 [in] PP_TouchListType list, |
| 826 [in] PP_TouchPoint point); |
| 827 |
| 828 /** |
| 829 * IsTouchInputEvent() determines if a resource is a touch event. |
| 830 * |
| 831 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. |
| 832 * |
| 833 * @return <code>PP_TRUE</code> if the given resource is a valid touch input |
| 834 * event, otherwise <code>PP_FALSE</code>. |
| 835 */ |
| 836 PP_Bool IsTouchInputEvent([in] PP_Resource resource); |
| 837 |
| 838 /** |
| 839 * Returns the number of touch-points in the specified list. |
| 840 * |
| 841 * @param[in] resource A <code>PP_Resource</code> corresponding to a touch |
| 842 * event. |
| 843 * |
| 844 * @param[in] list The list. |
| 845 * |
| 846 * @return The number of touch-points in the specified list. |
| 847 */ |
| 848 uint32_t GetTouchCount([in] PP_Resource resource, |
| 849 [in] PP_TouchListType list); |
| 850 |
| 851 /** |
| 852 * Returns the touch-point at the specified index from the specified list. |
| 853 * |
| 854 * @param[in] resource A <code>PP_Resource</code> corresponding to a touch |
| 855 * event. |
| 856 * |
| 857 * @param[in] list The list. |
| 858 * |
| 859 * @param[in] index The index. |
| 860 * |
| 861 * @return A <code>PP_TouchPoint</code> representing the touch-point. |
| 862 */ |
| 863 PP_TouchPoint GetTouchByIndex([in] PP_Resource resource, |
| 864 [in] PP_TouchListType list, |
| 865 [in] uint32_t index); |
| 866 |
| 867 /** |
| 868 * Returns the touch-point with the spcified touch-id in the specified list. |
| 869 * |
| 870 * @param[in] resource A <code>PP_Resource</code> corresponding to a touch |
| 871 * event. |
| 872 * |
| 873 * @param[in] list The list. |
| 874 * |
| 875 * @param[in] touch_id The id of the touch-point. |
| 876 * |
| 877 * @return A <code>PP_TouchPoint</code> representing the touch-point. |
| 878 */ |
| 879 PP_TouchPoint GetTouchById([in] PP_Resource resource, |
| 880 [in] PP_TouchListType list, |
| 881 [in] uint32_t touch_id); |
| 882 }; |
OLD | NEW |