]> Pileus Git - ~andy/gtk/blob - gtk/gtktoolbar.h
Adapt cast macros to standard.
[~andy/gtk] / gtk / gtktoolbar.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  * GtkToolbar copyright (C) Federico Mena
4  *
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.
9  *
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.
14  *
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.
19  */
20
21 /*
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/. 
26  */
27
28 #ifndef __GTK_TOOLBAR_H__
29 #define __GTK_TOOLBAR_H__
30
31
32 #include <gdk/gdk.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>
38
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43
44
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
51 typedef enum
52 {
53   GTK_TOOLBAR_CHILD_SPACE,
54   GTK_TOOLBAR_CHILD_BUTTON,
55   GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
56   GTK_TOOLBAR_CHILD_RADIOBUTTON,
57   GTK_TOOLBAR_CHILD_WIDGET
58 } GtkToolbarChildType;
59
60 typedef enum
61 {
62   GTK_TOOLBAR_SPACE_EMPTY,
63   GTK_TOOLBAR_SPACE_LINE
64 } GtkToolbarSpaceStyle;
65
66 typedef struct _GtkToolbarChild      GtkToolbarChild;
67 typedef struct _GtkToolbar           GtkToolbar;
68 typedef struct _GtkToolbarClass      GtkToolbarClass;
69
70 struct _GtkToolbarChild
71 {
72   GtkToolbarChildType type;
73   GtkWidget *widget;
74   GtkWidget *icon;
75   GtkWidget *label;
76 };
77
78 struct _GtkToolbar
79 {
80   GtkContainer container;
81
82   gint             num_children;
83   GList           *children;
84   GtkOrientation   orientation;
85   GtkToolbarStyle  style;
86   gint             space_size; /* big optional space between buttons */
87   GtkToolbarSpaceStyle space_style;
88
89   GtkTooltips     *tooltips;
90
91   gint             button_maxw;
92   gint             button_maxh;
93   GtkReliefStyle   relief;
94 };
95
96 struct _GtkToolbarClass
97 {
98   GtkContainerClass parent_class;
99
100   void (* orientation_changed) (GtkToolbar      *toolbar,
101                                 GtkOrientation   orientation);
102   void (* style_changed)       (GtkToolbar      *toolbar,
103                                 GtkToolbarStyle  style);
104 };
105
106
107 GtkType    gtk_toolbar_get_type        (void);
108 GtkWidget* gtk_toolbar_new             (GtkOrientation   orientation,
109                                         GtkToolbarStyle  style);
110
111 /* Simple button items */
112 GtkWidget* gtk_toolbar_append_item     (GtkToolbar      *toolbar,
113                                         const char      *text,
114                                         const char      *tooltip_text,
115                                         const char      *tooltip_private_text,
116                                         GtkWidget       *icon,
117                                         GtkSignalFunc    callback,
118                                         gpointer         user_data);
119 GtkWidget* gtk_toolbar_prepend_item    (GtkToolbar      *toolbar,
120                                         const char      *text,
121                                         const char      *tooltip_text,
122                                         const char      *tooltip_private_text,
123                                         GtkWidget       *icon,
124                                         GtkSignalFunc    callback,
125                                         gpointer         user_data);
126 GtkWidget* gtk_toolbar_insert_item     (GtkToolbar      *toolbar,
127                                         const char      *text,
128                                         const char      *tooltip_text,
129                                         const char      *tooltip_private_text,
130                                         GtkWidget       *icon,
131                                         GtkSignalFunc    callback,
132                                         gpointer         user_data,
133                                         gint             position);
134
135 /* Space Items */
136 void       gtk_toolbar_append_space    (GtkToolbar      *toolbar);
137 void       gtk_toolbar_prepend_space   (GtkToolbar      *toolbar);
138 void       gtk_toolbar_insert_space    (GtkToolbar      *toolbar,
139                                         gint             position);
140
141 /* Any element type */
142 GtkWidget* gtk_toolbar_append_element  (GtkToolbar      *toolbar,
143                                         GtkToolbarChildType type,
144                                         GtkWidget       *widget,
145                                         const char      *text,
146                                         const char      *tooltip_text,
147                                         const char      *tooltip_private_text,
148                                         GtkWidget       *icon,
149                                         GtkSignalFunc    callback,
150                                         gpointer         user_data);
151
152 GtkWidget* gtk_toolbar_prepend_element (GtkToolbar      *toolbar,
153                                         GtkToolbarChildType type,
154                                         GtkWidget       *widget,
155                                         const char      *text,
156                                         const char      *tooltip_text,
157                                         const char      *tooltip_private_text,
158                                         GtkWidget       *icon,
159                                         GtkSignalFunc    callback,
160                                         gpointer         user_data);
161
162 GtkWidget* gtk_toolbar_insert_element  (GtkToolbar      *toolbar,
163                                         GtkToolbarChildType type,
164                                         GtkWidget       *widget,
165                                         const char      *text,
166                                         const char      *tooltip_text,
167                                         const char      *tooltip_private_text,
168                                         GtkWidget       *icon,
169                                         GtkSignalFunc    callback,
170                                         gpointer         user_data,
171                                         gint             position);
172
173 /* Generic Widgets */
174 void       gtk_toolbar_append_widget   (GtkToolbar      *toolbar,
175                                         GtkWidget       *widget,
176                                         const char      *tooltip_text,
177                                         const char      *tooltip_private_text);
178 void       gtk_toolbar_prepend_widget  (GtkToolbar      *toolbar,
179                                         GtkWidget       *widget,
180                                         const char      *tooltip_text,
181                                         const char      *tooltip_private_text);
182 void       gtk_toolbar_insert_widget   (GtkToolbar      *toolbar,
183                                         GtkWidget       *widget,
184                                         const char      *tooltip_text,
185                                         const char      *tooltip_private_text,
186                                         gint             position);
187
188 /* Style functions */
189 void       gtk_toolbar_set_orientation       (GtkToolbar           *toolbar,
190                                               GtkOrientation        orientation);
191 void       gtk_toolbar_set_style             (GtkToolbar           *toolbar,
192                                               GtkToolbarStyle       style);
193 void       gtk_toolbar_set_space_size        (GtkToolbar           *toolbar,
194                                               gint                  space_size);
195 void       gtk_toolbar_set_space_style       (GtkToolbar           *toolbar,
196                                               GtkToolbarSpaceStyle  space_style);
197 void       gtk_toolbar_set_tooltips          (GtkToolbar           *toolbar,
198                                               gint                  enable);
199 void       gtk_toolbar_set_button_relief     (GtkToolbar           *toolbar,
200                                               GtkReliefStyle        relief);
201 GtkReliefStyle gtk_toolbar_get_button_relief (GtkToolbar           *toolbar);
202
203
204 #ifdef __cplusplus
205 }
206 #endif /* __cplusplus */
207
208 #endif /* __GTK_TOOLBAR_H__ */