From 7b4ac5de11d90e9f7048f057d70d3da5104388b6 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 1 Sep 2003 18:02:06 +0000 Subject: 2003-09-01 Havoc Pennington * glib/Makefile.am: rearrange a bunch of files and get "make check" framework set up --- glib/dbus-gmain.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'glib/dbus-gmain.c') diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c index 9b14049d..36c6c6b4 100644 --- a/glib/dbus-gmain.c +++ b/glib/dbus-gmain.c @@ -21,8 +21,9 @@ * */ +#include #include "dbus-glib.h" -#include +#include "dbus-gtest.h" /** * @defgroup DBusGLib GLib bindings @@ -491,3 +492,19 @@ dbus_server_setup_with_g_main (DBusServer *server, } /** @} */ /* end of public API */ + +#ifdef DBUS_BUILD_TESTS + +/** + * @ingroup DBusGLibInternals + * Unit test for GLib main loop integration + * @returns #TRUE on success. + */ +dbus_bool_t +_dbus_gmain_test (const char *test_data_dir) +{ + + return TRUE; +} + +#endif /* DBUS_BUILD_TESTS */ -- cgit From 85ab0327d82e4945ad16630e583d8cc68df25a90 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 7 Sep 2003 23:04:54 +0000 Subject: 2003-09-07 Havoc Pennington * Make Doxygen contented. --- glib/dbus-gmain.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'glib/dbus-gmain.c') diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c index 36c6c6b4..c33f47e8 100644 --- a/glib/dbus-gmain.c +++ b/glib/dbus-gmain.c @@ -49,6 +49,9 @@ */ typedef struct DBusGSource DBusGSource; +/** + * A GSource subclass for a DBusConnection. + */ struct DBusGSource { GSource source; /**< the parent GSource */ -- cgit From 583994cb3b7f5562fb7b8c37b4cb0d5af78e4ce2 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Wed, 17 Sep 2003 03:52:07 +0000 Subject: 2003-09-15 Havoc Pennington * dbus/dbus-pending-call.c: add the get/set object data boilerplate as for DBusConnection, etc. Use generic object data for the notify callback. * glib/dbus-gparser.c (parse_node): parse child nodes * tools/dbus-viewer.c: more hacking on the dbus-viewer * glib/dbus-gutils.c (_dbus_gutils_split_path): add a file to contain functions shared between the convenience lib and the installed lib * glib/Makefile.am (libdbus_glib_1_la_LDFLAGS): add -export-symbols-regex to the GLib library * dbus/dbus-object-tree.c (_dbus_object_tree_dispatch_and_unlock): fix the locking in here, and add a default handler for Introspect() that just returns sub-nodes. 2003-09-14 Havoc Pennington * glib/dbus-gthread.c (dbus_g_thread_init): rename to make g_foo rather than gfoo consistent * glib/dbus-gproxy.h: delete for now, move contents to dbus-glib.h, because the include files don't work right since we aren't in the dbus/ subdir. * glib/dbus-gproxy.c (dbus_gproxy_send): finish implementing (dbus_gproxy_end_call): finish (dbus_gproxy_begin_call): finish * glib/dbus-gmain.c (dbus_set_g_error): new * glib/dbus-gobject.c (handle_introspect): include information about child nodes in the introspection * dbus/dbus-connection.c (dbus_connection_list_registered): new function to help in implementation of introspection * dbus/dbus-object-tree.c (_dbus_object_tree_list_registered_and_unlock): new function 2003-09-12 Havoc Pennington * glib/dbus-gidl.h: add common base class for all the foo_info types * tools/dbus-viewer.c: add GTK-based introspection UI thingy similar to kdcop * test/Makefile.am: try test srcdir -ef . in addition to test srcdir = ., one of them should work (yeah lame) * glib/Makefile.am: build the "idl" parser stuff as a convenience library * glib/dbus-gparser.h: make description_load routines return NodeInfo* not Parser* * Makefile.am (SUBDIRS): build test dir after all library dirs * configure.in: add GTK+ detection --- glib/dbus-gmain.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'glib/dbus-gmain.c') diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c index c33f47e8..2e5604dc 100644 --- a/glib/dbus-gmain.c +++ b/glib/dbus-gmain.c @@ -25,6 +25,10 @@ #include "dbus-glib.h" #include "dbus-gtest.h" +#include +#define _(x) dgettext (GETTEXT_PACKAGE, x) +#define N_(x) x + /** * @defgroup DBusGLib GLib bindings * @ingroup DBus @@ -494,6 +498,43 @@ dbus_server_setup_with_g_main (DBusServer *server, g_error ("Not enough memory to set up DBusServer for use with GLib"); } +/** + * The implementation of DBUS_GERROR error domain. See documentation + * for GError in GLib reference manual. + * + * @returns the error domain quark for use with GError + */ +GQuark +dbus_g_error_quark (void) +{ + static GQuark quark = 0; + if (quark == 0) + quark = g_quark_from_static_string ("g-exec-error-quark"); + return quark; +} + + +/** + * Set a GError return location from a DBusError. + * + * @todo expand the DBUS_GERROR enum and take advantage of it here + * + * @param gerror location to store a GError, or #NULL + * @param derror the DBusError + */ +void +dbus_set_g_error (GError **gerror, + DBusError *derror) +{ + g_return_if_fail (derror != NULL); + g_return_if_fail (dbus_error_is_set (derror)); + + g_set_error (gerror, DBUS_GERROR, + DBUS_GERROR_FAILED, + _("D-BUS error %s: %s"), + derror->name, derror->message); +} + /** @} */ /* end of public API */ #ifdef DBUS_BUILD_TESTS -- cgit From 52f275a7f43a78f981d0ccc85d5882ff4c356bdd Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Tue, 23 Sep 2003 23:47:09 +0000 Subject: 2003-09-23 Havoc Pennington * glib/dbus-gproxy.c (dbus_gproxy_connect_signal): implement (dbus_gproxy_disconnect_signal): implement (dbus_gproxy_manager_remove_signal_match): implement (dbus_gproxy_manager_add_signal_match): implement (dbus_gproxy_oneway_call): implement --- glib/dbus-gmain.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'glib/dbus-gmain.c') diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c index 2e5604dc..54a2d462 100644 --- a/glib/dbus-gmain.c +++ b/glib/dbus-gmain.c @@ -535,6 +535,43 @@ dbus_set_g_error (GError **gerror, derror->name, derror->message); } +/** + * Get the GLib type ID for a DBusConnection boxed type. + * + * @returns GLib type + */ +GType +dbus_connection_get_g_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("DBusConnection", + (GBoxedCopyFunc) dbus_connection_ref, + (GBoxedFreeFunc) dbus_connection_unref); + + return our_type; +} + +/** + * Get the GLib type ID for a DBusMessage boxed type. + * + * @returns GLib type + */ +GType +dbus_message_get_g_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static ("DBusMessage", + (GBoxedCopyFunc) dbus_message_ref, + (GBoxedFreeFunc) dbus_message_unref); + + return our_type; +} + + /** @} */ /* end of public API */ #ifdef DBUS_BUILD_TESTS -- cgit