OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_LIBGTK2UI_GTK2_KEY_BINDINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_GTK2_KEY_BINDINGS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_KEY_BINDINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_LIBGTKUI_GTK2_KEY_BINDINGS_HANDLER_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/event_types.h" | 13 #include "base/event_types.h" |
14 #include "ui/base/ime/linux/text_edit_command_auralinux.h" | 14 #include "ui/base/ime/linux/text_edit_command_auralinux.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 struct NativeWebKeyboardEvent; | 17 struct NativeWebKeyboardEvent; |
18 } | 18 } |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
21 class Event; | 21 class Event; |
22 } | 22 } |
23 | 23 |
24 namespace libgtk2ui { | 24 namespace libgtkui { |
25 | 25 |
26 // This class is a convenience class for handling editor key bindings defined | 26 // This class is a convenience class for handling editor key bindings defined |
27 // in gtk keyboard theme. | 27 // in gtk keyboard theme. |
28 // In gtk, only GtkEntry and GtkTextView support customizing editor key bindings | 28 // In gtk, only GtkEntry and GtkTextView support customizing editor key bindings |
29 // through keyboard theme. And in gtk keyboard theme definition file, each key | 29 // through keyboard theme. And in gtk keyboard theme definition file, each key |
30 // binding must be bound to a specific class or object. So existing keyboard | 30 // binding must be bound to a specific class or object. So existing keyboard |
31 // themes only define editor key bindings exactly for GtkEntry and GtkTextView. | 31 // themes only define editor key bindings exactly for GtkEntry and GtkTextView. |
32 // Then, the only way for us to intercept editor key bindings defined in | 32 // Then, the only way for us to intercept editor key bindings defined in |
33 // keyboard theme, is to create a GtkEntry or GtkTextView object and call | 33 // keyboard theme, is to create a GtkEntry or GtkTextView object and call |
34 // gtk_bindings_activate_event() against it for the key events. If a key event | 34 // gtk_bindings_activate_event() against it for the key events. If a key event |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 GtkWidget* fake_window_; | 137 GtkWidget* fake_window_; |
138 GtkWidget* handler_; | 138 GtkWidget* handler_; |
139 | 139 |
140 // Buffer to store the match results. | 140 // Buffer to store the match results. |
141 std::vector<ui::TextEditCommandAuraLinux> edit_commands_; | 141 std::vector<ui::TextEditCommandAuraLinux> edit_commands_; |
142 | 142 |
143 // Whether the current X server has the XKeyboard extension. | 143 // Whether the current X server has the XKeyboard extension. |
144 bool has_xkb_; | 144 bool has_xkb_; |
145 }; | 145 }; |
146 | 146 |
147 } // namespace libgtk2ui | 147 } // namespace libgtkui |
148 | 148 |
149 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_KEY_BINDINGS_HANDLER_H_ | 149 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK2_KEY_BINDINGS_HANDLER_H_ |
OLD | NEW |