OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/gtk_custom_menu.h" | 5 #include "chrome/browser/ui/gtk/gtk_custom_menu.h" |
6 | 6 |
7 #include "chrome/browser/gtk/gtk_custom_menu_item.h" | 7 #include "chrome/browser/ui/gtk/gtk_custom_menu_item.h" |
8 | 8 |
9 G_DEFINE_TYPE(GtkCustomMenu, gtk_custom_menu, GTK_TYPE_MENU) | 9 G_DEFINE_TYPE(GtkCustomMenu, gtk_custom_menu, GTK_TYPE_MENU) |
10 | 10 |
11 // Stolen directly from gtkmenushell.c. I'd love to call the library version | 11 // Stolen directly from gtkmenushell.c. I'd love to call the library version |
12 // instead, but it's static and isn't exported. :( | 12 // instead, but it's static and isn't exported. :( |
13 static gint gtk_menu_shell_is_item(GtkMenuShell* menu_shell, | 13 static gint gtk_menu_shell_is_item(GtkMenuShell* menu_shell, |
14 GtkWidget* child) { | 14 GtkWidget* child) { |
15 GtkWidget *parent; | 15 GtkWidget *parent; |
16 | 16 |
17 g_return_val_if_fail(GTK_IS_MENU_SHELL(menu_shell), FALSE); | 17 g_return_val_if_fail(GTK_IS_MENU_SHELL(menu_shell), FALSE); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 widget_class->button_press_event = gtk_custom_menu_button_press; | 141 widget_class->button_press_event = gtk_custom_menu_button_press; |
142 widget_class->button_release_event = gtk_custom_menu_button_release; | 142 widget_class->button_release_event = gtk_custom_menu_button_release; |
143 widget_class->motion_notify_event = gtk_custom_menu_motion_notify; | 143 widget_class->motion_notify_event = gtk_custom_menu_motion_notify; |
144 | 144 |
145 menu_shell_class->move_current = gtk_custom_menu_move_current; | 145 menu_shell_class->move_current = gtk_custom_menu_move_current; |
146 } | 146 } |
147 | 147 |
148 GtkWidget* gtk_custom_menu_new() { | 148 GtkWidget* gtk_custom_menu_new() { |
149 return GTK_WIDGET(g_object_new(GTK_TYPE_CUSTOM_MENU, NULL)); | 149 return GTK_WIDGET(g_object_new(GTK_TYPE_CUSTOM_MENU, NULL)); |
150 } | 150 } |
OLD | NEW |