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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_key_bindings_handler.cc

Issue 1234223005: Initial gtk3 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed abort on GtkPrintUnixDialog Created 5 years, 5 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
OLDNEW
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 #include "chrome/browser/ui/libgtk2ui/gtk2_key_bindings_handler.h" 5 #include "chrome/browser/ui/libgtk2ui/gtk2_key_bindings_handler.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/XKBlib.h> 9 #include <X11/XKBlib.h>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 const ui::KeyEvent& key_event = static_cast<const ui::KeyEvent&>(event); 54 const ui::KeyEvent& key_event = static_cast<const ui::KeyEvent&>(event);
55 if (key_event.is_char() || !key_event.native_event()) 55 if (key_event.is_char() || !key_event.native_event())
56 return false; 56 return false;
57 57
58 GdkEventKey gdk_event; 58 GdkEventKey gdk_event;
59 BuildGdkEventKeyFromXEvent(key_event.native_event(), &gdk_event); 59 BuildGdkEventKeyFromXEvent(key_event.native_event(), &gdk_event);
60 60
61 edit_commands_.clear(); 61 edit_commands_.clear();
62 // If this key event matches a predefined key binding, corresponding signal 62 // If this key event matches a predefined key binding, corresponding signal
63 // will be emitted. 63 // will be emitted.
64 gtk_bindings_activate_event(GTK_OBJECT(handler_.get()), &gdk_event); 64 gtk_bindings_activate_event(G_OBJECT(handler_.get()), &gdk_event);
65 65
66 bool matched = !edit_commands_.empty(); 66 bool matched = !edit_commands_.empty();
67 if (edit_commands) 67 if (edit_commands)
68 edit_commands->swap(edit_commands_); 68 edit_commands->swap(edit_commands_);
69 return matched; 69 return matched;
70 } 70 }
71 71
72 GtkWidget* Gtk2KeyBindingsHandler::CreateNewHandler() { 72 GtkWidget* Gtk2KeyBindingsHandler::CreateNewHandler() {
73 Handler* handler = 73 Handler* handler =
74 static_cast<Handler*>(g_object_new(HandlerGetType(), NULL)); 74 static_cast<Handler*>(g_object_new(HandlerGetType(), NULL));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // whether a modifier key affects the keybinding, but that should be 116 // whether a modifier key affects the keybinding, but that should be
117 // extremely rare. 117 // extremely rare.
118 static bool logged = false; 118 static bool logged = false;
119 if (!logged) { 119 if (!logged) {
120 NOTIMPLEMENTED(); 120 NOTIMPLEMENTED();
121 logged = true; 121 logged = true;
122 } 122 }
123 gdk_event->group = 0; 123 gdk_event->group = 0;
124 } 124 }
125 125
126 gdk_event->keyval = GDK_VoidSymbol; 126 gdk_event->keyval = GDK_KEY_VoidSymbol;
127 gdk_keymap_translate_keyboard_state( 127 gdk_keymap_translate_keyboard_state(
128 keymap, 128 keymap,
129 gdk_event->hardware_keycode, 129 gdk_event->hardware_keycode,
130 static_cast<GdkModifierType>(gdk_event->state), 130 static_cast<GdkModifierType>(gdk_event->state),
131 gdk_event->group, 131 gdk_event->group,
132 &gdk_event->keyval, 132 &gdk_event->keyval,
133 NULL, NULL, &consumed); 133 NULL, NULL, &consumed);
134 134
135 state = static_cast<GdkModifierType>(gdk_event->state & ~consumed); 135 state = static_cast<GdkModifierType>(gdk_event->state & ~consumed);
136 gdk_keymap_add_virtual_modifiers(keymap, &state); 136 gdk_keymap_add_virtual_modifiers(keymap, &state);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // Just for disabling the default handler. 387 // Just for disabling the default handler.
388 return FALSE; 388 return FALSE;
389 } 389 }
390 390
391 void Gtk2KeyBindingsHandler::MoveFocus(GtkWidget* widget, 391 void Gtk2KeyBindingsHandler::MoveFocus(GtkWidget* widget,
392 GtkDirectionType arg1) { 392 GtkDirectionType arg1) {
393 // Just for disabling the default handler. 393 // Just for disabling the default handler.
394 } 394 }
395 395
396 } // namespace libgtk2ui 396 } // namespace libgtk2ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698