"Initial commit to Gerrit"
[profile/ivi/cogl.git] / doc / reference / cogl-2.0-experimental / html / cogl-2.0-experimental-The-Object-Interface.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 Object Interface</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Cogl 2.0 Reference Manual">
8 <link rel="up" href="ch01.html" title="Cogl - a modern 3D graphics API">
9 <link rel="prev" href="ch01.html" title="Cogl - a modern 3D graphics API">
10 <link rel="next" href="cogl-2.0-experimental-The-Top-Level-Context.html" title="The Top-Level Context">
11 <meta name="generator" content="GTK-Doc V1.18.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="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Cogl 2.0 Reference Manual</th>
21 <td><a accesskey="n" href="cogl-2.0-experimental-The-Top-Level-Context.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#cogl-2.0-experimental-The-Object-Interface.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#cogl-2.0-experimental-The-Object-Interface.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="cogl-2.0-experimental-The-Object-Interface"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="cogl-2.0-experimental-The-Object-Interface.top_of_page"></a>The Object Interface</span></h2>
34 <p>The Object Interface</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="cogl-2.0-experimental-The-Object-Interface.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">                    <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject">CoglObject</a>;
41 <span class="returnvalue">void</span> *              <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-ref" title="cogl_object_ref ()">cogl_object_ref</a>                     (<em class="parameter"><code><span class="type">void</span> *object</code></em>);
42 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-unref" title="cogl_object_unref ()">cogl_object_unref</a>                   (<em class="parameter"><code><span class="type">void</span> *object</code></em>);
43 <span class="returnvalue">void</span> *              <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-get-user-data" title="cogl_object_get_user_data ()">cogl_object_get_user_data</a>           (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a> *object</code></em>,
44                                                          <em class="parameter"><code><span class="type">CoglUserDataKey</span> *key</code></em>);
45 <span class="returnvalue">void</span>                <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-set-user-data" title="cogl_object_set_user_data ()">cogl_object_set_user_data</a>           (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a> *object</code></em>,
46                                                          <em class="parameter"><code><span class="type">CoglUserDataKey</span> *key</code></em>,
47                                                          <em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
48                                                          <em class="parameter"><code><span class="type">CoglUserDataDestroyCallback</span> destroy</code></em>);
49 </pre>
50 </div>
51 <div class="refsect1">
52 <a name="cogl-2.0-experimental-The-Object-Interface.description"></a><h2>Description</h2>
53 </div>
54 <div class="refsect1">
55 <a name="cogl-2.0-experimental-The-Object-Interface.details"></a><h2>Details</h2>
56 <div class="refsect2">
57 <a name="CoglObject"></a><h3>CoglObject</h3>
58 <pre class="programlisting">typedef struct _CoglObject CoglObject;</pre>
59 </div>
60 <hr>
61 <div class="refsect2">
62 <a name="cogl-object-ref"></a><h3>cogl_object_ref ()</h3>
63 <pre class="programlisting"><span class="returnvalue">void</span> *              cogl_object_ref                     (<em class="parameter"><code><span class="type">void</span> *object</code></em>);</pre>
64 <p>
65 Increases the reference count of <em class="parameter"><code>handle</code></em> by 1
66 </p>
67 <div class="variablelist"><table border="0">
68 <col align="left" valign="top">
69 <tbody>
70 <tr>
71 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
72 <td>a <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a>
73 </td>
74 </tr>
75 <tr>
76 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
77 <td>the <em class="parameter"><code>object</code></em>, with its reference count increased</td>
78 </tr>
79 </tbody>
80 </table></div>
81 </div>
82 <hr>
83 <div class="refsect2">
84 <a name="cogl-object-unref"></a><h3>cogl_object_unref ()</h3>
85 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_object_unref                   (<em class="parameter"><code><span class="type">void</span> *object</code></em>);</pre>
86 <p>
87 Drecreases the reference count of <em class="parameter"><code>object</code></em> by 1; if the reference
88 count reaches 0, the resources allocated by <em class="parameter"><code>object</code></em> will be freed
89 </p>
90 <div class="variablelist"><table border="0">
91 <col align="left" valign="top">
92 <tbody><tr>
93 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
94 <td>a <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a>
95 </td>
96 </tr></tbody>
97 </table></div>
98 </div>
99 <hr>
100 <div class="refsect2">
101 <a name="cogl-object-get-user-data"></a><h3>cogl_object_get_user_data ()</h3>
102 <pre class="programlisting"><span class="returnvalue">void</span> *              cogl_object_get_user_data           (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a> *object</code></em>,
103                                                          <em class="parameter"><code><span class="type">CoglUserDataKey</span> *key</code></em>);</pre>
104 <p>
105 Finds the user data previously associated with <em class="parameter"><code>object</code></em> using
106 the given <em class="parameter"><code>key</code></em>. If no user data has been associated with <em class="parameter"><code>object</code></em>
107 for the given <em class="parameter"><code>key</code></em> this function returns NULL.
108 </p>
109 <div class="variablelist"><table border="0">
110 <col align="left" valign="top">
111 <tbody>
112 <tr>
113 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
114 <td>The object with associated private data to query</td>
115 </tr>
116 <tr>
117 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
118 <td>The address of a <span class="type">CoglUserDataKey</span> which provides a unique value
119 with which to index the private data.</td>
120 </tr>
121 <tr>
122 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
123 <td>The user data previously associated
124 with <em class="parameter"><code>object</code></em> using the given <em class="parameter"><code>key</code></em>; or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no associated
125 data is found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
126 </td>
127 </tr>
128 </tbody>
129 </table></div>
130 <p class="since">Since 1.4</p>
131 </div>
132 <hr>
133 <div class="refsect2">
134 <a name="cogl-object-set-user-data"></a><h3>cogl_object_set_user_data ()</h3>
135 <pre class="programlisting"><span class="returnvalue">void</span>                cogl_object_set_user_data           (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a> *object</code></em>,
136                                                          <em class="parameter"><code><span class="type">CoglUserDataKey</span> *key</code></em>,
137                                                          <em class="parameter"><code><span class="type">void</span> *user_data</code></em>,
138                                                          <em class="parameter"><code><span class="type">CoglUserDataDestroyCallback</span> destroy</code></em>);</pre>
139 <p>
140 Associates some private <em class="parameter"><code>user_data</code></em> with a given <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#CoglObject" title="CoglObject"><span class="type">CoglObject</span></a>. To
141 later remove the association call <a class="link" href="cogl-2.0-experimental-The-Object-Interface.html#cogl-object-set-user-data" title="cogl_object_set_user_data ()"><code class="function">cogl_object_set_user_data()</code></a> with
142 the same <em class="parameter"><code>key</code></em> but NULL for the <em class="parameter"><code>user_data</code></em>.
143 </p>
144 <div class="variablelist"><table border="0">
145 <col align="left" valign="top">
146 <tbody>
147 <tr>
148 <td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
149 <td>The object to associate private data with</td>
150 </tr>
151 <tr>
152 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
153 <td>The address of a <span class="type">CoglUserDataKey</span> which provides a unique value
154 with which to index the private data.</td>
155 </tr>
156 <tr>
157 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
158 <td>The data to associate with the given object,
159 or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove a previous association.</td>
160 </tr>
161 <tr>
162 <td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
163 <td>A <span class="type">CoglUserDataDestroyCallback</span> to call if the object is
164 destroyed or if the association is removed by later setting
165 <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> data for the same key.</td>
166 </tr>
167 </tbody>
168 </table></div>
169 <p class="since">Since 1.4</p>
170 </div>
171 </div>
172 </div>
173 <div class="footer">
174 <hr>
175           Generated by GTK-Doc V1.18.1</div>
176 </body>
177 </html>