From: Jürg Billeter Date: Sun, 10 Jan 2010 10:10:49 +0000 (+0100) Subject: json-glib-1.0: Update to 0.10.0 X-Git-Tag: 0.7.10~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69c28b70bb38d236b5680dc077a5ac0102eb9057;p=thirdparty%2Fvala.git json-glib-1.0: Update to 0.10.0 --- diff --git a/vapi/json-glib-1.0.vapi b/vapi/json-glib-1.0.vapi index 47b35dee7..d1db9beaf 100644 --- a/vapi/json-glib-1.0.vapi +++ b/vapi/json-glib-1.0.vapi @@ -7,10 +7,26 @@ namespace Json { public class Array { [CCode (has_construct_function = false)] public Array (); + public void add_array_element (Json.Array value); + public void add_boolean_element (bool value); + public void add_double_element (double value); public void add_element (owned Json.Node node); + public void add_int_element (int64 value); + public void add_null_element (); + public void add_object_element (Json.Object value); + public void add_string_element (string value); + public unowned Json.Node dup_element (uint index_); + public void foreach_element (Json.ArrayForeach func, void* data); + public unowned Json.Array get_array_element (uint index_); + public bool get_boolean_element (uint index_); + public double get_double_element (uint index_); public unowned Json.Node get_element (uint index_); public GLib.List get_elements (); + public int64 get_int_element (uint index_); public uint get_length (); + public bool get_null_element (uint index_); + public unowned Json.Object get_object_element (uint index_); + public unowned string get_string_element (uint index_); public void remove_element (uint index_); public static unowned Json.Array sized_new (uint n_elements); } @@ -24,6 +40,8 @@ namespace Json { [NoAccessorMethod] public uint indent { get; set; } [NoAccessorMethod] + public uint indent_char { get; set; } + [NoAccessorMethod] public bool pretty { get; set; } [NoAccessorMethod] public Json.Node root { owned get; set; } @@ -31,9 +49,6 @@ namespace Json { [Compact] [CCode (copy_function = "json_node_copy", type_id = "JSON_TYPE_NODE", cheader_filename = "json-glib/json-glib.h")] public class Node { - public void* data; - public weak Json.Node parent; - public Json.NodeType type; [CCode (has_construct_function = false)] public Node (Json.NodeType type); public Json.Node copy (); @@ -43,17 +58,20 @@ namespace Json { public unowned Json.Array get_array (); public bool get_boolean (); public double get_double (); - public int get_int (); + public int64 get_int (); + public Json.NodeType get_node_type (); public unowned Json.Object get_object (); public unowned Json.Node get_parent (); public unowned string get_string (); public void get_value (out GLib.Value value); public GLib.Type get_value_type (); + public bool is_null (); public void set_array (Json.Array array); public void set_boolean (bool value); public void set_double (double value); - public void set_int (int value); + public void set_int (int64 value); public void set_object (Json.Object object); + public void set_parent (Json.Node parent); public void set_string (string value); public void set_value (GLib.Value value); public void take_array (owned Json.Array array); @@ -66,12 +84,29 @@ namespace Json { [CCode (has_construct_function = false)] public Object (); public void add_member (string member_name, owned Json.Node node); + public unowned Json.Node dup_member (string member_name); + public void foreach_member (Json.ObjectForeach func, void* data); + public unowned Json.Array get_array_member (string member_name); + public bool get_boolean_member (string member_name); + public double get_double_member (string member_name); + public int64 get_int_member (string member_name); public unowned Json.Node get_member (string member_name); public GLib.List get_members (); + public bool get_null_member (string member_name); + public unowned Json.Object get_object_member (string member_name); public uint get_size (); + public unowned string get_string_member (string member_name); public GLib.List get_values (); public bool has_member (string member_name); public void remove_member (string member_name); + public void set_array_member (string member_name, Json.Array value); + public void set_boolean_member (string member_name, bool value); + public void set_double_member (string member_name, double value); + public void set_int_member (string member_name, int64 value); + public void set_member (string member_name, Json.Node node); + public void set_null_member (string member_name); + public void set_object_member (string member_name, Json.Object value); + public void set_string_member (string member_name, string value); } [CCode (cheader_filename = "json-glib/json-glib.h")] public class Parser : GLib.Object { @@ -82,7 +117,7 @@ namespace Json { public uint get_current_pos (); public unowned Json.Node get_root (); public bool has_assignment (out unowned string variable_name); - public bool load_from_data (string data, size_t length) throws GLib.Error; + public bool load_from_data (string data, ssize_t length) throws GLib.Error; public bool load_from_file (string filename) throws GLib.Error; public virtual signal void array_element (Json.Array array, int index_); public virtual signal void array_end (Json.Array array); @@ -96,30 +131,31 @@ namespace Json { } [CCode (cheader_filename = "json-glib/json-gobject.h")] public interface Serializable { + public bool default_deserialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec, Json.Node property_node); + public unowned Json.Node default_serialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec); public abstract bool deserialize_property (string property_name, out GLib.Value value, GLib.ParamSpec pspec, Json.Node property_node); public abstract Json.Node serialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec); } - [CCode (cprefix = "JSON_NODE_", has_type_id = "0", cheader_filename = "json-glib/json-glib.h")] + [CCode (cprefix = "JSON_NODE_", cheader_filename = "json-glib/json-glib.h")] public enum NodeType { OBJECT, ARRAY, VALUE, NULL } - [CCode (cprefix = "JSON_PARSER_ERROR_", has_type_id = "0", cheader_filename = "json-glib/json-glib.h")] + [CCode (cprefix = "JSON_PARSER_ERROR_", cheader_filename = "json-glib/json-glib.h")] public enum ParserError { PARSE, UNKNOWN } - [CCode (cprefix = "JSON_TOKEN_", has_type_id = "0", cheader_filename = "json-glib/json-glib.h")] - public enum TokenType { - INVALID, - TRUE, - FALSE, - NULL, - VAR, - LAST - } + [CCode (cheader_filename = "json-glib/json-glib.h")] + public delegate void ArrayForeach (Json.Array array, uint index_, Json.Node element_node); + [CCode (cheader_filename = "json-glib/json-glib.h", has_target = false)] + public delegate void* BoxedDeserializeFunc (Json.Node node); + [CCode (cheader_filename = "json-glib/json-glib.h", has_target = false)] + public delegate unowned Json.Node BoxedSerializeFunc (void* boxed); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public delegate void ObjectForeach (Json.Object object, string member_name, Json.Node member_node); [CCode (cheader_filename = "json-glib/json-glib.h")] public const int MAJOR_VERSION; [CCode (cheader_filename = "json-glib/json-glib.h")] @@ -130,8 +166,28 @@ namespace Json { public const int VERSION_HEX; [CCode (cheader_filename = "json-glib/json-glib.h")] public const string VERSION_S; + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static bool boxed_can_deserialize (GLib.Type gboxed_type, Json.NodeType node_type); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static bool boxed_can_serialize (GLib.Type gboxed_type, Json.NodeType node_type); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static void* boxed_deserialize (GLib.Type gboxed_type, Json.Node node); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static void boxed_register_deserialize_func (GLib.Type gboxed_type, Json.NodeType node_type, Json.BoxedDeserializeFunc deserialize_func); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static void boxed_register_serialize_func (GLib.Type gboxed_type, Json.NodeType node_type, Json.BoxedSerializeFunc serialize_func); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static unowned Json.Node boxed_serialize (GLib.Type gboxed_type, void* boxed); [CCode (cheader_filename = "json-glib/json-gobject.h")] public static GLib.Object construct_gobject (GLib.Type gtype, string data, size_t length) throws GLib.Error; + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static unowned GLib.Object gobject_deserialize (GLib.Type gtype, Json.Node node); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static unowned GLib.Object gobject_from_data (GLib.Type gtype, string data, ssize_t length) throws GLib.Error; + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static unowned Json.Node gobject_serialize (GLib.Object gobject); + [CCode (cheader_filename = "json-glib/json-glib.h")] + public static unowned string gobject_to_data (GLib.Object gobject, size_t length); [CCode (cheader_filename = "json-glib/json-gobject.h")] public static string serialize_gobject (GLib.Object gobject, out size_t length); } diff --git a/vapi/packages/json-glib-1.0/json-glib-1.0.defines b/vapi/packages/json-glib-1.0/json-glib-1.0.defines new file mode 100644 index 000000000..b08e68362 --- /dev/null +++ b/vapi/packages/json-glib-1.0/json-glib-1.0.defines @@ -0,0 +1 @@ +-DJSON_COMPILATION diff --git a/vapi/packages/json-glib-1.0/json-glib-1.0.gi b/vapi/packages/json-glib-1.0/json-glib-1.0.gi index 2250edb38..76e1bfeda 100644 --- a/vapi/packages/json-glib-1.0/json-glib-1.0.gi +++ b/vapi/packages/json-glib-1.0/json-glib-1.0.gi @@ -1,6 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -10,6 +54,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -17,7 +90,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -25,6 +149,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -38,12 +225,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -123,7 +338,13 @@ - + + + + + + + @@ -159,6 +380,12 @@ + + + + + + @@ -190,7 +417,7 @@ - + @@ -200,6 +427,13 @@ + + + + + + + @@ -234,9 +468,6 @@ - - - @@ -247,6 +478,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -260,12 +534,33 @@ + + + + + + + + + + + + + + + + + + + + + @@ -295,6 +590,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -302,24 +660,16 @@ - + - + - - - - - - - - @@ -347,6 +697,7 @@ + @@ -384,7 +735,7 @@ - + @@ -462,6 +813,25 @@ + + + + + + + + + + + + + + + + + + + @@ -503,8 +873,8 @@ - + - +