| Top |
| guint | gs_icon_get_width () |
| void | gs_icon_set_width () |
| guint | gs_icon_get_height () |
| void | gs_icon_set_height () |
| guint | gs_icon_get_scale () |
| void | gs_icon_set_scale () |
| GIcon * | gs_icon_new_for_appstream_icon () |
This file provides several utilities for creating and handling GIcon instances. GIcon is used for representing icon sources throughout gnome-software, as it has low memory overheads, and allows the most appropriate icon data to be loaded when it’s needed to be used in a UI.
gnome-software uses various classes which implement GIcon, mostly the
built-in ones provided by GIO, but also GsRemoteIcon. All of them are tagged
with width and height metadata (when that data was available at
construction time). See gs_icon_get_width().
guint
gs_icon_get_width (GIcon *icon);
Get the width of an icon, if it was attached as metadata when the GIcon was created from an AsIcon.
Since: 40
void gs_icon_set_width (GIcon *icon,guint width);
Set the width of an icon. See gs_icon_get_width().
Since: 40
guint
gs_icon_get_height (GIcon *icon);
Get the height of an icon, if it was attached as metadata when the GIcon was created from an AsIcon.
Since: 40
void gs_icon_set_height (GIcon *icon,guint height);
Set the height of an icon. See gs_icon_get_height().
Since: 40
guint
gs_icon_get_scale (GIcon *icon);
Get the scale of an icon, if it was attached as metadata when the GIcon was created from an AsIcon.
See gtk_widget_get_scale_factor() for more information about scales.
Since: 40
void gs_icon_set_scale (GIcon *icon,guint scale);
Set the scale of an icon. See gs_icon_get_scale().
Since: 40
GIcon *
gs_icon_new_for_appstream_icon (AsIcon *appstream_icon);
Create a new GIcon representing the given AsIcon. The actual type of the
returned icon will vary depending on the AsIconKind of appstream_icon
.
If the width or height of the icon are set on the AsIcon, they are stored
as the width and height data associated with the returned object, using
g_object_set_data().
This can fail (and return NULL) if the appstream_icon
has invalid or
missing properties.
Since: 40