| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cr
os.h" | 5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cr
os.h" |
| 6 | 6 |
| 7 #include <gestures/gestures.h> | 7 #include <gestures/gestures.h> |
| 8 #include <libevdev/libevdev.h> | 8 #include <libevdev/libevdev.h> |
| 9 | 9 |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 GestureInterpreterLibevdevCros::~GestureInterpreterLibevdevCros() { | 90 GestureInterpreterLibevdevCros::~GestureInterpreterLibevdevCros() { |
| 91 if (interpreter_) { | 91 if (interpreter_) { |
| 92 DeleteGestureInterpreter(interpreter_); | 92 DeleteGestureInterpreter(interpreter_); |
| 93 interpreter_ = NULL; | 93 interpreter_ = NULL; |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 void GestureInterpreterLibevdevCros::OnLibEvdevCrosOpen( | 97 void GestureInterpreterLibevdevCros::OnLibEvdevCrosOpen( |
| 98 Evdev* evdev, | 98 Evdev* evdev, |
| 99 EventStateRec* evstate) { | 99 EventStateRec* evstate) { |
| 100 CHECK(evdev->info.is_monotonic) << "libevdev must use monotonic timestamps"; | 100 DCHECK(evdev->info.is_monotonic) << "libevdev must use monotonic timestamps"; |
| 101 VLOG(9) << "HACK DO NOT REMOVE OR LINK WILL FAIL" << (void*)gestures_log; | 101 VLOG(9) << "HACK DO NOT REMOVE OR LINK WILL FAIL" << (void*)gestures_log; |
| 102 | 102 |
| 103 HardwareProperties hwprops = GestureHardwareProperties(evdev); | 103 HardwareProperties hwprops = GestureHardwareProperties(evdev); |
| 104 GestureInterpreterDeviceClass devclass = GestureDeviceClass(evdev); | 104 GestureInterpreterDeviceClass devclass = GestureDeviceClass(evdev); |
| 105 | 105 |
| 106 // Create & initialize GestureInterpreter. | 106 // Create & initialize GestureInterpreter. |
| 107 CHECK(!interpreter_); | 107 DCHECK(!interpreter_); |
| 108 interpreter_ = NewGestureInterpreter(); | 108 interpreter_ = NewGestureInterpreter(); |
| 109 GestureInterpreterInitialize(interpreter_, devclass); | 109 GestureInterpreterInitialize(interpreter_, devclass); |
| 110 GestureInterpreterSetHardwareProperties(interpreter_, &hwprops); | 110 GestureInterpreterSetHardwareProperties(interpreter_, &hwprops); |
| 111 GestureInterpreterSetTimerProvider( | 111 GestureInterpreterSetTimerProvider( |
| 112 interpreter_, | 112 interpreter_, |
| 113 const_cast<GesturesTimerProvider*>(&kGestureTimerProvider), | 113 const_cast<GesturesTimerProvider*>(&kGestureTimerProvider), |
| 114 this); | 114 this); |
| 115 GestureInterpreterSetCallback(interpreter_, OnGestureReadyHelper, this); | 115 GestureInterpreterSetCallback(interpreter_, OnGestureReadyHelper, this); |
| 116 } | 116 } |
| 117 | 117 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 modifiers_->UpdateModifier(modifier, down); | 393 modifiers_->UpdateModifier(modifier, down); |
| 394 MouseEvent event(type, loc, loc, modifiers_->GetModifierFlags() | flag, flag); | 394 MouseEvent event(type, loc, loc, modifiers_->GetModifierFlags() | flag, flag); |
| 395 | 395 |
| 396 // This hack is necessary to trigger setting the repeat count. | 396 // This hack is necessary to trigger setting the repeat count. |
| 397 // TODO(spang): Fix it. | 397 // TODO(spang): Fix it. |
| 398 MouseEvent event2(&event); | 398 MouseEvent event2(&event); |
| 399 Dispatch(&event2); | 399 Dispatch(&event2); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace ui | 402 } // namespace ui |
| OLD | NEW |