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