File: ExportInputManager.cpp

package info (click to toggle)
mygui 3.2.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,224 kB
  • sloc: cpp: 118,031; ansic: 30,202; xml: 15,544; cs: 12,602; tcl: 776; python: 417; makefile: 34
file content (124 lines) | stat: -rw-r--r-- 3,015 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

#include "ExportDefine.h"
#include "ExportMarshaling.h"
#include "Generate/MyGUI_Export_MarshalingWidget.h"
#include "ExportMarshalingType.h"
#include <MyGUI.h>

namespace Export
{

	MYGUIEXPORT bool MYGUICALL ExportInputManager_GetKeyFocus( )
	{
		return MyGUI::InputManager::getInstance().isFocusKey();
	}

	MYGUIEXPORT bool MYGUICALL ExportInputManager_GetMouseFocus( )
	{
		return MyGUI::InputManager::getInstance().isFocusMouse();
	}

	MYGUIEXPORT Convert<MyGUI::Widget*>::Type MYGUICALL ExportInputManager_GetKeyFocusWidget( )
	{
		return Convert<MyGUI::Widget*>::To( MyGUI::InputManager::getInstance().getKeyFocusWidget() );
	}

	MYGUIEXPORT void MYGUICALL ExportInputManager_SetKeyFocusWidget(
		MyGUI::Widget* _widget )
	{
		MyGUI::InputManager::getInstance().setKeyFocusWidget(
			_widget );
	}

	MYGUIEXPORT Convert<MyGUI::Widget*>::Type MYGUICALL ExportInputManager_GetMouseFocusWidget( )
	{
		return Convert<MyGUI::Widget*>::To( MyGUI::InputManager::getInstance().getMouseFocusWidget() );
	}

	MYGUIEXPORT void MYGUICALL ExportInputManager_ResetKeyFocusWidget( )
	{
		MyGUI::InputManager::getInstance().resetKeyFocusWidget( );
	}

	MYGUIEXPORT void MYGUICALL ExportInputManager_AddWidgetModal(
		MyGUI::Widget* _widget )
	{
		MyGUI::InputManager::getInstance().addWidgetModal(
			_widget );
	}

	MYGUIEXPORT void MYGUICALL ExportInputManager_RemoveWidgetModal(
		MyGUI::Widget* _widget )
	{
		MyGUI::InputManager::getInstance().removeWidgetModal(
			_widget );
	}

	MYGUIEXPORT bool MYGUICALL ExportInputManager_InjectKeyPress(
		Convert<MyGUI::KeyCode>::Type _key,
		Convert<MyGUI::Char>::Type _char
	)
	{
		return MyGUI::InputManager::getInstance().injectKeyPress(
			Convert<MyGUI::KeyCode>::From( _key ),
			Convert<MyGUI::Char>::From( _char)
			);
	}

	MYGUIEXPORT bool MYGUICALL ExportInputManager_InjectKeyRelease(
		Convert<MyGUI::KeyCode>::Type _key
	)
	{
		return MyGUI::InputManager::getInstance().injectKeyRelease(
			Convert<MyGUI::KeyCode>::From( _key )
			);
	}

	MYGUIEXPORT bool MYGUICALL ExportInputManager_InjectMousePress(
		int _absX,
		int _absY,
		Convert<MyGUI::MouseButton>::Type _button
	)
	{
		return MyGUI::InputManager::getInstance().injectMousePress(
			_absX,
			_absY,
			Convert<MyGUI::MouseButton>::From( _button )
			);
	}

	MYGUIEXPORT bool MYGUICALL ExportInputManager_InjectMouseRelease(
		int _absX,
		int _absY,
		Convert<MyGUI::MouseButton>::Type _button
	)
	{
		return MyGUI::InputManager::getInstance().injectMouseRelease(
			_absX,
			_absY,
			Convert<MyGUI::MouseButton>::From( _button )
			);
	}

	MYGUIEXPORT bool MYGUICALL ExportInputManager_InjectMouseMove(
		int _absX,
		int _absY,
		int _absZ
	)
	{
		return MyGUI::InputManager::getInstance().injectMouseMove(
			_absX,
			_absY,
			_absZ );
	}

	MYGUIEXPORT void MYGUICALL ExportInputManager_GetMousePosition(
		Convert<int&>::Type _x,
		Convert<int&>::Type _y
	)
	{
		const MyGUI::IntPoint& point = MyGUI::InputManager::getInstance().getMousePosition();
		_x = point.left;
		_y = point.top;
	}
}