Lines Matching full:icon
36 * @short_description: Icon theming support
40 * #GThemedIcon is an implementation of #GIcon that supports icon themes.
41 * #GThemedIcon contains a list of all of the icons present in an icon
43 * not provide actual pixmaps for icons, just the icon names.
82 GThemedIcon *icon = G_THEMED_ICON (object);
87 g_value_set_boxed (value, icon->names);
91 g_value_set_boolean (value, icon->use_default_fallbacks);
105 GThemedIcon *icon = G_THEMED_ICON (object);
117 if (icon->names)
118 g_strfreev (icon->names);
120 icon->names = g_new (char *, 2);
121 icon->names[0] = g_strdup (name);
122 icon->names[1] = NULL;
131 if (icon->names)
132 g_strfreev (icon->names);
134 icon->names = names;
138 icon->use_default_fallbacks = g_value_get_boolean (value);
207 * The icon name.
212 _("The name of the icon"),
219 * A %NULL-terminated array of icon names.
224 _("An array containing the icon names"),
231 * Whether to use the default fallbacks found by shortening the icon name
235 * For example, if the icon name was "gnome-dev-cdrom-audio", the array
263 * @iconname: a string containing an icon name.
265 * Creates a new themed icon for @iconname.
279 * @iconnames: an array of strings containing icon names.
283 * Creates a new themed icon for @iconnames.
291 GIcon *icon = icon;
307 icon = G_ICON (g_object_new (G_TYPE_THEMED_ICON, "names", names, NULL));
312 icon = G_ICON (g_object_new (G_TYPE_THEMED_ICON, "names", iconnames, NULL));
314 return icon;
319 * @iconname: a string containing an icon name
321 * Creates a new themed icon for @iconname, and all the names
350 * @icon: a #GThemedIcon.
352 * Gets the names of icons from within @icon.
354 * Returns: a list of icon names.
357 g_themed_icon_get_names (GThemedIcon *icon)
359 g_return_val_if_fail (G_IS_THEMED_ICON (icon), NULL);
360 return (const char * const *)icon->names;
365 * @icon: a #GThemedIcon
366 * @iconname: name of icon to append to list of icons from within @icon.
368 * Append a name to the list of icons from within @icon.
376 g_themed_icon_append_name (GThemedIcon *icon,
381 g_return_if_fail (G_IS_THEMED_ICON (icon));
384 num_names = g_strv_length (icon->names);
385 icon->names = g_realloc (icon->names, sizeof (char*) * (num_names + 2));
386 icon->names[num_names] = g_strdup (iconname);
387 icon->names[num_names + 1] = NULL;
389 g_object_notify (G_OBJECT (icon), "names");
394 * @icon: a #GThemedIcon
395 * @iconname: name of icon to prepend to list of icons from within @icon.
397 * Prepend a name to the list of icons from within @icon.
407 g_themed_icon_prepend_name (GThemedIcon *icon,
414 g_return_if_fail (G_IS_THEMED_ICON (icon));
417 num_names = g_strv_length (icon->names);
419 for (i = 0; icon->names[i]; i++)
420 names[i + 1] = icon->names[i];
424 g_free (icon->names);
425 icon->names = names;
427 g_object_notify (G_OBJECT (icon), "names");
431 g_themed_icon_hash (GIcon *icon)
433 GThemedIcon *themed = G_THEMED_ICON (icon);
464 g_themed_icon_to_tokens (GIcon *icon,
468 GThemedIcon *themed_icon = G_THEMED_ICON (icon);
488 GIcon *icon;
492 icon = NULL;
509 icon = g_themed_icon_new_from_names (names, num_tokens);
513 return icon;