OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef UI_BASE_EVENTS_H_ | 5 #ifndef UI_BASE_EVENTS_H_ |
6 #define UI_BASE_EVENTS_H_ | 6 #define UI_BASE_EVENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 ET_KEY_PRESSED, | 28 ET_KEY_PRESSED, |
29 ET_KEY_RELEASED, | 29 ET_KEY_RELEASED, |
30 ET_MOUSEWHEEL, | 30 ET_MOUSEWHEEL, |
31 ET_TOUCH_RELEASED, | 31 ET_TOUCH_RELEASED, |
32 ET_TOUCH_PRESSED, | 32 ET_TOUCH_PRESSED, |
33 ET_TOUCH_MOVED, | 33 ET_TOUCH_MOVED, |
34 ET_TOUCH_STATIONARY, | 34 ET_TOUCH_STATIONARY, |
35 ET_TOUCH_CANCELLED, | 35 ET_TOUCH_CANCELLED, |
36 ET_DROP_TARGET_EVENT, | 36 ET_DROP_TARGET_EVENT, |
37 ET_FOCUS_CHANGE, | 37 ET_FOCUS_CHANGE, |
38 ET_SCROLL, | |
38 }; | 39 }; |
39 | 40 |
40 // Event flags currently supported | 41 // Event flags currently supported |
41 enum EventFlags { | 42 enum EventFlags { |
42 EF_CAPS_LOCK_DOWN = 1 << 0, | 43 EF_CAPS_LOCK_DOWN = 1 << 0, |
43 EF_SHIFT_DOWN = 1 << 1, | 44 EF_SHIFT_DOWN = 1 << 1, |
44 EF_CONTROL_DOWN = 1 << 2, | 45 EF_CONTROL_DOWN = 1 << 2, |
45 EF_ALT_DOWN = 1 << 3, | 46 EF_ALT_DOWN = 1 << 3, |
46 EF_LEFT_BUTTON_DOWN = 1 << 4, | 47 EF_LEFT_BUTTON_DOWN = 1 << 4, |
47 EF_MIDDLE_BUTTON_DOWN = 1 << 5, | 48 EF_MIDDLE_BUTTON_DOWN = 1 << 5, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 // Gets the radius along the X/Y axis from a native event. Default is 1.0. | 105 // Gets the radius along the X/Y axis from a native event. Default is 1.0. |
105 UI_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); | 106 UI_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); |
106 UI_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); | 107 UI_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); |
107 | 108 |
108 // Gets the angle of the major axis away from the X axis. Default is 0.0. | 109 // Gets the angle of the major axis away from the X axis. Default is 0.0. |
109 UI_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); | 110 UI_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); |
110 | 111 |
111 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. | 112 // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. |
112 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); | 113 UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); |
113 | 114 |
115 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, | |
Ben Goodger (Google)
2011/12/14 19:01:39
Offset from what?
DaveMoore
2011/12/14 21:26:04
Scrolls are always deltas. I can use a different w
| |
116 float* x_offset, | |
117 float* y_offset); | |
118 | |
114 // Creates and returns no-op event. | 119 // Creates and returns no-op event. |
115 UI_EXPORT base::NativeEvent CreateNoopEvent(); | 120 UI_EXPORT base::NativeEvent CreateNoopEvent(); |
116 | 121 |
117 } // namespace ui | 122 } // namespace ui |
118 | 123 |
119 #endif // UI_BASE_EVENTS_H_ | 124 #endif // UI_BASE_EVENTS_H_ |
OLD | NEW |