1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
31 #ifndef __GTK_MENU_SHELL_H__
32 #define __GTK_MENU_SHELL_H__
36 #include <gtk/gtkcontainer.h>
41 #define GTK_TYPE_MENU_SHELL (gtk_menu_shell_get_type ())
42 #define GTK_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShell))
43 #define GTK_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
44 #define GTK_IS_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_SHELL))
45 #define GTK_IS_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL))
46 #define GTK_MENU_SHELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
49 typedef struct _GtkMenuShell GtkMenuShell;
50 typedef struct _GtkMenuShellClass GtkMenuShellClass;
54 GtkContainer container;
56 GList *GSEAL (children);
57 GtkWidget *GSEAL (active_menu_item);
58 GtkWidget *GSEAL (parent_menu_shell);
61 guint32 GSEAL (activate_time);
63 guint GSEAL (active) : 1;
64 guint GSEAL (have_grab) : 1;
65 guint GSEAL (have_xgrab) : 1;
66 guint GSEAL (ignore_leave) : 1; /* unused */
67 guint GSEAL (menu_flag) : 1; /* unused */
68 guint GSEAL (ignore_enter) : 1;
71 struct _GtkMenuShellClass
73 GtkContainerClass parent_class;
75 guint submenu_placement : 1;
77 void (*deactivate) (GtkMenuShell *menu_shell);
78 void (*selection_done) (GtkMenuShell *menu_shell);
80 void (*move_current) (GtkMenuShell *menu_shell,
81 GtkMenuDirectionType direction);
82 void (*activate_current) (GtkMenuShell *menu_shell,
84 void (*cancel) (GtkMenuShell *menu_shell);
85 void (*select_item) (GtkMenuShell *menu_shell,
86 GtkWidget *menu_item);
87 void (*insert) (GtkMenuShell *menu_shell,
90 gint (*get_popup_delay) (GtkMenuShell *menu_shell);
91 gboolean (*move_selected) (GtkMenuShell *menu_shell,
94 /* Padding for future expansion */
95 void (*_gtk_reserved1) (void);
96 void (*_gtk_reserved2) (void);
100 GType gtk_menu_shell_get_type (void) G_GNUC_CONST;
101 void gtk_menu_shell_append (GtkMenuShell *menu_shell,
103 void gtk_menu_shell_prepend (GtkMenuShell *menu_shell,
105 void gtk_menu_shell_insert (GtkMenuShell *menu_shell,
108 void gtk_menu_shell_deactivate (GtkMenuShell *menu_shell);
109 void gtk_menu_shell_select_item (GtkMenuShell *menu_shell,
110 GtkWidget *menu_item);
111 void gtk_menu_shell_deselect (GtkMenuShell *menu_shell);
112 void gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
113 GtkWidget *menu_item,
114 gboolean force_deactivate);
115 void gtk_menu_shell_select_first (GtkMenuShell *menu_shell,
116 gboolean search_sensitive);
117 void _gtk_menu_shell_select_last (GtkMenuShell *menu_shell,
118 gboolean search_sensitive);
119 void _gtk_menu_shell_activate (GtkMenuShell *menu_shell);
120 gint _gtk_menu_shell_get_popup_delay (GtkMenuShell *menu_shell);
121 void gtk_menu_shell_cancel (GtkMenuShell *menu_shell);
123 void _gtk_menu_shell_add_mnemonic (GtkMenuShell *menu_shell,
126 void _gtk_menu_shell_remove_mnemonic (GtkMenuShell *menu_shell,
130 gboolean gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell);
131 void gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
132 gboolean take_focus);
136 #endif /* __GTK_MENU_SHELL_H__ */