| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ | 5 #ifndef CHROME_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ |
| 6 #define CHROME_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ | 6 #define CHROME_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "webkit/api/public/WebInputEvent.h" | 9 #include "webkit/api/public/WebInputEvent.h" |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #elif defined(OS_MACOSX) | 13 #elif defined(OS_MACOSX) |
| 14 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
| 15 @class NSEvent; | 15 @class NSEvent; |
| 16 #else | 16 #else |
| 17 class NSEvent; | 17 class NSEvent; |
| 18 #endif // __OBJC__ | 18 #endif // __OBJC__ |
| 19 #elif defined(OS_LINUX) | 19 #elif defined(USE_X11) |
| 20 #include <gdk/gdk.h> | 20 #include <gdk/gdk.h> |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 // Owns a platform specific event; used to pass own and pass event through | 23 // Owns a platform specific event; used to pass own and pass event through |
| 24 // platform independent code. | 24 // platform independent code. |
| 25 struct NativeWebKeyboardEvent : public WebKit::WebKeyboardEvent { | 25 struct NativeWebKeyboardEvent : public WebKit::WebKeyboardEvent { |
| 26 NativeWebKeyboardEvent(); | 26 NativeWebKeyboardEvent(); |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 29 NativeWebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); | 29 NativeWebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 30 #elif defined(OS_MACOSX) | 30 #elif defined(OS_MACOSX) |
| 31 explicit NativeWebKeyboardEvent(NSEvent *event); | 31 explicit NativeWebKeyboardEvent(NSEvent *event); |
| 32 NativeWebKeyboardEvent(wchar_t character, | 32 NativeWebKeyboardEvent(wchar_t character, |
| 33 int state, | 33 int state, |
| 34 double time_stamp_seconds); | 34 double time_stamp_seconds); |
| 35 #elif defined(OS_LINUX) | 35 #elif defined(USE_X11) |
| 36 explicit NativeWebKeyboardEvent(const GdkEventKey* event); | 36 explicit NativeWebKeyboardEvent(const GdkEventKey* event); |
| 37 NativeWebKeyboardEvent(wchar_t character, | 37 NativeWebKeyboardEvent(wchar_t character, |
| 38 int state, | 38 int state, |
| 39 double time_stamp_seconds); | 39 double time_stamp_seconds); |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); | 42 NativeWebKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 43 ~NativeWebKeyboardEvent(); | 43 ~NativeWebKeyboardEvent(); |
| 44 | 44 |
| 45 NativeWebKeyboardEvent& operator=(const NativeWebKeyboardEvent& event); | 45 NativeWebKeyboardEvent& operator=(const NativeWebKeyboardEvent& event); |
| 46 | 46 |
| 47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 48 MSG os_event; | 48 MSG os_event; |
| 49 #elif defined(OS_MACOSX) | 49 #elif defined(OS_MACOSX) |
| 50 NSEvent* os_event; | 50 NSEvent* os_event; |
| 51 #elif defined(OS_LINUX) | 51 #elif defined(USE_X11) |
| 52 GdkEventKey* os_event; | 52 GdkEventKey* os_event; |
| 53 #endif | 53 #endif |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // CHROME_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ | 56 #endif // CHROME_COMMON_NATIVE_WEB_KEYBOARD_EVENT_H_ |
| OLD | NEW |