OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_GTK_GTK_CUSTOM_MENU_H_ |
| 6 #define CHROME_BROWSER_GTK_GTK_CUSTOM_MENU_H_ |
| 7 |
| 8 // GtkCustomMenu is a GtkMenu subclass that can contain, and collaborates with, |
| 9 // GtkCustomMenuItem instances. GtkCustomMenuItem is a GtkMenuItem that can |
| 10 // have buttons and other normal widgets embeded in it. GtkCustomMenu exists |
| 11 // only to override most of the button/motion/move callback functions so |
| 12 // that the normal GtkMenu implementation doesn't handle events related to |
| 13 // GtkCustomMenuItem items. |
| 14 // |
| 15 // For a more through overview of this system, see the comments in |
| 16 // gtk_custom_menu_item.h. |
| 17 |
| 18 #include <gdk/gdk.h> |
| 19 #include <gtk/gtk.h> |
| 20 #include <gtk/gtkmenuitem.h> |
| 21 |
| 22 G_BEGIN_DECLS |
| 23 |
| 24 #define GTK_TYPE_CUSTOM_MENU \ |
| 25 (gtk_custom_menu_get_type()) |
| 26 #define GTK_CUSTOM_MENU(obj) \ |
| 27 (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_CUSTOM_MENU, GtkCustomMenu)) |
| 28 #define GTK_CUSTOM_MENU_CLASS(klass) \ |
| 29 (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_CUSTOM_MENU, GtkCustomMenuClass)) |
| 30 #define GTK_IS_CUSTOM_MENU(obj) \ |
| 31 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_CUSTOM_MENU)) |
| 32 #define GTK_IS_CUSTOM_MENU_CLASS(klass) \ |
| 33 (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_CUSTOM_MENU)) |
| 34 #define GTK_CUSTOM_MENU_GET_CLASS(obj) \ |
| 35 (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_CUSTOM_MENU, GtkCustomMenuClass)) |
| 36 |
| 37 typedef struct _GtkCustomMenu GtkCustomMenu; |
| 38 typedef struct _GtkCustomMenuClass GtkCustomMenuClass; |
| 39 |
| 40 struct _GtkCustomMenu { |
| 41 GtkMenu menu; |
| 42 }; |
| 43 |
| 44 struct _GtkCustomMenuClass { |
| 45 GtkMenuClass parent_class; |
| 46 }; |
| 47 |
| 48 GType gtk_custom_menu_get_type(void) G_GNUC_CONST; |
| 49 GtkWidget* gtk_custom_menu_new(); |
| 50 |
| 51 G_END_DECLS |
| 52 |
| 53 #endif // CHROME_BROWSER_GTK_GTK_CUSTOM_MENU_H_ |
OLD | NEW |