/src/ois/includes/mac/MacInputManager.h

https://bitbucket.org/cabalistic/ogredeps/ · C Header · 101 lines · 38 code · 22 blank · 41 comment · 0 complexity · 7eed66b07885869a29588d280031a7b1 MD5 · raw file

  1. /*
  2. The zlib/libpng License
  3. Copyright (c) 2006 Chris Snyder
  4. This software is provided 'as-is', without any express or implied warranty. In no event will
  5. the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose, including commercial
  7. applications, and to alter it and redistribute it freely, subject to the following
  8. restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not claim that
  10. you wrote the original software. If you use this software in a product,
  11. an acknowledgment in the product documentation would be appreciated but is
  12. not required.
  13. 2. Altered source versions must be plainly marked as such, and must not be
  14. misrepresented as being the original software.
  15. 3. This notice may not be removed or altered from any source distribution.
  16. */
  17. #ifndef OIS_MacInputManager_H
  18. #define OIS_MacInputManager_H
  19. #include "OISInputManager.h"
  20. #include "OISFactoryCreator.h"
  21. #include "mac/MacPrereqs.h"
  22. #include <Carbon/Carbon.h>
  23. namespace OIS
  24. {
  25. class MacInputManager : public InputManager, public FactoryCreator
  26. {
  27. public:
  28. MacInputManager();
  29. virtual ~MacInputManager();
  30. //InputManager Overrides
  31. /** @copydoc InputManager::_initialize */
  32. void _initialize( ParamList &paramList );
  33. //FactoryCreator Overrides
  34. /** @copydoc FactoryCreator::deviceList */
  35. DeviceList freeDeviceList();
  36. /** @copydoc FactoryCreator::totalDevices */
  37. int totalDevices(Type iType);
  38. /** @copydoc FactoryCreator::freeDevices */
  39. int freeDevices(Type iType);
  40. /** @copydoc FactoryCreator::vendorExist */
  41. bool vendorExist(Type iType, const std::string & vendor);
  42. /** @copydoc FactoryCreator::createObject */
  43. Object* createObject(InputManager* creator, Type iType, bool bufferMode, const std::string & vendor = "");
  44. /** @copydoc FactoryCreator::destroyObject */
  45. void destroyObject(Object* obj);
  46. //Internal Items
  47. //! Internal method, used for flaggin keyboard as available/unavailable for creation
  48. void _setKeyboardUsed(bool used) {keyboardUsed = used; }
  49. //! Internal method, used for flaggin mouse as available/unavailable for creation
  50. void _setMouseUsed(bool used) { mouseUsed = used; }
  51. //! methodfor getting the event target
  52. EventTargetRef _getEventTarget() {return mEventTargetRef;}
  53. //! method for getting window
  54. WindowRef _getWindow() {return mWindow;}
  55. protected:
  56. void _parseConfigSettings( ParamList& paramList );
  57. void _enumerateDevices();
  58. static const std::string iName;
  59. // Mac stuff
  60. EventTargetRef mEventTargetRef;
  61. WindowRef mWindow;
  62. // settings
  63. bool mHideMouse;
  64. bool mUseRepeat;
  65. //! Used to know if we used up keyboard
  66. bool keyboardUsed;
  67. //! Used to know if we used up mouse
  68. bool mouseUsed;
  69. //! HID Manager class handling devices other than keyboard/mouse
  70. MacHIDManager *mHIDManager;
  71. };
  72. }
  73. #endif