Commit graph

1047 commits

Author SHA1 Message Date
Colin Walters
df901b528b 2005-06-26 Colin Walters <walters@verbum.org>
* glib/dbus-glib.c (dbus_set_g_error): Delete.
	(dbus_g_error_set): New public function from its ashes; used by
	both service-side method implementation and GLib bindings
	internals.
	(dbus_g_error_has_name, dbus_g_error_get_name): New function.
	(_dbus_glib_test): Add some tests.

	* test/glib/test-dbus-glib.c (main): Test dbus_g_error_has_name.

	* test/glib/test-service-glib.c (my_object_throw_error): Use
	dbus_g_error_set.

	* glib/dbus-gobject.c (gerror_to_dbus_error_message): Handle
	errors thrown by dbus_g_error_set.

	* glib/dbus-gmain.c (dbus_g_bus_get): Change to dbus_g_error_set.

	* glib/dbus-gparser.c (validate_signature): Ditto.

	* glib/dbus-gproxy.c (dbus_g_proxy_new_for_name_owner)
	(dbus_g_proxy_end_call_internal): Ditto.

	* glib/Makefile.am: Generate dbus-glib-error-switch.h, which
	converts DBUS_ERROR_x to DBUS_GERROR_x.
	(libdbus_glib_1_la_SOURCES, BUILT_SOURCES, CLEANFILES): Add it.

	* doc/TODO: Remove error TODO.

	* doc/dbus-tutorial.xml: Update with documentation about error
	handling.

	* dbus/make-dbus-glib-error-enum.sh: Tighten up regexp to make
	sure we only change DBUS_ERROR to DBUS_GERROR, not all ERROR to
	GERROR.  Also add DBUS_GERROR_REMOTE_EXCEPTION.
2005-06-26 17:02:09 +00:00
Colin Walters
c904e1e3a6 2005-06-22 Colin Walters <walters@verbum.org>
Patch from Ross Burton <ross@openedhand.com>

	* glib/dbus-gobject.c (dbus_g_method_return): Free out_sig.
2005-06-22 23:35:32 +00:00
Colin Walters
21a73df1b5 2005-06-20 Colin Walters <walters@verbum.org>
* configure.in: Add glib/examples.

	* glib/Makefile.am: Add examples/

	* glib/examples/.cvsignore
	* glib/examples/Makefile.am
	* glib/examples/example-client.c
	* glib/examples/example-service.c
	* glib/examples/example-service.xml
	* glib/examples/example-signal-emitter.c
	* glib/examples/example-signal-emitter.xml
	* glib/examples/example-signal-recipient.c:
	New files; GLib binding examples, ported from
	python/examples.
2005-06-21 01:18:25 +00:00
Colin Walters
778579ec21 2005-06-20 Colin Walters <walters@verbum.org>
* dbus/dbus-glib.h:
	* glib/dbus-gproxy.c: Rename dbus_g_proxy_invoke to
	dbus_g_proxy_call.

	* glib/dbus-binding-tool-glib.c:
	* doc/dbus-tutorial.xml:
	* test/glib/test-dbus-glib.c: Update for rename.
2005-06-21 00:30:20 +00:00
Colin Walters
7883563478 2005-06-20 Colin Walters <walters@verbum.org>
Patch suggested by Ross Burton <ross@openedhand.com>

	* glib/dbus-gobject.c (export_signals): Free signal name.
	(g_value_init): Use G_VALUE_NOCOPY_CONTENTS to plug
	memory leak.  Add a bit of documentation.
	(dbus_g_method_return_error): Free context, and note we do
	so.
2005-06-20 19:54:22 +00:00
Murray Cumming
6a4596752c 2005-06-18 Murray Cumming <murrayc@murrayc.com>
* dbus/dbus-glib.h:
        * glib/dbus-gobject.c:
        * glib/dbus-gproxy.c:
        * glib/dbus-gvalue.c: Predeclare structs as
        typedef struct _Something Something instead of
        typedef struct Something Something, so we can
        redeclare the prototypes. Other GNOME libraries
        do this already.
2005-06-19 15:31:25 +00:00
Colin Walters
6e3a318982 2005-06-17 Colin Walters <walters@verbum.org>
* tools/dbus-names-model.c (have_names_notify): Fix call
	to dbus_g_proxy_end_call.
2005-06-17 17:10:41 +00:00
Colin Walters
949436ffac 2005-06-17 Colin Walters <walters@verbum.org>
* glib/dbus-gproxy.c (dbus_g_proxy_emit_remote_signal): Don't
	spew warnings if we get malformed remote signals.

	* glib/dbus-gobject.c (propsig_iterate): New function.
	(lookup_object_info): New function, extracted from
	lookup_object_and_method.
	(introspect_properties, introspect_signals): Delete; these
	are merged into write_interface.
	(write_interface): Write out signals and properties here;
	dump the org.gtk.object stuff and use the interface given
	in the introspection data blob.  Also fix up property XML.
	(lookup_values): New function.
	(introspect_interfaces): Gather a mapping from interface to a
	list of its methods, signals, and properties, then write out
	each interface.
	(lookup_object_and_method): Use lookup_object_info.
	(struct DBusGSignalClosure): Add interface.
	(dbus_g_signal_closure_new): Add interface. Don't dup signame;
	we can just use the constant data.
	(dbus_g_signal_closure_finalize): Don't free signal name.
	(signal_emitter_marshaller): Use interface from signal closure.
	(export_signals): Only export signals mentioned in introspection
	blob.
	(dbus_g_connection_register_g_object): Warn if we have no
	introspection data for an object.
	(funcsig_equal): Remove unused variable.
	(dbus_g_object_register_marshaller): Take varargs instead of
	list.
	(dbus_g_object_register_marshaller_array): New function,
	extracted from old dbus_g_object_register_marshaller.

	* glib/dbus-binding-tool-glib.c (struct DBusBindingToolCData): Add
	signals and property data.
	(write_quoted_string): New function, extracted from generate_glue.
	(generate_glue): Write signals and properties to introspection
	blob.

	* dbus/dbus-glib.h (struct DBusGObjectInfo): Include
	exported_signals and exported_properties.
	(dbus_g_object_register_marshaller): Update prototype.
	(dbus_g_object_register_marshaller_array): Prototype.

	* test/glib/test-dbus-glib.c: Extend testing to cover new signals.

	* test/glib/test-service-glib.c: Add new test signals and method
	to emit them.

	* test/glib/test-service-glib.xml: Add some test signals.

	* test/glib/Makefile.am (BUILT_SOURCES): Add my-object-marshal.c
	and my-object-marshal.h
	(test_service_glib_SOURCES, test_dbus_glib_SOURCES): Add
	my-object-marshal.c.
	(my-object-marshal.c, my-object-marshal.h): Implement.

	* test/glib/.cvsignore: Update.

	* doc/TODO: Remove two GLib TODO items fixed by this
	patch.
2005-06-17 14:29:48 +00:00
Colin Walters
679018f00c 2005-06-16 Colin Walters <walters@verbum.org>
* doc/TODO: Update for GLib bindings.
2005-06-16 19:57:31 +00:00
Colin Walters
887a1dc0e3 2005-06-16 Colin Walters <walters@verbum.org>
* glib/dbus-binding-tool-glib.c:
	* glib/dbus-gobject.c:
	* glib/dbus-gproxy.c:  Add Nokia copyright; Patch
	from Ross Burton, for his GLib bindings work.
2005-06-16 19:50:25 +00:00
Colin Walters
f5bb7fc1b0 2005-06-16 Colin Walters <walters@verbum.org>
* glib/dbus-gobject.c (funcsig_hash, funcsig_equal): Use n_params
	to iterate instead of walking to G_TYPE_INVALID.

	Patch based on a patch from Ryan Gammon.
2005-06-16 19:45:49 +00:00
Colin Walters
6b2af67ae1 2005-06-16 Colin Walters <walters@verbum.org>
* bus/bus.c (bus_context_new): Set parser to NULL
	after we unref it (Patch from Chris Boscolo, #2174).
2005-06-16 06:05:09 +00:00
Colin Walters
ddce490e79 2005-06-16 Colin Walters <walters@verbum.org>
* python/dbus_bindings.pyx.in: Import size_t,
	__int64_t, __uint64_t, and __signed.

	* dbus/dbus-sysdeps.c <HAVE_CMSGCRED> (write_credentials_byte):
	Define cmsg struct, output it.
	(_dbus_read_credentials_unix_socket):
	Use cmsg struct.

	Patch from Joe Markus Clarke for FreeBSD support.
2005-06-16 05:51:46 +00:00
Colin Walters
70bd20a50e 2005-06-16 Colin Walters <walters@verbum.org>
* tools/dbus-send.c (append_array): Use strtok.
	(append_dict): New function.
	(type_from_name): New function, extracted from main.
	(main): Handle sending dicts.

	* tools/dbus-print-message.c (print_iter): Print dict
	entries.
2005-06-16 04:48:10 +00:00
Colin Walters
3220372584 2005-06-16 Colin Walters <walters@verbum.org>
* glib/dbus-gvalue.c (marshal_basic): Marshal NULL string
	values as the empty string (#2948).
2005-06-16 04:38:11 +00:00
Colin Walters
6fe36d8791 2005-06-16 Colin Walters <walters@verbum.org>
* dbus/Makefile.am:
	* mono/doc/Makefile.am:
	* test/glib/Makefile.am:

	Fix srcdir != builddir issues (Patch from Chris Wilson, #3477)
2005-06-16 04:32:50 +00:00
Colin Walters
5935f33b75 2005-06-16 Colin Walters <walters@verbum.org>
* dbus/dbus-marshal-header.c (_dbus_header_load): Set
	header byte order from expected byte order (Patch from Chris Wilson, #3475).

	* dbus/dbus-marshal-byteswap.c (byteswap_body_helper):
	Increment pointer after swapping fixed array.  Add assertion
	for array length.
2005-06-16 04:27:45 +00:00
Colin Walters
5cd4c9ac5f 2005-06-15 Colin Walters <walters@verbum.org>
* dbus/dbus-sysdeps.c <HAVE_CMSGCRED> (_dbus_read_credentials_unix_socket):
	Fix call to dbus_set_error.  (Patch from Michael Banck, #3461)
2005-06-15 19:33:04 +00:00
John (J5) Palmieri
b28bbb092b * Bumped version for CVS HEAD 2005-06-15 18:35:18 +00:00
John (J5) Palmieri
e235a2a73a * NEWS: Update to 0.34 2005-06-15 18:32:32 +00:00
John (J5) Palmieri
6043a0be44 * dbus/dbus-connection.c (_dbus_connection_peer_filter): New method
(_dbus_connection_run_builtin_filters): New method
        (dbus_connection_dispatch): Run the builtin filters which in turn
        runs the peer filter which handles Ping messages.

        * doc/TODO:
         - Ping isn't handled: This patch fixes it

         - Add a test case for the Ping message: added TODO item
2005-06-15 16:20:28 +00:00
John (J5) Palmieri
a93f9c04ac * dbus/dbus-message.c:
(dbus_message_has_path): New method
        (dbus_message_has_interface): New method
        (dbus_message_has_member): New method

        * dbus/dbus/dbus-sysdeps.c (_dbus_check_dir_is_private_to_user):
        New method

        * dbus/dbus-keyring.c (_dbus_keyring_reload): Check to see that
        the keyring directory is private to the user

        * doc/TODO:
         - The convenience functions in dbus-bus.h should perhaps have
         the signatures that they would have if they were autogenerated
         stubs. e.g. the acquire service function. We should also evaluate
         which of these functions to include, in light of the fact that
         GLib/Qt native stubs will probably also exist.: Punted

         - add dbus_message_has_path(), maybe has_member/interface:
         fixed in this patch

         - in dbus-keyring.c, enforce that the keyring dir is not
         world readable/writable: Fixed in this patch
2005-06-15 15:59:57 +00:00
John (J5) Palmieri
5e389fdf49 * dbus/dbus-marshal-validate.h: Added a new validation
error code DBUS_VALIDITY_UNKNOWN_OOM_ERROR = -4 for
        out of memory errors when validating signitures

        * dbus/dbus-marshal-header.c: use DBUS_VALIDITY_UNKNOWN_OOM_ERROR
        in places where we previously used DBUS_VALID and a FALSE return
        value to indicate OOM

        * dbus/dbus-marshal-validate.c (_dbus_validate_signature_with_reason):
        Use a stack to track the number of elements inside containers.  The
        stack values are then used to validate that dict entries have only two
        elements within them.
        (validate_body_helper): check the reason for failure when validating
        varients

        * dbus/dbus-message.c (load_message): use
        DBUS_VALIDITY_UNKNOWN_OOM_ERROR in places where we previously used
        DBUS_VALID and a FALSE return value to indicate OOM

        * doc/TODO: remove "- validate dict entry number of fields" as this
        patch fixes it
2005-06-15 15:15:32 +00:00
David Zeuthen
1d19fc62e9 2005-06-14 David Zeuthen <davidz@redhat.com>
* bus/bus.c (process_config_every_time): Drop existing conf-dir
        watches (if applicable) and add new watches

        * bus/main.c (signal_handler): Handle SIGIO if using D_NOTIFY
        (main): Setup SIGIO signal handler if using D_NOTIFY

        * bus/config-parser.h: Add prototype bus_config_parser_get_conf_dirs

        * bus/config-parser.c (struct BusConfigParser): Add conf_dirs list
        (merge_included): Also merge conf_dirs list
        (bus_config_parser_unref): Clear conf_dirs list
        (include_dir): Add directory to conf_dirs list
        (bus_config_parser_get_conf_dirs): New function

        * bus/dir-watch.[ch]: New files

        * bus/Makefile.am (BUS_SOURCES): Add dir-watch.[ch]

        * configure.in: Add checks for D_NOTIFY on Linux
2005-06-15 02:31:38 +00:00
Colin Walters
50f85baa3d 2005-06-14 Colin Walters <walters@verbum.org>
* glib/dbus-binding-tool-glib.c:
	* glib/dbus-gobject.c:
	* glib/dbus-gvalue.c: Fix indentation and brace style.
2005-06-14 15:55:10 +00:00
Colin Walters
f5c4d6b55c 2005-06-14 Ross Burton <ross@burtonini.com>.
* glib/dbus-glib.h: Make DBusGMethodInvocation
	a private structure.  Rearrange prototypes a bit.

	* glib/dbus-gproxy.c (dbus_g_proxy_invoke): Add
	documentation for first_arg_type.

	* glib/dbus-gobject.c: Move DBusGMethodInvocation
	here, add documentation.  Move dbus_g_method_return
	and dbus_g_method_return_error into public API
	section.
2005-06-14 15:52:41 +00:00
Colin Walters
cdda4e453b 2005-06-14 Colin Walters <walters@verbum.org>
* glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller):
	Add missing return statements, noticed by Ross Burton.
2005-06-14 14:23:56 +00:00
Colin Walters
9548df2ce9 2005-06-13 Ross Burton <ross@burtonini.com>.
* glib/dbus-gobject.c: Handle errors on message
	demarshalling by sending error message back.
	* glib/dbus-gvalue.c: Initialize return variables.
2005-06-13 15:36:31 +00:00
Colin Walters
b539abf9ce 2005-06-13 Colin Walters <walters@verbum.org>
* glib/Makefile.am: Fix thinko in last patch.
2005-06-13 15:34:14 +00:00
Colin Walters
a04c4738fe 2005-06-13 Colin Walters <walters@verbum.org>
* glib/Makefile.am: Move dbus-gtype-specialized.c
	and dbus-gtype-specialized.h into a _HEADERS variable,
	install them.
2005-06-13 14:56:51 +00:00
Colin Walters
beb9cd2eb2 2005-06-12 Colin Walters <walters@verbum.org>
Async signals and various bugfixes and testing by
	Ross Burton <ross@burtonini.com>.

	* glib/dbus-gvalue.h: (struct DBusBasicGValue): Delete.
	(dbus_gvalue_genmarshal_name_from_type)
	(dbus_gvalue_ctype_from_type): Moved to dbus-binding-tool-glib.c.
	(dbus_gtype_to_dbus_type): Renamed to dbus_gtype_from_signature.
	(dbus_g_value_types_init, dbus_gtype_from_signature)
	(dbus_gtype_from_signature_iter, dbus_gtype_to_signature)
	(dbus_gtypes_from_arg_signature): New function prototypes.
	(dbus_gvalue_demarshal): Take context and error arguments.
	(dbus_gvalue_demarshal_variant): New function.
	(dbus_gvalue_demarshal_message): New function.
	(dbus_gvalue_store): Delete.

	* glib/dbus-gvalue.c:

	File has been almost entirely rewritten; now we special-case
	more types such as DBUS_TYPE_SIGNATURE, handle arrays and
	hash tables correctly, etc.  Full support for recursive values
	is not yet complete.

	* glib/dbus-gproxy.c (dbus_g_proxy_class_init): Change last
	argument of signal to G_TYPE_POINTER since we now pass a
	structure.
	(lookup_g_marshaller): Delete in favor of
	_dbus_gobject_lookup_marshaller.
	(marshal_dbus_message_to_g_marshaller): Use
	_dbus_gobject_lookup_marshaller and dbus_gvalue_demarshal_message
	to handle remote signal callbacks.
	(dbus_g_proxy_new_from_proxy): New function; creates a new
	DBusGProxy by copying an existing one.
	(dbus_g_proxy_get_interface, dbus_g_proxy_set_interface)
	(dbus_g_proxy_get_path): New functions.
	(dbus_g_proxy_marshal_args_to_message): New function;
	factored out of existing code.
	(DBUS_G_VALUE_ARRAY_COLLECT_ALL): Collect all arguments
	from a varargs array.
	(dbus_g_proxy_begin_call_internal): New function.
	(dbus_g_proxy_end_call_internal): New function.
	(dbus_g_proxy_begin_call): Take GTypes instead of DBus types
	as arguments; simply invoke dbus_g_proxy_begin_call_internal
	after collecting args into value array.
	(dbus_g_proxy_end_call): Take GTypes instead of DBus types;
	invoke dbus_g_proxy_end_call_internal.
	(dbus_g_proxy_invoke): Simply invoke begin_call_interanl and
	end_call_internal.
	(dbus_g_proxy_call_no_reply): Take GTypes instead of DBus
	types.
	(array_free_all): New function.
	(dbus_g_proxy_add_signal): Take GTypes.

	* glib/dbus-gobject.h:
	(_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete.
	(_dbus_gobject_get_path, _dbus_gobject_lookup_marshaller):
	Prototype.

	* glib/dbus-gobject.c: Add a global marshal_table hash which
	stores mappings from type signatures to marshallers.  Change lots
	of invocations of dbus_gtype_to_dbus_type to
	dbus_gtype_to_signature.
	(_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete.
	(introspect_signals): Fix test for query.return_type.
	(set_object_property): Update invocation of dbus_gvalue_demarshal.
	(invoke_object_method): Many changes.  Handle asynchronous
	invocations.  Convert arguments with
	dbus_gvalue_demarshal_message.  Handle errors.  Use
	DBusSignatureIter instead of strlen on args. Handle all arguments
	generically.  Special-case variants.
	(dbus_g_method_return, dbus_g_method_return_error): New function.
	(DBusGSignalClosure): New structure, closes over signal
	information.
	(dbus_g_signal_closure_new): New function.
	(dbus_g_signal_closure_finalize): New function.
	(signal_emitter_marshaller): New function; is special marshaller
	which emits signals on bus.
	(export_signals): New function; introspects object signals and
	connects to them.
	(dbus_g_object_type_install_info): Take GType instead of
	GObjectClass.
	(dbus_g_connection_register_g_object): Invoke export_signals.
	(dbus_g_connection_lookup_g_object): New function.
	(DBusGFuncSignature) New structure; used for mapping type
	signatures to marshallers.
	(funcsig_hash): New function; hashes DBusGFuncSignature.
	(funcsig_equal): New function; compares DBusGFuncSignature.
	(_dbus_gobject_lookup_marshaller): New function.
	(dbus_g_object_register_marshaller): New function; used to
	register a marshaller at runtime for a particular signature.

	* glib/dbus-gmain.c (_dbus_gmain_test): Add various tests.

	* glib/dbus-binding-tool-glib.h: Add DBUS_GLIB_ANNOTATION_ASYNC
	which notes a server method implementation should be
	asynchronous.

	* glib/dbus-binding-tool-glib.c
	(dbus_binding_tool_output_glib_server): Call
	dbus_g_value_types_init.
	(write_formal_parameters): Use dbus_gtype_from_signature.  Handle
	variants specially.
	(dbus_g_type_get_lookup_function): Turn GType into an invocation
	of a lookup function.
	(write_args_for_direction): Use dbus_g_type_get_lookup_function.
	(write_untyped_out_args): New method; write output arguments.
	(write_formal_declarations_for_direction): Function for
	writing prototypes.
	(write_formal_parameters_for_direction): Function for
	writing implementations.
	(write_typed_args_for_direction): Function for writing
	arguments prefixed with GTypes.
	(write_async_method_client): Write out async version
	of method.

	* glib/dbus-binding-tool-glib.c: Include dbus-gvalue-utils.h.
	(dbus_g_type_get_marshal_name): Move mapping from GType
	to marshal name into here.
	(dbus_g_type_get_c_name): Move into here.
	(compute_marshaller): Convert signature to type with
	dbus_gtype_from_signature, use dbus_g_type_get_marshal_name.
	(compute_marshaller_name): Ditto.
	(compute_marshaller): Handle async signal annotations.
	(gather_marshallers): Return if we don't have a known
	prefix.
	(generate_glue): Collect introspection blob here, and
	write all of the blob at the end.  This allows an object
	with multiple interfaces to work.
	Mark async methods in introspection blob.

	* glib/Makefile.am (libdbus_glib_1_la_SOURCES): Add
	dbus-gtype-specialized.c, dbus-gtype-specialized.h,
	dbus-gvalue-utils.h, dbus-gvalue-utils.c.

	* dbus/dbus-glib.h: Don't include dbus-protocol.h; this
	avoids people accidentally using DBUS_TYPE_* which should
	not be necessary anymore.
	Do include dbus-gtype-specialized.h, which are utilities
	for GLib container types.
	Add various #defines for types such as
	DBUS_TYPE_G_BOOLEAN_ARRAY.
	(DBusGValueIterator, DBusGValue): Define, not fully used
	yet.
	(dbus_g_value_get_g_type): Type for recursive value.
	(dbus_g_value_open, dbus_g_value_iterator_get_value)
	(dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse)
	(dbus_g_value_free): Prototypes.
	(dbus_g_object_register_marshaller, dbus_g_proxy_new_from_proxy): Prototype.
	(dbus_g_proxy_set_interface): Prototype.
	(dbus_g_proxy_begin_call, dbus_g_proxy_end_call)
	(dbus_g_proxy_call_no_reply): Take GLib types instead of DBus
	types.
	(dbus_g_proxy_get_path, dbus_g_proxy_get_interface):
	Accessors.
	(DBusGAsyncData, DBusGMethodInvocation): Structures for
	doing async invocations.
	(dbus_g_method_return, dbus_g_method_return_error):
	Prototypes.
	* doc/dbus-tutorial.xml: Update GLib section.

	* tools/dbus-viewer.c (load_child_nodes): Update
	for new invocation type of dbus_g_proxy_end_call.
	(load_from_service_thread_func): Ditto.

	* tools/print-introspect.c (main): Ditto.

	* tools/dbus-names-model.c (have_names_notify)
	(names_model_reload, names_model_set_connection)
	Use GTypes.

	* python/Makefile.am (INCLUDES): Define DBUS_COMPILATION,
	needed since Python bindings use GLib bindings.

	* test/glib/Makefile.am (INCLUDES): Define DBUS_COMPILATION.
	Add --prefix argument.

	* tools/Makefile.am: Define DBUS_COMPILATION.  Remove
	unneeded --ignore-unsupported arg.

	* test/glib/test-service-glib.c:
	* test/glib/test-service-glib.xml:
	* test/glib/test-dbus-glib.c: Add many more tests.
2005-06-13 03:01:30 +00:00
David Zeuthen
982de71850 2005-06-06 David Zeuthen <davidz@redhat.com>
* doc/TODO: Add item about need to remove deprecated functions.

        * dbus/dbus-connection.h: Add prototype for dbus_connection_disconnect

        * dbus/dbus-connection.c (dbus_connection_disconnect): New function
        to repair the ABI which was broken with the last commit.
2005-06-06 18:55:22 +00:00
John (J5) Palmieri
b079ae2e34 * doc/TODO: remove connection_open/connection_disconnect lacks symmetry item that was just fixed 2005-06-02 21:32:31 +00:00
John (J5) Palmieri
f03c0af1c7 * tools/dbus-send.c (main):
s/dbus_connection_disconnect/dbus_connection_close

	* test/glib/test-profile.c (no_bus_thread_func, with_bus_thread_func):
	s/dbus_connection_disconnect/dbus_connection_close

	* test/test-service.c (path_message_func, filter_func):
	s/dbus_connection_disconnect/dbus_connection_close
2005-06-02 18:22:04 +00:00
John (J5) Palmieri
11fd3b965f * dbus/dbus-connection.c, dbus/dbus-connection.h
(dbus_connection_disconnect): renamed to dbus_connection_close
	for API symmetry with dbus_connection_open
	(_dbus_connection_open_internal):
	s/dbus_connection_disconnect/dbus_connection_close

	* dbus/dbus-bus.c (dbus_bus_get):
	s/dbus_connection_disconnect/dbus_connection_close

	* bus/connection.c (bus_connections_unref,
	bus_connections_setup_connection, bus_connections_expire_incomplete):
	s/dbus_connection_disconnect/dbus_connection_close

	* bus/dispatch.c (bus_dispatch, kill_client_connection,
	kill_client_connection_unchecked, check_hello_connection):
	s/dbus_connection_disconnect/dbus_connection_close

	* bus/bus.c (new_connection_callback):
	s/dbus_connection_disconnect/dbus_connection_close
2005-06-02 17:41:04 +00:00
Colin Walters
0b7923b4cf 2005-05-25 Colin Walters <walters@verbum.org>
* dbus/dbus-protocol.h: Move various bus service #defines such
	  as DBUS_SERVICE_DBUS and DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT to
	  dbus/dbus-shared.h.
	* dbus/dbus-shared.h: Various defines moved here.
	* dbus/dbus-marshal-header.c: Include dbus-shared.h.
2005-05-25 16:03:53 +00:00
John (J5) Palmieri
29c49bce41 * python/__init__.py: Python bindings deserve a minor version
update.  Upped to (0, 40, 2)
2005-05-24 16:34:38 +00:00
John (J5) Palmieri
982e34a1ec * python/decorators.py: add explicitly_pass_message decorator
for passing in the dbus message as keyword for edge case signal
  handling

* python/matchrules.py (SignalMatchRule.__repr__): fix output
  to conform with what dbus expects for match rules
  (SignalMatchRule.execute): add the dbus message as a keyword
  if the signal handler has requested it

* python/examples/example/signal-recipient.py: added some more
  examples on how to hook up to signals

* python/proxies.py: minor formatting changes
2005-05-24 16:30:51 +00:00
John (J5) Palmieri
e43a353d27 * python/decorators.py: import dbus_bindings
* python/matchrules.py (SignalMatchRule, SignalMatchTree,
  SignalMatchNode): new classes that implement wildcard signal
  callback matching using a tree lookup. Heavily modified from a
  patch sent by Celso Pinto (fd.o bug #3241)

* _dbus.py (add_signal_receiver, remove_signal_receiver, _signal_func):
  use new match classes to handle signals.
2005-05-24 00:21:07 +00:00
John (J5) Palmieri
8af9f11e54 - s/TYPE_PATH/TYPE_OBJECT_PATH 2005-05-19 20:27:19 +00:00
Havoc Pennington
7befbf5270 2005-05-18 Havoc Pennington <hp@redhat.com>
* configure.in: use GLIB_GNU_GETTEXT to get INTLLIBS and require
	gettext. Not really worth requiring yet perhaps, but any
	production quality 1.0 would require it so we should go ahead and
	get things set up. We do have a couple token calls to
	bindtextdomain in the code already.
2005-05-18 15:44:50 +00:00
John (J5) Palmieri
63ac302bab * glib/dbus-gmain.c (io_handler_dispatch): fix deadlock
when using recursive g_main_loops

* python/_dbus.py (class Bus): add the ProxyObjectClass
  alias for ProxyObject to make it easier for the Twisted
  networking framework to integrate dbus.

* python/proxies.py (class ProxyObject): add the ProxyMethodClass
  alias for ProxyMethod to make it easier for the Twisted
  networking framework to integrate dbus.
2005-05-16 21:27:04 +00:00
Colin Walters
ad5bafed04 2005-05-11 Ross Burton <ross@burtonini.com>
* glib/dbus-glib-tool.c: Add --prefix argument.
	* glib/dbus-binding-tool-glib.h: Add prefix argument.
	* glib/dbus-binding-tool-glib.c (compute_marshaller_name):
	Add prefix argument.
	(generate_glue): Pass prefix argument down.
	(dbus_binding_tool_output_glib_server): Pass prefix to
	glib-genmarshal.
2005-05-11 19:02:31 +00:00
Colin Walters
3fa4c2f404 2005-05-11 Colin Walters <walters@verbum.org>
* tools/dbus-send.c (append_array): New function.
	(append_arg): Broken out from main.
	(main): Add cheesy hack to send arrays and variants.
	(usage): Update.
	* tools/dbus-print-message.c (print_iter): Broken out
	from main.
2005-05-11 18:48:24 +00:00
Colin Walters
61411a061c 2005-05-11 Colin Walters <walters@verbum.org>
* dbus/dbus-signature.c (dbus_signature_iter_get_signature):
	New function, returns signature string for signature iter.
	* dbus/dbus-signature.h: Prototype it.
	* dbus/dbus-message.c (dbus_message_iter_get_signature):
	New function, returns signature string for message iter.
	(dbus_message_iter_get_array_len): New function, returns
	length of array.
	(dbus_message_iter_get_fixed_array): Fix assertion; this
	function should be used when the iter is pointing to the
	contents of an array
	* dbus/dbus-message.h: Prototypes.
	* dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_array_length):
	New function; returns length of an array.
	* dbus/dbus-marshal-recursive.h: Prototype it.
2005-05-11 18:07:22 +00:00
Colin Walters
ca01b21112 2005-05-11 Colin Walters <walters@verbum.org>
* dbus/dbus-sysdeps-util.c <!HAVE_POSIX_GETPWNAM_R>: Fix
	compilation error.
2005-05-11 17:59:46 +00:00
Havoc Pennington
0e0b8c197d 2005-05-08 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps-util.c (_dbus_become_daemon): write the
	daemon's pid, not the parent's pid, to the file descriptor.
	Reported by Taj Morton.
2005-05-08 15:41:39 +00:00
Havoc Pennington
4db285c800 2005-05-05 Havoc Pennington <hp@redhat.com>
* configure.in (LT_*): add notes on how the libtool versioning
	works to save thinking. Increment soname to indicate protocol
	breakage (though really the library interface hasn't changed I
	guess)

	* dbus/dbus-transport.c (_dbus_transport_get_is_authenticated):
	verify the GUID received from server matches what we were
	expecting, if we had an expectation

	* dbus/dbus-auth.c (send_ok): send GUID along with the OK command
	(_dbus_auth_get_guid_from_server): new function
	(send_begin): parse the OK args

	* doc/dbus-specification.xml: add GUID to the auth protocol
2005-05-05 22:02:11 +00:00
John (J5) Palmieri
b4b85685f1 * Fix my name in previous changelog ;)
* python/proxies.py (ProxyObject.__getattr__): add further patch
  from Anthony Baxter to throw an AttributeError when python
  __special__ functions are called instead of marshling them over
  the bus (Bug#1685 comment 3).
2005-05-05 18:27:34 +00:00
John (J5) Palmieri
425257ddf9 * python/Makefile.am: changed to use pyexecdir for the binding
shared libraries (Bug#2494)

* python/exceptions.py: bring exceptions over from the bindings
  so they can be used in applications (Bug#2036)
  Make all exceptions derive from DBusException

* python/_dbus.py, python/proxies.py: implement __repr__ in a couple
  of classes so that print obj doesn't throw an exception (Bug #1685)
2005-05-05 18:01:45 +00:00