]> Pileus Git - ~andy/gtk/blob - gtk/gtkmenushell.h
version bump to 1.1.8, binary age 0, interface age 0, depend on GLib
[~andy/gtk] / gtk / gtkmenushell.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library 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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library 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.
18  */
19 #ifndef __GTK_MENU_SHELL_H__
20 #define __GTK_MENU_SHELL_H__
21
22
23 #include <gdk/gdk.h>
24 #include <gtk/gtkcontainer.h>
25
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31
32 #define GTK_TYPE_MENU_SHELL             (gtk_menu_shell_get_type ())
33 #define GTK_MENU_SHELL(obj)             (GTK_CHECK_CAST ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShell))
34 #define GTK_MENU_SHELL_CLASS(klass)     (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
35 #define GTK_IS_MENU_SHELL(obj)          (GTK_CHECK_TYPE ((obj), GTK_TYPE_MENU_SHELL))
36 #define GTK_IS_MENU_SHELL_CLASS(klass)  (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL))
37
38
39 typedef struct _GtkMenuShell       GtkMenuShell;
40 typedef struct _GtkMenuShellClass  GtkMenuShellClass;
41
42 struct _GtkMenuShell
43 {
44   GtkContainer container;
45   
46   GList *children;
47   GtkWidget *active_menu_item;
48   GtkWidget *parent_menu_shell;
49   
50   guint active : 1;
51   guint have_grab : 1;
52   guint have_xgrab : 1;
53   guint button : 2;
54   guint ignore_leave : 1;
55   guint menu_flag : 1;
56   guint ignore_enter : 1;
57   
58   guint32 activate_time;
59 };
60
61 struct _GtkMenuShellClass
62 {
63   GtkContainerClass parent_class;
64   
65   guint submenu_placement : 1;
66   
67   void (*deactivate)     (GtkMenuShell *menu_shell);
68   void (*selection_done) (GtkMenuShell *menu_shell);
69
70   void (*move_current)     (GtkMenuShell        *menu_shell,
71                             GtkMenuDirectionType direction);
72   void (*activate_current) (GtkMenuShell *menu_shell,
73                             gboolean      force_hide);
74   void (*cancel)           (GtkMenuShell *menu_shell);
75 };
76
77
78 GtkType gtk_menu_shell_get_type   (void);
79 void    gtk_menu_shell_append     (GtkMenuShell *menu_shell,
80                                    GtkWidget    *child);
81 void    gtk_menu_shell_prepend    (GtkMenuShell *menu_shell,
82                                    GtkWidget    *child);
83 void    gtk_menu_shell_insert     (GtkMenuShell *menu_shell,
84                                    GtkWidget    *child,
85                                    gint          position);
86 void    gtk_menu_shell_deactivate (GtkMenuShell *menu_shell);
87 void    gtk_menu_shell_select_item (GtkMenuShell      *menu_shell,
88                                     GtkWidget         *menu_item);
89 void    gtk_menu_shell_activate_item  (GtkMenuShell      *menu_shell,
90                                        GtkWidget         *menu_item,
91                                        gboolean           force_deactivate);
92
93
94 #ifdef __cplusplus
95 }
96 #endif /* __cplusplus */
97
98
99 #endif /* __GTK_MENU_SHELL_H__ */