Current File : //proc/thread-self/root/kunden/usr/share/gtk-doc/html/harfbuzz/object-model-user-data.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>User data: HarfBuzz Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="HarfBuzz Manual">
<link rel="up" href="object-model.html" title="The HarfBuzz object model">
<link rel="prev" href="object-model-lifecycle.html" title="Object lifecycle management">
<link rel="next" href="object-model-blobs.html" title="Blobs">
<meta name="generator" content="GTK-Doc V1.32 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="object-model.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="object-model-lifecycle.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="object-model-blobs.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="object-model-user-data"></a>User data</h2></div></div></div>
<p>
To better integrate with client programs, HarfBuzz's objects
offer a "user data" mechanism that can be used to attach
arbitrary data to the object. User-data attachment can be
useful for tying the lifecycles of various pieces of data
together, or for creating language bindings.
</p>
<p>
Each object type has a <code class="function">set_user_data()</code>
method and a <code class="function">get_user_data()</code> method. The
<code class="function">set_user_data()</code> methods take a client-provided
<code class="literal">key</code> and a pointer,
<code class="literal">user_data</code>, pointing to the data itself. Once
the key-data pair has been attached to the object, the
<code class="function">get_user_data()</code> method can be called with
the key, returning the <code class="function">user_data</code> pointer.
</p>
<p>
The <code class="function">set_user_data()</code> methods also support an
optional <code class="function">destroy</code> callback. Client programs
can set the <code class="function">destroy</code> callback and receive
notification from HarfBuzz whenever the object is destructed.
</p>
<p>
Finally, each <code class="function">set_user_data()</code> method allows
the client program to set a <code class="literal">replace</code> Boolean
indicating whether or not the function call should replace any
existing <code class="literal">user_data</code>
associated with the specified key.
</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>