PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ois/includes/mac/MacMouse.h

https://bitbucket.org/cabalistic/ogredeps/
C++ Header | 74 lines | 31 code | 16 blank | 27 comment | 0 complexity | ba394be60522be0396d496012a7106da MD5 | raw 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
24#ifndef OIS_MacMouse_H
25#define OIS_MacMouse_H
26
27#include "OISMouse.h"
28#include "mac/MacHelpers.h"
29#include "mac/MacPrereqs.h"
30
31#include <Carbon/Carbon.h>
32
33namespace OIS
34{
35	class MacMouse : public Mouse
36    {
37	public:
38		MacMouse( InputManager* creator, bool buffered );
39		virtual ~MacMouse();
40		
41		/** @copydoc Object::setBuffered */
42		virtual void setBuffered(bool buffered);
43
44		/** @copydoc Object::capture */
45		virtual void capture();
46
47		/** @copydoc Object::queryInterface */
48		virtual Interface* queryInterface(Interface::IType type) {return 0;}
49
50		/** @copydoc Object::_initialize */
51		virtual void _initialize();
52        
53	public:
54        void _mouseCallback( EventRef theEvent );
55
56	protected:
57		static OSStatus WindowFocusChanged(EventHandlerCallRef nextHandler, EventRef event, void* macMouse);
58        
59        // "universal procedure pointers" - required reference for callbacks
60		EventHandlerUPP mouseUPP;
61		EventHandlerRef mouseEventRef;
62		
63		EventHandlerUPP mWindowFocusListener;
64		EventHandlerRef mWindowFocusHandler;
65		
66		bool mNeedsToRegainFocus;
67		bool mMouseWarped;
68		
69		MouseState mTempState;
70	};
71}
72
73
74#endif // OIS_MacMouse_H