<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Serializable Interface: JSON-GLib Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="JSON-GLib Reference Manual"> <link rel="up" href="json-advanced.html" title="Part IV. JSON-GLib Advanced API"> <link rel="prev" href="json-glib-GObject-Serialization.html" title="GObject Serialization"> <link rel="next" href="json-glib-Boxed-Types-Serialization.html" title="Boxed Types Serialization"> <meta name="generator" content="GTK-Doc V1.25 (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"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#json-glib-Serializable-Interface.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> <a href="#json-glib-Serializable-Interface.object-hierarchy" class="shortcut">Object Hierarchy</a></span> </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="json-advanced.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="json-glib-GObject-Serialization.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <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> </tr></table> <div class="refentry"> <a name="json-glib-Serializable-Interface"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="json-glib-Serializable-Interface.top_of_page"></a>Serializable Interface</span></h2> <p>Serializable Interface — Interface for serialize and deserialize special GObjects</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="json-glib-Serializable-Interface.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_return"> <col class="functions_name"> </colgroup> <tbody> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <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> </td> </tr> <tr> <td class="function_type"> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> </td> <td class="function_name"> <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> </td> </tr> <tr> <td class="function_type"> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="returnvalue">GParamSpec</span></a> * </td> <td class="function_name"> <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> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <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> </td> </tr> <tr> <td class="function_type"> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="returnvalue">GParamSpec</span></a> ** </td> <td class="function_name"> <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> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <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> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <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> </td> </tr> <tr> <td class="function_type"> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> </td> <td class="function_name"> <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> </td> </tr> </tbody> </table></div> </div> <a name="JsonSerializable"></a><div class="refsect1"> <a name="json-glib-Serializable-Interface.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="name"> <col class="description"> </colgroup> <tbody><tr> <td class="datatype_keyword">struct</td> <td class="function_name"><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface" title="struct JsonSerializableIface">JsonSerializableIface</a></td> </tr></tbody> </table></div> </div> <div class="refsect1"> <a name="json-glib-Serializable-Interface.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="screen"> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/GTypeModule.html">GInterface</a> <span class="lineart">╰──</span> JsonSerializable </pre> </div> <div class="refsect1"> <a name="json-glib-Serializable-Interface.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <json-glib/json-glib.h> </pre> </div> <div class="refsect1"> <a name="json-glib-Serializable-Interface.description"></a><h2>Description</h2> <p><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> is an interface for <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> classes that allows controlling how the class is going to be serialized 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 <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> </div> <div class="refsect1"> <a name="json-glib-Serializable-Interface.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="json-serializable-serialize-property"></a><h3>json_serializable_serialize_property ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * 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>, <em class="parameter"><code>const <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property_name</code></em>, <em class="parameter"><code>const <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>);</pre> <p>Asks a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> implementation to serialize a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property into a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> object.</p> <div class="refsect3"> <a name="json-serializable-serialize-property.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <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> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_name</p></td> <td class="parameter_description"><p>the name of the property</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>the value of the property</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>pspec</p></td> <td class="parameter_description"><p>a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="json-serializable-serialize-property.returns"></a><h4>Returns</h4> <p> a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the serialized property</p> </div> </div> <hr> <div class="refsect2"> <a name="json-serializable-deserialize-property"></a><h3>json_serializable_deserialize_property ()</h3> <pre class="programlisting"><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> json_serializable_deserialize_property (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>, <em class="parameter"><code>const <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property_name</code></em>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>, <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> <p>Asks a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> implementation to deserialize the property contained inside <em class="parameter"><code>property_node</code></em> into <em class="parameter"><code>value</code></em> .</p> <div class="refsect3"> <a name="json-serializable-deserialize-property.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_name</p></td> <td class="parameter_description"><p>the name of the property</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p> a pointer to an uninitialized <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a>. </p></td> <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> </tr> <tr> <td class="parameter_name"><p>pspec</p></td> <td class="parameter_description"><p>a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_node</p></td> <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> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="json-serializable-deserialize-property.returns"></a><h4>Returns</h4> <p> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the property was successfully deserialized.</p> </div> </div> <hr> <div class="refsect2"> <a name="json-serializable-find-property"></a><h3>json_serializable_find_property ()</h3> <pre class="programlisting"><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="returnvalue">GParamSpec</span></a> * 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>, <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre> <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 the <em class="parameter"><code>serializable</code></em> instance. *</p> <div class="refsect3"> <a name="json-serializable-find-property.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>name</p></td> <td class="parameter_description"><p>the name of the property</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="json-serializable-find-property.returns"></a><h4>Returns</h4> <p> the <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> for the property or <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no property was found. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p> </div> <hr> <div class="refsect2"> <a name="json-serializable-get-property"></a><h3>json_serializable_get_property ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> 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>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> <p>Calls the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.get-property"><code class="function">JsonSerializableIface.get_property()</code></a> implementation on the <em class="parameter"><code>serializable</code></em> instance.</p> <div class="refsect3"> <a name="json-serializable-get-property.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>pspec</p></td> <td class="parameter_description"><p>a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p> return location for the property value. </p></td> <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> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p> </div> <hr> <div class="refsect2"> <a name="json-serializable-list-properties"></a><h3>json_serializable_list_properties ()</h3> <pre class="programlisting"><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="returnvalue">GParamSpec</span></a> ** 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>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *n_pspecs</code></em>);</pre> <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 the <em class="parameter"><code>serializable</code></em> instance.</p> <div class="refsect3"> <a name="json-serializable-list-properties.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>n_pspecs</p></td> <td class="parameter_description"><p> return location for the length of the array of <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> returned by the function. </p></td> <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> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="json-serializable-list-properties.returns"></a><h4>Returns</h4> <p> an array of <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a>. Use <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> to free the array when done. </p> <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> </div> <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p> </div> <hr> <div class="refsect2"> <a name="json-serializable-set-property"></a><h3>json_serializable_set_property ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> 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>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>, <em class="parameter"><code>const <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>);</pre> <p>Calls the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.set-property"><code class="function">JsonSerializableIface.set_property()</code></a> implementation on the <em class="parameter"><code>serializable</code></em> instance.</p> <div class="refsect3"> <a name="json-serializable-set-property.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>pspec</p></td> <td class="parameter_description"><p>a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>the property value to set</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix08.html#api-index-0.14">0.14</a></p> </div> <hr> <div class="refsect2"> <a name="json-serializable-default-serialize-property"></a><h3>json_serializable_default_serialize_property ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_serializable_default_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>, <em class="parameter"><code>const <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property_name</code></em>, <em class="parameter"><code>const <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>);</pre> <p>Calls the default implementation of the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.serialize-property"><code class="function">JsonSerializableIface.serialize_property()</code></a> virtual function.</p> <p>This function can be used inside a custom implementation of the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializableIface.serialize-property"><code class="function">JsonSerializableIface.serialize_property()</code></a> virtual function in lieu of calling the default implementation through <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Type-Information.html#g-type-default-interface-peek"><code class="function">g_type_default_interface_peek()</code></a>:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7</pre></td> <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> <span class="usertype">JsonNode</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">node</span><span class="symbol">;</span> <span class="normal">iface </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Type-Information.html#g-type-default-interface-peek">g_type_default_interface_peek</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">JSON_TYPE_SERIALIZABLE</span><span class="symbol">);</span> <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> <span class="normal"> value</span><span class="symbol">,</span> <span class="normal"> pspec</span><span class="symbol">);</span></pre></td> </tr> </tbody> </table> </div> <p></p> <div class="refsect3"> <a name="json-serializable-default-serialize-property.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <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> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_name</p></td> <td class="parameter_description"><p>the name of the property</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>the value of the property</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>pspec</p></td> <td class="parameter_description"><p>a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="json-serializable-default-serialize-property.returns"></a><h4>Returns</h4> <p> a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> containing the serialized property. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p> </div> <hr> <div class="refsect2"> <a name="json-serializable-default-deserialize-property"></a><h3>json_serializable_default_deserialize_property ()</h3> <pre class="programlisting"><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> json_serializable_default_deserialize_property (<em class="parameter"><code><a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> *serializable</code></em>, <em class="parameter"><code>const <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *property_name</code></em>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>, <em class="parameter"><code><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>, <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> <p>Calls the default implementation of the <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a> <code class="function">deserialize_property()</code> virtual function</p> <p>This function can be used inside a custom implementation of the <code class="function">deserialize_property()</code> virtual function in lieu of:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7 8</pre></td> <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> <span class="usertype">gboolean</span><span class="normal"> res</span><span class="symbol">;</span> <span class="normal">iface </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Type-Information.html#g-type-default-interface-peek">g_type_default_interface_peek</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">JSON_TYPE_SERIALIZABLE</span><span class="symbol">);</span> <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> <span class="normal"> value</span><span class="symbol">,</span> <span class="normal"> pspec</span><span class="symbol">,</span> <span class="normal"> property_node</span><span class="symbol">);</span></pre></td> </tr> </tbody> </table> </div> <p></p> <div class="refsect3"> <a name="json-serializable-default-deserialize-property.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>serializable</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-Serializable-Interface.html#JsonSerializable"><span class="type">JsonSerializable</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_name</p></td> <td class="parameter_description"><p>the name of the property</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a pointer to an uninitialized <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>pspec</p></td> <td class="parameter_description"><p>a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_node</p></td> <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> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="json-serializable-default-deserialize-property.returns"></a><h4>Returns</h4> <p> <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the property was successfully deserialized.</p> </div> <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p> </div> </div> <div class="refsect1"> <a name="json-glib-Serializable-Interface.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="JsonSerializableIface"></a><h3>struct JsonSerializableIface</h3> <pre class="programlisting">struct JsonSerializableIface { JsonNode *(* serialize_property) (JsonSerializable *serializable, const gchar *property_name, const GValue *value, GParamSpec *pspec); gboolean (* deserialize_property) (JsonSerializable *serializable, const gchar *property_name, GValue *value, GParamSpec *pspec, JsonNode *property_node); GParamSpec * (* find_property) (JsonSerializable *serializable, const char *name); GParamSpec **(* list_properties) (JsonSerializable *serializable, guint *n_pspecs); void (* set_property) (JsonSerializable *serializable, GParamSpec *pspec, const GValue *value); void (* get_property) (JsonSerializable *serializable, GParamSpec *pspec, GValue *value); }; </pre> <p>Interface that allows serializing and deserializing <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> instances 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> function will check if the passed <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> implements this interface, so it can also be used to override the default property serialization sequence.</p> <div class="refsect3"> <a name="JsonSerializableIface.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="struct_members_name"> <col class="struct_members_description"> <col width="200px" class="struct_members_annotations"> </colgroup> <tbody> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.serialize-property"></a>serialize_property</code></em> ()</p></td> <td class="struct_member_description"><p>virtual function for serializing a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property into a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.deserialize-property"></a>deserialize_property</code></em> ()</p></td> <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> into a <a href="/home/vagrant/ruby-gnome2.win64/glib2/vendor/local/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.find-property"></a>find_property</code></em> ()</p></td> <td class="struct_member_description"><p>virtual function for finding a property definition using its name</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.list-properties"></a>list_properties</code></em> ()</p></td> <td class="struct_member_description"><p>virtual function for listing the installed property definitions</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.set-property"></a>set_property</code></em> ()</p></td> <td class="struct_member_description"><p>virtual function for setting a property</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><em class="structfield"><code><a name="JsonSerializableIface.get-property"></a>get_property</code></em> ()</p></td> <td class="struct_member_description"><p>virtual function for getting a property</p></td> <td class="struct_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.25</div> </body> </html>