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.
21 #ifndef __GTK_TOOLBAR_H__
22 #define __GTK_TOOLBAR_H__
26 #include <gtk/gtkcontainer.h>
27 #include <gtk/gtkenums.h>
28 #include <gtk/gtkpixmap.h>
29 #include <gtk/gtksignal.h>
30 #include <gtk/gtktooltips.h>
35 #endif /* __cplusplus */
38 #define GTK_TOOLBAR(obj) GTK_CHECK_CAST (obj, gtk_toolbar_get_type (), GtkToolbar)
39 #define GTK_TOOLBAR_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_toolbar_get_type (), GtkToolbarClass)
40 #define GTK_IS_TOOLBAR(obj) GTK_CHECK_TYPE (obj, gtk_toolbar_get_type ())
42 enum _GtkToolbarChildType
44 GTK_TOOLBAR_CHILD_SPACE,
45 GTK_TOOLBAR_CHILD_BUTTON,
46 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
47 GTK_TOOLBAR_CHILD_RADIOBUTTON,
48 GTK_TOOLBAR_CHILD_WIDGET
51 typedef enum _GtkToolbarChildType GtkToolbarChildType;
52 typedef struct _GtkToolbarChild GtkToolbarChild;
53 typedef struct _GtkToolbar GtkToolbar;
54 typedef struct _GtkToolbarClass GtkToolbarClass;
56 struct _GtkToolbarChild
58 GtkToolbarChildType type;
66 GtkContainer container;
70 GtkOrientation orientation;
71 GtkToolbarStyle style;
72 gint space_size; /* big optional space between buttons */
74 GtkTooltips *tooltips;
78 GtkReliefStyle relief;
81 struct _GtkToolbarClass
83 GtkContainerClass parent_class;
85 void (* orientation_changed) (GtkToolbar *toolbar,
86 GtkOrientation orientation);
87 void (* style_changed) (GtkToolbar *toolbar,
88 GtkToolbarStyle style);
92 guint gtk_toolbar_get_type (void);
93 GtkWidget *gtk_toolbar_new (GtkOrientation orientation,
94 GtkToolbarStyle style);
96 /* Simple button items */
97 GtkWidget *gtk_toolbar_append_item (GtkToolbar *toolbar,
99 const char *tooltip_text,
100 const char *tooltip_private_text,
102 GtkSignalFunc callback,
104 GtkWidget *gtk_toolbar_prepend_item (GtkToolbar *toolbar,
106 const char *tooltip_text,
107 const char *tooltip_private_text,
109 GtkSignalFunc callback,
111 GtkWidget *gtk_toolbar_insert_item (GtkToolbar *toolbar,
113 const char *tooltip_text,
114 const char *tooltip_private_text,
116 GtkSignalFunc callback,
121 void gtk_toolbar_append_space (GtkToolbar *toolbar);
122 void gtk_toolbar_prepend_space (GtkToolbar *toolbar);
123 void gtk_toolbar_insert_space (GtkToolbar *toolbar,
126 /* Any element type */
127 GtkWidget *gtk_toolbar_append_element (GtkToolbar *toolbar,
128 GtkToolbarChildType type,
131 const char *tooltip_text,
132 const char *tooltip_private_text,
134 GtkSignalFunc callback,
137 GtkWidget *gtk_toolbar_prepend_element (GtkToolbar *toolbar,
138 GtkToolbarChildType type,
141 const char *tooltip_text,
142 const char *tooltip_private_text,
144 GtkSignalFunc callback,
147 GtkWidget *gtk_toolbar_insert_element (GtkToolbar *toolbar,
148 GtkToolbarChildType type,
151 const char *tooltip_text,
152 const char *tooltip_private_text,
154 GtkSignalFunc callback,
158 /* Generic Widgets */
159 void gtk_toolbar_append_widget (GtkToolbar *toolbar,
161 const char *tooltip_text,
162 const char *tooltip_private_text);
163 void gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
165 const char *tooltip_text,
166 const char *tooltip_private_text);
167 void gtk_toolbar_insert_widget (GtkToolbar *toolbar,
169 const char *tooltip_text,
170 const char *tooltip_private_text,
173 /* Style functions */
174 void gtk_toolbar_set_orientation (GtkToolbar *toolbar,
175 GtkOrientation orientation);
176 void gtk_toolbar_set_style (GtkToolbar *toolbar,
177 GtkToolbarStyle style);
178 void gtk_toolbar_set_space_size (GtkToolbar *toolbar,
180 void gtk_toolbar_set_tooltips (GtkToolbar *toolbar,
182 void gtk_toolbar_set_button_relief (GtkToolbar *toolbar,
183 GtkReliefStyle relief);
184 GtkReliefStyle gtk_toolbar_get_button_relief (GtkToolbar *toolbar);
189 #endif /* __cplusplus */
191 #endif /* __GTK_TOOLBAR_H__ */