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

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 nits. only sends gamepad updates if an exo window is in focus. 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 #include "base/memory/weak_ptr.h"
9
10 namespace exo {
11 class Gamepad;
12
13 // Handles events on multiple gamepad
14 class GamepadDelegate {
15 public:
16 // Gives the delegate a chance to clean up when the Gamepad instance is
17 // destroyed.
18 virtual void OnGamepadDestroying(Gamepad* gamepad) = 0;
19
20 // Called when the state of the gamepad has changed.
21 virtual void OnStateChange(bool connected) = 0;
22
23 // Called when the user moved an axis of the gamepad. Valid axes are defined
24 // by the W3C 'standard gamepad' specification.
25 virtual void OnAxis(int axis, double value) = 0;
26
27 // Called when the user pressed or moved a button of the gamepad.
28 // Valid buttons are defined by the W3C 'standard gamepad' specification.
29 virtual void OnButton(int button, bool pressed, double value) = 0;
30
31 // Called after all gamepad information of this frame has been set and the
32 // client should evaluate the updated state.
33 virtual void OnFrame() = 0;
34
35 // Used to obtain a weak pointer to this delegate.
36 virtual base::WeakPtr<GamepadDelegate> GetWeakPtr() = 0;
reveman 2016/06/30 01:19:05 Please handle this in the Gamepad implementation i
denniskempin 2016/06/30 17:08:29 Done. Also no longer needed.
37
38 protected:
39 virtual ~GamepadDelegate() {}
40 };
41
42 } // namespace exo
43
44 #endif // COMPONENTS_EXO_GAMEPAD_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698