Home | History | Annotate | Download | only in gio

Lines Matching refs:icon

48  * serializing an icon to and from strings.
50 * #GIcon does not provide the actual pixmap for the icon as this is out
52 * of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
114 * @icon: #gconstpointer to an icon object.
116 * Gets a hash for an icon.
118 * Returns: a #guint containing a hash for the @icon, suitable for
122 g_icon_hash (gconstpointer icon)
126 g_return_val_if_fail (G_IS_ICON (icon), 0);
128 iface = G_ICON_GET_IFACE (icon);
130 return (* iface->hash) ((GIcon *)icon);
163 g_icon_to_string_tokenized (GIcon *icon, GString *s)
171 g_return_val_if_fail (icon != NULL, FALSE);
172 g_return_val_if_fail (G_IS_ICON (icon), FALSE);
176 icon_iface = G_ICON_GET_IFACE (icon);
181 if (!icon_iface->to_tokens (icon, tokens, &version))
191 g_string_append (s, g_type_name_from_instance ((GTypeInstance *)icon));
216 * @icon: a #GIcon.
218 * Generates a textual representation of @icon that can be used for
219 * serialization such as when passing @icon to a different process or
221 * get @icon back from the returned string.
228 * If @icon is a #GFileIcon, the returned string is a native path
229 * (such as <literal>/path/to/my icon.png</literal>) without escaping
230 * if the #GFile for @icon is a native file. If the file is not
232 * (such as <literal>sftp://path/to/my%%20icon.png</literal>).
235 * If @icon is a #GThemedIcon with exactly one name, the encoding is
240 * Returns: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
246 g_icon_to_string (GIcon *icon)
250 g_return_val_if_fail (icon != NULL, NULL);
251 g_return_val_if_fail (G_IS_ICON (icon), NULL);
255 if (G_IS_FILE_ICON (icon))
259 file = g_file_icon_get_file (G_FILE_ICON (icon));
272 else if (G_IS_THEMED_ICON (icon))
276 names = g_themed_icon_get_names (G_THEMED_ICON (icon));
291 if (g_icon_to_string_tokenized (icon, s))
304 GIcon *icon;
314 icon = NULL;
407 icon = icon_iface->from_tokens (tokens + 1, num_tokens - 1, version, error);
412 return icon;
446 GIcon *icon;
452 icon = NULL;
462 icon = g_icon_new_from_tokens (tokens, error);
469 _("Can't handle the supplied version the icon encoding"));
481 icon = g_file_icon_new (location);
485 icon = g_themed_icon_new (str);
489 return icon;