oshima@chromium.org | 6c32d0b | 2012-04-07 09:33:04 +0900 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
oshima@google.com | 9b786a5 | 2011-10-06 02:14:33 +0900 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
danakj | 0393da3 | 2015-03-10 09:31:16 +0900 | [diff] [blame] | 5 | #ifndef BASE_EVENT_TYPES_H_ |
| 6 | #define BASE_EVENT_TYPES_H_ |
oshima@google.com | 9b786a5 | 2011-10-06 02:14:33 +0900 | [diff] [blame] | 7 | |
| 8 | #include "build/build_config.h" |
| 9 | |
| 10 | #if defined(OS_WIN) |
| 11 | #include <windows.h> |
msb@chromium.org | b1aa6a0 | 2011-11-15 04:23:46 +0900 | [diff] [blame] | 12 | #elif defined(USE_X11) |
oshima@google.com | 9b786a5 | 2011-10-06 02:14:33 +0900 | [diff] [blame] | 13 | typedef union _XEvent XEvent; |
dhollowa@chromium.org | bc3e361 | 2011-12-20 13:20:15 +0900 | [diff] [blame] | 14 | #elif defined(OS_MACOSX) |
| 15 | #if defined(__OBJC__) |
| 16 | @class NSEvent; |
| 17 | #else // __OBJC__ |
| 18 | class NSEvent; |
| 19 | #endif // __OBJC__ |
oshima@google.com | 9b786a5 | 2011-10-06 02:14:33 +0900 | [diff] [blame] | 20 | #endif |
| 21 | |
| 22 | namespace base { |
| 23 | |
| 24 | // Cross platform typedefs for native event types. |
| 25 | #if defined(OS_WIN) |
| 26 | typedef MSG NativeEvent; |
| 27 | #elif defined(USE_X11) |
| 28 | typedef XEvent* NativeEvent; |
dhollowa@chromium.org | bc3e361 | 2011-12-20 13:20:15 +0900 | [diff] [blame] | 29 | #elif defined(OS_MACOSX) |
| 30 | typedef NSEvent* NativeEvent; |
oshima@google.com | 9b786a5 | 2011-10-06 02:14:33 +0900 | [diff] [blame] | 31 | #else |
| 32 | typedef void* NativeEvent; |
| 33 | #endif |
| 34 | |
| 35 | } // namespace base |
| 36 | |
danakj | 0393da3 | 2015-03-10 09:31:16 +0900 | [diff] [blame] | 37 | #endif // BASE_EVENT_TYPES_H_ |