1/* GTK - The GIMP Toolkit
2 * Copyright © 2014 Red Hat, Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GTK_POPOVER_MENU_H__
19#define __GTK_POPOVER_MENU_H__
20
21#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22#error "Only <gtk/gtk.h> can be included directly."
23#endif
24
25#include <gtk/gtkpopover.h>
26
27G_BEGIN_DECLS
28
29#define GTK_TYPE_POPOVER_MENU (gtk_popover_menu_get_type ())
30#define GTK_POPOVER_MENU(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_POPOVER_MENU, GtkPopoverMenu))
31#define GTK_IS_POPOVER_MENU(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_POPOVER_MENU))
32
33typedef struct _GtkPopoverMenu GtkPopoverMenu;
34
35GDK_AVAILABLE_IN_ALL
36GType gtk_popover_menu_get_type (void) G_GNUC_CONST;
37
38GDK_AVAILABLE_IN_ALL
39GtkWidget * gtk_popover_menu_new_from_model (GMenuModel *model);
40
41/**
42 * GtkPopoverMenuFlags:
43 * @GTK_POPOVER_MENU_NESTED: Create submenus as nested
44 * popovers. Without this flag, submenus are created as
45 * sliding pages that replace the main menu.
46 *
47 * Flags that affect how popover menus are created from
48 * a menu model.
49 */
50typedef enum {
51 GTK_POPOVER_MENU_NESTED = 1 << 0
52} GtkPopoverMenuFlags;
53
54GDK_AVAILABLE_IN_ALL
55GtkWidget * gtk_popover_menu_new_from_model_full (GMenuModel *model,
56 GtkPopoverMenuFlags flags);
57
58GDK_AVAILABLE_IN_ALL
59void gtk_popover_menu_set_menu_model (GtkPopoverMenu *popover,
60 GMenuModel *model);
61GDK_AVAILABLE_IN_ALL
62GMenuModel *gtk_popover_menu_get_menu_model (GtkPopoverMenu *popover);
63
64GDK_AVAILABLE_IN_ALL
65gboolean gtk_popover_menu_add_child (GtkPopoverMenu *popover,
66 GtkWidget *child,
67 const char *id);
68
69GDK_AVAILABLE_IN_ALL
70gboolean gtk_popover_menu_remove_child (GtkPopoverMenu *popover,
71 GtkWidget *child);
72
73G_END_DECLS
74
75#endif /* __GTK_POPOVER_MENU_H__ */
76

source code of gtk/gtk/gtkpopovermenu.h