1 /* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
3 * Copyright (C) 2004 Red Hat, Inc., Jonathan Blandford <jrb@gnome.org>
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.
23 #include "gtkpathbar.h"
24 #include "gtktogglebutton.h"
25 #include "gtkalignment.h"
30 #include "gtkicontheme.h"
31 #include "gtkiconfactory.h"
35 #include "gtkmarshalers.h"
50 #define BUTTON_DATA(x) ((ButtonData *)(x))
52 #define SCROLL_DELAY_FACTOR 5
54 static guint path_bar_signals [LAST_SIGNAL] = { 0 };
56 /* Icon size for if we can't get it from the theme */
57 #define FALLBACK_ICON_SIZE 16
59 typedef struct _ButtonData ButtonData;
69 GtkFileSystemHandle *handle;
70 guint ignore_changes : 1;
71 guint file_is_hidden : 1;
73 /* This macro is used to check if a button can be used as a fake root.
74 * All buttons in front of a fake root are automatically hidden when in a
75 * directory below a fake root and replaced with the "<" arrow button.
77 #define BUTTON_IS_FAKE_ROOT(button) ((button)->type == HOME_BUTTON)
79 G_DEFINE_TYPE (GtkPathBar, gtk_path_bar, GTK_TYPE_CONTAINER)
81 static void gtk_path_bar_finalize (GObject *object);
82 static void gtk_path_bar_dispose (GObject *object);
83 static void gtk_path_bar_size_request (GtkWidget *widget,
84 GtkRequisition *requisition);
85 static void gtk_path_bar_unmap (GtkWidget *widget);
86 static void gtk_path_bar_size_allocate (GtkWidget *widget,
87 GtkAllocation *allocation);
88 static void gtk_path_bar_add (GtkContainer *container,
90 static void gtk_path_bar_remove (GtkContainer *container,
92 static void gtk_path_bar_forall (GtkContainer *container,
93 gboolean include_internals,
95 gpointer callback_data);
96 static void gtk_path_bar_scroll_up (GtkWidget *button,
97 GtkPathBar *path_bar);
98 static void gtk_path_bar_scroll_down (GtkWidget *button,
99 GtkPathBar *path_bar);
100 static void gtk_path_bar_stop_scrolling (GtkPathBar *path_bar);
101 static gboolean gtk_path_bar_slider_up_defocus (GtkWidget *widget,
102 GdkEventButton *event,
103 GtkPathBar *path_bar);
104 static gboolean gtk_path_bar_slider_down_defocus (GtkWidget *widget,
105 GdkEventButton *event,
106 GtkPathBar *path_bar);
107 static gboolean gtk_path_bar_slider_button_press (GtkWidget *widget,
108 GdkEventButton *event,
109 GtkPathBar *path_bar);
110 static gboolean gtk_path_bar_slider_button_release(GtkWidget *widget,
111 GdkEventButton *event,
112 GtkPathBar *path_bar);
113 static void gtk_path_bar_grab_notify (GtkWidget *widget,
114 gboolean was_grabbed);
115 static void gtk_path_bar_state_changed (GtkWidget *widget,
116 GtkStateType previous_state);
117 static void gtk_path_bar_style_set (GtkWidget *widget,
118 GtkStyle *previous_style);
119 static void gtk_path_bar_screen_changed (GtkWidget *widget,
120 GdkScreen *previous_screen);
121 static void gtk_path_bar_check_icon_theme (GtkPathBar *path_bar);
122 static void gtk_path_bar_update_button_appearance (GtkPathBar *path_bar,
123 ButtonData *button_data,
124 gboolean current_dir);
127 on_slider_unmap (GtkWidget *widget,
128 GtkPathBar *path_bar)
130 if (path_bar->timer &&
131 ((widget == path_bar->up_slider_button && path_bar->scrolling_up) ||
132 (widget == path_bar->down_slider_button && path_bar->scrolling_down)))
133 gtk_path_bar_stop_scrolling (path_bar);
137 get_slider_button (GtkPathBar *path_bar,
138 GtkArrowType arrow_type)
143 gtk_widget_push_composite_child ();
145 button = gtk_button_new ();
146 atk_obj = gtk_widget_get_accessible (button);
147 if (arrow_type == GTK_ARROW_LEFT)
148 atk_object_set_name (atk_obj, _("Up Path"));
150 atk_object_set_name (atk_obj, _("Down Path"));
152 gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
153 gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (arrow_type, GTK_SHADOW_OUT));
154 gtk_container_add (GTK_CONTAINER (path_bar), button);
155 gtk_widget_show_all (button);
157 g_signal_connect (G_OBJECT (button), "unmap",
158 G_CALLBACK (on_slider_unmap), path_bar);
160 gtk_widget_pop_composite_child ();
166 gtk_path_bar_init (GtkPathBar *path_bar)
168 GTK_WIDGET_SET_FLAGS (path_bar, GTK_NO_WINDOW);
169 gtk_widget_set_redraw_on_allocate (GTK_WIDGET (path_bar), FALSE);
171 path_bar->set_path_handle = NULL;
173 path_bar->spacing = 0;
174 path_bar->up_slider_button = get_slider_button (path_bar, GTK_ARROW_LEFT);
175 path_bar->down_slider_button = get_slider_button (path_bar, GTK_ARROW_RIGHT);
176 path_bar->icon_size = FALLBACK_ICON_SIZE;
178 g_signal_connect (path_bar->up_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_up), path_bar);
179 g_signal_connect (path_bar->down_slider_button, "clicked", G_CALLBACK (gtk_path_bar_scroll_down), path_bar);
181 g_signal_connect (path_bar->up_slider_button, "focus_out_event", G_CALLBACK (gtk_path_bar_slider_up_defocus), path_bar);
182 g_signal_connect (path_bar->down_slider_button, "focus_out_event", G_CALLBACK (gtk_path_bar_slider_down_defocus), path_bar);
184 g_signal_connect (path_bar->up_slider_button, "button_press_event", G_CALLBACK (gtk_path_bar_slider_button_press), path_bar);
185 g_signal_connect (path_bar->up_slider_button, "button_release_event", G_CALLBACK (gtk_path_bar_slider_button_release), path_bar);
186 g_signal_connect (path_bar->down_slider_button, "button_press_event", G_CALLBACK (gtk_path_bar_slider_button_press), path_bar);
187 g_signal_connect (path_bar->down_slider_button, "button_release_event", G_CALLBACK (gtk_path_bar_slider_button_release), path_bar);
191 gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
193 GObjectClass *gobject_class;
194 GtkObjectClass *object_class;
195 GtkWidgetClass *widget_class;
196 GtkContainerClass *container_class;
198 gobject_class = (GObjectClass *) path_bar_class;
199 object_class = (GtkObjectClass *) path_bar_class;
200 widget_class = (GtkWidgetClass *) path_bar_class;
201 container_class = (GtkContainerClass *) path_bar_class;
203 gobject_class->finalize = gtk_path_bar_finalize;
204 gobject_class->dispose = gtk_path_bar_dispose;
206 widget_class->size_request = gtk_path_bar_size_request;
207 widget_class->unmap = gtk_path_bar_unmap;
208 widget_class->size_allocate = gtk_path_bar_size_allocate;
209 widget_class->style_set = gtk_path_bar_style_set;
210 widget_class->screen_changed = gtk_path_bar_screen_changed;
211 widget_class->grab_notify = gtk_path_bar_grab_notify;
212 widget_class->state_changed = gtk_path_bar_state_changed;
214 container_class->add = gtk_path_bar_add;
215 container_class->forall = gtk_path_bar_forall;
216 container_class->remove = gtk_path_bar_remove;
218 /* container_class->child_type = gtk_path_bar_child_type;*/
220 path_bar_signals [PATH_CLICKED] =
221 g_signal_new (I_("path-clicked"),
222 G_OBJECT_CLASS_TYPE (object_class),
224 G_STRUCT_OFFSET (GtkPathBarClass, path_clicked),
226 _gtk_marshal_VOID__POINTER_POINTER_BOOLEAN,
235 gtk_path_bar_finalize (GObject *object)
237 GtkPathBar *path_bar;
239 path_bar = GTK_PATH_BAR (object);
241 gtk_path_bar_stop_scrolling (path_bar);
243 g_list_free (path_bar->button_list);
244 if (path_bar->root_path)
245 gtk_file_path_free (path_bar->root_path);
246 if (path_bar->home_path)
247 gtk_file_path_free (path_bar->home_path);
248 if (path_bar->desktop_path)
249 gtk_file_path_free (path_bar->desktop_path);
251 if (path_bar->root_icon)
252 g_object_unref (path_bar->root_icon);
253 if (path_bar->home_icon)
254 g_object_unref (path_bar->home_icon);
255 if (path_bar->desktop_icon)
256 g_object_unref (path_bar->desktop_icon);
258 if (path_bar->file_system)
259 g_object_unref (path_bar->file_system);
261 G_OBJECT_CLASS (gtk_path_bar_parent_class)->finalize (object);
264 /* Removes the settings signal handler. It's safe to call multiple times */
266 remove_settings_signal (GtkPathBar *path_bar,
269 if (path_bar->settings_signal_id)
271 GtkSettings *settings;
273 settings = gtk_settings_get_for_screen (screen);
274 g_signal_handler_disconnect (settings,
275 path_bar->settings_signal_id);
276 path_bar->settings_signal_id = 0;
281 gtk_path_bar_dispose (GObject *object)
283 GtkPathBar *path_bar = GTK_PATH_BAR (object);
285 remove_settings_signal (path_bar, gtk_widget_get_screen (GTK_WIDGET (object)));
287 if (path_bar->set_path_handle)
288 gtk_file_system_cancel_operation (path_bar->set_path_handle);
289 path_bar->set_path_handle = NULL;
291 G_OBJECT_CLASS (gtk_path_bar_parent_class)->dispose (object);
296 * Ideally, our size is determined by another widget, and we are just filling
300 gtk_path_bar_size_request (GtkWidget *widget,
301 GtkRequisition *requisition)
303 ButtonData *button_data;
304 GtkPathBar *path_bar;
305 GtkRequisition child_requisition;
308 path_bar = GTK_PATH_BAR (widget);
310 requisition->width = 0;
311 requisition->height = 0;
313 for (list = path_bar->button_list; list; list = list->next)
315 button_data = BUTTON_DATA (list->data);
316 gtk_widget_size_request (button_data->button, &child_requisition);
317 requisition->width = MAX (child_requisition.width, requisition->width);
318 requisition->height = MAX (child_requisition.height, requisition->height);
321 /* Add space for slider, if we have more than one path */
322 /* Theoretically, the slider could be bigger than the other button. But we're
323 * not going to worry about that now.
325 path_bar->slider_width = MIN(requisition->height * 2 / 3 + 5, requisition->height);
326 if (path_bar->button_list && path_bar->button_list->next != NULL)
327 requisition->width += (path_bar->spacing + path_bar->slider_width) * 2;
329 gtk_widget_size_request (path_bar->up_slider_button, &child_requisition);
330 gtk_widget_size_request (path_bar->down_slider_button, &child_requisition);
332 requisition->width += GTK_CONTAINER (widget)->border_width * 2;
333 requisition->height += GTK_CONTAINER (widget)->border_width * 2;
335 widget->requisition = *requisition;
339 gtk_path_bar_update_slider_buttons (GtkPathBar *path_bar)
341 if (path_bar->button_list)
345 button = BUTTON_DATA (path_bar->button_list->data)->button;
346 if (gtk_widget_get_child_visible (button))
348 gtk_path_bar_stop_scrolling (path_bar);
349 gtk_widget_set_sensitive (path_bar->down_slider_button, FALSE);
352 gtk_widget_set_sensitive (path_bar->down_slider_button, TRUE);
354 button = BUTTON_DATA (g_list_last (path_bar->button_list)->data)->button;
355 if (gtk_widget_get_child_visible (button))
357 gtk_path_bar_stop_scrolling (path_bar);
358 gtk_widget_set_sensitive (path_bar->up_slider_button, FALSE);
361 gtk_widget_set_sensitive (path_bar->up_slider_button, TRUE);
366 gtk_path_bar_unmap (GtkWidget *widget)
368 gtk_path_bar_stop_scrolling (GTK_PATH_BAR (widget));
370 GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->unmap (widget);
373 /* This is a tad complicated
376 gtk_path_bar_size_allocate (GtkWidget *widget,
377 GtkAllocation *allocation)
380 GtkPathBar *path_bar = GTK_PATH_BAR (widget);
381 GtkTextDirection direction;
382 GtkAllocation child_allocation;
383 GList *list, *first_button;
385 gint allocation_width;
387 gboolean need_sliders = FALSE;
388 gint up_slider_offset = 0;
389 gint down_slider_offset = 0;
391 widget->allocation = *allocation;
393 /* No path is set; we don't have to allocate anything. */
394 if (path_bar->button_list == NULL)
397 direction = gtk_widget_get_direction (widget);
398 border_width = (gint) GTK_CONTAINER (path_bar)->border_width;
399 allocation_width = allocation->width - 2 * border_width;
401 /* First, we check to see if we need the scrollbars. */
402 if (path_bar->fake_root)
403 width = path_bar->spacing + path_bar->slider_width;
407 for (list = path_bar->button_list; list; list = list->next)
409 child = BUTTON_DATA (list->data)->button;
411 width += child->requisition.width + path_bar->spacing;
412 if (list == path_bar->fake_root)
416 if (width <= allocation_width)
418 if (path_bar->fake_root)
419 first_button = path_bar->fake_root;
421 first_button = g_list_last (path_bar->button_list);
425 gboolean reached_end = FALSE;
426 gint slider_space = 2 * (path_bar->spacing + path_bar->slider_width);
428 if (path_bar->first_scrolled_button)
429 first_button = path_bar->first_scrolled_button;
431 first_button = path_bar->button_list;
434 /* To see how much space we have, and how many buttons we can display.
435 * We start at the first button, count forward until hit the new
436 * button, then count backwards.
438 /* Count down the path chain towards the end. */
439 width = BUTTON_DATA (first_button->data)->button->requisition.width;
440 list = first_button->prev;
441 while (list && !reached_end)
443 child = BUTTON_DATA (list->data)->button;
445 if (width + child->requisition.width +
446 path_bar->spacing + slider_space > allocation_width)
448 else if (list == path_bar->fake_root)
451 width += child->requisition.width + path_bar->spacing;
456 /* Finally, we walk up, seeing how many of the previous buttons we can
458 while (first_button->next && !reached_end)
460 child = BUTTON_DATA (first_button->next->data)->button;
462 if (width + child->requisition.width + path_bar->spacing + slider_space > allocation_width)
468 width += child->requisition.width + path_bar->spacing;
469 if (first_button == path_bar->fake_root)
471 first_button = first_button->next;
476 /* Now, we allocate space to the buttons */
477 child_allocation.y = allocation->y + border_width;
478 child_allocation.height = MAX (1, (gint) allocation->height - border_width * 2);
480 if (direction == GTK_TEXT_DIR_RTL)
482 child_allocation.x = allocation->x + allocation->width - border_width;
483 if (need_sliders || path_bar->fake_root)
485 child_allocation.x -= (path_bar->spacing + path_bar->slider_width);
486 up_slider_offset = allocation->width - border_width - path_bar->slider_width;
491 child_allocation.x = allocation->x + border_width;
492 if (need_sliders || path_bar->fake_root)
494 up_slider_offset = border_width;
495 child_allocation.x += (path_bar->spacing + path_bar->slider_width);
499 for (list = first_button; list; list = list->prev)
501 child = BUTTON_DATA (list->data)->button;
503 child_allocation.width = child->requisition.width;
504 if (direction == GTK_TEXT_DIR_RTL)
505 child_allocation.x -= child_allocation.width;
507 /* Check to see if we've don't have any more space to allocate buttons */
508 if (need_sliders && direction == GTK_TEXT_DIR_RTL)
510 if (child_allocation.x - path_bar->spacing - path_bar->slider_width < widget->allocation.x + border_width)
513 else if (need_sliders && direction == GTK_TEXT_DIR_LTR)
515 if (child_allocation.x + child_allocation.width + path_bar->spacing + path_bar->slider_width >
516 widget->allocation.x + border_width + allocation_width)
520 gtk_widget_set_child_visible (BUTTON_DATA (list->data)->button, TRUE);
521 gtk_widget_size_allocate (child, &child_allocation);
523 if (direction == GTK_TEXT_DIR_RTL)
525 child_allocation.x -= path_bar->spacing;
526 down_slider_offset = child_allocation.x - widget->allocation.x - path_bar->slider_width;
527 down_slider_offset = border_width;
531 down_slider_offset = child_allocation.x - widget->allocation.x;
532 down_slider_offset = allocation->width - border_width - path_bar->slider_width;
533 child_allocation.x += child_allocation.width + path_bar->spacing;
536 /* Now we go hide all the widgets that don't fit */
539 gtk_widget_set_child_visible (BUTTON_DATA (list->data)->button, FALSE);
542 for (list = first_button->next; list; list = list->next)
544 gtk_widget_set_child_visible (BUTTON_DATA (list->data)->button, FALSE);
547 if (need_sliders || path_bar->fake_root)
549 child_allocation.width = path_bar->slider_width;
550 child_allocation.x = up_slider_offset + allocation->x;
551 gtk_widget_size_allocate (path_bar->up_slider_button, &child_allocation);
553 gtk_widget_set_child_visible (path_bar->up_slider_button, TRUE);
554 gtk_widget_show_all (path_bar->up_slider_button);
557 gtk_widget_set_child_visible (path_bar->up_slider_button, FALSE);
561 child_allocation.width = path_bar->slider_width;
562 child_allocation.x = down_slider_offset + allocation->x;
563 gtk_widget_size_allocate (path_bar->down_slider_button, &child_allocation);
565 gtk_widget_set_child_visible (path_bar->down_slider_button, TRUE);
566 gtk_widget_show_all (path_bar->down_slider_button);
567 gtk_path_bar_update_slider_buttons (path_bar);
570 gtk_widget_set_child_visible (path_bar->down_slider_button, FALSE);
574 gtk_path_bar_style_set (GtkWidget *widget,
575 GtkStyle *previous_style)
577 if (GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->style_set)
578 GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->style_set (widget, previous_style);
580 gtk_path_bar_check_icon_theme (GTK_PATH_BAR (widget));
584 gtk_path_bar_screen_changed (GtkWidget *widget,
585 GdkScreen *previous_screen)
587 if (GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->screen_changed)
588 GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->screen_changed (widget, previous_screen);
590 /* We might nave a new settings, so we remove the old one */
592 remove_settings_signal (GTK_PATH_BAR (widget), previous_screen);
594 gtk_path_bar_check_icon_theme (GTK_PATH_BAR (widget));
598 gtk_path_bar_add (GtkContainer *container,
601 gtk_widget_set_parent (widget, GTK_WIDGET (container));
605 gtk_path_bar_remove_1 (GtkContainer *container,
608 gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
609 gtk_widget_unparent (widget);
611 gtk_widget_queue_resize (GTK_WIDGET (container));
615 gtk_path_bar_remove (GtkContainer *container,
618 GtkPathBar *path_bar;
621 path_bar = GTK_PATH_BAR (container);
623 if (widget == path_bar->up_slider_button)
625 gtk_path_bar_remove_1 (container, widget);
626 path_bar->up_slider_button = NULL;
630 if (widget == path_bar->down_slider_button)
632 gtk_path_bar_remove_1 (container, widget);
633 path_bar->down_slider_button = NULL;
637 children = path_bar->button_list;
640 if (widget == BUTTON_DATA (children->data)->button)
642 gtk_path_bar_remove_1 (container, widget);
643 path_bar->button_list = g_list_remove_link (path_bar->button_list, children);
644 g_list_free (children);
648 children = children->next;
653 gtk_path_bar_forall (GtkContainer *container,
654 gboolean include_internals,
655 GtkCallback callback,
656 gpointer callback_data)
658 GtkPathBar *path_bar;
661 g_return_if_fail (callback != NULL);
662 path_bar = GTK_PATH_BAR (container);
664 children = path_bar->button_list;
668 child = BUTTON_DATA (children->data)->button;
669 children = children->next;
671 (* callback) (child, callback_data);
674 if (path_bar->up_slider_button)
675 (* callback) (path_bar->up_slider_button, callback_data);
677 if (path_bar->down_slider_button)
678 (* callback) (path_bar->down_slider_button, callback_data);
682 gtk_path_bar_scroll_down (GtkWidget *button, GtkPathBar *path_bar)
685 GList *down_button = NULL;
686 GList *up_button = NULL;
687 gint space_available;
690 GtkTextDirection direction;
692 if (path_bar->ignore_click)
694 path_bar->ignore_click = FALSE;
698 gtk_widget_queue_resize (GTK_WIDGET (path_bar));
700 border_width = GTK_CONTAINER (path_bar)->border_width;
701 direction = gtk_widget_get_direction (GTK_WIDGET (path_bar));
703 /* We find the button at the 'down' end that we have to make
705 for (list = path_bar->button_list; list; list = list->next)
707 if (list->next && gtk_widget_get_child_visible (BUTTON_DATA (list->next->data)->button))
714 /* Find the last visible button on the 'up' end
716 for (list = g_list_last (path_bar->button_list); list; list = list->prev)
718 if (gtk_widget_get_child_visible (BUTTON_DATA (list->data)->button))
725 /* We check if down_button might be NULL in cases where the pathbar's horizontal size is smaller
726 * than the button and it doesn't get displayed. e.g., on Windows it might be "My Documents and Settings"
728 space_needed = down_button ? BUTTON_DATA (down_button->data)->button->allocation.width : 0 + path_bar->spacing;
729 if (direction == GTK_TEXT_DIR_RTL)
730 space_available = path_bar->down_slider_button->allocation.x - GTK_WIDGET (path_bar)->allocation.x;
732 space_available = (GTK_WIDGET (path_bar)->allocation.x + GTK_WIDGET (path_bar)->allocation.width - border_width) -
733 (path_bar->down_slider_button->allocation.x + path_bar->down_slider_button->allocation.width);
735 /* We have space_available extra space that's not being used. We
736 * need space_needed space to make the button fit. So we walk down
737 * from the end, removing buttons until we get all the space we
739 while (space_available < space_needed)
741 space_available += BUTTON_DATA (up_button->data)->button->allocation.width + path_bar->spacing;
742 up_button = up_button->prev;
743 path_bar->first_scrolled_button = up_button;
748 gtk_path_bar_scroll_up (GtkWidget *button, GtkPathBar *path_bar)
752 if (path_bar->ignore_click)
754 path_bar->ignore_click = FALSE;
758 gtk_widget_queue_resize (GTK_WIDGET (path_bar));
760 for (list = g_list_last (path_bar->button_list); list; list = list->prev)
762 if (list->prev && gtk_widget_get_child_visible (BUTTON_DATA (list->prev->data)->button))
764 if (list->prev == path_bar->fake_root)
765 path_bar->fake_root = NULL;
766 path_bar->first_scrolled_button = list;
773 gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
775 gboolean retval = FALSE;
779 if (path_bar->scrolling_up)
780 gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
781 else if (path_bar->scrolling_down)
782 gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
784 if (path_bar->need_timer)
786 GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (path_bar));
789 g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
791 path_bar->need_timer = FALSE;
793 path_bar->timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
794 (GSourceFunc)gtk_path_bar_scroll_timeout,
805 gtk_path_bar_stop_scrolling (GtkPathBar *path_bar)
809 g_source_remove (path_bar->timer);
811 path_bar->need_timer = FALSE;
816 gtk_path_bar_slider_up_defocus (GtkWidget *widget,
817 GdkEventButton *event,
818 GtkPathBar *path_bar)
821 GList *up_button = NULL;
823 if (event->type != GDK_FOCUS_CHANGE)
826 for (list = g_list_last (path_bar->button_list); list; list = list->prev)
828 if (gtk_widget_get_child_visible (BUTTON_DATA (list->data)->button))
835 /* don't let the focus vanish */
836 if ((!GTK_WIDGET_IS_SENSITIVE (path_bar->up_slider_button)) ||
837 (!gtk_widget_get_child_visible (path_bar->up_slider_button)))
838 gtk_widget_grab_focus (BUTTON_DATA (up_button->data)->button);
844 gtk_path_bar_slider_down_defocus (GtkWidget *widget,
845 GdkEventButton *event,
846 GtkPathBar *path_bar)
849 GList *down_button = NULL;
851 if (event->type != GDK_FOCUS_CHANGE)
854 for (list = path_bar->button_list; list; list = list->next)
856 if (gtk_widget_get_child_visible (BUTTON_DATA (list->data)->button))
863 /* don't let the focus vanish */
864 if ((!GTK_WIDGET_IS_SENSITIVE (path_bar->down_slider_button)) ||
865 (!gtk_widget_get_child_visible (path_bar->down_slider_button)))
866 gtk_widget_grab_focus (BUTTON_DATA (down_button->data)->button);
872 gtk_path_bar_slider_button_press (GtkWidget *widget,
873 GdkEventButton *event,
874 GtkPathBar *path_bar)
876 if (event->type != GDK_BUTTON_PRESS || event->button != 1)
879 path_bar->ignore_click = FALSE;
881 if (widget == path_bar->up_slider_button)
883 path_bar->scrolling_down = FALSE;
884 path_bar->scrolling_up = TRUE;
885 gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
887 else if (widget == path_bar->down_slider_button)
889 path_bar->scrolling_up = FALSE;
890 path_bar->scrolling_down = TRUE;
891 gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
894 if (!path_bar->timer)
896 GtkSettings *settings = gtk_widget_get_settings (widget);
899 g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
901 path_bar->need_timer = TRUE;
902 path_bar->timer = gdk_threads_add_timeout (timeout,
903 (GSourceFunc)gtk_path_bar_scroll_timeout,
911 gtk_path_bar_slider_button_release (GtkWidget *widget,
912 GdkEventButton *event,
913 GtkPathBar *path_bar)
915 if (event->type != GDK_BUTTON_RELEASE)
918 path_bar->ignore_click = TRUE;
919 gtk_path_bar_stop_scrolling (path_bar);
925 gtk_path_bar_grab_notify (GtkWidget *widget,
926 gboolean was_grabbed)
929 gtk_path_bar_stop_scrolling (GTK_PATH_BAR (widget));
933 gtk_path_bar_state_changed (GtkWidget *widget,
934 GtkStateType previous_state)
936 if (!GTK_WIDGET_IS_SENSITIVE (widget))
937 gtk_path_bar_stop_scrolling (GTK_PATH_BAR (widget));
941 /* Changes the icons wherever it is needed */
943 reload_icons (GtkPathBar *path_bar)
947 if (path_bar->root_icon)
949 g_object_unref (path_bar->root_icon);
950 path_bar->root_icon = NULL;
952 if (path_bar->home_icon)
954 g_object_unref (path_bar->home_icon);
955 path_bar->home_icon = NULL;
957 if (path_bar->desktop_icon)
959 g_object_unref (path_bar->desktop_icon);
960 path_bar->desktop_icon = NULL;
963 for (list = path_bar->button_list; list; list = list->next)
965 ButtonData *button_data;
966 gboolean current_dir;
968 button_data = BUTTON_DATA (list->data);
969 if (button_data->type != NORMAL_BUTTON)
971 current_dir = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button));
972 gtk_path_bar_update_button_appearance (path_bar, button_data, current_dir);
979 change_icon_theme (GtkPathBar *path_bar)
981 GtkSettings *settings;
984 settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (path_bar)));
986 if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width, &height))
987 path_bar->icon_size = MAX (width, height);
989 path_bar->icon_size = FALLBACK_ICON_SIZE;
991 reload_icons (path_bar);
993 /* Callback used when a GtkSettings value changes */
995 settings_notify_cb (GObject *object,
997 GtkPathBar *path_bar)
1001 name = g_param_spec_get_name (pspec);
1003 if (! strcmp (name, "gtk-icon-theme-name") ||
1004 ! strcmp (name, "gtk-icon-sizes"))
1005 change_icon_theme (path_bar);
1009 gtk_path_bar_check_icon_theme (GtkPathBar *path_bar)
1011 GtkSettings *settings;
1013 if (path_bar->settings_signal_id)
1016 settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (path_bar)));
1017 path_bar->settings_signal_id = g_signal_connect (settings, "notify", G_CALLBACK (settings_notify_cb), path_bar);
1019 change_icon_theme (path_bar);
1022 /* Public functions and their helpers */
1024 gtk_path_bar_clear_buttons (GtkPathBar *path_bar)
1026 while (path_bar->button_list != NULL)
1028 gtk_container_remove (GTK_CONTAINER (path_bar), BUTTON_DATA (path_bar->button_list->data)->button);
1030 path_bar->first_scrolled_button = NULL;
1031 path_bar->fake_root = NULL;
1035 button_clicked_cb (GtkWidget *button,
1038 ButtonData *button_data;
1039 GtkPathBar *path_bar;
1041 gboolean child_is_hidden;
1042 GtkFilePath *child_path;
1044 button_data = BUTTON_DATA (data);
1045 if (button_data->ignore_changes)
1048 path_bar = GTK_PATH_BAR (button->parent);
1050 button_list = g_list_find (path_bar->button_list, button_data);
1051 g_assert (button_list != NULL);
1053 g_signal_handlers_block_by_func (button,
1054 G_CALLBACK (button_clicked_cb), data);
1055 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
1056 g_signal_handlers_unblock_by_func (button,
1057 G_CALLBACK (button_clicked_cb), data);
1059 if (button_list->prev)
1061 ButtonData *child_data;
1063 child_data = BUTTON_DATA (button_list->prev->data);
1064 child_path = child_data->path;
1065 child_is_hidden = child_data->file_is_hidden;
1070 child_is_hidden = FALSE;
1073 g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0,
1074 button_data->path, child_path, child_is_hidden);
1077 struct SetButtonImageData
1079 GtkPathBar *path_bar;
1080 ButtonData *button_data;
1084 set_button_image_get_info_cb (GtkFileSystemHandle *handle,
1085 const GtkFileInfo *info,
1086 const GError *error,
1089 gboolean cancelled = handle->cancelled;
1091 struct SetButtonImageData *data = user_data;
1093 if (handle != data->button_data->handle)
1096 data->button_data->handle = NULL;
1098 if (!data->button_data->button)
1100 g_free (data->button_data);
1104 if (cancelled || error)
1107 pixbuf = gtk_file_info_render_icon (info, GTK_WIDGET (data->path_bar),
1108 data->path_bar->icon_size, NULL);
1109 gtk_image_set_from_pixbuf (GTK_IMAGE (data->button_data->image), pixbuf);
1111 switch (data->button_data->type)
1114 if (data->path_bar->home_icon)
1115 g_object_unref (pixbuf);
1117 data->path_bar->home_icon = pixbuf;
1120 case DESKTOP_BUTTON:
1121 if (data->path_bar->desktop_icon)
1122 g_object_unref (pixbuf);
1124 data->path_bar->desktop_icon = pixbuf;
1133 g_object_unref (handle);
1137 set_button_image (GtkPathBar *path_bar,
1138 ButtonData *button_data)
1140 GtkFileSystemVolume *volume;
1141 struct SetButtonImageData *data;
1143 switch (button_data->type)
1147 if (path_bar->root_icon != NULL)
1149 gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), path_bar->root_icon);
1153 volume = gtk_file_system_get_volume_for_path (path_bar->file_system, path_bar->root_path);
1157 path_bar->root_icon = gtk_file_system_volume_render_icon (path_bar->file_system,
1159 GTK_WIDGET (path_bar),
1160 path_bar->icon_size,
1162 gtk_file_system_volume_free (path_bar->file_system, volume);
1164 gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), path_bar->root_icon);
1168 if (path_bar->home_icon != NULL)
1170 gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), path_bar->home_icon);
1174 data = g_new0 (struct SetButtonImageData, 1);
1175 data->path_bar = path_bar;
1176 data->button_data = button_data;
1178 if (button_data->handle)
1179 gtk_file_system_cancel_operation (button_data->handle);
1181 button_data->handle =
1182 gtk_file_system_get_info (path_bar->file_system,
1183 path_bar->home_path,
1185 set_button_image_get_info_cb,
1189 case DESKTOP_BUTTON:
1190 if (path_bar->desktop_icon != NULL)
1192 gtk_image_set_from_pixbuf (GTK_IMAGE (button_data->image), path_bar->desktop_icon);
1196 data = g_new0 (struct SetButtonImageData, 1);
1197 data->path_bar = path_bar;
1198 data->button_data = button_data;
1200 if (button_data->handle)
1201 gtk_file_system_cancel_operation (button_data->handle);
1203 button_data->handle =
1204 gtk_file_system_get_info (path_bar->file_system,
1205 path_bar->desktop_path,
1207 set_button_image_get_info_cb,
1216 button_data_free (ButtonData *button_data)
1218 if (button_data->path)
1219 gtk_file_path_free (button_data->path);
1220 button_data->path = NULL;
1222 g_free (button_data->dir_name);
1223 button_data->dir_name = NULL;
1225 button_data->button = NULL;
1227 if (button_data->handle)
1228 gtk_file_system_cancel_operation (button_data->handle);
1230 g_free (button_data);
1234 get_dir_name (ButtonData *button_data)
1236 return button_data->dir_name;
1239 /* We always want to request the same size for the label, whether
1240 * or not the contents are bold
1243 label_size_request_cb (GtkWidget *widget,
1244 GtkRequisition *requisition,
1245 ButtonData *button_data)
1247 const gchar *dir_name = get_dir_name (button_data);
1248 PangoLayout *layout = gtk_widget_create_pango_layout (button_data->label, dir_name);
1249 gint bold_width, bold_height;
1252 pango_layout_get_pixel_size (layout, &requisition->width, &requisition->height);
1254 markup = g_markup_printf_escaped ("<b>%s</b>", dir_name);
1255 pango_layout_set_markup (layout, markup, -1);
1258 pango_layout_get_pixel_size (layout, &bold_width, &bold_height);
1259 requisition->width = MAX (requisition->width, bold_width);
1260 requisition->height = MAX (requisition->height, bold_height);
1262 g_object_unref (layout);
1266 gtk_path_bar_update_button_appearance (GtkPathBar *path_bar,
1267 ButtonData *button_data,
1268 gboolean current_dir)
1270 const gchar *dir_name = get_dir_name (button_data);
1272 if (button_data->label != NULL)
1278 markup = g_markup_printf_escaped ("<b>%s</b>", dir_name);
1279 gtk_label_set_markup (GTK_LABEL (button_data->label), markup);
1284 gtk_label_set_text (GTK_LABEL (button_data->label), dir_name);
1288 if (button_data->image != NULL)
1290 set_button_image (path_bar, button_data);
1293 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button)) != current_dir)
1295 button_data->ignore_changes = TRUE;
1296 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_data->button), current_dir);
1297 button_data->ignore_changes = FALSE;
1302 find_button_type (GtkPathBar *path_bar,
1305 if (path_bar->root_path != NULL &&
1306 ! gtk_file_path_compare (path, path_bar->root_path))
1308 if (path_bar->home_path != NULL &&
1309 ! gtk_file_path_compare (path, path_bar->home_path))
1311 if (path_bar->desktop_path != NULL &&
1312 ! gtk_file_path_compare (path, path_bar->desktop_path))
1313 return DESKTOP_BUTTON;
1315 return NORMAL_BUTTON;
1319 button_drag_data_get_cb (GtkWidget *widget,
1320 GdkDragContext *context,
1321 GtkSelectionData *selection_data,
1326 ButtonData *button_data;
1327 GtkPathBar *path_bar;
1332 path_bar = GTK_PATH_BAR (widget->parent); /* the button's parent *is* the path bar */
1334 uri = gtk_file_system_path_to_uri (path_bar->file_system, button_data->path);
1335 uri_list = g_strconcat (uri, "\r\n", NULL);
1338 gtk_selection_data_set (selection_data,
1339 selection_data->target,
1347 make_directory_button (GtkPathBar *path_bar,
1348 const char *dir_name,
1350 gboolean current_dir,
1351 gboolean file_is_hidden)
1353 const GtkTargetEntry targets[] = {
1354 { "text/uri-list", 0, 0 }
1358 GtkWidget *child = NULL;
1359 GtkWidget *label_alignment = NULL;
1360 ButtonData *button_data;
1362 file_is_hidden = !! file_is_hidden;
1363 /* Is it a special button? */
1364 button_data = g_new0 (ButtonData, 1);
1366 button_data->type = find_button_type (path_bar, path);
1367 button_data->button = gtk_toggle_button_new ();
1368 atk_obj = gtk_widget_get_accessible (button_data->button);
1369 gtk_button_set_focus_on_click (GTK_BUTTON (button_data->button), FALSE);
1371 switch (button_data->type)
1374 button_data->image = gtk_image_new ();
1375 child = button_data->image;
1376 button_data->label = gtk_label_new (NULL);
1377 atk_object_set_name (atk_obj, _("File System Root"));
1380 case DESKTOP_BUTTON:
1381 button_data->image = gtk_image_new ();
1382 button_data->label = gtk_label_new (NULL);
1383 label_alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
1384 gtk_container_add (GTK_CONTAINER (label_alignment), button_data->label);
1385 child = gtk_hbox_new (FALSE, 2);
1386 gtk_box_pack_start (GTK_BOX (child), button_data->image, FALSE, FALSE, 0);
1387 gtk_box_pack_start (GTK_BOX (child), label_alignment, FALSE, FALSE, 0);
1391 button_data->label = gtk_label_new (NULL);
1392 label_alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
1393 gtk_container_add (GTK_CONTAINER (label_alignment), button_data->label);
1394 child = label_alignment;
1395 button_data->image = NULL;
1398 /* label_alignment is created because we can't override size-request
1399 * on label itself and still have the contents of the label centered
1400 * properly in the label's requisition
1402 if (label_alignment)
1403 g_signal_connect (label_alignment, "size-request",
1404 G_CALLBACK (label_size_request_cb), button_data);
1406 button_data->dir_name = g_strdup (dir_name);
1407 button_data->path = gtk_file_path_new_dup (gtk_file_path_get_string (path));
1408 button_data->file_is_hidden = file_is_hidden;
1410 gtk_container_add (GTK_CONTAINER (button_data->button), child);
1411 gtk_widget_show_all (button_data->button);
1413 gtk_path_bar_update_button_appearance (path_bar, button_data, current_dir);
1415 g_signal_connect (button_data->button, "clicked",
1416 G_CALLBACK (button_clicked_cb),
1418 g_object_weak_ref (G_OBJECT (button_data->button),
1419 (GWeakNotify) button_data_free, button_data);
1421 gtk_drag_source_set (button_data->button,
1424 G_N_ELEMENTS (targets),
1426 g_signal_connect (button_data->button, "drag_data_get",
1427 G_CALLBACK (button_drag_data_get_cb), button_data);
1433 gtk_path_bar_check_parent_path (GtkPathBar *path_bar,
1434 const GtkFilePath *file_path,
1435 GtkFileSystem *file_system)
1438 GList *current_path = NULL;
1439 gboolean need_new_fake_root = FALSE;
1441 for (list = path_bar->button_list; list; list = list->next)
1443 ButtonData *button_data;
1445 button_data = list->data;
1446 if (! gtk_file_path_compare (file_path, button_data->path))
1448 current_path = list;
1451 if (list == path_bar->fake_root)
1452 need_new_fake_root = TRUE;
1457 if (need_new_fake_root)
1459 path_bar->fake_root = NULL;
1460 for (list = current_path; list; list = list->next)
1462 ButtonData *button_data;
1464 button_data = list->data;
1465 if (BUTTON_IS_FAKE_ROOT (button_data))
1467 path_bar->fake_root = list;
1473 for (list = path_bar->button_list; list; list = list->next)
1475 gtk_path_bar_update_button_appearance (path_bar,
1476 BUTTON_DATA (list->data),
1477 (list == current_path) ? TRUE : FALSE);
1480 if (!gtk_widget_get_child_visible (BUTTON_DATA (current_path->data)->button))
1482 path_bar->first_scrolled_button = current_path;
1483 gtk_widget_queue_resize (GTK_WIDGET (path_bar));
1495 GtkFilePath *parent_path;
1496 GtkPathBar *path_bar;
1499 gboolean first_directory;
1503 gtk_path_bar_set_path_finish (struct SetPathInfo *info,
1510 gtk_path_bar_clear_buttons (info->path_bar);
1511 info->path_bar->button_list = g_list_reverse (info->new_buttons);
1512 info->path_bar->fake_root = info->fake_root;
1514 for (l = info->path_bar->button_list; l; l = l->next)
1516 GtkWidget *button = BUTTON_DATA (l->data)->button;
1517 gtk_container_add (GTK_CONTAINER (info->path_bar), button);
1524 for (l = info->new_buttons; l; l = l->next)
1526 ButtonData *button_data;
1528 button_data = BUTTON_DATA (l->data);
1529 gtk_widget_destroy (button_data->button);
1532 g_list_free (info->new_buttons);
1536 gtk_file_path_free (info->path);
1537 if (info->parent_path)
1538 gtk_file_path_free (info->parent_path);
1543 gtk_path_bar_get_info_callback (GtkFileSystemHandle *handle,
1544 const GtkFileInfo *file_info,
1545 const GError *error,
1548 gboolean cancelled = handle->cancelled;
1549 struct SetPathInfo *path_info = data;
1550 ButtonData *button_data;
1551 const gchar *display_name;
1555 if (handle != path_info->path_bar->set_path_handle)
1557 gtk_path_bar_set_path_finish (path_info, FALSE);
1558 g_object_unref (handle);
1562 g_object_unref (handle);
1563 path_info->path_bar->set_path_handle = NULL;
1565 if (cancelled || !file_info)
1567 gtk_path_bar_set_path_finish (path_info, FALSE);
1571 display_name = gtk_file_info_get_display_name (file_info);
1572 is_hidden = gtk_file_info_get_is_hidden (file_info);
1574 gtk_widget_push_composite_child ();
1575 button_data = make_directory_button (path_info->path_bar, display_name,
1577 path_info->first_directory, is_hidden);
1578 gtk_widget_pop_composite_child ();
1579 gtk_file_path_free (path_info->path);
1581 path_info->new_buttons = g_list_prepend (path_info->new_buttons, button_data);
1583 if (BUTTON_IS_FAKE_ROOT (button_data))
1584 path_info->fake_root = path_info->new_buttons;
1586 path_info->path = path_info->parent_path;
1587 path_info->first_directory = FALSE;
1589 if (!path_info->path)
1591 gtk_path_bar_set_path_finish (path_info, TRUE);
1595 valid = gtk_file_system_get_parent (path_info->path_bar->file_system,
1597 &path_info->parent_path,
1601 gtk_path_bar_set_path_finish (path_info, FALSE);
1605 path_info->path_bar->set_path_handle =
1606 gtk_file_system_get_info (handle->file_system,
1608 GTK_FILE_INFO_DISPLAY_NAME | GTK_FILE_INFO_IS_HIDDEN,
1609 gtk_path_bar_get_info_callback,
1614 _gtk_path_bar_set_path (GtkPathBar *path_bar,
1615 const GtkFilePath *file_path,
1616 const gboolean keep_trail,
1619 struct SetPathInfo *info;
1622 g_return_val_if_fail (GTK_IS_PATH_BAR (path_bar), FALSE);
1623 g_return_val_if_fail (file_path != NULL, FALSE);
1627 /* Check whether the new path is already present in the pathbar as buttons.
1628 * This could be a parent directory or a previous selected subdirectory.
1631 gtk_path_bar_check_parent_path (path_bar, file_path, path_bar->file_system))
1634 info = g_new0 (struct SetPathInfo, 1);
1635 info->path = gtk_file_path_copy (file_path);
1636 info->path_bar = path_bar;
1637 info->first_directory = TRUE;
1639 result = gtk_file_system_get_parent (path_bar->file_system,
1640 info->path, &info->parent_path, error);
1643 gtk_file_path_free (info->path);
1648 if (path_bar->set_path_handle)
1649 gtk_file_system_cancel_operation (path_bar->set_path_handle);
1651 path_bar->set_path_handle =
1652 gtk_file_system_get_info (path_bar->file_system,
1654 GTK_FILE_INFO_DISPLAY_NAME | GTK_FILE_INFO_IS_HIDDEN,
1655 gtk_path_bar_get_info_callback,
1661 /* FIXME: This should be a construct-only property */
1663 _gtk_path_bar_set_file_system (GtkPathBar *path_bar,
1664 GtkFileSystem *file_system)
1669 g_return_if_fail (GTK_IS_PATH_BAR (path_bar));
1671 g_assert (path_bar->file_system == NULL);
1673 path_bar->file_system = g_object_ref (file_system);
1675 home = g_get_home_dir ();
1678 gchar *freeme = NULL;
1680 path_bar->home_path = gtk_file_system_filename_to_path (path_bar->file_system, home);
1681 /* FIXME: Need file system backend specific way of getting the
1684 desktop = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
1685 if (desktop != NULL)
1686 path_bar->desktop_path = gtk_file_system_filename_to_path (path_bar->file_system, desktop);
1688 path_bar->desktop_path = NULL;
1692 path_bar->home_path = NULL;
1693 path_bar->desktop_path = NULL;
1695 path_bar->root_path = gtk_file_system_filename_to_path (path_bar->file_system, "/");
1700 * @path_bar: a #GtkPathBar
1702 * If the selected button in the pathbar is not the furthest button "up" (in the
1703 * root direction), act as if the user clicked on the next button up.
1706 _gtk_path_bar_up (GtkPathBar *path_bar)
1710 for (l = path_bar->button_list; l; l = l->next)
1712 GtkWidget *button = BUTTON_DATA (l->data)->button;
1713 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
1717 GtkWidget *next_button = BUTTON_DATA (l->next->data)->button;
1718 button_clicked_cb (next_button, l->next->data);
1726 * _gtk_path_bar_down:
1727 * @path_bar: a #GtkPathBar
1729 * If the selected button in the pathbar is not the furthest button "down" (in the
1730 * leaf direction), act as if the user clicked on the next button down.
1733 _gtk_path_bar_down (GtkPathBar *path_bar)
1737 for (l = path_bar->button_list; l; l = l->next)
1739 GtkWidget *button = BUTTON_DATA (l->data)->button;
1740 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
1744 GtkWidget *prev_button = BUTTON_DATA (l->prev->data)->button;
1745 button_clicked_cb (prev_button, l->prev->data);
1752 #define __GTK_PATH_BAR_C__
1753 #include "gtkaliasdef.c"