platform/upstream/eldbus.git
10 years agoRevert "Backport fixes from EFL tree"
José Roberto de Souza [Mon, 5 Aug 2013 16:25:04 +0000 (13:25 -0300)]
Revert "Backport fixes from EFL tree"

This reverts commit 7de696d9d258c372d503c8040d79fd061dc3765a.

10 years agoeldbus: use the right variable name for version.
Cedric Bail [Tue, 30 Jul 2013 05:45:56 +0000 (14:45 +0900)]
eldbus: use the right variable name for version.

10 years agoBackport fixes from EFL tree
José Roberto de Souza [Tue, 16 Jul 2013 17:54:36 +0000 (14:54 -0300)]
Backport fixes from EFL tree

11 years agoBackport changes from EFL
Lucas De Marchi [Fri, 26 Apr 2013 16:05:06 +0000 (13:05 -0300)]
Backport changes from EFL

There were lots of changes in eldbus inside EFL. This commit imports all
of them by simply copying the headers and source files over the old
ones. This is the lazy way to do but there were way too many missing
commits, including renames and cleanups.

Docs are probably broken - NOT TESTED. Use the EFL version if you are
interested in the documentation.

11 years agobuild-sys: Define version as in EFL
Lucas De Marchi [Fri, 26 Apr 2013 15:30:40 +0000 (12:30 -0300)]
build-sys: Define version as in EFL

11 years agoDon't use deprecated AM_CONFIG_HEADER
Lucas De Marchi [Tue, 23 Apr 2013 15:33:53 +0000 (12:33 -0300)]
Don't use deprecated AM_CONFIG_HEADER

11 years agoRename edbus->eldbus
Lucas De Marchi [Tue, 23 Apr 2013 15:30:07 +0000 (12:30 -0300)]
Rename edbus->eldbus

11 years agoSpec file fix.
Michael Jennings [Wed, 26 Dec 2012 10:08:24 +0000 (10:08 +0000)]
Spec file fix.

SVN revision: 81704

11 years agoedbus: Fix make distcheck.
Stefan Schmidt [Fri, 21 Dec 2012 08:10:17 +0000 (08:10 +0000)]
edbus: Fix make distcheck.

SVN revision: 81515

11 years agoedbus codegen: rename tool and move it to the right dir
Lucas De Marchi [Thu, 20 Dec 2012 22:04:11 +0000 (22:04 +0000)]
edbus codegen: rename tool and move it to the right dir

SVN revision: 81496

11 years agoedbus codegen: fix check for eina + ecore
Lucas De Marchi [Thu, 20 Dec 2012 22:04:07 +0000 (22:04 +0000)]
edbus codegen: fix check for eina + ecore

This way we get a spurious line in configure, resulting in this message:

/home/lucas/p/edbus/configure: line 14196: ecore: command not found

SVN revision: 81495

11 years agoedbus: Mark instrospectable as dirty when needed
José Roberto de Souza [Thu, 20 Dec 2012 22:04:02 +0000 (22:04 +0000)]
edbus: Mark instrospectable as dirty when needed

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81494

11 years agoedbus: Fix edbus_proxy_property_set
José Roberto de Souza [Thu, 20 Dec 2012 21:48:22 +0000 (21:48 +0000)]
edbus: Fix edbus_proxy_property_set

Fix the function and add support for complex types, in which case a
Eina_Value is expected.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81493

11 years agoedbus codegen: Initial commit
José Roberto de Souza [Thu, 20 Dec 2012 21:47:20 +0000 (21:47 +0000)]
edbus codegen: Initial commit

Add codegen tool to generate client code.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81492

11 years agoedbus: add helper function edbus_message_iter_struct_like_to_eina_value()
José Roberto de Souza [Thu, 20 Dec 2012 21:38:15 +0000 (21:38 +0000)]
edbus: add helper function edbus_message_iter_struct_like_to_eina_value()

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81489

11 years agoedbus: add _message_iter_from_eina_value_struct to private header
José Roberto de Souza [Thu, 20 Dec 2012 21:38:10 +0000 (21:38 +0000)]
edbus: add _message_iter_from_eina_value_struct to private header

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81488

11 years agoedbus: avoid cyclic unref
Lucas De Marchi [Thu, 20 Dec 2012 14:52:27 +0000 (14:52 +0000)]
edbus: avoid cyclic unref

If we are freeing a EDBUS_Connection_Name its name_owner_changed signal
handler may hold a pointer and try to unref it when deleting the signal
handler. We can't simply make the signal handler hold a reference to the
connection name, otherwise edbus_connection_name_gc will never be
triggered because of cyclic references.

Thus, just set the cn->name_owner_changed->bus to NULL before trying to
delete the signal handler.

Related log found by Lucas Jóia:

==20607== Invalid read of size 4
==20607==    at 0x6FE29EE: edbus_connection_name_gc.isra.3 (edbus_core.c:375)
==20607==    by 0x6FE4287: edbus_connection_unref (edbus_core.c:1028)
==20607==    by 0x4C8D94: e_msgbus_shutdown (e_msgbus.c:167)
==20607==    by 0x436194: _e_main_shutdown (e_main.c:1136)
==20607==    by 0x434F25: main (e_main.c:1074)
==20607==  Address 0x1461ba68 is 24 bytes inside a block of size 64 free'd
==20607==    at 0x4C2A739: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20607==    by 0x6FF0E78: edbus_signal_handler_unref (edbus_signal_handler.c:269)
==20607==    by 0x6FE2A48: edbus_connection_name_gc.isra.3 (edbus_core.c:384)
==20607==    by 0x6FE4287: edbus_connection_unref (edbus_core.c:1028)
==20607==    by 0x4C8D94: e_msgbus_shutdown (e_msgbus.c:167)
==20607==    by 0x436194: _e_main_shutdown (e_main.c:1136)
==20607==    by 0x434F25: main (e_main.c:1074)

SVN revision: 81463

11 years agoedbus: Do not modify cn->names hash while walking it
Lucas De Marchi [Thu, 20 Dec 2012 14:52:21 +0000 (14:52 +0000)]
edbus: Do not modify cn->names hash while walking it

Bug triggered by Lucas Jóia:

==10042== Invalid read of size 8
==10042==    at 0x6B86626: _eina_rbtree_iterator_next (eina_rbtree.c:165)
==10042==    by 0x6B7228D: _eina_hash_iterator_next (eina_hash.c:622)
==10042==    by 0x6FE41DC: edbus_connection_unref (edbus_core.c:1015)
==10042==    by 0x4C8D94: e_msgbus_shutdown (e_msgbus.c:167)
==10042==    by 0x436194: _e_main_shutdown (e_main.c:1136)
==10042==    by 0x434F25: main (e_main.c:1074)
==10042==  Address 0x15c1b958 is 40 bytes inside a block of size 96 free'd
==10042==    at 0x4C2A739: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10042==    by 0x6B71CB7: _eina_hash_del_by_hash_el (eina_hash.c:441)
==10042==    by 0x6FE2A1E: edbus_connection_name_gc.isra.2 (edbus_core.c:385)
==10042==    by 0x6FE4217: edbus_connection_unref (edbus_core.c:1026)
==10042==    by 0x4C8D94: e_msgbus_shutdown (e_msgbus.c:167)
==10042==    by 0x436194: _e_main_shutdown (e_main.c:1136)
==10042==    by 0x434F25: main (e_main.c:1074)

SVN revision: 81462

11 years agoedbus: no need for this auxiliary variables, and check refcount first
Lucas De Marchi [Thu, 20 Dec 2012 14:52:15 +0000 (14:52 +0000)]
edbus: no need for this auxiliary variables, and check refcount first

SVN revision: 81461

11 years agoedbus: Remove object path of service if ObjectManager is the last optional iface
José Roberto de Souza [Thu, 20 Dec 2012 01:55:47 +0000 (01:55 +0000)]
edbus: Remove object path of service if ObjectManager is the last optional iface

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81416

11 years agoedbus: Fix undefined ref. to 'EINA_LOG_DOMAIN_GLOBAL' in examples
José Roberto de Souza [Thu, 20 Dec 2012 01:55:42 +0000 (01:55 +0000)]
edbus: Fix undefined ref. to 'EINA_LOG_DOMAIN_GLOBAL' in examples

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81415

11 years agoedbus: Only create one ref of proxys when listen object manager
José Roberto de Souza [Thu, 20 Dec 2012 01:55:34 +0000 (01:55 +0000)]
edbus: Only create one ref of proxys when listen object manager

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81414

11 years agoedbus: (de)yodafy free cb functions
Lucas De Marchi [Wed, 19 Dec 2012 17:30:11 +0000 (17:30 +0000)]
edbus: (de)yodafy free cb functions

edbus_connection_cb_free_add     -> edbus_connection_free_cb_add
edbus_connection_cb_free_del     -> edbus_connection_free_cb_del
edbus_object_cb_free_add         -> edbus_object_free_cb_add
edbus_object_cb_free_del         -> edbus_object_free_cb_del
edbus_pending_cb_free_add        -> edbus_pending_free_cb_add
edbus_pending_cb_free_del        -> edbus_pending_free_cb_del
edbus_proxy_cb_free_add          -> edbus_proxy_free_cb_add
edbus_proxy_cb_free_del          -> edbus_proxy_free_cb_del
edbus_signal_handler_cb_free_add -> edbus_signal_handler_free_cb_add
edbus_signal_handler_cb_free_del -> edbus_signal_handler_free_cb_del

SVN revision: 81389

11 years agoedbus: Fix leftover unref after edbus_service_signal_send change
Lucas De Marchi [Wed, 19 Dec 2012 17:30:03 +0000 (17:30 +0000)]
edbus: Fix leftover unref after edbus_service_signal_send change

SVN revision: 81388

11 years agoedbus: unexport edbus_message_signal_new()
Lucas De Marchi [Tue, 18 Dec 2012 21:38:49 +0000 (21:38 +0000)]
edbus: unexport edbus_message_signal_new()

Signals need to be sent with edbus_service_signal_emit() -- for basic
messages -- or edbus_service_signal_new() + edbus_service_signal_send --
for complex messages.  Otherwise it's possible to send signals that are
not in the service introspection or that have different signatures by
mistake/typo.

SVN revision: 81311

11 years agoedbus: unref sent signal, also for complex types
Lucas De Marchi [Tue, 18 Dec 2012 21:38:43 +0000 (21:38 +0000)]
edbus: unref sent signal, also for complex types

SVN revision: 81310

11 years agoedbus: rename functions edbus_message{_iter,}_arguments_set
Lucas De Marchi [Tue, 18 Dec 2012 20:05:02 +0000 (20:05 +0000)]
edbus: rename functions edbus_message{_iter,}_arguments_set

Rename these functions since they do not set the data in the
iterator/message but rather they append the data.

Also improve the documentation of edbus_message_iter_arguments_append()
to clarify its usage.

SVN revision: 81295

11 years agoedbus: Fix invalid access memory in edbus_service_interface_unregister()
José Roberto de Souza [Mon, 17 Dec 2012 19:48:54 +0000 (19:48 +0000)]
edbus: Fix invalid access memory in edbus_service_interface_unregister()

_object_unregister is called synchronized by libdbus, so when _interface_free() ran
your object its already freed.

==30579== Invalid read of size 4
==30579==    at 0x4775190: _find_object_manager_parent (edbus_service.c:803)
==30579==    by 0x4775292: _interface_free (edbus_service.c:1011)
==30579==    by 0x4777F1D: edbus_service_interface_unregister (edbus_service.c:1101)
==30579==    by 0x40CBD28: elm_dbus_menu_delete (elm_dbus_menu.c:128)
==30579==    by 0x414552F: _elm_menu_smart_del (elm_menu.c:562)
==30579==    by 0x4810F39: _eo_op_internal (eo.c:363)
==30579==    by 0x4812E1B: eo_do_internal (eo.c:403)
==30579==    by 0x4279D02: evas_object_smart_del (evas_object_smart.c:1080)

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 81180

11 years agoedbus: fix missing blank lines
Lucas De Marchi [Mon, 17 Dec 2012 19:48:45 +0000 (19:48 +0000)]
edbus: fix missing blank lines

Apparently the previous sed script didn't caught all missing blank
lines.

SVN revision: 81179

11 years agoedbus: rename DISCONNECTED event
Lucas De Marchi [Mon, 17 Dec 2012 18:25:13 +0000 (18:25 +0000)]
edbus: rename DISCONNECTED event

SVN revision: 81177

11 years agoedbus: Fix formatting
Lucas De Marchi [Mon, 17 Dec 2012 18:25:06 +0000 (18:25 +0000)]
edbus: Fix formatting

SVN revision: 81176

11 years agoedbus: simplify end condition check in loop
Lucas De Marchi [Mon, 17 Dec 2012 18:25:00 +0000 (18:25 +0000)]
edbus: simplify end condition check in loop

SVN revision: 81175

11 years agoedbus: avoid using dbus_signature_iter_get_signature when not needed
Lucas De Marchi [Mon, 17 Dec 2012 18:24:54 +0000 (18:24 +0000)]
edbus: avoid using dbus_signature_iter_get_signature when not needed

SVN revision: 81174

11 years agoedbus: Use eina_log in client example and generalize expected values
Lucas De Marchi [Mon, 17 Dec 2012 18:24:49 +0000 (18:24 +0000)]
edbus: Use eina_log in client example and generalize expected values

Keep expected values in a struct. It would be ideal to have all values
and compare functions in an array, so we would be able to set the same
callback function for all methods. But it's already short enough so keep
it as is.

The usage of eina_log here allows us to easily catch which test failed.

SVN revision: 81173

11 years agoedbus: Fix typo in error message
Lucas De Marchi [Mon, 17 Dec 2012 18:24:43 +0000 (18:24 +0000)]
edbus: Fix typo in error message

SVN revision: 81172

11 years agoedbus: Don't use "bool" as a variable name
Lucas De Marchi [Mon, 17 Dec 2012 18:24:37 +0000 (18:24 +0000)]
edbus: Don't use "bool" as a variable name

Using bool as variable name is asking for trouble in C99. If we end up
including stdbool.h, this would fail.

SVN revision: 81171

11 years agoedbus: Let arguments_get fail if getting less args than passed
Lucas De Marchi [Mon, 17 Dec 2012 18:24:31 +0000 (18:24 +0000)]
edbus: Let arguments_get fail if getting less args than passed

If user passed a string with more elements, return EINA_FALSE on
edbus_message_arguments_get() so he knows not all elements are
initialized. Before this patch, we would notify user of its error if he
did something like:

i) edbus_message_arguments_get(msg, "uu", &a)
ii) edbus_message_arguments_get(msg, "uu", &a, &b)

And "msg" containing only 1 argument.

This also fixes the case in which user is getting the elements of an
array iterator and the array is empty. We were previously returning
EINA_TRUE, even if we were not filling the variable.

Last but not least, if the user was calling
edbus_message_iter_arguments_get() in an empty array, we would return
EINA_FALSE, even if we didn't actually get any element.

SVN revision: 81170

11 years agoedbus: do not use dbus_signature_iter_get_signature in edbus_message_iter_arguments_vget
Lucas De Marchi [Mon, 17 Dec 2012 18:24:23 +0000 (18:24 +0000)]
edbus: do not use dbus_signature_iter_get_signature in edbus_message_iter_arguments_vget

we are only interested in the first char of the signature so we can use
dbus_signature_iter_get_current_type and:

a) avoid the allocation of the signature for each complete type
b) simplify the check for struct and dict, since *_get_current_type()
   does TheRightThing (TM)

This also rename some variables to clarify the new semantics:

 iter_type -> iter
 sig_type  -> sig_iter

SVN revision: 81169

11 years agoedbus: Improve doc of edbus_{private_,}connection_get
Lucas De Marchi [Fri, 14 Dec 2012 16:29:08 +0000 (16:29 +0000)]
edbus: Improve doc of edbus_{private_,}connection_get

SVN revision: 80968

11 years agoedbus: add edbus.spec to gitignore
Lucas De Marchi [Fri, 14 Dec 2012 16:29:01 +0000 (16:29 +0000)]
edbus: add edbus.spec to gitignore

SVN revision: 80967

11 years agoedbus: Remove useless defines
Lucas De Marchi [Fri, 14 Dec 2012 16:28:55 +0000 (16:28 +0000)]
edbus: Remove useless defines

These values are used only using they directly are more meaninful than
those defines.

SVN revision: 80966

11 years agoedbus: remove unneeded code
Lucas De Marchi [Fri, 14 Dec 2012 16:28:50 +0000 (16:28 +0000)]
edbus: remove unneeded code

SVN revision: 80965

11 years agoedbus: if you goto end, you don't use else
Lucas De Marchi [Fri, 14 Dec 2012 16:28:46 +0000 (16:28 +0000)]
edbus: if you goto end, you don't use else

SVN revision: 80964

11 years agoedbus: Add missing EINA_WARN_UNUSED_RESULT to service API
Lucas De Marchi [Fri, 14 Dec 2012 16:28:41 +0000 (16:28 +0000)]
edbus: Add missing EINA_WARN_UNUSED_RESULT to service API

SVN revision: 80963

11 years agoedbus: Add blank lines to separate function docs
Lucas De Marchi [Fri, 14 Dec 2012 16:28:36 +0000 (16:28 +0000)]
edbus: Add blank lines to separate function docs

find . -name '*.h' -exec \
     sed -i '/^\s*$/b; N; /\n\/\*\*/{P;x;p;x;D}' {} \;

This ensures to add a blank line above a doxygen comment if and only if
there wasn't one.

SVN revision: 80962

11 years agoedbus: Give proper doc to edbus_service_property_changed()
Lucas De Marchi [Fri, 14 Dec 2012 16:28:27 +0000 (16:28 +0000)]
edbus: Give proper doc to edbus_service_property_changed()

SVN revision: 80961

11 years agoedbus: Dont create proxy of FDO.Instropectable
José Roberto de Souza [Tue, 11 Dec 2012 19:52:24 +0000 (19:52 +0000)]
edbus: Dont create proxy of FDO.Instropectable

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80712

11 years agoedbus: Dont create proxy of FDO.Peer
José Roberto de Souza [Tue, 11 Dec 2012 19:52:20 +0000 (19:52 +0000)]
edbus: Dont create proxy of FDO.Peer

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80711

11 years agoedbus: Fix typo in object manager
José Roberto de Souza [Tue, 11 Dec 2012 19:52:15 +0000 (19:52 +0000)]
edbus: Fix typo in object manager

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80710

11 years agoedbus: Dont create proxy of Object Manager on edbus_object_managed_objects_get()
José Roberto de Souza [Tue, 11 Dec 2012 19:52:11 +0000 (19:52 +0000)]
edbus: Dont create proxy of Object Manager on edbus_object_managed_objects_get()

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80709

11 years agoedbus: Only one ref of Properties interface in each object
José Roberto de Souza [Tue, 11 Dec 2012 19:52:06 +0000 (19:52 +0000)]
edbus: Only one ref of Properties interface in each object

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80708

11 years agoedbus: Better naming for FDO proxy in connection
Lucas De Marchi [Tue, 11 Dec 2012 19:52:02 +0000 (19:52 +0000)]
edbus: Better naming for FDO proxy in connection

Patch by: Lucas De Marchi <lucas.de.marchi@gmail.com>

SVN revision: 80707

11 years agoedbus: Keep only one reference of object and proxy of dbus daemon interface per conne...
José Roberto de Souza [Tue, 11 Dec 2012 19:51:38 +0000 (19:51 +0000)]
edbus: Keep only one reference of object and proxy of dbus daemon interface per connection

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80706

11 years agoedbus: simplify returning new ref of obj/proxy
Lucas De Marchi [Tue, 11 Dec 2012 19:51:34 +0000 (19:51 +0000)]
edbus: simplify returning new ref of obj/proxy

Patch by: Lucas De Marchi <lucas.de.marchi@gmail.com>

SVN revision: 80705

11 years agoedbus: Add ref to object and proxy in edbus_object/proxy_get
José Roberto de Souza [Tue, 11 Dec 2012 19:51:29 +0000 (19:51 +0000)]
edbus: Add ref to object and proxy in edbus_object/proxy_get

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80704

11 years agoedbus: Fix typo on doc of edbus_message_arguments_get
José Roberto de Souza [Tue, 11 Dec 2012 19:51:25 +0000 (19:51 +0000)]
edbus: Fix typo on doc of edbus_message_arguments_get

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80703

11 years agoedbus: Add object method call
José Roberto de Souza [Tue, 11 Dec 2012 19:51:20 +0000 (19:51 +0000)]
edbus: Add object method call

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80702

11 years agoedbus: Add missing break in edbus_message_from_eina_value
José Roberto de Souza [Tue, 11 Dec 2012 19:51:16 +0000 (19:51 +0000)]
edbus: Add missing break in edbus_message_from_eina_value

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80701

11 years agoedbus: Add example for reading str array inside a variant using eina_value
José Roberto de Souza [Tue, 11 Dec 2012 19:51:12 +0000 (19:51 +0000)]
edbus: Add example for reading str array inside a variant using eina_value

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80700

11 years agoedbus: Change some function parameters to const
José Roberto de Souza [Tue, 11 Dec 2012 19:51:02 +0000 (19:51 +0000)]
edbus: Change some function parameters to const

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80699

11 years agoedbus: Signal property changed after a successful property-set in complex server...
José Roberto de Souza [Tue, 11 Dec 2012 19:50:58 +0000 (19:50 +0000)]
edbus: Signal property changed after a successful property-set in complex server example

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80698

11 years agoedbus: Fix signature check in edbus_message_iter_fixed_array_get()
José Roberto de Souza [Tue, 11 Dec 2012 19:50:53 +0000 (19:50 +0000)]
edbus: Fix signature check in edbus_message_iter_fixed_array_get()

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80697

11 years agoedbus: Add Variant to Property set function
José Roberto de Souza [Tue, 11 Dec 2012 19:50:49 +0000 (19:50 +0000)]
edbus: Add Variant to Property set function

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80696

11 years agoedbus: Add proxy to Proxy_Event_Property_Changed
José Roberto de Souza [Tue, 11 Dec 2012 19:50:45 +0000 (19:50 +0000)]
edbus: Add proxy to Proxy_Event_Property_Changed

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80695

11 years agoedbus: Remove signal_handler_del over a already freed signal
José Roberto de Souza [Tue, 11 Dec 2012 19:50:40 +0000 (19:50 +0000)]
edbus: Remove signal_handler_del over a already freed signal

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80694

11 years agoedbus: Add Disconnected event in connection
José Roberto de Souza [Tue, 11 Dec 2012 19:50:29 +0000 (19:50 +0000)]
edbus: Add Disconnected event in connection

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80693

11 years agoedbus: Remove unnecessary connection events
José Roberto de Souza [Tue, 11 Dec 2012 19:50:25 +0000 (19:50 +0000)]
edbus: Remove unnecessary connection events

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80692

11 years agoedbus: Add edbus_private_connection_get()
José Roberto de Souza [Tue, 11 Dec 2012 19:50:20 +0000 (19:50 +0000)]
edbus: Add edbus_private_connection_get()

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80691

11 years agoedbus: Refactor examples
José Roberto de Souza [Tue, 11 Dec 2012 19:50:16 +0000 (19:50 +0000)]
edbus: Refactor examples

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80690

11 years agoedbus: Support '(' and '{' in edbus_message_iter_get_and_next()
José Roberto de Souza [Tue, 11 Dec 2012 19:50:11 +0000 (19:50 +0000)]
edbus: Support '(' and '{' in edbus_message_iter_get_and_next()

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80689

11 years agoedbus: Allow to monitor unique id in edbus_name_owner_changed_callback_add
José Roberto de Souza [Tue, 11 Dec 2012 19:50:06 +0000 (19:50 +0000)]
edbus: Allow to monitor unique id in edbus_name_owner_changed_callback_add

This allows to monitor when a client exits. Clients in general don't
register a name in the bus and in some cases it's even not allowed to do
(for example an agent talking to bluetoothd, that runs in system bus).

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80687

11 years agoedbus: Fix bug found in refactored banshee example
José Roberto de Souza [Tue, 11 Dec 2012 19:50:01 +0000 (19:50 +0000)]
edbus: Fix bug found in refactored banshee example

Refactor edbus_signal_handler_add() so internal signal handlers don't
set the connection free callback. This fixes the bug in which
EDBus_Connection was freeing the signal handler of EDBus_Conenction_Name

==22814== Invalid read of size 4
==22814==    at 0x40564B0: edbus_signal_handler_del (edbus_signal_handler.c:278)
==22814==    by 0x4040E65: _edbus_connection_name_unref (edbus_core.c:507)
==22814==    by 0x404106B: edbus_connection_name_owner_monitor (edbus_core.c:520)
==22814==    by 0x4055F63: _edbus_signal_handler_clean (edbus_signal_handler.c:217)
==22814==    by 0x40564F8: edbus_signal_handler_del (edbus_signal_handler.c:279)
==22814==    by 0x4043088: _edbus_connection_unref (edbus_core.c:1045)
==22814==    by 0x404352F: edbus_connection_unref (edbus_core.c:1105)
==22814==    by 0x80498AA: main (banshee.c:233)
==22814==  Address 0x44bea48 is 0 bytes inside a block of size 72 free'd
==22814==    at 0x402C06C: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==22814==    by 0x4056118: _edbus_signal_handler_del (edbus_signal_handler.c:249)
==22814==    by 0x4056401: edbus_signal_handler_unref (edbus_signal_handler.c:272)
==22814==    by 0x4056503: edbus_signal_handler_del (edbus_signal_handler.c:280)
==22814==    by 0x4043088: _edbus_connection_unref (edbus_core.c:1045)
==22814==    by 0x404352F: edbus_connection_unref (edbus_core.c:1105)
==22814==    by 0x80498AA: main (banshee.c:233)
==22814==
CRI<22814>: src/lib/edbus_signal_handler.c:278 edbus_signal_handler_del() *** Eina Magic Check Failed !!!
    Input handle has already been freed!
    *** NAUGHTY PROGRAMMER!!!
    *** SPANK SPANK SPANK!!!
    *** Now go fix your code. Tut tut tut!

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80686

11 years agoedbus: Refactor banshee example
José Roberto de Souza [Tue, 11 Dec 2012 19:49:57 +0000 (19:49 +0000)]
edbus: Refactor banshee example

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80685

11 years agoedbus: Refactor edbus_connection_name
José Roberto de Souza [Tue, 11 Dec 2012 19:49:46 +0000 (19:49 +0000)]
edbus: Refactor edbus_connection_name

Simplifications on "monitor" of NameOwnerChanged
Life cycle tied with refcount, objs, and name_owner_changed list.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80684

11 years agoedbus: Handle 'unref signal handler inside of own callback' with ref and unref
José Roberto de Souza [Tue, 11 Dec 2012 19:49:42 +0000 (19:49 +0000)]
edbus: Handle 'unref signal handler inside of own callback' with ref and unref

This way is much simpler and doesn't generate many events when main loop
is quit inside of a signal handler callback.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80683

11 years agoedbus: Use edbus_connection_name_get() instead of try find and alloc
José Roberto de Souza [Tue, 11 Dec 2012 19:49:37 +0000 (19:49 +0000)]
edbus: Use edbus_connection_name_get() instead of try find and alloc

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80682

11 years agoedbus: Add EINA_ARG_NONNULL and EINA_WARN_UNUSED_RESULT to API
José Roberto de Souza [Tue, 11 Dec 2012 19:49:33 +0000 (19:49 +0000)]
edbus: Add EINA_ARG_NONNULL and EINA_WARN_UNUSED_RESULT to API

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80681

11 years agoedbus: Implement edbus_object_managed_objects_get()
José Roberto de Souza [Tue, 11 Dec 2012 19:49:27 +0000 (19:49 +0000)]
edbus: Implement edbus_object_managed_objects_get()

Also removed edbus_object_interfaces_added_callback_add/del() because we already
have object events for that.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80680

11 years agoedbus: Implement edbus_object_event_callback_add()
José Roberto de Souza [Mon, 3 Dec 2012 12:09:53 +0000 (12:09 +0000)]
edbus: Implement edbus_object_event_callback_add()

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 80058

11 years agoedbus: remove static from var
Lucas De Marchi [Mon, 3 Dec 2012 12:09:43 +0000 (12:09 +0000)]
edbus: remove static from var

This is not needed. Let it on stack.

SVN revision: 80057

11 years agorpm spec for new edbus
Rui Seabra [Sun, 18 Nov 2012 11:22:16 +0000 (11:22 +0000)]
rpm spec for new edbus

SVN revision: 79417

11 years agoedbus: Fix doxygen layout
José Roberto de Souza [Fri, 16 Nov 2012 13:07:58 +0000 (13:07 +0000)]
edbus: Fix doxygen layout

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79389

11 years agoedbus: Add main page to doxygen
José Roberto de Souza [Fri, 16 Nov 2012 13:07:53 +0000 (13:07 +0000)]
edbus: Add main page to doxygen

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79388

11 years agoedbus: Rename edbus_object_bus_path_get() to edbus_object_path_get()
José Roberto de Souza [Fri, 16 Nov 2012 13:07:45 +0000 (13:07 +0000)]
edbus: Rename edbus_object_bus_path_get() to edbus_object_path_get()

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79387

11 years agoedbus: Fix search of children objects when path = "/"
José Roberto de Souza [Fri, 16 Nov 2012 13:07:38 +0000 (13:07 +0000)]
edbus: Fix search of children objects when path = "/"

Example: there's an object in "/org/bla" and we are adding an object in
"/". Thus the second should becaome the parent of the first, which was a
root object since it had no parent yet.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79386

11 years agoedbus: Fix segfault in edbus_message_to_eina_value() when message have no args
José Roberto de Souza [Fri, 16 Nov 2012 13:07:32 +0000 (13:07 +0000)]
edbus: Fix segfault in edbus_message_to_eina_value() when message have no args

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79385

11 years agoedbus: Cosmetic change
José Roberto de Souza [Fri, 16 Nov 2012 13:07:26 +0000 (13:07 +0000)]
edbus: Cosmetic change

There's no need to call eina_array_count(). Pop until it finishes.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79384

11 years agoedbus: Remove stringshare of Instrospectable interface
José Roberto de Souza [Fri, 16 Nov 2012 13:07:21 +0000 (13:07 +0000)]
edbus: Remove stringshare of Instrospectable interface

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79383

11 years agoedbus: Add edbus_service_object_manager_attach/detach
José Roberto de Souza [Fri, 16 Nov 2012 13:07:14 +0000 (13:07 +0000)]
edbus: Add edbus_service_object_manager_attach/detach

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79382

11 years agoedbus: Fix leak in GetAll Properties of Proxy monitor
José Roberto de Souza [Fri, 16 Nov 2012 13:07:06 +0000 (13:07 +0000)]
edbus: Fix leak in GetAll Properties of Proxy monitor

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79381

11 years agoedbus: Add input message to get property function
José Roberto de Souza [Fri, 16 Nov 2012 13:06:53 +0000 (13:06 +0000)]
edbus: Add input message to get property function

Without this message, it's not possible for user create the error
message. Also update the docs to clarify usage of the Get/Set callbacks.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>

SVN revision: 79380

11 years agoedbus: add const where it's due and remove casts
Lucas De Marchi [Mon, 12 Nov 2012 16:16:16 +0000 (16:16 +0000)]
edbus: add const where it's due and remove casts

SVN revision: 79185

11 years agoedbus: check signature earlier and fail on invalid signature
Lucas De Marchi [Mon, 12 Nov 2012 16:16:10 +0000 (16:16 +0000)]
edbus: check signature earlier and fail on invalid signature

The problem is: if there's any arg with invalid signatures, we cannot
continue adding the interface. Just fail with a log message so user will
notice it.

This means we need to check if signals are valid much earlier. Actually
before even adding the object/interface.

Also change the iteration on signals so we don't use a needless index.

SVN revision: 79184

11 years agoedbus: do not alloc/free eina_strbuf. Reset it instead
Lucas De Marchi [Mon, 12 Nov 2012 16:16:04 +0000 (16:16 +0000)]
edbus: do not alloc/free eina_strbuf. Reset it instead

SVN revision: 79183

11 years agoedbus: simplify/unify appending args to methods/signals
Lucas De Marchi [Mon, 12 Nov 2012 16:15:58 +0000 (16:15 +0000)]
edbus: simplify/unify appending args to methods/signals

Functions to append methods/properties/signals also marked as inline as
they should be called by only one place.

SVN revision: 79182

11 years agoedbus: compat introspection with no annotation/arg
Lucas De Marchi [Mon, 12 Nov 2012 16:15:52 +0000 (16:15 +0000)]
edbus: compat introspection with no annotation/arg

SVN revision: 79181

11 years agoedbus: add son in server example for tests
Lucas De Marchi [Mon, 12 Nov 2012 16:15:43 +0000 (16:15 +0000)]
edbus: add son in server example for tests

SVN revision: 79180

11 years agoedbus: fix checking if root objects are our son
Lucas De Marchi [Mon, 12 Nov 2012 16:07:12 +0000 (16:07 +0000)]
edbus: fix checking if root objects are our son

strncmp'ing is not sufficient because it whould fail in case an object
like "/org/bla" is registered (and in conn->root_objs) and we were
registering "/org/blatest/". We would incorrectly put "/org/bla" as son
of "/org/blatest". Fix this by looking up the next char, checking if
it's a slash.

Also re-format the code a little bit.

SVN revision: 79179

11 years agoedbus: simplify and fix formatting
Lucas De Marchi [Mon, 12 Nov 2012 16:07:06 +0000 (16:07 +0000)]
edbus: simplify and fix formatting

SVN revision: 79178

11 years agoedbus: move function up - no fwd declaration when not needed
Lucas De Marchi [Mon, 12 Nov 2012 16:07:01 +0000 (16:07 +0000)]
edbus: move function up - no fwd declaration when not needed

SVN revision: 79177