Orxonox  0.0.5 Codename: Arcturus
MacInputManager.h
Go to the documentation of this file.
1 /*
2  The zlib/libpng License
3 
4  Copyright (c) 2006 Chris Snyder
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_MacInputManager_H
24 #define OIS_MacInputManager_H
25 
26 #include "OISInputManager.h"
27 #include "OISFactoryCreator.h"
28 #include "mac/MacPrereqs.h"
29 #include <Carbon/Carbon.h>
30 
31 namespace OIS
32 {
33 
35  {
36  public:
38  virtual ~MacInputManager();
39 
40  //InputManager Overrides
42  void _initialize( ParamList &paramList );
43 
44  //FactoryCreator Overrides
47 
49  int totalDevices(Type iType);
50 
52  int freeDevices(Type iType);
53 
55  bool vendorExist(Type iType, const std::string & vendor);
56 
58  Object* createObject(InputManager* creator, Type iType, bool bufferMode, const std::string & vendor = "");
59 
61  void destroyObject(Object* obj);
62 
63  //Internal Items
65  void _setKeyboardUsed(bool used) {keyboardUsed = used; }
66 
68  void _setMouseUsed(bool used) { mouseUsed = used; }
69 
71  EventTargetRef _getEventTarget() {return mEventTargetRef;}
72 
74  WindowRef _getWindow() {return mWindow;}
75 
76  protected:
77  void _parseConfigSettings( ParamList& paramList );
78 
79  void _enumerateDevices();
80 
81  static const std::string iName;
82 
83  // Mac stuff
84  EventTargetRef mEventTargetRef;
85  WindowRef mWindow;
86 
87  // settings
88  bool mHideMouse;
89  bool mUseRepeat;
90 
93 
95  bool mouseUsed;
96 
99  };
100 }
101 #endif
void _initialize(ParamList &paramList)
Definition: MacInputManager.cpp:60
Definition: MacInputManager.h:34
EventTargetRef mEventTargetRef
Definition: MacInputManager.h:84
EventTargetRef _getEventTarget()
methodfor getting the event target
Definition: MacInputManager.h:71
::std::string string
Definition: gtest-port.h:756
bool vendorExist(Type iType, const std::string &vendor)
Definition: MacInputManager.cpp:161
WindowRef mWindow
Definition: MacInputManager.h:85
MacInputManager()
Definition: MacInputManager.cpp:37
DeviceList freeDeviceList()
Definition: MacInputManager.cpp:125
Object * createObject(InputManager *creator, Type iType, bool bufferMode, const std::string &vendor="")
Definition: MacInputManager.cpp:170
MacHIDManager * mHIDManager
HID Manager class handling devices other than keyboard/mouse.
Definition: MacInputManager.h:98
int totalDevices(Type iType)
Definition: MacInputManager.cpp:139
Interface for creating devices - all devices ultimately get enumerated/created via a factory...
Definition: OISFactoryCreator.h:34
Definition: MacHIDManager.h:65
void _setMouseUsed(bool used)
Internal method, used for flaggin mouse as available/unavailable for creation.
Definition: MacInputManager.h:68
void _setKeyboardUsed(bool used)
Internal method, used for flaggin keyboard as available/unavailable for creation. ...
Definition: MacInputManager.h:65
void _parseConfigSettings(ParamList &paramList)
Definition: MacInputManager.cpp:71
The base class of all input types.
Definition: OISObject.h:32
WindowRef _getWindow()
method for getting window
Definition: MacInputManager.h:74
bool mHideMouse
Definition: MacInputManager.h:88
int freeDevices(Type iType)
Definition: MacInputManager.cpp:150
Type
Each Input class has a General Type variable, a form of RTTI.
Definition: OISPrereqs.h:138
void destroyObject(Object *obj)
Definition: MacInputManager.cpp:203
Base Manager class.
Definition: OISInputManager.h:38
static const std::string iName
Definition: MacInputManager.h:81
bool mUseRepeat
Definition: MacInputManager.h:89
std::multimap< Type, std::string > DeviceList
Map of device objects connected and their respective vendors.
Definition: OISPrereqs.h:149
Definition: EventHelpers.h:31
bool mouseUsed
Used to know if we used up mouse.
Definition: MacInputManager.h:95
bool keyboardUsed
Used to know if we used up keyboard.
Definition: MacInputManager.h:92
void _enumerateDevices()
Definition: MacInputManager.cpp:120
std::multimap< std::string, std::string > ParamList
Way to send OS nuetral parameters.. ie OS Window handles, modes, flags.
Definition: OISPrereqs.h:126
virtual ~MacInputManager()
Definition: MacInputManager.cpp:54