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

Side by Side Diff: ui/base/events.h

Issue 9076002: Initial views touchui Gesture Recognizer support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win release build Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/views/events/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
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 ET_SCROLL,
39 ET_TRANSLATED_KEY_PRESS, 39 ET_TRANSLATED_KEY_PRESS,
40 ET_TRANSLATED_KEY_RELEASE, 40 ET_TRANSLATED_KEY_RELEASE,
41
42 // GestureEvent types
43 ET_GESTURE_SCROLL_BEGIN,
44 ET_GESTURE_SCROLL_END,
45 ET_GESTURE_SCROLL_UPDATE,
46 ET_GESTURE_TAP,
47 ET_GESTURE_TAP_DOWN,
48 ET_GESTURE_DOUBLE_TAP,
41 }; 49 };
42 50
43 // Event flags currently supported 51 // Event flags currently supported
44 enum EventFlags { 52 enum EventFlags {
45 EF_CAPS_LOCK_DOWN = 1 << 0, 53 EF_CAPS_LOCK_DOWN = 1 << 0,
46 EF_SHIFT_DOWN = 1 << 1, 54 EF_SHIFT_DOWN = 1 << 1,
47 EF_CONTROL_DOWN = 1 << 2, 55 EF_CONTROL_DOWN = 1 << 2,
48 EF_ALT_DOWN = 1 << 3, 56 EF_ALT_DOWN = 1 << 3,
49 EF_LEFT_MOUSE_BUTTON = 1 << 4, 57 EF_LEFT_MOUSE_BUTTON = 1 << 4,
50 EF_MIDDLE_MOUSE_BUTTON = 1 << 5, 58 EF_MIDDLE_MOUSE_BUTTON = 1 << 5,
(...skipping 18 matching lines...) Expand all
69 TOUCH_STATUS_CANCEL, // The touch event was cancelled, but didn't 77 TOUCH_STATUS_CANCEL, // The touch event was cancelled, but didn't
70 // terminate the touch sequence. 78 // terminate the touch sequence.
71 TOUCH_STATUS_SYNTH_MOUSE // The touch event was not processed, but a 79 TOUCH_STATUS_SYNTH_MOUSE // The touch event was not processed, but a
72 // synthetic mouse event generated from the 80 // synthetic mouse event generated from the
73 // unused touch event was handled. 81 // unused touch event was handled.
74 }; 82 };
75 83
76 // Updates the list of devices for cached properties. 84 // Updates the list of devices for cached properties.
77 UI_EXPORT void UpdateDeviceList(); 85 UI_EXPORT void UpdateDeviceList();
78 86
87 enum GestureStatus {
88 GESTURE_STATUS_UNKNOWN = 0, // Unknown Gesture status. This is used to
89 // indicate that the Gesture event was not
90 // handled.
91 GESTURE_STATUS_CONSUMED, // The Gesture event got consumed.
92 GESTURE_STATUS_SYNTH_MOUSE // The Gesture event was not processed, but a
93 // synthetic mouse event generated from the
94 // unused Gesture event was handled.
95 };
96
79 // Get the EventType from a native event. 97 // Get the EventType from a native event.
80 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); 98 UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event);
81 99
82 // Get the EventFlags from a native event. 100 // Get the EventFlags from a native event.
83 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); 101 UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event);
84 102
85 // Get the location from a native event. The coordinate system of the resultant 103 // Get the location from a native event. The coordinate system of the resultant
86 // |Point| has the origin at top-left of the "root window". The nature of 104 // |Point| has the origin at top-left of the "root window". The nature of
87 // this "root window" and how it maps to platform-specific drawing surfaces is 105 // this "root window" and how it maps to platform-specific drawing surfaces is
88 // defined in ui/aura/root_window.* and ui/aura/root_window_host*. 106 // defined in ui/aura/root_window.* and ui/aura/root_window_host*.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, 143 UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event,
126 float* x_offset, 144 float* x_offset,
127 float* y_offset); 145 float* y_offset);
128 146
129 // Creates and returns no-op event. 147 // Creates and returns no-op event.
130 UI_EXPORT base::NativeEvent CreateNoopEvent(); 148 UI_EXPORT base::NativeEvent CreateNoopEvent();
131 149
132 } // namespace ui 150 } // namespace ui
133 151
134 #endif // UI_BASE_EVENTS_H_ 152 #endif // UI_BASE_EVENTS_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698