1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Serializable Interface: JSON-GLib Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="JSON-GLib Reference Manual">
8 <link rel="up" href="json-advanced.html" title="Part IV. JSON-GLib Advanced API">
9 <link rel="prev" href="json-glib-GObject-Serialization.html" title="GObject Serialization">
10 <link rel="next" href="json-glib-Boxed-Types-Serialization.html" title="Boxed Types Serialization">
11 <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
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">
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
18 <a href="#json-glib-Serializable-Interface.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
19 <a href="#json-glib-Serializable-Interface.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22 <td><a accesskey="u" href="json-advanced.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23 <td><a accesskey="p" href="json-glib-GObject-Serialization.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24 <td><a accesskey="n" href="json-glib-Boxed-Types-Serialization.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26 <div class="refentry">
27 <a name="json-glib-Serializable-Interface"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
30 <h2><span class="refentrytitle"><a name="json-glib-Serializable-Interface.top_of_page"></a>Serializable Interface</span></h2>
31 <p>Serializable Interface — Interface for serialize and deserialize special GObjects</p>
33 <td class="gallery_image" valign="top" align="right"></td>
35 <div class="refsect1">
36 <a name="json-glib-Serializable-Interface.functions"></a><h2>Functions</h2>
37 <div class="informaltable"><table class="informaltable" width="100%" border="0">
39 <col width="150px" class="functions_return">
40 <col class="functions_name">
44 <td class="function_type">
45 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
47 <td class="function_name">
48 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-serialize-property" title="json_serializable_serialize_property ()">json_serializable_serialize_property</a> <span class="c_punctuation">()</span>
52 <td class="function_type">
53 <span class="returnvalue">gboolean</span>
55 <td class="function_name">
56 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-deserialize-property" title="json_serializable_deserialize_property ()">json_serializable_deserialize_property</a> <span class="c_punctuation">()</span>
60 <td class="function_type">
61 <span class="returnvalue">GParamSpec</span> *
63 <td class="function_name">
64 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-find-property" title="json_serializable_find_property ()">json_serializable_find_property</a> <span class="c_punctuation">()</span>
68 <td class="function_type">
69 <span class="returnvalue">void</span>
71 <td class="function_name">
72 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-get-property" title="json_serializable_get_property ()">json_serializable_get_property</a> <span class="c_punctuation">()</span>
76 <td class="function_type">
77 <span class="returnvalue">GParamSpec</span> **
79 <td class="function_name">
80 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-list-properties" title="json_serializable_list_properties ()">json_serializable_list_properties</a> <span class="c_punctuation">()</span>
84 <td class="function_type">
85 <span class="returnvalue">void</span>
87 <td class="function_name">
88 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-set-property" title="json_serializable_set_property ()">json_serializable_set_property</a> <span class="c_punctuation">()</span>
92 <td class="function_type">
93 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
95 <td class="function_name">
96 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-default-serialize-property" title="json_serializable_default_serialize_property ()">json_serializable_default_serialize_property</a> <span class="c_punctuation">()</span>
100 <td class="function_type">
101 <span class="returnvalue">gboolean</span>
103 <td class="function_name">
104 <a class="link" href="json-glib-Serializable-Interface.html#json-serializable-default-deserialize-property" title="json_serializable_default_deserialize_property ()">json_serializable_default_deserialize_property</a> <span class="c_punctuation">()</span>
110 <a name="JsonSerializable"></a><div class="refsect1">
111 <a name="json-glib-Serializable-Interface.other"></a><h2>Types and Values</h2>
112 <div class="informaltable"><table class="informaltable" width="100%" border="0">
114 <col width="150px" class="name">
115 <col class="description">
118 <td class="datatype_keyword">struct</td>
119 <td class="function_name"><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface" title="struct JsonSerializableIface">JsonSerializableIface</a></td>
123 <div class="refsect1">
124 <a name="json-glib-Serializable-Interface.object-hierarchy"></a><h2>Object Hierarchy</h2>
125 <pre class="screen"> <a href="/home/ebassi/gnome/install/share/gtk-doc/html/gobject/GTypeModule.html">GInterface</a>
126 <span class="lineart">╰──</span> JsonSerializable
129 <div class="refsect1">
130 <a name="json-glib-Serializable-Interface.description"></a><h2>Description</h2>
131 <p><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> is an interface for <span class="type">GObject</span> classes that
132 allows controlling how the class is going to be serialized
133 or deserialized by <a class="link" href="json-glib-GObject-Serialization.html#json-construct-gobject" title="json_construct_gobject ()"><code class="function">json_construct_gobject()</code></a> and
134 <a class="link" href="json-glib-GObject-Serialization.html#json-serialize-gobject" title="json_serialize_gobject ()"><code class="function">json_serialize_gobject()</code></a> respectively.</p>
136 <div class="refsect1">
137 <a name="json-glib-Serializable-Interface.functions_details"></a><h2>Functions</h2>
138 <div class="refsect2">
139 <a name="json-serializable-serialize-property"></a><h3>json_serializable_serialize_property ()</h3>
140 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
141 json_serializable_serialize_property (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
142 <em class="parameter"><code>const <span class="type">gchar</span> *property_name</code></em>,
143 <em class="parameter"><code>const <span class="type">GValue</span> *value</code></em>,
144 <em class="parameter"><code><span class="type">GParamSpec</span> *pspec</code></em>);</pre>
145 <p>Asks a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> implementation to serialize a <span class="type">GObject</span>
146 property into a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> object.</p>
147 <div class="refsect3">
148 <a name="json-serializable-serialize-property.parameters"></a><h4>Parameters</h4>
149 <div class="informaltable"><table class="informaltable" width="100%" border="0">
151 <col width="150px" class="parameters_name">
152 <col class="parameters_description">
153 <col width="200px" class="parameters_annotations">
157 <td class="parameter_name"><p>serializable</p></td>
158 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> object</p></td>
159 <td class="parameter_annotations"> </td>
162 <td class="parameter_name"><p>property_name</p></td>
163 <td class="parameter_description"><p>the name of the property</p></td>
164 <td class="parameter_annotations"> </td>
167 <td class="parameter_name"><p>value</p></td>
168 <td class="parameter_description"><p>the value of the property</p></td>
169 <td class="parameter_annotations"> </td>
172 <td class="parameter_name"><p>pspec</p></td>
173 <td class="parameter_description"><p>a <span class="type">GParamSpec</span></p></td>
174 <td class="parameter_annotations"> </td>
179 <div class="refsect3">
180 <a name="json-serializable-serialize-property.returns"></a><h4>Returns</h4>
181 <p> a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the serialized property</p>
185 <div class="refsect2">
186 <a name="json-serializable-deserialize-property"></a><h3>json_serializable_deserialize_property ()</h3>
187 <pre class="programlisting"><span class="returnvalue">gboolean</span>
188 json_serializable_deserialize_property
189 (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
190 <em class="parameter"><code>const <span class="type">gchar</span> *property_name</code></em>,
191 <em class="parameter"><code><span class="type">GValue</span> *value</code></em>,
192 <em class="parameter"><code><span class="type">GParamSpec</span> *pspec</code></em>,
193 <em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *property_node</code></em>);</pre>
194 <p>Asks a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> implementation to deserialize the
195 property contained inside <em class="parameter"><code>property_node</code></em>
196 into <em class="parameter"><code>value</code></em>
198 <div class="refsect3">
199 <a name="json-serializable-deserialize-property.parameters"></a><h4>Parameters</h4>
200 <div class="informaltable"><table class="informaltable" width="100%" border="0">
202 <col width="150px" class="parameters_name">
203 <col class="parameters_description">
204 <col width="200px" class="parameters_annotations">
208 <td class="parameter_name"><p>serializable</p></td>
209 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td>
210 <td class="parameter_annotations"> </td>
213 <td class="parameter_name"><p>property_name</p></td>
214 <td class="parameter_description"><p>the name of the property</p></td>
215 <td class="parameter_annotations"> </td>
218 <td class="parameter_name"><p>value</p></td>
219 <td class="parameter_description"><p> a pointer to an uninitialized <span class="type">GValue</span>. </p></td>
220 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
223 <td class="parameter_name"><p>pspec</p></td>
224 <td class="parameter_description"><p>a <span class="type">GParamSpec</span></p></td>
225 <td class="parameter_annotations"> </td>
228 <td class="parameter_name"><p>property_node</p></td>
229 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the serialized property</p></td>
230 <td class="parameter_annotations"> </td>
235 <div class="refsect3">
236 <a name="json-serializable-deserialize-property.returns"></a><h4>Returns</h4>
237 <p> <code class="literal">TRUE</code> if the property was successfully deserialized.</p>
241 <div class="refsect2">
242 <a name="json-serializable-find-property"></a><h3>json_serializable_find_property ()</h3>
243 <pre class="programlisting"><span class="returnvalue">GParamSpec</span> *
244 json_serializable_find_property (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
245 <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
246 <p>Calls the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.find-property"><code class="function">JsonSerializableIface.find_property()</code></a> implementation on
247 the <em class="parameter"><code>serializable</code></em>
249 <div class="refsect3">
250 <a name="json-serializable-find-property.parameters"></a><h4>Parameters</h4>
251 <div class="informaltable"><table class="informaltable" width="100%" border="0">
253 <col width="150px" class="parameters_name">
254 <col class="parameters_description">
255 <col width="200px" class="parameters_annotations">
259 <td class="parameter_name"><p>serializable</p></td>
260 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td>
261 <td class="parameter_annotations"> </td>
264 <td class="parameter_name"><p>name</p></td>
265 <td class="parameter_description"><p>the name of the property</p></td>
266 <td class="parameter_annotations"> </td>
271 <div class="refsect3">
272 <a name="json-serializable-find-property.returns"></a><h4>Returns</h4>
273 <p> the <span class="type">GParamSpec</span> for the property
274 or <code class="literal">NULL</code> if no property was found. </p>
275 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
277 <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p>
280 <div class="refsect2">
281 <a name="json-serializable-get-property"></a><h3>json_serializable_get_property ()</h3>
282 <pre class="programlisting"><span class="returnvalue">void</span>
283 json_serializable_get_property (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
284 <em class="parameter"><code><span class="type">GParamSpec</span> *pspec</code></em>,
285 <em class="parameter"><code><span class="type">GValue</span> *value</code></em>);</pre>
286 <p>Calls the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.get-property"><code class="function">JsonSerializableIface.get_property()</code></a> implementation
287 on the <em class="parameter"><code>serializable</code></em>
289 <div class="refsect3">
290 <a name="json-serializable-get-property.parameters"></a><h4>Parameters</h4>
291 <div class="informaltable"><table class="informaltable" width="100%" border="0">
293 <col width="150px" class="parameters_name">
294 <col class="parameters_description">
295 <col width="200px" class="parameters_annotations">
299 <td class="parameter_name"><p>serializable</p></td>
300 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td>
301 <td class="parameter_annotations"> </td>
304 <td class="parameter_name"><p>pspec</p></td>
305 <td class="parameter_description"><p>a <span class="type">GParamSpec</span></p></td>
306 <td class="parameter_annotations"> </td>
309 <td class="parameter_name"><p>value</p></td>
310 <td class="parameter_description"><p> return location for the property value. </p></td>
311 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
316 <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p>
319 <div class="refsect2">
320 <a name="json-serializable-list-properties"></a><h3>json_serializable_list_properties ()</h3>
321 <pre class="programlisting"><span class="returnvalue">GParamSpec</span> **
322 json_serializable_list_properties (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
323 <em class="parameter"><code><span class="type">guint</span> *n_pspecs</code></em>);</pre>
324 <p>Calls the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.list-properties"><code class="function">JsonSerializableIface.list_properties()</code></a> implementation on
325 the <em class="parameter"><code>serializable</code></em>
327 <div class="refsect3">
328 <a name="json-serializable-list-properties.parameters"></a><h4>Parameters</h4>
329 <div class="informaltable"><table class="informaltable" width="100%" border="0">
331 <col width="150px" class="parameters_name">
332 <col class="parameters_description">
333 <col width="200px" class="parameters_annotations">
337 <td class="parameter_name"><p>serializable</p></td>
338 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td>
339 <td class="parameter_annotations"> </td>
342 <td class="parameter_name"><p>n_pspecs</p></td>
343 <td class="parameter_description"><p> return location for the length of the array
344 of <span class="type">GParamSpec</span> returned by the function. </p></td>
345 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
350 <div class="refsect3">
351 <a name="json-serializable-list-properties.returns"></a><h4>Returns</h4>
353 of <span class="type">GParamSpec</span>. Use <code class="function">g_free()</code> to free the array when done. </p>
354 <p><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_pspecs][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span></p>
356 <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p>
359 <div class="refsect2">
360 <a name="json-serializable-set-property"></a><h3>json_serializable_set_property ()</h3>
361 <pre class="programlisting"><span class="returnvalue">void</span>
362 json_serializable_set_property (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
363 <em class="parameter"><code><span class="type">GParamSpec</span> *pspec</code></em>,
364 <em class="parameter"><code>const <span class="type">GValue</span> *value</code></em>);</pre>
365 <p>Calls the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.set-property"><code class="function">JsonSerializableIface.set_property()</code></a> implementation
366 on the <em class="parameter"><code>serializable</code></em>
368 <div class="refsect3">
369 <a name="json-serializable-set-property.parameters"></a><h4>Parameters</h4>
370 <div class="informaltable"><table class="informaltable" width="100%" border="0">
372 <col width="150px" class="parameters_name">
373 <col class="parameters_description">
374 <col width="200px" class="parameters_annotations">
378 <td class="parameter_name"><p>serializable</p></td>
379 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td>
380 <td class="parameter_annotations"> </td>
383 <td class="parameter_name"><p>pspec</p></td>
384 <td class="parameter_description"><p>a <span class="type">GParamSpec</span></p></td>
385 <td class="parameter_annotations"> </td>
388 <td class="parameter_name"><p>value</p></td>
389 <td class="parameter_description"><p>the property value to set</p></td>
390 <td class="parameter_annotations"> </td>
395 <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p>
398 <div class="refsect2">
399 <a name="json-serializable-default-serialize-property"></a><h3>json_serializable_default_serialize_property ()</h3>
400 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
401 json_serializable_default_serialize_property
402 (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
403 <em class="parameter"><code>const <span class="type">gchar</span> *property_name</code></em>,
404 <em class="parameter"><code>const <span class="type">GValue</span> *value</code></em>,
405 <em class="parameter"><code><span class="type">GParamSpec</span> *pspec</code></em>);</pre>
406 <p>Calls the default implementation of the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a>
407 <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.serialize-property"><code class="function">JsonSerializableIface.serialize_property()</code></a> virtual function.</p>
408 <p>This function can be used inside a custom implementation
409 of the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.serialize-property"><code class="function">JsonSerializableIface.serialize_property()</code></a> virtual
410 function in lieu of calling the default implementation
411 through <code class="function">g_type_default_interface_peek()</code>:</p>
412 <div class="informalexample">
413 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
416 <td class="listing_lines" align="right"><pre>1
423 <td class="listing_code"><pre class="programlisting"><span class="usertype">JsonSerializable</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">iface</span><span class="symbol">;</span>
424 <span class="usertype">JsonNode</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">node</span><span class="symbol">;</span>
426 <span class="normal">iface </span><span class="symbol">=</span><span class="normal"> </span><span class="function">g_type_default_interface_peek</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">JSON_TYPE_SERIALIZABLE</span><span class="symbol">);</span>
427 <span class="normal">node </span><span class="symbol">=</span><span class="normal"> iface</span><span class="symbol">-></span><span class="function">serialize_property</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">serializable</span><span class="symbol">,</span><span class="normal"> property_name</span><span class="symbol">,</span>
428 <span class="normal"> value</span><span class="symbol">,</span>
429 <span class="normal"> pspec</span><span class="symbol">);</span></pre></td>
436 <div class="refsect3">
437 <a name="json-serializable-default-serialize-property.parameters"></a><h4>Parameters</h4>
438 <div class="informaltable"><table class="informaltable" width="100%" border="0">
440 <col width="150px" class="parameters_name">
441 <col class="parameters_description">
442 <col width="200px" class="parameters_annotations">
446 <td class="parameter_name"><p>serializable</p></td>
447 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> object</p></td>
448 <td class="parameter_annotations"> </td>
451 <td class="parameter_name"><p>property_name</p></td>
452 <td class="parameter_description"><p>the name of the property</p></td>
453 <td class="parameter_annotations"> </td>
456 <td class="parameter_name"><p>value</p></td>
457 <td class="parameter_description"><p>the value of the property</p></td>
458 <td class="parameter_annotations"> </td>
461 <td class="parameter_name"><p>pspec</p></td>
462 <td class="parameter_description"><p>a <span class="type">GParamSpec</span></p></td>
463 <td class="parameter_annotations"> </td>
468 <div class="refsect3">
469 <a name="json-serializable-default-serialize-property.returns"></a><h4>Returns</h4>
470 <p> a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the serialized
472 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
474 <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p>
477 <div class="refsect2">
478 <a name="json-serializable-default-deserialize-property"></a><h3>json_serializable_default_deserialize_property ()</h3>
479 <pre class="programlisting"><span class="returnvalue">gboolean</span>
480 json_serializable_default_deserialize_property
481 (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>,
482 <em class="parameter"><code>const <span class="type">gchar</span> *property_name</code></em>,
483 <em class="parameter"><code><span class="type">GValue</span> *value</code></em>,
484 <em class="parameter"><code><span class="type">GParamSpec</span> *pspec</code></em>,
485 <em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *property_node</code></em>);</pre>
486 <p>Calls the default implementation of the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a>
487 <code class="function">deserialize_property()</code> virtual function</p>
488 <p>This function can be used inside a custom implementation
489 of the <code class="function">deserialize_property()</code> virtual function in lieu of:</p>
490 <div class="informalexample">
491 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
494 <td class="listing_lines" align="right"><pre>1
502 <td class="listing_code"><pre class="programlisting"><span class="usertype">JsonSerializable</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">iface</span><span class="symbol">;</span>
503 <span class="usertype">gboolean</span><span class="normal"> res</span><span class="symbol">;</span>
505 <span class="normal">iface </span><span class="symbol">=</span><span class="normal"> </span><span class="function">g_type_default_interface_peek</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">JSON_TYPE_SERIALIZABLE</span><span class="symbol">);</span>
506 <span class="normal">res </span><span class="symbol">=</span><span class="normal"> iface</span><span class="symbol">-></span><span class="function">deserialize_property</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">serializable</span><span class="symbol">,</span><span class="normal"> property_name</span><span class="symbol">,</span>
507 <span class="normal"> value</span><span class="symbol">,</span>
508 <span class="normal"> pspec</span><span class="symbol">,</span>
509 <span class="normal"> property_node</span><span class="symbol">);</span></pre></td>
516 <div class="refsect3">
517 <a name="json-serializable-default-deserialize-property.parameters"></a><h4>Parameters</h4>
518 <div class="informaltable"><table class="informaltable" width="100%" border="0">
520 <col width="150px" class="parameters_name">
521 <col class="parameters_description">
522 <col width="200px" class="parameters_annotations">
526 <td class="parameter_name"><p>serializable</p></td>
527 <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td>
528 <td class="parameter_annotations"> </td>
531 <td class="parameter_name"><p>property_name</p></td>
532 <td class="parameter_description"><p>the name of the property</p></td>
533 <td class="parameter_annotations"> </td>
536 <td class="parameter_name"><p>value</p></td>
537 <td class="parameter_description"><p>a pointer to an uninitialized <span class="type">GValue</span></p></td>
538 <td class="parameter_annotations"> </td>
541 <td class="parameter_name"><p>pspec</p></td>
542 <td class="parameter_description"><p>a <span class="type">GParamSpec</span></p></td>
543 <td class="parameter_annotations"> </td>
546 <td class="parameter_name"><p>property_node</p></td>
547 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the serialized property</p></td>
548 <td class="parameter_annotations"> </td>
553 <div class="refsect3">
554 <a name="json-serializable-default-deserialize-property.returns"></a><h4>Returns</h4>
555 <p> <code class="literal">TRUE</code> if the property was successfully deserialized.</p>
557 <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p>
560 <div class="refsect1">
561 <a name="json-glib-Serializable-Interface.other_details"></a><h2>Types and Values</h2>
562 <div class="refsect2">
563 <a name="JsonSerializableIface"></a><h3>struct JsonSerializableIface</h3>
564 <pre class="programlisting">struct JsonSerializableIface {
565 JsonNode *(* serialize_property) (JsonSerializable *serializable,
566 const gchar *property_name,
569 gboolean (* deserialize_property) (JsonSerializable *serializable,
570 const gchar *property_name,
573 JsonNode *property_node);
575 GParamSpec * (* find_property) (JsonSerializable *serializable,
577 GParamSpec **(* list_properties) (JsonSerializable *serializable,
579 void (* set_property) (JsonSerializable *serializable,
581 const GValue *value);
582 void (* get_property) (JsonSerializable *serializable,
587 <p>Interface that allows serializing and deserializing <span class="type">GObject</span> instances
588 with properties storing complex data types. The <a class="link" href="json-glib-GObject-Serialization.html#json-serialize-gobject" title="json_serialize_gobject ()"><code class="function">json_serialize_gobject()</code></a>
589 function will check if the passed <span class="type">GObject</span> implements this interface,
590 so it can also be used to override the default property serialization
592 <div class="refsect3">
593 <a name="JsonSerializableIface.members"></a><h4>Members</h4>
594 <div class="informaltable"><table class="informaltable" width="100%" border="0">
596 <col width="300px" class="struct_members_name">
597 <col class="struct_members_description">
598 <col width="200px" class="struct_members_annotations">
602 <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.serialize-property"></a>serialize_property</code></em> ()</p></td>
603 <td class="struct_member_description"><p>virtual function for serializing a <span class="type">GObject</span> property
604 into a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
605 <td class="struct_member_annotations"> </td>
608 <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.deserialize-property"></a>deserialize_property</code></em> ()</p></td>
609 <td class="struct_member_description"><p>virtual function for deserializing a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>
610 into a <span class="type">GObject</span> property</p></td>
611 <td class="struct_member_annotations"> </td>
614 <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.find-property"></a>find_property</code></em> ()</p></td>
615 <td class="struct_member_description"><p>virtual function for finding a property definition using
617 <td class="struct_member_annotations"> </td>
620 <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.list-properties"></a>list_properties</code></em> ()</p></td>
621 <td class="struct_member_description"><p>virtual function for listing the installed property
623 <td class="struct_member_annotations"> </td>
626 <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.set-property"></a>set_property</code></em> ()</p></td>
627 <td class="struct_member_description"><p>virtual function for setting a property</p></td>
628 <td class="struct_member_annotations"> </td>
631 <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.get-property"></a>get_property</code></em> ()</p></td>
632 <td class="struct_member_description"><p>virtual function for getting a property</p></td>
633 <td class="struct_member_annotations"> </td>
642 <hr>Generated by GTK-Doc V1.25.1</div>