2 #ifndef _WINDOWEVENTSYSTEM_H_
\r
3 #define _WINDOWEVENTSYSTEM_H_
\r
5 #include <Win32WindowSystem.h>
\r
7 #define ECORE_EVENT_MOUSE_BUTTON_DOWN WM_LBUTTONDOWN
\r
8 #define ECORE_EVENT_MOUSE_BUTTON_UP WM_LBUTTONUP
\r
9 #define ECORE_EVENT_MOUSE_MOVE WM_MOUSEMOVE
\r
10 #define ECORE_EVENT_MOUSE_OUT WM_MOUSELEAVE
\r
11 #define ECORE_EVENT_MOUSE_WHEEL WM_MOUSEWHEEL
\r
13 #define ECORE_EVENT_KEY_DOWN WM_KEYDOWN
\r
14 #define ECORE_EVENT_KEY_UP WM_KEYUP
\r
16 #define ECORE_WIN_EVENT_WINDOW_FOCUS_IN WM_SETFOCUS
\r
17 #define ECORE_WIN_EVENT_WINDOW_FOCUS_OUT WM_KILLFOCUS
\r
19 #define ECORE_WIN_EVENT_WINDOW_DAMAGE WM_PAINT
\r
21 #define ECORE_WIN_EVENT_XDND_ENTER 0
\r
22 #define ECORE_WIN_EVENT_XDND_POSITION 0
\r
23 #define ECORE_WIN_EVENT_XDND_LEAVE 0
\r
24 #define ECORE_WIN_EVENT_XDND_DROP 0
\r
26 #define ECORE_WIN_EVENT_XDND_FINISHED 0
\r
27 #define ECORE_WIN_EVENT_XDND_STATUS 0
\r
29 #define ECORE_WIN_EVENT_CLIENT_MESSAGE 0
\r
30 #define ECORE_WIN_EVENT_SELECTION_CLEAR 0
\r
31 #define ECORE_WIN_EVENT_SELECTION_NOTIFY 0
\r
33 #define ECORE_CALLBACK_PASS_ON true;
\r
35 #define ECORE_EVENT_MODIFIER_SHIFT 0x0001
\r
36 #define ECORE_EVENT_MODIFIER_CTRL 0x0002
\r
37 #define ECORE_EVENT_MODIFIER_ALT 0x0004
\r
38 #define ECORE_EVENT_MODIFIER_WIN 0x0008
\r
39 #define ECORE_EVENT_MODIFIER_SCROLL 0x0010
\r
40 #define ECORE_EVENT_MODIFIER_NUM 0x0020
\r
41 #define ECORE_EVENT_MODIFIER_CAPS 0x0040
\r
42 #define ECORE_EVENT_LOCK_SCROLL 0x0080
\r
43 #define ECORE_EVENT_LOCK_NUM 0x0100
\r
44 #define ECORE_EVENT_LOCK_CAPS 0x0200
\r
45 #define ECORE_EVENT_LOCK_SHIFT 0x0300
\r
46 #define ECORE_EVENT_MODIFIER_ALTGR 0x0400 /**< @since 1.7 */
\r
48 #define DEVICE_MOUSE 0
\r
56 namespace Win32System
\r
60 ECORE_IMF_KEYBOARD_MODIFIER_NONE = 0, /**< No active modifiers */
\r
61 ECORE_IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */
\r
62 ECORE_IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */
\r
63 ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
\r
64 ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */
\r
65 ECORE_IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4 /**< "AltGr" is pressed @since 1.7 */
\r
66 } Ecore_IMF_Keyboard_Modifiers;
\r
68 struct _Ecore_Event_Key
\r
70 const char *keyname; /**< The key name */
\r
71 const char *key; /**< The key symbol */
\r
73 const char *compose; /**< final string corresponding to the key symbol composed */
\r
74 Ecore_Window window; /**< The main window where event happened */
\r
75 Ecore_Window root_window; /**< The root window where event happened */
\r
76 Ecore_Window event_window; /**< The child window where event happened */
\r
78 unsigned int timestamp; /**< Time when the event occurred */
\r
80 //int same_screen; /**< same screen flag */
\r
82 unsigned int keycode; /**< Key scan code numeric value @since 1.10 */
\r
84 void *data; /**< User data associated with an Ecore_Event_Key @since 1.10 */
\r
88 * @struct _Ecore_Event_Mouse_Button
\r
89 * Contains information about an Ecore mouse button event.
\r
92 struct _Ecore_Event_Mouse_Button
\r
94 Ecore_Window window; /**< The main window where event happened */
\r
96 unsigned int timestamp; /**< Time when the event occurred */
\r
97 unsigned int buttons; /**< The button that was used */
\r
99 int x; /**< x coordinate relative to window where event happened */
\r
100 int y; /**< y coordinate relative to window where event happened */
\r
104 int device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */
\r
105 double radius, radius_x, radius_y; /**< radius of press point - radius_x and y if its an ellipse (radius is the average of the 2) */
\r
106 double pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */
\r
107 double angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */
\r
108 double x, y; /**< same as x, y, but with sub-pixel precision, if available */
\r
112 } root; /**< same as root.x, root.y, but with sub-pixel precision, if available */
\r
117 * @struct _Ecore_Event_Mouse_Wheel
\r
118 * Contains information about an Ecore mouse wheel event.
\r
120 struct _Ecore_Event_Mouse_Wheel
\r
122 Ecore_Window window; /**< The main window where event happened */
\r
123 Ecore_Window root_window; /**< The root window where event happened */
\r
124 Ecore_Window event_window; /**< The child window where event happened */
\r
126 unsigned int timestamp; /**< Time when the event occurred */
\r
127 unsigned int modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/
\r
129 int direction; /**< Orientation of the wheel (horizontal/vertical) */
\r
130 int z; /**< Value of the wheel event (+1/-1) */
\r
132 int x; /**< x coordinate relative to window where event happened */
\r
133 int y; /**< y coordinate relative to window where event happened */
\r
138 } root; /**< Coordinates relative to root window */
\r
142 * @struct _Ecore_Event_Mouse_Move
\r
143 * Contains information about an Ecore mouse move event.
\r
145 struct _Ecore_Event_Mouse_Move
\r
147 Ecore_Window window; /**< The main window where event happened */
\r
148 Ecore_Window root_window; /**< The root window where event happened */
\r
149 Ecore_Window event_window; /**< The child window where event happened */
\r
151 unsigned int timestamp; /**< Time when the event occurred */
\r
152 unsigned int modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/
\r
154 int x; /**< x coordinate relative to window where event happened */
\r
155 int y; /**< y coordinate relative to window where event happened */
\r
160 } root; /**< Coordinates relative to root window */
\r
164 int device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */
\r
165 double radius, radius_x, radius_y; /**< radius of press point - radius_x and y if its an ellipse (radius is the average of the 2) */
\r
166 double pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */
\r
167 double angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */
\r
168 double x, y; /**< same as x, y root.x, root.y, but with sub-pixel precision, if available */
\r
176 typedef enum _Ecore_Win_Event_Mode
\r
178 ECORE_WIN_EVENT_MODE_NORMAL,
\r
179 ECORE_WIN_EVENT_MODE_WHILE_GRABBED,
\r
180 ECORE_WIN_EVENT_MODE_GRAB,
\r
181 ECORE_WIN_EVENT_MODE_UNGRAB
\r
182 } Ecore_Win_Event_Mode;
\r
184 typedef enum _Ecore_Win_Event_Detail
\r
186 ECORE_WIN_EVENT_DETAIL_ANCESTOR,
\r
187 ECORE_WIN_EVENT_DETAIL_VIRTUAL,
\r
188 ECORE_WIN_EVENT_DETAIL_INFERIOR,
\r
189 ECORE_WIN_EVENT_DETAIL_NON_LINEAR,
\r
190 ECORE_WIN_EVENT_DETAIL_NON_LINEAR_VIRTUAL,
\r
191 ECORE_WIN_EVENT_DETAIL_POINTER,
\r
192 ECORE_WIN_EVENT_DETAIL_POINTER_ROOT,
\r
193 ECORE_WIN_EVENT_DETAIL_DETAIL_NONE
\r
194 } Ecore_Win_Event_Detail;
\r
196 typedef unsigned int Ecore_Win_Time;
\r
198 struct _Ecore_Win_Event_Mouse_In
\r
207 Ecore_Win_Window win;
\r
208 Ecore_Win_Window event_win;
\r
209 Ecore_Win_Window root_win;
\r
210 Ecore_Win_Event_Mode mode;
\r
211 Ecore_Win_Event_Detail detail;
\r
212 Ecore_Win_Time time;
\r
215 struct _Ecore_Win_Event_Mouse_Out
\r
224 Ecore_Win_Window win;
\r
225 Ecore_Win_Window event_win;
\r
226 Ecore_Win_Window root_win;
\r
227 Ecore_Win_Event_Mode mode;
\r
228 Ecore_Win_Event_Detail detail;
\r
229 Ecore_Win_Time time;
\r
232 struct _Ecore_Win_Event_Window_Focus_In
\r
234 Ecore_Win_Window win;
\r
237 struct _Ecore_Win_Event_Window_Focus_Out
\r
239 Ecore_Win_Window win;
\r
242 typedef struct _Ecore_Event_Key Ecore_Event_Key;
\r
243 typedef struct _Ecore_Event_Mouse_Button Ecore_Event_Mouse_Button;
\r
244 typedef struct _Ecore_Event_Mouse_Wheel Ecore_Event_Mouse_Wheel;
\r
245 typedef struct _Ecore_Event_Mouse_Move Ecore_Event_Mouse_Move;
\r
246 typedef struct _Ecore_Win_Event_Mouse_In Ecore_Win_Event_Mouse_In;
\r
247 typedef struct _Ecore_Win_Event_Mouse_Out Ecore_Win_Event_Mouse_Out;
\r
248 typedef struct _Ecore_Win_Event_Window_Focus_In Ecore_Win_Event_Window_Focus_In;
\r
249 typedef struct _Ecore_Win_Event_Window_Focus_Out Ecore_Win_Event_Window_Focus_Out;
\r
251 typedef int Ecore_Event_Handler;
\r
253 struct TWinEventInfo
\r
255 TWinEventInfo(long hWnd, unsigned int uMsg, long wParam, long lParam)
\r
257 this->mWindow = (Ecore_Win_Window)hWnd;
\r
259 this->wParam = wParam;
\r
260 this->lParam = lParam;
\r
263 Ecore_Win_Window mWindow;
\r
269 typedef bool(*EventCallback)(void* data, int type, TWinEventInfo* event);
\r
271 Ecore_Event_Handler ecore_event_handler_add(int eventType, EventCallback callback, void* handler);
\r
273 void ecore_event_handler_del(Ecore_Event_Handler handler);
\r
275 void* GetEventHandler(int eventType);
\r
276 EventCallback GetCallback(int eventType);
\r