~ubuntu-branches/ubuntu/maverick/glib2.0/maverick

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Caches.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-08-17 16:13:18 UTC
  • mfrom: (1.54.1 upstream) (3.4.24 experimental)
  • Revision ID: james.westby@ubuntu.com-20100817161318-34xg2wch15l3wrsq
Tags: 2.25.14-1ubuntu1
Resync on Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
9
9
<link rel="prev" href="glib-Relations-and-Tuples.html" title="Relations and Tuples">
10
10
<link rel="next" href="glib-Memory-Allocators.html" title="Memory Allocators">
11
 
<meta name="generator" content="GTK-Doc V1.15.1 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
</head>
14
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
26
26
                  <a href="#glib-Caches.description" class="shortcut">Description</a>
27
27
</td></tr>
28
28
</table>
29
 
<div class="refentry">
 
29
<div class="refentry" title="Caches">
30
30
<a name="glib-Caches"></a><div class="titlepage"></div>
31
31
<div class="refnamediv"><table width="100%"><tr>
32
32
<td valign="top">
36
36
</td>
37
37
<td valign="top" align="right"></td>
38
38
</tr></table></div>
39
 
<div class="refsynopsisdiv">
 
39
<div class="refsynopsisdiv" title="Synopsis">
40
40
<a name="glib-Caches.synopsis"></a><h2>Synopsis</h2>
41
41
<pre class="synopsis">
42
42
#include &lt;glib.h&gt;
43
43
 
44
44
                    <a class="link" href="glib-Caches.html#GCache" title="GCache">GCache</a>;
45
 
<a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="returnvalue">GCache</span></a> *            <a class="link" href="glib-Caches.html#g-cache-new" title="g_cache_new ()">g_cache_new</a>                         (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()"><span class="type">GCacheNewFunc</span></a> value_new_func</code></em>,
 
45
<a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="returnvalue">GCache</span></a>*             <a class="link" href="glib-Caches.html#g-cache-new" title="g_cache_new ()">g_cache_new</a>                         (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()"><span class="type">GCacheNewFunc</span></a> value_new_func</code></em>,
46
46
                                                         <em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()"><span class="type">GCacheDestroyFunc</span></a> value_destroy_func</code></em>,
47
47
                                                         <em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheDupFunc" title="GCacheDupFunc ()"><span class="type">GCacheDupFunc</span></a> key_dup_func</code></em>,
48
48
                                                         <em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()"><span class="type">GCacheDestroyFunc</span></a> key_destroy_func</code></em>,
67
67
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            (<a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()">*GCacheNewFunc</a>)                    (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> key</code></em>);
68
68
</pre>
69
69
</div>
70
 
<div class="refsect1">
 
70
<div class="refsect1" title="Description">
71
71
<a name="glib-Caches.description"></a><h2>Description</h2>
72
72
<p>
73
73
A <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> allows sharing of complex data structures, in order to
74
74
save system resources.
75
75
</p>
76
76
<p>
77
 
GTK+ uses caches for <span class="type">GtkStyles</span> and <span class="type">GdkGCs</span>. These consume a lot of
78
 
resources, so a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> is used to see if a <span class="type">GtkStyle</span> or <span class="type">GdkGC</span> with
 
77
GTK+ uses caches for <a href="http://library.gnome.org/devel/gtk/unstable/GtkStyle.html"><span class="type">GtkStyles</span></a> and <a href="http://library.gnome.org/devel/gdk/unstable/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGCs</span></a>. These consume a lot of
 
78
resources, so a <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> is used to see if a <a href="http://library.gnome.org/devel/gtk/unstable/GtkStyle.html"><span class="type">GtkStyle</span></a> or <a href="http://library.gnome.org/devel/gdk/unstable/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> with
79
79
the required properties already exists. If it does, then the
80
80
existing object is used instead of creating a new one.
81
81
</p>
84
84
of a particular resource. A <a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> value is the actual resource.
85
85
</p>
86
86
</div>
87
 
<div class="refsect1">
 
87
<div class="refsect1" title="Details">
88
88
<a name="glib-Caches.details"></a><h2>Details</h2>
89
 
<div class="refsect2">
 
89
<div class="refsect2" title="GCache">
90
90
<a name="GCache"></a><h3>GCache</h3>
91
91
<pre class="programlisting">typedef struct _GCache GCache;</pre>
92
92
<p>
96
96
</p>
97
97
</div>
98
98
<hr>
99
 
<div class="refsect2">
 
99
<div class="refsect2" title="g_cache_new ()">
100
100
<a name="g-cache-new"></a><h3>g_cache_new ()</h3>
101
 
<pre class="programlisting"><a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="returnvalue">GCache</span></a> *            g_cache_new                         (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()"><span class="type">GCacheNewFunc</span></a> value_new_func</code></em>,
 
101
<pre class="programlisting"><a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="returnvalue">GCache</span></a>*             g_cache_new                         (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheNewFunc" title="GCacheNewFunc ()"><span class="type">GCacheNewFunc</span></a> value_new_func</code></em>,
102
102
                                                         <em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()"><span class="type">GCacheDestroyFunc</span></a> value_destroy_func</code></em>,
103
103
                                                         <em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheDupFunc" title="GCacheDupFunc ()"><span class="type">GCacheDupFunc</span></a> key_dup_func</code></em>,
104
104
                                                         <em class="parameter"><code><a class="link" href="glib-Caches.html#GCacheDestroyFunc" title="GCacheDestroyFunc ()"><span class="type">GCacheDestroyFunc</span></a> key_destroy_func</code></em>,
165
165
</table></div>
166
166
</div>
167
167
<hr>
168
 
<div class="refsect2">
 
168
<div class="refsect2" title="g_cache_insert ()">
169
169
<a name="g-cache-insert"></a><h3>g_cache_insert ()</h3>
170
170
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            g_cache_insert                      (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> *cache</code></em>,
171
171
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> key</code></em>);</pre>
201
201
</table></div>
202
202
</div>
203
203
<hr>
204
 
<div class="refsect2">
 
204
<div class="refsect2" title="g_cache_remove ()">
205
205
<a name="g-cache-remove"></a><h3>g_cache_remove ()</h3>
206
206
<pre class="programlisting"><span class="returnvalue">void</span>                g_cache_remove                      (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> *cache</code></em>,
207
207
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> value</code></em>);</pre>
227
227
</table></div>
228
228
</div>
229
229
<hr>
230
 
<div class="refsect2">
 
230
<div class="refsect2" title="g_cache_destroy ()">
231
231
<a name="g-cache-destroy"></a><h3>g_cache_destroy ()</h3>
232
232
<pre class="programlisting"><span class="returnvalue">void</span>                g_cache_destroy                     (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> *cache</code></em>);</pre>
233
233
<p>
247
247
</table></div>
248
248
</div>
249
249
<hr>
250
 
<div class="refsect2">
 
250
<div class="refsect2" title="g_cache_key_foreach ()">
251
251
<a name="g-cache-key-foreach"></a><h3>g_cache_key_foreach ()</h3>
252
252
<pre class="programlisting"><span class="returnvalue">void</span>                g_cache_key_foreach                 (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> *cache</code></em>,
253
253
                                                         <em class="parameter"><code><a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()"><span class="type">GHFunc</span></a> func</code></em>,
283
283
</table></div>
284
284
</div>
285
285
<hr>
286
 
<div class="refsect2">
 
286
<div class="refsect2" title="g_cache_value_foreach ()">
287
287
<a name="g-cache-value-foreach"></a><h3>g_cache_value_foreach ()</h3>
288
288
<pre class="programlisting"><span class="returnvalue">void</span>                g_cache_value_foreach               (<em class="parameter"><code><a class="link" href="glib-Caches.html#GCache" title="GCache"><span class="type">GCache</span></a> *cache</code></em>,
289
289
                                                         <em class="parameter"><code><a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()"><span class="type">GHFunc</span></a> func</code></em>,
290
290
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
291
 
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
291
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
292
292
<h3 class="title">Warning</h3>
293
293
<p><code class="literal">g_cache_value_foreach</code> has been deprecated since version 2.10 and should not be used in newly-written code. The reason is that it passes pointers to internal
294
294
                 data structures to <em class="parameter"><code>func</code></em>; use <a class="link" href="glib-Caches.html#g-cache-key-foreach" title="g_cache_key_foreach ()"><code class="function">g_cache_key_foreach()</code></a>
319
319
</table></div>
320
320
</div>
321
321
<hr>
322
 
<div class="refsect2">
 
322
<div class="refsect2" title="GCacheDestroyFunc ()">
323
323
<a name="GCacheDestroyFunc"></a><h3>GCacheDestroyFunc ()</h3>
324
324
<pre class="programlisting"><span class="returnvalue">void</span>                (*GCacheDestroyFunc)                (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> value</code></em>);</pre>
325
325
<p>
338
338
</table></div>
339
339
</div>
340
340
<hr>
341
 
<div class="refsect2">
 
341
<div class="refsect2" title="GCacheDupFunc ()">
342
342
<a name="GCacheDupFunc"></a><h3>GCacheDupFunc ()</h3>
343
343
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            (*GCacheDupFunc)                    (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> value</code></em>);</pre>
344
344
<p>
365
365
</table></div>
366
366
</div>
367
367
<hr>
368
 
<div class="refsect2">
 
368
<div class="refsect2" title="GCacheNewFunc ()">
369
369
<a name="GCacheNewFunc"></a><h3>GCacheNewFunc ()</h3>
370
370
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            (*GCacheNewFunc)                    (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> key</code></em>);</pre>
371
371
<p>
393
393
</div>
394
394
<div class="footer">
395
395
<hr>
396
 
          Generated by GTK-Doc V1.15.1</div>
 
396
          Generated by GTK-Doc V1.15</div>
397
397
</body>
398
398
</html>
 
 
b'\\ No newline at end of file'