| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VIEWS_NATIVE_TYPES_H_ | |
| 6 #define VIEWS_NATIVE_TYPES_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "ui/gfx/native_widget_types.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 | |
| 23 #if defined(USE_AURA) | |
| 24 namespace aura { | |
| 25 class Event; | |
| 26 } | |
| 27 #endif | |
| 28 | |
| 29 namespace views { | |
| 30 | |
| 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) | |
| 44 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 | |
| 52 typedef GdkEvent* NativeEvent; | |
| 53 #endif | |
| 54 | |
| 55 #endif | |
| 56 | |
| 57 #if defined(USE_X11) | |
| 58 typedef XEvent* NativeEvent2; | |
| 59 #else | |
| 60 typedef void* NativeEvent2; | |
| 61 #endif | |
| 62 | |
| 63 } // namespace views | |
| 64 | |
| 65 #endif // VIEWS_NATIVE_TYPES_H_ | |
| 66 | |
| OLD | NEW |