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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // Returns whether this is a scroll event and optionally gets the amount to be | 148 // Returns whether this is a scroll event and optionally gets the amount to be |
149 // scrolled. |x_offset|, |y_offset| and |finger_count| can be NULL. | 149 // scrolled. |x_offset|, |y_offset| and |finger_count| can be NULL. |
150 EVENTS_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, | 150 EVENTS_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, |
151 float* x_offset, | 151 float* x_offset, |
152 float* y_offset, | 152 float* y_offset, |
153 float* x_offset_ordinal, | 153 float* x_offset_ordinal, |
154 float* y_offset_ordinal, | 154 float* y_offset_ordinal, |
155 int* finger_count); | 155 int* finger_count); |
156 | 156 |
157 // Returns whether natural scrolling should be used for touchpad. | |
158 EVENTS_EXPORT bool ShouldDefaultToNaturalScroll(); | |
159 | |
160 // Returns whether or not the internal display produces touch events. | |
161 EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport(); | |
162 | |
163 #if defined(OS_WIN) | 157 #if defined(OS_WIN) |
164 EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); | 158 EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); |
165 EVENTS_EXPORT int GetModifiersFromKeyState(); | 159 EVENTS_EXPORT int GetModifiersFromKeyState(); |
166 | 160 |
167 // Returns true if |message| identifies a mouse event that was generated as the | 161 // Returns true if |message| identifies a mouse event that was generated as the |
168 // result of a touch event. | 162 // result of a touch event. |
169 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); | 163 EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); |
170 | 164 |
171 // Converts scan code and lParam each other. The scan code | 165 // Converts scan code and lParam each other. The scan code |
172 // representing an extended key contains 0xE000 bits. | 166 // representing an extended key contains 0xE000 bits. |
173 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); | 167 EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); |
174 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); | 168 EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); |
175 | 169 |
176 #endif | 170 #endif |
177 | 171 |
178 #if defined(USE_X11) | 172 #if defined(USE_X11) |
179 // Update the native X11 event to correspond to the new flags. | 173 // Update the native X11 event to correspond to the new flags. |
180 EVENTS_EXPORT void UpdateX11EventForFlags(Event* event); | 174 EVENTS_EXPORT void UpdateX11EventForFlags(Event* event); |
181 // Update the native X11 event to correspond to the new button flags. | 175 // Update the native X11 event to correspond to the new button flags. |
182 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); | 176 EVENTS_EXPORT void UpdateX11EventForChangedButtonFlags(MouseEvent* event); |
183 #endif | 177 #endif |
184 | 178 |
185 // Registers a custom event type. | 179 // Registers a custom event type. |
186 EVENTS_EXPORT int RegisterCustomEventType(); | 180 EVENTS_EXPORT int RegisterCustomEventType(); |
187 | 181 |
188 } // namespace ui | 182 } // namespace ui |
189 | 183 |
190 #endif // UI_EVENTS_EVENT_UTILS_H_ | 184 #endif // UI_EVENTS_EVENT_UTILS_H_ |
OLD | NEW |