| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/event_types.h" | 12 #include "base/event_types.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "ui/display/display.h" |
| 15 #include "ui/events/event.h" | 16 #include "ui/events/event.h" |
| 16 #include "ui/events/event_constants.h" | 17 #include "ui/events/event_constants.h" |
| 17 #include "ui/events/events_export.h" | 18 #include "ui/events/events_export.h" |
| 18 #include "ui/events/keycodes/keyboard_codes.h" | 19 #include "ui/events/keycodes/keyboard_codes.h" |
| 19 #include "ui/gfx/display.h" | |
| 20 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 21 | 21 |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 23 #include <windows.h> | 23 #include <windows.h> |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 namespace gfx { | 26 namespace gfx { |
| 27 class Point; | 27 class Point; |
| 28 class Vector2d; | 28 class Vector2d; |
| 29 } | 29 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 float* x_offset, | 145 float* x_offset, |
| 146 float* y_offset, | 146 float* y_offset, |
| 147 float* x_offset_ordinal, | 147 float* x_offset_ordinal, |
| 148 float* y_offset_ordinal, | 148 float* y_offset_ordinal, |
| 149 int* finger_count); | 149 int* finger_count); |
| 150 | 150 |
| 151 // Returns whether natural scrolling should be used for touchpad. | 151 // Returns whether natural scrolling should be used for touchpad. |
| 152 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); | 152 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); |
| 153 | 153 |
| 154 // Returns whether or not the internal display produces touch events. | 154 // Returns whether or not the internal display produces touch events. |
| 155 EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport(); | 155 EVENTS_EXPORT display::Display::TouchSupport GetInternalDisplayTouchSupport(); |
| 156 | 156 |
| 157 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
| 158 EVENTS_EXPORT int GetModifiersFromKeyState(); | 158 EVENTS_EXPORT int GetModifiersFromKeyState(); |
| 159 | 159 |
| 160 // Returns true if |message| identifies a mouse event that was generated as the | 160 // Returns true if |message| identifies a mouse event that was generated as the |
| 161 // result of a touch event. | 161 // result of a touch event. |
| 162 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); | 162 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); |
| 163 | 163 |
| 164 // Converts scan code and lParam each other. The scan code | 164 // Converts scan code and lParam each other. The scan code |
| 165 // representing an extended key contains 0xE000 bits. | 165 // representing an extended key contains 0xE000 bits. |
| 166 EVENTS_EXPORT uint16_t GetScanCodeFromLParam(LPARAM lParam); | 166 EVENTS_EXPORT uint16_t GetScanCodeFromLParam(LPARAM lParam); |
| 167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16_t scan_code); | 167 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16_t scan_code); |
| 168 | 168 |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 #if defined(USE_X11) | 171 #if defined(USE_X11) |
| 172 // Update the native X11 event to correspond to the new flags. | 172 // Update the native X11 event to correspond to the new flags. |
| 173 EVENTS_EXPORT void UpdateX11EventForFlags(Event* event); | 173 EVENTS_EXPORT void UpdateX11EventForFlags(Event* event); |
| 174 // Update the native X11 event to correspond to the new button flags. | 174 // Update the native X11 event to correspond to the new button flags. |
| 175 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 175 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
| 176 #endif | 176 #endif |
| 177 | 177 |
| 178 // Registers a custom event type. | 178 // Registers a custom event type. |
| 179 EVENTS_EXPORT int RegisterCustomEventType(); | 179 EVENTS_EXPORT int RegisterCustomEventType(); |
| 180 | 180 |
| 181 } // namespace ui | 181 } // namespace ui |
| 182 | 182 |
| 183 #endif // UI_EVENTS_EVENT_UTILS_H_ | 183 #endif // UI_EVENTS_EVENT_UTILS_H_ |
| OLD | NEW |