Imported Upstream version 2.6.7
[platform/upstream/harfbuzz.git] / docs / html / object-model.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>The HarfBuzz object model: 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="pt01.html" title="Part I. User's manual">
9 <link rel="prev" href="aat-shaping.html" title="AAT shaping">
10 <link rel="next" href="object-model-object-types.html" title="Objects in HarfBuzz">
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="pt01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="aat-shaping.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="object-model-object-types.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
21 </tr></table>
22 <div class="chapter">
23 <div class="titlepage"><div><div><h2 class="title">
24 <a name="object-model"></a>The HarfBuzz object model</h2></div></div></div>
25 <div class="toc"><dl class="toc">
26 <dt><span class="section"><a href="object-model.html#object-model-intro">An overview of data types in HarfBuzz</a></span></dt>
27 <dt><span class="section"><a href="object-model-object-types.html">Objects in HarfBuzz</a></span></dt>
28 <dt><span class="section"><a href="object-model-lifecycle.html">Object lifecycle management</a></span></dt>
29 <dt><span class="section"><a href="object-model-user-data.html">User data</a></span></dt>
30 <dt><span class="section"><a href="object-model-blobs.html">Blobs</a></span></dt>
31 </dl></div>
32 <div class="section">
33 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
34 <a name="object-model-intro"></a>An overview of data types in HarfBuzz</h2></div></div></div>
35 <p>
36       HarfBuzz features two kinds of data types: non-opaque,
37       pass-by-value types and opaque, heap-allocated types.  This kind
38       of separation is common in C libraries that have to provide
39       API/ABI compatibility (almost) indefinitely. 
40     </p>
41 <p>
42       <span class="emphasis"><em>Value types:</em></span> The non-opaque, pass-by-value
43       types include integer types, enums, and small structs.  Exposing
44       a struct in the public API makes it impossible to expand the
45       struct in the future. As such, exposing structs is reserved for
46       cases where it’s extremely inefficient to do otherwise.
47     </p>
48 <p>
49       In HarfBuzz, several structs, like <code class="literal">hb_glyph_info_t</code> and
50       <code class="literal">hb_glyph_position_t</code>, fall into that efficiency-sensitive
51       category and are non-opaque.
52     </p>
53 <p>
54       For all non-opaque structs where future extensibility may be
55       necessary, reserved members are included to hold space for
56       possible future members.  As such, it’s important to provide
57       <code class="function">equal()</code>, and <code class="function">hash()</code>
58       methods for such structs, allowing users of the API do
59       effectively deal with the type without having to 
60       adapt their code to future changes. 
61     </p>
62 <p>
63       Important value types provided by HarfBuzz include the structs
64       for working with Unicode code points, glyphs, and tags for font
65       tables and features, as well as the enums for many Unicode and
66       OpenType properties.
67     </p>
68 </div>
69 </div>
70 <div class="footer">
71 <hr>Generated by GTK-Doc V1.32.1</div>
72 </body>
73 </html>