glib r6991 - in trunk: docs/reference docs/reference/gio gio
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r6991 - in trunk: docs/reference docs/reference/gio gio
- Date: Tue, 10 Jun 2008 16:45:54 +0000 (UTC)
Author: matthiasc
Date: Tue Jun 10 16:45:54 2008
New Revision: 6991
URL: http://svn.gnome.org/viewvc/glib?rev=6991&view=rev
Log:
Add g_themed_icon_prepend_name
Modified:
trunk/docs/reference/ChangeLog
trunk/docs/reference/gio/gio-sections.txt
trunk/gio/ChangeLog
trunk/gio/gio.symbols
trunk/gio/gthemedicon.c
trunk/gio/gthemedicon.h
Modified: trunk/docs/reference/gio/gio-sections.txt
==============================================================================
--- trunk/docs/reference/gio/gio-sections.txt (original)
+++ trunk/docs/reference/gio/gio-sections.txt Tue Jun 10 16:45:54 2008
@@ -364,6 +364,7 @@
g_themed_icon_new
g_themed_icon_new_from_names
g_themed_icon_new_with_default_fallbacks
+g_themed_icon_prepend_name
g_themed_icon_append_name
<SUBSECTION Standard>
GThemedIconClass
Modified: trunk/gio/gio.symbols
==============================================================================
--- trunk/gio/gio.symbols (original)
+++ trunk/gio/gio.symbols Tue Jun 10 16:45:54 2008
@@ -633,6 +633,7 @@
g_themed_icon_new_with_default_fallbacks
g_themed_icon_new_from_names
g_themed_icon_get_names
+g_themed_icon_prepend_name
g_themed_icon_append_name
#endif
#endif
Modified: trunk/gio/gthemedicon.c
==============================================================================
--- trunk/gio/gthemedicon.c (original)
+++ trunk/gio/gthemedicon.c Tue Jun 10 16:45:54 2008
@@ -368,7 +368,8 @@
* </para></note>
*/
void
-g_themed_icon_append_name (GThemedIcon *icon, const char *iconname)
+g_themed_icon_append_name (GThemedIcon *icon,
+ const char *iconname)
{
guint num_names;
@@ -383,6 +384,44 @@
g_object_notify (G_OBJECT (icon), "names");
}
+/**
+ * g_themed_icon_prepend_name:
+ * @icon: a #GThemedIcon
+ * @iconname: name of icon to prepend to list of icons from within @icon.
+ *
+ * Prepend a name to the list of icons from within @icon.
+ *
+ * <note><para>
+ * Note that doing so invalidates the hash computed by prior calls
+ * to g_icon_hash().
+ * </para></note>
+ *
+ * Since: 2.18
+ */
+void
+g_themed_icon_prepend_name (GThemedIcon *icon,
+ const char *iconname)
+{
+ guint num_names;
+ gchar **names;
+ gint i;
+
+ g_return_if_fail (G_IS_THEMED_ICON (icon));
+ g_return_if_fail (iconname != NULL);
+
+ num_names = g_strv_length (icon->names);
+ names = g_new (char*, num_names + 2);
+ for (i = 0; icon->names[i]; i++)
+ names[i + 1] = icon->names[i];
+ names[0] = g_strdup (iconname);
+ names[num_names + 1] = NULL;
+
+ g_free (icon->names);
+ icon->names = names;
+
+ g_object_notify (G_OBJECT (icon), "names");
+}
+
static guint
g_themed_icon_hash (GIcon *icon)
{
Modified: trunk/gio/gthemedicon.h
==============================================================================
--- trunk/gio/gthemedicon.h (original)
+++ trunk/gio/gthemedicon.h Tue Jun 10 16:45:54 2008
@@ -48,12 +48,16 @@
GType g_themed_icon_get_type (void) G_GNUC_CONST;
-GIcon *g_themed_icon_new (const char *iconname);
-GIcon *g_themed_icon_new_with_default_fallbacks (const char *iconname);
-GIcon *g_themed_icon_new_from_names (char **iconnames, int len);
-void g_themed_icon_append_name (GThemedIcon *icon, const char *iconname);
+GIcon *g_themed_icon_new (const char *iconname);
+GIcon *g_themed_icon_new_with_default_fallbacks (const char *iconname);
+GIcon *g_themed_icon_new_from_names (char **iconnames,
+ int len);
+void g_themed_icon_prepend_name (GThemedIcon *icon,
+ const char *iconname);
+void g_themed_icon_append_name (GThemedIcon *icon,
+ const char *iconname);
-const char * const *g_themed_icon_get_names (GThemedIcon *icon);
+const char * const *g_themed_icon_get_names (GThemedIcon *icon);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]