Orxonox  0.0.5 Codename: Arcturus
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  {
155  AddOn_All = 0, //All Devices
156  AddOn_LIRC = 1, //PC Linux Infrared Remote Control
157  AddOn_WiiMote = 2 //PC WiiMote Support
158  };
159 
167  void enableAddOnFactory(AddOnFactories factory);
168 
169  protected:
174  virtual void _initialize(ParamList &paramList) = 0;
175 
180  InputManager(const std::string& name);
181 
186  virtual ~InputManager();
187 
190 
193 
196 
199 
201  LIRCFactoryCreator *m_lircSupport;
202  WiiMoteFactoryCreator *m_wiiMoteSupport;
203  };
204 }
205 #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:202
FactoryCreatedObject mFactoryObjects
Factory created objects - useful so we can find creator to send destruction request to...
Definition: OISInputManager.h:195
FactoryList mFactories
FactoryCreator list.
Definition: OISInputManager.h:192
::std::string string
Definition: gtest-port.h:756
const std::string mInputSystemName
Name of the input system.
Definition: OISInputManager.h:198
std::map< Object *, FactoryCreator * > FactoryCreatedObject
Map of FactoryCreator created Objects.
Definition: OISPrereqs.h:135
Interface for creating devices - all devices ultimately get enumerated/created via a factory...
Definition: OISFactoryCreator.h:34
std::vector< FactoryCreator * > FactoryList
List of FactoryCreator&#39;s.
Definition: OISPrereqs.h:132
The base class of all input types.
Definition: OISObject.h:32
Type
Each Input class has a General Type variable, a form of RTTI.
Definition: OISPrereqs.h:138
LIRCFactoryCreator * m_lircSupport
Extra factory (not enabled by default)
Definition: OISInputManager.h:201
const std::string m_VersionName
OIS Version name.
Definition: OISInputManager.h:189
Base Manager class.
Definition: OISInputManager.h:38
std::multimap< Type, std::string > DeviceList
Map of device objects connected and their respective vendors.
Definition: OISPrereqs.h:149
Definition: EventHelpers.h:31
std::multimap< std::string, std::string > ParamList
Way to send OS nuetral parameters.. ie OS Window handles, modes, flags.
Definition: OISPrereqs.h:126