| 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) |
| 12 typedef union _GdkEvent GdkEvent; |
| 13 #endif |
| 14 #if defined(TOUCH_UI) |
| 15 typedef union _XEvent XEvent; |
| 16 #endif |
| 17 |
| 11 namespace views { | 18 namespace views { |
| 12 | 19 |
| 20 // A note about NativeEvent and NativeEvent2. |
| 21 // 1. Eventually TOOLKIT_VIEWS will converge on using XEvent as we remove |
| 22 // Gtk/Gdk from the stack. |
| 23 // 2. TOUCH_UI needs XEvents now for certain event types. |
| 24 // 3. TOUCH_UI also needs GdkEvents for certain event types. |
| 25 // |
| 26 // => NativeEvent and NativeEvent2. |
| 27 // |
| 28 // Once we replace usage of Gtk/Gdk types with Xlib types across the board in |
| 29 // views, we can remove NativeEvent2 and typedef XEvent* to NativeEvent. The |
| 30 // world will then be beautiful(ish). |
| 31 |
| 13 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 14 typedef MSG NativeEvent; | 33 typedef MSG NativeEvent; |
| 15 #endif | 34 #endif |
| 16 #if defined(OS_LINUX) | 35 #if defined(OS_LINUX) |
| 17 typedef union _GdkEvent GdkEvent; | |
| 18 typedef GdkEvent* NativeEvent; | 36 typedef GdkEvent* NativeEvent; |
| 19 #endif | 37 #endif |
| 20 #if defined(TOUCH_UI) | 38 #if defined(TOUCH_UI) |
| 21 typedef union _XEvent XEvent; | 39 typedef XEvent* NativeEvent2; |
| 22 typedef XEvent* NativeEvent; | 40 #else |
| 41 typedef void* NativeEvent2; |
| 23 #endif | 42 #endif |
| 24 | 43 |
| 25 } // namespace views | 44 } // namespace views |
| 26 | 45 |
| 27 #endif // VIEWS_NATIVE_TYPES_H_ | 46 #endif // VIEWS_NATIVE_TYPES_H_ |
| 28 | 47 |
| OLD | NEW |