| 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 composition key event with specified event type. A composition |
| 105 // key event is a key event with special key code 229. |
| 106 void SendFakeCompositionKeyEvent(WebKit::WebInputEvent::Type type); |
| 107 |
| 103 // Signal handlers of GtkIMContext object. | 108 // Signal handlers of GtkIMContext object. |
| 104 static void HandleCommitThunk(GtkIMContext* context, gchar* text, | 109 static void HandleCommitThunk(GtkIMContext* context, gchar* text, |
| 105 GtkIMContextWrapper* self); | 110 GtkIMContextWrapper* self); |
| 106 static void HandlePreeditStartThunk(GtkIMContext* context, | 111 static void HandlePreeditStartThunk(GtkIMContext* context, |
| 107 GtkIMContextWrapper* self); | 112 GtkIMContextWrapper* self); |
| 108 static void HandlePreeditChangedThunk(GtkIMContext* context, | 113 static void HandlePreeditChangedThunk(GtkIMContext* context, |
| 109 GtkIMContextWrapper* self); | 114 GtkIMContextWrapper* self); |
| 110 static void HandlePreeditEndThunk(GtkIMContext* context, | 115 static void HandlePreeditEndThunk(GtkIMContext* context, |
| 111 GtkIMContextWrapper* self); | 116 GtkIMContextWrapper* self); |
| 112 | 117 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 203 |
| 199 // If it's true then the next "commit" signal will be suppressed. | 204 // If it's true then the next "commit" signal will be suppressed. |
| 200 // It's only used to workaround http://crbug.com/50485. | 205 // It's only used to workaround http://crbug.com/50485. |
| 201 // TODO(suzhe): Remove it after input methods get fixed. | 206 // TODO(suzhe): Remove it after input methods get fixed. |
| 202 bool suppress_next_commit_; | 207 bool suppress_next_commit_; |
| 203 | 208 |
| 204 DISALLOW_COPY_AND_ASSIGN(GtkIMContextWrapper); | 209 DISALLOW_COPY_AND_ASSIGN(GtkIMContextWrapper); |
| 205 }; | 210 }; |
| 206 | 211 |
| 207 #endif // CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ | 212 #endif // CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_ |
| OLD | NEW |