OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 WEBKIT_GLUE_WEBINPUTEVENT_H_ | 5 #ifndef WEBKIT_GLUE_WEBINPUTEVENT_H_ |
6 #define WEBKIT_GLUE_WEBINPUTEVENT_H_ | 6 #define WEBKIT_GLUE_WEBINPUTEVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <windows.h> | 11 #include <windows.h> |
12 #elif defined(OS_MACOSX) | 12 #elif defined(OS_MACOSX) |
13 #include <vector> | 13 #include <vector> |
14 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
15 @class NSEvent; | 15 @class NSEvent; |
16 @class NSView; | 16 @class NSView; |
17 #else | 17 #else |
18 class NSEvent; | 18 class NSEvent; |
19 class NSView; | 19 class NSView; |
20 #endif // __OBJC__ | 20 #endif // __OBJC__ |
21 #elif defined(OS_LINUX) | 21 #elif defined(OS_LINUX) |
22 #include <glib.h> | |
22 typedef struct _GdkEventButton GdkEventButton; | 23 typedef struct _GdkEventButton GdkEventButton; |
23 typedef struct _GdkEventMotion GdkEventMotion; | 24 typedef struct _GdkEventMotion GdkEventMotion; |
24 typedef struct _GdkEventScroll GdkEventScroll; | 25 typedef struct _GdkEventScroll GdkEventScroll; |
25 typedef struct _GdkEventKey GdkEventKey; | 26 typedef struct _GdkEventKey GdkEventKey; |
26 #endif | 27 #endif |
27 | 28 |
28 // The classes defined in this file are intended to be used with WebView's | 29 // The classes defined in this file are intended to be used with WebView's |
29 // HandleInputEvent method. These event types are cross-platform; however, | 30 // HandleInputEvent method. These event types are cross-platform; however, |
30 // there are platform-specific constructors that accept native UI events. | 31 // there are platform-specific constructors that accept native UI events. |
31 // | 32 // |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 std::vector<unsigned short> key_identifier; | 142 std::vector<unsigned short> key_identifier; |
142 #elif defined(OS_WIN) | 143 #elif defined(OS_WIN) |
143 bool system_key; // Set if we receive a SYSKEYDOWN/WM_SYSKEYUP message. | 144 bool system_key; // Set if we receive a SYSKEYDOWN/WM_SYSKEYUP message. |
144 MSG actual_message; // Set to the current keyboard message. | 145 MSG actual_message; // Set to the current keyboard message. |
145 #elif defined(OS_LINUX) | 146 #elif defined(OS_LINUX) |
146 // The unicode character, if available, corresponding to this key event. | 147 // The unicode character, if available, corresponding to this key event. |
147 // TODO(evanm): temporary hack for test_shell. Ideally we'd either manage | 148 // TODO(evanm): temporary hack for test_shell. Ideally we'd either manage |
148 // to stuff everything into key_code, or make this field shared by all | 149 // to stuff everything into key_code, or make this field shared by all |
149 // implementations, but this will have to do for now. | 150 // implementations, but this will have to do for now. |
150 wchar_t text; | 151 wchar_t text; |
152 | |
153 // Stores the GDK keyval and modifier state of the GdkEventKey; this is used | |
154 // to transport these values across IPC so they can be used in the front end | |
155 // code. | |
156 guint gdk_keyval; | |
157 guint gdk_modifier; | |
Avi (use Gerrit)
2009/02/25 22:38:40
How is this different from the existing modifier i
darin (slow to review)
2009/02/26 04:16:55
yeah, i don't understand this either. PlatformKey
| |
151 #endif | 158 #endif |
152 | 159 |
153 WebKeyboardEvent() | 160 WebKeyboardEvent() |
154 : key_code(0) | 161 : key_code(0) |
155 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
156 , system_key(false) { | 163 , system_key(false) { |
157 memset(&actual_message, 0, sizeof(actual_message)); | 164 memset(&actual_message, 0, sizeof(actual_message)); |
158 } | 165 } |
159 #else | 166 #else |
160 {} | 167 {} |
161 #endif | 168 #endif |
162 | 169 |
163 #if defined(OS_WIN) | 170 #if defined(OS_WIN) |
164 WebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); | 171 WebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam); |
165 #elif defined(OS_MACOSX) | 172 #elif defined(OS_MACOSX) |
166 WebKeyboardEvent(NSEvent *event); | 173 WebKeyboardEvent(NSEvent *event); |
167 #elif defined(OS_LINUX) | 174 #elif defined(OS_LINUX) |
168 explicit WebKeyboardEvent(const GdkEventKey* event); | 175 explicit WebKeyboardEvent(const GdkEventKey* event); |
169 #endif | 176 #endif |
170 }; | 177 }; |
171 | 178 |
172 | 179 |
173 #endif // WEBKIT_GLUE_WEBINPUTEVENT_H_ | 180 #endif // WEBKIT_GLUE_WEBINPUTEVENT_H_ |
OLD | NEW |