| 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 #include "ui/events/event_constants.h" | 5 #include "ui/events/event_constants.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <X11/extensions/XInput.h> | 9 #include <X11/extensions/XInput.h> |
| 10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
| 11 #include <X11/Xlib.h> | 11 #include <X11/Xlib.h> |
| 12 #include <X11/Xutil.h> | 12 #include <X11/Xutil.h> |
| 13 #include <X11/XKBlib.h> | 13 #include <X11/XKBlib.h> |
| 14 | 14 |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
| 17 #include "ui/events/devices/x11/device_data_manager_x11.h" |
| 18 #include "ui/events/devices/x11/device_list_cache_x11.h" |
| 19 #include "ui/events/devices/x11/touch_factory_x11.h" |
| 17 #include "ui/events/event.h" | 20 #include "ui/events/event.h" |
| 18 #include "ui/events/event_utils.h" | 21 #include "ui/events/event_utils.h" |
| 19 #include "ui/events/keycodes/keyboard_code_conversion_x.h" | 22 #include "ui/events/keycodes/keyboard_code_conversion_x.h" |
| 20 #include "ui/events/x/device_data_manager_x11.h" | |
| 21 #include "ui/events/x/device_list_cache_x.h" | |
| 22 #include "ui/events/x/touch_factory_x11.h" | |
| 23 #include "ui/gfx/display.h" | 23 #include "ui/gfx/display.h" |
| 24 #include "ui/gfx/point.h" | 24 #include "ui/gfx/point.h" |
| 25 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
| 26 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
| 27 #include "ui/gfx/x/x11_atom_cache.h" | 27 #include "ui/gfx/x/x11_atom_cache.h" |
| 28 #include "ui/gfx/x/x11_types.h" | 28 #include "ui/gfx/x/x11_types.h" |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 // Scroll amount for each wheelscroll event. 53 is also the value used for GTK+. | 32 // Scroll amount for each wheelscroll event. 53 is also the value used for GTK+. |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 native_event, start_time, end_time); | 351 native_event, start_time, end_time); |
| 352 return true; | 352 return true; |
| 353 } | 353 } |
| 354 | 354 |
| 355 } // namespace | 355 } // namespace |
| 356 | 356 |
| 357 namespace ui { | 357 namespace ui { |
| 358 | 358 |
| 359 void UpdateDeviceList() { | 359 void UpdateDeviceList() { |
| 360 XDisplay* display = gfx::GetXDisplay(); | 360 XDisplay* display = gfx::GetXDisplay(); |
| 361 DeviceListCacheX::GetInstance()->UpdateDeviceList(display); | 361 DeviceListCacheX11::GetInstance()->UpdateDeviceList(display); |
| 362 TouchFactory::GetInstance()->UpdateDeviceList(display); | 362 TouchFactory::GetInstance()->UpdateDeviceList(display); |
| 363 DeviceDataManagerX11::GetInstance()->UpdateDeviceList(display); | 363 DeviceDataManagerX11::GetInstance()->UpdateDeviceList(display); |
| 364 } | 364 } |
| 365 | 365 |
| 366 EventType EventTypeFromNative(const base::NativeEvent& native_event) { | 366 EventType EventTypeFromNative(const base::NativeEvent& native_event) { |
| 367 // Allow the DeviceDataManager to block the event. If blocked return | 367 // Allow the DeviceDataManager to block the event. If blocked return |
| 368 // ET_UNKNOWN as the type so this event will not be further processed. | 368 // ET_UNKNOWN as the type so this event will not be further processed. |
| 369 // NOTE: During some events unittests there is no device data manager. | 369 // NOTE: During some events unittests there is no device data manager. |
| 370 if (DeviceDataManager::HasInstance() && | 370 if (DeviceDataManager::HasInstance() && |
| 371 static_cast<DeviceDataManagerX11*>(DeviceDataManager::GetInstance())-> | 371 static_cast<DeviceDataManagerX11*>(DeviceDataManager::GetInstance())-> |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 xievent->detail = | 920 xievent->detail = |
| 921 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); | 921 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); |
| 922 break; | 922 break; |
| 923 } | 923 } |
| 924 default: | 924 default: |
| 925 break; | 925 break; |
| 926 } | 926 } |
| 927 } | 927 } |
| 928 | 928 |
| 929 } // namespace ui | 929 } // namespace ui |
| OLD | NEW |