~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gtk/gtktoolbar.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 * Copyright (C) 2002 Anders Carlsson <andersca@gnome.org>
 
6
 * Copyright (C) 2002 James Henstridge <james@daa.com.au>
 
7
 * Copyright (C) 2003 Soeren Sandmann <sandmann@daimi.au.dk>
 
8
 * 
 
9
 * This library is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU Lesser General Public
 
11
 * License as published by the Free Software Foundation; either
 
12
 * version 2 of the License, or (at your option) any later version.
 
13
 *
 
14
 * This library is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * Lesser General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU Lesser General Public
 
20
 * License along with this library; if not, write to the
 
21
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
22
 * Boston, MA 02111-1307, USA.
 
23
 */
 
24
 
 
25
/*
 
26
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 
27
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 
28
 * files for a list of changes.  These files are distributed with
 
29
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
 
30
 */
 
31
 
 
32
#ifndef __GTK_TOOLBAR_H__
 
33
#define __GTK_TOOLBAR_H__
 
34
 
 
35
#include <gdk/gdk.h>
 
36
#include <gtk/gtkcontainer.h>
 
37
#include <gtk/gtkenums.h>
 
38
#include <gtk/gtktooltips.h>
 
39
 
 
40
#include "gtktoolitem.h"
 
41
 
 
42
#ifndef GTK_DISABLE_DEPRECATED
 
43
 
 
44
/* Not needed, retained for compatibility -Yosh */
 
45
#include <gtk/gtkpixmap.h>
 
46
#include <gtk/gtksignal.h>
 
47
 
 
48
#endif /* GTK_DISABLE_DEPRECATED */
 
49
 
 
50
G_BEGIN_DECLS
 
51
 
 
52
#define GTK_TYPE_TOOLBAR            (gtk_toolbar_get_type ())
 
53
#define GTK_TOOLBAR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOOLBAR, GtkToolbar))
 
54
#define GTK_TOOLBAR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLBAR, GtkToolbarClass))
 
55
#define GTK_IS_TOOLBAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOOLBAR))
 
56
#define GTK_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR))
 
57
#define GTK_TOOLBAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass))
 
58
 
 
59
#ifndef GTK_DISABLE_DEPRECATED
 
60
typedef enum
 
61
{
 
62
  GTK_TOOLBAR_CHILD_SPACE,
 
63
  GTK_TOOLBAR_CHILD_BUTTON,
 
64
  GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
 
65
  GTK_TOOLBAR_CHILD_RADIOBUTTON,
 
66
  GTK_TOOLBAR_CHILD_WIDGET
 
67
} GtkToolbarChildType;
 
68
 
 
69
typedef struct _GtkToolbarChild      GtkToolbarChild;
 
70
 
 
71
struct _GtkToolbarChild
 
72
{
 
73
  GtkToolbarChildType type;
 
74
  GtkWidget *widget;
 
75
  GtkWidget *icon;
 
76
  GtkWidget *label;
 
77
};
 
78
 
 
79
#endif /* GTK_DISABLE_DEPRECATED */
 
80
 
 
81
typedef enum
 
82
{
 
83
  GTK_TOOLBAR_SPACE_EMPTY,
 
84
  GTK_TOOLBAR_SPACE_LINE
 
85
} GtkToolbarSpaceStyle;
 
86
 
 
87
typedef struct _GtkToolbar           GtkToolbar;
 
88
typedef struct _GtkToolbarClass      GtkToolbarClass;
 
89
typedef struct _GtkToolbarPrivate    GtkToolbarPrivate;
 
90
 
 
91
struct _GtkToolbar
 
92
{
 
93
  GtkContainer container;
 
94
 
 
95
  /*< public >*/
 
96
  gint             num_children;
 
97
  GList           *children;
 
98
  GtkOrientation   orientation;
 
99
  GtkToolbarStyle  style;
 
100
  GtkIconSize      icon_size;
 
101
  
 
102
  GtkTooltips     *tooltips;
 
103
  
 
104
  /*< private >*/
 
105
  gint             button_maxw;         /* maximum width of homogeneous children */
 
106
  gint             button_maxh;         /* maximum height of homogeneous children */
 
107
 
 
108
  guint            _gtk_reserved1;
 
109
  guint            _gtk_reserved2;
 
110
 
 
111
  guint            style_set : 1;
 
112
  guint            icon_size_set : 1;
 
113
};
 
114
 
 
115
struct _GtkToolbarClass
 
116
{
 
117
  GtkContainerClass parent_class;
 
118
  
 
119
  /* signals */
 
120
  void     (* orientation_changed) (GtkToolbar       *toolbar,
 
121
                                    GtkOrientation    orientation);
 
122
  void     (* style_changed)       (GtkToolbar       *toolbar,
 
123
                                    GtkToolbarStyle   style);
 
124
  gboolean (* popup_context_menu)  (GtkToolbar       *toolbar,
 
125
                                    gint              x,
 
126
                                    gint              y,
 
127
                                    gint              button_number);
 
128
  
 
129
  /* Padding for future expansion */
 
130
  void (*_gtk_reserved1) (void);
 
131
  void (*_gtk_reserved2) (void);
 
132
  void (*_gtk_reserved3) (void);
 
133
};
 
134
 
 
135
GType           gtk_toolbar_get_type         (void) G_GNUC_CONST;
 
136
GtkWidget*      gtk_toolbar_new                     (void);
 
137
void            gtk_toolbar_insert                  (GtkToolbar      *toolbar,
 
138
                                                     GtkToolItem     *item,
 
139
                                                     gint             pos);
 
140
gint            gtk_toolbar_get_item_index          (GtkToolbar      *toolbar,
 
141
                                                     GtkToolItem     *item);
 
142
gint            gtk_toolbar_get_n_items             (GtkToolbar      *toolbar);
 
143
GtkToolItem *   gtk_toolbar_get_nth_item            (GtkToolbar      *toolbar,
 
144
                                                     gint             n);
 
145
gboolean        gtk_toolbar_get_show_arrow          (GtkToolbar      *toolbar);
 
146
void            gtk_toolbar_set_show_arrow          (GtkToolbar      *toolbar,
 
147
                                                     gboolean         show_arrow);
 
148
GtkOrientation  gtk_toolbar_get_orientation         (GtkToolbar      *toolbar);
 
149
void            gtk_toolbar_set_orientation         (GtkToolbar      *toolbar,
 
150
                                                     GtkOrientation   orientation);
 
151
gboolean        gtk_toolbar_get_tooltips            (GtkToolbar      *toolbar);
 
152
void            gtk_toolbar_set_tooltips            (GtkToolbar      *toolbar,
 
153
                                                     gboolean         enable);
 
154
GtkToolbarStyle gtk_toolbar_get_style               (GtkToolbar      *toolbar);
 
155
void            gtk_toolbar_set_style               (GtkToolbar      *toolbar,
 
156
                                                     GtkToolbarStyle  style);
 
157
void            gtk_toolbar_unset_style             (GtkToolbar      *toolbar);
 
158
GtkIconSize     gtk_toolbar_get_icon_size           (GtkToolbar      *toolbar);
 
159
GtkReliefStyle  gtk_toolbar_get_relief_style        (GtkToolbar      *toolbar);
 
160
gint            gtk_toolbar_get_drop_index          (GtkToolbar      *toolbar,
 
161
                                                     gint             x,
 
162
                                                     gint             y);
 
163
void            gtk_toolbar_set_drop_highlight_item (GtkToolbar      *toolbar,
 
164
                                                     GtkToolItem     *tool_item,
 
165
                                                     gint             index_);
 
166
 
 
167
/* internal functions */
 
168
gchar *         _gtk_toolbar_elide_underscores      (const gchar     *original);
 
169
void            _gtk_toolbar_paint_space_line       (GtkWidget       *widget,
 
170
                                                     GtkToolbar      *toolbar,
 
171
                                                     GdkRectangle    *area,
 
172
                                                     GtkAllocation   *allocation);
 
173
gint            _gtk_toolbar_get_default_space_size (void);
 
174
void            _gtk_toolbar_rebuild_menu           (GtkToolbar      *toolbar);
 
175
 
 
176
 
 
177
/* deprecated */
 
178
#ifndef GTK_DISABLE_DEPRECATED
 
179
void       gtk_toolbar_set_icon_size   (GtkToolbar      *toolbar,
 
180
                                        GtkIconSize      icon_size);
 
181
void       gtk_toolbar_unset_icon_size (GtkToolbar      *toolbar);
 
182
 
 
183
/* Simple button items */
 
184
GtkWidget* gtk_toolbar_append_item   (GtkToolbar      *toolbar,
 
185
                                      const char      *text,
 
186
                                      const char      *tooltip_text,
 
187
                                      const char      *tooltip_private_text,
 
188
                                      GtkWidget       *icon,
 
189
                                      GtkSignalFunc    callback,
 
190
                                      gpointer         user_data);
 
191
GtkWidget* gtk_toolbar_prepend_item  (GtkToolbar      *toolbar,
 
192
                                      const char      *text,
 
193
                                      const char      *tooltip_text,
 
194
                                      const char      *tooltip_private_text,
 
195
                                      GtkWidget       *icon,
 
196
                                      GtkSignalFunc    callback,
 
197
                                      gpointer         user_data);
 
198
GtkWidget* gtk_toolbar_insert_item   (GtkToolbar      *toolbar,
 
199
                                      const char      *text,
 
200
                                      const char      *tooltip_text,
 
201
                                      const char      *tooltip_private_text,
 
202
                                      GtkWidget       *icon,
 
203
                                      GtkSignalFunc    callback,
 
204
                                      gpointer         user_data,
 
205
                                      gint             position);
 
206
 
 
207
/* Stock Items */
 
208
GtkWidget* gtk_toolbar_insert_stock    (GtkToolbar      *toolbar,
 
209
                                        const gchar     *stock_id,
 
210
                                        const char      *tooltip_text,
 
211
                                        const char      *tooltip_private_text,
 
212
                                        GtkSignalFunc    callback,
 
213
                                        gpointer         user_data,
 
214
                                        gint             position);
 
215
 
 
216
/* Space Items */
 
217
void       gtk_toolbar_append_space    (GtkToolbar      *toolbar);
 
218
void       gtk_toolbar_prepend_space   (GtkToolbar      *toolbar);
 
219
void       gtk_toolbar_insert_space    (GtkToolbar      *toolbar,
 
220
                                        gint             position);
 
221
void       gtk_toolbar_remove_space    (GtkToolbar      *toolbar,
 
222
                                        gint             position);
 
223
/* Any element type */
 
224
GtkWidget* gtk_toolbar_append_element  (GtkToolbar      *toolbar,
 
225
                                        GtkToolbarChildType type,
 
226
                                        GtkWidget       *widget,
 
227
                                        const char      *text,
 
228
                                        const char      *tooltip_text,
 
229
                                        const char      *tooltip_private_text,
 
230
                                        GtkWidget       *icon,
 
231
                                        GtkSignalFunc    callback,
 
232
                                        gpointer         user_data);
 
233
 
 
234
GtkWidget* gtk_toolbar_prepend_element (GtkToolbar      *toolbar,
 
235
                                        GtkToolbarChildType type,
 
236
                                        GtkWidget       *widget,
 
237
                                        const char      *text,
 
238
                                        const char      *tooltip_text,
 
239
                                        const char      *tooltip_private_text,
 
240
                                        GtkWidget       *icon,
 
241
                                        GtkSignalFunc    callback,
 
242
                                        gpointer         user_data);
 
243
 
 
244
GtkWidget* gtk_toolbar_insert_element  (GtkToolbar      *toolbar,
 
245
                                        GtkToolbarChildType type,
 
246
                                        GtkWidget       *widget,
 
247
                                        const char      *text,
 
248
                                        const char      *tooltip_text,
 
249
                                        const char      *tooltip_private_text,
 
250
                                        GtkWidget       *icon,
 
251
                                        GtkSignalFunc    callback,
 
252
                                        gpointer         user_data,
 
253
                                        gint             position);
 
254
 
 
255
/* Generic Widgets */
 
256
void       gtk_toolbar_append_widget   (GtkToolbar      *toolbar,
 
257
                                        GtkWidget       *widget,
 
258
                                        const char      *tooltip_text,
 
259
                                        const char      *tooltip_private_text);
 
260
void       gtk_toolbar_prepend_widget  (GtkToolbar      *toolbar,
 
261
                                        GtkWidget       *widget,
 
262
                                        const char      *tooltip_text,
 
263
                                        const char      *tooltip_private_text);
 
264
void       gtk_toolbar_insert_widget   (GtkToolbar      *toolbar,
 
265
                                        GtkWidget       *widget,
 
266
                                        const char      *tooltip_text,
 
267
                                        const char      *tooltip_private_text,
 
268
                                        gint             position);
 
269
 
 
270
#endif /* GTK_DISABLE_DEPRECATED */
 
271
 
 
272
 
 
273
G_END_DECLS
 
274
 
 
275
#endif /* __GTK_TOOLBAR_H__ */