dbus/tools dbus-tree-view.c,1.8,1.9

Colin Walters walters at freedesktop.org
Sun Feb 27 09:38:14 PST 2005


Update of /cvs/dbus/dbus/tools
In directory gabe:/tmp/cvs-serv13388/tools

Modified Files:
	dbus-tree-view.c 
Log Message:
2005-02-27  Colin Walters  <walters at verbum.org>

	* 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.


Index: dbus-tree-view.c
===================================================================
RCS file: /cvs/dbus/dbus/tools/dbus-tree-view.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- dbus-tree-view.c	13 Feb 2005 17:16:25 -0000	1.8
+++ dbus-tree-view.c	27 Feb 2005 17:38:12 -0000	1.9
@@ -25,49 +25,6 @@
 #include "dbus-tree-view.h"
 #include <glib/gi18n.h>
 
-/* FIXME this function should just be in the library */
-static const char *
-type_to_string (int type)
-{
-  switch (type)
-    {
-    case DBUS_TYPE_INVALID:
-      return "invalid";
-    case DBUS_TYPE_BOOLEAN:
-      return "boolean";
-    case DBUS_TYPE_BYTE:
-      return "byte";
-    case DBUS_TYPE_INT16:
-      return "int16";
-    case DBUS_TYPE_UINT16:
-      return "uint16";
-    case DBUS_TYPE_INT32:
-      return "int32";
-    case DBUS_TYPE_UINT32:
-      return "uint32";
-    case DBUS_TYPE_DOUBLE:
-      return "double";
-    case DBUS_TYPE_STRING:
-      return "string";
-    case DBUS_TYPE_OBJECT_PATH:
-      return "object_path";
-    case DBUS_TYPE_SIGNATURE:
-      return "signature";
-    case DBUS_TYPE_STRUCT:
-      return "struct";
-    case DBUS_TYPE_ARRAY:
-      return "array";
-    case DBUS_TYPE_VARIANT:
-      return "variant";
-    case DBUS_STRUCT_BEGIN_CHAR:
-      return "begin_struct";
-    case DBUS_STRUCT_END_CHAR:
-      return "end_struct";
-    default:
-      return "unknown";
-    }
-}
-
 enum
 {
   MODEL_COLUMN_INFO,
@@ -334,14 +291,14 @@
     case INFO_TYPE_PROPERTY:
       g_string_append (str, "<i>property</i>");
       g_string_append_printf (str, " <b>%s</b>",
-                              type_to_string (property_info_get_type ((PropertyInfo*)info)));
+                              property_info_get_type ((PropertyInfo*)info));
       break;
     case INFO_TYPE_ARG:
       g_string_append_printf (str, "<i>arg</i> %s",
                               arg_info_get_direction ((ArgInfo*)info) == ARG_IN ?
                               "in" : "out");
       g_string_append_printf (str, " <b>%s</b>",
-                              type_to_string (arg_info_get_type ((ArgInfo*)info)));
+                              arg_info_get_type ((ArgInfo*)info));
       break;
     }
 



More information about the dbus-commit mailing list