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

Side by Side Diff: components/exo/gamepad_delegate.h

Issue 2076013002: exo: Implement wayland gamepad support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@serv
Patch Set: fixed polling thread. Created 4 years, 5 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_EXO_GAMEPAD_DELEGATE_H_
6 #define COMPONENTS_EXO_GAMEPAD_DELEGATE_H_
7
8 namespace exo {
9 class Gamepad;
10
11 // Handles events on multiple gamepad
12 class GamepadDelegate {
13 public:
14 // Gives the delegate a chance to clean up when the Gamepad instance is
15 // destroyed.
16 virtual void OnGamepadDestroying(Gamepad* gamepad) = 0;
17
18 // Called when the state of the gamepad has changed.
19 virtual void OnStateChange(bool connected) = 0;
20
21 // Called when the user moved an axis of the gamepad. Valid axes are defined
22 // by the W3C 'standard gamepad' specification.
23 virtual void OnAxis(int axis, double value) = 0;
24
25 // Called when the user pressed or moved a button of the gamepad.
26 // Valid buttons are defined by the W3C 'standard gamepad' specification.
27 virtual void OnButton(int button, bool pressed, double value) = 0;
28
29 // Called after all gamepad information of this frame has been set and the
30 // client should evaluate the updated state.
31 virtual void OnFrame() = 0;
32
33 protected:
34 virtual ~GamepadDelegate() {}
35 };
36
37 } // namespace exo
38
39 #endif // COMPONENTS_EXO_GAMEPAD_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698