1. 10 Jun, 2021 1 commit
  2. 08 Jun, 2021 1 commit
  3. 11 Mar, 2017 1 commit
  4. 18 Mar, 2014 2 commits
    • Emmanuele Bassi's avatar
      Use compiler annotations to determine symbol visibility · 79466474
      Emmanuele Bassi authored
      Instead of relying on a separate file that requires being update every
      time we add a new public function we should use compiler annotations to
      let the linker know which symbols are public and exported.
      
      In order to achieve this we have to:
      
       * check for the visibility=hidden attribute
       * add -fvisibility=hidden to the linker flags
       * add a macro to annotate all public symbols
      
      While we're at it, we should copy the versioned symbols macro layout
      already used by GLib, GTK+, and other G* libraries, including the
      ability to express the range of allowed versions of JSON-GLib that
      third party code can compile against.
      79466474
    • Emmanuele Bassi's avatar
      docs: Port to MarkDown · 20c861f0
      Emmanuele Bassi authored
      Drop the DocBook documentation, and move everything to the MarkDown
      format used by modern gtk-doc.
      20c861f0
  5. 14 Jan, 2012 1 commit
  6. 17 Oct, 2011 1 commit
  7. 15 Jun, 2011 1 commit
  8. 01 Jun, 2011 1 commit
  9. 28 Nov, 2009 1 commit
    • Emmanuele Bassi's avatar
      docs: Fix argument name mismatch · 4445bdb0
      Emmanuele Bassi authored
      gtk-doc complains that the argument name in the header does not match
      the one in the documentation annotation for the GBoxed deserialization
      function registration.
      4445bdb0
  10. 23 Nov, 2009 1 commit
    • Emmanuele Bassi's avatar
      boxed: Split (de)serialization registration · 3cf919e9
      Emmanuele Bassi authored
      A GBoxed type defined as:
      
        struct Boxed {
          int foo;
          gboolean bar;
          int baz;
        };
      
      Can be represented either by a JSON object:
      
        {
          "foo" : 1,
          "bar" : true,
          "baz" : 3
        }
      
      Or by a JSON array:
      
        [ 1, true, 3 ]
      
      The current function for registering a serialization and a
      deserialization pair does not allow registering more than one
      deserialization function - which means that there can only be
      one way to deserialize a GBoxed type into a specific JsonNode
      type.
      
      To allow having more than one JsonNodeType associated to a
      GBoxed type and a deserialization function we need to split out
      the registration of the serialization and deserialization functions
      into two distinct functions.
      3cf919e9
  11. 12 Nov, 2009 2 commits
    • Emmanuele Bassi's avatar
      serializable: Add methods proxying default implementations · 63dc03da
      Emmanuele Bassi authored
      If you want to use the default implementation of serialize_property()
      and/or deserialize_property() from an object class implementing
      JsonSerializable you currently have to peek the interface vtable and
      then call the vfunc pointers.
      
      We can expose the default implementation through functions ourselves and
      simplify the required code.
      63dc03da
    • Emmanuele Bassi's avatar
      gobject: Add deprecation annotations · 5f484d8c
      Emmanuele Bassi authored
      This makes it easier to detect when building without
      JSON_DISABLE_DEPRECATED.
      5f484d8c
  12. 28 Oct, 2009 2 commits
    • Emmanuele Bassi's avatar
      gobject: Use from/to data naming convention · 8f8ce877
      Emmanuele Bassi authored
      Be more GLib-like, and use
      
        <namespace>_<type>_from_data()
        <namespace>_<type>_to_data()
      
      Instead of the homebrew "construct" and "serialize", when dealing
      with string buffers.
      
      This means:
      
        • adding json_gobject_from_data() to deprecate
          json_construct_gobject()
        • adding json_gobject_to_data() to deprecate
          json_serialize_gobject()
      
      The json_construct_gobject() function also contains a mistake: it
      uses gsize with the special value of -1 meaning "slurp the whole
      string", but gsize is an unsigned type. The newly added
      json_gobject_from_data() correctly uses gssize instead.
      8f8ce877
    • Emmanuele Bassi's avatar
      gobject: Uniform JSON<->GObject mapping code · 00b4d200
      Emmanuele Bassi authored
      Rename json_gobject_new() to json_gobject_deserialize(), and
      json_gobject_dump() to json_gobject_serialize(); this maps the
      JSON GBoxed API.
      
      Also for consistency, change the serialize() return value and
      the deserialize() argument to be JsonNodes of type JSON_NODE_OBJECT.
      00b4d200
  13. 27 Oct, 2009 2 commits
    • Emmanuele Bassi's avatar
      gobject: Make GObject<->JsonObject functions public · 373fa3d9
      Emmanuele Bassi authored
      The functions mapping a GObject to and from a JsonObject should
      be public, as they can be used by parsers.
      373fa3d9
    • Emmanuele Bassi's avatar
      gobject: Add experimental GBoxed<->JSON transformation · ff986ee5
      Emmanuele Bassi authored
      Serializing and deserializing GBoxed types is fairly complicated
      currently. If a GObject implements JsonSerializable it is possible
      for the class to intercept the JsonNode, parse it manually and
      then set the value to the property.
      
      This leaves a hole opened for:
      
        • manual (de)serialization of GBoxed types
        • (de)serialization of GBoxed properties in classes not
          implementing JsonSerializable
      
      In order to serialize and deserialize a GBoxed JSON-GLib should
      provide a mechanism similar to the GValue transformation functions:
      when registering the boxed type the developer should also be able
      to register a serialization and a deserialization functions pair
      matching the tuple:
      
        (GBoxed type, JSON type)
      
      The serialization function would be:
      
        JsonNode *(* JsonBoxedSerializeFunc) (gconstpointer boxed);
      
      And, conversely, the deserialization function would be:
      
        gpointer (* JsonBoxedDeserializeFunc) (JsonNode *node);
      
      Obviously, the whole machinery works only for GBoxed types that
      register the serialization and deserialization functions.
      ff986ee5
  14. 09 Jun, 2009 1 commit
    • Emmanuele Bassi's avatar
      Fix license and copyright notices · c1278644
      Emmanuele Bassi authored
      THere is no such thing as the "Lesser General Public License
      version 2": the LGPL v2 is the "Library GPL", and has been
      superceded by v2.1 with the new "Lesser GPL" name.
      
      Also, the copyright is now Intel Corp.
      c1278644
  15. 10 Nov, 2007 1 commit
    • Emmanuele Bassi's avatar
      Initial implementation of GObject deserialization function · 45c69726
      Emmanuele Bassi authored
      The json_construct_gobject() function takes a GType and a JSON data stream
      and constructs a new instance for the given type. If the type is a
      JsonSerializable, it will use the JsonSerializable interface for parsing
      the JsonNodes of each object member.
      
      This is the initial implementation of the function: the JsonNode-to-GValue
      fallback parser is just a stub.
      45c69726
  16. 16 Oct, 2007 1 commit
    • Emmanuele Bassi's avatar
      Add the JsonSerializable interface · 87a36b8a
      Emmanuele Bassi authored
      The JsonSerializable interface allows implementations to override the
      GObject-to-JSON serialization process, by providing two virtual methods
      to control the (de)serialization of GObject properties. This way it's
      possible to serialize GObjects with properties holding complex data types.
      87a36b8a
  17. 02 Oct, 2007 1 commit