d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * This file is part of the GNOME Devtools Libraries.
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * Copyright (C) 2003 Jeroen Zwartepoorte <jeroen@xs4all.nl>
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * This library is free software; you can redistribute it and/or
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * modify it under the terms of the GNU Lesser General Public
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * License as published by the Free Software Foundation; either
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * version 2.1 of the License, or (at your option) any later version.
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * This library is distributed in the hope that it will be useful,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * but WITHOUT ANY WARRANTY; without even the implied warranty of
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * Lesser General Public License for more details.
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * You should have received a copy of the GNU Lesser General Public
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * License along with this library; if not, write to the Free Software
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b/* ----- Private prototypes ----- */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_class_init (GdlDockBarClass *klass);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_get_property (GObject *object,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_set_property (GObject *object,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_destroy (GtkObject *object);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_attach (GdlDockBar *dockbar,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_remove_item (GdlDockBar *dockbar,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b/* ----- Class variables and definitions ----- */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b/* ----- Private functions ----- */
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex ValavanisG_DEFINE_TYPE (GdlDockBar, gdl_dock_bar, GTK_TYPE_BOX)
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_request (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_allocate (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_vrequest (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_vallocate (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_hrequest (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_hallocate (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void update_dock_items (GdlDockBar *dockbar, gboolean full_update);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_class->get_property = gdl_dock_bar_get_property;
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_class->set_property = gdl_dock_bar_set_property;
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b _("GdlDockMaster object which the dockbar widget "
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b "is attached to"),
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_param_spec_enum ("dockbar-style", _("Dockbar style"),
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b _("Dockbar style to show items on it"),
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b widget_class->size_request = gdl_dock_bar_size_request;
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b widget_class->size_allocate = gdl_dock_bar_size_allocate;
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b dockbar->_priv->orientation = GTK_ORIENTATION_VERTICAL;
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_value_set_object (value, dockbar->_priv->master);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_value_set_enum (value, dockbar->_priv->dockbar_style);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b gdl_dock_bar_attach (dockbar, g_value_get_object (value));
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b dockbar->_priv->dockbar_style = g_value_get_enum (value);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bon_dock_item_foreach_disconnect (GdlDockItem *item, GdlDockBar *dock_bar)
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_signal_handlers_disconnect_by_func (item, gdl_dock_bar_remove_item,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_signal_handlers_disconnect_matched (priv->master,
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis GTK_OBJECT_CLASS (gdl_dock_bar_parent_class)->destroy (object);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_warning ("Item has not been added to the dockbar");
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b button = g_object_get_data (G_OBJECT (item), "GdlDockBarButton");
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b gtk_container_remove (GTK_CONTAINER (dockbar), button);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_set_data (G_OBJECT (item), "GdlDockBarButton", NULL);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b dockbar = g_object_get_data (G_OBJECT (item), "GdlDockBar");
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_set_data (G_OBJECT (item), "GdlDockBar", NULL);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b controller = gdl_dock_master_get_controller (GDL_DOCK_OBJECT_GET_MASTER (item));
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b GDL_DOCK_OBJECT_UNSET_FLAGS (item, GDL_DOCK_ICONIFIED);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_warning ("Item has already been added to the dockbar");
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* Create a button for the item. */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b if (dockbar->_priv->orientation == GTK_ORIENTATION_HORIZONTAL)
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_get (item, "stock-id", &stock_id, "pixbuf-icon", &pixbuf_icon,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b if (dockbar->_priv->dockbar_style == GDL_DOCK_BAR_TEXT ||
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b dockbar->_priv->dockbar_style == GDL_DOCK_BAR_BOTH) {
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b if (dockbar->_priv->orientation == GTK_ORIENTATION_VERTICAL)
8f68941caf80aff5c249f79af65bd7c39523a2b1Alex Valavanis gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* FIXME: For now AUTO behaves same as BOTH */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b if (dockbar->_priv->dockbar_style == GDL_DOCK_BAR_ICONS ||
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b dockbar->_priv->dockbar_style == GDL_DOCK_BAR_BOTH ||
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b dockbar->_priv->dockbar_style == GDL_DOCK_BAR_AUTO) {
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b } else if (pixbuf_icon) {
8f68941caf80aff5c249f79af65bd7c39523a2b1Alex Valavanis gtk_box_pack_start (GTK_BOX (box), image, TRUE, TRUE, 0);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b gtk_box_pack_start (GTK_BOX (dockbar), button, FALSE, FALSE, 0);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_set_data (G_OBJECT (item), "GdlDockBar", dockbar);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_set_data (G_OBJECT (item), "GdlDockBarButton", button);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* Set up destroy notify */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* add only items, not toplevels */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bupdate_dock_items (GdlDockBar *dockbar, gboolean full_update)
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* build items list */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b gdl_dock_master_foreach (master, (GFunc) build_list, &items);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b if (g_slist_index (dockbar->_priv->items, item) != -1 &&
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b else if (g_slist_index (dockbar->_priv->items, item) == -1 &&
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b if (g_slist_index (dockbar->_priv->items, item) != -1)
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bgdl_dock_bar_layout_changed_cb (GdlDockMaster *master,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_return_if_fail (master == NULL || GDL_IS_DOCK_MASTER (master));
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_signal_handlers_disconnect_matched (dockbar->_priv->master,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_signal_connect (dockbar->_priv->master, "layout-changed",
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_request (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* default to vertical for unknown values */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_allocate (GtkWidget *widget,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* default to vertical for unknown values */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_vrequest (GtkWidget *widget,
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if (gtk_widget_get_visible (GTK_WIDGET (child->data)))
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_size_request (GTK_WIDGET (child->data), &child_requisition);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis height = child_requisition.height + padding * 2;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis requisition->height = MAX (requisition->height, height);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis requisition->height += child_requisition.height + padding * 2;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis requisition->width = MAX (requisition->width, child_requisition.width);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis requisition->height += (nvis_children - 1) * gtk_box_get_spacing (box);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_vallocate (GtkWidget *widget,
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis gtk_widget_set_allocation (widget, allocation);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis gtk_widget_get_requisition (widget, &requisition);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if (gtk_widget_get_visible (GTK_WIDGET(child->data)))
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis (nvis_children - 1) * gtk_box_get_spacing (box));
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis height = (gint) allocation->height - (gint) requisition.height;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.x = allocation->x + border_width;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.width = MAX (1, (gint) allocation->width - (gint) border_width * 2);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if ((pack_type == GTK_PACK_START) && gtk_widget_get_visible (GTK_WIDGET (child->data)))
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_get_child_requisition (GTK_WIDGET (child->data), &child_requisition);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_height = child_requisition.height + padding * 2;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_allocation.height = MAX (1, child_height - padding * 2);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_get_child_requisition (GTK_WIDGET (child->data), &child_requisition);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.height = child_requisition.height;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.y = y + (child_height - child_allocation.height) / 2;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_size_allocate (GTK_WIDGET (child->data), &child_allocation);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis y += child_height + gtk_box_get_spacing (box);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis y = allocation->y + allocation->height - border_width;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if ((pack_type == GTK_PACK_END) && gtk_widget_get_visible (GTK_WIDGET (child->data)))
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_get_child_requisition (GTK_WIDGET (child->data), &child_requisition);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_height = child_requisition.height + padding * 2;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_allocation.height = MAX (1, child_height - padding * 2);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_allocation.y = y + padding - child_height;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.height = child_requisition.height;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.y = y + (child_height - child_allocation.height) / 2 - child_height;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_size_allocate (GTK_WIDGET (child->data), &child_allocation);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis y -= (child_height + gtk_box_get_spacing (box));
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_hrequest (GtkWidget *widget,
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if (gtk_widget_get_visible (GTK_WIDGET (child->data)))
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_size_request (GTK_WIDGET (child->data), &child_requisition);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis width = child_requisition.width + padding * 2;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis requisition->width = MAX (requisition->width, width);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis requisition->width += child_requisition.width + padding * 2;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis requisition->height = MAX (requisition->height, child_requisition.height);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis requisition->width += (nvis_children - 1) * gtk_box_get_spacing (box);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bstatic void gdl_dock_bar_size_hallocate (GtkWidget *widget,
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis gtk_widget_set_allocation (widget, allocation);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis gtk_widget_get_requisition (widget, &requisition);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis direction = gtk_widget_get_direction (widget);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if (gtk_widget_get_visible (GTK_WIDGET (child->data)))
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis border_width = gtk_container_get_border_width (GTK_CONTAINER (box));
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis (nvis_children - 1) * gtk_box_get_spacing (box));
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis width = (gint) allocation->width - (gint) requisition.width;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.y = allocation->y + border_width;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.height = MAX (1, (gint) allocation->height - (gint) border_width * 2);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if ((pack_type == GTK_PACK_START) && gtk_widget_get_visible (GTK_WIDGET (child->data)))
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_get_child_requisition (GTK_WIDGET (child->data), &child_requisition);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_width = child_requisition.width + padding * 2;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_allocation.width = MAX (1, child_width - padding * 2);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_get_child_requisition (GTK_WIDGET (child->data), &child_requisition);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.width = child_requisition.width;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.x = x + (child_width - child_allocation.width) / 2;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_size_allocate (GTK_WIDGET (child->data), &child_allocation);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis x += child_width + gtk_box_get_spacing (box);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis x = allocation->x + allocation->width - border_width;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis for (child = gtk_container_get_children (GTK_CONTAINER (box));
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis if ((pack_type == GTK_PACK_END) && gtk_widget_get_visible (GTK_WIDGET (child->data)))
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_get_child_requisition (GTK_WIDGET (child->data), &child_requisition);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_width = child_requisition.width + padding * 2;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_allocation.width = MAX (1, child_width - padding * 2);
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis child_allocation.x = x + padding - child_width;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.width = child_requisition.width;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.x = x + (child_width - child_allocation.width) / 2 - child_width;
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
25587daccfe04cdc288082cbd6195326c0166f32Alex Valavanis gtk_widget_size_allocate (GTK_WIDGET (child->data), &child_allocation);
d19de0ff8b0793e74e98429ded50868ce7e9f75cAlex Valavanis x -= (child_width + gtk_box_get_spacing (box));
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b /* get the master of the given dock */
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bGtkOrientation gdl_dock_bar_get_orientation (GdlDockBar *dockbar)
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bvoid gdl_dock_bar_set_orientation (GdlDockBar *dockbar,
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_set(G_OBJECT(dockbar), "dockbar-style", style, NULL);
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_bGdlDockBarStyle gdl_dock_bar_get_style(GdlDockBar* dockbar)
a0df1b8dd5b14367c583ce2f72a2ca6bf1cde799gustav_b g_object_get(G_OBJECT(dockbar), "dockbar-style", &style, NULL);