2 #ifndef _WINDOWEVENTSYSTEM_H_
\r
3 #define _WINDOWEVENTSYSTEM_H_
\r
5 #define EVENT_MOUSE_BUTTON_DOWN WM_LBUTTONDOWN
\r
6 #define EVENT_MOUSE_BUTTON_UP WM_LBUTTONUP
\r
7 #define EVENT_MOUSE_MOVE WM_MOUSEMOVE
\r
8 #define EVENT_MOUSE_OUT WM_MOUSELEAVE
\r
9 #define EVENT_MOUSE_WHEEL WM_MOUSEWHEEL
\r
11 #define EVENT_KEY_DOWN WM_KEYDOWN
\r
12 #define EVENT_KEY_UP WM_KEYUP
\r
14 #define WIN_EVENT_WINDOW_FOCUS_IN WM_SETFOCUS
\r
15 #define WIN_EVENT_WINDOW_FOCUS_OUT WM_KILLFOCUS
\r
17 #define WIN_EVENT_WINDOW_DAMAGE WM_PAINT
\r
19 #define WIN_EVENT_XDND_ENTER 0
\r
20 #define WIN_EVENT_XDND_POSITION 0
\r
21 #define WIN_EVENT_XDND_LEAVE 0
\r
22 #define WIN_EVENT_XDND_DROP 0
\r
24 #define WIN_EVENT_XDND_FINISHED 0
\r
25 #define WIN_EVENT_XDND_STATUS 0
\r
27 #define WIN_EVENT_CLIENT_MESSAGE 0
\r
28 #define WIN_EVENT_SELECTION_CLEAR 0
\r
29 #define WIN_EVENT_SELECTION_NOTIFY 0
\r
31 #define CALLBACK_PASS_ON true;
\r
33 #define EVENT_MODIFIER_SHIFT 0x0001
\r
34 #define EVENT_MODIFIER_CTRL 0x0002
\r
35 #define EVENT_MODIFIER_ALT 0x0004
\r
36 #define EVENT_MODIFIER_WIN 0x0008
\r
37 #define EVENT_MODIFIER_SCROLL 0x0010
\r
38 #define EVENT_MODIFIER_NUM 0x0020
\r
39 #define EVENT_MODIFIER_CAPS 0x0040
\r
40 #define EVENT_LOCK_SCROLL 0x0080
\r
41 #define EVENT_LOCK_NUM 0x0100
\r
42 #define EVENT_LOCK_CAPS 0x0200
\r
43 #define EVENT_LOCK_SHIFT 0x0300
\r
44 #define EVENT_MODIFIER_ALTGR 0x0400 /**< @since 1.7 */
\r
46 #define DEVICE_MOUSE 0
\r
48 // INTERNAL INCLUDES
\r
49 #include <dali/internal/window-system/windows/platform-implement-win.h>
\r
62 IMF_KEYBOARD_MODIFIER_NONE = 0, /**< No active modifiers */
\r
63 IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */
\r
64 IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */
\r
65 IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
\r
66 IMF_KEYBOARD_MODIFIER_WIN = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */
\r
67 IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4 /**< "AltGr" is pressed @since 1.7 */
\r
68 } IMF_Keyboard_Modifiers;
\r
72 const char *keyname; /**< The key name */
\r
73 const char *key; /**< The key symbol */
\r
75 const char *compose; /**< final string corresponding to the key symbol composed */
\r
76 winWindow window; /**< The main window where event happened */
\r
77 winWindow root_window; /**< The root window where event happened */
\r
78 winWindow event_window; /**< The child window where event happened */
\r
80 unsigned int timestamp; /**< Time when the event occurred */
\r
82 unsigned int keycode; /**< Key scan code numeric value @since 1.10 */
\r
84 void *data; /**< User data associated with an Event_Key @since 1.10 */
\r
88 * @struct _Event_Mouse_Button
\r
89 * Contains information about an Ecore mouse button event.
\r
92 struct _Event_Mouse_Button
\r
94 winWindow 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 _Event_Mouse_Wheel
\r
118 * Contains information about an Ecore mouse wheel event.
\r
120 struct _Event_Mouse_Wheel
\r
122 winWindow window; /**< The main window where event happened */
\r
123 winWindow root_window; /**< The root window where event happened */
\r
124 winWindow 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 _Event_Mouse_Move
\r
143 * Contains information about an Ecore mouse move event.
\r
145 struct _Event_Mouse_Move
\r
147 winWindow window; /**< The main window where event happened */
\r
148 winWindow root_window; /**< The root window where event happened */
\r
149 winWindow 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 _Win_Event_Mode
\r
178 WIN_EVENT_MODE_NORMAL,
\r
179 WIN_EVENT_MODE_WHILE_GRABBED,
\r
180 WIN_EVENT_MODE_GRAB,
\r
181 WIN_EVENT_MODE_UNGRAB
\r
184 typedef enum _Win_Event_Detail
\r
186 WIN_EVENT_DETAIL_ANCESTOR,
\r
187 WIN_EVENT_DETAIL_VIRTUAL,
\r
188 WIN_EVENT_DETAIL_INFERIOR,
\r
189 WIN_EVENT_DETAIL_NON_LINEAR,
\r
190 WIN_EVENT_DETAIL_NON_LINEAR_VIRTUAL,
\r
191 WIN_EVENT_DETAIL_POINTER,
\r
192 WIN_EVENT_DETAIL_POINTER_ROOT,
\r
193 WIN_EVENT_DETAIL_DETAIL_NONE
\r
194 } Win_Event_Detail;
\r
196 typedef unsigned int Win_Time;
\r
198 struct _Win_Event_Mouse_In
\r
208 winWindow event_win;
\r
209 winWindow root_win;
\r
210 Win_Event_Mode mode;
\r
211 Win_Event_Detail detail;
\r
215 struct _Win_Event_Mouse_Out
\r
225 winWindow event_win;
\r
226 winWindow root_win;
\r
227 Win_Event_Mode mode;
\r
228 Win_Event_Detail detail;
\r
232 struct _Win_Event_Window_Focus_In
\r
237 struct _Win_Event_Window_Focus_Out
\r
242 typedef struct _Event_Key Event_Key;
\r
243 typedef struct _Event_Mouse_Button Event_Mouse_Button;
\r
244 typedef struct _Event_Mouse_Wheel Event_Mouse_Wheel;
\r
245 typedef struct _Event_Mouse_Move Event_Mouse_Move;
\r
246 typedef struct _Win_Event_Mouse_In Win_Event_Mouse_In;
\r
247 typedef struct _Win_Event_Mouse_Out Win_Event_Mouse_Out;
\r
248 typedef struct _Win_Event_Window_Focus_In Win_Event_Window_Focus_In;
\r
249 typedef struct _Win_Event_Window_Focus_Out Win_Event_Window_Focus_Out;
\r
251 typedef int Event_Handler;
\r
253 struct TWinEventInfo
\r
255 TWinEventInfo(long hWnd, unsigned int uMsg, long wParam, long lParam)
\r
257 this->mWindow = (winWindow)hWnd;
\r
259 this->wParam = wParam;
\r
260 this->lParam = lParam;
\r
269 typedef bool(*EventCallback)(void* data, int type, TWinEventInfo* event);
\r
271 Event_Handler event_handler_add(int eventType, EventCallback callback, void* handler);
\r
273 void event_handler_del(Event_Handler handler);
\r
275 void* GetEventHandler(int eventType);
\r
276 EventCallback GetCallback(int eventType);
\r
278 } // namespace Adaptor
280 } // namespace internal
282 } // namespace Dali
\r