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