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

Side by Side Diff: chrome/browser/ui/libgtkui/gtk_key_bindings_handler.cc

Issue 2707313002: Gtk: Change NULL to nullptr (Closed)
Patch Set: Created 3 years, 10 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/libgtkui/gtk_key_bindings_handler.h" 5 #include "chrome/browser/ui/libgtkui/gtk_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 <stddef.h> 9 #include <stddef.h>
10 #include <X11/XKBlib.h> 10 #include <X11/XKBlib.h>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 &gdk_event); 74 &gdk_event);
75 75
76 bool matched = !edit_commands_.empty(); 76 bool matched = !edit_commands_.empty();
77 if (edit_commands) 77 if (edit_commands)
78 edit_commands->swap(edit_commands_); 78 edit_commands->swap(edit_commands_);
79 return matched; 79 return matched;
80 } 80 }
81 81
82 GtkWidget* Gtk2KeyBindingsHandler::CreateNewHandler() { 82 GtkWidget* Gtk2KeyBindingsHandler::CreateNewHandler() {
83 Handler* handler = 83 Handler* handler =
84 static_cast<Handler*>(g_object_new(HandlerGetType(), NULL)); 84 static_cast<Handler*>(g_object_new(HandlerGetType(), nullptr));
85 85
86 handler->owner = this; 86 handler->owner = this;
87 87
88 // We don't need to show the |handler| object on screen, so set its size to 88 // We don't need to show the |handler| object on screen, so set its size to
89 // zero. 89 // zero.
90 gtk_widget_set_size_request(GTK_WIDGET(handler), 0, 0); 90 gtk_widget_set_size_request(GTK_WIDGET(handler), 0, 0);
91 91
92 // Prevents it from handling any events by itself. 92 // Prevents it from handling any events by itself.
93 gtk_widget_set_sensitive(GTK_WIDGET(handler), FALSE); 93 gtk_widget_set_sensitive(GTK_WIDGET(handler), FALSE);
94 gtk_widget_set_events(GTK_WIDGET(handler), 0); 94 gtk_widget_set_events(GTK_WIDGET(handler), 0);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 NOTIMPLEMENTED(); 126 NOTIMPLEMENTED();
127 logged = true; 127 logged = true;
128 } 128 }
129 gdk_event->group = 0; 129 gdk_event->group = 0;
130 } 130 }
131 131
132 gdk_event->keyval = GDK_KEY_VoidSymbol; 132 gdk_event->keyval = GDK_KEY_VoidSymbol;
133 gdk_keymap_translate_keyboard_state( 133 gdk_keymap_translate_keyboard_state(
134 keymap, gdk_event->hardware_keycode, 134 keymap, gdk_event->hardware_keycode,
135 static_cast<GdkModifierType>(gdk_event->state), gdk_event->group, 135 static_cast<GdkModifierType>(gdk_event->state), gdk_event->group,
136 &gdk_event->keyval, NULL, NULL, &consumed); 136 &gdk_event->keyval, nullptr, nullptr, &consumed);
137 137
138 state = static_cast<GdkModifierType>(gdk_event->state & ~consumed); 138 state = static_cast<GdkModifierType>(gdk_event->state & ~consumed);
139 gdk_keymap_add_virtual_modifiers(keymap, &state); 139 gdk_keymap_add_virtual_modifiers(keymap, &state);
140 gdk_event->state |= state; 140 gdk_event->state |= state;
141 } 141 }
142 142
143 void Gtk2KeyBindingsHandler::HandlerInit(Handler* self) { 143 void Gtk2KeyBindingsHandler::HandlerInit(Handler* self) {
144 self->owner = NULL; 144 self->owner = nullptr;
145 } 145 }
146 146
147 void Gtk2KeyBindingsHandler::HandlerClassInit(HandlerClass* klass) { 147 void Gtk2KeyBindingsHandler::HandlerClassInit(HandlerClass* klass) {
148 GtkTextViewClass* text_view_class = GTK_TEXT_VIEW_CLASS(klass); 148 GtkTextViewClass* text_view_class = GTK_TEXT_VIEW_CLASS(klass);
149 GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass); 149 GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass);
150 150
151 // Overrides all virtual methods related to editor key bindings. 151 // Overrides all virtual methods related to editor key bindings.
152 text_view_class->backspace = BackSpace; 152 text_view_class->backspace = BackSpace;
153 text_view_class->copy_clipboard = CopyClipboard; 153 text_view_class->copy_clipboard = CopyClipboard;
154 text_view_class->cut_clipboard = CutClipboard; 154 text_view_class->cut_clipboard = CutClipboard;
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // Just for disabling the default handler. 425 // Just for disabling the default handler.
426 return FALSE; 426 return FALSE;
427 } 427 }
428 428
429 void Gtk2KeyBindingsHandler::MoveFocus(GtkWidget* widget, 429 void Gtk2KeyBindingsHandler::MoveFocus(GtkWidget* widget,
430 GtkDirectionType arg1) { 430 GtkDirectionType arg1) {
431 // Just for disabling the default handler. 431 // Just for disabling the default handler.
432 } 432 }
433 433
434 } // namespace libgtkui 434 } // namespace libgtkui
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_key_bindings_handler.h ('k') | chrome/browser/ui/libgtkui/gtk_status_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698