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 VIEWS_NATIVE_TYPES_H_ | 5 #ifndef VIEWS_NATIVE_TYPES_H_ |
6 #define VIEWS_NATIVE_TYPES_H_ | 6 #define VIEWS_NATIVE_TYPES_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 | 10 |
11 #if defined(OS_LINUX) | 11 #if defined(OS_LINUX) |
12 typedef union _GdkEvent GdkEvent; | 12 typedef union _GdkEvent GdkEvent; |
13 #endif | 13 #endif |
14 #if defined(USE_X11) | 14 #if defined(USE_X11) |
15 typedef union _XEvent XEvent; | 15 typedef union _XEvent XEvent; |
16 #endif | 16 #endif |
| 17 #if defined(USE_WAYLAND) |
| 18 namespace ui { |
| 19 union WaylandEvent; |
| 20 } |
| 21 #endif |
17 | 22 |
18 #if defined(USE_AURA) | 23 #if defined(USE_AURA) |
19 namespace aura { | 24 namespace aura { |
20 class Event; | 25 class Event; |
21 } | 26 } |
22 #endif | 27 #endif |
23 | 28 |
24 namespace views { | 29 namespace views { |
25 | 30 |
26 // A note about NativeEvent and NativeEvent2. | 31 // A note about NativeEvent and NativeEvent2. |
27 // 1. Eventually TOOLKIT_VIEWS will converge on using XEvent as we remove | 32 // 1. Eventually TOOLKIT_VIEWS will converge on using XEvent as we remove |
28 // Gtk/Gdk from the stack. | 33 // Gtk/Gdk from the stack. |
29 // 2. TOUCH_UI needs XEvents now for certain event types. | 34 // 2. TOUCH_UI needs XEvents now for certain event types. |
30 // 3. TOUCH_UI also needs GdkEvents for certain event types. | 35 // 3. TOUCH_UI also needs GdkEvents for certain event types. |
31 // | 36 // |
32 // => NativeEvent and NativeEvent2. | 37 // => NativeEvent and NativeEvent2. |
33 // | 38 // |
34 // Once we replace usage of Gtk/Gdk types with Xlib types across the board in | 39 // Once we replace usage of Gtk/Gdk types with Xlib types across the board in |
35 // views, we can remove NativeEvent2 and typedef XEvent* to NativeEvent. The | 40 // views, we can remove NativeEvent2 and typedef XEvent* to NativeEvent. The |
36 // world will then be beautiful(ish). | 41 // world will then be beautiful(ish). |
37 | 42 |
38 #if defined(USE_AURA) | 43 #if defined(USE_AURA) |
39 typedef aura::Event* NativeEvent; | 44 typedef aura::Event* NativeEvent; |
40 #elif defined(OS_WIN) | 45 #elif defined(OS_WIN) |
41 typedef MSG NativeEvent; | 46 typedef MSG NativeEvent; |
42 #elif defined(OS_LINUX) | 47 #elif defined(OS_LINUX) |
| 48 |
| 49 #if defined(USE_WAYLAND) |
| 50 typedef ui::WaylandEvent* NativeEvent; |
| 51 #else |
43 typedef GdkEvent* NativeEvent; | 52 typedef GdkEvent* NativeEvent; |
44 #endif | 53 #endif |
45 | 54 |
| 55 #endif |
| 56 |
46 #if defined(USE_X11) | 57 #if defined(USE_X11) |
47 typedef XEvent* NativeEvent2; | 58 typedef XEvent* NativeEvent2; |
48 #else | 59 #else |
49 typedef void* NativeEvent2; | 60 typedef void* NativeEvent2; |
50 #endif | 61 #endif |
51 | 62 |
52 } // namespace views | 63 } // namespace views |
53 | 64 |
54 #endif // VIEWS_NATIVE_TYPES_H_ | 65 #endif // VIEWS_NATIVE_TYPES_H_ |
55 | 66 |
OLD | NEW |