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

<refnamediv>
<refname>GThemedIcon</refname>
<refpurpose>Icon theming support</refpurpose>
</refnamediv>

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

<synopsis>

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

                    <link linkend="GThemedIcon-struct">GThemedIcon</link>;
<link linkend="GIcon">GIcon</link> *             <link linkend="g-themed-icon-new">g_themed_icon_new</link>                   (const <link linkend="char">char</link> *iconname);
<link linkend="GIcon">GIcon</link> *             <link linkend="g-themed-icon-new-from-names">g_themed_icon_new_from_names</link>        (<link linkend="char">char</link> **iconnames,
                                                         <link linkend="int">int</link> len);
<link linkend="GIcon">GIcon</link> *             <link linkend="g-themed-icon-new-with-default-fallbacks">g_themed_icon_new_with_default_fallbacks</link>
                                                        (const <link linkend="char">char</link> *iconname);
<link linkend="void">void</link>                <link linkend="g-themed-icon-prepend-name">g_themed_icon_prepend_name</link>          (<link linkend="GThemedIcon">GThemedIcon</link> *icon,
                                                         const <link linkend="char">char</link> *iconname);
<link linkend="void">void</link>                <link linkend="g-themed-icon-append-name">g_themed_icon_append_name</link>           (<link linkend="GThemedIcon">GThemedIcon</link> *icon,
                                                         const <link linkend="char">char</link> *iconname);
const <link linkend="gchar">gchar</link>* const * <link linkend="g-themed-icon-get-names">g_themed_icon_get_names</link>            (<link linkend="GThemedIcon">GThemedIcon</link> *icon);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GThemedIcon.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GThemedIcon
</synopsis>
</refsect1>



<refsect1 id="GThemedIcon.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GThemedIcon implements
 <link linkend="GIcon">GIcon</link>.</para>
</refsect1>


<refsect1 id="GThemedIcon.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
  &quot;<link linkend="GThemedIcon--name">name</link>&quot;                     <link linkend="gchar">gchar</link>*                : Write / Construct Only
  &quot;<link linkend="GThemedIcon--names">names</link>&quot;                    <link linkend="GStrv">GStrv</link>*                : Read / Write / Construct Only
  &quot;<link linkend="GThemedIcon--use-default-fallbacks">use-default-fallbacks</link>&quot;    <link linkend="gboolean">gboolean</link>              : Read / Write / Construct Only
</synopsis>
</refsect1>



<refsect1 id="GThemedIcon.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GThemedIcon"><type>GThemedIcon</type></link> is an implementation of <link linkend="GIcon"><type>GIcon</type></link> that supports icon themes.
<link linkend="GThemedIcon"><type>GThemedIcon</type></link> contains a list of all of the icons present in an icon
theme, so that icons can be looked up quickly. <link linkend="GThemedIcon"><type>GThemedIcon</type></link> does
not provide actual pixmaps for icons, just the icon names.
Ideally something like <link linkend="gtk-icon-theme-choose-icon"><function>gtk_icon_theme_choose_icon()</function></link> should be used to
resolve the list of names so that fallback icons work nicely with
themes that inherit other themes.</para>
<para>
</para>
</refsect1>

<refsect1 id="GThemedIcon.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GThemedIcon-struct" role="struct">
<title>GThemedIcon</title>
<indexterm zone="GThemedIcon-struct"><primary sortas="ThemedIcon">GThemedIcon</primary></indexterm><programlisting>typedef struct _GThemedIcon GThemedIcon;</programlisting>
<para>
An implementation of <link linkend="GIcon"><type>GIcon</type></link> for themed icons.</para>
<para>
</para></refsect2>
<refsect2 id="g-themed-icon-new" role="function">
<title>g_themed_icon_new ()</title>
<indexterm zone="g-themed-icon-new"><primary sortas="themed_icon_new">g_themed_icon_new</primary></indexterm><programlisting><link linkend="GIcon">GIcon</link> *             g_themed_icon_new                   (const <link linkend="char">char</link> *iconname);</programlisting>
<para>
Creates a new themed icon for <parameter>iconname</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iconname</parameter>&#160;:</term>
<listitem><simpara> a string containing an icon name.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GThemedIcon"><type>GThemedIcon</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-themed-icon-new-from-names" role="function">
<title>g_themed_icon_new_from_names ()</title>
<indexterm zone="g-themed-icon-new-from-names"><primary sortas="themed_icon_new_from_names">g_themed_icon_new_from_names</primary></indexterm><programlisting><link linkend="GIcon">GIcon</link> *             g_themed_icon_new_from_names        (<link linkend="char">char</link> **iconnames,
                                                         <link linkend="int">int</link> len);</programlisting>
<para>
Creates a new themed icon for <parameter>iconnames</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iconnames</parameter>&#160;:</term>
<listitem><simpara> an array of strings containing icon names.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara> the length of the <parameter>iconnames</parameter> array, or -1 if <parameter>iconnames</parameter> is 
    <link linkend="NULL--CAPS"><literal>NULL</literal></link>-terminated
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GThemedIcon"><type>GThemedIcon</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-themed-icon-new-with-default-fallbacks" role="function">
<title>g_themed_icon_new_with_default_fallbacks ()</title>
<indexterm zone="g-themed-icon-new-with-default-fallbacks"><primary sortas="themed_icon_new_with_default_fallbacks">g_themed_icon_new_with_default_fallbacks</primary></indexterm><programlisting><link linkend="GIcon">GIcon</link> *             g_themed_icon_new_with_default_fallbacks
                                                        (const <link linkend="char">char</link> *iconname);</programlisting>
<para>
Creates a new themed icon for <parameter>iconname</parameter>, and all the names
that can be created by shortening <parameter>iconname</parameter> at '-' characters.
</para>
<para>
In the following example, <parameter>icon1</parameter> and <parameter>icon2</parameter> are equivalent:
<informalexample><programlisting>
const char *names[] = { 
  "gnome-dev-cdrom-audio",
  "gnome-dev-cdrom",
  "gnome-dev",
  "gnome"
};

icon1 = g_themed_icon_new_from_names (names, 4);
icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>iconname</parameter>&#160;:</term>
<listitem><simpara> a string containing an icon name
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new <link linkend="GThemedIcon"><type>GThemedIcon</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-themed-icon-prepend-name" role="function" condition="since:2.18">
<title>g_themed_icon_prepend_name ()</title>
<indexterm zone="g-themed-icon-prepend-name" role="2.18"><primary sortas="themed_icon_prepend_name">g_themed_icon_prepend_name</primary></indexterm><programlisting><link linkend="void">void</link>                g_themed_icon_prepend_name          (<link linkend="GThemedIcon">GThemedIcon</link> *icon,
                                                         const <link linkend="char">char</link> *iconname);</programlisting>
<para>
Prepend a name to the list of icons from within <parameter>icon</parameter>.
</para>
<para>
<note><para>
Note that doing so invalidates the hash computed by prior calls
to <link linkend="g-icon-hash"><function>g_icon_hash()</function></link>.
</para></note></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>icon</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GThemedIcon"><type>GThemedIcon</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iconname</parameter>&#160;:</term>
<listitem><simpara> name of icon to prepend to list of icons from within <parameter>icon</parameter>.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.18</para></refsect2>
<refsect2 id="g-themed-icon-append-name" role="function">
<title>g_themed_icon_append_name ()</title>
<indexterm zone="g-themed-icon-append-name"><primary sortas="themed_icon_append_name">g_themed_icon_append_name</primary></indexterm><programlisting><link linkend="void">void</link>                g_themed_icon_append_name           (<link linkend="GThemedIcon">GThemedIcon</link> *icon,
                                                         const <link linkend="char">char</link> *iconname);</programlisting>
<para>
Append a name to the list of icons from within <parameter>icon</parameter>.
</para>
<para>
<note><para>
Note that doing so invalidates the hash computed by prior calls
to <link linkend="g-icon-hash"><function>g_icon_hash()</function></link>.
</para></note></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>icon</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GThemedIcon"><type>GThemedIcon</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iconname</parameter>&#160;:</term>
<listitem><simpara> name of icon to append to list of icons from within <parameter>icon</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-themed-icon-get-names" role="function">
<title>g_themed_icon_get_names ()</title>
<indexterm zone="g-themed-icon-get-names"><primary sortas="themed_icon_get_names">g_themed_icon_get_names</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>* const * g_themed_icon_get_names            (<link linkend="GThemedIcon">GThemedIcon</link> *icon);</programlisting>
<para>
Gets the names of icons from within <parameter>icon</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>icon</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GThemedIcon"><type>GThemedIcon</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a list of icon names.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>
<refsect1 id="GThemedIcon.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GThemedIcon--name" role="property"><title>The <literal>&quot;name&quot;</literal> property</title>
<indexterm zone="GThemedIcon--name"><primary sortas="ThemedIcon:name">GThemedIcon:name</primary></indexterm><programlisting>  &quot;name&quot;                     <link linkend="gchar">gchar</link>*                : Write / Construct Only</programlisting>
<para>
The icon name.</para>
<para>
</para><para>Default value: NULL</para>
</refsect2>
<refsect2 id="GThemedIcon--names" role="property"><title>The <literal>&quot;names&quot;</literal> property</title>
<indexterm zone="GThemedIcon--names"><primary sortas="ThemedIcon:names">GThemedIcon:names</primary></indexterm><programlisting>  &quot;names&quot;                    <link linkend="GStrv">GStrv</link>*                : Read / Write / Construct Only</programlisting>
<para>
A <link linkend="NULL--CAPS"><literal>NULL</literal></link>-terminated array of icon names.</para>
<para>
</para></refsect2>
<refsect2 id="GThemedIcon--use-default-fallbacks" role="property"><title>The <literal>&quot;use-default-fallbacks&quot;</literal> property</title>
<indexterm zone="GThemedIcon--use-default-fallbacks"><primary sortas="ThemedIcon:use-default-fallbacks">GThemedIcon:use-default-fallbacks</primary></indexterm><programlisting>  &quot;use-default-fallbacks&quot;    <link linkend="gboolean">gboolean</link>              : Read / Write / Construct Only</programlisting>
<para>
Whether to use the default fallbacks found by shortening the icon name
at '-' characters. If the "names" array has more than one element, 
ignores any past the first.
</para>
<para>
For example, if the icon name was "gnome-dev-cdrom-audio", the array 
would become
<informalexample><programlisting>
{
  "gnome-dev-cdrom-audio",
  "gnome-dev-cdrom",
  "gnome-dev",
  "gnome",
  NULL
};
</programlisting></informalexample></para>
<para>
</para><para>Default value: FALSE</para>
</refsect2>

</refsect1>



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

</refentry>
