<refentry id="libgnomeui-GnomeIconLookup">
<refmeta>
<refentrytitle role="top_of_page" id="libgnomeui-GnomeIconLookup.top_of_page">GnomeIconLookup</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGNOMEUI Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GnomeIconLookup</refname>
<refpurpose></refpurpose>
</refnamediv>

<refsynopsisdiv id="libgnomeui-GnomeIconLookup.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;libgnomeui/libgnomeui.h&gt;

enum                <link linkend="GnomeIconLookupFlags">GnomeIconLookupFlags</link>;
enum                <link linkend="GnomeIconLookupResultFlags">GnomeIconLookupResultFlags</link>;
<link linkend="char">char</link> *              <link linkend="gnome-icon-lookup">gnome_icon_lookup</link>                   (<link linkend="GtkIconTheme">GtkIconTheme</link> *icon_theme,
                                                         <link linkend="GnomeThumbnailFactory">GnomeThumbnailFactory</link> *thumbnail_factory,
                                                         const <link linkend="char">char</link> *file_uri,
                                                         const <link linkend="char">char</link> *custom_icon,
                                                         <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *file_info,
                                                         const <link linkend="char">char</link> *mime_type,
                                                         <link linkend="GnomeIconLookupFlags">GnomeIconLookupFlags</link> flags,
                                                         <link linkend="GnomeIconLookupResultFlags">GnomeIconLookupResultFlags</link> *result);
<link linkend="char">char</link> *              <link linkend="gnome-icon-lookup-sync">gnome_icon_lookup_sync</link>              (<link linkend="GtkIconTheme">GtkIconTheme</link> *icon_theme,
                                                         <link linkend="GnomeThumbnailFactory">GnomeThumbnailFactory</link> *thumbnail_factory,
                                                         const <link linkend="char">char</link> *file_uri,
                                                         const <link linkend="char">char</link> *custom_icon,
                                                         <link linkend="GnomeIconLookupFlags">GnomeIconLookupFlags</link> flags,
                                                         <link linkend="GnomeIconLookupResultFlags">GnomeIconLookupResultFlags</link> *result);
</synopsis>
</refsynopsisdiv>









<refsect1 id="libgnomeui-GnomeIconLookup.description" role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>

<refsect1 id="libgnomeui-GnomeIconLookup.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GnomeIconLookupFlags" role="enum">
<title>enum GnomeIconLookupFlags</title>
<indexterm zone="GnomeIconLookupFlags"><primary sortas="GnomeIconLookupFlags">GnomeIconLookupFlags</primary></indexterm><programlisting>typedef enum {
  GNOME_ICON_LOOKUP_FLAGS_NONE = 0,
  GNOME_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT = 1&lt;&lt;0,
  GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES = 1&lt;&lt;1,
  GNOME_ICON_LOOKUP_FLAGS_ALLOW_SVG_AS_THEMSELVES = 1&lt;&lt;2
} GnomeIconLookupFlags;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="GnomeIconLookupResultFlags" role="enum">
<title>enum GnomeIconLookupResultFlags</title>
<indexterm zone="GnomeIconLookupResultFlags"><primary sortas="GnomeIconLookupResultFlags">GnomeIconLookupResultFlags</primary></indexterm><programlisting>typedef enum {
  GNOME_ICON_LOOKUP_RESULT_FLAGS_NONE = 0,
  GNOME_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL = 1&lt;&lt;0
} GnomeIconLookupResultFlags;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="gnome-icon-lookup" role="function" condition="since:2.2">
<title>gnome_icon_lookup ()</title>
<indexterm zone="gnome-icon-lookup" role="2.2"><primary sortas="gnome_icon_lookup">gnome_icon_lookup</primary></indexterm><programlisting><link linkend="char">char</link> *              gnome_icon_lookup                   (<link linkend="GtkIconTheme">GtkIconTheme</link> *icon_theme,
                                                         <link linkend="GnomeThumbnailFactory">GnomeThumbnailFactory</link> *thumbnail_factory,
                                                         const <link linkend="char">char</link> *file_uri,
                                                         const <link linkend="char">char</link> *custom_icon,
                                                         <link linkend="GnomeVFSFileInfo">GnomeVFSFileInfo</link> *file_info,
                                                         const <link linkend="char">char</link> *mime_type,
                                                         <link linkend="GnomeIconLookupFlags">GnomeIconLookupFlags</link> flags,
                                                         <link linkend="GnomeIconLookupResultFlags">GnomeIconLookupResultFlags</link> *result);</programlisting>
<para>
This function tries to locate an icon in <parameter>icon_theme</parameter> that can be used
to represent the file passed. It can optionally also look for existing
thumbnails. It does no I/O, so the lookup should be relatively fast.
</para>
<para>
If you don't know any information about the file already you can use
<link linkend="gnome-icon-lookup-sync"><function>gnome_icon_lookup_sync()</function></link> which gets this information using gnome-vfs.
</para>
<para>
For backwards compatibility, this function also accepts a GnomeIconTheme
instead of a GtkIconTheme.
</para>
<para>
The following <parameter>flags</parameter> are valid:
</para>
<para>
GNOME_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT - Return the text icon for scripts.
This is useful if you do text embedding in the icons.
</para>
<para>
GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES - Return the
filename of the filename itself for small images. Only availible if you
pass a thumbnail_factory.
</para>
<para>
Possible <parameter>result</parameter> flags:
</para>
<para>
GNOME_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL - The returned file is a thumbnail.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>icon_theme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkIconTheme"><type>GtkIconTheme</type></link>, or (deprecated) a <link linkend="GnomeIconTheme"><type>GnomeIconTheme</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>thumbnail_factory</parameter>&#160;:</term>
<listitem><simpara> an optional <link linkend="GnomeThumbnailFactory"><type>GnomeThumbnailFactory</type></link> used to look up thumbnails
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file_uri</parameter>&#160;:</term>
<listitem><simpara> the uri of the file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>custom_icon</parameter>&#160;:</term>
<listitem><simpara> optionally the name of a custom icon to try
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file_info</parameter>&#160;:</term>
<listitem><simpara> information about the file from <link linkend="gnome-vfs-get-file-info"><function>gnome_vfs_get_file_info()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&#160;:</term>
<listitem><simpara> the mime type of the icon
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags that affect the result of the lookup
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> optionally result flags of the lookups are stored here
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The name of an icon or an absolute filename of an image to
         use for the file.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>
<refsect2 id="gnome-icon-lookup-sync" role="function" condition="since:2.2">
<title>gnome_icon_lookup_sync ()</title>
<indexterm zone="gnome-icon-lookup-sync" role="2.2"><primary sortas="gnome_icon_lookup_sync">gnome_icon_lookup_sync</primary></indexterm><programlisting><link linkend="char">char</link> *              gnome_icon_lookup_sync              (<link linkend="GtkIconTheme">GtkIconTheme</link> *icon_theme,
                                                         <link linkend="GnomeThumbnailFactory">GnomeThumbnailFactory</link> *thumbnail_factory,
                                                         const <link linkend="char">char</link> *file_uri,
                                                         const <link linkend="char">char</link> *custom_icon,
                                                         <link linkend="GnomeIconLookupFlags">GnomeIconLookupFlags</link> flags,
                                                         <link linkend="GnomeIconLookupResultFlags">GnomeIconLookupResultFlags</link> *result);</programlisting>
<para>
This function tries to locate an icon in <parameter>icon_theme</parameter> that can be used
to represent the file passed. See <link linkend="gnome-icon-lookup"><function>gnome_icon_lookup()</function></link> for more information.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>icon_theme</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GtkIconTheme"><type>GtkIconTheme</type></link>, or (deprecated) a <link linkend="GnomeIconTheme"><type>GnomeIconTheme</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>thumbnail_factory</parameter>&#160;:</term>
<listitem><simpara> an optional <link linkend="GnomeThumbnailFactory"><type>GnomeThumbnailFactory</type></link> used to look up thumbnails
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>file_uri</parameter>&#160;:</term>
<listitem><simpara> the uri of the file
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>custom_icon</parameter>&#160;:</term>
<listitem><simpara> optionally the name of a custom icon to try
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags that affect the result of the lookup
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>result</parameter>&#160;:</term>
<listitem><simpara> optionally result flags of the lookups are stored here
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The name of an icon or an absolute filename of an image to
         use for the file.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.2</para></refsect2>

</refsect1>




</refentry>
