OIS  1.5
Object-oriented Input System
OISInputManager.h
Go to the documentation of this file.
1 /*
2 The zlib/libpng License
3 
4 Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
5 
6 This software is provided 'as-is', without any express or implied warranty. In no event will
7 the authors be held liable for any damages arising from the use of this software.
8 
9 Permission is granted to anyone to use this software for any purpose, including commercial
10 applications, and to alter it and redistribute it freely, subject to the following
11 restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not claim that
14  you wrote the original software. If you use this software in a product,
15  an acknowledgment in the product documentation would be appreciated but is
16  not required.
17 
18  2. Altered source versions must be plainly marked as such, and must not be
19  misrepresented as being the original software.
20 
21  3. This notice may not be removed or altered from any source distribution.
22 */
23 #ifndef OIS_InputManager_H
24 #define OIS_InputManager_H
25 
26 #include "OISPrereqs.h"
27 
28 namespace OIS
29 {
30  //Forward declare a couple of classes we might use later
31  class LIRCFactoryCreator;
32  class WiiMoteFactoryCreator;
33 
39  {
40  public:
47  static unsigned int getVersionNumber();
48 
55  const std::string& getVersionName();
56 
65  static InputManager* createInputSystem(std::size_t winHandle);
66 
76  static InputManager* createInputSystem(ParamList& paramList);
77 
84  static void destroyInputSystem(InputManager* manager);
85 
89  const std::string& inputSystemName();
90 
97  int getNumberOfDevices(Type iType);
98 
105  DeviceList listFreeDevices();
106 
112  Object* createInputObject(Type iType, bool bufferMode, const std::string& vendor = "");
113 
117  void destroyInputObject(Object* obj);
118 
140  void addFactoryCreator(FactoryCreator* factory);
141 
150  void removeFactoryCreator(FactoryCreator* factory);
151 
154  AddOn_All = 0, //All Devices
155  AddOn_LIRC = 1, //PC Linux Infrared Remote Control
156  AddOn_WiiMote = 2 //PC WiiMote Support
157  };
158 
166  void enableAddOnFactory(AddOnFactories factory);
167 
168  protected:
173  virtual void _initialize(ParamList& paramList) = 0;
174 
179  explicit InputManager(const std::string& name);
180 
185  virtual ~InputManager();
186 
188  const std::string m_VersionName;
189 
192 
195 
197  const std::string mInputSystemName;
198 
200  LIRCFactoryCreator* m_lircSupport;
201  WiiMoteFactoryCreator* m_wiiMoteSupport;
202 
203  private:
204  // Prevent copying.
205  InputManager(const InputManager&);
206  InputManager& operator=(const InputManager&);
207  };
208 }
209 #endif
#define _OISExport
Definition: OISPrereqs.h:40
AddOnFactories
All generic devices OIS supports internally (if they are compiled in)
Definition: OISInputManager.h:153
WiiMoteFactoryCreator * m_wiiMoteSupport
Definition: OISInputManager.h:201
FactoryCreatedObject mFactoryObjects
Factory created objects - useful so we can find creator to send destruction request to...
Definition: OISInputManager.h:194
FactoryList mFactories
FactoryCreator list.
Definition: OISInputManager.h:191
const std::string mInputSystemName
Name of the input system.
Definition: OISInputManager.h:197
std::map< Object *, FactoryCreator * > FactoryCreatedObject
Map of FactoryCreator created Objects.
Definition: OISPrereqs.h:156
Definition: OISFactoryCreator.h:34
std::vector< FactoryCreator * > FactoryList
List of FactoryCreator&#39;s.
Definition: OISPrereqs.h:153
Definition: OISObject.h:32
Type
Each Input class has a General Type variable, a form of RTTI.
Definition: OISPrereqs.h:159
LIRCFactoryCreator * m_lircSupport
Extra factory (not enabled by default)
Definition: OISInputManager.h:200
const std::string m_VersionName
OIS Version name.
Definition: OISInputManager.h:188
Definition: OISInputManager.h:38
std::multimap< Type, std::string > DeviceList
Map of device objects connected and their respective vendors.
Definition: OISPrereqs.h:170
Definition: OISEffect.h:28
std::multimap< std::string, std::string > ParamList
Way to send OS nuetral parameters.. ie OS Window handles, modes, flags.
Definition: OISPrereqs.h:147