]> Pileus Git - ~andy/gtk/blob - gtk/gtkmenufactory.h
Added gdk_text/string_extents() - too calculate all the metrics at once of
[~andy/gtk] / gtk / gtkmenufactory.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_FACTORY_H__
20 #define __GTK_MENU_FACTORY_H__
21
22
23 #include <gtk/gtkwidget.h>
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #pragma }
29 #endif /* __cplusplus */
30
31
32 typedef struct _GtkMenuEntry    GtkMenuEntry;
33 typedef struct _GtkMenuPath     GtkMenuPath;
34 typedef struct _GtkMenuFactory  GtkMenuFactory;
35
36 typedef void (*GtkMenuCallback) (GtkWidget *widget,
37                                  gpointer   user_data);
38
39 struct _GtkMenuEntry
40 {
41   gchar *path;
42   gchar *accelerator;
43   GtkMenuCallback callback;
44   gpointer callback_data;
45   GtkWidget *widget;
46 };
47
48 struct _GtkMenuPath
49 {
50   char *path;
51   GtkWidget *widget;
52 };
53
54 struct _GtkMenuFactory
55 {
56   gchar *path;
57   GtkMenuFactoryType type;
58   GtkAccelGroup *accel_group;
59   GtkWidget *widget;
60   GList *subfactories;
61 };
62
63 /* Note: the use of GtkMenuFactory is strongly deprecated.
64  * use GtkItemFactory instead (gtkitemfactory.h and gtkitemfactory.c).
65  * gtkmenufactory.h and gtkmenufactory.c are sheduled for removal
66  * in some future gtk versions.
67  */
68
69 GtkMenuFactory* gtk_menu_factory_new               (GtkMenuFactoryType  type);
70 void            gtk_menu_factory_destroy           (GtkMenuFactory     *factory);
71 void            gtk_menu_factory_add_entries       (GtkMenuFactory     *factory,
72                                                     GtkMenuEntry       *entries,
73                                                     int                 nentries);
74 void            gtk_menu_factory_add_subfactory    (GtkMenuFactory     *factory,
75                                                     GtkMenuFactory     *subfactory,
76                                                     const char         *path);
77 void            gtk_menu_factory_remove_paths      (GtkMenuFactory     *factory,
78                                                     char              **paths,
79                                                     int                 npaths);
80 void            gtk_menu_factory_remove_entries    (GtkMenuFactory     *factory,
81                                                     GtkMenuEntry       *entries,
82                                                     int                 nentries);
83 void            gtk_menu_factory_remove_subfactory (GtkMenuFactory     *factory,
84                                                     GtkMenuFactory     *subfactory,
85                                                     const char         *path);
86 GtkMenuPath*    gtk_menu_factory_find              (GtkMenuFactory     *factory,
87                                                     const char         *path);
88
89
90 #ifdef __cplusplus
91 }
92 #endif /* __cplusplus */
93
94
95 #endif /* __GTK_MENU_FACTORY_H__ */