Add codes for Dali Windows Backend
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / windows / event-system-win.h
1 #ifndef _WINDOWEVENTSYSTEM_H_\r
2 #define _WINDOWEVENTSYSTEM_H_\r
3 \r
4 /*\r
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
6 *\r
7 * Licensed under the Apache License, Version 2.0 (the "License");\r
8 * you may not use this file except in compliance with the License.\r
9 * You may obtain a copy of the License at\r
10 *\r
11 * http://www.apache.org/licenses/LICENSE-2.0\r
12 *\r
13 * Unless required by applicable law or agreed to in writing, software\r
14 * distributed under the License is distributed on an "AS IS" BASIS,\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16 * See the License for the specific language governing permissions and\r
17 * limitations under the License.\r
18 *\r
19 */\r
20 #define DEVICE_MOUSE                    0\r
21 \r
22 // INTERNAL INCLUDES\r
23 #include <dali/internal/window-system/windows/platform-implement-win.h>\r
24 \r
25 namespace Dali\r
26 {\r
27 \r
28 namespace Internal\r
29 {\r
30 \r
31 namespace Adaptor\r
32 {\r
33 \r
34 struct _Event_Mouse_Button\r
35 {\r
36   WinWindowHandle     window; /**< The main window where event happened */\r
37 \r
38   uint32_t            timestamp; /**< Time when the event occurred */\r
39 \r
40   int32_t             x; /**< x coordinate relative to window where event happened */\r
41   int32_t             y; /**< y coordinate relative to window where event happened */\r
42 \r
43   struct\r
44   {\r
45     int32_t       device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */\r
46     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
47     double        pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */\r
48     double        angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */\r
49     double        x, y; /**< same as x, y, but with sub-pixel precision, if available */\r
50     struct\r
51     {\r
52       double     x, y;\r
53     } root; /**< same as root.x, root.y, but with sub-pixel precision, if available */\r
54   } multi;\r
55 };\r
56 \r
57 /**\r
58 * @struct _Event_Mouse_Wheel\r
59 * Contains information about an Windows mouse wheel event.\r
60 */\r
61 struct _Event_Mouse_Wheel\r
62 {\r
63   WinWindowHandle     window; /**< The main window where event happened */\r
64   WinWindowHandle     root_window; /**< The root window where event happened */\r
65   WinWindowHandle     event_window; /**< The child window where event happened */\r
66 \r
67   uint32_t            timestamp; /**< Time when the event occurred */\r
68   uint32_t            modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
69 \r
70   int32_t              direction; /**< Orientation of the wheel (horizontal/vertical) */\r
71   int32_t              z; /**< Value of the wheel event (+1/-1) */\r
72 \r
73   int32_t              x; /**< x coordinate relative to window where event happened */\r
74   int32_t              y; /**< y coordinate relative to window where event happened */\r
75   struct\r
76   {\r
77         int32_t           x;\r
78         int32_t           y;\r
79   } root; /**< Coordinates relative to root window */\r
80 };\r
81 \r
82 typedef struct _Event_Mouse_Button Event_Mouse_Button;\r
83 typedef struct _Event_Mouse_Wheel  Event_Mouse_Wheel;\r
84 \r
85 struct TWinEventInfo\r
86 {\r
87   TWinEventInfo( uint64_t hWnd, uint32_t uMsg, uint64_t wParam, uint64_t lParam)\r
88   {\r
89     this->mWindow = (WinWindowHandle)hWnd;\r
90     this->uMsg = uMsg;\r
91     this->wParam = wParam;\r
92     this->lParam = lParam;\r
93   }\r
94 \r
95   WinWindowHandle mWindow;\r
96   uint32_t uMsg;\r
97   uint64_t wParam;\r
98   uint64_t lParam;\r
99 };\r
100
101 } // namespace Adaptor
102
103 } // namespace internal
104
105 } // namespace Dali\r
106 \r
107 #endif\r