Ticket #1004: gnome-app.h

File gnome-app.h, 5.2 KB (added by faheem, 21 months ago)

/usr/include/libgnomeui-2.0/libgnomeui/gnome-app.h

Line 
1/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright (C) 1997, 1998, 1999, 2000 Red Hat Software, The Free
4 * Software Foundation, Miguel de Icaza, Federico Menu, Chris Toshok.
5 * All rights reserved.
6 *
7 * This file is part of the Gnome Library.
8 *
9 * The Gnome Library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * The Gnome Library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Library General Public License for more details.
18 *
19 * You should have received a copy of the GNU Library General Public
20 * License along with the Gnome Library; see the file COPYING.LIB.  If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.  */
23/*
24  @NOTATION@
25 */
26
27/*
28 *
29 * Originally by Elliot Lee,
30 *
31 * improvements and rearrangement by Miguel,
32 * and I don't know what you other people did :)
33 *
34 * Even more changes by Federico Mena.
35 */
36
37#ifndef GNOME_APP_H
38#define GNOME_APP_H
39
40#include <gtk/gtk.h>
41
42#include <bonobo/bonobo-dock.h>
43
44G_BEGIN_DECLS
45
46#define GNOME_APP_MENUBAR_NAME "Menubar"
47#define GNOME_APP_TOOLBAR_NAME "Toolbar"
48
49
50#define GNOME_TYPE_APP            (gnome_app_get_type ())
51#define GNOME_APP(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_APP, GnomeApp))
52#define GNOME_APP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_APP, GnomeAppClass))
53#define GNOME_IS_APP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_APP))
54#define GNOME_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_APP))
55#define GNOME_APP_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_APP, GnomeAppClass))
56
57
58typedef struct _GnomeApp        GnomeApp;
59typedef struct _GnomeAppPrivate GnomeAppPrivate;
60typedef struct _GnomeAppClass   GnomeAppClass;
61
62struct _GnomeApp {
63        GtkWindow parent_object;
64
65        /* Application name. */
66        gchar *name;
67
68        /* Prefix for gnome-config (used to save the layout).  */
69        gchar *prefix;
70
71        /* The dock.  */
72        GtkWidget *dock;
73
74        /* The status bar.  */
75        GtkWidget *statusbar;
76
77        /* The vbox widget that ties them.  */
78        GtkWidget *vbox;
79
80        /* The menubar.  This is a pointer to a widget contained into
81           the dock.  */
82        GtkWidget *menubar;
83
84        /* The contents.  This is a pointer to dock->client_area.  */
85        GtkWidget *contents;
86
87        /* Dock layout.  */
88        BonoboDockLayout *layout;
89
90        /* Main accelerator group for this window (hotkeys live here).  */
91        GtkAccelGroup *accel_group;
92
93        /* If TRUE, the application uses gnome-config to retrieve and
94           save the docking configuration automagically.  */
95        guint enable_layout_config : 1;
96
97        /*< private >*/
98        GnomeAppPrivate *_priv;
99};
100
101struct _GnomeAppClass {
102        GtkWindowClass parent_class;
103
104        /* Padding for possible expansion */
105        gpointer padding1;
106        gpointer padding2;
107};
108
109
110/* Standard Gtk function */
111GType gnome_app_get_type (void) G_GNUC_CONST;
112
113/* Create a new (empty) application window.  You must specify the application's name (used
114 * internally as an identifier).  The window title can be left as NULL, in which case the window's
115 * title will not be set.
116 */
117GtkWidget *gnome_app_new (const gchar *appname, const gchar *title);
118
119/* Constructor for language bindings; you don't normally need this. */
120void gnome_app_construct (GnomeApp *app, const gchar *appname, const gchar *title);
121
122/* Sets the menu bar of the application window */
123void gnome_app_set_menus (GnomeApp *app, GtkMenuBar *menubar);
124
125/* Sets the main toolbar of the application window */
126void gnome_app_set_toolbar (GnomeApp *app, GtkToolbar *toolbar);
127
128/* Sets the status bar of the application window */
129void gnome_app_set_statusbar (GnomeApp *app, GtkWidget *statusbar);
130
131/* Sets the status bar of the application window, but uses the given
132 * container widget rather than creating a new one. */
133void gnome_app_set_statusbar_custom (GnomeApp *app,
134                                     GtkWidget *container,
135                                     GtkWidget *statusbar);
136
137/* Sets the content area of the application window */
138void gnome_app_set_contents (GnomeApp *app, GtkWidget *contents);
139
140void gnome_app_add_toolbar (GnomeApp *app,
141                            GtkToolbar *toolbar,
142                            const gchar *name,
143                            BonoboDockItemBehavior behavior,
144                            BonoboDockPlacement placement,
145                            gint band_num,
146                            gint band_position,
147                            gint offset);
148
149GtkWidget *gnome_app_add_docked (GnomeApp *app,
150                                 GtkWidget *widget,
151                                 const gchar *name,
152                                 BonoboDockItemBehavior behavior,
153                                 BonoboDockPlacement placement,
154                                 gint band_num,
155                                 gint band_position,
156                                 gint offset);
157
158void gnome_app_add_dock_item (GnomeApp *app,
159                              BonoboDockItem *item,
160                              BonoboDockPlacement placement,
161                              gint band_num,
162                              gint band_position,
163                              gint offset);
164
165void gnome_app_enable_layout_config (GnomeApp *app, gboolean enable);
166
167BonoboDock *gnome_app_get_dock (GnomeApp *app);
168
169BonoboDockItem *gnome_app_get_dock_item_by_name (GnomeApp *app,
170                                                const gchar *name);
171
172G_END_DECLS
173
174#endif /* GNOME_APP_H */