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

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

Issue 2805793002: ozone: evdev: Add gamepad support (Closed)
Patch Set: Created 3 years, 8 months 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_DEVICE_EVENT_DISPATCHER_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_
6 #define UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ 6 #define UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 ~TouchEventParams(); 143 ~TouchEventParams();
144 144
145 int device_id; 145 int device_id;
146 int slot; 146 int slot;
147 EventType type; 147 EventType type;
148 gfx::PointF location; 148 gfx::PointF location;
149 PointerDetails pointer_details; 149 PointerDetails pointer_details;
150 base::TimeTicks timestamp; 150 base::TimeTicks timestamp;
151 }; 151 };
152 152
153 struct EVENTS_OZONE_EVDEV_EXPORT GamepadEventParams {
154 GamepadEventParams(int device_id,
155 EventType type,
156 double value,
157 uint16_t code,
158 const base::TimeTicks timestamp);
159 int device_id;
160 EventType type;
161 double value;
162 uint16_t code;
163 base::TimeTicks timestamp;
164 };
165
153 // Interface used by device objects for event dispatch. 166 // Interface used by device objects for event dispatch.
154 class EVENTS_OZONE_EVDEV_EXPORT DeviceEventDispatcherEvdev { 167 class EVENTS_OZONE_EVDEV_EXPORT DeviceEventDispatcherEvdev {
155 public: 168 public:
156 DeviceEventDispatcherEvdev() {} 169 DeviceEventDispatcherEvdev() {}
157 virtual ~DeviceEventDispatcherEvdev() {} 170 virtual ~DeviceEventDispatcherEvdev() {}
158 171
159 // User input events. 172 // User input events.
173 virtual void DispatchGamepadEvent(const GamepadEventParams& params) = 0;
160 virtual void DispatchKeyEvent(const KeyEventParams& params) = 0; 174 virtual void DispatchKeyEvent(const KeyEventParams& params) = 0;
161 virtual void DispatchMouseMoveEvent(const MouseMoveEventParams& params) = 0; 175 virtual void DispatchMouseMoveEvent(const MouseMoveEventParams& params) = 0;
162 virtual void DispatchMouseButtonEvent( 176 virtual void DispatchMouseButtonEvent(
163 const MouseButtonEventParams& params) = 0; 177 const MouseButtonEventParams& params) = 0;
164 virtual void DispatchMouseWheelEvent(const MouseWheelEventParams& params) = 0; 178 virtual void DispatchMouseWheelEvent(const MouseWheelEventParams& params) = 0;
165 virtual void DispatchPinchEvent(const PinchEventParams& params) = 0; 179 virtual void DispatchPinchEvent(const PinchEventParams& params) = 0;
166 virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0; 180 virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0;
167 virtual void DispatchTouchEvent(const TouchEventParams& params) = 0; 181 virtual void DispatchTouchEvent(const TouchEventParams& params) = 0;
168 182
169 // Device lifecycle events. 183 // Device lifecycle events.
184 virtual void DispatchGamepadDevicesUpdated(
185 const std::vector<InputDevice>& devices) = 0;
170 virtual void DispatchKeyboardDevicesUpdated( 186 virtual void DispatchKeyboardDevicesUpdated(
171 const std::vector<InputDevice>& devices) = 0; 187 const std::vector<InputDevice>& devices) = 0;
172 virtual void DispatchTouchscreenDevicesUpdated( 188 virtual void DispatchTouchscreenDevicesUpdated(
173 const std::vector<TouchscreenDevice>& devices) = 0; 189 const std::vector<TouchscreenDevice>& devices) = 0;
174 virtual void DispatchMouseDevicesUpdated( 190 virtual void DispatchMouseDevicesUpdated(
175 const std::vector<InputDevice>& devices) = 0; 191 const std::vector<InputDevice>& devices) = 0;
176 virtual void DispatchTouchpadDevicesUpdated( 192 virtual void DispatchTouchpadDevicesUpdated(
177 const std::vector<InputDevice>& devices) = 0; 193 const std::vector<InputDevice>& devices) = 0;
178 virtual void DispatchDeviceListsComplete() = 0; 194 virtual void DispatchDeviceListsComplete() = 0;
179 virtual void DispatchStylusStateChanged(StylusState stylus_state) = 0; 195 virtual void DispatchStylusStateChanged(StylusState stylus_state) = 0;
180 }; 196 };
181 197
182 } // namespace ui 198 } // namespace ui
183 199
184 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ 200 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698