| 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/base/events.h" | 5 #include "ui/base/events.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.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 <string.h> | 10 #include <string.h> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/message_pump_x.h" | 14 #include "base/message_pump_aurax11.h" |
| 15 #include "ui/base/keycodes/keyboard_code_conversion_x.h" | 15 #include "ui/base/keycodes/keyboard_code_conversion_x.h" |
| 16 #include "ui/base/ui_base_switches.h" | 16 #include "ui/base/ui_base_switches.h" |
| 17 #include "ui/base/touch/touch_factory.h" | 17 #include "ui/base/touch/touch_factory.h" |
| 18 #include "ui/base/x/valuators.h" | 18 #include "ui/base/x/valuators.h" |
| 19 #include "ui/base/x/x11_util.h" | 19 #include "ui/base/x/x11_util.h" |
| 20 #include "ui/gfx/point.h" | 20 #include "ui/gfx/point.h" |
| 21 #include "ui/gfx/monitor.h" | 21 #include "ui/gfx/monitor.h" |
| 22 #include "ui/gfx/rect.h" | 22 #include "ui/gfx/rect.h" |
| 23 #include "ui/gfx/screen.h" | 23 #include "ui/gfx/screen.h" |
| 24 | 24 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 float GetTouchParamFromXEvent(XEvent* xev, | 556 float GetTouchParamFromXEvent(XEvent* xev, |
| 557 ui::ValuatorTracker::Valuator val, | 557 ui::ValuatorTracker::Valuator val, |
| 558 float default_value) { | 558 float default_value) { |
| 559 ui::ValuatorTracker::GetInstance()->ExtractValuator( | 559 ui::ValuatorTracker::GetInstance()->ExtractValuator( |
| 560 *xev, val, &default_value); | 560 *xev, val, &default_value); |
| 561 return default_value; | 561 return default_value; |
| 562 } | 562 } |
| 563 | 563 |
| 564 Atom GetNoopEventAtom() { | 564 Atom GetNoopEventAtom() { |
| 565 return XInternAtom( | 565 return XInternAtom( |
| 566 base::MessagePumpX::GetDefaultXDisplay(), | 566 base::MessagePumpAuraX11::GetDefaultXDisplay(), |
| 567 "noop", False); | 567 "noop", False); |
| 568 } | 568 } |
| 569 | 569 |
| 570 #if defined(USE_XI2_MT) | 570 #if defined(USE_XI2_MT) |
| 571 gfx::Point CalibrateTouchCoordinates( | 571 gfx::Point CalibrateTouchCoordinates( |
| 572 const XIDeviceEvent* xievent) { | 572 const XIDeviceEvent* xievent) { |
| 573 int x = static_cast<int>(xievent->event_x); | 573 int x = static_cast<int>(xievent->event_x); |
| 574 int y = static_cast<int>(xievent->event_y); | 574 int y = static_cast<int>(xievent->event_y); |
| 575 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 575 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 576 switches::kEnableTouchCalibration)) | 576 switches::kEnableTouchCalibration)) |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 noop->xclient.format = 8; | 979 noop->xclient.format = 8; |
| 980 DCHECK(!noop->xclient.display); | 980 DCHECK(!noop->xclient.display); |
| 981 } | 981 } |
| 982 // Make sure we use atom from current xdisplay, which may | 982 // Make sure we use atom from current xdisplay, which may |
| 983 // change during the test. | 983 // change during the test. |
| 984 noop->xclient.message_type = GetNoopEventAtom(); | 984 noop->xclient.message_type = GetNoopEventAtom(); |
| 985 return noop; | 985 return noop; |
| 986 } | 986 } |
| 987 | 987 |
| 988 } // namespace ui | 988 } // namespace ui |
| OLD | NEW |