FmThumbnailer

## FmThumbnailer FmThumbnailer — External thumbnailers handling. |

## Synopsis

    #define             FM_THUMBNAILER                      (p)
                        FmThumbnailer;
    void                fm_thumbnailer_check_update         ();
    char *              fm_thumbnailer_command_for_uri      (FmThumbnailer *thumbnailer,
                                                             const char *uri,
                                                             const char *output_file,
                                                             guint size);
    void                fm_thumbnailer_free                 (FmThumbnailer *thumbnailer);
    gboolean            fm_thumbnailer_launch_for_uri       (FmThumbnailer *thumbnailer,
                                                             const char *uri,
                                                             const char *output_file,
                                                             guint size);
    GPid                fm_thumbnailer_launch_for_uri_async (FmThumbnailer *thumbnailer,
                                                             const char *uri,
                                                             const char *output_file,
                                                             guint size,
                                                             GError **error);
    FmThumbnailer *     fm_thumbnailer_new_from_keyfile     (const char *id,
                                                             GKeyFile *kf);
    FmThumbnailer *     fm_thumbnailer_ref                  (FmThumbnailer *thumbnailer);
    void                fm_thumbnailer_unref                (FmThumbnailer *thumbnailer);

## Description

`include`: libfm/fm.h

## Details

### FM_THUMBNAILER()

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

### FmThumbnailer

    typedef struct _FmThumbnailer FmThumbnailer;

### 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.

`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);

### Warning

`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.

`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);

### Warning

`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`.

`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`.

`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.

`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.

`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.

`thumbnailer` : | thumbnailer descriptor

Since 1.2.0