<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="GnomeDesktopThumbnailFactory">
<refmeta>
<refentrytitle role="top_of_page" id="GnomeDesktopThumbnailFactory.top_of_page">GnomeDesktopThumbnailFactory</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GNOME-DESKTOP Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GnomeDesktopThumbnailFactory</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="GnomeDesktopThumbnailFactory.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
#include &lt;libgnomeui/gnome-thumbnail.h&gt;

                    <link linkend="GnomeDesktopThumbnailFactory-struct">GnomeDesktopThumbnailFactory</link>;
enum                <link linkend="GnomeDesktopThumbnailSize">GnomeDesktopThumbnailSize</link>;
<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> * <link linkend="gnome-desktop-thumbnail-factory-new">gnome_desktop_thumbnail_factory_new</link>
                                                        (<link linkend="GnomeDesktopThumbnailSize">GnomeDesktopThumbnailSize</link> size);
<link linkend="char">char</link> *              <link linkend="gnome-desktop-thumbnail-factory-lookup">gnome_desktop_thumbnail_factory_lookup</link>
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> mtime);
<link linkend="gboolean">gboolean</link>            <link linkend="gnome-desktop-thumbnail-factory-has-valid-failed-thumbnail">gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail</link>
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> mtime);
<link linkend="gboolean">gboolean</link>            <link linkend="gnome-desktop-thumbnail-factory-can-thumbnail">gnome_desktop_thumbnail_factory_can_thumbnail</link>
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         const <link linkend="char">char</link> *mime_type,
                                                         <link linkend="time-t">time_t</link> mtime);
<link linkend="GdkPixbuf">GdkPixbuf</link> *         <link linkend="gnome-desktop-thumbnail-factory-generate-thumbnail">gnome_desktop_thumbnail_factory_generate_thumbnail</link>
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         const <link linkend="char">char</link> *mime_type);
<link linkend="void">void</link>                <link linkend="gnome-desktop-thumbnail-factory-save-thumbnail">gnome_desktop_thumbnail_factory_save_thumbnail</link>
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *thumbnail,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> original_mtime);
<link linkend="void">void</link>                <link linkend="gnome-desktop-thumbnail-factory-create-failed-thumbnail">gnome_desktop_thumbnail_factory_create_failed_thumbnail</link>
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> mtime);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GnomeDesktopThumbnailFactory.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GnomeDesktopThumbnailFactory
</synopsis>
</refsect1>

<refsect1 id="GnomeDesktopThumbnailFactory.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>
<refsect1 id="GnomeDesktopThumbnailFactory.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GnomeDesktopThumbnailFactory-struct" role="struct">
<title>GnomeDesktopThumbnailFactory</title>
<indexterm zone="GnomeDesktopThumbnailFactory-struct"><primary>GnomeDesktopThumbnailFactory</primary></indexterm>
<programlisting>typedef struct _GnomeDesktopThumbnailFactory GnomeDesktopThumbnailFactory;</programlisting>
<para>
</para></refsect2>
<refsect2 id="GnomeDesktopThumbnailSize" role="enum">
<title>enum GnomeDesktopThumbnailSize</title>
<indexterm zone="GnomeDesktopThumbnailSize"><primary>GnomeDesktopThumbnailSize</primary></indexterm>
<programlisting>typedef enum {
  GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL,
  GNOME_DESKTOP_THUMBNAIL_SIZE_LARGE
} GnomeDesktopThumbnailSize;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-new" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_new ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-new" role="2.2"><primary>gnome_desktop_thumbnail_factory_new</primary></indexterm>
<programlisting><link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> * gnome_desktop_thumbnail_factory_new
                                                        (<link linkend="GnomeDesktopThumbnailSize">GnomeDesktopThumbnailSize</link> size);</programlisting>
<para>
Creates a new <link linkend="GnomeDesktopThumbnailFactory."><type>GnomeDesktopThumbnailFactory.</type></link>
</para>
<para>
This function must be called on the main thread.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara> The thumbnail size to use
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-lookup" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_lookup ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-lookup" role="2.2"><primary>gnome_desktop_thumbnail_factory_lookup</primary></indexterm>
<programlisting><link linkend="char">char</link> *              gnome_desktop_thumbnail_factory_lookup
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> mtime);</programlisting>
<para>
Tries to locate an existing thumbnail for the file specified.
</para>
<para>
Usage of this function is threadsafe.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara> the mtime of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The absolute path of the thumbnail, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none exist.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-has-valid-failed-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-has-valid-failed-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail</primary></indexterm>
<programlisting><link linkend="gboolean">gboolean</link>            gnome_desktop_thumbnail_factory_has_valid_failed_thumbnail
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> mtime);</programlisting>
<para>
Tries to locate an failed thumbnail for the file specified. Writing
and looking for failed thumbnails is important to avoid to try to
thumbnail e.g. broken images several times.
</para>
<para>
Usage of this function is threadsafe.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara> the mtime of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> TRUE if there is a failed thumbnail for the file.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-can-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_can_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-can-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_can_thumbnail</primary></indexterm>
<programlisting><link linkend="gboolean">gboolean</link>            gnome_desktop_thumbnail_factory_can_thumbnail
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         const <link linkend="char">char</link> *mime_type,
                                                         <link linkend="time-t">time_t</link> mtime);</programlisting>
<para>
Returns TRUE if this GnomeIconFactory can (at least try) to thumbnail
this file. Thumbnails or files with failed thumbnails won't be thumbnailed.
</para>
<para>
Usage of this function is threadsafe.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara> the mime type of the file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara> the mtime of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> TRUE if the file can be thumbnailed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-generate-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_generate_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-generate-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_generate_thumbnail</primary></indexterm>
<programlisting><link linkend="GdkPixbuf">GdkPixbuf</link> *         gnome_desktop_thumbnail_factory_generate_thumbnail
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         const <link linkend="char">char</link> *mime_type);</programlisting>
<para>
Tries to generate a thumbnail for the specified file. If it succeeds
it returns a pixbuf that can be used as a thumbnail.
</para>
<para>
Usage of this function is threadsafe.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara> the mime type of the file
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> thumbnail pixbuf if thumbnailing succeeded, <link linkend="NULL:CAPS"><literal>NULL</literal></link> otherwise.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-save-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_save_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-save-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_save_thumbnail</primary></indexterm>
<programlisting><link linkend="void">void</link>                gnome_desktop_thumbnail_factory_save_thumbnail
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         <link linkend="GdkPixbuf">GdkPixbuf</link> *thumbnail,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> original_mtime);</programlisting>
<para>
Saves <parameter>thumbnail</parameter> at the right place. If the save fails a
failed thumbnail is written.
</para>
<para>
Usage of this function is threadsafe.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>thumbnail</parameter>&#160;:</term>
<listitem><simpara> the thumbnail as a pixbuf 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>original_mtime</parameter>&#160;:</term>
<listitem><simpara> the modification time of the original file 
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-desktop-thumbnail-factory-create-failed-thumbnail" role="function" condition="since:2.2">
<title>gnome_desktop_thumbnail_factory_create_failed_thumbnail ()</title>
<indexterm zone="gnome-desktop-thumbnail-factory-create-failed-thumbnail" role="2.2"><primary>gnome_desktop_thumbnail_factory_create_failed_thumbnail</primary></indexterm>
<programlisting><link linkend="void">void</link>                gnome_desktop_thumbnail_factory_create_failed_thumbnail
                                                        (<link linkend="GnomeDesktopThumbnailFactory">GnomeDesktopThumbnailFactory</link> *factory,
                                                         const <link linkend="char">char</link> *uri,
                                                         <link linkend="time-t">time_t</link> mtime);</programlisting>
<para>
Creates a failed thumbnail for the file so that we don't try
to re-thumbnail the file later.
</para>
<para>
Usage of this function is threadsafe.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>factory</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GnomeDesktopThumbnailFactory"><type>GnomeDesktopThumbnailFactory</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the uri of a file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mtime</parameter>&#160;:</term>
<listitem><simpara> the modification time of the file
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>

</refsect1>

</refentry>
