]> Pileus Git - ~andy/gtk/blob - gtk/gtkuimanager.h
Rename GtkMenuMerge to GtkUIManager.
[~andy/gtk] / gtk / gtkuimanager.h
1 /*
2  * GTK - The GIMP Toolkit
3  * Copyright (C) 1998, 1999 Red Hat, Inc.
4  * All rights reserved.
5  *
6  * This Library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This Library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
18  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 /*
23  * Author: James Henstridge <james@daa.com.au>
24  *
25  * Modified by the GTK+ Team and others 2003.  See the AUTHORS
26  * file for a list of people on the GTK+ Team.  See the ChangeLog
27  * files for a list of changes.  These files are distributed with
28  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
29  */
30 #ifndef __GTK_UI_MANAGER_H__
31 #define __GTK_UI_MANAGER_H__
32
33
34 #include <glib.h>
35 #include <glib-object.h>
36 #include <gtk/gtkaccelgroup.h>
37 #include <gtk/gtkwidget.h>
38 #include <gtk/gtkaction.h>
39 #include <gtk/gtkactiongroup.h>
40
41 #define GTK_TYPE_UI_MANAGER            (gtk_ui_manager_get_type ())
42 #define GTK_UI_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_UI_MANAGER, GtkMenuMerge))
43 #define GTK_UI_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_UI_MANAGER, GtkUIManagerClass))
44 #define GTK_IS_UI_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_UI_MANAGER))
45 #define GTK_IS_UI_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), GTK_TYPE_UI_MANAGER))
46 #define GTK_UI_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_UI_MANAGER, GtkUIManagerClass))
47
48 typedef struct _GtkUIManager      GtkUIManager;
49 typedef struct _GtkUIManagerClass GtkUIManagerClass;
50 typedef struct _GtkUIManagerPrivate GtkUIManagerPrivate;
51
52
53 struct _GtkUIManager {
54   GObject parent;
55
56   /*< private >*/
57
58   GtkUIManagerPrivate *private_data;
59 };
60
61 struct _GtkUIManagerClass {
62   GObjectClass parent_class;
63
64   void (* add_widget)    (GtkUIManager *merge, 
65                           GtkWidget    *widget);
66   void (* remove_widget) (GtkUIManager *merge, 
67                           GtkWidget    *widget);
68
69   /* Padding for future expansion */
70   void (*_gtk_reserved1) (void);
71   void (*_gtk_reserved2) (void);
72   void (*_gtk_reserved3) (void);
73   void (*_gtk_reserved4) (void);
74 };
75
76 GType          gtk_ui_manager_get_type            (void);
77 GtkUIManager  *gtk_ui_manager_new                 (void);
78
79 /* these two functions will dirty all merge nodes, as they may need to
80  * be connected up to different actions */
81 void           gtk_ui_manager_insert_action_group (GtkUIManager   *self,
82                                                    GtkActionGroup *action_group,
83                                                    gint            pos);
84 void           gtk_ui_manager_remove_action_group (GtkUIManager   *self,
85                                                    GtkActionGroup *action_group);
86 GList         *gtk_ui_manager_get_action_groups   (GtkUIManager   *self);
87 GtkAccelGroup *gtk_ui_manager_get_accel_group     (GtkUIManager   *self);
88
89
90
91 GtkWidget     *gtk_ui_manager_get_widget          (GtkUIManager   *self,
92                                                    const gchar    *path);
93
94 /* these two functions are for adding UI elements to the merged user
95  * interface */
96 guint          gtk_ui_manager_add_ui_from_string  (GtkUIManager   *self,
97                                                    const gchar    *buffer,
98                                                    gsize           length,
99                                                    GError        **error);
100 guint          gtk_ui_manager_add_ui_from_file    (GtkUIManager   *self,
101                                                    const gchar    *filename,
102                                                    GError        **error);
103 void           gtk_ui_manager_remove_ui           (GtkUIManager   *self,
104                                                    guint           merge_id);
105
106 gchar         *gtk_ui_manager_get_ui              (GtkUIManager   *self);
107
108
109 #endif /* __GTK_UI_MANAGER_H__ */