Commit Graph

158 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri 331488d1ce efl: merge edbus (v2).
SVN revision: 81825
2012-12-28 17:53:25 +00:00
Michael Jennings 6449aba3b9 Spec file fix.
SVN revision: 81704
2012-12-26 10:08:24 +00:00
Stefan Schmidt cf2dd66eab edbus: Fix make distcheck.
SVN revision: 81515
2012-12-21 08:10:17 +00:00
Lucas De Marchi 9183a031be edbus codegen: rename tool and move it to the right dir
SVN revision: 81496
2012-12-20 22:04:11 +00:00
Lucas De Marchi 49d1a4ad4d 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
2012-12-20 22:04:07 +00:00
José Roberto de Souza 29c5ffc21a edbus: Mark instrospectable as dirty when needed
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 81494
2012-12-20 22:04:02 +00:00
José Roberto de Souza 2576b1b861 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
2012-12-20 21:48:22 +00:00
José Roberto de Souza c86f98d459 edbus codegen: Initial commit
Add codegen tool to generate client code.

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



SVN revision: 81492
2012-12-20 21:47:20 +00:00
José Roberto de Souza b9b14269c8 edbus: add helper function edbus_message_iter_struct_like_to_eina_value()
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 81489
2012-12-20 21:38:15 +00:00
José Roberto de Souza 8cb23c5dfb edbus: add _message_iter_from_eina_value_struct to private header
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 81488
2012-12-20 21:38:10 +00:00
Lucas De Marchi 80bdcca7ed 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
2012-12-20 14:52:27 +00:00
Lucas De Marchi 83619110f2 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
2012-12-20 14:52:21 +00:00
Lucas De Marchi 1cae2f1968 edbus: no need for this auxiliary variables, and check refcount first
SVN revision: 81461
2012-12-20 14:52:15 +00:00
José Roberto de Souza ad6fdc585a 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
2012-12-20 01:55:47 +00:00
José Roberto de Souza a4327e30ec edbus: Fix undefined ref. to 'EINA_LOG_DOMAIN_GLOBAL' in examples
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 81415
2012-12-20 01:55:42 +00:00
José Roberto de Souza ab93f397a7 edbus: Only create one ref of proxys when listen object manager
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 81414
2012-12-20 01:55:34 +00:00
Lucas De Marchi bb50f86bc5 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
2012-12-19 17:30:11 +00:00
Lucas De Marchi dcda0e6610 edbus: Fix leftover unref after edbus_service_signal_send change
SVN revision: 81388
2012-12-19 17:30:03 +00:00
Lucas De Marchi 6038eeaf47 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
2012-12-18 21:38:49 +00:00
Lucas De Marchi 7b2ff200f8 edbus: unref sent signal, also for complex types
SVN revision: 81310
2012-12-18 21:38:43 +00:00
Lucas De Marchi b98d5f16b3 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
2012-12-18 20:05:02 +00:00
José Roberto de Souza 36e5dd2ebc 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
2012-12-17 19:48:54 +00:00
Lucas De Marchi 165eb12d81 edbus: fix missing blank lines
Apparently the previous sed script didn't caught all missing blank
lines.



SVN revision: 81179
2012-12-17 19:48:45 +00:00
Lucas De Marchi c4cedac312 edbus: rename DISCONNECTED event
SVN revision: 81177
2012-12-17 18:25:13 +00:00
Lucas De Marchi d2c7cdd0d6 edbus: Fix formatting
SVN revision: 81176
2012-12-17 18:25:06 +00:00
Lucas De Marchi 8cbd63de27 edbus: simplify end condition check in loop
SVN revision: 81175
2012-12-17 18:25:00 +00:00
Lucas De Marchi ada326a184 edbus: avoid using dbus_signature_iter_get_signature when not needed
SVN revision: 81174
2012-12-17 18:24:54 +00:00
Lucas De Marchi 8af6b6620f 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
2012-12-17 18:24:49 +00:00
Lucas De Marchi effae37eab edbus: Fix typo in error message
SVN revision: 81172
2012-12-17 18:24:43 +00:00
Lucas De Marchi f75ffb34fa 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
2012-12-17 18:24:37 +00:00
Lucas De Marchi e53c47bcf0 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
2012-12-17 18:24:31 +00:00
Lucas De Marchi 7a2a31a436 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
2012-12-17 18:24:23 +00:00
Lucas De Marchi 18b1a05ea1 edbus: Improve doc of edbus_{private_,}connection_get
SVN revision: 80968
2012-12-14 16:29:08 +00:00
Lucas De Marchi 0a9daf8e46 edbus: add edbus.spec to gitignore
SVN revision: 80967
2012-12-14 16:29:01 +00:00
Lucas De Marchi aa31434d1f edbus: Remove useless defines
These values are used only using they directly are more meaninful than
those defines.



SVN revision: 80966
2012-12-14 16:28:55 +00:00
Lucas De Marchi eb967fa9d8 edbus: remove unneeded code
SVN revision: 80965
2012-12-14 16:28:50 +00:00
Lucas De Marchi 57e4972180 edbus: if you goto end, you don't use else
SVN revision: 80964
2012-12-14 16:28:46 +00:00
Lucas De Marchi d2a1198b51 edbus: Add missing EINA_WARN_UNUSED_RESULT to service API
SVN revision: 80963
2012-12-14 16:28:41 +00:00
Lucas De Marchi c598ce36fc 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
2012-12-14 16:28:36 +00:00
Lucas De Marchi 7a3fd93948 edbus: Give proper doc to edbus_service_property_changed()
SVN revision: 80961
2012-12-14 16:28:27 +00:00
José Roberto de Souza 3909a4ba36 edbus: Dont create proxy of FDO.Instropectable
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80712
2012-12-11 19:52:24 +00:00
José Roberto de Souza cb2b967570 edbus: Dont create proxy of FDO.Peer
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80711
2012-12-11 19:52:20 +00:00
José Roberto de Souza 7c8e5cd193 edbus: Fix typo in object manager
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80710
2012-12-11 19:52:15 +00:00
José Roberto de Souza 4f05ef66e5 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
2012-12-11 19:52:11 +00:00
José Roberto de Souza d3a279ff56 edbus: Only one ref of Properties interface in each object
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80708
2012-12-11 19:52:06 +00:00
Lucas De Marchi cbc0a8311a edbus: Better naming for FDO proxy in connection
Patch by: Lucas De Marchi <lucas.de.marchi@gmail.com>



SVN revision: 80707
2012-12-11 19:52:02 +00:00
José Roberto de Souza d05347bb91 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
2012-12-11 19:51:38 +00:00
Lucas De Marchi 07e21b19c8 edbus: simplify returning new ref of obj/proxy
Patch by: Lucas De Marchi <lucas.de.marchi@gmail.com>



SVN revision: 80705
2012-12-11 19:51:34 +00:00
José Roberto de Souza 85192f5045 edbus: Add ref to object and proxy in edbus_object/proxy_get
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80704
2012-12-11 19:51:29 +00:00
José Roberto de Souza 4b874afdd9 edbus: Fix typo on doc of edbus_message_arguments_get
Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80703
2012-12-11 19:51:25 +00:00