From 2b97fb81a508a047b14f4c4426c28abfd18bb2e0 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 27 Feb 2005 17:38:12 +0000 Subject: 2005-02-27 Colin Walters * glib/dbus-gidl.c (property_info_get_type, arg_info_get_type): Change return value to const char * instead of int so we can do full signatures. (struct PropertyInfo, struct ArgInfo): Store char *. (property_info_new, arg_info_new): Update parameters, strdup. (property_info_unref, arg_info_unref): Free. * glib/dbus-gidl.h: Update prototypes. * glib/dbus-gparser.c (basic_type_from_string): Delete. (validate_signature): New function, just validates signature and sets GError. (parse_property, parse_arg): Invoke validate_signature. Store signature instead of just type code. * glib/dbus-gvalue.c (base_type_from_signature): New utility function to return a primary type for a signature, dropping information about types in container types. (dbus_gvalue_genmarshal_name_from_type) (dbus_gvalue_binding_type_from_type) (dbus_gvalue_ctype_from_type): Update to take full signature instead of type code. (dbus_gtype_to_dbus_type): Moved here from glib/dbus-gobject.c. * glib/dbus-gvalue.h: Update prototypes for above. * glib/dbus-gobject.c (gtype_to_dbus_type): Moved to glib/dbus-gvalue.c as dbus_gtype_to_dbus_type. (introspect_properties, introspect_signals, write_interface): Update to handle signatures, and remove usage of _dbus_gutils_type_to_string. (handle_introspect): Print out type codes instead of e.g. "string" in hardcoded introspection XML; also use x_AS_STRING constants instead of hardcoding in string. * glib/dbus-glib-tool.c (pretty_print): Handle signature change to string. Remove usage of _dbus_gutils_type_to_string. * glib/dbus-gutils.c (_dbus_gutils_type_to_string): Delete. * glib/dbus-gutils.h (_dbus_gutils_type_to_string): Update for deletion. * glib/dbus-binding-tool-glib.c (compute_marshaller) (compute_marshaller_name, generate_glue): Handle signature change to string. (write_formal_parameters, write_args_for_direction): Ditto, and remove FIXME. * tools/dbus-tree-view.c (type_to_string): Delete. (info_set_func_text): Update to print full signatures. * test/glib/test-service-glib.xml: Change types to new introspection format. --- glib/dbus-gidl.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'glib/dbus-gidl.c') diff --git a/glib/dbus-gidl.c b/glib/dbus-gidl.c index fb9573e5..3ca0a478 100644 --- a/glib/dbus-gidl.c +++ b/glib/dbus-gidl.c @@ -66,14 +66,14 @@ struct SignalInfo struct PropertyInfo { BaseInfo base; - int type; + char *type; PropertyAccessFlags access; }; struct ArgInfo { BaseInfo base; - int type; + char *type; ArgDirection direction; }; @@ -631,7 +631,7 @@ signal_info_add_arg (SignalInfo *info, PropertyInfo* property_info_new (const char *name, - int type, + const char *type, PropertyAccessFlags access) { PropertyInfo *info; @@ -641,7 +641,7 @@ property_info_new (const char *name, info->base.name = g_strdup (name); info->base.type = INFO_TYPE_PROPERTY; - info->type = type; + info->type = g_strdup (type); info->access = access; return info; @@ -662,6 +662,7 @@ property_info_unref (PropertyInfo *info) if (info->base.refcount == 0) { base_info_free (info); + g_free (info->type); } } @@ -671,7 +672,7 @@ property_info_get_name (PropertyInfo *info) return info->base.name; } -int +const char * property_info_get_type (PropertyInfo *info) { return info->type; @@ -686,7 +687,7 @@ property_info_get_access (PropertyInfo *info) ArgInfo* arg_info_new (const char *name, ArgDirection direction, - int type) + const char *type) { ArgInfo *info; @@ -697,7 +698,7 @@ arg_info_new (const char *name, /* name can be NULL */ info->base.name = g_strdup (name); info->direction = direction; - info->type = type; + info->type = g_strdup (type); return info; } @@ -717,6 +718,7 @@ arg_info_unref (ArgInfo *info) if (info->base.refcount == 0) { base_info_free (info); + g_free (info->type); } } const char* @@ -725,7 +727,7 @@ arg_info_get_name (ArgInfo *info) return info->base.name; } -int +const char * arg_info_get_type (ArgInfo *info) { return info->type; -- cgit