FmThumbnailer

## FmThumbnailer FmThumbnailer — External thumbnailers handling. |

## Functions

#define | FM_THUMBNAILER()
void | fm_thumbnailer_check_update ()
char * | fm_thumbnailer_command_for_uri ()
void | fm_thumbnailer_free ()
gboolean | fm_thumbnailer_launch_for_uri ()
GPid | fm_thumbnailer_launch_for_uri_async ()
FmThumbnailer * | fm_thumbnailer_new_from_keyfile ()
FmThumbnailer * | fm_thumbnailer_ref ()
void | fm_thumbnailer_unref ()

## Types and Values

| FmThumbnailer

## Description

`include` : libfm/fm.h

## Functions

### FM_THUMBNAILER()

    #define FM_THUMBNAILER(p) ((FmThumbnailer*)p)

### fm_thumbnailer_check_update ()

    void
    fm_thumbnailer_check_update ();

Checks new thumbnailers and reloads if needed.

Since: 1.0.0

### fm_thumbnailer_command_for_uri ()

    char *
    fm_thumbnailer_command_for_uri (FmThumbnailer *thumbnailer,
                                    const char *uri,
                                    const char *output_file,
                                    guint size);

Tries to generate command line that can be used to generate a thumbnail for given `uri` . Returned string is allocated and should be freed with `g_free()` after usage.

#### Parameters

thumbnailer | thumbnailer descriptor |
uri | a file to create thumbnail for |
output_file | the target file name |
size | size of thumbnail to generate |

#### Returns

a newly allocated string or `NULL`.

[transfer full]

Since: 1.2.0

### fm_thumbnailer_free ()

    void
    fm_thumbnailer_free (FmThumbnailer *thumbnailer);

`fm_thumbnailer_free` has been deprecated since version 1.2.0 and should not be used in newly-written code.

Use `fm_thumbnailer_unref()` instead.

Frees `thumbnailer` object.

#### Parameters

thumbnailer | thumbnailer descriptor |

Since: 1.0.0

### fm_thumbnailer_launch_for_uri ()

    gboolean
    fm_thumbnailer_launch_for_uri (FmThumbnailer *thumbnailer,
                                   const char *uri,
                                   const char *output_file,
                                   guint size);

`fm_thumbnailer_launch_for_uri` has been deprecated since version 1.2.0 and should not be used in newly-written code.

Use `fm_thumbnailer_launch_for_uri_async()` instead.

Tries to generate new thumbnail for given `uri` .

#### Parameters

thumbnailer | thumbnailer descriptor |
uri | a file to create thumbnail for |
output_file | the target file name |
size | size of thumbnail to generate |

#### Returns

`TRUE` in case of success.

Since: 1.0.0

### fm_thumbnailer_launch_for_uri_async ()

    GPid
    fm_thumbnailer_launch_for_uri_async (FmThumbnailer *thumbnailer,
                                         const char *uri,
                                         const char *output_file,
                                         guint size,
                                         GError **error);

Tries to spawn thumbnailer to generate new thumbnail for given `uri` .

#### Parameters

thumbnailer | thumbnailer descriptor |
uri | a file to create thumbnail for |
output_file | the target file name |
size | size of thumbnail to generate |
error | location to save error. | [allow-none][out]

#### Returns

thumbnailer process ID or -1 in case of failure.

Since: 1.2.0

### fm_thumbnailer_new_from_keyfile ()

    FmThumbnailer *
    fm_thumbnailer_new_from_keyfile (const char *id,
                                     GKeyFile *kf);

Creates new `thumbnailer` object.

#### Parameters

id | desktop entry Id |
kf | content of `id` |

#### Returns

a new FmThumbnailer or `NULL` in case of error.

[transfer full]

Since: 1.0.0

### fm_thumbnailer_ref ()

    FmThumbnailer *
    fm_thumbnailer_ref (FmThumbnailer *thumbnailer);

Increases reference count for `thumbnailer` object.

#### Parameters

thumbnailer | thumbnailer descriptor |

#### Returns

`thumbnailer` .

Since: 1.2.0

### fm_thumbnailer_unref ()

    void
    fm_thumbnailer_unref (FmThumbnailer *thumbnailer);

Decreases reference count for `thumbnailer` object. When last reference is dropped, allocated resources will be freed and `thumbnailer` becomes invalid.

#### Parameters

thumbnailer | thumbnailer descriptor |

Since: 1.2.0

## Types and Values

### FmThumbnailer

    typedef struct _FmThumbnailer FmThumbnailer;