typedef struct {
GIcon *icon;
int size;
} LoadableIconKey;
loadable_icon_key_new (GIcon *icon, int size)
{
LoadableIconKey *key;
key = g_slice_new (LoadableIconKey);
key->icon = g_object_ref (icon);
key->size = size;
return key;
}
loadable_icon_key_hash (LoadableIconKey *key)
{
return g_icon_hash (key->icon) ^ key->size;
}
loadable_icon_key_equal (const LoadableIconKey *a,
const LoadableIconKey *b)
{
return a->size == b->size &&
g_icon_equal (a->icon, b->icon);
}
static void
loadable_icon_key_free (LoadableIconKey *key)
{
g_object_unref (key->icon);
g_slice_free (LoadableIconKey, key);
}
static void destroy_cache_entry (MarlinIconInfo *icon_info)
{
g_return_if_fail (icon_info != NULL);
g_clear_object (&icon_info);
}