2 * bonobo-mdi-child.h - definition of a BonoboMDI object
4 * Copyright (C) 2001-2002 Free Software Foundation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program 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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330,
19 * Boston, MA 02111-1307, USA.
24 #ifndef _BONOBO_MDI_CHILD_H_
25 #define _BONOBO_MDI_CHILD_H_
28 #include <bonobo/bonobo-window.h>
30 #define BONOBO_TYPE_MDI_CHILD (bonobo_mdi_child_get_type ())
31 #define BONOBO_MDI_CHILD(obj) (GTK_CHECK_CAST ((obj), BONOBO_TYPE_MDI_CHILD, BonoboMDIChild))
32 #define BONOBO_MDI_CHILD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), BONOBO_TYPE_MDI_CHILD, BonoboMDIChildClass))
33 #define BONOBO_IS_MDI_CHILD(obj) (GTK_CHECK_TYPE ((obj), BONOBO_TYPE_MDI_CHILD))
34 #define BONOBO_IS_MDI_CHILD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), BONOBO_TYPE_MDI_CHILD))
35 #define BONOBO_MDI_CHILD_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), BONOBO_TYPE_MDI_CHILD, BonoboMDIChildClass))
38 * is an abstract class. In order to use it, you have to either derive a
39 * new class from it and set the proper virtual functions in its parent
40 * BonoboMDIChildClass structure or use the BonoboMDIGenericChild class
41 * that allows to specify the relevant functions on a per-instance basis
42 * and can directly be used with BonoboMDI.
45 typedef struct _BonoboMDIChildPrivate BonoboMDIChildPrivate;
51 BonoboMDIChildPrivate *priv;
55 typedef GtkWidget *(*BonoboMDIChildViewCreator) (BonoboMDIChild *, gpointer);
56 typedef GList *(*BonoboMDIChildMenuCreator) (BonoboMDIChild *, GtkWidget *, gpointer);
57 typedef gchar *(*BonoboMDIChildConfigFunc) (BonoboMDIChild *, gpointer);
58 typedef GtkWidget *(*BonoboMDIChildLabelFunc) (BonoboMDIChild *, GtkWidget *, gpointer);
61 * Note that if you override the set_label virtual function, it should return
62 * a new widget if its GtkWidget* parameter is NULL and modify and return the
63 * old widget otherwise.
64 * (see bonobo-mdi-child.c/bonobo_mdi_child_set_book_label() for an example).
69 GObjectClass parent_class;
71 /* Virtual functions */
72 BonoboMDIChildViewCreator create_view;
73 BonoboMDIChildConfigFunc get_config_string;
74 BonoboMDIChildLabelFunc set_label;
76 void (* name_changed) (BonoboMDIChild *mdi_child, gchar* old_name);
78 } BonoboMDIChildClass;
80 GType bonobo_mdi_child_get_type (void) G_GNUC_CONST;
82 GtkWidget *bonobo_mdi_child_add_view (BonoboMDIChild *mdi_child);
83 void bonobo_mdi_child_remove_view (BonoboMDIChild *mdi_child,
86 GList *bonobo_mdi_child_get_views (const BonoboMDIChild *mdi_child);
88 void bonobo_mdi_child_set_name (BonoboMDIChild *mdi_child,
90 gchar *bonobo_mdi_child_get_name (const BonoboMDIChild *mdi_child);
92 void bonobo_mdi_child_set_parent (BonoboMDIChild *mdi_child,
94 GObject *bonobo_mdi_child_get_parent (const BonoboMDIChild *mdi_child);
98 #endif /* _BONOBO_MDI_CHILD_H_ */