]> Pileus Git - ~andy/gtk/blob - gtk/gtkmenushell.h
Revert name change
[~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 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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
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/.
25  */
26
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
29 #endif
30
31 #ifndef __GTK_MENU_SHELL_H__
32 #define __GTK_MENU_SHELL_H__
33
34
35 #include <gdk/gdk.h>
36 #include <gtk/gtkcontainer.h>
37
38
39 G_BEGIN_DECLS
40
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))
47
48
49 typedef struct _GtkMenuShell       GtkMenuShell;
50 typedef struct _GtkMenuShellClass  GtkMenuShellClass;
51
52 struct _GtkMenuShell
53 {
54   GtkContainer container;
55
56   GList *GSEAL (children);
57   GtkWidget *GSEAL (active_menu_item);
58   GtkWidget *GSEAL (parent_menu_shell);
59
60   guint GSEAL (button);
61   guint32 GSEAL (activate_time);
62
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;
69 };
70
71 struct _GtkMenuShellClass
72 {
73   GtkContainerClass parent_class;
74   
75   guint submenu_placement : 1;
76   
77   void (*deactivate)     (GtkMenuShell *menu_shell);
78   void (*selection_done) (GtkMenuShell *menu_shell);
79
80   void (*move_current)     (GtkMenuShell        *menu_shell,
81                             GtkMenuDirectionType direction);
82   void (*activate_current) (GtkMenuShell *menu_shell,
83                             gboolean      force_hide);
84   void (*cancel)           (GtkMenuShell *menu_shell);
85   void (*select_item)      (GtkMenuShell *menu_shell,
86                             GtkWidget    *menu_item);
87   void (*insert)           (GtkMenuShell *menu_shell,
88                             GtkWidget    *child,
89                             gint          position);
90   gint (*get_popup_delay)  (GtkMenuShell *menu_shell);
91   gboolean (*move_selected) (GtkMenuShell *menu_shell,
92                              gint          distance);
93
94   /* Padding for future expansion */
95   void (*_gtk_reserved1) (void);
96   void (*_gtk_reserved2) (void);
97 };
98
99
100 GType gtk_menu_shell_get_type          (void) G_GNUC_CONST;
101 void  gtk_menu_shell_append            (GtkMenuShell *menu_shell,
102                                         GtkWidget    *child);
103 void  gtk_menu_shell_prepend           (GtkMenuShell *menu_shell,
104                                         GtkWidget    *child);
105 void  gtk_menu_shell_insert            (GtkMenuShell *menu_shell,
106                                         GtkWidget    *child,
107                                         gint          position);
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);
122
123 void  _gtk_menu_shell_add_mnemonic     (GtkMenuShell *menu_shell,
124                                         guint         keyval,
125                                         GtkWidget    *target);
126 void  _gtk_menu_shell_remove_mnemonic  (GtkMenuShell *menu_shell,
127                                         guint         keyval,
128                                         GtkWidget    *target);
129
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);
133
134 G_END_DECLS
135
136 #endif /* __GTK_MENU_SHELL_H__ */