| 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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 EVENTS_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, | 141 EVENTS_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, |
| 142 double* start_time, | 142 double* start_time, |
| 143 double* end_time); | 143 double* end_time); |
| 144 | 144 |
| 145 // Returns whether natural scrolling should be used for touchpad. | 145 // Returns whether natural scrolling should be used for touchpad. |
| 146 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); | 146 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); |
| 147 | 147 |
| 148 // Returns whether or not the internal display produces touch events. | 148 // Returns whether or not the internal display produces touch events. |
| 149 EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport(); | 149 EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport(); |
| 150 | 150 |
| 151 // Was this event generated by a touchpad device? | |
| 152 // The caller is responsible for ensuring that this is a mouse/touchpad event | |
| 153 // before calling this function. | |
| 154 EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); | |
| 155 | |
| 156 #if defined(OS_WIN) | 151 #if defined(OS_WIN) |
| 157 EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); | 152 EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); |
| 158 EVENTS_EXPORT int GetModifiersFromKeyState(); | 153 EVENTS_EXPORT int GetModifiersFromKeyState(); |
| 159 | 154 |
| 160 // Returns true if |message| identifies a mouse event that was generated as the | 155 // Returns true if |message| identifies a mouse event that was generated as the |
| 161 // result of a touch event. | 156 // result of a touch event. |
| 162 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); | 157 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); |
| 163 | 158 |
| 164 // Converts scan code and lParam each other. The scan code | 159 // Converts scan code and lParam each other. The scan code |
| 165 // representing an extended key contains 0xE000 bits. | 160 // representing an extended key contains 0xE000 bits. |
| 166 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); | 161 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); |
| 167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 162 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
| 168 | 163 |
| 169 #endif | 164 #endif |
| 170 | 165 |
| 171 // Registers a custom event type. | 166 // Registers a custom event type. |
| 172 EVENTS_EXPORT int RegisterCustomEventType(); | 167 EVENTS_EXPORT int RegisterCustomEventType(); |
| 173 | 168 |
| 174 } // namespace ui | 169 } // namespace ui |
| 175 | 170 |
| 176 #endif // UI_EVENTS_EVENT_UTILS_H_ | 171 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |