Patch for gnome-icon-list



At some point the definition of the GnomeIconListClass was changed
to use a private data structure. This left applications using
that structure no means of retrieving values such as the icon width,
spacing, and separator text. The following patch introduces access
functions for the now private data.

Norman
--- gnome-icon-list.org.c	Wed Aug 11 00:03:20 1999
+++ gnome-icon-list.c	Wed Aug 11 00:24:07 1999
@@ -2647,3 +2647,120 @@
 
 	return -1;
 }
+
+/**
+ * gnome_icon_list_get_icon_width:
+ * @gil: An icon list.
+ *
+ * Returns the amount of horizontal space (in pixels) allocated to the icons, 
+ * i.e. the column width of the icon list.
+ */
+int            
+gnome_icon_list_get_icon_width (GnomeIconList *gil)
+{
+	GilPrivate *priv;
+
+	g_return_val_if_fail (gil != NULL, -1);
+	g_return_val_if_fail (IS_GIL (gil), -1);
+
+	priv = gil->priv;
+	return priv->icon_width;
+}
+
+/**
+ * gnome_icon_list_get_row_spacing:
+ * @gil: An icon list.
+ *
+ * Returns the spacing (in pixels) used between rows of icons.
+ */
+int            
+gnome_icon_list_get_row_spacing (GnomeIconList *gil)
+{
+	GilPrivate *priv;
+
+	g_return_val_if_fail (gil != NULL, -1);
+	g_return_val_if_fail (IS_GIL (gil), -1);
+
+	priv = gil->priv;
+	return priv->row_spacing;
+}
+
+/**
+ * gnome_icon_list_get_col_spacing:
+ * @gil: An icon list.
+ *
+ * Returns the spacing (in pixels) used between columns of icons.
+ */
+int            
+gnome_icon_list_get_col_spacing (GnomeIconList *gil)
+{
+	GilPrivate *priv;
+
+	g_return_val_if_fail (gil != NULL, -1);
+	g_return_val_if_fail (IS_GIL (gil), -1);
+
+	priv = gil->priv;
+	return priv->col_spacing;
+}
+
+/**
+ * gnome_icon_list_get_text_spacing:
+ * @gil: An icon list.
+ *
+ * Returns the spacing (in pixels) used between an icon's image 
+ * and its text caption.
+ */
+int            
+gnome_icon_list_get_text_spacing (GnomeIconList *gil)
+{
+	GilPrivate *priv;
+
+	g_return_val_if_fail (gil != NULL, -1);
+	g_return_val_if_fail (IS_GIL (gil), -1);
+
+	priv = gil->priv;
+	return priv->text_spacing;
+}
+
+/**
+ * gnome_icon_list_get_icon_border:
+ * @gil: An icon list.
+ *
+ * Returns the icon list icon border width in pixels.
+ * Returns the width of the border (in pixels) displayed around 
+ * an icon's image.  This is currently not implemented.
+ */
+
+int            
+gnome_icon_list_get_icon_border (GnomeIconList *gil)
+{
+	GilPrivate *priv;
+
+	g_return_val_if_fail (gil != NULL, -1);
+	g_return_val_if_fail (IS_GIL (gil), -1);
+
+	priv = gil->priv;
+	return priv->icon_border;
+}
+
+/**
+ * gnome_icon_list_get_separators:
+ * @gil: An icon list.
+ *
+ * Returns the characters that can be used as word separators when doing
+ * word-wrapping in the icon text captions. 
+ */
+
+
+char *         
+gnome_icon_list_get_separators (GnomeIconList *gil)
+{
+	GilPrivate *priv;
+
+	g_return_val_if_fail (gil != NULL, NULL);
+	g_return_val_if_fail (IS_GIL (gil), NULL);
+
+	priv = gil->priv;
+	return g_strdup (priv->separators);
+}
+
--- gnome-icon-list.org.h	Wed Aug 11 00:03:16 1999
+++ gnome-icon-list.h	Wed Aug 11 00:07:07 1999
@@ -152,6 +152,14 @@
 void           gnome_icon_list_set_separators      (GnomeIconList *gil,
 						    const char *sep);
 
+/* Getting the spacing values */
+int            gnome_icon_list_get_icon_width      (GnomeIconList *gil);
+int            gnome_icon_list_get_row_spacing     (GnomeIconList *gil);
+int            gnome_icon_list_get_col_spacing     (GnomeIconList *gil);
+int            gnome_icon_list_get_text_spacing    (GnomeIconList *gil);
+int            gnome_icon_list_get_icon_border     (GnomeIconList *gil);
+char *         gnome_icon_list_get_separators      (GnomeIconList *gil);
+
 /* Attaching information to the icons */
 void           gnome_icon_list_set_icon_data       (GnomeIconList *gil,
 						    int pos, gpointer data);
--- ChangeLog.org	Wed Aug 11 00:34:42 1999
+++ ChangeLog	Wed Aug 11 00:34:45 1999
@@ -1,3 +1,7 @@
+1999-08-11  Norman Stevens <norman@arcady.u-net.com>
+
+       * gnome-icon-list.c, gnome-icon-list.h: Add accessor functions
+       for private data.
+
 1999-08-06  Morten Welinder  <terra@diku.dk>
 
        * gnome-canvas.c (shutdown_transients): Plug leak.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]