Ardour  9.0-pre0-582-g084a23a80d
gtkmenu.h
Go to the documentation of this file.
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 #ifndef __GTK_MENU_H__
28 #define __GTK_MENU_H__
29 
30 
31 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
32 #error "Only <gtk/gtk.h> can be included directly."
33 #endif
34 
35 #include <gtk/gtkaccelgroup.h>
36 #include <gtk/gtkmenushell.h>
37 
38 
39 G_BEGIN_DECLS
40 
41 #define GTK_TYPE_MENU (gtk_menu_get_type ())
42 #define GTK_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU, GtkMenu))
43 #define GTK_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU, GtkMenuClass))
44 #define GTK_IS_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU))
45 #define GTK_IS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU))
46 #define GTK_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU, GtkMenuClass))
47 
48 
49 typedef struct _GtkMenu GtkMenu;
50 typedef struct _GtkMenuClass GtkMenuClass;
51 
52 typedef void (*GtkMenuPositionFunc) (GtkMenu *menu,
53  gint *x,
54  gint *y,
55  gboolean *push_in,
56  gpointer user_data);
57 typedef void (*GtkMenuDetachFunc) (GtkWidget *attach_widget,
58  GtkMenu *menu);
59 
60 struct _GtkMenu
61 {
62  GtkMenuShell GSEAL (menu_shell);
63 
64  GtkWidget *GSEAL (parent_menu_item);
65  GtkWidget *GSEAL (old_active_menu_item);
66 
67  GtkAccelGroup *GSEAL (accel_group);
68  gchar *GSEAL (accel_path);
69  GtkMenuPositionFunc GSEAL (position_func);
70  gpointer GSEAL (position_func_data);
71 
72  guint GSEAL (toggle_size);
73  /* Do _not_ touch these widgets directly. We hide the reference
74  * count from the toplevel to the menu, so it must be restored
75  * before operating on these widgets
76  */
77  GtkWidget *GSEAL (toplevel);
78 
79  GtkWidget *GSEAL (tearoff_window);
80  GtkWidget *GSEAL (tearoff_hbox);
81  GtkWidget *GSEAL (tearoff_scrollbar);
82  GtkAdjustment *GSEAL (tearoff_adjustment);
83 
84  GdkWindow *GSEAL (view_window);
85  GdkWindow *GSEAL (bin_window);
86 
87  gint GSEAL (scroll_offset);
88  gint GSEAL (saved_scroll_offset);
89  gint GSEAL (scroll_step);
90  guint GSEAL (timeout_id);
91 
92  /* When a submenu of this menu is popped up, motion in this
93  * region is ignored
94  */
95  GdkRegion *GSEAL (navigation_region); /* unused */
96  guint GSEAL (navigation_timeout);
97 
98  guint GSEAL (needs_destruction_ref_count) : 1;
99  guint GSEAL (torn_off) : 1;
100  /* The tearoff is active when it is torn off and the not-torn-off
101  * menu is not popped up.
102  */
103  guint GSEAL (tearoff_active) : 1;
104 
105  guint GSEAL (scroll_fast) : 1;
106 
107  guint GSEAL (upper_arrow_visible) : 1;
108  guint GSEAL (lower_arrow_visible) : 1;
109  guint GSEAL (upper_arrow_prelight) : 1;
110  guint GSEAL (lower_arrow_prelight) : 1;
111 };
112 
114 {
116 
117  /* Padding for future expansion */
118  void (*_gtk_reserved1) (void);
119  void (*_gtk_reserved2) (void);
120  void (*_gtk_reserved3) (void);
121  void (*_gtk_reserved4) (void);
122 };
123 
124 
125 GType gtk_menu_get_type (void) G_GNUC_CONST;
127 
128 /* Display the menu onscreen */
130  GtkWidget *parent_menu_shell,
131  GtkWidget *parent_menu_item,
132  GtkMenuPositionFunc func,
133  gpointer data,
134  guint button,
135  guint32 activate_time);
136 
137 /* Position the menu according to its position function. Called
138  * from gtkmenuitem.c when a menu-item changes its allocation
139  */
141 
143 
144 /* Keep track of the last menu item selected. (For the purposes
145  * of the option menu
146  */
149  guint index_);
150 
151 /* set/get the accelerator group that holds global accelerators (should
152  * be added to the corresponding toplevel with gtk_window_add_accel_group().
153  */
155  GtkAccelGroup *accel_group);
158  const gchar *accel_path);
159 const gchar* gtk_menu_get_accel_path (GtkMenu *menu);
160 
161 /* A reference count is kept for a widget when it is attached to
162  * a particular widget. This is typically a menu item; it may also
163  * be a widget with a popup menu - for instance, the Notebook widget.
164  */
166  GtkWidget *attach_widget,
167  GtkMenuDetachFunc detacher);
169 
170 /* This should be dumped in favor of data set when the menu is popped
171  * up - that is currently in the ItemFactory code, but should be
172  * in the Menu code.
173  */
175 
177  gboolean torn_off);
179 
180 /* This sets the window manager title for the window that
181  * appears when a menu is torn off
182  */
184  const gchar *title);
185 const gchar *gtk_menu_get_title (GtkMenu *menu);
186 
188  GtkWidget *child,
189  gint position);
190 
192  GdkScreen *screen);
193 
195  GtkWidget *child,
196  guint left_attach,
197  guint right_attach,
198  guint top_attach,
199  guint bottom_attach);
200 
202  gint monitor_num);
205 
206 #ifndef GTK_DISABLE_DEPRECATED
207 #define gtk_menu_append(menu,child) gtk_menu_shell_append ((GtkMenuShell *)(menu),(child))
208 #define gtk_menu_prepend(menu,child) gtk_menu_shell_prepend ((GtkMenuShell *)(menu),(child))
209 #define gtk_menu_insert(menu,child,pos) gtk_menu_shell_insert ((GtkMenuShell *)(menu),(child),(pos))
210 #endif /* GTK_DISABLE_DEPRECATED */
211 
213  gboolean reserve_toggle_size);
215 
216 
217 G_END_DECLS
218 
219 #endif /* __GTK_MENU_H__ */
void gtk_menu_set_monitor(GtkMenu *menu, gint monitor_num)
GList * gtk_menu_get_for_attach_widget(GtkWidget *widget)
void gtk_menu_popdown(GtkMenu *menu)
gboolean gtk_menu_get_tearoff_state(GtkMenu *menu)
void gtk_menu_reposition(GtkMenu *menu)
void gtk_menu_popup(GtkMenu *menu, GtkWidget *parent_menu_shell, GtkWidget *parent_menu_item, GtkMenuPositionFunc func, gpointer data, guint button, guint32 activate_time)
GtkWidget * gtk_menu_get_attach_widget(GtkMenu *menu)
void gtk_menu_set_title(GtkMenu *menu, const gchar *title)
void gtk_menu_set_reserve_toggle_size(GtkMenu *menu, gboolean reserve_toggle_size)
void gtk_menu_attach(GtkMenu *menu, GtkWidget *child, guint left_attach, guint right_attach, guint top_attach, guint bottom_attach)
const gchar * gtk_menu_get_accel_path(GtkMenu *menu)
void gtk_menu_set_active(GtkMenu *menu, guint index_)
void gtk_menu_set_accel_group(GtkMenu *menu, GtkAccelGroup *accel_group)
const gchar * gtk_menu_get_title(GtkMenu *menu)
void gtk_menu_reorder_child(GtkMenu *menu, GtkWidget *child, gint position)
GtkWidget * gtk_menu_get_active(GtkMenu *menu)
void gtk_menu_set_screen(GtkMenu *menu, GdkScreen *screen)
void(* GtkMenuPositionFunc)(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
Definition: gtkmenu.h:52
void(* GtkMenuDetachFunc)(GtkWidget *attach_widget, GtkMenu *menu)
Definition: gtkmenu.h:57
gint gtk_menu_get_monitor(GtkMenu *menu)
void gtk_menu_set_accel_path(GtkMenu *menu, const gchar *accel_path)
void gtk_menu_detach(GtkMenu *menu)
GtkWidget * gtk_menu_new(void)
GType gtk_menu_get_type(void) G_GNUC_CONST
void gtk_menu_attach_to_widget(GtkMenu *menu, GtkWidget *attach_widget, GtkMenuDetachFunc detacher)
GtkAccelGroup * gtk_menu_get_accel_group(GtkMenu *menu)
void gtk_menu_set_tearoff_state(GtkMenu *menu, gboolean torn_off)
gboolean gtk_menu_get_reserve_toggle_size(GtkMenu *menu)
void(* _gtk_reserved3)(void)
Definition: gtkmenu.h:120
GtkMenuShellClass parent_class
Definition: gtkmenu.h:115
void(* _gtk_reserved1)(void)
Definition: gtkmenu.h:118
void(* _gtk_reserved4)(void)
Definition: gtkmenu.h:121
void(* _gtk_reserved2)(void)
Definition: gtkmenu.h:119
gint GSEAL(scroll_step)
guint GSEAL(navigation_timeout)
guint GSEAL(toggle_size)
GtkAdjustment * GSEAL(tearoff_adjustment)
GdkWindow * GSEAL(view_window)
GtkWidget * GSEAL(tearoff_window)
GtkWidget * GSEAL(tearoff_scrollbar)
GtkMenuShell GSEAL(menu_shell)
gpointer GSEAL(position_func_data)
GdkRegion * GSEAL(navigation_region)
GtkMenuPositionFunc GSEAL(position_func)
gint GSEAL(scroll_offset)
GtkWidget * GSEAL(old_active_menu_item)
gint GSEAL(saved_scroll_offset)
GtkWidget * GSEAL(parent_menu_item)
guint GSEAL(timeout_id)
GtkAccelGroup * GSEAL(accel_group)
GtkWidget * GSEAL(toplevel)
GdkWindow * GSEAL(bin_window)
gchar * GSEAL(accel_path)
GtkWidget * GSEAL(tearoff_hbox)