MacMouse.h 1.09 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef OIS_MacMouse_H
#define OIS_MacMouse_H

#include "OISMouse.h"
#include "mac/MacHelpers.h"
#include "mac/MacPrereqs.h"

#include <Carbon/Carbon.h>

namespace OIS
{
	class MacMouse : public Mouse
    {
	public:
		MacMouse( InputManager* creator, bool buffered );
		virtual ~MacMouse();
Ben Hymers's avatar
Ben Hymers committed
17

18
19
20
21
22
23
24
25
26
27
28
		/** @copydoc Object::setBuffered */
		virtual void setBuffered(bool buffered);

		/** @copydoc Object::capture */
		virtual void capture();

		/** @copydoc Object::queryInterface */
		virtual Interface* queryInterface(Interface::IType type) {return 0;}

		/** @copydoc Object::_initialize */
		virtual void _initialize();
Ben Hymers's avatar
Ben Hymers committed
29

30
31
32
33
34
	public:
        void _mouseCallback( EventRef theEvent );

	protected:
		static OSStatus WindowFocusChanged(EventHandlerCallRef nextHandler, EventRef event, void* macMouse);
Ben Hymers's avatar
Ben Hymers committed
35

36
37
38
        // "universal procedure pointers" - required reference for callbacks
		EventHandlerUPP mouseUPP;
		EventHandlerRef mouseEventRef;
Ben Hymers's avatar
Ben Hymers committed
39

40
41
		EventHandlerUPP mWindowFocusListener;
		EventHandlerRef mWindowFocusHandler;
Ben Hymers's avatar
Ben Hymers committed
42

43
44
		bool mNeedsToRegainFocus;
		bool mMouseWarped;
Ben Hymers's avatar
Ben Hymers committed
45

46
47
48
49
50
51
		MouseState mTempState;
	};
}


#endif // OIS_MacMouse_H