OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_EVENT_TYPES_H | 5 #ifndef BASE_EVENT_TYPES_H |
6 #define BASE_EVENT_TYPES_H | 6 #define BASE_EVENT_TYPES_H |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
12 #include <windows.h> | 12 #include <windows.h> |
13 #elif defined(USE_WAYLAND) | 13 #elif defined(USE_WAYLAND) |
14 namespace base { | 14 namespace base { |
15 namespace wayland { | 15 namespace wayland { |
16 union WaylandEvent; | 16 union WaylandEvent; |
17 } | 17 } |
18 } | 18 } |
19 #elif defined(USE_X11) | 19 #elif defined(USE_X11) |
| 20 #include <X11/Xdefs.h> |
| 21 typedef XID Window; |
20 typedef union _XEvent XEvent; | 22 typedef union _XEvent XEvent; |
21 #endif | 23 #endif |
22 | 24 |
23 namespace base { | 25 namespace base { |
24 | 26 |
25 // Cross platform typedefs for native event types. | 27 // Cross platform typedefs for native event types. |
26 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
27 typedef MSG NativeEvent; | 29 typedef MSG NativeEvent; |
| 30 typedef HWND NativeWindow; |
28 #elif defined(USE_WAYLAND) | 31 #elif defined(USE_WAYLAND) |
29 typedef wayland::WaylandEvent* NativeEvent; | 32 typedef wayland::WaylandEvent* NativeEvent; |
| 33 // TODO: typedef NativeWindow. |
30 #elif defined(USE_X11) | 34 #elif defined(USE_X11) |
31 typedef XEvent* NativeEvent; | 35 typedef XEvent* NativeEvent; |
| 36 typedef ::Window NativeWindow; |
32 #else | 37 #else |
33 typedef void* NativeEvent; | 38 typedef void* NativeEvent; |
| 39 typedef void* NativeWindow; |
34 #endif | 40 #endif |
35 | 41 |
36 } // namespace base | 42 } // namespace base |
37 | 43 |
38 #endif // BASE_EVENT_TYPES_H | 44 #endif // BASE_EVENT_TYPES_H |
OLD | NEW |