st-icon: St Reference Manual

## st-icon st-icon — a simple styled icon actor |

## Functions

ClutterActor * | st_icon_new ()
GIcon * | st_icon_get_gicon ()
void | st_icon_set_gicon ()
GIcon * | st_icon_get_fallback_gicon ()
void | st_icon_set_fallback_gicon ()
const gchar * | st_icon_get_icon_name ()
void | st_icon_set_icon_name ()
const gchar * | st_icon_get_fallback_icon_name ()
void | st_icon_set_fallback_icon_name ()
gint | st_icon_get_icon_size ()
void | st_icon_set_icon_size ()

## Types and Values

#define | ST_TYPE_ICON
struct | StIcon
| StIconPrivate

## Description

StIcon is a simple styled texture actor that displays an image from a stylesheet.

## Functions

### st_icon_new ()

    ClutterActor *
    st_icon_new (void);

Create a newly allocated StIcon.

#### Returns

A newly allocated StIcon

### st_icon_get_gicon ()

    GIcon *
    st_icon_get_gicon (StIcon *icon);

Gets the current GIcon in use.

#### Parameters

icon | an StIcon |

#### Returns

The current GIcon, if set, otherwise `NULL`.

[nullable][transfer none]

### st_icon_set_gicon ()

    void
    st_icon_set_gicon (StIcon *icon,
                       GIcon *gicon);

Sets a GIcon to show for the icon. If `gicon` is `NULL` or fails to load, the fallback icon set using `st_icon_set_fallback_icon()` will be shown.

#### Parameters

icon | an StIcon |
gicon | a GIcon. | [nullable]

### st_icon_get_fallback_gicon ()

    GIcon *
    st_icon_get_fallback_gicon (StIcon *icon);

Gets the currently set fallback GIcon.

#### Parameters

icon | a StIcon |

#### Returns

The fallback GIcon, if set, otherwise `NULL`.

[transfer none]

### st_icon_set_fallback_gicon ()

    void
    st_icon_set_fallback_gicon (StIcon *icon,
                                GIcon *fallback_gicon);

Sets a fallback GIcon to show if the normal icon fails to load. If `fallback_gicon` is `NULL` or fails to load, the icon is unset and no texture will be visible for the fallback icon.

#### Parameters

icon | a StIcon |
fallback_gicon | the fallback GIcon. | [nullable]

### st_icon_get_icon_name ()

    const gchar *
    st_icon_get_icon_name (StIcon *icon);

This is a convenience method to get the icon name of the current icon, if it is currently a GThemedIcon, or `NULL` otherwise.

#### Parameters

icon | an StIcon |

#### Returns

The name of the icon or `NULL`.

[transfer none][nullable]

### st_icon_set_icon_name ()

    void
    st_icon_set_icon_name (StIcon *icon,
                           const gchar *icon_name);

This is a convenience method to set the GIcon to a GThemedIcon created using the given icon name. If `icon_name` is an empty string, `NULL` or fails to load, the fallback icon will be shown.

#### Parameters

icon | an StIcon |
icon_name | the name of the icon. | [nullable]

### st_icon_get_fallback_icon_name ()

    const gchar *
    st_icon_get_fallback_icon_name (StIcon *icon);

This is a convenience method to get the icon name of the fallback GThemedIcon that is currently set.

#### Parameters

icon | an StIcon |

#### Returns

The name of the icon or `NULL` if no icon is set.

[transfer none]

### st_icon_set_fallback_icon_name ()

    void
    st_icon_set_fallback_icon_name (StIcon *icon,
                                    const gchar *fallback_icon_name);

This is a convenience method to set the fallback GIcon to a GThemedIcon created using the given icon name. If `fallback_icon_name` is an empty string, `NULL` or fails to load, the icon is unset and no texture will be visible for the fallback icon.

#### Parameters

icon | an StIcon |
fallback_icon_name | the name of the fallback icon. | [nullable]

### st_icon_get_icon_size ()

    gint
    st_icon_get_icon_size (StIcon *icon);

Gets the explicit size set using `st_icon_set_icon_size()` for the icon. This is not necessarily the size that the icon will be displayed at.

#### Parameters

icon | an StIcon |

#### Returns

The explicitly set size, or -1 if no size has been set

### st_icon_set_icon_size ()

    void
    st_icon_set_icon_size (StIcon *icon,
                           gint size);

Sets an explicit size for the icon. Setting `size` to -1 will use the size defined by the current style or the default icon size.

#### Parameters

icon | an StIcon |
size | if positive, the new size, otherwise the size will be derived from the current style |

## Types and Values

### ST_TYPE_ICON

    #define ST_TYPE_ICON st_icon_get_type()

### struct StIcon

    struct StIcon {
    };

The contents of this structure are private and should only be accessed through the public API.

### StIconPrivate

    typedef struct _StIconPrivate StIconPrivate;