summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2011-07-09 19:07:46 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2011-07-09 19:07:46 +0000
commit3fb6de18c5d4b6a5f4fb08dfdb94cb39e8cd3844 (patch)
treeb0ff98a38e2120c9b56a1b2ba979a4b0722f4ca6 /src
parentMerge upstream GDL 2.24.0 changes (diff)
downloadinkscape-3fb6de18c5d4b6a5f4fb08dfdb94cb39e8cd3844.tar.gz
inkscape-3fb6de18c5d4b6a5f4fb08dfdb94cb39e8cd3844.zip
Merge upstream GDL 2.26.0 changes
(bzr r10435)
Diffstat (limited to 'src')
-rw-r--r--src/libgdl/gdl-combo-button.h4
-rw-r--r--src/libgdl/gdl-dock-bar.h1
-rw-r--r--src/libgdl/gdl-dock-item-grip.c99
-rw-r--r--src/libgdl/gdl-dock-item.c261
-rw-r--r--src/libgdl/gdl-dock.c2
-rw-r--r--src/libgdl/gdl-stock.c2
-rw-r--r--src/libgdl/gdl-switcher.c2
7 files changed, 283 insertions, 88 deletions
diff --git a/src/libgdl/gdl-combo-button.h b/src/libgdl/gdl-combo-button.h
index 6e80af0b6..2f9c3ca2c 100644
--- a/src/libgdl/gdl-combo-button.h
+++ b/src/libgdl/gdl-combo-button.h
@@ -21,9 +21,7 @@
#ifndef _GDL_COMBO_BUTTON_H_
#define _GDL_COMBO_BUTTON_H_
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkmenu.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/src/libgdl/gdl-dock-bar.h b/src/libgdl/gdl-dock-bar.h
index 798dded20..ca6da1d26 100644
--- a/src/libgdl/gdl-dock-bar.h
+++ b/src/libgdl/gdl-dock-bar.h
@@ -23,7 +23,6 @@
#define __GDL_DOCK_BAR_H__
#include <gtk/gtk.h>
-#include "libgdl/gdl-dock.h"
G_BEGIN_DECLS
diff --git a/src/libgdl/gdl-dock-item-grip.c b/src/libgdl/gdl-dock-item-grip.c
index 91b88e782..7f7d17ab2 100644
--- a/src/libgdl/gdl-dock-item-grip.c
+++ b/src/libgdl/gdl-dock-item-grip.c
@@ -42,7 +42,7 @@ struct _GdlDockItemGripPrivate {
};
GDL_CLASS_BOILERPLATE (GdlDockItemGrip, gdl_dock_item_grip,
- GtkContainer, GTK_TYPE_CONTAINER);
+ GtkContainer, GTK_TYPE_CONTAINER);
/* must be called after size_allocate */
static void
@@ -122,7 +122,7 @@ ensure_title_and_icon_pixbuf (GdlDockItemGrip *grip)
static gint
gdl_dock_item_grip_expose (GtkWidget *widget,
- GdkEventExpose *event)
+ GdkEventExpose *event)
{
GdlDockItemGrip *grip;
GdkRectangle title_area;
@@ -172,7 +172,7 @@ gdl_dock_item_grip_expose (GtkWidget *widget,
0, 0, pixbuf_rect.x, pixbuf_rect.y,
pixbuf_rect.width, pixbuf_rect.height,
GDK_RGB_DITHER_NONE, 0, 0);
- }
+ }
}
if (gdk_rectangle_intersect (&title_area, &event->area, &expose_area)) {
@@ -221,15 +221,15 @@ gdl_dock_item_grip_item_notify (GObject *master,
g_free (grip->_priv->title);
grip->_priv->title = NULL;
ensure_title_and_icon_pixbuf (grip);
- gtk_widget_queue_draw (GTK_WIDGET (grip));
+ gtk_widget_queue_draw (GTK_WIDGET (grip));
} else if (strcmp (pspec->name, "behavior") == 0) {
- cursor = FALSE;
+ cursor = FALSE;
if (grip->_priv->close_button) {
if (GDL_DOCK_ITEM_CANT_CLOSE (grip->item)) {
gtk_widget_hide (GTK_WIDGET (grip->_priv->close_button));
} else {
gtk_widget_show (GTK_WIDGET (grip->_priv->close_button));
- cursor = TRUE;
+ cursor = TRUE;
}
}
if (grip->_priv->iconify_button) {
@@ -237,10 +237,10 @@ gdl_dock_item_grip_item_notify (GObject *master,
gtk_widget_hide (GTK_WIDGET (grip->_priv->iconify_button));
} else {
gtk_widget_show (GTK_WIDGET (grip->_priv->iconify_button));
- cursor = TRUE;
+ cursor = TRUE;
}
}
- if (grip->title_window && !cursor)
+ if (grip->title_window && !cursor)
gdk_window_set_cursor (grip->title_window, NULL);
}
@@ -301,9 +301,9 @@ gdl_dock_item_grip_set_property (GObject *object,
g_signal_connect (grip->item, "notify::stock-id",
G_CALLBACK (gdl_dock_item_grip_item_notify),
grip);
- g_signal_connect (grip->item, "notify::behavior",
- G_CALLBACK (gdl_dock_item_grip_item_notify),
- grip);
+ g_signal_connect (grip->item, "notify::behavior",
+ G_CALLBACK (gdl_dock_item_grip_item_notify),
+ grip);
if (!GDL_DOCK_ITEM_CANT_CLOSE (grip->item) && grip->_priv->close_button)
gtk_widget_show (grip->_priv->close_button);
@@ -353,6 +353,7 @@ gdl_dock_item_grip_instance_init (GdlDockItemGrip *grip)
grip->_priv->icon_pixbuf = NULL;
grip->_priv->title_layout = NULL;
+ /* create the close button */
gtk_widget_push_composite_child ();
grip->_priv->close_button = gtk_button_new ();
gtk_widget_pop_composite_child ();
@@ -369,6 +370,7 @@ gdl_dock_item_grip_instance_init (GdlDockItemGrip *grip)
g_signal_connect (G_OBJECT (grip->_priv->close_button), "clicked",
G_CALLBACK (gdl_dock_item_grip_close_clicked), grip);
+ /* create the iconify button */
gtk_widget_push_composite_child ();
grip->_priv->iconify_button = gtk_button_new ();
gtk_widget_pop_composite_child ();
@@ -385,6 +387,7 @@ gdl_dock_item_grip_instance_init (GdlDockItemGrip *grip)
g_signal_connect (G_OBJECT (grip->_priv->iconify_button), "clicked",
G_CALLBACK (gdl_dock_item_grip_iconify_clicked), grip);
+ /* set tooltips on the buttons */
gtk_widget_set_tooltip_text (grip->_priv->iconify_button,
_("Iconify this dock"));
gtk_widget_set_tooltip_text (grip->_priv->close_button,
@@ -426,15 +429,14 @@ gdl_dock_item_grip_realize (GtkWidget *widget)
gdk_window_set_user_data (grip->title_window, widget);
- if (GDL_DOCK_ITEM_CANT_CLOSE (grip->item))
- cursor = NULL;
- else if (GDL_DOCK_ITEM_CANT_ICONIFY (grip->item))
- cursor = NULL;
- else
- cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
+ if (GDL_DOCK_ITEM_CANT_CLOSE (grip->item) &&
+ GDL_DOCK_ITEM_CANT_ICONIFY (grip->item))
+ cursor = NULL;
+ else
+ cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
GDK_HAND2);
gdk_window_set_cursor (grip->title_window, cursor);
- if (cursor)
+ if (cursor)
gdk_cursor_unref (cursor);
}
}
@@ -497,15 +499,17 @@ gdl_dock_item_grip_size_request (GtkWidget *widget,
pango_layout_get_pixel_size (grip->_priv->title_layout, NULL, &layout_height);
gtk_widget_size_request (grip->_priv->close_button, &child_requisition);
-
- requisition->width += child_requisition.width;
layout_height = MAX (layout_height, child_requisition.height);
+ if (GTK_WIDGET_VISIBLE (grip->_priv->close_button)) {
+ requisition->width += child_requisition.width;
+ }
gtk_widget_size_request (grip->_priv->iconify_button, &child_requisition);
-
- requisition->width += child_requisition.width;
layout_height = MAX (layout_height, child_requisition.height);
-
+ if (GTK_WIDGET_VISIBLE (grip->_priv->iconify_button)) {
+ requisition->width += child_requisition.width;
+ }
+
requisition->height += layout_height;
if (grip->_priv->icon_pixbuf) {
@@ -579,33 +583,35 @@ gdl_dock_item_grip_size_allocate (GtkWidget *widget,
child_allocation.x = allocation->x + allocation->width - container->border_width;
child_allocation.y = allocation->y + container->border_width;
- gtk_widget_size_request (grip->_priv->close_button, &button_requisition);
-
- if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL)
- child_allocation.x -= button_requisition.width;
+ if (GTK_WIDGET_VISIBLE (grip->_priv->close_button)) {
+ gtk_widget_size_request (grip->_priv->close_button, &button_requisition);
- child_allocation.width = button_requisition.width;
- child_allocation.height = button_requisition.height;
-
- gtk_widget_size_allocate (grip->_priv->close_button, &child_allocation);
-
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- child_allocation.x += button_requisition.width;
+ if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL)
+ child_allocation.x -= button_requisition.width;
+ child_allocation.width = button_requisition.width;
+ child_allocation.height = button_requisition.height;
+
+ gtk_widget_size_allocate (grip->_priv->close_button, &child_allocation);
- gtk_widget_size_request (grip->_priv->iconify_button, &button_requisition);
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ child_allocation.x += button_requisition.width;
+ }
- if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL)
- child_allocation.x -= button_requisition.width;
+ if (GTK_WIDGET_VISIBLE (grip->_priv->iconify_button)) {
+ gtk_widget_size_request (grip->_priv->iconify_button, &button_requisition);
- child_allocation.width = button_requisition.width;
- child_allocation.height = button_requisition.height;
+ if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL)
+ child_allocation.x -= button_requisition.width;
- gtk_widget_size_allocate (grip->_priv->iconify_button, &child_allocation);
+ child_allocation.width = button_requisition.width;
+ child_allocation.height = button_requisition.height;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- child_allocation.x += button_requisition.width;
+ gtk_widget_size_allocate (grip->_priv->iconify_button, &child_allocation);
+ if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+ child_allocation.x += button_requisition.width;
+ }
if (grip->title_window) {
GdkRectangle area;
@@ -712,6 +718,15 @@ gdl_dock_item_grip_class_init (GdlDockItemGripClass *klass)
gdl_stock_init ();
}
+/* ----- Public interface ----- */
+
+/**
+ * gdl_dock_item_grip_new:
+ * @item: The dock item that will "own" this grip widget.
+ *
+ * Creates a new GDL dock item grip object.
+ * Returns: The newly created dock item grip widget.
+ **/
GtkWidget *
gdl_dock_item_grip_new (GdlDockItem *item)
{
diff --git a/src/libgdl/gdl-dock-item.c b/src/libgdl/gdl-dock-item.c
index d2c36b18a..86f729c61 100644
--- a/src/libgdl/gdl-dock-item.c
+++ b/src/libgdl/gdl-dock-item.c
@@ -281,6 +281,16 @@ gdl_dock_item_class_init (GdlDockItemClass *klass)
/* properties */
+ /**
+ * GdlDockItem:orientation:
+ *
+ * The orientation of the docking item. If the orientation is set to
+ * #GTK_ORIENTATION_VERTICAL, the grip widget will be shown along
+ * the top of the edge of item (if it is not hidden). If the
+ * orientation is set to #GTK_ORIENTATION_HORIZONTAL, the grip
+ * widget will be shown down the left edge of the item (even if the
+ * widget text direction is set to RTL).
+ */
g_object_class_install_property (
g_object_class, PROP_ORIENTATION,
g_param_spec_enum ("orientation", _("Orientation"),
@@ -339,6 +349,12 @@ gdl_dock_item_class_init (GdlDockItemClass *klass)
/* signals */
+ /**
+ * GdlDockItem::dock-drag-begin:
+ * @item: The dock item which is being dragged.
+ *
+ * Signals that the dock item has begun to be dragged.
+ **/
gdl_dock_item_signals [DOCK_DRAG_BEGIN] =
g_signal_new ("dock-drag-begin",
G_TYPE_FROM_CLASS (klass),
@@ -349,7 +365,15 @@ gdl_dock_item_class_init (GdlDockItemClass *klass)
gdl_marshal_VOID__VOID,
G_TYPE_NONE,
0);
-
+
+ /**
+ * GdlDockItem::dock-drag-motion:
+ * @item: The dock item which is being dragged.
+ * @x: The x-position that the dock item has been dragged to.
+ * @y: The y-position that the dock item has been dragged to.
+ *
+ * Signals that a dock item dragging motion event has occured.
+ **/
gdl_dock_item_signals [DOCK_DRAG_MOTION] =
g_signal_new ("dock-drag-motion",
G_TYPE_FROM_CLASS (klass),
@@ -363,6 +387,14 @@ gdl_dock_item_class_init (GdlDockItemClass *klass)
G_TYPE_INT,
G_TYPE_INT);
+ /**
+ * GdlDockItem::dock-drag-end:
+ * @item: The dock item which is no longer being dragged.
+ * @cancel: This value is set to TRUE if the drag was cancelled by
+ * the user. #cancel is set to FALSE if the drag was accepted.
+ *
+ * Signals that the dock item dragging has ended.
+ **/
gdl_dock_item_signals [DOCK_DRAG_END] =
g_signal_new ("dock_drag_end",
G_TYPE_FROM_CLASS (klass),
@@ -1401,60 +1433,64 @@ gdl_dock_item_dock (GdlDockObject *object,
if (parent)
gdl_dock_object_freeze (parent);
- /* ref ourselves since we could be destroyed when detached */
+
if (new_parent)
{
+ /* ref ourselves since we could be destroyed when detached */
g_object_ref (object);
GDL_DOCK_OBJECT_SET_FLAGS (object, GDL_DOCK_IN_REFLOW);
gdl_dock_object_detach (object, FALSE);
- }
- /* freeze the new parent, so reduce won't get called before it's
- actually added to our parent */
- gdl_dock_object_freeze (new_parent);
+ /* freeze the new parent, so reduce won't get called before it's
+ actually added to our parent */
+ gdl_dock_object_freeze (new_parent);
- /* bind the new parent to our master, so the following adds work */
- gdl_dock_object_bind (new_parent, G_OBJECT (GDL_DOCK_OBJECT_GET_MASTER (object)));
+ /* bind the new parent to our master, so the following adds work */
+ gdl_dock_object_bind (new_parent, G_OBJECT (GDL_DOCK_OBJECT_GET_MASTER (object)));
- /* add the objects */
- if (add_ourselves_first) {
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
- splitpos = available_space - pref_size;
- } else {
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
- splitpos = pref_size;
- }
+ /* add the objects */
+ if (add_ourselves_first) {
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
+ splitpos = available_space - pref_size;
+ } else {
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
+ splitpos = pref_size;
+ }
- /* add the new parent to the parent */
- if (parent)
- gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (new_parent));
+ /* add the new parent to the parent */
+ if (parent)
+ gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (new_parent));
- /* show automatic object */
- if (gtk_widget_get_visible (GTK_WIDGET (object)))
- {
- gtk_widget_show (GTK_WIDGET (new_parent));
- GDL_DOCK_OBJECT_UNSET_FLAGS (object, GDL_DOCK_IN_REFLOW);
+ /* show automatic object */
+ if (gtk_widget_get_visible (GTK_WIDGET (object)))
+ {
+ gtk_widget_show (GTK_WIDGET (new_parent));
+ GDL_DOCK_OBJECT_UNSET_FLAGS (object, GDL_DOCK_IN_REFLOW);
+ }
gdl_dock_object_thaw (new_parent);
+
+ /* use extra docking parameter */
+ if (position != GDL_DOCK_CENTER && other_data &&
+ G_VALUE_HOLDS (other_data, G_TYPE_UINT)) {
+
+ g_object_set (G_OBJECT (new_parent),
+ "position", g_value_get_uint (other_data),
+ NULL);
+ } else if (splitpos > 0 && splitpos < available_space) {
+ g_object_set (G_OBJECT (new_parent), "position", splitpos, NULL);
+ }
+
+ g_object_unref (object);
}
- else // If the parent is already a DockNotebook, we don't need
- // to create a new one.
+ else
+ {
+ /* If the parent is already a DockNotebook, we don't need
+ to create a new one. */
gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (requestor));
-
- /* use extra docking parameter */
- if (position != GDL_DOCK_CENTER && other_data &&
- G_VALUE_HOLDS (other_data, G_TYPE_UINT)) {
-
- g_object_set (G_OBJECT (new_parent),
- "position", g_value_get_uint (other_data),
- NULL);
- } else if (splitpos > 0 && splitpos < available_space) {
- g_object_set (G_OBJECT (new_parent), "position", splitpos, NULL);
}
- g_object_unref (object);
-
requestor_parent = gdl_dock_object_get_parent_object (requestor);
if (GDL_IS_DOCK_NOTEBOOK (requestor_parent))
{
@@ -1665,6 +1701,17 @@ gdl_dock_item_real_set_orientation (GdlDockItem *item,
/* ----- Public interface ----- */
+/**
+ * gdl_dock_item_new:
+ * @name: Unique name for identifying the dock object.
+ * @long_name: Human readable name for the dock object.
+ * @behavior: General behavior for the dock item (i.e. whether it can
+ * float, if it's locked, etc.), as specified by
+ * #GdlDockItemBehavior flags.
+ *
+ * Creates a new dock item widget.
+ * Returns: The newly created dock item grip widget.
+ **/
GtkWidget *
gdl_dock_item_new (const gchar *name,
const gchar *long_name,
@@ -1682,6 +1729,18 @@ gdl_dock_item_new (const gchar *name,
return GTK_WIDGET (item);
}
+/**
+ * gdl_dock_item_new_with_stock:
+ * @name: Unique name for identifying the dock object.
+ * @long_name: Human readable name for the dock object.
+ * @stock_id: Stock icon for the dock object.
+ * @behavior: General behavior for the dock item (i.e. whether it can
+ * float, if it's locked, etc.), as specified by
+ * #GdlDockItemBehavior flags.
+ *
+ * Creates a new dock item grip widget with a given stock id.
+ * Returns: The newly created dock item grip widget.
+ **/
GtkWidget *
gdl_dock_item_new_with_stock (const gchar *name,
const gchar *long_name,
@@ -1724,6 +1783,15 @@ gdl_dock_item_new_with_pixbuf_icon (const gchar *name,
}
/* convenient function (and to preserve source compat) */
+/**
+ * gdl_dock_item_dock_to:
+ * @item: The dock item that will be relocated to the dock position.
+ * @target: The dock item that will be used as the point of reference.
+ * @position: The position to dock #item, relative to #target.
+ * @docking_param: This value is unused, and will be ignored.
+ *
+ * Relocates a dock item to a new location relative to another dock item.
+ **/
void
gdl_dock_item_dock_to (GdlDockItem *item,
GdlDockItem *target,
@@ -1761,6 +1829,18 @@ gdl_dock_item_dock_to (GdlDockItem *item,
position, NULL);
}
+/**
+ * gdl_dock_item_set_orientation:
+ * @item: The dock item which will get it's orientation set.
+ * @orientation: The orientation to set the item to. If the orientation
+ * is set to #GTK_ORIENTATION_VERTICAL, the grip widget will be shown
+ * along the top of the edge of item (if it is not hidden). If the
+ * orientation is set to #GTK_ORIENTATION_HORIZONTAL, the grip widget
+ * will be shown down the left edge of the item (even if the widget
+ * text direction is set to RTL).
+ *
+ * This function sets the layout of the dock item.
+ **/
void
gdl_dock_item_set_orientation (GdlDockItem *item,
GtkOrientation orientation)
@@ -1785,6 +1865,16 @@ gdl_dock_item_set_orientation (GdlDockItem *item,
}
}
+/**
+ * gdl_dock_item_get_tablabel:
+ * @item: The dock item from which to get the tab label widget.
+ *
+ * Gets the current tab label widget. Note that this label widget is
+ * only visible when the "switcher-style" property of the #GdlDockMaster
+ * is set to #GDL_SWITCHER_STYLE_TABS
+ *
+ * Returns: Returns the tab label widget.
+ **/
GtkWidget *
gdl_dock_item_get_tablabel (GdlDockItem *item)
{
@@ -1794,6 +1884,15 @@ gdl_dock_item_get_tablabel (GdlDockItem *item)
return item->_priv->tab_label;
}
+/**
+ * gdl_dock_item_set_tablabel:
+ * @item: The dock item which will get it's tab label widget set.
+ * @tablabel: The widget that will become the tab label.
+ *
+ * Replaces the current tab label widget with another widget. Note that
+ * this label widget is only visible when the "switcher-style" property
+ * of the #GdlDockMaster is set to #GDL_SWITCHER_STYLE_TABS
+ **/
void
gdl_dock_item_set_tablabel (GdlDockItem *item,
GtkWidget *tablabel)
@@ -1825,6 +1924,12 @@ gdl_dock_item_set_tablabel (GdlDockItem *item,
}
}
+/**
+ * gdl_dock_item_hide_grip:
+ * @item: The dock item to hide the grip of.
+ *
+ * This function hides the dock item's grip widget.
+ **/
void
gdl_dock_item_hide_grip (GdlDockItem *item)
{
@@ -1836,6 +1941,12 @@ gdl_dock_item_hide_grip (GdlDockItem *item)
g_warning ("Grips always show unless GDL_DOCK_ITEM_BEH_NO_GRIP is set\n" );
}
+/**
+ * gdl_dock_item_show_grip:
+ * @item: The dock item to show the grip of.
+ *
+ * This function shows the dock item's grip widget.
+ **/
void
gdl_dock_item_show_grip (GdlDockItem *item)
{
@@ -1847,6 +1958,14 @@ gdl_dock_item_show_grip (GdlDockItem *item)
}
/* convenient function (and to preserve source compat) */
+/**
+ * gdl_dock_item_bind:
+ * @item: The item to bind.
+ * @dock: The #GdlDock widget to bind it to. Note that this widget must
+ * be a type of #GdlDock.
+ *
+ * Binds this dock item to a new dock master.
+ **/
void
gdl_dock_item_bind (GdlDockItem *item,
GtkWidget *dock)
@@ -1859,6 +1978,12 @@ gdl_dock_item_bind (GdlDockItem *item,
}
/* convenient function (and to preserve source compat) */
+/**
+ * gdl_dock_item_unbind:
+ * @item: The item to unbind.
+ *
+ * Unbinds this dock item from it's dock master.
+ **/
void
gdl_dock_item_unbind (GdlDockItem *item)
{
@@ -1867,6 +1992,15 @@ gdl_dock_item_unbind (GdlDockItem *item)
gdl_dock_object_unbind (GDL_DOCK_OBJECT (item));
}
+/**
+ * gdl_dock_item_hide_item:
+ * @item: The dock item to hide.
+ *
+ * This function hides the dock item. When dock items are hidden they
+ * are completely removed from the layout.
+ *
+ * The dock item close button causes the panel to be hidden.
+ **/
void
gdl_dock_item_hide_item (GdlDockItem *item)
{
@@ -1928,6 +2062,15 @@ gdl_dock_item_hide_item (GdlDockItem *item)
gdl_dock_object_thaw (GDL_DOCK_OBJECT (item));
}
+/**
+ * gdl_dock_item_iconify_item:
+ * @item: The dock item to iconify.
+ *
+ * This function iconifies the dock item. When dock items are iconified
+ * they are hidden, and appear only as icons in dock bars.
+ *
+ * The dock item iconify button causes the panel to be iconified.
+ **/
void
gdl_dock_item_iconify_item (GdlDockItem *item)
{
@@ -1937,6 +2080,13 @@ gdl_dock_item_iconify_item (GdlDockItem *item)
gdl_dock_item_hide_item (item);
}
+/**
+ * gdl_dock_item_show_item:
+ * @item: The dock item to show.
+ *
+ * This function shows the dock item. When dock items are shown, they
+ * are displayed in their normal layout position.
+ **/
void
gdl_dock_item_show_item (GdlDockItem *item)
{
@@ -1988,18 +2138,41 @@ gdl_dock_item_show_item (GdlDockItem *item)
gtk_widget_show (GTK_WIDGET (item));
}
+/**
+ * gdl_dock_item_lock:
+ * @item: The dock item to lock.
+ *
+ * This function locks the dock item. When locked the dock item cannot
+ * be dragged around and it doesn't show a grip.
+ **/
void
gdl_dock_item_lock (GdlDockItem *item)
{
g_object_set (item, "locked", TRUE, NULL);
}
+/**
+ * gdl_dock_item_unlock:
+ * @item: The dock item to unlock.
+ *
+ * This function unlocks the dock item. When unlocked the dock item can
+ * be dragged around and can show a grip.
+ **/
void
gdl_dock_item_unlock (GdlDockItem *item)
{
g_object_set (item, "locked", FALSE, NULL);
}
+/**
+ * gdl_dock_item_set_default_position:
+ * @item: The dock item
+ * @reference: The GdlDockObject which is the default dock for @item
+ *
+ * This method has only an effect when you add you dock_item with
+ * GDL_DOCK_ITEM_BEH_NEVER_FLOATING. In this case you have to assign
+ * it a default position.
+ **/
void
gdl_dock_item_set_default_position (GdlDockItem *item,
GdlDockObject *reference)
@@ -2026,6 +2199,14 @@ gdl_dock_item_set_default_position (GdlDockItem *item,
}
}
+/**
+ * gdl_dock_item_preferred_size:
+ * @item: The dock item to get the preferred size of.
+ * @req: A pointer to a #GtkRequisition into which the preferred size
+ * will be written.
+ *
+ * Gets the preferred size of the dock item in pixels.
+ **/
void
gdl_dock_item_preferred_size (GdlDockItem *item,
GtkRequisition *req)
diff --git a/src/libgdl/gdl-dock.c b/src/libgdl/gdl-dock.c
index d80a47a1f..3b0dc4e6b 100644
--- a/src/libgdl/gdl-dock.c
+++ b/src/libgdl/gdl-dock.c
@@ -1139,6 +1139,8 @@ gdl_dock_select_larger_item (GdlDockItem *dock_item_1,
return ((size_1.width * size_1.height)
>= (size_2.width * size_2.height)?
dock_item_1 : dock_item_2);
+ } else if (placement == GDL_DOCK_NONE) {
+ return dock_item_1;
} else {
g_warning ("Should not reach here: %s:%d", __FUNCTION__, __LINE__);
}
diff --git a/src/libgdl/gdl-stock.c b/src/libgdl/gdl-stock.c
index dc86e523b..4cb7bf929 100644
--- a/src/libgdl/gdl-stock.c
+++ b/src/libgdl/gdl-stock.c
@@ -59,7 +59,7 @@ icon_set_from_data (GtkIconSet *set,
pixbuf = gdk_pixbuf_new_from_inline (data_size, icon_data, FALSE, &err);
if (err) {
- g_warning ("%s",err->message);
+ g_warning ("%s", err->message);
g_error_free (err);
err = NULL;
g_object_unref (source);
diff --git a/src/libgdl/gdl-switcher.c b/src/libgdl/gdl-switcher.c
index c67b4464b..fea3218ae 100644
--- a/src/libgdl/gdl-switcher.c
+++ b/src/libgdl/gdl-switcher.c
@@ -216,7 +216,7 @@ button_toggled_callback (GtkToggleButton *toggle_button,
static int
layout_buttons (GdlSwitcher *switcher)
{
- GtkRequisition client_requisition;
+ GtkRequisition client_requisition = {0,};
GtkAllocation *allocation = & GTK_WIDGET (switcher)->allocation;
GdlSwitcherStyle switcher_style;
gboolean icons_only;