| Index: ui/events/ozone/evdev/tablet_event_converter_evdev.h
|
| diff --git a/ui/events/ozone/evdev/event_converter_evdev_impl.h b/ui/events/ozone/evdev/tablet_event_converter_evdev.h
|
| similarity index 54%
|
| copy from ui/events/ozone/evdev/event_converter_evdev_impl.h
|
| copy to ui/events/ozone/evdev/tablet_event_converter_evdev.h
|
| index d0eab9fd43e589793c383e5e201c04affba8622e..4576c0c2ad6d53eea30591ea07d486be3ea37492 100644
|
| --- a/ui/events/ozone/evdev/event_converter_evdev_impl.h
|
| +++ b/ui/events/ozone/evdev/tablet_event_converter_evdev.h
|
| @@ -2,33 +2,33 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
|
| -#define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
|
| +#ifndef UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_
|
| +#define UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_
|
|
|
| #include "base/files/file_path.h"
|
| #include "base/message_loop/message_pump_libevent.h"
|
| #include "ui/events/event.h"
|
| #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
|
| #include "ui/events/ozone/evdev/event_converter_evdev.h"
|
| +#include "ui/events/ozone/evdev/event_device_info.h"
|
| #include "ui/events/ozone/evdev/event_modifiers_evdev.h"
|
| #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
|
| -#include "ui/events/ozone/evdev/keyboard_evdev.h"
|
|
|
| struct input_event;
|
|
|
| namespace ui {
|
|
|
| -class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdevImpl
|
| +class EVENTS_OZONE_EVDEV_EXPORT TabletEventConverterEvdev
|
| : public EventConverterEvdev {
|
| public:
|
| - EventConverterEvdevImpl(int fd,
|
| - base::FilePath path,
|
| - int id,
|
| - EventModifiersEvdev* modifiers,
|
| - CursorDelegateEvdev* cursor,
|
| - KeyboardEvdev* keyboard,
|
| - const EventDispatchCallback& callback);
|
| - ~EventConverterEvdevImpl() override;
|
| + TabletEventConverterEvdev(int fd,
|
| + base::FilePath path,
|
| + int id,
|
| + EventModifiersEvdev* modifiers,
|
| + CursorDelegateEvdev* cursor,
|
| + const EventDeviceInfo& info,
|
| + const EventDispatchCallback& callback);
|
| + virtual ~TabletEventConverterEvdev();
|
|
|
| // EventConverterEvdev:
|
| void OnFileCanReadWithoutBlocking(int fd) override;
|
| @@ -36,41 +36,44 @@ class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdevImpl
|
| void ProcessEvents(const struct input_event* inputs, int count);
|
|
|
| private:
|
| + friend class MockTabletEventConverterEvdev;
|
| void ConvertKeyEvent(const input_event& input);
|
| -
|
| - void ConvertMouseMoveEvent(const input_event& input);
|
| -
|
| + void ConvertAbsEvent(const input_event& input);
|
| void DispatchMouseButton(const input_event& input);
|
| + void UpdateCursor();
|
|
|
| // Flush events delimited by EV_SYN. This is useful for handling
|
| // non-axis-aligned movement properly.
|
| void FlushEvents();
|
|
|
| - // Save x-axis events of relative devices to be flushed at EV_SYN time.
|
| - int x_offset_;
|
| -
|
| - // Save y-axis events of relative devices to be flushed at EV_SYN time.
|
| - int y_offset_;
|
| -
|
| // Controller for watching the input fd.
|
| base::MessagePumpLibevent::FileDescriptorWatcher controller_;
|
|
|
| // Shared cursor state.
|
| CursorDelegateEvdev* cursor_;
|
|
|
| - // Shared keyboard state.
|
| - KeyboardEvdev* keyboard_;
|
| -
|
| // Modifier key state (shift, ctrl, etc).
|
| EventModifiersEvdev* modifiers_;
|
|
|
| // Callback for dispatching events.
|
| EventDispatchCallback callback_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(EventConverterEvdevImpl);
|
| + int y_abs_location_;
|
| + int x_abs_location_;
|
| + int x_abs_min_;
|
| + int y_abs_min_;
|
| + int x_abs_range_;
|
| + int y_abs_range_;
|
| +
|
| + // BTN_TOOL_ code for the active device
|
| + int stylus_;
|
| +
|
| + // Whether we need to move the cursor
|
| + bool abs_value_dirty_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TabletEventConverterEvdev);
|
| };
|
|
|
| } // namespace ui
|
|
|
| -#endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_IMPL_H_
|
| -
|
| +#endif // UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_
|
|
|