14
14
<refname>GIcon</refname>
15
15
<refpurpose>Interface for icons</refpurpose>
16
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
19
<refsynopsisdiv role="synopsis">
18
<refsynopsisdiv id="GIcon.synopsis" role="synopsis">
20
19
<title role="synopsis.title">Synopsis</title>
24
23
#include <gio/gio.h>
27
25
<link linkend="GIcon-struct">GIcon</link>;
28
26
<link linkend="GIconIface">GIconIface</link>;
29
27
<link linkend="guint">guint</link> <link linkend="g-icon-hash">g_icon_hash</link> (<link linkend="gconstpointer">gconstpointer</link> icon);
30
28
<link linkend="gboolean">gboolean</link> <link linkend="g-icon-equal">g_icon_equal</link> (<link linkend="GIcon">GIcon</link> *icon1,
31
29
<link linkend="GIcon">GIcon</link> *icon2);
37
<refsect1 role="object_hierarchy">
33
<refsect1 id="GIcon.object-hierarchy" role="object_hierarchy">
38
34
<title role="object_hierarchy.title">Object Hierarchy</title>
41
36
<link linkend="GInterface">GInterface</link>
47
<refsect1 role="prerequisites">
41
<refsect1 id="GIcon.prerequisites" role="prerequisites">
48
42
<title role="prerequisites.title">Prerequisites</title>
51
45
<link linkend="GObject">GObject</link>.</para>
55
<refsect1 role="derived_interfaces">
48
<refsect1 id="GIcon.derived-interfaces" role="derived_interfaces">
56
49
<title role="derived_interfaces.title">Known Derived Interfaces</title>
58
51
GIcon is required by
59
52
<link linkend="GLoadableIcon">GLoadableIcon</link>.</para>
64
<refsect1 role="implementations">
56
<refsect1 id="GIcon.implementations" role="implementations">
65
57
<title role="implementations.title">Known Implementations</title>
67
59
GIcon is implemented by
68
<link linkend="GThemedIcon">GThemedIcon</link> and <link linkend="GFileIcon">GFileIcon</link>.</para>
60
<link linkend="GThemedIcon">GThemedIcon</link>, <link linkend="GFileIcon">GFileIcon</link>, <link linkend="GEmblem">GEmblem</link> and <link linkend="GEmblemedIcon">GEmblemedIcon</link>.</para>
75
<refsect1 role="desc">
66
<refsect1 id="GIcon.description" role="desc">
76
67
<title role="desc.title">Description</title>
78
69
<link linkend="GIcon"><type>GIcon</type></link> is a very minimal interface for icons. It provides functions
90
81
To check if two <link linkend="GIcons"><type>GIcons</type></link> are equal, see <link linkend="g-icon-equal"><function>g_icon_equal()</function></link>.</para>
96
<refsect1 role="details">
86
<refsect1 id="GIcon.details" role="details">
97
87
<title role="details.title">Details</title>
99
<title><anchor id="GIcon-struct" role="struct"/>GIcon</title>
100
<indexterm><primary>GIcon</primary></indexterm><programlisting>typedef struct _GIcon GIcon;</programlisting>
88
<refsect2 id="GIcon-struct" role="struct">
90
<indexterm zone="GIcon-struct"><primary sortas="GIcon">GIcon</primary></indexterm><programlisting>typedef struct _GIcon GIcon;</programlisting>
102
92
An abstract type that specifies an icon.</para>
105
94
</para></refsect2>
107
<title><anchor id="GIconIface" role="struct"/>GIconIface</title>
108
<indexterm><primary>GIconIface</primary></indexterm><programlisting>typedef struct {
95
<refsect2 id="GIconIface" role="struct">
96
<title>GIconIface</title>
97
<indexterm zone="GIconIface"><primary sortas="GIconIface">GIconIface</primary></indexterm><programlisting>typedef struct {
109
98
GTypeInterface g_iface;
111
100
/* Virtual Table */
113
guint (*hash) (GIcon *icon);
114
gboolean (*equal) (GIcon *icon1,
102
guint (* hash) (GIcon *icon);
103
gboolean (* equal) (GIcon *icon1,
117
106
</programlisting>
120
109
different systems. See <link linkend="GThemedIcon"><type>GThemedIcon</type></link> and <link linkend="GLoadableIcon"><type>GLoadableIcon</type></link> for
121
110
examples of how to implement this interface.</para>
124
112
</para><variablelist role="struct">
126
<term><link linkend="GTypeInterface">GTypeInterface</link> <structfield>g_iface</structfield>;</term>
114
<term><link linkend="GTypeInterface">GTypeInterface</link> <structfield>g_iface</structfield>;</term>
127
115
<listitem><simpara> The parent interface.
128
116
</simpara></listitem>
131
<term><structfield>hash</structfield> ()</term>
119
<term><structfield>hash</structfield> ()</term>
132
120
<listitem><simpara> A hash for a given <link linkend="GIcon"><type>GIcon</type></link>.
133
121
</simpara></listitem>
136
<term><structfield>equal</structfield> ()</term>
124
<term><structfield>equal</structfield> ()</term>
137
125
<listitem><simpara> Checks if two <link linkend="GIcon"><type>GIcon</type></link><!-- -->s are equal.
138
126
</simpara></listitem>
140
128
</variablelist></refsect2>
142
<title><anchor id="g-icon-hash" role="function"/>g_icon_hash ()</title>
143
<indexterm><primary>g_icon_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_icon_hash (<link linkend="gconstpointer">gconstpointer</link> icon);</programlisting>
129
<refsect2 id="g-icon-hash" role="function">
130
<title>g_icon_hash ()</title>
131
<indexterm zone="g-icon-hash"><primary sortas="g_icon_hash">g_icon_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_icon_hash (<link linkend="gconstpointer">gconstpointer</link> icon);</programlisting>
145
133
Gets a hash for an icon.</para>
148
135
</para><variablelist role="params">
149
<varlistentry><term><parameter>icon</parameter> :</term>
136
<varlistentry><term><parameter>icon</parameter> :</term>
150
137
<listitem><simpara> <link linkend="gconstpointer"><type>gconstpointer</type></link> to an icon object.
151
138
</simpara></listitem></varlistentry>
152
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="guint"><type>guint</type></link> containing a hash for the <parameter>icon</parameter>, suitable for
139
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="guint"><type>guint</type></link> containing a hash for the <parameter>icon</parameter>, suitable for
153
140
use in a <link linkend="GHashTable"><type>GHashTable</type></link> or similar data structure.
154
141
</simpara></listitem></varlistentry>
155
142
</variablelist></refsect2>
157
<title><anchor id="g-icon-equal" role="function"/>g_icon_equal ()</title>
158
<indexterm><primary>g_icon_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_icon_equal (<link linkend="GIcon">GIcon</link> *icon1,
143
<refsect2 id="g-icon-equal" role="function">
144
<title>g_icon_equal ()</title>
145
<indexterm zone="g-icon-equal"><primary sortas="g_icon_equal">g_icon_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_icon_equal (<link linkend="GIcon">GIcon</link> *icon1,
159
146
<link linkend="GIcon">GIcon</link> *icon2);</programlisting>
161
148
Checks if two icons are equal.</para>
164
150
</para><variablelist role="params">
165
<varlistentry><term><parameter>icon1</parameter> :</term>
151
<varlistentry><term><parameter>icon1</parameter> :</term>
166
152
<listitem><simpara> pointer to the first <link linkend="GIcon"><type>GIcon</type></link>.
167
153
</simpara></listitem></varlistentry>
168
<varlistentry><term><parameter>icon2</parameter> :</term>
154
<varlistentry><term><parameter>icon2</parameter> :</term>
169
155
<listitem><simpara> pointer to the second <link linkend="GIcon"><type>GIcon</type></link>.
170
156
</simpara></listitem></varlistentry>
171
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>icon1</parameter> is equal to <parameter>icon2</parameter>. <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
157
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>icon1</parameter> is equal to <parameter>icon2</parameter>. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
172
158
</simpara></listitem></varlistentry>
173
159
</variablelist></refsect2>