diff options
| author | Emmanuele Bassi <ebassi@gnome.org> | 2014-03-06 14:35:49 +0000 |
|---|---|---|
| committer | Emmanuele Bassi <ebassi@gnome.org> | 2014-03-18 16:27:59 +0000 |
| commit | 794664746dcbe8894255f9615357dd51f7f836c3 (patch) | |
| tree | 05bc7f153bd80a904111d2aee0ada361bc32bc8f /json-glib/json-gobject.h | |
| parent | 50bf9cd2f6bc9fb21d9793377f0fd534732d215d (diff) | |
| download | json-glib-794664746dcbe8894255f9615357dd51f7f836c3.tar.gz | |
Use compiler annotations to determine symbol visibility
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.
Diffstat (limited to 'json-glib/json-gobject.h')
| -rw-r--r-- | json-glib/json-gobject.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/json-glib/json-gobject.h b/json-glib/json-gobject.h index dc1fac6..17aa2db 100644 --- a/json-glib/json-gobject.h +++ b/json-glib/json-gobject.h @@ -25,7 +25,6 @@ #define __JSON_GOBJECT_H__ #include <json-glib/json-types.h> -#include <glib-object.h> G_BEGIN_DECLS @@ -84,33 +83,42 @@ struct _JsonSerializableIface GValue *value); }; -GType json_serializable_get_type (void) G_GNUC_CONST; +JSON_AVAILABLE_IN_1_0 +GType json_serializable_get_type (void) G_GNUC_CONST; +JSON_AVAILABLE_IN_1_0 JsonNode *json_serializable_serialize_property (JsonSerializable *serializable, const gchar *property_name, const GValue *value, GParamSpec *pspec); +JSON_AVAILABLE_IN_1_0 gboolean json_serializable_deserialize_property (JsonSerializable *serializable, const gchar *property_name, GValue *value, GParamSpec *pspec, JsonNode *property_node); +JSON_AVAILABLE_IN_1_0 GParamSpec * json_serializable_find_property (JsonSerializable *serializable, const char *name); +JSON_AVAILABLE_IN_1_0 GParamSpec ** json_serializable_list_properties (JsonSerializable *serializable, guint *n_pspecs); +JSON_AVAILABLE_IN_1_0 void json_serializable_set_property (JsonSerializable *serializable, GParamSpec *pspec, const GValue *value); +JSON_AVAILABLE_IN_1_0 void json_serializable_get_property (JsonSerializable *serializable, GParamSpec *pspec, GValue *value); +JSON_AVAILABLE_IN_1_0 JsonNode *json_serializable_default_serialize_property (JsonSerializable *serializable, const gchar *property_name, const GValue *value, GParamSpec *pspec); +JSON_AVAILABLE_IN_1_0 gboolean json_serializable_default_deserialize_property (JsonSerializable *serializable, const gchar *property_name, GValue *value, @@ -141,38 +149,48 @@ typedef JsonNode *(* JsonBoxedSerializeFunc) (gconstpointer boxed); */ typedef gpointer (* JsonBoxedDeserializeFunc) (JsonNode *node); +JSON_AVAILABLE_IN_1_0 void json_boxed_register_serialize_func (GType gboxed_type, JsonNodeType node_type, JsonBoxedSerializeFunc serialize_func); +JSON_AVAILABLE_IN_1_0 void json_boxed_register_deserialize_func (GType gboxed_type, JsonNodeType node_type, JsonBoxedDeserializeFunc deserialize_func); +JSON_AVAILABLE_IN_1_0 gboolean json_boxed_can_serialize (GType gboxed_type, JsonNodeType *node_type); +JSON_AVAILABLE_IN_1_0 gboolean json_boxed_can_deserialize (GType gboxed_type, JsonNodeType node_type); +JSON_AVAILABLE_IN_1_0 JsonNode *json_boxed_serialize (GType gboxed_type, gconstpointer boxed); +JSON_AVAILABLE_IN_1_0 gpointer json_boxed_deserialize (GType gboxed_type, JsonNode *node); +JSON_AVAILABLE_IN_1_0 JsonNode *json_gobject_serialize (GObject *gobject); +JSON_AVAILABLE_IN_1_0 GObject * json_gobject_deserialize (GType gtype, JsonNode *node); +JSON_AVAILABLE_IN_1_0 GObject * json_gobject_from_data (GType gtype, const gchar *data, gssize length, GError **error); +JSON_AVAILABLE_IN_1_0 gchar * json_gobject_to_data (GObject *gobject, gsize *length); -JSON_DEPRECATED_FOR(json_gobject_from_data) +JSON_DEPRECATED_IN_1_0_FOR(json_gobject_from_data) GObject * json_construct_gobject (GType gtype, const gchar *data, gsize length, GError **error); -JSON_DEPRECATED_FOR(json_gobject_to_data) +JSON_DEPRECATED_IN_1_0_FOR(json_gobject_to_data) gchar * json_serialize_gobject (GObject *gobject, gsize *length) G_GNUC_MALLOC; |
