Commit Graph

25 Commits

Author SHA1 Message Date
Jean-Philippe Andre 10eb4c9a6b eldbus: change to idle_enterer from idler
Summary:
This patch set changes eldbus to use idle_enterer from idler.
If an application does not give idle time, then the eldbus cannot have chance to work.

Reviewers: raster, cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4443
2016-12-06 12:02:32 +09:00
Lukasz Stanislawski abdbb9ad14 eldbus: fix broken fallback interface.
Summary:
Previous implementation assumed that fallback interface path should be changed
on every method call. This is generally not needed since real request
path can be obtained directly from dbus message passed as method call
paremeter.

This patch reverts this behaviour and additionally fix broken Property and Introspect
interface handling of fallback interface.

Reviewers: raster, lucasdemarchi, cedric

Subscribers: cedric, seoz

Differential Revision: https://phab.enlightenment.org/D3016

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-22 00:04:38 +02:00
Felipe Magno de Almeida 835b8756ec Fixes ABI breakage in Eldbus for use with C++ Eldbus
Summary:
This fixes the breakage when Eldbus_Service_Interface_Desc added a
wrongfully methods2 field to a class that is allocated by the user.

This patch adds the respective eldbus_service_interface_register2 and
eldbus_service_interface_fallback_register2 for registration of
Eldbus_Service_Interface_Desc2 which is now versioned. So future the
functions can be backwards compatible and the struct be forward
compatible and leaves the Eldbus_Service_Interface_Desc and
eldbus_service_interface_register and
eldbus_service_interface_fallback_register intact as it was in EFL
1.10.

This fixes T1408

Reviewers: cedric, stefan_schmidt, raster

Reviewed By: raster

Subscribers: cedric

Maniphest Tasks: T1408

Differential Revision: https://phab.enlightenment.org/D1188
2014-07-15 08:01:14 +09:00
Carsten Haitzler fc2c00c67b fix eldbus warnings 2014-07-08 12:45:44 +09:00
Felipe Magno de Almeida 1baf9e4825 eldbus: Fixes ABI break in Eldbus_Method with appended void* data
Summary:
Removed the void* data variable from Eldbus_Method and created another
struct that has the void* data and added an array of Eldbus_Method2 in
the descriptor for the Eldbus_Service_Interface_Desc and making the
appropriate modifications in the implementation to use both
descriptions.

Reviewers: cedric, stefan_schmidt, raster

CC: cedric

Maniphest Tasks: T1408

Differential Revision: https://phab.enlightenment.org/D1139
2014-07-08 11:57:08 +09:00
Felipe Magno de Almeida 30df128be5 eldbus-cxx: Implementation of eldbus C++ API
Summary:
Applications can:

  void method_callback(void* data, const Eldbus_Service_Interface* iface,
                       const Eldbus_Message* message);
  struct { ... } data_struct;

  Eldbus_Method methods[] =
   {
     "method1", ELDBUS_ARGS("b", "bool"), ELDBUS_ARGS("b", "bool"), ELDBUS_METHOD_FLAG_HAS_DATA
     , (Eldbus_Method_Cb)&method_callback, &data_struct
   };

   And method_callback will be called with data parameter pointing to data_struct global object.

Also, Eldbus-cxx supports registering an interface passing a lambda or
function object as method. For example:

  edb::service_interface iface = edb::service_interface_register
    (c, path, interface
     , es::method("SendStringAndBool"
                  , [expected_string, expected_bool] (std::string const& n, bool b
                                                      , bool* out)
                  {
                    std::cout << "Running SendStringAndBool" << std::endl;
                    ck_assert(n == expected_string);
                    ck_assert(b == expected_bool);
                    *out = b;
                    return n;
                  }
                  , es::ins<std::string, bool>("string", "bool")
                  , es::outs<std::string, bool>("string", "bool")
                  )
    );

When a request for "SendStringAndBool" with the proper signature is
called, executes the lambda and replies with the return value and
its bool* out parameter value.

Reviewers: cedric, woohyun, raster

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D1052
2014-07-03 16:28:23 +09:00
Jérémy Zurcher f8c2c57406 do not use EINA_FALSE instead of NULL 2014-05-07 17:45:11 +02:00
Carsten Haitzler 86d9b4ed71 Registers a fallback handler for a given subsection of the object hierarchy.
Summary:
Goal of this patch is cover in Eldbus library function dbus_connection_register_fallback.
http://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html#gac4473b37bfa74ccf7459959d27e7bc59

Reviewers: stanluk, raster

Reviewed By: raster

Differential Revision: https://phab.enlightenment.org/D479
2014-01-23 15:45:22 +09:00
Sebastian Dransfeld 831d17a8e8 eldbus: unref msg on error
If we return here, the msg isn't sent, so unref it.

Fixes CID 1039178
2013-12-07 21:11:33 +01:00
Sebastian Dransfeld c5caea03e3 eldbus: on error unref msg
This is done on all other errors, EINA_SAFETY macros ain't no silver
bullet.

Fixes CID 1039177
2013-12-07 21:11:33 +01:00
Sebastian Dransfeld f950e7990f eldbus: free allocated mem on error
Fixes CID 1039177
2013-12-07 21:11:33 +01:00
José Roberto de Souza 091c5425c6 eldbus: Handle correclty the last unref of a object path or conn in service callback
This allow user remove the last reference of service object path or last
last reference of connection be removed inside of a method callback.
2013-08-26 16:11:31 -03:00
José Roberto de Souza 547313ece9 eldbus: Send all object manager signals of all childrens before delete path or detach object manager 2013-08-26 15:17:02 -03:00
José Roberto de Souza 74bf97600f eldbus: ecore_idler_del() return is the data 2013-08-26 15:16:53 -03:00
José Roberto de Souza 9b49791de0 eldbus: Only a explicit call should unregister a object path 2013-08-26 15:16:43 -03:00
José Roberto de Souza 97ad61df93 eldbus: Empty list of interfaces add/del if there is no parent object manager 2013-08-26 15:16:33 -03:00
José Roberto de Souza d1d298e4c2 eldbus: Use EINA_LIST_FREE instead of EINA_LIST_FOREACH to send interfaces add 2013-08-26 15:16:26 -03:00
José Roberto de Souza 36b71d867c eldbus: Send property changed signals before close connection 2013-08-26 15:16:18 -03:00
José Roberto de Souza 26a6b01369 eldbus: Correctly append name of interface removed 2013-08-23 16:05:18 -03:00
José Roberto de Souza fe6a51f7e9 eldbus: Mark introspection of parent object as dirty when adding a child object 2013-08-23 16:05:06 -03:00
José Roberto de Souza 353de50898 eldbus: Correclty check if user already create a object manager iface to object
CID: 1039421
2013-07-08 13:52:12 -03:00
Jérémy Zurcher 57b2cb5239 eldbus_service: explicitly set flags to 0 in static _Signal and _Method structs 2013-05-07 22:16:37 +02:00
José Roberto de Souza 12855e5fe7 eldbus: Fix interface_unregister() 2013-05-04 10:38:55 -03:00
José Roberto de Souza 9e4dc299a7 eldbus: Fix eldbus_service_*_get() functions over FDO interfaces 2013-05-04 10:38:55 -03:00
Lucas De Marchi 4e3804041f Rename edbus->eldbus
git grep -l edbus2 | while read f; do sed -i 's/edbus2/eldbus/g' "$f"; done
find . -name '*edbus2*' -exec rename edbus2 eldbus {} \;

git grep -l "EDBUS" | while read f; do sed -i 's/EDBUS/ELDBUS/g' "$f"; done
git grep -l "EDBus" | while read f; do sed -i 's/EDBus/Eldbus/g' "$f"; done
git grep -l "edbus (v2)" | while read f; do sed -i 's/edbus (v2)/eldbus/g' "$f"; done
git grep -l "Edbus" | while read f; do sed -i 's/Edbus/Eldbus/g' "$f"; done
git grep -l "edbus" | while read f; do sed -i 's/edbus/eldbus/g' "$f"; done

find . -name '*edbus*' -exec rename edbus eldbus {} \;
find . -name '*EDBus*' -exec rename EDBus Eldbus {} \;
2013-04-23 12:36:29 -03:00