Revert "[Tizen] Disable indicator"
[platform/core/uifw/dali-adaptor.git] / dali-windows-backend / ExInclude / WindowsEventSystem.h
1 #pragma once\r
2 #ifndef _WINDOWEVENTSYSTEM_H_\r
3 #define _WINDOWEVENTSYSTEM_H_\r
4 \r
5 #include <Win32WindowSystem.h>\r
6 \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
12 \r
13 #define ECORE_EVENT_KEY_DOWN            WM_KEYDOWN\r
14 #define ECORE_EVENT_KEY_UP              WM_KEYUP\r
15 \r
16 #define ECORE_WIN_EVENT_WINDOW_FOCUS_IN   WM_SETFOCUS\r
17 #define ECORE_WIN_EVENT_WINDOW_FOCUS_OUT  WM_KILLFOCUS\r
18 \r
19 #define ECORE_WIN_EVENT_WINDOW_DAMAGE     WM_PAINT\r
20 \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
25 \r
26 #define ECORE_WIN_EVENT_XDND_FINISHED     0\r
27 #define ECORE_WIN_EVENT_XDND_STATUS       0\r
28 \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
32 \r
33 #define ECORE_CALLBACK_PASS_ON true;\r
34 \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
47 \r
48 #define DEVICE_MOUSE                    0\r
49 \r
50 namespace Dali\r
51 {\r
52 \r
53 namespace Internal\r
54 {\r
55 \r
56 namespace Win32System\r
57 {\r
58 typedef enum\r
59 {\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
67 \r
68 struct _Ecore_Event_Key\r
69 {\r
70     const char      *keyname; /**< The key name */\r
71     const char      *key; /**< The key symbol */\r
72     const char      *string;\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
77 \r
78     unsigned int     timestamp; /**< Time when the event occurred */\r
79 \r
80     //int              same_screen; /**< same screen flag */\r
81 \r
82     unsigned int     keycode; /**< Key scan code numeric value @since 1.10 */\r
83 \r
84     void            *data; /**< User data associated with an Ecore_Event_Key @since 1.10 */\r
85 };\r
86 \r
87 /**\r
88 * @struct _Ecore_Event_Mouse_Button\r
89 * Contains information about an Ecore mouse button event.\r
90 */\r
91 \r
92 struct _Ecore_Event_Mouse_Button\r
93 {\r
94     Ecore_Window     window; /**< The main window where event happened */\r
95 \r
96     unsigned int     timestamp; /**< Time when the event occurred */\r
97     unsigned int     buttons; /**< The button that was used */\r
98 \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
101 \r
102     struct\r
103     {\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
109         struct\r
110         {\r
111             double     x, y;\r
112         } root; /**< same as root.x, root.y, but with sub-pixel precision, if available */\r
113     } multi;\r
114 };\r
115 \r
116 /**\r
117 * @struct _Ecore_Event_Mouse_Wheel\r
118 * Contains information about an Ecore mouse wheel event.\r
119 */\r
120 struct _Ecore_Event_Mouse_Wheel\r
121 {\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
125 \r
126     unsigned int     timestamp; /**< Time when the event occurred */\r
127     unsigned int     modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
128 \r
129     int              direction; /**< Orientation of the wheel (horizontal/vertical) */\r
130     int              z; /**< Value of the wheel event (+1/-1) */\r
131 \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
134     struct\r
135     {\r
136         int           x;\r
137         int           y;\r
138     } root; /**< Coordinates relative to root window */\r
139 };\r
140 \r
141 /**\r
142 * @struct _Ecore_Event_Mouse_Move\r
143 * Contains information about an Ecore mouse move event.\r
144 */\r
145 struct _Ecore_Event_Mouse_Move\r
146 {\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
150 \r
151     unsigned int     timestamp; /**< Time when the event occurred */\r
152     unsigned int     modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
153 \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
156     struct\r
157     {\r
158         int           x;\r
159         int           y;\r
160     } root; /**< Coordinates relative to root window */\r
161 \r
162     struct\r
163     {\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
169         struct\r
170         {\r
171             double     x, y;\r
172         } root;\r
173     } multi;\r
174 };\r
175 \r
176 typedef enum _Ecore_Win_Event_Mode\r
177 {\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
183 \r
184 typedef enum _Ecore_Win_Event_Detail\r
185 {\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
195 \r
196 typedef unsigned int Ecore_Win_Time;\r
197 \r
198 struct _Ecore_Win_Event_Mouse_In\r
199 {\r
200     int                  modifiers;\r
201     int                  x, y;\r
202 \r
203     struct\r
204     {\r
205         int x, y;\r
206     } root;\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
213 };\r
214 \r
215 struct _Ecore_Win_Event_Mouse_Out\r
216 {\r
217     int                  modifiers;\r
218     int                  x, y;\r
219 \r
220     struct\r
221     {\r
222         int x, y;\r
223     } root;\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
230 };\r
231 \r
232 struct _Ecore_Win_Event_Window_Focus_In\r
233 {\r
234     Ecore_Win_Window       win;\r
235 };\r
236 \r
237 struct _Ecore_Win_Event_Window_Focus_Out\r
238 {\r
239     Ecore_Win_Window       win;\r
240 };\r
241 \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
250 \r
251 typedef int Ecore_Event_Handler;\r
252 \r
253 struct TWinEventInfo\r
254 {\r
255     TWinEventInfo(long hWnd, unsigned int uMsg, long wParam, long lParam)\r
256     {\r
257         this->mWindow = (Ecore_Win_Window)hWnd;\r
258         this->uMsg = uMsg;\r
259         this->wParam = wParam;\r
260         this->lParam = lParam;\r
261     }\r
262 \r
263     Ecore_Win_Window mWindow;\r
264     unsigned int uMsg;\r
265     long wParam;\r
266     long lParam;\r
267 };\r
268 \r
269 typedef bool(*EventCallback)(void* data, int type, TWinEventInfo* event);\r
270 \r
271 Ecore_Event_Handler ecore_event_handler_add(int eventType, EventCallback callback, void* handler);\r
272 \r
273 void ecore_event_handler_del(Ecore_Event_Handler handler);\r
274 \r
275 void* GetEventHandler(int eventType);\r
276 EventCallback GetCallback(int eventType);\r
277 }\r
278 }\r
279 }\r
280 \r
281 #endif\r