## GLoadableIcon

GLoadableIcon — Loadable Icons

## Functions

GInputStream * | g_loadable_icon_load ()
void | g_loadable_icon_load_async ()
GInputStream * | g_loadable_icon_load_finish ()

## Types and Values

| GLoadableIcon
struct | GLoadableIconIface

## Object Hierarchy

        GInterface
        ╰── GLoadableIcon

## Prerequisites

GLoadableIcon requires GIcon and GObject.

## Known Implementations

GLoadableIcon is implemented by GBytesIcon and GFileIcon.

## Includes

    #include <gio/gio.h>

## Description

Extends the GIcon interface and adds the ability to load icons from streams.

## Functions

### g_loadable_icon_load ()

    GInputStream *
    g_loadable_icon_load (GLoadableIcon *icon,
                          int size,
                          char **type,
                          GCancellable *cancellable,
                          GError **error);

Loads a loadable icon. For the asynchronous version of this function, see `g_loadable_icon_load_async()`.

#### Parameters

icon | a GLoadableIcon. |
size | an integer. |
type | a location to store the type of the loaded icon, `NULL` to ignore. | [out][optional]
cancellable | optional GCancellable object, `NULL` to ignore. | [nullable]
error | a GError location to store the error occurring, or `NULL` to ignore. |

#### Returns

a GInputStream to read the icon from.

[transfer full]

### g_loadable_icon_load_async ()

    void
    g_loadable_icon_load_async (GLoadableIcon *icon,
                                int size,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Loads an icon asynchronously. To finish this function, see `g_loadable_icon_load_finish()`. For the synchronous, blocking version of this function, see `g_loadable_icon_load()`.

#### Parameters

icon | a GLoadableIcon. |
size | an integer. |
cancellable | optional GCancellable object, `NULL` to ignore. | [nullable]
callback | a GAsyncReadyCallback to call when the request is satisfied. | [scope async]
user_data | the data to pass to callback function. | [closure]

### g_loadable_icon_load_finish ()

    GInputStream *
    g_loadable_icon_load_finish (GLoadableIcon *icon,
                                 GAsyncResult *res,
                                 char **type,
                                 GError **error);

Finishes an asynchronous icon load started in `g_loadable_icon_load_async()`.

#### Parameters

icon | a GLoadableIcon. |
res | a GAsyncResult. |
type | a location to store the type of the loaded icon, `NULL` to ignore. | [out][optional]
error | a GError location to store the error occurring, or `NULL` to ignore. |

#### Returns

a GInputStream to read the icon from.

[transfer full]

## Types and Values

### GLoadableIcon

    typedef struct _GLoadableIcon GLoadableIcon;

Generic type for all kinds of icons that can be loaded as a stream.

### struct GLoadableIconIface

    struct GLoadableIconIface {
      GTypeInterface g_iface;

      /* Virtual Table */

      GInputStream * (* load)        (GLoadableIcon       *icon,
                                      int                  size,
                                      char               **type,
                                      GCancellable        *cancellable,
                                      GError             **error);
      void           (* load_async)  (GLoadableIcon       *icon,
                                      int                  size,
                                      GCancellable        *cancellable,
                                      GAsyncReadyCallback  callback,
                                      gpointer             user_data);
      GInputStream * (* load_finish) (GLoadableIcon       *icon,
                                      GAsyncResult        *res,
                                      char               **type,
                                      GError             **error);
    };

Interface for icons that can be loaded as a stream.

#### Members

`load` () | Loads an icon. |
`load_async` () | Loads an icon asynchronously. |
`load_finish` () | Finishes an asynchronous icon load. |

## See Also

GIcon, GThemedIcon