summaryrefslogtreecommitdiffstats
path: root/glib
Commit message (Collapse)AuthorAgeFilesLines
* * dbus/dbus-auth.c, dbus/dbus-connection.c, dbus/dbus-keyring.c,John (J5) Palmieri2005-11-304-17/+2
| | | | | | | | | | dbus/dbus-server-debug-pipe.c, glib/dbus-binding-tool-glib.c glib/dbus-glib-tool.c, glib/dbus-gparser.c, glib/dbus-gproxy.c test/test-segfault.c, test/test-utils.c, test/glib/test-dbus-glib.c, tools/dbus-cleanup-sockets.c tools/dbus-launch.c, tools/dbus-tree-view.c, tools/dbus-viewer.c: Various cleanup of dead code and compiler warnings (patch from Kjartan Maraas <kmaraas at gnome.org>)
* * glib/dbus-gmain.c (connection_setup_add_watch): plugged a leakJohn (J5) Palmieri2005-11-301-0/+1
| | | | (patch from Carlos Garnacho Parro <carlosg at gnome.org>
* 2005-11-27 Carlos Garcia Campos <carlosgc@gnome.org>Robert McQueen2005-11-273-14/+36
| | | | | * glib/dbus-gobject.c: Append a GValue instead of a basic type in method return message for property getters
* * configure.in: Add test/name-test/Makefile to the generatedJohn (J5) Palmieri2005-11-224-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefile list * dbus/dbus-shared.h (#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT): New flag which replaces DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT (#define DBUS_NAME_FLAG_DO_NOT_QUEUE): New flag for specifying not to queue an ower if it can't be the primary owner * bus/bus.h: Add new internal BusOwner struct * bus/driver.c (bus_driver_handle_hello): Send flags (0 for default) to bus_registry_ensure and don't set the prohibit_replacement flag since they are now set per BusOwner and not per name. (bus_driver_handle_list_queued_owners): bus method (ListQueuedOwners) that returns the list of connections in a name's connection queue * bus/services.c (struct BusService): remove prohibit_replacement field (struct BusOwner): new struct for keeping track of queued connections and their associated flags for the queue (struct BusRegistry): add a BusOwner memory pool (bus_registry_new): initialize the BusOwner memory pool (bus_registry_unref): free the BusOwner memory pool (_bus_service_find_owner_link): new internal method for searching the queue for a specific connection (bus_owner_set_flags): new method for adding setting the flags on a bus owner (bus_owner_new): new method that creates a BusOwner object from the pool and sets its flags (bus_owner_ref, bus_owner_unref): ref counting for BusOwner objects (bus_registry_ensure): Add the flags parameter (bus_registry_acquire_service): Switch from using raw connections to using the BusOwner struct Add new state machine for dealing with the new set of flags (bus_registry_set_service_context_table, struct OwnershipCancelData, cancel_ownership, free_ownership_cancel_data, add_cancel_ownership_to_transaction, struct OwnershipRestoreData, restore_ownership, free_ownership_restore_data, add_restore_ownership_to_transaction): Switch to using BusOwner instead of raw connections (bus_service_add_owner): Add flags parameter Switch to using BusOwner instead of raw connections Add state machine for dealing with the new set of flags (bus_service_swap_owner): Swaps the first and second owners in the queue. Used to make sure proper signals are sent when a service looses or gains primary ownership. We never insert an owner at the top of the queue. Instead we insert it in the second position and then swap. (bus_service_remove_owner): Remove the owner from the queue sending out the NameLost and NameOwnerChanged signals if the we were the primary owner (bus_service_get_primary_owners_connection): New method that extracts the connection from the primary owner (bus_service_get_primary_owner): Returns the BusOwner instead of the connection (bus_service_get_allow_replacement): Changed from the old bus_service_get_prohibit_replacement method. Checks the flags of the primary owner and returns if it can be replaced or not (bus_service_set_prohibit_replacement): removed (bus_service_has_owner): returns TRUE if and owner with the specified connection exists in the queue * dbus/dbus-bus.c (dbus_bus_connection_get_unique_name): New helper method that only compiles if tests are enabled. Allows us to get the unique name of a connection so we can check it against the queue when doing regression tests * bus/activation.c (bus_activation_send_pending_auto_activate), bus/dispatch.c (bus_dispatch), bus/driver.c (bus_driver_handle_get_service_owner, bus_driver_handle_get_connection_unix_user, bus_driver_handle_get_connection_unix_process_id, bus_driver_handle_get_connection_selinux_security_context), bus/signals.c (connection_is_primary_owner): use bus_service_get_primary_owners_connection instead of bus_service_get_primary_owner * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket, _dbus_listen_unix_socket): Calculate the length of the socket path and use that instead of using a fixed length which was causing socket names to contain many trailing Nul bytes. * dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c (dbus_g_method_get_sender): New method for extracting the sender from a DBusGMethodInvocation (dbus_g_method_return_get_reply): changed name to dbus_g_method_get_reply (dbus_g_method_return_send_reply): changed name to dbus_g_method_send reply * doc/dbus-specification.xml: New docs that describe how the new queueing system works and talks about the changes to the how we specify socket names * glib/examples/example-service.c, glib/examples/example-signal-emitter.c, glib/examples/statemachine/statemachine-server.c: Changed the RequestName flags to the new system * test/name-test/ (test-names.c, run-test.sh, Makefile.am): New regression test suite for testing various states of the new queueing system
* 2005-11-15 Robert McQueen <robot101@debian.org>Robert McQueen2005-11-151-0/+34
| | | | | | | | | | | | * dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c: Patch from Rob Taylor to add two methods, dbus_g_method_return_get_reply and dbus_g_method_return_send_reply, to allow you to get the reply message from a DBusGMethodInvocation, append arbitrary stuff to it, and send it. The GLib bindings can't marshal a return value of something like a(s) if the array is empty - ultimately they should be made to heed the signature of the out arguments as the Python bindings now can, but this is a workable interim solution which might have other applications.
* 2005-10-29 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-293-5/+5
| | | | | | | | | | | | * glib/Makefile.am, glib/examples/Makefile.am, glib/examples/statemachine/Makefile.am: Merge patch from Ubuntu by Daniel Stone to replace explicit calls to libtool with $(LIBTOOL). * test/python/.cvsignore: Add run-with-tmp-session-bus.conf. * tools/dbus-monitor.1, tools/dbus-monitor.c: Merge dbus-monitor patch from Ubuntu by Daniel Silverstone to allow specifying match rules on the command line.
* CleanupsRoss Burton2005-10-271-0/+1
|
* Add const keywordsRoss Burton2005-10-252-2/+2
|
* Add a NoReply annotationRoss Burton2005-10-252-17/+39
|
* * glib/dbus-gvalue-utils.c (hash_free_from_gtype): handle gdoubleJohn (J5) Palmieri2005-10-182-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | and G_TYPE_VALUE_ARRAY (DBUS_TYPE_STRUCT) (gvalue_from_hash_value, hash_value_from_gvalue): handle gdouble * glib/dbus-gvalue.c (dbus_gvalue_to_signature): add missing DBUS_STRUCT_BEGIN_CHAR and DBUS_STRUCT_END_CHAR charaters when constructing struct signatures * python/_dbus.py (Bus): handle private connections using the private keyword in the constructor. defaults to private=False (Bus::close): new method to close a connection to the bus * python/dbus_bindings.pyx (Connection::close): renamed method was previously called disconnect (bus_get): now supports getting a private connection * python/proxies.py (ProxyMethod::__call__): check if ignore_reply keyword is set to True. if it is, execute the method without waiting for a reply (ProxyObject::_introspect_execute_queue): new method for executing all the pending methods that were waiting for the introspect to finish. this is called when introspect either succeeds or fails (ProxyObject::_introspect_error_handler): call queued methods
* * glib/dbus-gvalue.c (marshal_variant): call _dbus_gvalue_marshalJohn (J5) Palmieri2005-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of marshal basic so we can handle recursive types in a variant * test/glib/test-dbus-glib.c: Add test for marshaling recurive types in variants * test/glib/test-service-glib.c, test-service-glib.xml (my_object_echo_variant [EchoVariant], my_object_process_variant_of_array_of_ints123 [ProcessVariantOfArrayOfInts123]): Add two test methods * python/introspect_parser.py: New module for parsing introspect data. * python/dbus_bindings.pyx: (various places): when throwing errors fix to use errormsg instead of message local variable because Pyrex can get confused with other message variables (initial patch by Robert McQueen <robert.mcqueen at collabora.co.uk>) (MessageIter::parse_signature_block): new method for getting the next block in a signiture. (MessageIter::append_strict): new method for appending values strictly using the passed in signature instead of guessing at the type (MessageItter:: append_dict, append_struct, append_array): use signatures to marshal children if the signature is available * python/exceptions.py (IntrospectionParserException): new exception * python/proxies.py (ProxyMethod::__call__): Marshal args with introspected signatures if available, else we fall back to the old way of doing things. (ProxyObject::_introspect_reply_handler ): parse introspection data * python/service.py (ObjectType::_reflect_on_method): Properly terminate <method> if there are no args in the reflection data * test/python/test-client.py: add tests for talking with the GLib test server. This gives us better coverage for introspection since python to python will always generate arguments as variants. It also allows us to test the robustness of the GLib bindings and interlanguage communications.
* * glib/dbus-glib-tool.c: removed extra comma at the end of theJohn (J5) Palmieri2005-09-261-1/+2
| | | | | DBusBindingOutputMode enum which was causing a warning. #include <time.h> so using time_t is explicitly defined
* * Released 0.50dbus-0.50John (J5) Palmieri2005-09-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Patch from Steve Grubb: - bus/activation.c (bus_activation_service_reload_test): clean up some indentation - dbus/dbus-keyring.c (_dbus_keyring_reload): fix conditional - dbus/dbus-message-factory.c (generate_special): fix a couple of buffer overflows in the test suite. This is non critical because it can not be exploited and this code is only run when doing a make check. * Patch from Yaakov Selkowitz: Build fixes for Cygwin - configure.in: Don't check and link against kdecore, only qt headers - dbus/Makefile.am: Add -no-undefined to libdbus_1_la_LDFLAGS - gcj/org/freedesktop/dbus/Makefile.am: add libdbus_gcj_1_la_LDFLAGS = -no-undefined - glib/Makefile.am: Add -no-undefined to libdbus_glib_1_la_LDFLAGS and $(DBUS_GLIB_LIBS) to dbus_binding_tool_LDADD - qt/Makefile.am: Add -no-undefined to libdbus_qt_1_la_LDFLAGS - tools/Makefile.am: Add platform extentions to binaries (i.e. .exe on windows) * configure.in: - Make it so if no suitable version of python is found we only disable building python instead of exiting the configure script - Require version 2.4 of glib for glib bindings - Up version to 0.50 * python/__init__.py: Sync version with libdbus to (0,50,0)
* 2005-08-25 Colin Walters <walters@verbum.org>Colin Walters2005-08-261-1/+2
| | | | | * glib/dbus-gproxy.c (dbus_g_proxy_call): Doc update, thanks to Ryan Lortie for the suggestion.
* Unref message and protect against NULLRoss Burton2005-08-171-1/+4
|
* 2005-08-16 Colin Walters <walters@verbum.org>Colin Walters2005-08-161-1/+1
| | | | | * glib/dbus-gobject.c (dbus_set_g_error): Don't lose if the DBusError message is NULL.
* 2005-08-04 Colin Walters <walters@verbum.org>Colin Walters2005-08-0411-302/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gvalue-utils.h (_dbus_g_type_specialized_builtins_init) (dbus_g_type_is_fixed, dbus_g_type_fixed_get_size) (dbus_gvalue_set_from_pointer, dbus_g_hash_table_value_foreach) (dbus_g_hash_table_insert_values, dbus_g_hash_table_insert_steal_values) (dbus_gtype_is_valid_hash_key, dbus_gtype_is_valid_hash_value) (dbus_g_hash_func_from_gtype, dbus_g_hash_free_from_gtype) (dbus_g_hash_equal_from_gtype, dbus_gvalue_stor, dbus_gvalue_take): * glib/dbus-gvalue.h (dbus_g_value_types_init) (dbus_gvalue_demarshal, dbus_gvalue_demarshal_variant) (dbus_gvalue_demarshal_message, dbus_gvalue_marshal): Prefix name with _ to ensure they're not exported. All callers updated. * glib/dbus-gvalue.c (typecode_to_gtype) (dbus_typecode_maps_to_basic, basic_typecode_to_gtype) (signature_iter_to_g_type_dict) (signature_iter_to_g_type_array) (dbus_gtype_from_signature_iter, dbus_gtype_from_signature) (dbus_gtypes_from_arg_signature): Move to dbus-gsignature.c. * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Call dbus_g_type_specialized_builtins_init instead of dbus_g_value_types_init. (dbus_binding_tool_output_glib_client): Ditto. * glib/Makefile.am (DBUS_GLIB_INTERNALS): Add dbus-gsignature.c and dbus-gsignature.h * test/glib/test-service-glib.c (my_object_rec_arrays): Delete unused variable.
* 2005-08-03 Colin Walters <walters@verbum.org>Colin Walters2005-08-031-0/+150
| | | | | * glib/dbus-gobject.c: Add tests on hardcoded object info; this should catch any incompatible changes accidentally made.
* 2005-08-01 Colin Walters <walters@verbum.org>Colin Walters2005-08-011-2/+2
| | | | | | | Patch from Joe Markus Clarke: * glib/dbus-gidl.c (property_info_unref, arg_info_unref): Fix use-after-free.
* 2005-08-01 Colin Walters <walters@verbum.org>Colin Walters2005-08-013-9/+8
| | | | | | | | | | Patch from Joe Markus Clarke: * glib/dbus-gvalue.c (dbus_g_value_types_init): * glib/dbus-gvalue-utils.c (dbus_g_type_specialized_builtins_init) * glib/dbus-gobject.c (write_interface): Don't use C99 style initializers (bug #3933).
* 2005-07-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-07-313-5/+5
| | | | * fix a bunch of Doxygen warnings and mistakes
* Remove matchers when all proxies are removedRoss Burton2005-07-251-0/+6
|
* 2005-07-24 Colin Walters <walters@verbum.org>Colin Walters2005-07-241-5/+0
| | | | | | | | | * glib/dbus-gvalue.c (signature_iter_to_g_type_array): Don't require typedata; recursive arrays won't have it. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Add recursive arrays tests.
* * glib/Makefile.am: Add make-dbus-glib-error-switch.sh to EXTRA_DISTJohn (J5) Palmieri2005-07-153-2/+4
| | | | | | | | | | | | | so distcheck doesn't fail * glib/examples/Makefile.am: Add example-service.xml and example-signal-emitter.xml to EXTRA_DIST so distcheck doesn't fail * glib/examples/statemachine/Makefile.am: Add statemachine.xml and statemachine-server.xml to EXTRA_DIST so distcheck doesn't fail * python/Makefile.am: Preprend $(srcdir)/ to source files so the compiler looks in the right places during distcheck
* * glib/example/Makefile.am: Fix a typo which cause make distcheckJohn (J5) Palmieri2005-07-151-1/+1
| | | | to fail
* Don't leak messages when calling methodsRoss Burton2005-07-151-0/+1
|
* 2005-07-12 Colin Walters <walters@verbum.org>Colin Walters2005-07-123-5/+5
| | | | | | | | | | * glib/examples/statemachine/Makefile.am (statemachine-server-glue.h) (statemachine-glue.h): * glib/examples/Makefile.am (example-service-glue.h) (example-signal-emitter-glue.h): * glib/Makefile.am (dbus-glib-error-switch.h): Add libtool --mode=execute so we use the built library instead of any installed one.
* 2005-07-11 Colin Walters <walters@verbum.org>Colin Walters2005-07-114-203/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gvalue.c (struct _DBusGValue): Delete. (dbus_g_value_types_init): Remove assertion. (dbus_g_value_get_g_type, dbus_g_value_open) (dbus_g_value_iterator_get_values, dbus_g_value_get_signature) (dbus_g_value_copy, dbus_g_value_free): Delete unimplemented functions related to DBusGValue. Now we marshal/demarshal structures as GValueArray. (dbus_gtype_from_signature_iter): Return G_TYPE_VALUE_ARRAY for structures. (signature_iter_to_g_type_array): Don't call signature_iter_to_g_type_struct. (signature_iter_to_g_type_struct): Delete. (dbus_gvalue_to_signature): Delete. (dbus_gvalue_to_signature): New function with same name as other one; we can convert structures to signatures. (demarshal_valuearray): New function. (get_type_demarshaller): Use it. (demarshal_recurse): Delete. (marshal_proxy): New function. (marshal_map): Warn if we can't determine signature from type. (marshal_collection_ptrarray): Ditto. (marshal_collection_array): Ditto. (get_type_marshaller): Use marshal_valuearray. (marshal_recurse): Delete. (_dbus_gvalue_test): Add some tests. * dbus/dbus-glib.h (struct _DBusGValueIterator): (dbus_g_value_get_g_type, DBUS_TYPE_G_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): Remove prototypes. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_lookup_function): Handle G_TYPE_VALUE_ARRAY. * glib/examples/example-service.c: * glib/examples/example-client.c: Implement GetTuple. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Add structure tests.
* 2005-07-10 Colin Walters <walters@verbum.org>Colin Walters2005-07-107-166/+479
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/TODO: Knock off some GLib items with this patch. * glib/dbus-gvalue-utils.c (_dbus_gtype_can_signal_error) (_dbus_gvalue_signals_error): New functions. * glib/dbus-gvalue-utils.h: Prototype them. * glib/dbus-gobject.c (arg_iterate): Update to handle return vals and change to not output const/retval flags for input args. All callers updated. (invoke_object_method): Refactor to handle return values. Add some more comments in various places. Remove debug g_print. * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_RETURNVAL): New. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_marshal_name): Handle G_TYPE_NONE. (compute_gsignature): New function; refactored from code from compute_marshaller and compute_marshaller_name. Enhance to handle return values and async ops more cleanly. Update for async ops returning NONE instead of BOOLEAN. (compute_marshaller, compute_marshaller_name): Call compute_gsignature and output appropriate string. (generate_glue): Handle return value annotation. Also don't dump constness flag for input arguments. * glib/Makefile.am (DBUS_GLIB_INTERNALS): New variable; contains files shared between installed library and utilities. (libdbus_glib_1_la_SOURCES): Move some stuf into DBUS_GLIB_INTERNALS. (libdbus_gtool_la_SOURCES): Suck in DBUS_GLIB_INTERNALS so the binding tool can access gtype utility functions. * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: * test/glib/test-dbus-glib.c: Add some tests for return values.
* 2005-07-09 Colin Walters <walters@verbum.org>Colin Walters2005-07-094-29/+52
| | | | | | | | | | | | | | | | | * glib/dbus-gparser.c (parse_annotation): Add annotations to argument if available, not method. * glib/dbus-gobject.c (arg_iterate): More verbose warnings. (invoke_object_method): First, remove some redundant GValues (object_value, error_value) in favor of working on array directly. Second, rework constness to be less buggy. Now we iterate directly over the argument metadata instead of parallel iterating over output signature and metadata. * glib/dbus-glib-tool.h: Add INVALID_ANNOTATION error. * glib/dbus-binding-tool-glib.c (generate_glue): Barf on const annotation on input args.
* 2005-07-09 Colin Walters <walters@verbum.org>Colin Walters2005-07-096-8/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_CONST): Define. * glib/dbus-binding-tool-glib.c (generate_glue): Handle Const annotation. * glib/dbus-gobject.c (arg_iterate): Update to parse constval too. (method_dir_signature_from_object_info): Handle arg_iterate change. (write_interface): Ditto. (lookup_object_info): Don't barf if format_version is > 0. (invoke_object_method): Handle arg constness. * glib/dbus-gidl.c (struct ArgInfo): Add annotations. (arg_info_new): Create. (arg_info_unref): Destroy. (arg_info_get_annotations, arg_info_get_annotation) (arg_info_add_annotation): New functions. * glib/dbus-gidl.h: Prototype them. * glib/dbus-gparser.c (parse_annotation): Allow annotations in args, disallow them in properties. (parse_annotation): Handle arg annotations. * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c: Update to make some methods const.
* 2005-07-08 Colin Walters <walters@verbum.org>Colin Walters2005-07-099-259/+555
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c: * test/glib/test-dbus-glib.c: Test a{sv}. * glib/examples/statemachine/statemachine.c: * glib/examples/statemachine/statemachine-server.c: * glib/examples/statemachine/statemachine-client.c: Fix some bugs, add progress bar, etc. * glib/dbus-gvalue.c (register_array, register_dict): Delete; not needed anymore due to generic array/map marshalling. (dbus_g_value_types_init): Don't register basic arrays or the string/string hash. (dbus_gtype_from_signature_iter): Don't try to recurse into variants. (dbus_gtype_to_signature): Check collection/map before type metadata. (demarshal_garray_basic): Renamed to demarshal_collection_array. (demarshal_ghashtable): Renamed to demarshal_map; fix to use new generic map creation/append functions instead of hash table specifically. (get_type_demarshaller): Handle maps. (demarshal_collection): Dispatch on collection type to either demarshal_collection_ptrarray or demarshal_collection_array. (get_type_marshaller): Handle maps. (marshal_collection): Dispatch collection type to either marshal_collection_ptrarray or marshal_collection_array. (_dbus_gvalue_test): New test. * glib/dbus-gvalue-utils.c (unset_and_free_g_value): New function. (hash_free_from_gtype): Use it to free GValues. (hashtable_append): New function. (ptrarray_append): Fix prototype. (slist_append): Ditto. (_dbus_gvalue_utils_test): Extend tests. * glib/dbus-gtype-specialized.c (dbus_g_type_specialized_init_append): Renamed from dbus_g_type_specialized_collection_init_append. Remove const from value, since we steal it. (dbus_g_type_specialized_map_append): New function. * glib/dbus-gtype-specialized.h: Update prototypes. Add DBusGTypeSpecializedMapAppendFunc. * glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run _dbus_gvalue_test. * glib/dbus-gtest.h: Prototype it.
* Make async bindings work againRoss Burton2005-07-081-18/+13
|
* 2005-07-08 Colin Walters <walters@verbum.org>Colin Walters2005-07-0823-107/+1983
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2005-07-06 Colin Walters <walters@verbum.org>Colin Walters2005-07-065-353/+390
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-glib.h (DBusGPendingCall, DBusGPendingCallNotify) (DBUS_TYPE_G_PENDING_CALL, dbus_g_pending_call_get_g_type) (dbus_g_pending_call_ref, dbus_g_pending_call_unref): Delete. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete in favor of dbus_g_proxy_begin_call and dbus_g_proxy_cancel_call. (DBusGProxyCall, DBusGProxyCallNotify): New. (dbus_g_proxy_begin_call): Change prototype to take callback, user data, and destroy function. This replaces dbus_g_pending_call_set_notify. (dbus_g_proxy_cancel_call): Prototype. (DBusGAsyncData): Delete, shouldn't be needed anymore. * glib/dbus-gproxy.c (struct _DBusGProxy): Add call_id_counter and pending_calls map. (struct _DBusGProxyManager): Add bus_proxy member, which is an internal proxy for calls to the bus. Remove pending_nameowner_calls, now the internal proxy keeps track. (dbus_g_proxy_manager_unref): Unref bus proxy, remove reference to pending_nameowner_calls. (got_name_owner_cb): Update prototype, and use dbus_g_proxy_end_call. (got_name_owner_cb): Remove reference to pending_nameowner_calls. (dbus_g_proxy_manager_register): Delete directly libdbus code in favor of using internal proxy. (dbus_g_proxy_manager_unregister): Update to use dbus_g_proxy_cancel_call for any pending GetNameOwner call. (dbus_g_proxy_init): Initialize pending calls map. (dbus_g_proxy_constructor): New. (dbus_g_proxy_class_init): Add get/set property functions, constructor, and add NAME, PATH, and INTERFACE properties. (cancel_pending_call): New function. (dbus_g_proxy_dispose): Iterate over any outstanding calls and cancel them. (dbus_g_proxy_set_property, dbus_g_proxy_get_property): New. (GPendingNotifyClosure): New structure. (d_pending_call_notify, d_pending_call_free): Moved here from dbus-glib.c. (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Moved around to satisfy function ordering. (manager_begin_bus_call): New internal function for talking to internal bus proxy. (dbus_g_proxy_new): Construct object using GObjet properties. (dbus_g_proxy_begin_call_internal): Update to take user data, etc. Create closure of same, and insert call into map of pending calls. (dbus_g_proxy_end_call_internal): Take call id instead of pending call. Look up pending call in current set. Remove it when we've completed. (dbus_g_pending_call_end, dbus_g_proxy_end_call_internal): Delete. (dbus_g_proxy_begin_call): Change API to take callback, user data, and destroy function directly. (dbus_g_proxy_end_call): Update to take DBusGProxyCall. (dbus_g_proxy_call): Invoke with NULL callback. (dbus_g_proxy_cancel_call): New function, replaces dbus_g_pending_call_cancel. * glib/dbus-gparser.c (validate_signature): Fix call to dbus_set_g_error. * glib/dbus-gobject.c (dbus_g_object_type_dbus_metadata_quark): New quark for attaching metadata to GType. (info_hash): Delete. (lookup_object_info): Look up using quark. (dbus_g_object_type_install_info): Check that a type is classed, not that it's an object. Also just install type data using quark instead of using global hash. * glib/dbus-glib.c (dbus_g_pending_call_ref) (dbus_g_pending_call_unref, dbus_pending_call_get_g_type) (GPendingNotifyClosure): Delete. (d_pending_call_notify, d_pending_call_free): Move to dbus-gproxy.c. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete. * glib/dbus-binding-tool-glib.c (generate_client_glue): Disable async client method generation until we can fix it... * tools/dbus-viewer.c (load_child_nodes): Use dbus_g_proxy_call. (load_from_service_thread_func): Ditto. * tools/dbus-names-model.c (struct NamesModel): Hold DBusGProxyCall. (have_names_notify): Update prototype, use dbus_g_proxy_cancel_call. (names_model_reload): Update for new dbus_g_proxy_begin_call API. * tools/dbus-monitor.c (filter_func): Update for print_message API change. * test/glib/test-dbus-glib.c: Add more tests for async invocations. Update many begin_call/end_call pairs to just use dbus_g_proxy_call. * tools/dbus-send.c (main): Add --print-reply=literal mode. This allows us to dump print-introspect.c. * tools/dbus-print-message.h (print_message): Add literal argument to print_message which is intended to allow printing arguments without metadata like "string=". * tools/dbus-print-message.c (print_iter): Add literal argument. (print_message): Allow printing string messages literally.
* 2005-07-05 Colin Walters <walters@verbum.org>Colin Walters2005-07-051-4/+3
| | | | | | | * glib/dbus-gproxy.c (marshal_dbus_message_to_g_marshaller): Remove value refcount leak, original patch from Jorn Baayen <jorn@openedhand.com>. Also remove useless extra value in favor of prepending to value array directly.
* 2005-07-02 Colin Walters <walters@verbum.org>Colin Walters2005-07-021-2/+2
| | | | * glib/dbus-gmain.c (_dbus_gmain_test): Fix test.
* 2005-07-01 Colin Walters <walters@verbum.org>Colin Walters2005-07-011-2/+31
| | | | | | | | | Patch from Jonathan Matthew <jonathan@kaolin.hn.org> * glib/dbus-gvalue.c (basic_typecode_to_gtype): Fix return type. (dbus_g_value_types_init): Marshal G_TYPE_CHAR as DBUS_TYPE_BYTE, G_TYPE_LONG as DBUS_TYPE_INT32, G_TYPE_ULONG as DBUS_TYPE_UINT32, and G_TYPE_FLOAT as DBUS_TYPE_DOUBLE.
* 2005-06-30 Colin Walters <walters@verbum.org>Colin Walters2005-06-305-50/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Update tests for new error setting bits, also add async tests (patch from Ross Burton). * test/glib/Makefile.am (test_service_glib_LDADD): Add DBUS_GLIB_THREADS_LIBS. * glib/dbus-gproxy.c (get_name_owner) (dbus_g_pending_call_end_valist): Ditto. * glib/dbus-gobject.c (error_metadata): New mapping from GError domain (GQuark) to DBusGErrorInfo. (gerror_domaincode_to_dbus_error_name): Attempt to look up error quark in error_metadata. Take message interface as default error message interface. (gerror_to_dbus_error_message): Pass message interface. (dbus_set_g_error): Resurrected. (dbus_g_error_info_free): New function. (dbus_g_object_type_install_info): Use g_type_class_ref instead of _peek to actually create the object class if it hasn't been created yet. (dbus_g_error_domain_register): New function. * glib/dbus-gmain.c (dbus_g_bus_get): Switch to dbus_set_g_error. * glib/dbus-gparser.c (validate_signature): Ditto. * dbus/dbus-glib.h (dbus_g_error_set): Delete. (dbus_g_error_domain_register): Prototype. * glib/dbus-glib.c (dbus_g_error_set): Delete. Update tests.
* 2005-06-29 Colin Walters <walters@verbum.org>Colin Walters2005-06-292-101/+68
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-glib.h: Delete DBUS_TYPE_G_PROXY_ARRAY. Add DBUS_TYPE_G_OBJECT_PATH. * glib/dbus-gvalue.c (dbus_g_value_types_init): Remove marshallers for G_TYPE_OBJECT and DBUS_TYPE_G_PROXY_ARRAY (the latter should be handled more generically). Add DBUS_TYPE_G_OBJECT_PATH. (dbus_g_object_path_get_g_type): New function. (dbus_gtype_from_signature_iter): Map DBUS_TYPE_OBJECT_PATH to DBUS_TYPE_G_OBJECT_PATH by default. (demarshal_proxy): Remove unused name variable. (demarshal_object_path, marshal_object_path): New functions. (demarshal_proxy_array, marshal_proxy_array): Delete. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_c_name): Map DBUS_TYPE_G_OBJECT_PATH to char *. (dbus_g_type_get_lookup_function): Map builtin DBUS_TYPE_G_OBJECT_PATH. * test/glib/test-dbus-glib.c * test/glib/test-service-glib.c (my_object_objpath): Adapt tests to new object path marshalling.
* 2005-06-29 Colin Walters <walters@verbum.org>Colin Walters2005-06-291-2/+2
| | | | | | | Patch from Ross Burton <ross@openedhand.com> * glib/dbus-gobject.c (invoke_object_method): Unset object value in all cases, not only in async case.
* 2005-06-29 Colin Walters <walters@verbum.org>Colin Walters2005-06-293-114/+689
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gproxy.c (struct _DBusGProxy): Add new member name_call for keeping track of any outgoing GetNameOwner call. Also add for_owner and associated. (struct _DBusGProxyManager): Add owner_names, which is hash table that maps a base name to a list of names it owns (that we're interested in). Add pending_nameowner_calls which is a list of all outstanding GetNameOwner; avoids us having to iterate over every proxy. Add unassociated_proxies which keeps track of name proxies with no associated name owner. (dbus_g_proxy_manager_unref): Destroy owner_names. (struct DBusGProxyNameOwnerInfo): New struct for keeping track of name refcounts. (find_name_in_info, name_owner_foreach) (dbus_g_proxy_manager_lookup_name_owner, insert_nameinfo) (dbus_g_proxy_manager_monitor_name_owner) (dbus_g_proxy_manager_unmonitor_name_owner) (unassociate_proxies, dbus_g_proxy_manager_replace_name_owner): New functions; they manipulate the owner_names mapping. (got_name_owner_cb): New function. (get_name_owner): New function, extracted from dbus_g_proxy_new_for_name_owner. (dbus_g_proxy_manager_register): For now we need to keep track of all NameOwnerChanged. Also if the proxy is for a name, if we don't already know the name owner, queue a new GetNameOwner request and add it to our list of unassociated proxies. Otherwise inc the refcount. (dbus_g_proxy_manager_unregister): If this proxy is for a name, cancel any pending GetNameOwner call, etc. (dbus_g_proxy_manager_filter): Handle NameOwnerChanged. Also use the owner_names mapping to look up the current names for the signal source, and dispatch to any proxies for that name. (dbus_g_proxy_new): Initialize new members. (dbus_g_proxy_new_for_name): Delete unused proxy variable. (dbus_g_proxy_new_for_name_owner): Use get_name_owner. (dbus_g_pending_call_end_valist): New function, extracted from dbus_g_proxy_end_call_internal. Useful when we don't have a proxy but want to use the GLib infrastructure. Also note how many arguments in reply were over. (dbus_g_pending_call_end): New function, just call dbus_g_pending_call_end_valist. (dbus_g_proxy_end_call_internal): Just call dbus_g_pending_call_end_valist. * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Fix lookup of builtin marshaller for STRING_STRING_STRING. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Extend tests to cover name proxies, destruction of owner proxies, etc. * glib/examples/example-signal-recipient.c (dbus_g_proxy_new_for_name_owner): Create a name proxy. * tools/dbus-send.c (main): Print D-BUS error name in addition to message.
* 2005-06-27 Colin Walters <walters@verbum.org>Colin Walters2005-06-271-7/+21
| | | | | | | | | | | | * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Test hash table signal emitting. * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Convert types to their fundamental basis types, since this is what marshallers operate on. Also add an entry for VOID__BOXED. (dbus_g_object_register_marshaller_array): Convert to fundamental.
* 2005-06-26 Colin Walters <walters@verbum.org>Colin Walters2005-06-268-22/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-22 Colin Walters <walters@verbum.org>Colin Walters2005-06-221-0/+1
| | | | | | Patch from Ross Burton <ross@openedhand.com> * glib/dbus-gobject.c (dbus_g_method_return): Free out_sig.
* 2005-06-20 Colin Walters <walters@verbum.org>Colin Walters2005-06-219-0/+565
| | | | | | | | | | | | | | | | | * 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-20 Colin Walters <walters@verbum.org>Colin Walters2005-06-212-9/+11
| | | | | | | | | | * 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-20 Colin Walters <walters@verbum.org>Colin Walters2005-06-201-1/+5
| | | | | | | | | | 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-18 Murray Cumming <murrayc@murrayc.com>Murray Cumming2005-06-193-6/+6
| | | | | | | | | | | * 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-17 Colin Walters <walters@verbum.org>Colin Walters2005-06-173-244/+394
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.