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 Library 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 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library 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-1999. 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_TOOLBAR(obj) GTK_CHECK_CAST (obj, gtk_toolbar_get_type (), GtkToolbar)
46 #define GTK_TOOLBAR_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_toolbar_get_type (), GtkToolbarClass)
47 #define GTK_IS_TOOLBAR(obj) GTK_CHECK_TYPE (obj, gtk_toolbar_get_type ())
51 GTK_TOOLBAR_CHILD_SPACE,
52 GTK_TOOLBAR_CHILD_BUTTON,
53 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
54 GTK_TOOLBAR_CHILD_RADIOBUTTON,
55 GTK_TOOLBAR_CHILD_WIDGET
56 } GtkToolbarChildType;
60 GTK_TOOLBAR_SPACE_EMPTY,
61 GTK_TOOLBAR_SPACE_LINE
62 } GtkToolbarSpaceStyle;
64 typedef struct _GtkToolbarChild GtkToolbarChild;
65 typedef struct _GtkToolbar GtkToolbar;
66 typedef struct _GtkToolbarClass GtkToolbarClass;
68 struct _GtkToolbarChild
70 GtkToolbarChildType type;
78 GtkContainer container;
82 GtkOrientation orientation;
83 GtkToolbarStyle style;
84 gint space_size; /* big optional space between buttons */
85 GtkToolbarSpaceStyle space_style;
87 GtkTooltips *tooltips;
91 GtkReliefStyle relief;
94 struct _GtkToolbarClass
96 GtkContainerClass parent_class;
98 void (* orientation_changed) (GtkToolbar *toolbar,
99 GtkOrientation orientation);
100 void (* style_changed) (GtkToolbar *toolbar,
101 GtkToolbarStyle style);
105 GtkType gtk_toolbar_get_type (void);
106 GtkWidget *gtk_toolbar_new (GtkOrientation orientation,
107 GtkToolbarStyle style);
109 /* Simple button items */
110 GtkWidget *gtk_toolbar_append_item (GtkToolbar *toolbar,
112 const char *tooltip_text,
113 const char *tooltip_private_text,
115 GtkSignalFunc callback,
117 GtkWidget *gtk_toolbar_prepend_item (GtkToolbar *toolbar,
119 const char *tooltip_text,
120 const char *tooltip_private_text,
122 GtkSignalFunc callback,
124 GtkWidget *gtk_toolbar_insert_item (GtkToolbar *toolbar,
126 const char *tooltip_text,
127 const char *tooltip_private_text,
129 GtkSignalFunc callback,
134 void gtk_toolbar_append_space (GtkToolbar *toolbar);
135 void gtk_toolbar_prepend_space (GtkToolbar *toolbar);
136 void gtk_toolbar_insert_space (GtkToolbar *toolbar,
139 /* Any element type */
140 GtkWidget *gtk_toolbar_append_element (GtkToolbar *toolbar,
141 GtkToolbarChildType type,
144 const char *tooltip_text,
145 const char *tooltip_private_text,
147 GtkSignalFunc callback,
150 GtkWidget *gtk_toolbar_prepend_element (GtkToolbar *toolbar,
151 GtkToolbarChildType type,
154 const char *tooltip_text,
155 const char *tooltip_private_text,
157 GtkSignalFunc callback,
160 GtkWidget *gtk_toolbar_insert_element (GtkToolbar *toolbar,
161 GtkToolbarChildType type,
164 const char *tooltip_text,
165 const char *tooltip_private_text,
167 GtkSignalFunc callback,
171 /* Generic Widgets */
172 void gtk_toolbar_append_widget (GtkToolbar *toolbar,
174 const char *tooltip_text,
175 const char *tooltip_private_text);
176 void gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
178 const char *tooltip_text,
179 const char *tooltip_private_text);
180 void gtk_toolbar_insert_widget (GtkToolbar *toolbar,
182 const char *tooltip_text,
183 const char *tooltip_private_text,
186 /* Style functions */
187 void gtk_toolbar_set_orientation (GtkToolbar *toolbar,
188 GtkOrientation orientation);
189 void gtk_toolbar_set_style (GtkToolbar *toolbar,
190 GtkToolbarStyle style);
191 void gtk_toolbar_set_space_size (GtkToolbar *toolbar,
193 void gtk_toolbar_set_space_style (GtkToolbar *toolbar,
194 GtkToolbarSpaceStyle space_style);
195 void gtk_toolbar_set_tooltips (GtkToolbar *toolbar,
197 void gtk_toolbar_set_button_relief (GtkToolbar *toolbar,
198 GtkReliefStyle relief);
199 GtkReliefStyle gtk_toolbar_get_button_relief (GtkToolbar *toolbar);
204 #endif /* __cplusplus */
206 #endif /* __GTK_TOOLBAR_H__ */