| 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 <string.h> | 7 #include <string.h> |
| 8 #include <X11/extensions/XInput.h> | 8 #include <X11/extensions/XInput.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 double GetTouchParamFromXEvent(XEvent* xev, | 254 double GetTouchParamFromXEvent(XEvent* xev, |
| 255 ui::DeviceDataManager::DataType val, | 255 ui::DeviceDataManager::DataType val, |
| 256 double default_value) { | 256 double default_value) { |
| 257 ui::DeviceDataManager::GetInstance()->GetEventData( | 257 ui::DeviceDataManager::GetInstance()->GetEventData( |
| 258 *xev, val, &default_value); | 258 *xev, val, &default_value); |
| 259 return default_value; | 259 return default_value; |
| 260 } | 260 } |
| 261 | 261 |
| 262 Atom GetNoopEventAtom() { | 262 Atom GetNoopEventAtom() { |
| 263 return XInternAtom(ui::GetXDisplay(), "noop", False); | 263 return XInternAtom(gfx::GetXDisplay(), "noop", False); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace | 266 } // namespace |
| 267 | 267 |
| 268 namespace ui { | 268 namespace ui { |
| 269 | 269 |
| 270 void UpdateDeviceList() { | 270 void UpdateDeviceList() { |
| 271 Display* display = GetXDisplay(); | 271 XDisplay* display = gfx::GetXDisplay(); |
| 272 DeviceListCacheX::GetInstance()->UpdateDeviceList(display); | 272 DeviceListCacheX::GetInstance()->UpdateDeviceList(display); |
| 273 TouchFactory::GetInstance()->UpdateDeviceList(display); | 273 TouchFactory::GetInstance()->UpdateDeviceList(display); |
| 274 DeviceDataManager::GetInstance()->UpdateDeviceList(display); | 274 DeviceDataManager::GetInstance()->UpdateDeviceList(display); |
| 275 } | 275 } |
| 276 | 276 |
| 277 EventType EventTypeFromNative(const base::NativeEvent& native_event) { | 277 EventType EventTypeFromNative(const base::NativeEvent& native_event) { |
| 278 switch (native_event->type) { | 278 switch (native_event->type) { |
| 279 case KeyPress: | 279 case KeyPress: |
| 280 return ET_KEY_PRESSED; | 280 return ET_KEY_PRESSED; |
| 281 case KeyRelease: | 281 case KeyRelease: |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 noop->xclient.format = 8; | 746 noop->xclient.format = 8; |
| 747 DCHECK(!noop->xclient.display); | 747 DCHECK(!noop->xclient.display); |
| 748 } | 748 } |
| 749 // Make sure we use atom from current xdisplay, which may | 749 // Make sure we use atom from current xdisplay, which may |
| 750 // change during the test. | 750 // change during the test. |
| 751 noop->xclient.message_type = GetNoopEventAtom(); | 751 noop->xclient.message_type = GetNoopEventAtom(); |
| 752 return noop; | 752 return noop; |
| 753 } | 753 } |
| 754 | 754 |
| 755 } // namespace ui | 755 } // namespace ui |
| OLD | NEW |