summaryrefslogtreecommitdiffstats
path: root/glib
Commit message (Collapse)AuthorAgeFilesLines
* 2005-06-14 Colin Walters <walters@verbum.org>Colin Walters2005-06-143-130/+145
| | | | | | * glib/dbus-binding-tool-glib.c: * glib/dbus-gobject.c: * glib/dbus-gvalue.c: Fix indentation and brace style.
* 2005-06-14 Ross Burton <ross@burtonini.com>.Colin Walters2005-06-142-49/+71
| | | | | | | | | | | | | * 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 Colin Walters <walters@verbum.org>Colin Walters2005-06-141-0/+6
| | | | | * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Add missing return statements, noticed by Ross Burton.
* 2005-06-13 Ross Burton <ross@burtonini.com>.Colin Walters2005-06-132-7/+12
| | | | | | * glib/dbus-gobject.c: Handle errors on message demarshalling by sending error message back. * glib/dbus-gvalue.c: Initialize return variables.
* 2005-06-13 Colin Walters <walters@verbum.org>Colin Walters2005-06-131-1/+1
| | | | * glib/Makefile.am: Fix thinko in last patch.
* 2005-06-13 Colin Walters <walters@verbum.org>Colin Walters2005-06-131-2/+6
| | | | | | * glib/Makefile.am: Move dbus-gtype-specialized.c and dbus-gtype-specialized.h into a _HEADERS variable, install them.
* 2005-06-12 Colin Walters <walters@verbum.org>Colin Walters2005-06-1313-784/+4185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * glib/dbus-gmain.c (io_handler_dispatch): fix deadlockJohn (J5) Palmieri2005-05-161-7/+1
| | | | | | | | | | | | 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-11 Ross Burton <ross@burtonini.com>Colin Walters2005-05-113-8/+18
| | | | | | | | | | * 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-03 Ross Burton <ross@burtonini.com>Colin Walters2005-05-031-4/+14
| | | | | | | * glib/dbus-gobject.c (dbus_g_connection_register_g_object): Return if we get an error during registration. Set up a weak reference on object to unregister if object is destroyed. (unregister_gobject): New function.
* 2005-04-18 David Zeuthen <davidz@redhat.com>David Zeuthen2005-04-191-0/+3
| | | | | | * glib/dbus-gmain.c (io_handler_destroy_source): (timeout_handler_destroy_source, connection_setup_free): Also unref the source to avoid memory leaks.
* 2005-04-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-04-131-3/+3
| | | | | | * glib/dbus-gmain.c (message_queue_dispatch): only dispatch one message at a time to avoid monopolizing the main loop, bug #2953 from Benjamin Otte
* 2005-04-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-04-092-0/+4
| | | | | | | | | | | | * dbus/dbus-message-util.c (_dbus_message_test): fix signedness warning * glib/dbus-glib-tool.c (main): fix warning * glib/dbus-binding-tool-glib.c (generate_glue): fix warning * dbus/dbus-connection.c (dbus_connection_read_write_dispatch): add a new function that can be used in simple applications that don't have a main loop and are willing to block
* 2005-04-05 David Zeuthen <davidz@redhat.com>David Zeuthen2005-04-061-8/+6
| | | | | | | | | | | | | | | | Fix https://bugs.freedesktop.org/show_bug.cgi?id=2889 * glib/dbus-gmain.c: (io_handler_destroy_source): Remove from list of IO handlers of the ConnectionSetup object (timeout_handler_destroy_source): -do- for timeout handlers (io_handler_source_finalized): Don't remove from list since we now do that in io_handler_destroy_source(). Renamed from io_handler_source_destroyed (timeout_handler_source_destroyed): -do- for timeout handlers (connection_setup_free): It is now safe to iterate over all IO and timeout handlers as the _destroy_source removes them from the list synchronously
* 2005-03-17 Colin Walters <walters@verbum.org>Colin Walters2005-03-172-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * bus/print-introspect.c: Move to tools/. * bus/run-with-tmp-session-bus.sh: Ditto. * glib/Makefile.am (dbus-glib-bindings.h): Move generation to tools/Makefile.am. * test/glib/run-test.sh: Update to handle move of run-with-tmp-session-bus.sh. * test/glib/test-service-glib.c: Update to handle move of dbus-glib-bindings.h. * tools/print-introspect.c: Moved here from bus/, and ported to GLib bindings. * tools/run-with-tmp-session-bus.sh: Moved here from bus/. * tools/Makefile.am: Generate dbus-glib-bindings.h and dbus-bus-introspect.xml here. * tools/.cvsignore, glib/.cvsignore, bus/.cvsignore: Update.
* 2005-03-12 Colin Walters <walters@verbum.org>Colin Walters2005-03-124-11/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/driver.c (write_args_for_direction): New function, parses a type signature into arguments and outputs to XML. (bus_driver_handle_introspect): Use it instead of hardcoding XML for certain signatures. * bus/Makefile.am (dbus-bus-introspect.xml): Add dependency on dbus-daemon. * glib/dbus-glib-tool.c (main): Parse ignore_unsupported argument, pass it to dbus_binding_tool_output_glib_client. * glib/dbus-binding-tool-glib.c (generate_client_glue): Protect against multiple inclusion. (dbus_binding_tool_output_glib_client): Add G_BEGIN_DECLS/G_END_DECLS. * glib/dbus-binding-tool-glib.c (compute_client_method_name): Change to just take iface prefix directly. (write_formal_parameters): Clarify error message. (check_supported_parameters): New function; checks to see type signatures of method parameters are supported. (generate_client_glue): Handle ignore_unsupported flag. (dbus_binding_tool_output_glib_client): Handle ignore_unsupported parameter. * glib/Makefile.am (dbus-glib-bindings.h): Pass --ignore-unsupported by default until glib bindings support arrays.
* 2005-03-11 Colin Walters <walters@verbum.org>Colin Walters2005-03-122-0/+9
| | | | | | | | | | | | | | | | | | | | | * glib/Makefile.am: Generate dbus-glib-bindings.h and install it. * bus/print-introspect.c: New file; prints introspection data for a given name and object path. * bus/run-with-tmp-session-bus.sh: New file, refactored from test/glib/run-test.sh. Creates a temporary session bus and runs another program. * test/glib/run-test.sh: Refactor to invoke run-with-tmp-session-bus.sh. * bus/driver.c (bus_driver_handle_introspect): Fix to print new introspection format. Also change to use DBUS_TYPE_x_AS_STRING macros instead of hardcoding. * glib/.cvsignore, bus/.cvsignore, test/glib/.cvsignore: Update.
* 2005-03-09 Colin Walters <walters@verbum.org>Colin Walters2005-03-094-144/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gproxy.c (dbus_g_proxy_invoke): New method; calls to this are generated for client-side wrappers. Invokes a D-BUS method and returns reply values. * glib/dbus-binding-tool-glib.c (write_args_sig_for_direction): New function; writes signature string for argument direction. (write_args_for_direction): Change to pass input values directly instead of via address, and fix indentation. (generate_client_glue): Change to invoke dbus_g_proxy_invoke. Also make generated wrappers inlineable. * dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Add note about using dbus_type_is_fixed. * dbus/dbus-marshal-basic.c (_dbus_type_is_fixed): Moved to dbus/dbus-signature.c as dbus_type_is_fixed. All callers updated. * dbus/dbus-signature.c (dbus_type_is_fixed): Moved here from dbus/dbus-marshal-basic.c:_dbus_type_is_fixed. * dbus/dbus-signature.h: Prototype. * glib/dbus-binding-tool-glib.c (compute_marshaller_name): Fix error printf code. * test/glib/test-dbus-glib.c (main): Be sure to clear error as appropriate instead of just freeing it. (main): Free returned strings using g_free. * test/glib/Makefile.am (test-service-glib-glue.h) (test-service-glib-bindings.h): Add dependency on dbus-binding-tool. * glib/dbus-gvalue.c (MAP_BASIC): Refactored from MAP_BASIC_INIT; simply maps a simple D-BUS type to GType. (dbus_dbus_type_to_gtype): Function which maps D-BUS type to GType. (dbus_gvalue_init): Just invoke dbus_dbus_type_to_gtype and initialize the value with it. (dbus_gvalue_binding_type_from_type): Unused, delete. (dbus_gvalue_demarshal): Switch to hardcoding demarshalling for various types instead of unmarshalling to value data directly. Remove can_convert boolean. (dbus_gvalue_marshal): Remove duplicate initialization; switch to returning directly instead of using can_convert boolean. (dbus_gvalue_store): New function; not related to D-BUS per-se. Stores a GValue in a pointer to a value of its corresponding C type. * glib/dbus-gvalue.h: Remove dbus_gvalue_binding_type_from_type, add dbus_gvalue_store.
* * NEWS: Update for 0.31dbus-0.31.0John (J5) Palmieri2005-03-071-1/+1
| | | | | | | | | | | * configure.in: Release 0.31 add LT_CURRENT, LT_REVISION, LT_AGE for easy soname bumping * qt/Makefile.am: fixed build * dbus/Makefile.am: soname bump for libdbus * glib/Makefile.am: soname bump for libdbus-glib
* 2005-02-27 Colin Walters <walters@verbum.org>Colin Walters2005-02-2710-186/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* glib/Makefile.am: added dbus-gobject.h to sources listJohn (J5) Palmieri2005-02-241-0/+1
| | | | so distcheck doesn't fail
* 2005-02-19 Colin Walters <walters@verbum.org>Colin Walters2005-02-192-30/+91
| | | | | | | | | | | | | | | | | * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Fix iochannel refcounting. * glib/dbus-glib-tool.c: Include dbus-glib-tool.h, as well as errno.h and sys/stat.h. (lose): New function, prints error with newline and exits. (lose_gerror): Similar, but takes GError for message. (main): Add --output argument to specify output file to write to, instead of always printing to stdout. In this mode, determine timestamps on source files to see whether any are newer than the target file. If not, exit. Also convert a number of error messages to use lose (since it's shorter), and switch to using g_io_channel_shutdown.
* 2005-02-19 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-193-8/+12
| | | | | | | | | | * glib/dbus-gobject.c (_dbus_glib_marshal_dbus_message_to_gvalue_array): add docs * glib/dbus-glib.c: fix doxygen warnings * glib/dbus-gparser.c (parse_annotation): error if an annotation is found on an <arg>
* 2005-02-17 Colin Walters <walters@verbum.org>Colin Walters2005-02-183-4/+4
| | | | | | | | | | | * glib/dbus-gobject.h: Don't export _dbus_glib_marshal_dbus_message_to_gvalue_array. * glib/dbus-gobject.c (_dbus_glib_marshal_dbus_message_to_gvalue_array): Do rename. (invoke_object_method): Handle it. * glib/dbus-gproxy.c (marshal_dbus_message_to_g_marshaller): Handle rename.
* 2005-02-17 Colin Walters <walters@verbum.org>Colin Walters2005-02-172-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_SERVICE_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_DBUS): Rename to DBUS_PATH_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_LOCAL): Rename to DBUS_PATH_LOCAL. (DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_INTERFACE_DBUS. (DBUS_INTERFACE_ORG_FREEDESKTOP_INTROSPECTABLE): Rename to DBUS_INTERFACE_INTROSPECTABLE. (DBUS_INTERFACE_ORG_FREEDESKTOP_PROPERTIES): Rename to DBUS_INTERFACE_PROPERTIES. (DBUS_INTERFACE_ORG_FREEDESKTOP_PEER): Rename to DBUS_INTERFACE_PEER. (DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL): DBUS_INTERFACE_LOCAL. All other users of those constants have been changed. * bus/driver.c (bus_driver_handle_introspect): Use constants. * glib/dbus-gobject.c (handle_introspect): Use constants. * doc/dbus-faq.xml, doc/dbus-specification.xml: Update for rename.
* 2005-02-17 Colin Walters <walters@verbum.org>Colin Walters2005-02-176-71/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * glib/dbus-gparser.c (struct Parser): Add in_annotation boolean. (parse_node, parse_interface, parse_method, parse_signal) (parse_property, parse_annotation): Lose if we're currently in an annotation. (parse_annotation): New function. (parser_start_element, parser_end_element): Handle annotation. (parse_method, parse_interface): Remove support for c_name attribute, switch to annotations. * glib/dbus-gidl.h (interface_info_get_binding_names) (method_info_get_binding_names) (interface_info_get_binding_name, method_info_get_binding_name) (interface_info_set_binding_name, method_info_set_binding_name): Remove. (interface_info_get_annotations, method_info_get_annotations) (interface_info_get_annotation, method_info_get_annotation) (interface_info_add_annotation, method_info_add_annotation): Prototype. * glib/dbus-gidl.c (struct InterfaceInfo): Substitute "annotations" for "bindings". (struct MethodInfo): Ditto. Straightfoward conversion of binding methods into annotation methods as prototyped. * glib/dbus-glib-tool.c (pretty_print): Print annotations. * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_C_SYMBOL): Define. * glib/dbus-binding-tool-glib.c (gather_marshallers, generate_glue): Use new annotation API. * doc/introspect.dtd: Fix a number of DTD syntax errors. Add annotation element. * doc/dbus-specification.xml: Discuss introspection annotations, include list of well-known annotations. * test/glib/test-service-glib.xml: Make validate against new DTD.
* 2005-02-17 Colin Walters <walters@verbum.org>Colin Walters2005-02-1715-122/+1889
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is based on initial work from Paul Kuliniewicz <kuliniew@purdue.edu>. * glib/dbus-gvalue.c (dbus_gvalue_init): New function; move initialization of GValue from dbus type to here. (dbus_gvalue_genmarshal_name_from_type): New function; generates a string for the "glib-genmarshal" program from a DBus type. (dbus_gvalue_binding_type_from_type): New function; turns a DBus type into the C name for it we use in the glib bindings. (dbus_gvalue_ctype_from_type): New function; maps a DBus type into a glib C type (not GValue). (dbus_gvalue_demarshal): invoke dbus_gvalue_init. * glib/dbus-gutils.c (_dbus_gutils_wincaps_to_uscore): Moved here from dbus-gobject.c. * glib/dbus-gutils.h: Prototype it. * glib/dbus-gproxy.c: Include new dbus-gobject.h. (marshal_dbus_message_to_g_marshaller): Use new shared function dbus_glib_marshal_dbus_message_to_gvalue_array. * glib/dbus-gparser.c (parse_interface, parse_method): Handle c_name attribute. Will be changed once we have annotations. * glib/dbus-gobject.c: Change info_hash_mutex from GStaticMutex to GStaticRWLock. Callers updated. (wincaps_to_uscore): Move to dbus-gutils.c. Callers updated. (string_table_next): New function for iterating over zero-terminated string value array. (string_table_lookup): New function; retrieves specific entry in array. (get_method_data): New function; look up method data in object data chunk. (object_error_domain_prefix_from_object_info) (object_error_code_from_object_info): New functions, but not implemented yet. (method_interface_from_object_info): New function; retrieve interface name. (method_name_from_object_info): New function; retrieve method name. (method_arg_info_from_object_info): New function; retrieve argument data. (arg_iterate): New function; iterates over serialized argument data. (method_dir_signature_from_object_info): New function; returns a GString holding type signature for arguments for just one direction (input or output). (method_input_signature_from_object_info) (method_output_signature_from_object_info): New functions. (dbus_glib_marshal_dbus_message_to_gvalue_array): New shared function; converts dbus message arguments into a GValue array. Used for both signal handling and method invocation. (struct DBusGlibWriteIterfaceData): New utility structure. (write_interface): New function; generate introspection XML for an interface. (introspect_interfaces): New function; gathers all interface->methods, generates introspection XML for them. (handle_introspect): Invoke introspect_interfaces. (get_object_property): Be sure to zero-initalize stack-allocated GValue. (lookup_object_and_method): New function; examines an incoming message and attempts to match it up (via interface, method name, and argument signature) with a known object and method. (gerror_domaincode_to_dbus_error_name): New function; converts a GError domain and code into a DBus error name. Needs GError data added to object introspection to work well. (gerror_to_dbus_error_message): Creates a DBusMessage error return from GError. (invoke_object_method): New function to invoke an object method looked up via lookup_object_and_method. Parses the incoming message, turns it into a GValue array, then invokes the marshaller specified in the DBusGMethodInfo. Creates a new message with either return values or error message as appropriate. (gobject_message_function): Invoke lookup_object_and_method and invoke_object_method. * glib/dbus-glib-tool.c: Include dbus-binding-tool-glib.h. (enum DBusBindingOutputMode): New enum for binding output modes. (pretty_print): Print binding names. (dbus_binding_tool_error_quark): GError bits. (version): Fix typo. (main): Create GIOChannel for output. Parse new --mode argument, possible values are "pretty-print", "glib-server", "glib-client". Use mode to invoke appropriate function. * glib/dbus-gobject.h: Prototype dbus_glib_marshal_dbus_message_to_gvalue_array. * glib/dbus-glib-tool.h: New header, just includes GError bits for now. * glib/dbus-gidl.c (struct InterfaceInfo): Add bindings hashtable; maps binding style to name. (struct MethodInfo): Ditto. (get_hash_keys, get_hash_key): Utility function, returns keys for a GHashTable. (interface_info_new, method_info_new): Initialize bindings. (interface_info_unref, method_info_unref): Destroy bindings. (method_info_get_binding_names, method_info_get_binding_name) (interface_info_get_binding_names, interface_info_get_binding_name): Functions for retrieving binding names. (method_info_set_binding_name, interface_info_set_binding_name): Functions for setting binding names. * glib/dbus-binding-tool-glib.h: New file, has prototypes for glib binding generation. * glib/dbus-binding-tool-glib.c: New file, implements server-side and client-side glib glue generation. * glib/Makefile.am (dbus_binding_tool_SOURCES): Add dbus-binding-tool-glib.c, dbus-binding-tool-glib.h, dbus-glib-tool.h. * dbus/dbus-glib.h (struct DBusGMethodMarshaller): Remove in favor of using GClosureMarshal directly. (struct DBusGObjectInfo): Add n_infos member. * test/glib/test-service-glib.xml: New file; contains introspection data for MyTestObject used in test-service-glib.c. * test/glib/test-service-glib.c (enum MyObjectError): New GError enum. (my_object_do_nothing, my_object_increment, my_object_throw_error) (my_object_uppercase, my_object_many_args): New test methods. (main): Use dbus_g_object_class_install_info to include generated object info. * test/glib/Makefile.am: Generate server-side glue for test-service-glib.c, as well as client-side bindings. * test/glib/test-dbus-glib.c: Include test-service-glib-bindings.h. (main): Activate TestSuiteGLibService; test invoke a bunch of its methods using both the dbus_gproxy stuff directly as well as the generated bindings.
* 2005-02-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-161-1/+4
| | | | | | | | | | | | | | | | | | | * dbus/dbus-connection.c (dbus_connection_dispatch): always complete a pending call, don't run filters first. * glib/dbus-gproxy.c (dbus_g_proxy_end_call): change to use dbus_pending_call_steal_reply * dbus/dbus-pending-call.c (dbus_pending_call_block): just call _dbus_connection_block_pending_call (dbus_pending_call_get_reply): change to steal_reply and return a ref * dbus/dbus-connection.c (dbus_connection_send_with_reply_and_block): port to work in terms of DBusPendingCall (_dbus_connection_block_pending_call): replace block_for_reply with this
* 2005-02-12 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-123-1/+26
| | | | | | | | | | | | | * tools/dbus-tree-view.c (info_set_func_text): display more details on args * bus/driver.c (bus_driver_handle_list_services): list the bus driver * glib/dbus-gparser.c (parse_arg): generate an arg name if none is supplied * glib/dbus-gidl.c (signal_info_get_n_args): new function (method_info_get_n_args): new function
* 2005-02-10 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-101-0/+2
| | | | | | | | | * dbus/dbus-object-tree.c (handle_default_introspect_and_unlock): change to be _and_unlock instead of _unlocked * dbus/dbus-connection.c (_dbus_connection_send_preallocated_unlocked_no_update): rename to have no_update so we can find this bug quickly in future
* 2005-02-04 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-051-13/+46
| | | | | | | | | | | | | | | | * glib/dbus-gproxy.c (dbus_g_proxy_disconnect_signal): use g_quark_try_string() so it actually can return 0 (dbus_g_proxy_connect_signal): ditto 2005-02-04 Havoc Pennington <hp@redhat.com> * glib/dbus-gproxy.c (dbus_g_proxy_emit_remote_signal): fix a bogus warning (tristring_from_message): assert cleanly on null path/interface (should not be possible though I decided later) (dbus_g_proxy_dispose): move proxy manager unregistration here (DBUS_G_PROXY_DESTROYED): add this macro, and use it in a bunch of g_return_if_fail() checks
* 2005-01-31 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-311-140/+194
| | | | | * glib/dbus-gproxy.c: rewrite how signals work again, this time I think it's sort of right
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-315-77/+390
| | | | | | | | | | | | * tools/dbus-names-model.c: dynamically watch NameOwnerChanged * autogen.sh: change to autotools 1.9 * glib/dbus-gproxy.c: completely change how signals work (dbus_g_proxy_add_signal): new function to specify signature of a signal (dbus_g_proxy_emit_received): marshal the dbus message to GValues, and g_warning if the incoming message has the wrong signature.
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-303-201/+338
| | | | | | | | | | | | | | | * glib/dbus-glib.c (dbus_g_pending_call_set_notify): new function (dbus_g_pending_call_cancel): new function * dbus/dbus-glib.h: move GType decls for connection/message here; * dbus/dbus-glib.c: move all the g_type and ref/unref stuff in here, just kind of rationalizing how we handle all that * tools/dbus-names-model.c: new file for a tree model listing the services on a bus * tools/dbus-tree-view.c (model_new): use proper typing on the model rows
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-301-7/+86
| | | | | | | | | | * glib/dbus-gmain.c: add a custom GSource back that just checks whether the message queue has anything in it; otherwise, there are cases where we won't see messages in the queue since there was no IO visible to the glib main loop * dbus/dbus-connection-internal.h (_DBUS_DEFAULT_TIMEOUT_VALUE): increase default message timeout to 25 seconds
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-301-340/+313
| | | | | | * glib/dbus-gmain.c: rewrite the main loop stuff to avoid the custom source, seems to be a lot easier to understand and work better.
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-301-16/+74
| | | | | | | | | | I think this main loop thing is conceptually broken, but here are some band aids. I'll maybe rewrite it in a minute. * glib/dbus-gmain.c (add_timeout): timeout stuff doesn't use the custom GSource, so don't pass it in; confusing (gsource_server_finalize, gsource_connection_finalize): add finalize handlers that remove all the watches.
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-302-5/+7
| | | | | | | | | | | | | | | | | | | | * glib/dbus-gobject.c (introspect_properties): fix the XML generated * dbus/dbus-message.c (dbus_message_unref): add an in_cache flag which effectively detects the use of freed messages * glib/dbus-gobject.c (handle_introspect): modify and return the reply message instead of the incoming message * dbus/dbus-object-tree.c (handle_default_introspect_unlocked): gee, maybe it should SEND THE XML instead of just making a string and freeing it again ;-) * tools/dbus-print-message.c (print_message): improve printing of messages * configure.in: add debug-glib.service to the output
* 2005-01-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-306-21/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbus-viewer introspected and displayed the bus driver * dbus/dbus-object-tree.c (object_tree_test_iteration): add tests for a handler registered on "/" * dbus/dbus-object-tree.c (_dbus_decompose_path): fix to handle path "/" properly (run_decompose_tests): add tests for path decomposition * glib/dbus-gutils.c (_dbus_gutils_split_path): fix to handle "/" properly * glib/dbus-gobject.c (handle_introspect): fix quotes * test/glib/run-test.sh: support launching the bus, then running dbus-viewer * test/glib/test-service-glib.c (main): put in a trivial gobject subclass and register it on the connection * bus/driver.c (bus_driver_handle_introspect): implement introspection of the bus driver service * dbus/dbus-protocol.h: add #defines for the XML namespace, identifiers, doctype decl * bus/driver.c (bus_driver_handle_get_service_owner): handle attempts to get owner of DBUS_SERVICE_ORG_FREEDESKTOP_DBUS by returning the service unchanged. (bus_driver_handle_message): remove old check for reply_serial in method calls, now the message type deals with that (bus_driver_handle_message): handle NULL interface * glib/dbus-gproxy.c (dbus_g_proxy_get_bus_name): new function * glib/dbus-gloader-expat.c (description_load_from_string): allow -1 for len * tools/dbus-viewer.c: add support for introspecting a service on a bus * glib/dbus-gproxy.c (dbus_g_pending_call_ref): add (dbus_g_pending_call_unref): add
* 2005-01-29 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-291-2/+26
| | | | | | | | | | | | | * tools/dbus-tree-view.c: add support for displaying properties. (run dbus-viewer with an introspect xml file as arg, then resize the window so the tree elements show up, not sure what that is) * glib/dbus-gobject.c (handle_introspect): return org.freedesktop.Properties and org.freedesktop.Introspectable interfaces when we are introspected. * doc/dbus-specification.xml: allow empty interface name when Get/Set a property
* 2005-01-29 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-297-111/+434
| | | | | | | | | | | | | | | | | | | | | | | | * glib/Makefile.am: rename dbus-glib-tool to dbus-binding-tool; though it uses glib, it could be extended for any binding in principle * glib/dbus-gobject.c (gobject_message_function): change to the new way properties work * dbus/dbus-protocol.h: add the new interfaces * doc/dbus-specification.xml: document the introspection format, Introspectable interface, and add an org.freedesktop.Properties interface. * glib/dbus-gparser.c: add support for a <property> element * glib/dbus-gidl.c: add PropertyInfo * glib/dbus-gobject.c (handle_introspect): put the outermost <node> outside the signal and property descriptions. (introspect_properties): export properties as <property> rather than as method calls
* 2005-01-27 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-283-6/+31
| | | | | | | | | | | * dbus/dbus-arch-deps.h.in: add 16/32-bit types * configure.in: find the right type for 16 and 32 bit ints as well as 64 * dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add the 16-bit types so people don't have to stuff them in 32-bit or byte arrays.
* 2005-01-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-211-5/+7
| | | | | | | * glib/dbus-gmain.c: don't put the GLib bindings in the same toplevel doxygen group as the low-level API stuff * dbus/dbus.h: note that libdbus is the low-level API
* 2005-01-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-181-83/+88
| | | | | | | | | | | | * Throughout, grand renaming to strip out the use of "service", just say "name" instead (or "bus name" when ambiguous). Did not change the internal code of the message bus itself, only the programmer-facing API and messages. * doc/dbus-specification.xml: further update the message bus section * bus/config-parser.c (all_are_equiv): fix bug using freed string in error case
* 2005-01-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-1/+3
| | | | | | | | * dbus/dbus-types.h: hardcode dbus_bool_t to 32 bits * Throughout: modify DBUS_TYPE_BOOLEAN to be a 32-bit type instead of an 8-bit type. Now dbus_bool_t is the type to use whenever you are marshaling/unmarshaling a boolean.
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-162-2/+2
| | | | | | | | | | | | | | | | | * Add and fix docs according to Doxygen warnings throughout source. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_array_is_empty): change this to just call array_reader_get_array_len() and make it static * dbus/dbus-message.c (dbus_message_iter_get_element_type): rename from get_array_type (dbus_message_iter_init_append): rename from append_iter_init * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_element_type): rename from _dbus_type_reader_get_array_type
* 2005-01-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-154-63/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Land the new message args API and type system. This patch is huge, but the public API change is not really large. The set of D-BUS types has changed somewhat, and the arg "getters" are more geared toward language bindings; they don't make a copy, etc. There are also some known issues. See these emails for details on this huge patch: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * dbus/dbus-marshal-*: all the new stuff * dbus/dbus-message.c: basically rewritten * dbus/dbus-memory.c (check_guards): with "guards" enabled, init freed blocks to be all non-nul bytes so using freed memory is less likely to work right * dbus/dbus-internals.c (_dbus_test_oom_handling): add DBUS_FAIL_MALLOC=N environment variable, so you can do DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or DBUS_FAIL_MALLOC=10 to make it really, really, really slow and thorough. * qt/message.cpp: port to the new message args API (operator<<): use str.utf8() rather than str.unicode() (pretty sure this is right from the Qt docs?) * glib/dbus-gvalue.c: port to the new message args API * bus/dispatch.c, bus/driver.c: port to the new message args API * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the "locked" flag to TRUE and align_offset to 0; I guess we never looked at these anyhow, but seems cleaner. * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING): move allocation padding macro to this header; use it to implement (_DBUS_STRING_STATIC): ability to declare a static string. * dbus/dbus-message.c (_dbus_message_has_type_interface_member): change to return TRUE if the interface is not set. * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff to dbus-marshal-validate.[hc] * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from dbus-internals.c * dbus/Makefile.am: cut over from dbus-marshal.[hc] to dbus-marshal-*.[hc] * dbus/dbus-object-tree.c (_dbus_decompose_path): move this function here from dbus-marshal.c
* 2004-11-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * test/glib/test-profile.c: fix this thing up a bit * dbus/dbus-message.c (dbus_message_new_empty_header): increase preallocation sizes by a fair bit; not sure if this will be an overall performance win or not, but it does reduce reallocs. * dbus/dbus-string.c (set_length, reallocate_for_length): ignore the test hack that forced constant realloc if asserts are disabled, so we can profile sanely. Sprinkle in some _DBUS_UNLIKELY() which are probably pointless, but before I noticed the real performance problem I put them in. (_dbus_string_validate_utf8): micro-optimize this thing a little bit, though callgrind says it didn't help; then special-case ascii, which did help a lot; then be sure we detect nul bytes as invalid, which is a bugfix. (align_length_then_lengthen): add some more _DBUS_UNLIKELY superstition; use memset to nul the padding instead of a manual loop. (_dbus_string_get_length): inline this as a macro; it showed up in the profile because it's used for loop tests and so forth
* * dbus/dbus-sysdeps.c (_dbus_file_get_contents): fix an incorrect format string.Olivier Andrieu2004-10-071-5/+4
| | | | | * glib/dbus-dbus-gmain.c (dbus_g_bus_get): do not mangle NULL pointer (bug #1540, Leonardo Boiko).
* 2004-08-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-08-1017-18/+18
| | | | | * COPYING: switch to Academic Free License version 2.1 instead of 2.0, to resolve complaints about patent termination clause.