-#pragma once\r
#ifndef _WINDOWEVENTSYSTEM_H_\r
#define _WINDOWEVENTSYSTEM_H_\r
\r
-#define EVENT_MOUSE_BUTTON_DOWN WM_LBUTTONDOWN\r
-#define EVENT_MOUSE_BUTTON_UP WM_LBUTTONUP\r
-#define EVENT_MOUSE_MOVE WM_MOUSEMOVE\r
-#define EVENT_MOUSE_OUT WM_MOUSELEAVE\r
-#define EVENT_MOUSE_WHEEL WM_MOUSEWHEEL\r
-\r
-#define EVENT_KEY_DOWN WM_KEYDOWN\r
-#define EVENT_KEY_UP WM_KEYUP\r
-\r
-#define WIN_EVENT_WINDOW_FOCUS_IN WM_SETFOCUS\r
-#define WIN_EVENT_WINDOW_FOCUS_OUT WM_KILLFOCUS\r
-\r
-#define WIN_EVENT_WINDOW_DAMAGE WM_PAINT\r
-\r
-#define WIN_EVENT_XDND_ENTER 0\r
-#define WIN_EVENT_XDND_POSITION 0\r
-#define WIN_EVENT_XDND_LEAVE 0\r
-#define WIN_EVENT_XDND_DROP 0\r
-\r
-#define WIN_EVENT_XDND_FINISHED 0\r
-#define WIN_EVENT_XDND_STATUS 0\r
-\r
-#define WIN_EVENT_CLIENT_MESSAGE 0\r
-#define WIN_EVENT_SELECTION_CLEAR 0\r
-#define WIN_EVENT_SELECTION_NOTIFY 0\r
-\r
-#define CALLBACK_PASS_ON true;\r
-\r
-#define EVENT_MODIFIER_SHIFT 0x0001\r
-#define EVENT_MODIFIER_CTRL 0x0002\r
-#define EVENT_MODIFIER_ALT 0x0004\r
-#define EVENT_MODIFIER_WIN 0x0008\r
-#define EVENT_MODIFIER_SCROLL 0x0010\r
-#define EVENT_MODIFIER_NUM 0x0020\r
-#define EVENT_MODIFIER_CAPS 0x0040\r
-#define EVENT_LOCK_SCROLL 0x0080\r
-#define EVENT_LOCK_NUM 0x0100\r
-#define EVENT_LOCK_CAPS 0x0200\r
-#define EVENT_LOCK_SHIFT 0x0300\r
-#define EVENT_MODIFIER_ALTGR 0x0400 /**< @since 1.7 */\r
-\r
+/*\r
+* Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+*\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+*\r
+*/\r
#define DEVICE_MOUSE 0\r
\r
// INTERNAL INCLUDES\r
namespace Adaptor\r
{\r
\r
-typedef enum\r
-{\r
- IMF_KEYBOARD_MODIFIER_NONE = 0, /**< No active modifiers */\r
- IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */\r
- IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */\r
- IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */\r
- IMF_KEYBOARD_MODIFIER_WIN = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */\r
- IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4 /**< "AltGr" is pressed @since 1.7 */\r
-} IMF_Keyboard_Modifiers;\r
-\r
-struct _Event_Key\r
-{\r
- const char *keyname; /**< The key name */\r
- const char *key; /**< The key symbol */\r
- const char *string;\r
- const char *compose; /**< final string corresponding to the key symbol composed */\r
- winWindow window; /**< The main window where event happened */\r
- winWindow root_window; /**< The root window where event happened */\r
- winWindow event_window; /**< The child window where event happened */\r
-\r
- unsigned int timestamp; /**< Time when the event occurred */\r
-\r
- unsigned int keycode; /**< Key scan code numeric value @since 1.10 */\r
-\r
- void *data; /**< User data associated with an Event_Key @since 1.10 */\r
-};\r
-\r
-/**\r
-* @struct _Event_Mouse_Button\r
-* Contains information about an Ecore mouse button event.\r
-*/\r
-\r
struct _Event_Mouse_Button\r
{\r
- winWindow window; /**< The main window where event happened */\r
+ WinWindowHandle window; /**< The main window where event happened */\r
\r
- unsigned int timestamp; /**< Time when the event occurred */\r
- unsigned int buttons; /**< The button that was used */\r
+ uint32_t timestamp; /**< Time when the event occurred */\r
\r
- int x; /**< x coordinate relative to window where event happened */\r
- int y; /**< y coordinate relative to window where event happened */\r
+ int32_t x; /**< x coordinate relative to window where event happened */\r
+ int32_t y; /**< y coordinate relative to window where event happened */\r
\r
+ struct\r
+ {\r
+ int32_t device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */\r
+ 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
+ double pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */\r
+ double angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */\r
+ double x, y; /**< same as x, y, but with sub-pixel precision, if available */\r
struct\r
{\r
- int device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */\r
- 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
- double pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */\r
- double angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */\r
- double x, y; /**< same as x, y, but with sub-pixel precision, if available */\r
- struct\r
- {\r
- double x, y;\r
- } root; /**< same as root.x, root.y, but with sub-pixel precision, if available */\r
- } multi;\r
+ double x, y;\r
+ } root; /**< same as root.x, root.y, but with sub-pixel precision, if available */\r
+ } multi;\r
};\r
\r
/**\r
* @struct _Event_Mouse_Wheel\r
-* Contains information about an Ecore mouse wheel event.\r
+* Contains information about an Windows mouse wheel event.\r
*/\r
struct _Event_Mouse_Wheel\r
{\r
- winWindow window; /**< The main window where event happened */\r
- winWindow root_window; /**< The root window where event happened */\r
- winWindow event_window; /**< The child window where event happened */\r
-\r
- unsigned int timestamp; /**< Time when the event occurred */\r
- unsigned int modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
-\r
- int direction; /**< Orientation of the wheel (horizontal/vertical) */\r
- int z; /**< Value of the wheel event (+1/-1) */\r
-\r
- int x; /**< x coordinate relative to window where event happened */\r
- int y; /**< y coordinate relative to window where event happened */\r
- struct\r
- {\r
- int x;\r
- int y;\r
- } root; /**< Coordinates relative to root window */\r
-};\r
-\r
-/**\r
-* @struct _Event_Mouse_Move\r
-* Contains information about an Ecore mouse move event.\r
-*/\r
-struct _Event_Mouse_Move\r
-{\r
- winWindow window; /**< The main window where event happened */\r
- winWindow root_window; /**< The root window where event happened */\r
- winWindow event_window; /**< The child window where event happened */\r
-\r
- unsigned int timestamp; /**< Time when the event occurred */\r
- unsigned int modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
-\r
- int x; /**< x coordinate relative to window where event happened */\r
- int y; /**< y coordinate relative to window where event happened */\r
- struct\r
- {\r
- int x;\r
- int y;\r
- } root; /**< Coordinates relative to root window */\r
-\r
- struct\r
- {\r
- int device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */\r
- 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
- double pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */\r
- double angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */\r
- double x, y; /**< same as x, y root.x, root.y, but with sub-pixel precision, if available */\r
- struct\r
- {\r
- double x, y;\r
- } root;\r
- } multi;\r
-};\r
-\r
-typedef enum _Win_Event_Mode\r
-{\r
- WIN_EVENT_MODE_NORMAL,\r
- WIN_EVENT_MODE_WHILE_GRABBED,\r
- WIN_EVENT_MODE_GRAB,\r
- WIN_EVENT_MODE_UNGRAB\r
-} Win_Event_Mode;\r
-\r
-typedef enum _Win_Event_Detail\r
-{\r
- WIN_EVENT_DETAIL_ANCESTOR,\r
- WIN_EVENT_DETAIL_VIRTUAL,\r
- WIN_EVENT_DETAIL_INFERIOR,\r
- WIN_EVENT_DETAIL_NON_LINEAR,\r
- WIN_EVENT_DETAIL_NON_LINEAR_VIRTUAL,\r
- WIN_EVENT_DETAIL_POINTER,\r
- WIN_EVENT_DETAIL_POINTER_ROOT,\r
- WIN_EVENT_DETAIL_DETAIL_NONE\r
-} Win_Event_Detail;\r
-\r
-typedef unsigned int Win_Time;\r
-\r
-struct _Win_Event_Mouse_In\r
-{\r
- int modifiers;\r
- int x, y;\r
-\r
- struct\r
- {\r
- int x, y;\r
- } root;\r
- winWindow win;\r
- winWindow event_win;\r
- winWindow root_win;\r
- Win_Event_Mode mode;\r
- Win_Event_Detail detail;\r
- Win_Time time;\r
-};\r
-\r
-struct _Win_Event_Mouse_Out\r
-{\r
- int modifiers;\r
- int x, y;\r
-\r
- struct\r
- {\r
- int x, y;\r
- } root;\r
- winWindow win;\r
- winWindow event_win;\r
- winWindow root_win;\r
- Win_Event_Mode mode;\r
- Win_Event_Detail detail;\r
- Win_Time time;\r
+ WinWindowHandle window; /**< The main window where event happened */\r
+ WinWindowHandle root_window; /**< The root window where event happened */\r
+ WinWindowHandle event_window; /**< The child window where event happened */\r
+\r
+ uint32_t timestamp; /**< Time when the event occurred */\r
+ uint32_t modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
+\r
+ int32_t direction; /**< Orientation of the wheel (horizontal/vertical) */\r
+ int32_t z; /**< Value of the wheel event (+1/-1) */\r
+\r
+ int32_t x; /**< x coordinate relative to window where event happened */\r
+ int32_t y; /**< y coordinate relative to window where event happened */\r
+ struct\r
+ {\r
+ int32_t x;\r
+ int32_t y;\r
+ } root; /**< Coordinates relative to root window */\r
};\r
\r
-struct _Win_Event_Window_Focus_In\r
-{\r
- winWindow win;\r
-};\r
-\r
-struct _Win_Event_Window_Focus_Out\r
-{\r
- winWindow win;\r
-};\r
-\r
-typedef struct _Event_Key Event_Key;\r
typedef struct _Event_Mouse_Button Event_Mouse_Button;\r
typedef struct _Event_Mouse_Wheel Event_Mouse_Wheel;\r
-typedef struct _Event_Mouse_Move Event_Mouse_Move;\r
-typedef struct _Win_Event_Mouse_In Win_Event_Mouse_In;\r
-typedef struct _Win_Event_Mouse_Out Win_Event_Mouse_Out;\r
-typedef struct _Win_Event_Window_Focus_In Win_Event_Window_Focus_In;\r
-typedef struct _Win_Event_Window_Focus_Out Win_Event_Window_Focus_Out;\r
-\r
-typedef int Event_Handler;\r
\r
struct TWinEventInfo\r
{\r
- TWinEventInfo(long hWnd, unsigned int uMsg, long wParam, long lParam)\r
- {\r
- this->mWindow = (winWindow)hWnd;\r
- this->uMsg = uMsg;\r
- this->wParam = wParam;\r
- this->lParam = lParam;\r
- }\r
-\r
- winWindow mWindow;\r
- unsigned int uMsg;\r
- long wParam;\r
- long lParam;\r
+ TWinEventInfo( uint64_t hWnd, uint32_t uMsg, uint64_t wParam, uint64_t lParam)\r
+ {\r
+ this->mWindow = (WinWindowHandle)hWnd;\r
+ this->uMsg = uMsg;\r
+ this->wParam = wParam;\r
+ this->lParam = lParam;\r
+ }\r
+\r
+ WinWindowHandle mWindow;\r
+ uint32_t uMsg;\r
+ uint64_t wParam;\r
+ uint64_t lParam;\r
};\r
-\r
-typedef bool(*EventCallback)(void* data, int type, TWinEventInfo* event);\r
-\r
-Event_Handler event_handler_add(int eventType, EventCallback callback, void* handler);\r
-\r
-void event_handler_del(Event_Handler handler);\r
-\r
-void* GetEventHandler(int eventType);\r
-EventCallback GetCallback(int eventType);\r
} // namespace Adaptor