Chromium Code Reviews| 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 #ifndef UI_EVENTS_EVENT_UTILS_H_ | 5 #ifndef UI_EVENTS_EVENT_UTILS_H_ |
| 6 #define UI_EVENTS_EVENT_UTILS_H_ | 6 #define UI_EVENTS_EVENT_UTILS_H_ |
| 7 | 7 |
| 8 #include "base/event_types.h" | 8 #include "base/event_types.h" |
| 9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
| 10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 float* x_offset, | 116 float* x_offset, |
| 117 float* y_offset, | 117 float* y_offset, |
| 118 float* x_offset_ordinal, | 118 float* x_offset_ordinal, |
| 119 float* y_offset_ordinal, | 119 float* y_offset_ordinal, |
| 120 int* finger_count); | 120 int* finger_count); |
| 121 | 121 |
| 122 EVENTS_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, | 122 EVENTS_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, |
| 123 double* start_time, | 123 double* start_time, |
| 124 double* end_time); | 124 double* end_time); |
| 125 | 125 |
| 126 // Enable/disable natural scrolling for touchpads. | |
| 127 EVENTS_EXPORT void SetNaturalScroll(bool enabled); | |
| 128 | |
| 129 // In natural scrolling enabled for touchpads? | |
| 130 EVENTS_EXPORT bool IsNaturalScrollEnabled(); | |
| 131 | |
| 132 // Returns whether natural scrolling should be used for touchpad. | 126 // Returns whether natural scrolling should be used for touchpad. |
| 133 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); | 127 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); |
|
achuithb
2014/03/27 00:54:27
What about this? Shouldn't this be removed as well
achuithb
2014/03/27 00:59:02
Actually, it looks like it shouldn't be. Never min
| |
| 134 | 128 |
| 135 // Returns whether or not the internal display produces touch events. | 129 // Returns whether or not the internal display produces touch events. |
| 136 EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport(); | 130 EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport(); |
| 137 | 131 |
| 138 // Was this event generated by a touchpad device? | 132 // Was this event generated by a touchpad device? |
| 139 // The caller is responsible for ensuring that this is a mouse/touchpad event | 133 // The caller is responsible for ensuring that this is a mouse/touchpad event |
| 140 // before calling this function. | 134 // before calling this function. |
| 141 EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); | 135 EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); |
| 142 | 136 |
| 143 #if defined(OS_WIN) | 137 #if defined(OS_WIN) |
| 144 EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); | 138 EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); |
| 145 EVENTS_EXPORT int GetModifiersFromKeyState(); | 139 EVENTS_EXPORT int GetModifiersFromKeyState(); |
| 146 | 140 |
| 147 // Returns true if |message| identifies a mouse event that was generated as the | 141 // Returns true if |message| identifies a mouse event that was generated as the |
| 148 // result of a touch event. | 142 // result of a touch event. |
| 149 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); | 143 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); |
| 150 | 144 |
| 151 // Converts scan code and lParam each other. The scan code | 145 // Converts scan code and lParam each other. The scan code |
| 152 // representing an extended key contains 0xE000 bits. | 146 // representing an extended key contains 0xE000 bits. |
| 153 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); | 147 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); |
| 154 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 148 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
| 155 #endif | 149 #endif |
| 156 | 150 |
| 157 // Registers a custom event type. | 151 // Registers a custom event type. |
| 158 EVENTS_EXPORT int RegisterCustomEventType(); | 152 EVENTS_EXPORT int RegisterCustomEventType(); |
| 159 | 153 |
| 160 } // namespace ui | 154 } // namespace ui |
| 161 | 155 |
| 162 #endif // UI_EVENTS_EVENT_UTILS_H_ | 156 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |