FmIcon

FmIcon — A simple icons cache.

Synopsis

struct              FmIcon;
FmIcon *            fm_icon_from_gicon                  (GIcon *gicon);
FmIcon *            fm_icon_from_name                   (const char *name);
gpointer            fm_icon_get_user_data               (FmIcon *icon);
FmIcon *            fm_icon_ref                         (FmIcon *icon);
void                fm_icon_set_user_data               (FmIcon *icon,
                                                         gpointer user_data);
void                fm_icon_set_user_data_destroy       (GDestroyNotify func);
void                fm_icon_unload_cache                ();
void                fm_icon_unload_user_data_cache      ();
void                fm_icon_unref                       (FmIcon *icon);

Description

include: libfm/fm-icon.h

Details

struct FmIcon

struct FmIcon {
    guint n_ref;
    GIcon* gicon;
    /* FIXME: should we utilize g_object_set_qdata to
              store those data in gicon object instead? */
    gpointer user_data;
};

guint n_ref;

reference counter

GIcon *gicon;

cached icon object

gpointer user_data;

associated user data

fm_icon_from_gicon ()

FmIcon *            fm_icon_from_gicon                  (GIcon *gicon);

Retrives a FmIcon corresponding to gicon from cache inserting new one if there was no such icon there yet.

gicon :

a GIcon object

Returns :

a FmIcon object. [transfer full]

Since 0.1.0


fm_icon_from_name ()

FmIcon *            fm_icon_from_name                   (const char *name);

Retrives a FmIcon corresponding to name from cache inserting new one if there was no such icon there yet.

name :

a name for icon

Returns :

a FmIcon object. [transfer full]

Since 0.1.0


fm_icon_get_user_data ()

gpointer            fm_icon_get_user_data               (FmIcon *icon);

Retrieves user data that was set via fm_icon_set_user_data().

icon :

a FmIcon object

Returns :

user data.

Since 0.1.0


fm_icon_ref ()

FmIcon *            fm_icon_ref                         (FmIcon *icon);

Increases reference count on icon.

icon :

an existing FmIcon object

Returns :

icon.

Since 0.1.0


fm_icon_set_user_data ()

void                fm_icon_set_user_data               (FmIcon *icon,
                                                         gpointer user_data);

Sets user_data to be associated with icon.

See also: fm_icon_get_user_data(), fm_icon_unload_user_data_cache().

icon :

a FmIcon object

user_data :

data pointer to set

Since 0.1.0


fm_icon_set_user_data_destroy ()

void                fm_icon_set_user_data_destroy       (GDestroyNotify func);

Sets func to be used by fm_icon_unload_user_data_cache() to destroy user data that was set by fm_icon_set_user_data().

func :

function for user data

Since 0.1.0


fm_icon_unload_cache ()

void                fm_icon_unload_cache                ();

Flushes cache.

Since 0.1.0


fm_icon_unload_user_data_cache ()

void                fm_icon_unload_user_data_cache      ();

Flushes all user data in cache.

See also: fm_icon_set_user_data().

Since 0.1.0


fm_icon_unref ()

void                fm_icon_unref                       (FmIcon *icon);

Decreases reference count on icon. If refernce count went to 0 then removes icon from cache.

icon :

a FmIcon object

Since 0.1.0