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

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev.h

Issue 790153005: ozone: evdev: Add property to identify internal or external devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "ui/events/devices/input_device.h"
11 #include "ui/events/ozone/evdev/event_dispatch_callback.h" 12 #include "ui/events/ozone/evdev/event_dispatch_callback.h"
12 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" 13 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
13 #include "ui/gfx/geometry/size.h" 14 #include "ui/gfx/geometry/size.h"
14 15
15 namespace ui { 16 namespace ui {
16 17
17 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev 18 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev
18 : public base::MessagePumpLibevent::Watcher { 19 : public base::MessagePumpLibevent::Watcher {
19 public: 20 public:
20 EventConverterEvdev(int fd, const base::FilePath& path, int id); 21 EventConverterEvdev(int fd,
22 const base::FilePath& path,
23 int id,
24 InputDeviceType type);
21 ~EventConverterEvdev() override; 25 ~EventConverterEvdev() override;
22 26
23 int id() const { return id_; } 27 int id() const { return id_; }
24 28
25 const base::FilePath& path() const { return path_; } 29 const base::FilePath& path() const { return path_; }
26 30
31 InputDeviceType type() const { return type_; }
32
27 // Start reading events. 33 // Start reading events.
28 void Start(); 34 void Start();
29 35
30 // Stop reading events. 36 // Stop reading events.
31 void Stop(); 37 void Stop();
32 38
33 // Returns true of the converter is used for a touchscreen device. 39 // Returns true of the converter is used for a touchscreen device.
34 virtual bool HasTouchscreen() const; 40 virtual bool HasTouchscreen() const;
35 41
36 // Returns the size of the touchscreen device if the converter is used for a 42 // Returns the size of the touchscreen device if the converter is used for a
37 // touchscreen device. 43 // touchscreen device.
38 virtual gfx::Size GetTouchscreenSize() const; 44 virtual gfx::Size GetTouchscreenSize() const;
39 45
40 // Returns true if the converter is used with an internal device.
41 virtual bool IsInternal() const;
42
43 protected: 46 protected:
44 // base::MessagePumpLibevent::Watcher: 47 // base::MessagePumpLibevent::Watcher:
45 void OnFileCanWriteWithoutBlocking(int fd) override; 48 void OnFileCanWriteWithoutBlocking(int fd) override;
46 49
47 // File descriptor to read. 50 // File descriptor to read.
48 int fd_; 51 int fd_;
49 52
50 // Path to input device. 53 // Path to input device.
51 base::FilePath path_; 54 base::FilePath path_;
52 55
53 // Uniquely identifies an event converter. 56 // Uniquely identifies an event converter.
54 int id_; 57 int id_;
55 58
59 // Type (internal or external).
60 InputDeviceType type_;
61
56 // Controller for watching the input fd. 62 // Controller for watching the input fd.
57 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 63 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
58 64
59 private: 65 private:
60 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev); 66 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
61 }; 67 };
62 68
63 } // namespace ui 69 } // namespace ui
64 70
65 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ 71 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698