<?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" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GLoadableIcon">
<refmeta>
<refentrytitle role="top_of_page">GLoadableIcon</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GLoadableIcon</refname>
<refpurpose>Loadable Icons</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

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

<synopsis>

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


                    <link linkend="GLoadableIcon-struct">GLoadableIcon</link>;
                    <link linkend="GLoadableIconIface">GLoadableIconIface</link>;
<link linkend="GInputStream">GInputStream</link>*       <link linkend="g-loadable-icon-load">g_loadable_icon_load</link>                (<link linkend="GLoadableIcon">GLoadableIcon</link> *icon,
                                                         <link linkend="int">int</link> size,
                                                         <link linkend="char">char</link> **type,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="void">void</link>                <link linkend="g-loadable-icon-load-async">g_loadable_icon_load_async</link>          (<link linkend="GLoadableIcon">GLoadableIcon</link> *icon,
                                                         <link linkend="int">int</link> size,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);
<link linkend="GInputStream">GInputStream</link>*       <link linkend="g-loadable-icon-load-finish">g_loadable_icon_load_finish</link>         (<link linkend="GLoadableIcon">GLoadableIcon</link> *icon,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *res,
                                                         <link linkend="char">char</link> **type,
                                                         <link linkend="GError">GError</link> **error);


</synopsis>
</refsynopsisdiv>

<refsect1 role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>

  <link linkend="GInterface">GInterface</link>
   +----GLoadableIcon
</synopsis>

</refsect1>

<refsect1 role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GLoadableIcon requires
 <link linkend="GIcon">GIcon</link> and  <link linkend="GObject">GObject</link>.</para>

</refsect1>



<refsect1 role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GLoadableIcon is implemented by
 <link linkend="GFileIcon">GFileIcon</link>.</para>

</refsect1>




<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
Extends the <link linkend="GIcon"><type>GIcon</type></link> interface and adds the ability to 
load icons from streams.</para>
<para>

</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="GLoadableIcon-struct" role="struct"/>GLoadableIcon</title>
<indexterm><primary>GLoadableIcon</primary></indexterm><programlisting>typedef struct _GLoadableIcon GLoadableIcon;</programlisting>
<para>
Generic type for all kinds of icons that can be loaded 
as a stream.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GLoadableIconIface" role="struct"/>GLoadableIconIface</title>
<indexterm><primary>GLoadableIconIface</primary></indexterm><programlisting>typedef struct {
  GTypeInterface g_iface;

  /* Virtual Table */

  GInputStream * (*load)        (GLoadableIcon      *icon,
				 int                 size,
				 char              **type,
				 GCancellable       *cancellable,
				 GError            **error);
  void           (*load_async)  (GLoadableIcon      *icon,
				 int                 size,
				 GCancellable       *cancellable,
				 GAsyncReadyCallback callback,
				 gpointer            user_data);
  GInputStream * (*load_finish) (GLoadableIcon      *icon,
				  GAsyncResult      *res,
				  char             **type,
				  GError           **error);
} GLoadableIconIface;
</programlisting>
<para>
Interface for icons that can be loaded as a stream.</para>
<para>

</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GTypeInterface">GTypeInterface</link>&nbsp;<structfield>g_iface</structfield>;</term>
<listitem><simpara> The parent interface.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>load</structfield>&nbsp;()</term>
<listitem><simpara> Loads an icon.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>load_async</structfield>&nbsp;()</term>
<listitem><simpara> Loads an icon asynchronously.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>load_finish</structfield>&nbsp;()</term>
<listitem><simpara> Finishes an asynchronous icon load.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-loadable-icon-load" role="function"/>g_loadable_icon_load ()</title>
<indexterm><primary>g_loadable_icon_load</primary></indexterm><programlisting><link linkend="GInputStream">GInputStream</link>*       g_loadable_icon_load                (<link linkend="GLoadableIcon">GLoadableIcon</link> *icon,
                                                         <link linkend="int">int</link> size,
                                                         <link linkend="char">char</link> **type,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Loads a loadable icon. For the asynchronous version of this function, 
see <link linkend="g-loadable-icon-load-async"><function>g_loadable_icon_load_async()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>icon</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GLoadableIcon"><type>GLoadableIcon</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> an integer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
<listitem><simpara>  a location to store the type of the loaded icon, <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&nbsp;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore. 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to 
ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link> to read the icon from.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-loadable-icon-load-async" role="function"/>g_loadable_icon_load_async ()</title>
<indexterm><primary>g_loadable_icon_load_async</primary></indexterm><programlisting><link linkend="void">void</link>                g_loadable_icon_load_async          (<link linkend="GLoadableIcon">GLoadableIcon</link> *icon,
                                                         <link linkend="int">int</link> size,
                                                         <link linkend="GCancellable">GCancellable</link> *cancellable,
                                                         <link linkend="GAsyncReadyCallback">GAsyncReadyCallback</link> callback,
                                                         <link linkend="gpointer">gpointer</link> user_data);</programlisting>
<para>
Loads an icon asynchronously. To finish this function, see 
<link linkend="g-loadable-icon-load-finish"><function>g_loadable_icon_load_finish()</function></link>. For the synchronous, blocking 
version of this function, see <link linkend="g-loadable-icon-load"><function>g_loadable_icon_load()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>icon</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GLoadableIcon"><type>GLoadableIcon</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> an integer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&nbsp;:</term>
<listitem><simpara> optional <link linkend="GCancellable"><type>GCancellable</type></link> object, <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore. 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>callback</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GAsyncReadyCallback"><type>GAsyncReadyCallback</type></link> to call when the request is satisfied
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
<listitem><simpara> the data to pass to callback function
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-loadable-icon-load-finish" role="function"/>g_loadable_icon_load_finish ()</title>
<indexterm><primary>g_loadable_icon_load_finish</primary></indexterm><programlisting><link linkend="GInputStream">GInputStream</link>*       g_loadable_icon_load_finish         (<link linkend="GLoadableIcon">GLoadableIcon</link> *icon,
                                                         <link linkend="GAsyncResult">GAsyncResult</link> *res,
                                                         <link linkend="char">char</link> **type,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Finishes an asynchronous icon load started in <link linkend="g-loadable-icon-load-async"><function>g_loadable_icon_load_async()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>icon</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GLoadableIcon"><type>GLoadableIcon</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>res</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
<listitem><simpara> a location to store the type of the loaded icon, <link linkend="NULL:CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> to 
ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link> to read the icon from.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1>
<title>See Also</title>
<link linkend="GIcon"><type>GIcon</type></link>, <link linkend="GThemedIcon"><type>GThemedIcon</type></link>
</refsect1>


<refsect1><refsect2 /><refsect2 /></refsect1>
</refentry>
