dbus/glib/examples example-signal-emitter.c, 1.1, 1.2 example-service.c, 1.1, 1.2 Makefile.am, 1.1, 1.2

Colin Walters walters at freedesktop.org
Sat Jul 9 02:25:36 EST 2005


Update of /cvs/dbus/dbus/glib/examples
In directory gabe:/tmp/cvs-serv2325/glib/examples

Modified Files:
	example-signal-emitter.c example-service.c Makefile.am 
Log Message:
2005-07-08  Colin Walters  <walters at verbum.org>

	* tools/Makefile.am: Kill of print-introspect in favor of using
	dbus-send --print-reply=literal.
	* tools/print-introspect.c: Deleted.

	* test/glib/test-service-glib.xml: 
	* test/glib/test-service-glib.c (my_object_get_objs): New test
	for "ao".

	* test/glib/test-dbus-glib.c (echo_received_cb): Free echo data.
	(main): Test GetObjs.

	* glib/examples/statemachine/Makefile.am:
	* glib/examples/statemachine/sm-marshal.list:
	* glib/examples/statemachine/statemachine-client.c:
	* glib/examples/statemachine/statemachine-server.c:
	* glib/examples/statemachine/statemachine-server.xml:
	* glib/examples/statemachine/statemachine.c:
	* glib/examples/statemachine/statemachine.h:
	* glib/examples/statemachine/statemachine.xml:

	New example.

	* glib/examples/example-service.c (main): Move invocation
	of dbus_g_object_type_install_info earlier, to emphasize it
	should only be done once.

	* glib/examples/example-signal-emitter.c (main): Ditto.

	* glib/examples/Makefile.am (SUBDIRS): Include statemachine.

	* glib/dbus-gvalue.h (dbus_gtype_to_signature)
	(dbus_gvalue_marshal): Update prototypes.

	* glib/dbus-gvalue.c: Update all marshalling functions to take
	const GValue instead of GValue.
	(signature_iter_to_g_type_array): Return a GPtrArray for nonfixed
	types.
	(dbus_gvalue_to_signature): Update for dbus_gtype_to_signature
	change.
	(dbus_gtype_to_signature): Handle generic collecitons and maps.
	Return a newly-allocated string.
	(demarshal_proxy, demarshal_object_path, demarshal_object)
	(demarshal_strv, demarshal_ghashtable): Set error, don't assert if
	we get the wrong types from message.
	(get_type_demarshaller): New function, extracted from
	dbus_gvalue_demarshal.
	(demarshal_collection): New function, demarshals generic
	collection.
	(dbus_gvalue_demarshal): Just invoke result of
	get_type_demarshaller.  Throw error if we don't have one.
	(marshal_garray_basic): Abort on OOM.
	(get_type_marshaller): New function, extracted from
	dbus_gvalue_marshal.
	(collection_marshal_iterator, marshal_collection): New functions;
	implements generic marshalling for an iteratable specialized
	collection.
	(dbus_gvalue_marshal): Just invoke result of get_type_marshaller.

	* glib/dbus-gvalue-utils.c (gvalue_from_ptrarray_value): Handle
	G_TYPE_STRING.
	(ptrarray_value_from_gvalue): Ditto.
	(ptrarray_append, ptrarray_free): New functions.
	(slist_constructor, slist_iterator, slist_copy_elt, slist_copy) 
	(slist_append, slist_end_append, slist_free): New functions.
	(dbus_g_type_specialized_builtins_init): Add append fuctions
	for GPtrArray and GSList.  Register GSList.
	(test_specialized_hash, _dbus_gvalue_utils_test): New functions.

	* glib/dbus-gtype-specialized.h (DBusGTypeSpecializedAppendContext):
	New.
	(dbus_g_type_specialized_collection_init_append)
	(dbus_g_type_specialized_collection_append)
	(dbus_g_type_specialized_collection_end_append): Prototype.
	(DBusGTypeSpecializedCollectionVtable): Add append_func and
	end_append_func.

	* glib/dbus-gtype-specialized.c (dbus_g_type_specialized_collection_init_append) 
	(dbus_g_type_specialized_collection_append) 
	(dbus_g_type_specialized_collection_end_append): New functions.
	(dbus_g_type_map_value_iterate): Take const GValue.
	(dbus_g_type_collection_value_iterate): Ditto.

	* glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run
	_dbus_gvalue_utils_test.
	
	* glib/dbus-gtest.h: Prototype it.

	* glib/dbus-gproxy.c (dbus_g_proxy_manager_filter): Avoid
	using uninitialized owner_list.
	(dbus_g_proxy_begin_call_internal): Move return_if_fail to
	public API.
	(dbus_g_proxy_end_call_internal): Update to use error set
	from dbus_gvalue_demarshal instead of setting it here.
	(dbus_g_proxy_begin_call): Move return_if_fail here.

	* glib/dbus-gobject.c (write_interface): Update for
	dbus_gtype_to_signature returning new string.

	* configure.in: Add glib/examples/statemachine.


Index: example-signal-emitter.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/examples/example-signal-emitter.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- example-signal-emitter.c	21 Jun 2005 01:18:25 -0000	1.1
+++ example-signal-emitter.c	8 Jul 2005 16:25:34 -0000	1.2
@@ -99,6 +99,8 @@
   guint request_name_result;
 
   g_type_init ();
+
+  dbus_g_object_type_install_info (TEST_TYPE_OBJECT, &dbus_glib_test_object_object_info);
   
   mainloop = g_main_loop_new (NULL, FALSE);
 
@@ -120,8 +122,6 @@
 
   obj = g_object_new (TEST_TYPE_OBJECT, NULL);
 
-  dbus_g_object_type_install_info (TEST_TYPE_OBJECT, &dbus_glib_test_object_object_info);
-
   dbus_g_connection_register_g_object (bus, "/org/designfu/TestService/object", G_OBJECT (obj));
 
   printf ("test service running\n");

Index: example-service.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/examples/example-service.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- example-service.c	21 Jun 2005 01:18:25 -0000	1.1
+++ example-service.c	8 Jul 2005 16:25:34 -0000	1.2
@@ -106,6 +106,8 @@
 
   g_type_init ();
   
+  dbus_g_object_type_install_info (SOME_TYPE_OBJECT, &dbus_glib_some_object_object_info);
+
   mainloop = g_main_loop_new (NULL, FALSE);
 
   bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
@@ -126,8 +128,6 @@
 
   obj = g_object_new (SOME_TYPE_OBJECT, NULL);
 
-  dbus_g_object_type_install_info (SOME_TYPE_OBJECT, &dbus_glib_some_object_object_info);
-
   dbus_g_connection_register_g_object (bus, "/SomeObject", G_OBJECT (obj));
 
   printf ("service running\n");

Index: Makefile.am
===================================================================
RCS file: /cvs/dbus/dbus/glib/examples/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Makefile.am	21 Jun 2005 01:18:25 -0000	1.1
+++ Makefile.am	8 Jul 2005 16:25:34 -0000	1.2
@@ -1,3 +1,5 @@
+SUBDIRS = . statemachine
+
 INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_COMPILATION
 
 ## Makefile.am bits for sample client/server pair



More information about the dbus-commit mailing list