1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 * GtkToolbar copyright (C) Federico Mena
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
23 * file for a list of people on the GTK+ Team. See the ChangeLog
24 * files for a list of changes. These files are distributed with
25 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
28 #ifndef __GTK_TOOLBAR_H__
29 #define __GTK_TOOLBAR_H__
33 #include <gtk/gtkcontainer.h>
34 #include <gtk/gtkenums.h>
35 #include <gtk/gtktooltips.h>
37 /* Not needed, retained for compatibility -Yosh */
38 #include <gtk/gtkpixmap.h>
39 #include <gtk/gtksignal.h>
44 #endif /* __cplusplus */
47 #define GTK_TYPE_TOOLBAR (gtk_toolbar_get_type ())
48 #define GTK_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOOLBAR, GtkToolbar))
49 #define GTK_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLBAR, GtkToolbarClass))
50 #define GTK_IS_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOOLBAR))
51 #define GTK_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR))
52 #define GTK_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass))
57 GTK_TOOLBAR_CHILD_SPACE,
58 GTK_TOOLBAR_CHILD_BUTTON,
59 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
60 GTK_TOOLBAR_CHILD_RADIOBUTTON,
61 GTK_TOOLBAR_CHILD_WIDGET
62 } GtkToolbarChildType;
66 GTK_TOOLBAR_SPACE_EMPTY,
67 GTK_TOOLBAR_SPACE_LINE
68 } GtkToolbarSpaceStyle;
70 typedef struct _GtkToolbarChild GtkToolbarChild;
71 typedef struct _GtkToolbar GtkToolbar;
72 typedef struct _GtkToolbarClass GtkToolbarClass;
74 struct _GtkToolbarChild
76 GtkToolbarChildType type;
84 GtkContainer container;
88 GtkOrientation orientation;
89 GtkToolbarStyle style;
90 GtkIconSize icon_size;
92 GtkTooltips *tooltips;
97 guint style_set_connection;
98 guint icon_size_connection;
101 guint icon_size_set : 1;
104 struct _GtkToolbarClass
106 GtkContainerClass parent_class;
108 void (* orientation_changed) (GtkToolbar *toolbar,
109 GtkOrientation orientation);
110 void (* style_changed) (GtkToolbar *toolbar,
111 GtkToolbarStyle style);
113 /* Padding for future expansion */
114 void (*_gtk_reserved1) (void);
115 void (*_gtk_reserved2) (void);
116 void (*_gtk_reserved3) (void);
117 void (*_gtk_reserved4) (void);
121 GType gtk_toolbar_get_type (void) G_GNUC_CONST;
122 GtkWidget* gtk_toolbar_new (void);
124 /* Simple button items */
125 GtkWidget* gtk_toolbar_append_item (GtkToolbar *toolbar,
127 const char *tooltip_text,
128 const char *tooltip_private_text,
130 GtkSignalFunc callback,
132 GtkWidget* gtk_toolbar_prepend_item (GtkToolbar *toolbar,
134 const char *tooltip_text,
135 const char *tooltip_private_text,
137 GtkSignalFunc callback,
139 GtkWidget* gtk_toolbar_insert_item (GtkToolbar *toolbar,
141 const char *tooltip_text,
142 const char *tooltip_private_text,
144 GtkSignalFunc callback,
149 GtkWidget* gtk_toolbar_insert_stock (GtkToolbar *toolbar,
150 const gchar *stock_id,
151 const char *tooltip_text,
152 const char *tooltip_private_text,
153 GtkSignalFunc callback,
160 void gtk_toolbar_append_space (GtkToolbar *toolbar);
161 void gtk_toolbar_prepend_space (GtkToolbar *toolbar);
162 void gtk_toolbar_insert_space (GtkToolbar *toolbar,
164 void gtk_toolbar_remove_space (GtkToolbar *toolbar,
167 /* Any element type */
168 GtkWidget* gtk_toolbar_append_element (GtkToolbar *toolbar,
169 GtkToolbarChildType type,
172 const char *tooltip_text,
173 const char *tooltip_private_text,
175 GtkSignalFunc callback,
178 GtkWidget* gtk_toolbar_prepend_element (GtkToolbar *toolbar,
179 GtkToolbarChildType type,
182 const char *tooltip_text,
183 const char *tooltip_private_text,
185 GtkSignalFunc callback,
188 GtkWidget* gtk_toolbar_insert_element (GtkToolbar *toolbar,
189 GtkToolbarChildType type,
192 const char *tooltip_text,
193 const char *tooltip_private_text,
195 GtkSignalFunc callback,
199 /* Generic Widgets */
200 void gtk_toolbar_append_widget (GtkToolbar *toolbar,
202 const char *tooltip_text,
203 const char *tooltip_private_text);
204 void gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
206 const char *tooltip_text,
207 const char *tooltip_private_text);
208 void gtk_toolbar_insert_widget (GtkToolbar *toolbar,
210 const char *tooltip_text,
211 const char *tooltip_private_text,
214 /* Style functions */
215 void gtk_toolbar_set_orientation (GtkToolbar *toolbar,
216 GtkOrientation orientation);
217 void gtk_toolbar_set_style (GtkToolbar *toolbar,
218 GtkToolbarStyle style);
219 void gtk_toolbar_set_icon_size (GtkToolbar *toolbar,
220 GtkIconSize icon_size);
221 void gtk_toolbar_set_tooltips (GtkToolbar *toolbar,
223 void gtk_toolbar_unset_style (GtkToolbar *toolbar);
224 void gtk_toolbar_unset_icon_size (GtkToolbar *toolbar);
226 GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar);
227 GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
228 GtkIconSize gtk_toolbar_get_icon_size (GtkToolbar *toolbar);
229 gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar);
233 #endif /* __cplusplus */
235 #endif /* __GTK_TOOLBAR_H__ */