Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.h

Issue 126118: Integrating GtkIMContext into the RenderWidgetHostViewGtk class.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
7 7
8 #include <gdk/gdk.h> 8 #include <gdk/gdk.h>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/gfx/native_widget_types.h" 11 #include "base/gfx/native_widget_types.h"
12 #include "chrome/browser/renderer_host/render_widget_host_view.h" 12 #include "chrome/browser/renderer_host/render_widget_host_view.h"
13 #include "chrome/common/owned_widget_gtk.h" 13 #include "chrome/common/owned_widget_gtk.h"
14 #include "chrome/common/render_messages.h" 14 #include "chrome/common/render_messages.h"
15 #include "webkit/glue/webcursor.h" 15 #include "webkit/glue/webcursor.h"
16 16
17 class RenderWidgetHost; 17 class RenderWidgetHost;
18 18
19 typedef struct _GtkClipboard GtkClipboard; 19 typedef struct _GtkClipboard GtkClipboard;
20 typedef struct _GtkSelectionData GtkSelectionData; 20 typedef struct _GtkSelectionData GtkSelectionData;
21 typedef struct _GtkIMContext GtkIMContext;
21 22
22 // ----------------------------------------------------------------------------- 23 // -----------------------------------------------------------------------------
23 // See comments in render_widget_host_view.h about this class and its members. 24 // See comments in render_widget_host_view.h about this class and its members.
24 // ----------------------------------------------------------------------------- 25 // -----------------------------------------------------------------------------
25 class RenderWidgetHostViewGtk : public RenderWidgetHostView { 26 class RenderWidgetHostViewGtk : public RenderWidgetHostView {
26 public: 27 public:
27 RenderWidgetHostViewGtk(RenderWidgetHost* widget); 28 RenderWidgetHostViewGtk(RenderWidgetHost* widget);
28 ~RenderWidgetHostViewGtk(); 29 ~RenderWidgetHostViewGtk();
29 30
30 // Initialize this object for use as a drawing area. 31 // Initialize this object for use as a drawing area.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 103
103 // Variables used only for popups -------------------------------------------- 104 // Variables used only for popups --------------------------------------------
104 // Our parent widget. 105 // Our parent widget.
105 RenderWidgetHostView* parent_host_view_; 106 RenderWidgetHostView* parent_host_view_;
106 // The native view of our parent, equivalent to 107 // The native view of our parent, equivalent to
107 // parent_host_view_->GetNativeView(). 108 // parent_host_view_->GetNativeView().
108 GtkWidget* parent_; 109 GtkWidget* parent_;
109 // We ignore the first mouse release on popups. This allows the popup to 110 // We ignore the first mouse release on popups. This allows the popup to
110 // stay open. 111 // stay open.
111 bool is_popup_first_mouse_release_; 112 bool is_popup_first_mouse_release_;
113
114 // The GtkIMContext object.
115 // In terms of the DOM event specification Appendix A
116 // <http://www.w3.org/TR/DOM-Level-3-Events/keyset.html>,
117 // GTK uses a GtkIMContext object for the following two purposes:
118 // 1. Composing Latin characters (A.1.2), and;
119 // 2. Composing CJK characters with an IME (A.1.3).
120 // Many JavaScript pages assume composed Latin characters are dispatched to
121 // their onkeypress() handlers but not dispatched CJK characters composed
122 // with an IME. To emulate this behavior, we should monitor the status of
123 // this GtkIMContext object and prevent sending Char events when a
124 // GtkIMContext object sends a "commit" signal with the CJK characters
125 // composed by an IME.
126 GtkIMContext* im_context_;
127
128 // Whether or not the above GtkIMContext is composing a CJK text with an IME.
129 // The GtkIMContext object sends a "preedit_start" before it starts composing
130 // a CJK text and a "preedit_end" signal after it finishes composing it.
131 // On the other hand, the GtkIMContext object doesn't send them when
132 // composing Latin texts. So, we monitor the above signals to check whether
133 // or not the GtkIMContext object is composing a CJK text.
134 bool im_is_composing_cjk_text_;
112 }; 135 };
113 136
114 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_ 137 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.cc ('k') | chrome/browser/renderer_host/render_widget_host_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698