<refentry id="gtk-Themeable-Stock-Images">
<refmeta>
<refentrytitle>Themeable Stock Images</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Themeable Stock Images</refname><refpurpose>
Manipulating stock icons</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

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


struct      <link linkend="GtkIconSource">GtkIconSource</link>;
struct      <link linkend="GtkIconFactory-struct">GtkIconFactory</link>;
struct      <link linkend="GtkIconSet">GtkIconSet</link>;
enum        <link linkend="GtkIconSize">GtkIconSize</link>;
<link linkend="GtkIconSource">GtkIconSource</link>* <link linkend="gtk-icon-source-copy">gtk_icon_source_copy</link>         (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
void        <link linkend="gtk-icon-source-free">gtk_icon_source_free</link>            (<link linkend="GtkIconSource">GtkIconSource</link> *source);
void        <link linkend="gtk-icon-factory-add">gtk_icon_factory_add</link>            (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory,
                                             const <link linkend="gchar">gchar</link> *stock_id,
                                             <link linkend="GtkIconSet">GtkIconSet</link> *icon_set);
void        <link linkend="gtk-icon-factory-add-default">gtk_icon_factory_add_default</link>    (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory);
<link linkend="GtkIconSet">GtkIconSet</link>* <link linkend="gtk-icon-factory-lookup">gtk_icon_factory_lookup</link>         (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory,
                                             const <link linkend="gchar">gchar</link> *stock_id);
<link linkend="GtkIconSet">GtkIconSet</link>* <link linkend="gtk-icon-factory-lookup-default">gtk_icon_factory_lookup_default</link> (const <link linkend="gchar">gchar</link> *stock_id);
<link linkend="GtkIconFactory">GtkIconFactory</link>* <link linkend="gtk-icon-factory-new">gtk_icon_factory_new</link>        (void);
void        <link linkend="gtk-icon-factory-remove-default">gtk_icon_factory_remove_default</link> (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory);
void        <link linkend="gtk-icon-set-add-source">gtk_icon_set_add_source</link>         (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set,
                                             const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="GtkIconSet">GtkIconSet</link>* <link linkend="gtk-icon-set-copy">gtk_icon_set_copy</link>               (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set);
<link linkend="GtkIconSet">GtkIconSet</link>* <link linkend="gtk-icon-set-new">gtk_icon_set_new</link>                (void);
<link linkend="GtkIconSet">GtkIconSet</link>* <link linkend="gtk-icon-set-new-from-pixbuf">gtk_icon_set_new_from_pixbuf</link>    (<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
<link linkend="GtkIconSet">GtkIconSet</link>* <link linkend="gtk-icon-set-ref">gtk_icon_set_ref</link>                (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set);
<link linkend="GdkPixbuf">GdkPixbuf</link>*  <link linkend="gtk-icon-set-render-icon">gtk_icon_set_render_icon</link>        (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set,
                                             <link linkend="GtkStyle">GtkStyle</link> *style,
                                             <link linkend="GtkTextDirection">GtkTextDirection</link> direction,
                                             <link linkend="GtkStateType">GtkStateType</link> state,
                                             <link linkend="GtkIconSize">GtkIconSize</link> size,
                                             <link linkend="GtkWidget">GtkWidget</link> *widget,
                                             const char *detail);
void        <link linkend="gtk-icon-set-unref">gtk_icon_set_unref</link>              (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-icon-size-lookup">gtk_icon_size_lookup</link>            (<link linkend="GtkIconSize">GtkIconSize</link> size,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height);
<link linkend="GtkIconSize">GtkIconSize</link> <link linkend="gtk-icon-size-register">gtk_icon_size_register</link>          (const <link linkend="gchar">gchar</link> *name,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);
void        <link linkend="gtk-icon-size-register-alias">gtk_icon_size_register_alias</link>    (const <link linkend="gchar">gchar</link> *alias,
                                             <link linkend="GtkIconSize">GtkIconSize</link> target);
<link linkend="GtkIconSize">GtkIconSize</link> <link linkend="gtk-icon-size-from-name">gtk_icon_size_from_name</link>         (const <link linkend="gchar">gchar</link> *name);
G_CONST_RETURN <link linkend="gchar">gchar</link>* <link linkend="gtk-icon-size-get-name">gtk_icon_size_get_name</link>
                                            (<link linkend="GtkIconSize">GtkIconSize</link> size);
void        <link linkend="gtk-icon-set-get-sizes">gtk_icon_set_get_sizes</link>          (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set,
                                             <link linkend="GtkIconSize">GtkIconSize</link> **sizes,
                                             <link linkend="gint">gint</link> *n_sizes);
<link linkend="GtkTextDirection">GtkTextDirection</link> <link linkend="gtk-icon-source-get-direction">gtk_icon_source_get_direction</link>
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-icon-source-get-direction-wildcarded">gtk_icon_source_get_direction_wildcarded</link>
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
G_CONST_RETURN <link linkend="gchar">gchar</link>* <link linkend="gtk-icon-source-get-filename">gtk_icon_source_get_filename</link>
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="GdkPixbuf">GdkPixbuf</link>*  <link linkend="gtk-icon-source-get-pixbuf">gtk_icon_source_get_pixbuf</link>      (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="GtkIconSize">GtkIconSize</link> <link linkend="gtk-icon-source-get-size">gtk_icon_source_get_size</link>        (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-icon-source-get-size-wildcarded">gtk_icon_source_get_size_wildcarded</link>
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="GtkStateType">GtkStateType</link> <link linkend="gtk-icon-source-get-state">gtk_icon_source_get_state</link>      (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="gboolean">gboolean</link>    <link linkend="gtk-icon-source-get-state-wildcarded">gtk_icon_source_get_state_wildcarded</link>
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);
<link linkend="GtkIconSource">GtkIconSource</link>* <link linkend="gtk-icon-source-new">gtk_icon_source_new</link>          (void);
void        <link linkend="gtk-icon-source-set-direction">gtk_icon_source_set_direction</link>   (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GtkTextDirection">GtkTextDirection</link> direction);
void        <link linkend="gtk-icon-source-set-direction-wildcarded">gtk_icon_source_set_direction_wildcarded</link>
                                            (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="gboolean">gboolean</link> setting);
void        <link linkend="gtk-icon-source-set-filename">gtk_icon_source_set_filename</link>    (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             const <link linkend="gchar">gchar</link> *filename);
void        <link linkend="gtk-icon-source-set-pixbuf">gtk_icon_source_set_pixbuf</link>      (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);
void        <link linkend="gtk-icon-source-set-size">gtk_icon_source_set_size</link>        (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GtkIconSize">GtkIconSize</link> size);
void        <link linkend="gtk-icon-source-set-size-wildcarded">gtk_icon_source_set_size_wildcarded</link>
                                            (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="gboolean">gboolean</link> setting);
void        <link linkend="gtk-icon-source-set-state">gtk_icon_source_set_state</link>       (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GtkStateType">GtkStateType</link> state);
void        <link linkend="gtk-icon-source-set-state-wildcarded">gtk_icon_source_set_state_wildcarded</link>
                                            (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="gboolean">gboolean</link> setting);


</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>


<para id="GtkIconFactory">
Browse the available stock icons in the list of stock IDs found <link
linkend="gtk-Stock-Items">here</link>. You can also use 
the <application>gtk-demo</application> application for this purpose.
</para>

<para>
 An icon factory manages a collection of <link linkend="GtkIconSet">GtkIconSet</link>; a <link linkend="GtkIconSet">GtkIconSet</link> manages a
 set of variants of a particular icon (i.e. a <link linkend="GtkIconSet">GtkIconSet</link> contains variants for
 different sizes and widget states). Icons in an icon factory are named by a
 stock ID, which is a simple string identifying the icon. Each <link linkend="GtkStyle">GtkStyle</link> has a
 list of <link linkend="GtkIconFactory">GtkIconFactory</link> derived from the current theme; those icon factories
 are consulted first when searching for an icon. If the theme doesn't set a
 particular icon, GTK+ looks for the icon in a list of default icon factories,
 maintained by <link linkend="gtk-icon-factory-add-default">gtk_icon_factory_add_default</link>() and
 <link linkend="gtk-icon-factory-remove-default">gtk_icon_factory_remove_default</link>(). Applications with icons should add a default
 icon factory with their icons, which will allow themes to override the icons
 for the application.
</para>

<para>
To display an icon, always use <link linkend="gtk-style-lookup-icon-set">gtk_style_lookup_icon_set</link>() on the widget that
will display the icon, or the convenience function
<link linkend="gtk-widget-render-icon">gtk_widget_render_icon</link>(). These functions take the theme into account when
looking up the icon to use for a given stock ID.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GtkIconSource">struct GtkIconSource</title>
<programlisting>struct GtkIconSource;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GtkIconFactory-struct">struct GtkIconFactory</title>
<programlisting>struct GtkIconFactory;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GtkIconSet">struct GtkIconSet</title>
<programlisting>struct GtkIconSet;</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="GtkIconSize">enum GtkIconSize</title>
<programlisting>typedef enum
{
  GTK_ICON_SIZE_INVALID,
  GTK_ICON_SIZE_MENU,
  GTK_ICON_SIZE_SMALL_TOOLBAR,
  GTK_ICON_SIZE_LARGE_TOOLBAR,
  GTK_ICON_SIZE_BUTTON,
  GTK_ICON_SIZE_DND,
  GTK_ICON_SIZE_DIALOG
} GtkIconSize;
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-copy">gtk_icon_source_copy ()</title>
<programlisting><link linkend="GtkIconSource">GtkIconSource</link>* gtk_icon_source_copy         (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Creates a copy of <parameter>source</parameter>; mostly useful for language bindings.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-free">gtk_icon_source_free ()</title>
<programlisting>void        gtk_icon_source_free            (<link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Frees a dynamically-allocated icon source, along with its
filename, size, and pixbuf fields if those are not <literal>NULL</literal>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-factory-add">gtk_icon_factory_add ()</title>
<programlisting>void        gtk_icon_factory_add            (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory,
                                             const <link linkend="gchar">gchar</link> *stock_id,
                                             <link linkend="GtkIconSet">GtkIconSet</link> *icon_set);</programlisting>
<para>
Adds the given <parameter>icon_set</parameter> to the icon factory, under the name
<parameter>stock_id</parameter>.  <parameter>stock_id</parameter> should be namespaced for your application,
e.g. "myapp-whatever-icon".  Normally applications create a
<link linkend="GtkIconFactory">GtkIconFactory</link>, then add it to the list of default factories with
<link linkend="gtk-icon-factory-add-default">gtk_icon_factory_add_default</link>(). Then they pass the <parameter>stock_id</parameter> to
widgets such as <link linkend="GtkImage">GtkImage</link> to display the icon. Themes can provide
an icon with the same name (such as "myapp-whatever-icon") to
override your application's default icons. If an icon already
existed in <parameter>factory</parameter> for <parameter>stock_id</parameter>, it is unreferenced and replaced
with the new <parameter>icon_set</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>factory</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconFactory">GtkIconFactory</link>
</entry></row>
<row><entry align="right"><parameter>stock_id</parameter>&nbsp;:</entry>
<entry> icon name
</entry></row>
<row><entry align="right"><parameter>icon_set</parameter>&nbsp;:</entry>
<entry> icon set
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-factory-add-default">gtk_icon_factory_add_default ()</title>
<programlisting>void        gtk_icon_factory_add_default    (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory);</programlisting>
<para>
Adds an icon factory to the list of icon factories searched by
<link linkend="gtk-style-lookup-icon-set">gtk_style_lookup_icon_set</link>(). This means that, for example,
<link linkend="gtk-image-new-from-stock">gtk_image_new_from_stock</link>() will be able to find icons in <parameter>factory</parameter>.
There will normally be an icon factory added for each library or
application that comes with icons. The default icon factories
can be overridden by themes.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>factory</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconFactory">GtkIconFactory</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-factory-lookup">gtk_icon_factory_lookup ()</title>
<programlisting><link linkend="GtkIconSet">GtkIconSet</link>* gtk_icon_factory_lookup         (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory,
                                             const <link linkend="gchar">gchar</link> *stock_id);</programlisting>
<para>
Looks up <parameter>stock_id</parameter> in the icon factory, returning an icon set
if found, otherwise <literal>NULL</literal>. For display to the user, you should
use <link linkend="gtk-style-lookup-icon-set">gtk_style_lookup_icon_set</link>() on the <link linkend="GtkStyle">GtkStyle</link> for the
widget that will display the icon, instead of using this
function directly, so that themes are taken into account.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>factory</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconFactory">GtkIconFactory</link>
</entry></row>
<row><entry align="right"><parameter>stock_id</parameter>&nbsp;:</entry>
<entry> an icon name
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> icon set of <parameter>stock_id</parameter>.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-factory-lookup-default">gtk_icon_factory_lookup_default ()</title>
<programlisting><link linkend="GtkIconSet">GtkIconSet</link>* gtk_icon_factory_lookup_default (const <link linkend="gchar">gchar</link> *stock_id);</programlisting>
<para>
Looks for an icon in the list of default icon factories.  For
display to the user, you should use <link linkend="gtk-style-lookup-icon-set">gtk_style_lookup_icon_set</link>() on
the <link linkend="GtkStyle">GtkStyle</link> for the widget that will display the icon, instead of
using this function directly, so that themes are taken into
account.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>stock_id</parameter>&nbsp;:</entry>
<entry> an icon name
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="GtkIconSet">GtkIconSet</link>, or <literal>NULL</literal>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-factory-new">gtk_icon_factory_new ()</title>
<programlisting><link linkend="GtkIconFactory">GtkIconFactory</link>* gtk_icon_factory_new        (void);</programlisting>
<para>
Creates a new <link linkend="GtkIconFactory">GtkIconFactory</link>. An icon factory manages a collection
of <link linkend="GtkIconSet">GtkIconSet</link><!>s; a <link linkend="GtkIconSet">GtkIconSet</link> manages a set of variants of a
particular icon (i.e. a <link linkend="GtkIconSet">GtkIconSet</link> contains variants for different
sizes and widget states). Icons in an icon factory are named by a
stock ID, which is a simple string identifying the icon. Each
<link linkend="GtkStyle">GtkStyle</link> has a list of <link linkend="GtkIconFactory">GtkIconFactory</link><!>s derived from the current
theme; those icon factories are consulted first when searching for
an icon. If the theme doesn't set a particular icon, GTK+ looks for
the icon in a list of default icon factories, maintained by
<link linkend="gtk-icon-factory-add-default">gtk_icon_factory_add_default</link>() and
<link linkend="gtk-icon-factory-remove-default">gtk_icon_factory_remove_default</link>(). Applications with icons should
add a default icon factory with their icons, which will allow
themes to override the icons for the application.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new <link linkend="GtkIconFactory">GtkIconFactory</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-factory-remove-default">gtk_icon_factory_remove_default ()</title>
<programlisting>void        gtk_icon_factory_remove_default (<link linkend="GtkIconFactory">GtkIconFactory</link> *factory);</programlisting>
<para>
Removes an icon factory from the list of default icon
factories. Not normally used; you might use it for a library that
can be unloaded or shut down.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>factory</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconFactory">GtkIconFactory</link> previously added with <link linkend="gtk-icon-factory-add-default">gtk_icon_factory_add_default</link>()
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-add-source">gtk_icon_set_add_source ()</title>
<programlisting>void        gtk_icon_set_add_source         (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set,
                                             const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Icon sets have a list of <link linkend="GtkIconSource">GtkIconSource</link>, which they use as base
icons for rendering icons in different states and sizes. Icons are
scaled, made to look insensitive, etc. in
<link linkend="gtk-icon-set-render-icon">gtk_icon_set_render_icon</link>(), but <link linkend="GtkIconSet">GtkIconSet</link> needs base images to
work with. The base images and when to use them are described by
a <link linkend="GtkIconSource">GtkIconSource</link>.
</para>
<para>
This function copies <parameter>source</parameter>, so you can reuse the same source immediately
without affecting the icon set.
</para>
<para>
An example of when you'd use this function: a web browser's "Back
to Previous Page" icon might point in a different direction in
Hebrew and in English; it might look different when insensitive;
and it might change size depending on toolbar mode (small/large
icons). So a single icon set would contain all those variants of
the icon, and you might add a separate source for each one.
</para>
<para>
You should nearly always add a "default" icon source with all
fields wildcarded, which will be used as a fallback if no more
specific source matches. <link linkend="GtkIconSet">GtkIconSet</link> always prefers more specific
icon sources to more generic icon sources. The order in which you
add the sources to the icon set does not matter.
</para>
<para>
<link linkend="gtk-icon-set-new-from-pixbuf">gtk_icon_set_new_from_pixbuf</link>() creates a new icon set with a
default icon source based on the given pixbuf.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>icon_set</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSet">GtkIconSet</link>
</entry></row>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-copy">gtk_icon_set_copy ()</title>
<programlisting><link linkend="GtkIconSet">GtkIconSet</link>* gtk_icon_set_copy               (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set);</programlisting>
<para>
Copies <parameter>icon_set</parameter> by value.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>icon_set</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSet">GtkIconSet</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new <link linkend="GtkIconSet">GtkIconSet</link> identical to the first.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-new">gtk_icon_set_new ()</title>
<programlisting><link linkend="GtkIconSet">GtkIconSet</link>* gtk_icon_set_new                (void);</programlisting>
<para>
Creates a new <link linkend="GtkIconSet">GtkIconSet</link>. A <link linkend="GtkIconSet">GtkIconSet</link> represents a single icon
in various sizes and widget states. It can provide a <link linkend="GdkPixbuf">GdkPixbuf</link>
for a given size and state on request, and automatically caches
some of the rendered <link linkend="GdkPixbuf">GdkPixbuf</link> objects.
</para>
<para>
Normally you would use <link linkend="gtk-widget-render-icon">gtk_widget_render_icon</link>() instead of
using <link linkend="GtkIconSet">GtkIconSet</link> directly. The one case where you'd use
<link linkend="GtkIconSet">GtkIconSet</link> is to create application-specific icon sets to place in
a <link linkend="GtkIconFactory">GtkIconFactory</link>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new <link linkend="GtkIconSet">GtkIconSet</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-new-from-pixbuf">gtk_icon_set_new_from_pixbuf ()</title>
<programlisting><link linkend="GtkIconSet">GtkIconSet</link>* gtk_icon_set_new_from_pixbuf    (<link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
<para>
Creates a new <link linkend="GtkIconSet">GtkIconSet</link> with <parameter>pixbuf</parameter> as the default/fallback
source image. If you don't add any additional <link linkend="GtkIconSource">GtkIconSource</link> to the
icon set, all variants of the icon will be created from <parameter>pixbuf</parameter>,
using scaling, pixelation, etc. as required to adjust the icon size
or make the icon look insensitive/prelighted.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>pixbuf</parameter>&nbsp;:</entry>
<entry> a <link linkend="GdkPixbuf">GdkPixbuf</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new <link linkend="GtkIconSet">GtkIconSet</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-ref">gtk_icon_set_ref ()</title>
<programlisting><link linkend="GtkIconSet">GtkIconSet</link>* gtk_icon_set_ref                (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set);</programlisting>
<para>
Increments the reference count on <parameter>icon_set</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>icon_set</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSet">GtkIconSet</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <parameter>icon_set</parameter>.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-render-icon">gtk_icon_set_render_icon ()</title>
<programlisting><link linkend="GdkPixbuf">GdkPixbuf</link>*  gtk_icon_set_render_icon        (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set,
                                             <link linkend="GtkStyle">GtkStyle</link> *style,
                                             <link linkend="GtkTextDirection">GtkTextDirection</link> direction,
                                             <link linkend="GtkStateType">GtkStateType</link> state,
                                             <link linkend="GtkIconSize">GtkIconSize</link> size,
                                             <link linkend="GtkWidget">GtkWidget</link> *widget,
                                             const char *detail);</programlisting>
<para>
Renders an icon using <link linkend="gtk-style-render-icon">gtk_style_render_icon</link>(). In most cases,
<link linkend="gtk-widget-render-icon">gtk_widget_render_icon</link>() is better, since it automatically provides
most of the arguments from the current widget settings.  This
function never returns <literal>NULL</literal>; if the icon can't be rendered
(perhaps because an image file fails to load), a default "missing
image" icon will be returned instead.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>icon_set</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSet">GtkIconSet</link>
</entry></row>
<row><entry align="right"><parameter>style</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkStyle">GtkStyle</link> associated with <parameter>widget</parameter>, or <literal>NULL</literal>
</entry></row>
<row><entry align="right"><parameter>direction</parameter>&nbsp;:</entry>
<entry> text direction
</entry></row>
<row><entry align="right"><parameter>state</parameter>&nbsp;:</entry>
<entry> widget state
</entry></row>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> icon size
</entry></row>
<row><entry align="right"><parameter>widget</parameter>&nbsp;:</entry>
<entry> widget that will display the icon, or <literal>NULL</literal>
</entry></row>
<row><entry align="right"><parameter>detail</parameter>&nbsp;:</entry>
<entry> detail to pass to the theme engine, or <literal>NULL</literal>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a <link linkend="GdkPixbuf">GdkPixbuf</link> to be displayed
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-unref">gtk_icon_set_unref ()</title>
<programlisting>void        gtk_icon_set_unref              (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set);</programlisting>
<para>
Decrements the reference count on <parameter>icon_set</parameter>, and frees memory
if the reference count reaches 0.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>icon_set</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSet">GtkIconSet</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-size-lookup">gtk_icon_size_lookup ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_icon_size_lookup            (<link linkend="GtkIconSize">GtkIconSize</link> size,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height);</programlisting>
<para>
Obtains the pixel size of a semantic icon size, normally <parameter>size</parameter> would be
<link linkend="GTK-ICON-SIZE-MENU-CAPS">GTK_ICON_SIZE_MENU</link>, <link linkend="GTK-ICON-SIZE-BUTTON-CAPS">GTK_ICON_SIZE_BUTTON</link>, etc.  This function
isn't normally needed, <link linkend="gtk-widget-render-icon">gtk_widget_render_icon</link>() is the usual
way to get an icon for rendering, then just look at the size of
the rendered pixbuf. The rendered pixbuf may not even correspond to
the width/height returned by <link linkend="gtk-icon-size-lookup">gtk_icon_size_lookup</link>(), because themes
are free to render the pixbuf however they like, including changing
the usual size.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> an icon size
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry> location to store icon width
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry> location to store icon height
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if <parameter>size</parameter> was a valid size
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-size-register">gtk_icon_size_register ()</title>
<programlisting><link linkend="GtkIconSize">GtkIconSize</link> gtk_icon_size_register          (const <link linkend="gchar">gchar</link> *name,
                                             <link linkend="gint">gint</link> width,
                                             <link linkend="gint">gint</link> height);</programlisting>
<para>
Registers a new icon size, along the same lines as <link linkend="GTK-ICON-SIZE-MENU-CAPS">GTK_ICON_SIZE_MENU</link>,
etc. Returns the integer value for the size.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> name of the icon size
</entry></row>
<row><entry align="right"><parameter>width</parameter>&nbsp;:</entry>
<entry> the icon width
</entry></row>
<row><entry align="right"><parameter>height</parameter>&nbsp;:</entry>
<entry> the icon height
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> integer value representing the size

</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-size-register-alias">gtk_icon_size_register_alias ()</title>
<programlisting>void        gtk_icon_size_register_alias    (const <link linkend="gchar">gchar</link> *alias,
                                             <link linkend="GtkIconSize">GtkIconSize</link> target);</programlisting>
<para>
Registers <parameter>alias</parameter> as another name for <parameter>target</parameter>.
So calling <link linkend="gtk-icon-size-from-name">gtk_icon_size_from_name</link>() with <parameter>alias</parameter> as argument
will return <parameter>target</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>alias</parameter>&nbsp;:</entry>
<entry> an alias for <parameter>target</parameter>
</entry></row>
<row><entry align="right"><parameter>target</parameter>&nbsp;:</entry>
<entry> an existing icon size
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-size-from-name">gtk_icon_size_from_name ()</title>
<programlisting><link linkend="GtkIconSize">GtkIconSize</link> gtk_icon_size_from_name         (const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Looks up the icon size associated with <parameter>name</parameter>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>name</parameter>&nbsp;:</entry>
<entry> the name to look up.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the icon size with the given name.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-size-get-name">gtk_icon_size_get_name ()</title>
<programlisting>G_CONST_RETURN <link linkend="gchar">gchar</link>* gtk_icon_size_get_name
                                            (<link linkend="GtkIconSize">GtkIconSize</link> size);</programlisting>
<para>
Gets the canonical name of the given icon size. The returned string 
is statically allocated and should not be freed.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSize">GtkIconSize</link>.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the name of the given icon size.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-set-get-sizes">gtk_icon_set_get_sizes ()</title>
<programlisting>void        gtk_icon_set_get_sizes          (<link linkend="GtkIconSet">GtkIconSet</link> *icon_set,
                                             <link linkend="GtkIconSize">GtkIconSize</link> **sizes,
                                             <link linkend="gint">gint</link> *n_sizes);</programlisting>
<para>
Obtains a list of icon sizes this icon set can render. The returned
array must be freed with <link linkend="g-free">g_free</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>icon_set</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSet">GtkIconSet</link>
</entry></row>
<row><entry align="right"><parameter>sizes</parameter>&nbsp;:</entry>
<entry> return location for array of sizes
</entry></row>
<row><entry align="right"><parameter>n_sizes</parameter>&nbsp;:</entry>
<entry> location to store number of elements in returned array
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-direction">gtk_icon_source_get_direction ()</title>
<programlisting><link linkend="GtkTextDirection">GtkTextDirection</link> gtk_icon_source_get_direction
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Obtains the text direction this icon source applies to. The return
value is only useful/meaningful if the text direction is <emphasis>not</emphasis> 
wildcarded.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> text direction this source matches
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-direction-wildcarded">gtk_icon_source_get_direction_wildcarded ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_icon_source_get_direction_wildcarded
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Gets the value set by <link linkend="gtk-icon-source-set-direction-wildcarded">gtk_icon_source_set_direction_wildcarded</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if this icon source is a base for any text direction variant
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-filename">gtk_icon_source_get_filename ()</title>
<programlisting>G_CONST_RETURN <link linkend="gchar">gchar</link>* gtk_icon_source_get_filename
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Retrieves the source filename, or <literal>NULL</literal> if none is set.  The
filename is not a copy, and should not be modified or expected to
persist beyond the lifetime of the icon source.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> image filename
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-pixbuf">gtk_icon_source_get_pixbuf ()</title>
<programlisting><link linkend="GdkPixbuf">GdkPixbuf</link>*  gtk_icon_source_get_pixbuf      (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Retrieves the source pixbuf, or <literal>NULL</literal> if none is set.
The reference count on the pixbuf is not incremented.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> source pixbuf
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-size">gtk_icon_source_get_size ()</title>
<programlisting><link linkend="GtkIconSize">GtkIconSize</link> gtk_icon_source_get_size        (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Obtains the icon size this source applies to. The return value
is only useful/meaningful if the icon size is <emphasis>not</emphasis> wildcarded.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> icon size this source matches.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-size-wildcarded">gtk_icon_source_get_size_wildcarded ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_icon_source_get_size_wildcarded
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Gets the value set by <link linkend="gtk-icon-source-set-size-wildcarded">gtk_icon_source_set_size_wildcarded</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if this icon source is a base for any icon size variant
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-state">gtk_icon_source_get_state ()</title>
<programlisting><link linkend="GtkStateType">GtkStateType</link> gtk_icon_source_get_state      (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Obtains the widget state this icon source applies to. The return
value is only useful/meaningful if the widget state is <emphasis>not</emphasis>
wildcarded.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> widget state this source matches
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-get-state-wildcarded">gtk_icon_source_get_state_wildcarded ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    gtk_icon_source_get_state_wildcarded
                                            (const <link linkend="GtkIconSource">GtkIconSource</link> *source);</programlisting>
<para>
Gets the value set by <link linkend="gtk-icon-source-set-state-wildcarded">gtk_icon_source_set_state_wildcarded</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> if this icon source is a base for any widget state variant
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-new">gtk_icon_source_new ()</title>
<programlisting><link linkend="GtkIconSource">GtkIconSource</link>* gtk_icon_source_new          (void);</programlisting>
<para>
Creates a new <link linkend="GtkIconSource">GtkIconSource</link>. A <link linkend="GtkIconSource">GtkIconSource</link> contains a <link linkend="GdkPixbuf">GdkPixbuf</link> (or
image filename) that serves as the base image for one or more of the
icons in a <link linkend="GtkIconSet">GtkIconSet</link>, along with a specification for which icons in the
icon set will be based on that pixbuf or image file. An icon set contains
a set of icons that represent "the same" logical concept in different states,
different global text directions, and different sizes.
</para>
<para>
So for example a web browser's "Back to Previous Page" icon might
point in a different direction in Hebrew and in English; it might
look different when insensitive; and it might change size depending
on toolbar mode (small/large icons). So a single icon set would
contain all those variants of the icon. <link linkend="GtkIconSet">GtkIconSet</link> contains a list
of <link linkend="GtkIconSource">GtkIconSource</link> from which it can derive specific icon variants in
the set. 
</para>
<para>
In the simplest case, <link linkend="GtkIconSet">GtkIconSet</link> contains one source pixbuf from
which it derives all variants. The convenience function
<link linkend="gtk-icon-set-new-from-pixbuf">gtk_icon_set_new_from_pixbuf</link>() handles this case; if you only have
one source pixbuf, just use that function.
</para>
<para>
If you want to use a different base pixbuf for different icon
variants, you create multiple icon sources, mark which variants
they'll be used to create, and add them to the icon set with
<link linkend="gtk-icon-set-add-source">gtk_icon_set_add_source</link>().
</para>
<para>
By default, the icon source has all parameters wildcarded. That is,
the icon source will be used as the base icon for any desired text
direction, widget state, or icon size.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a new <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-direction">gtk_icon_source_set_direction ()</title>
<programlisting>void        gtk_icon_source_set_direction   (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GtkTextDirection">GtkTextDirection</link> direction);</programlisting>
<para>
Sets the text direction this icon source is intended to be used
with.
</para>
<para>
Setting the text direction on an icon source makes no difference
if the text direction is wildcarded. Therefore, you should usually
call <link linkend="gtk-icon-source-set-direction-wildcarded">gtk_icon_source_set_direction_wildcarded</link>() to un-wildcard it
in addition to calling this function.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>direction</parameter>&nbsp;:</entry>
<entry> text direction this source applies to
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-direction-wildcarded">gtk_icon_source_set_direction_wildcarded ()</title>
<programlisting>void        gtk_icon_source_set_direction_wildcarded
                                            (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
If the text direction is wildcarded, this source can be used
as the base image for an icon in any <link linkend="GtkTextDirection">GtkTextDirection</link>.
If the text direction is not wildcarded, then the
text direction the icon source applies to should be set
with <link linkend="gtk-icon-source-set-direction">gtk_icon_source_set_direction</link>(), and the icon source
will only be used with that text direction.
</para>
<para>
<link linkend="GtkIconSet">GtkIconSet</link> prefers non-wildcarded sources (exact matches) over
wildcarded sources, and will use an exact match when possible.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>setting</parameter>&nbsp;:</entry>
<entry> <literal>TRUE</literal> to wildcard the text direction
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-filename">gtk_icon_source_set_filename ()</title>
<programlisting>void        gtk_icon_source_set_filename    (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             const <link linkend="gchar">gchar</link> *filename);</programlisting>
<para>
Sets the name of an image file to use as a base image when creating
icon variants for <link linkend="GtkIconSet">GtkIconSet</link>. The filename must be absolute.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> image file to use
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-pixbuf">gtk_icon_source_set_pixbuf ()</title>
<programlisting>void        gtk_icon_source_set_pixbuf      (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GdkPixbuf">GdkPixbuf</link> *pixbuf);</programlisting>
<para>
Sets a pixbuf to use as a base image when creating icon variants
for <link linkend="GtkIconSet">GtkIconSet</link>. If an icon source has both a filename and a pixbuf
set, the pixbuf will take priority.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>pixbuf</parameter>&nbsp;:</entry>
<entry> pixbuf to use as a source
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-size">gtk_icon_source_set_size ()</title>
<programlisting>void        gtk_icon_source_set_size        (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GtkIconSize">GtkIconSize</link> size);</programlisting>
<para>
Sets the icon size this icon source is intended to be used
with.
</para>
<para>
Setting the icon size on an icon source makes no difference
if the size is wildcarded. Therefore, you should usually
call <link linkend="gtk-icon-source-set-size-wildcarded">gtk_icon_source_set_size_wildcarded</link>() to un-wildcard it
in addition to calling this function.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> icon size this source applies to
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-size-wildcarded">gtk_icon_source_set_size_wildcarded ()</title>
<programlisting>void        gtk_icon_source_set_size_wildcarded
                                            (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
If the icon size is wildcarded, this source can be used as the base
image for an icon of any size.  If the size is not wildcarded, then
the size the source applies to should be set with
<link linkend="gtk-icon-source-set-size">gtk_icon_source_set_size</link>() and the icon source will only be used
with that specific size.
</para>
<para>
<link linkend="GtkIconSet">GtkIconSet</link> prefers non-wildcarded sources (exact matches) over
wildcarded sources, and will use an exact match when possible.
</para>
<para>
<link linkend="GtkIconSet">GtkIconSet</link> will normally scale wildcarded source images to produce
an appropriate icon at a given size, but will not change the size
of source images that match exactly.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>setting</parameter>&nbsp;:</entry>
<entry> <literal>TRUE</literal> to wildcard the widget state
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-state">gtk_icon_source_set_state ()</title>
<programlisting>void        gtk_icon_source_set_state       (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="GtkStateType">GtkStateType</link> state);</programlisting>
<para>
Sets the widget state this icon source is intended to be used
with.
</para>
<para>
Setting the widget state on an icon source makes no difference
if the state is wildcarded. Therefore, you should usually
call <link linkend="gtk-icon-source-set-state-wildcarded">gtk_icon_source_set_state_wildcarded</link>() to un-wildcard it
in addition to calling this function.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>state</parameter>&nbsp;:</entry>
<entry> widget state this source applies to
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="gtk-icon-source-set-state-wildcarded">gtk_icon_source_set_state_wildcarded ()</title>
<programlisting>void        gtk_icon_source_set_state_wildcarded
                                            (<link linkend="GtkIconSource">GtkIconSource</link> *source,
                                             <link linkend="gboolean">gboolean</link> setting);</programlisting>
<para>
If the widget state is wildcarded, this source can be used as the
base image for an icon in any <link linkend="GtkStateType">GtkStateType</link>.  If the widget state
is not wildcarded, then the state the source applies to should be
set with <link linkend="gtk-icon-source-set-state">gtk_icon_source_set_state</link>() and the icon source will
only be used with that specific state.
</para>
<para>
<link linkend="GtkIconSet">GtkIconSet</link> prefers non-wildcarded sources (exact matches) over
wildcarded sources, and will use an exact match when possible.
</para>
<para>
<link linkend="GtkIconSet">GtkIconSet</link> will normally transform wildcarded source images to
produce an appropriate icon for a given state, for example
lightening an image on prelight, but will not modify source images
that match exactly.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>source</parameter>&nbsp;:</entry>
<entry> a <link linkend="GtkIconSource">GtkIconSource</link>
</entry></row>
<row><entry align="right"><parameter>setting</parameter>&nbsp;:</entry>
<entry> <literal>TRUE</literal> to wildcard the widget state
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
