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/gtkpixmap.h>
36 #include <gtk/gtksignal.h>
37 #include <gtk/gtktooltips.h>
42 #endif /* __cplusplus */
45 #define GTK_TYPE_TOOLBAR (gtk_toolbar_get_type ())
46 #define GTK_TOOLBAR(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_TOOLBAR, GtkToolbar))
47 #define GTK_TOOLBAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLBAR, GtkToolbarClass))
48 #define GTK_IS_TOOLBAR(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_TOOLBAR))
49 #define GTK_IS_TOOLBAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR))
50 #define GTK_TOOLBAR_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass))
55 GTK_TOOLBAR_CHILD_SPACE,
56 GTK_TOOLBAR_CHILD_BUTTON,
57 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
58 GTK_TOOLBAR_CHILD_RADIOBUTTON,
59 GTK_TOOLBAR_CHILD_WIDGET
60 } GtkToolbarChildType;
64 GTK_TOOLBAR_SPACE_EMPTY,
65 GTK_TOOLBAR_SPACE_LINE
66 } GtkToolbarSpaceStyle;
68 typedef struct _GtkToolbarChild GtkToolbarChild;
69 typedef struct _GtkToolbar GtkToolbar;
70 typedef struct _GtkToolbarClass GtkToolbarClass;
72 struct _GtkToolbarChild
74 GtkToolbarChildType type;
82 GtkContainer container;
86 GtkOrientation orientation;
87 GtkToolbarStyle style;
88 GtkIconSize icon_size;
90 GtkTooltips *tooltips;
95 guint style_set_connection;
96 guint icon_size_connection;
99 guint icon_size_set : 1;
102 struct _GtkToolbarClass
104 GtkContainerClass parent_class;
106 void (* orientation_changed) (GtkToolbar *toolbar,
107 GtkOrientation orientation);
108 void (* style_changed) (GtkToolbar *toolbar,
109 GtkToolbarStyle style);
111 /* Padding for future expansion */
112 void (*_gtk_reserved1) (void);
113 void (*_gtk_reserved2) (void);
114 void (*_gtk_reserved3) (void);
115 void (*_gtk_reserved4) (void);
119 GtkType gtk_toolbar_get_type (void) G_GNUC_CONST;
120 GtkWidget* gtk_toolbar_new (void);
122 /* Simple button items */
123 GtkWidget* gtk_toolbar_append_item (GtkToolbar *toolbar,
125 const char *tooltip_text,
126 const char *tooltip_private_text,
128 GtkSignalFunc callback,
130 GtkWidget* gtk_toolbar_prepend_item (GtkToolbar *toolbar,
132 const char *tooltip_text,
133 const char *tooltip_private_text,
135 GtkSignalFunc callback,
137 GtkWidget* gtk_toolbar_insert_item (GtkToolbar *toolbar,
139 const char *tooltip_text,
140 const char *tooltip_private_text,
142 GtkSignalFunc callback,
147 GtkWidget* gtk_toolbar_insert_stock (GtkToolbar *toolbar,
148 const gchar *stock_id,
149 const char *tooltip_text,
150 const char *tooltip_private_text,
151 GtkSignalFunc callback,
158 void gtk_toolbar_append_space (GtkToolbar *toolbar);
159 void gtk_toolbar_prepend_space (GtkToolbar *toolbar);
160 void gtk_toolbar_insert_space (GtkToolbar *toolbar,
162 void gtk_toolbar_remove_space (GtkToolbar *toolbar,
165 /* Any element type */
166 GtkWidget* gtk_toolbar_append_element (GtkToolbar *toolbar,
167 GtkToolbarChildType type,
170 const char *tooltip_text,
171 const char *tooltip_private_text,
173 GtkSignalFunc callback,
176 GtkWidget* gtk_toolbar_prepend_element (GtkToolbar *toolbar,
177 GtkToolbarChildType type,
180 const char *tooltip_text,
181 const char *tooltip_private_text,
183 GtkSignalFunc callback,
186 GtkWidget* gtk_toolbar_insert_element (GtkToolbar *toolbar,
187 GtkToolbarChildType type,
190 const char *tooltip_text,
191 const char *tooltip_private_text,
193 GtkSignalFunc callback,
197 /* Generic Widgets */
198 void gtk_toolbar_append_widget (GtkToolbar *toolbar,
200 const char *tooltip_text,
201 const char *tooltip_private_text);
202 void gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
204 const char *tooltip_text,
205 const char *tooltip_private_text);
206 void gtk_toolbar_insert_widget (GtkToolbar *toolbar,
208 const char *tooltip_text,
209 const char *tooltip_private_text,
212 /* Style functions */
213 void gtk_toolbar_set_orientation (GtkToolbar *toolbar,
214 GtkOrientation orientation);
215 void gtk_toolbar_set_style (GtkToolbar *toolbar,
216 GtkToolbarStyle style);
217 void gtk_toolbar_set_icon_size (GtkToolbar *toolbar,
218 GtkIconSize icon_size);
219 void gtk_toolbar_set_tooltips (GtkToolbar *toolbar,
221 void gtk_toolbar_unset_style (GtkToolbar *toolbar);
222 void gtk_toolbar_unset_icon_size (GtkToolbar *toolbar);
224 GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar);
225 GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
226 GtkIconSize gtk_toolbar_get_icon_size (GtkToolbar *toolbar);
227 gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar);
231 #endif /* __cplusplus */
233 #endif /* __GTK_TOOLBAR_H__ */