SuperTuxKart
options_screen_input.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2009-2015 Marianne Gagnon
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 
19 #ifndef __HEADER_OPTIONS_SCREEN_INPUT_HPP__
20 #define __HEADER_OPTIONS_SCREEN_INPUT_HPP__
21 
22 #include <string>
23 #include "guiengine/screen.hpp"
24 
25 namespace GUIEngine { class Widget; }
26 class DeviceConfig;
27 namespace irr { namespace gui { class STKModifiedSpriteBank; } namespace video { class IVideoDriver; } }
28 
29 
30 struct Input;
31 
36 class OptionsScreenInput : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<OptionsScreenInput>
37 {
39 
40  void updateInputButtons(DeviceConfig* config);
41  void buildDeviceList();
42 
43  irr::gui::STKModifiedSpriteBank* m_icon_bank;
44 
45  std::map<std::string, float> m_highlights;
46 
47 public:
49 
51  virtual void loadedFromFile();
52 
54  virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
55 
57  virtual void unloaded();
58 
60  virtual void init();
61 
66  void rebuildDeviceList();
67 
69  virtual void filterInput(Input::InputType type,
70  int deviceID,
71  int btnID,
72  int axisDir,
73  int value);
74 
76  virtual void onUpdate(float dt);
77 };
78 
79 #endif
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:31
virtual void unloaded()
implement optional callback from parent class GUIEngine::Screen
Definition: options_screen_input.cpp:293
contains the key bindings information related to one input device
Definition: device_config.hpp:41
Definition: input.hpp:34
virtual void init()
implement callback from parent class GUIEngine::Screen
Definition: options_screen_input.cpp:157
virtual void onUpdate(float dt)
implement callback from parent class GUIEngine::Screen
Definition: options_screen_input.cpp:343
void rebuildDeviceList()
invoke if the list of devices changed after the creation of this screen.
Definition: options_screen_input.cpp:186
Input options screen.
Definition: options_screen_input.hpp:36
Represents a single GUI screen.
Definition: screen.hpp:94
virtual void loadedFromFile()
implement callback from parent class GUIEngine::Screen
Definition: options_screen_input.cpp:59
Declares a class to be a singleton.
Definition: screen.hpp:57
virtual void filterInput(Input::InputType type, int deviceID, int btnID, int axisDir, int value)
implement callback from parent class GUIEngine::Screen
Definition: options_screen_input.cpp:301
virtual void eventCallback(GUIEngine::Widget *widget, const std::string &name, const int playerID)
implement callback from parent class GUIEngine::Screen
Definition: options_screen_input.cpp:206
The nearly-abstract base of all widgets (not fully abstract since a bare Widget can be created for th...
Definition: widget.hpp:138