OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
10 #include <pango/pango-attributes.h> | 10 #include <pango/pango-attributes.h> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" |
17 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" | |
17 #include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h" | 18 #include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h" |
18 | 19 |
19 namespace gfx { | 20 namespace gfx { |
20 class Rect; | 21 class Rect; |
21 } | 22 } |
22 | 23 |
23 #if !defined(TOOLKIT_VIEWS) | 24 #if !defined(TOOLKIT_VIEWS) |
24 class MenuGtk; | 25 class MenuGtk; |
25 #endif | 26 #endif |
26 class RenderWidgetHostViewGtk; | 27 class RenderWidgetHostViewGtk; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 void HandlePreeditEnd(); | 94 void HandlePreeditEnd(); |
94 | 95 |
95 // Real code of "realize" signal handler, used for setting im context's client | 96 // Real code of "realize" signal handler, used for setting im context's client |
96 // window. | 97 // window. |
97 void HandleHostViewRealize(GtkWidget* widget); | 98 void HandleHostViewRealize(GtkWidget* widget); |
98 | 99 |
99 // Real code of "unrealize" signal handler, used for unsetting im context's | 100 // Real code of "unrealize" signal handler, used for unsetting im context's |
100 // client window. | 101 // client window. |
101 void HandleHostViewUnrealize(); | 102 void HandleHostViewUnrealize(); |
102 | 103 |
104 // Sends a fake key event with specified event type. | |
105 void SendFakeKeyEvent(WebKit::WebInputEvent::Type type); | |
Evan Martin
2010/12/13 23:09:26
I guess this always sends a composition key event?
| |
106 | |
103 // Signal handlers of GtkIMContext object. | 107 // Signal handlers of GtkIMContext object. |
104 static void HandleCommitThunk(GtkIMContext* context, gchar* text, | 108 static void HandleCommitThunk(GtkIMContext* context, gchar* text, |
105 GtkIMContextWrapper* self); | 109 GtkIMContextWrapper* self); |
106 static void HandlePreeditStartThunk(GtkIMContext* context, | 110 static void HandlePreeditStartThunk(GtkIMContext* context, |
107 GtkIMContextWrapper* self); | 111 GtkIMContextWrapper* self); |
108 static void HandlePreeditChangedThunk(GtkIMContext* context, | 112 static void HandlePreeditChangedThunk(GtkIMContext* context, |
109 GtkIMContextWrapper* self); | 113 GtkIMContextWrapper* self); |
110 static void HandlePreeditEndThunk(GtkIMContext* context, | 114 static void HandlePreeditEndThunk(GtkIMContext* context, |
111 GtkIMContextWrapper* self); | 115 GtkIMContextWrapper* self); |
112 | 116 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 | 202 |
199 // If it's true then the next "commit" signal will be suppressed. | 203 // If it's true then the next "commit" signal will be suppressed. |
200 // It's only used to workaround http://crbug.com/50485. | 204 // It's only used to workaround http://crbug.com/50485. |
201 // TODO(suzhe): Remove it after input methods get fixed. | 205 // TODO(suzhe): Remove it after input methods get fixed. |
202 bool suppress_next_commit_; | 206 bool suppress_next_commit_; |
203 | 207 |
204 DISALLOW_COPY_AND_ASSIGN(GtkIMContextWrapper); | 208 DISALLOW_COPY_AND_ASSIGN(GtkIMContextWrapper); |
205 }; | 209 }; |
206 | 210 |
207 #endif // CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ | 211 #endif // CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ |
OLD | NEW |