~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Common/Input/Win32/InputManager.h

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*!
2
 
        @file
3
 
        @author         Albert Semenov
4
 
        @date           09/2009
5
 
*/
6
 
 
7
 
#ifndef __INPUT_MANAGER_H__
8
 
#define __INPUT_MANAGER_H__
9
 
 
10
 
#include <MyGUI.h>
11
 
#include <windows.h>
12
 
 
13
 
namespace input
14
 
{
15
 
 
16
 
        class InputManager
17
 
        {
18
 
        public:
19
 
                InputManager();
20
 
                virtual ~InputManager();
21
 
 
22
 
                void createInput(size_t _handle);
23
 
                void destroyInput();
24
 
                void captureInput();
25
 
                void setInputViewSize(int _width, int _height);
26
 
 
27
 
                virtual void injectMouseMove(int _absx, int _absy, int _absz) { }
28
 
                virtual void injectMousePress(int _absx, int _absy, MyGUI::MouseButton _id) { }
29
 
                virtual void injectMouseRelease(int _absx, int _absy, MyGUI::MouseButton _id) { }
30
 
                virtual void injectKeyPress(MyGUI::KeyCode _key, MyGUI::Char _text) { }
31
 
                virtual void injectKeyRelease(MyGUI::KeyCode _key) { }
32
 
 
33
 
                virtual void onFileDrop(const std::wstring& _filename) { }
34
 
                virtual bool onWinodwClose(size_t _handle) { return true; }
35
 
 
36
 
                void setMousePosition(int _x, int _y);
37
 
                void updateCursorPosition();
38
 
 
39
 
        private:
40
 
                static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
41
 
 
42
 
                void frameEvent(float _time);
43
 
                void computeMouseMove();
44
 
 
45
 
                void mouseMove(int _absx, int _absy, int _absz);
46
 
                void mousePress(int _absx, int _absy, MyGUI::MouseButton _id);
47
 
                void mouseRelease(int _absx, int _absy, MyGUI::MouseButton _id);
48
 
 
49
 
        private:
50
 
                static InputManager* msInputManager;
51
 
                HWND mHwnd;
52
 
                static LRESULT msOldWindowProc;
53
 
                int mWidth;
54
 
                int mHeight;
55
 
                static bool msSkipMove;
56
 
                int mMouseX;
57
 
                int mMouseY;
58
 
                int mMouseZ;
59
 
                bool mMouseMove;
60
 
        };
61
 
 
62
 
} // namespace input
63
 
 
64
 
#endif // __INPUT_MANAGER_H__
 
1
/*!
 
2
        @file
 
3
        @author         Albert Semenov
 
4
        @date           09/2009
 
5
*/
 
6
 
 
7
#ifndef __INPUT_MANAGER_H__
 
8
#define __INPUT_MANAGER_H__
 
9
 
 
10
#include <MyGUI.h>
 
11
#include <windows.h>
 
12
 
 
13
namespace input
 
14
{
 
15
 
 
16
        class InputManager
 
17
        {
 
18
        public:
 
19
                InputManager();
 
20
                virtual ~InputManager();
 
21
 
 
22
                void createInput(size_t _handle);
 
23
                void destroyInput();
 
24
                void captureInput();
 
25
                void setInputViewSize(int _width, int _height);
 
26
 
 
27
                virtual void injectMouseMove(int _absx, int _absy, int _absz) { }
 
28
                virtual void injectMousePress(int _absx, int _absy, MyGUI::MouseButton _id) { }
 
29
                virtual void injectMouseRelease(int _absx, int _absy, MyGUI::MouseButton _id) { }
 
30
                virtual void injectKeyPress(MyGUI::KeyCode _key, MyGUI::Char _text) { }
 
31
                virtual void injectKeyRelease(MyGUI::KeyCode _key) { }
 
32
 
 
33
                virtual void onFileDrop(const std::wstring& _filename) { }
 
34
                virtual bool onWinodwClose(size_t _handle) { return true; }
 
35
 
 
36
                void setMousePosition(int _x, int _y);
 
37
                void updateCursorPosition();
 
38
 
 
39
        private:
 
40
                static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
41
 
 
42
                void frameEvent(float _time);
 
43
                void computeMouseMove();
 
44
 
 
45
                void mouseMove(int _absx, int _absy, int _absz);
 
46
                void mousePress(int _absx, int _absy, MyGUI::MouseButton _id);
 
47
                void mouseRelease(int _absx, int _absy, MyGUI::MouseButton _id);
 
48
 
 
49
        private:
 
50
                static InputManager* msInputManager;
 
51
                HWND mHwnd;
 
52
                static LRESULT msOldWindowProc;
 
53
                int mWidth;
 
54
                int mHeight;
 
55
                static bool msSkipMove;
 
56
                int mMouseX;
 
57
                int mMouseY;
 
58
                int mMouseZ;
 
59
                bool mMouseMove;
 
60
        };
 
61
 
 
62
} // namespace input
 
63
 
 
64
#endif // __INPUT_MANAGER_H__