<?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" id="GLoadableIcon.top_of_page">GLoadableIcon</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GLoadableIcon</refname>
<refpurpose>Loadable Icons</refpurpose>
</refnamediv>

<refsynopsisdiv id="GLoadableIcon.synopsis" 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 id="GLoadableIcon.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GInterface">GInterface</link>
   +----GLoadableIcon
</synopsis>
</refsect1>

<refsect1 id="GLoadableIcon.prerequisites" 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 id="GLoadableIcon.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GLoadableIcon is implemented by
 <link linkend="GFileIcon">GFileIcon</link>.</para>
</refsect1>




<refsect1 id="GLoadableIcon.description" 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 id="GLoadableIcon.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GLoadableIcon-struct" role="struct">
<title>GLoadableIcon</title>
<indexterm zone="GLoadableIcon-struct"><primary sortas="LoadableIcon">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 id="GLoadableIconIface" role="struct">
<title>GLoadableIconIface</title>
<indexterm zone="GLoadableIconIface"><primary sortas="LoadableIconIface">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>&#160;<structfield>g_iface</structfield>;</term>
<listitem><simpara> The parent interface.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>load</structfield>&#160;()</term>
<listitem><simpara> Loads an icon.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>load_async</structfield>&#160;()</term>
<listitem><simpara> Loads an icon asynchronously.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>load_finish</structfield>&#160;()</term>
<listitem><simpara> Finishes an asynchronous icon load.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-loadable-icon-load" role="function">
<title>g_loadable_icon_load ()</title>
<indexterm zone="g-loadable-icon-load"><primary sortas="loadable_icon_load">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>&#160;:</term>
<listitem><simpara> a <link linkend="GLoadableIcon"><type>GLoadableIcon</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara> an integer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</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>&#160;:</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>&#160;:</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>&#160;:</term><listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link> to read the icon from.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-loadable-icon-load-async" role="function">
<title>g_loadable_icon_load_async ()</title>
<indexterm zone="g-loadable-icon-load-async"><primary sortas="loadable_icon_load_async">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>&#160;:</term>
<listitem><simpara> a <link linkend="GLoadableIcon"><type>GLoadableIcon</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&#160;:</term>
<listitem><simpara> an integer.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancellable</parameter>&#160;:</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>&#160;:</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>&#160;:</term>
<listitem><simpara> the data to pass to callback function
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-loadable-icon-load-finish" role="function">
<title>g_loadable_icon_load_finish ()</title>
<indexterm zone="g-loadable-icon-load-finish"><primary sortas="loadable_icon_load_finish">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>&#160;:</term>
<listitem><simpara> a <link linkend="GLoadableIcon"><type>GLoadableIcon</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>res</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAsyncResult"><type>GAsyncResult</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</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>&#160;:</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>&#160;:</term><listitem><simpara> a <link linkend="GInputStream"><type>GInputStream</type></link> to read the icon from.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1 id="GLoadableIcon.see-also">
<title>See Also</title>
#GIcon, <link linkend="GThemedIcon"><type>GThemedIcon</type></link>
</refsect1>

</refentry>
