File: libgnomeui-GnomeIconLookup.html

package info (click to toggle)
libgnomeui 2.24.5-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 12,428 kB
  • sloc: ansic: 37,044; sh: 11,082; makefile: 409; xml: 18
file content (235 lines) | stat: -rw-r--r-- 15,753 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GnomeIconLookup</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GNOME UI Library Reference Manual">
<link rel="up" href="fixme.html" title="Miscellaneous Widgets">
<link rel="prev" href="libgnomeui-gnome-icon-entry.html" title="GnomeIconEntry">
<link rel="next" href="GnomeIconSelection.html" title="GnomeIconSelection">
<meta name="generator" content="GTK-Doc V1.16 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libgnomeui-gnome-icon-entry.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="fixme.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GNOME UI Library Reference Manual</th>
<td><a accesskey="n" href="GnomeIconSelection.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libgnomeui-GnomeIconLookup.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libgnomeui-GnomeIconLookup.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libgnomeui-GnomeIconLookup"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgnomeui-GnomeIconLookup.top_of_page"></a>GnomeIconLookup</span></h2>
<p>GnomeIconLookup</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libgnomeui-GnomeIconLookup.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libgnomeui/libgnomeui.h&gt;

enum                <a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupFlags" title="enum GnomeIconLookupFlags">GnomeIconLookupFlags</a>;
enum                <a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupResultFlags" title="enum GnomeIconLookupResultFlags">GnomeIconLookupResultFlags</a>;
<span class="returnvalue">char</span> *              <a class="link" href="libgnomeui-GnomeIconLookup.html#gnome-icon-lookup" title="gnome_icon_lookup ()">gnome_icon_lookup</a>                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/gtk/unstable/GtkIconTheme.html"><span class="type">GtkIconTheme</span></a> *icon_theme</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeThumbnail.html#GnomeThumbnailFactory" title="struct GnomeThumbnailFactory"><span class="type">GnomeThumbnailFactory</span></a> *thumbnail_factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *file_uri</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *custom_icon</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gnome-vfs-2.0/gnome-vfs-2.0-gnome-vfs-file-info.html#GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a> *file_info</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *mime_type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupFlags" title="enum GnomeIconLookupFlags"><span class="type">GnomeIconLookupFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupResultFlags" title="enum GnomeIconLookupResultFlags"><span class="type">GnomeIconLookupResultFlags</span></a> *result</code></em>);
<span class="returnvalue">char</span> *              <a class="link" href="libgnomeui-GnomeIconLookup.html#gnome-icon-lookup-sync" title="gnome_icon_lookup_sync ()">gnome_icon_lookup_sync</a>              (<em class="parameter"><code><a href="http://library.gnome.org/devel/gtk/unstable/GtkIconTheme.html"><span class="type">GtkIconTheme</span></a> *icon_theme</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeThumbnail.html#GnomeThumbnailFactory" title="struct GnomeThumbnailFactory"><span class="type">GnomeThumbnailFactory</span></a> *thumbnail_factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *file_uri</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *custom_icon</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupFlags" title="enum GnomeIconLookupFlags"><span class="type">GnomeIconLookupFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupResultFlags" title="enum GnomeIconLookupResultFlags"><span class="type">GnomeIconLookupResultFlags</span></a> *result</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libgnomeui-GnomeIconLookup.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="libgnomeui-GnomeIconLookup.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GnomeIconLookupFlags"></a><h3>enum GnomeIconLookupFlags</h3>
<pre class="programlisting">typedef enum {
  GNOME_ICON_LOOKUP_FLAGS_NONE = 0,
  GNOME_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT = 1&lt;&lt;0,
  GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES = 1&lt;&lt;1,
  GNOME_ICON_LOOKUP_FLAGS_ALLOW_SVG_AS_THEMSELVES = 1&lt;&lt;2
} GnomeIconLookupFlags;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GnomeIconLookupResultFlags"></a><h3>enum GnomeIconLookupResultFlags</h3>
<pre class="programlisting">typedef enum {
  GNOME_ICON_LOOKUP_RESULT_FLAGS_NONE = 0,
  GNOME_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL = 1&lt;&lt;0
} GnomeIconLookupResultFlags;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gnome-icon-lookup"></a><h3>gnome_icon_lookup ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *              gnome_icon_lookup                   (<em class="parameter"><code><a href="http://library.gnome.org/devel/gtk/unstable/GtkIconTheme.html"><span class="type">GtkIconTheme</span></a> *icon_theme</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeThumbnail.html#GnomeThumbnailFactory" title="struct GnomeThumbnailFactory"><span class="type">GnomeThumbnailFactory</span></a> *thumbnail_factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *file_uri</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *custom_icon</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/gnome-vfs-2.0/gnome-vfs-2.0-gnome-vfs-file-info.html#GnomeVFSFileInfo"><span class="type">GnomeVFSFileInfo</span></a> *file_info</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *mime_type</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupFlags" title="enum GnomeIconLookupFlags"><span class="type">GnomeIconLookupFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupResultFlags" title="enum GnomeIconLookupResultFlags"><span class="type">GnomeIconLookupResultFlags</span></a> *result</code></em>);</pre>
<p>
This function tries to locate an icon in <em class="parameter"><code>icon_theme</code></em> that can be used
to represent the file passed. It can optionally also look for existing
thumbnails. It does no I/O, so the lookup should be relatively fast.
</p>
<p>
If you don't know any information about the file already you can use
<a class="link" href="libgnomeui-GnomeIconLookup.html#gnome-icon-lookup-sync" title="gnome_icon_lookup_sync ()"><code class="function">gnome_icon_lookup_sync()</code></a> which gets this information using gnome-vfs.
</p>
<p>
For backwards compatibility, this function also accepts a GnomeIconTheme
instead of a GtkIconTheme.
</p>
<p>
The following <em class="parameter"><code>flags</code></em> are valid:
</p>
<p>
GNOME_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT - Return the text icon for scripts.
This is useful if you do text embedding in the icons.
</p>
<p>
GNOME_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES - Return the
filename of the filename itself for small images. Only availible if you
pass a thumbnail_factory.
</p>
<p>
Possible <em class="parameter"><code>result</code></em> flags:
</p>
<p>
GNOME_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL - The returned file is a thumbnail.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>icon_theme</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gtk/unstable/GtkIconTheme.html"><span class="type">GtkIconTheme</span></a>, or (deprecated) a <a class="link" href="libgnomeui-GnomeIconTheme.html#GnomeIconTheme" title="GnomeIconTheme"><span class="type">GnomeIconTheme</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>thumbnail_factory</code></em> :</span></p></td>
<td>an optional <a class="link" href="libgnomeui-GnomeThumbnail.html#GnomeThumbnailFactory" title="struct GnomeThumbnailFactory"><span class="type">GnomeThumbnailFactory</span></a> used to look up thumbnails</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>file_uri</code></em> :</span></p></td>
<td>the uri of the file</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>custom_icon</code></em> :</span></p></td>
<td>optionally the name of a custom icon to try</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>file_info</code></em> :</span></p></td>
<td>information about the file from <a href="/usr/share/gtk-doc/html/gnome-vfs-2.0/gnome-vfs-2.0-gnome-vfs-file-info-ops.html#gnome-vfs-get-file-info"><code class="function">gnome_vfs_get_file_info()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mime_type</code></em> :</span></p></td>
<td>the mime type of the icon</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>flags that affect the result of the lookup</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>optionally result flags of the lookups are stored here</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The name of an icon or an absolute filename of an image to
use for the file.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gnome-icon-lookup-sync"></a><h3>gnome_icon_lookup_sync ()</h3>
<pre class="programlisting"><span class="returnvalue">char</span> *              gnome_icon_lookup_sync              (<em class="parameter"><code><a href="http://library.gnome.org/devel/gtk/unstable/GtkIconTheme.html"><span class="type">GtkIconTheme</span></a> *icon_theme</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeThumbnail.html#GnomeThumbnailFactory" title="struct GnomeThumbnailFactory"><span class="type">GnomeThumbnailFactory</span></a> *thumbnail_factory</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *file_uri</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *custom_icon</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupFlags" title="enum GnomeIconLookupFlags"><span class="type">GnomeIconLookupFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="libgnomeui-GnomeIconLookup.html#GnomeIconLookupResultFlags" title="enum GnomeIconLookupResultFlags"><span class="type">GnomeIconLookupResultFlags</span></a> *result</code></em>);</pre>
<p>
This function tries to locate an icon in <em class="parameter"><code>icon_theme</code></em> that can be used
to represent the file passed. See <a class="link" href="libgnomeui-GnomeIconLookup.html#gnome-icon-lookup" title="gnome_icon_lookup ()"><code class="function">gnome_icon_lookup()</code></a> for more information.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>icon_theme</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gtk/unstable/GtkIconTheme.html"><span class="type">GtkIconTheme</span></a>, or (deprecated) a <a class="link" href="libgnomeui-GnomeIconTheme.html#GnomeIconTheme" title="GnomeIconTheme"><span class="type">GnomeIconTheme</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>thumbnail_factory</code></em> :</span></p></td>
<td>an optional <a class="link" href="libgnomeui-GnomeThumbnail.html#GnomeThumbnailFactory" title="struct GnomeThumbnailFactory"><span class="type">GnomeThumbnailFactory</span></a> used to look up thumbnails</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>file_uri</code></em> :</span></p></td>
<td>the uri of the file</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>custom_icon</code></em> :</span></p></td>
<td>optionally the name of a custom icon to try</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>flags that affect the result of the lookup</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td>optionally result flags of the lookups are stored here</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The name of an icon or an absolute filename of an image to
use for the file.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.2</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.16</div>
</body>
</html>