Imported Upstream version 2.6.7
[platform/upstream/harfbuzz.git] / docs / html / object-model-user-data.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>User data: HarfBuzz Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
7 <link rel="home" href="index.html" title="HarfBuzz Manual">
8 <link rel="up" href="object-model.html" title="The HarfBuzz object model">
9 <link rel="prev" href="object-model-lifecycle.html" title="Object lifecycle management">
10 <link rel="next" href="object-model-blobs.html" title="Blobs">
11 <meta name="generator" content="GTK-Doc V1.32.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts"></td>
17 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
18 <td><a accesskey="u" href="object-model.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="object-model-lifecycle.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="object-model-blobs.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="section">
23 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
24 <a name="object-model-user-data"></a>User data</h2></div></div></div>
25 <p>
26       To better integrate with client programs, HarfBuzz's objects
27       offer a "user data" mechanism that can be used to attach
28       arbitrary data to the object.  User-data attachment can be
29       useful for tying the lifecycles of various pieces of data
30       together, or for creating language bindings. 
31     </p>
32 <p>
33       Each object type has a <code class="function">set_user_data()</code>
34       method and a <code class="function">get_user_data()</code> method. The
35       <code class="function">set_user_data()</code> methods take a client-provided
36       <code class="literal">key</code> and a pointer,
37       <code class="literal">user_data</code>, pointing to the data itself. Once
38       the key-data pair has been attached to the object, the
39       <code class="function">get_user_data()</code> method can be called with
40       the key, returning the <code class="function">user_data</code> pointer.
41     </p>
42 <p>
43       The <code class="function">set_user_data()</code> methods also support an
44       optional <code class="function">destroy</code> callback. Client programs
45       can set the <code class="function">destroy</code> callback and receive
46       notification from HarfBuzz whenever the object is destructed.
47     </p>
48 <p>
49       Finally, each <code class="function">set_user_data()</code> method allows
50       the client program to set a <code class="literal">replace</code> Boolean
51       indicating whether or not the function call should replace any
52       existing <code class="literal">user_data</code>
53       associated with the specified key.
54     </p>
55 </div>
56 <div class="footer">
57 <hr>Generated by GTK-Doc V1.32.1</div>
58 </body>
59 </html>