Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: ui/events/ozone/evdev/event_factory_evdev.cc

Issue 721823002: ozone: Interpret absolute events for graphics tablets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@o
Patch Set: Add missing initialisers for class members on TabletEventConverterEvdev Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/event_factory_evdev.h" 5 #include "ui/events/ozone/evdev/event_factory_evdev.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <linux/input.h> 8 #include <linux/input.h>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/stl_util.h" 11 #include "base/stl_util.h"
12 #include "base/task_runner.h" 12 #include "base/task_runner.h"
13 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
14 #include "base/threading/worker_pool.h" 14 #include "base/threading/worker_pool.h"
15 #include "ui/events/devices/device_data_manager.h" 15 #include "ui/events/devices/device_data_manager.h"
16 #include "ui/events/ozone/device/device_event.h" 16 #include "ui/events/ozone/device/device_event.h"
17 #include "ui/events/ozone/device/device_manager.h" 17 #include "ui/events/ozone/device/device_manager.h"
18 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 18 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
19 #include "ui/events/ozone/evdev/event_converter_evdev_impl.h" 19 #include "ui/events/ozone/evdev/event_converter_evdev_impl.h"
20 #include "ui/events/ozone/evdev/event_device_info.h" 20 #include "ui/events/ozone/evdev/event_device_info.h"
21 #include "ui/events/ozone/evdev/tablet_event_converter_evdev.h"
21 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h" 22 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h"
22 23
23 #if defined(USE_EVDEV_GESTURES) 24 #if defined(USE_EVDEV_GESTURES)
24 #include "ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h" 25 #include "ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h"
25 #include "ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cr os.h" 26 #include "ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cr os.h"
26 #include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h" 27 #include "ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.h"
27 #endif 28 #endif
28 29
29 #ifndef EVIOCSCLOCKID 30 #ifndef EVIOCSCLOCKID
30 #define EVIOCSCLOCKID _IOW('E', 0xa0, int) 31 #define EVIOCSCLOCKID _IOW('E', 0xa0, int)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #endif 91 #endif
91 92
92 // Touchscreen: use TouchEventConverterEvdev. 93 // Touchscreen: use TouchEventConverterEvdev.
93 if (devinfo.HasMTAbsXY()) { 94 if (devinfo.HasMTAbsXY()) {
94 scoped_ptr<TouchEventConverterEvdev> converter(new TouchEventConverterEvdev( 95 scoped_ptr<TouchEventConverterEvdev> converter(new TouchEventConverterEvdev(
95 fd, params.path, params.id, params.dispatch_callback)); 96 fd, params.path, params.id, params.dispatch_callback));
96 converter->Initialize(devinfo); 97 converter->Initialize(devinfo);
97 return converter.Pass(); 98 return converter.Pass();
98 } 99 }
99 100
101 // Graphics tablet
102 if (devinfo.HasAbsXY())
103 return make_scoped_ptr<EventConverterEvdev>(new TabletEventConverterEvdev(
104 fd, params.path, params.id, params.modifiers, params.cursor, devinfo,
105 params.dispatch_callback));
106
100 // Everything else: use EventConverterEvdevImpl. 107 // Everything else: use EventConverterEvdevImpl.
101 return make_scoped_ptr<EventConverterEvdevImpl>( 108 return make_scoped_ptr<EventConverterEvdevImpl>(
102 new EventConverterEvdevImpl(fd, 109 new EventConverterEvdevImpl(fd,
103 params.path, 110 params.path,
104 params.id, 111 params.id,
105 params.modifiers, 112 params.modifiers,
106 params.cursor, 113 params.cursor,
107 params.keyboard, 114 params.keyboard,
108 params.dispatch_callback)); 115 params.dispatch_callback));
109 } 116 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 324 }
318 325
319 observer->OnTouchscreenDevicesUpdated(touchscreens); 326 observer->OnTouchscreenDevicesUpdated(touchscreens);
320 } 327 }
321 328
322 int EventFactoryEvdev::NextDeviceId() { 329 int EventFactoryEvdev::NextDeviceId() {
323 return ++last_device_id_; 330 return ++last_device_id_;
324 } 331 }
325 332
326 } // namespace ui 333 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc ('k') | ui/events/ozone/evdev/tablet_event_converter_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698