aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2013-04-23 11:40:05 -0300
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2013-04-23 12:36:29 -0300
commit4e3804041f8e865e007b2a6a0d45a05f39500c3b (patch)
treea493b9c8f8a610d2667651f3ba81819ed16fbe8c
parenteoid -> use mmap for allocating id tables. makes it a separate memory (diff)
downloadefl-4e3804041f8e865e007b2a6a0d45a05f39500c3b.tar.gz
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 {} \;
-rw-r--r--.gitignore28
-rw-r--r--AUTHORS2
-rw-r--r--COPYING2
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac28
-rw-r--r--doc/Doxyfile.in4
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/eldbus_examples.dox (renamed from doc/edbus_examples.dox)2
-rw-r--r--doc/main.dox4
-rw-r--r--m4/efl.m410
-rw-r--r--old/ChangeLog.ethumb2
-rw-r--r--old/NEWS.ethumb2
-rw-r--r--old/README.eldbus (renamed from old/README.edbus)8
-rw-r--r--pc/edbus2.pc.in13
-rw-r--r--pc/eldbus.pc.in13
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Makefile_EDBus.am85
-rw-r--r--src/Makefile_Eldbus.am85
-rw-r--r--src/bin/efreet/efreetd_dbus.c120
-rw-r--r--src/bin/eldbus/client.c (renamed from src/bin/edbus/client.c)2
-rw-r--r--src/bin/eldbus/codegen.h (renamed from src/bin/edbus/codegen.h)0
-rw-r--r--src/bin/eldbus/dbus.c (renamed from src/bin/edbus/dbus.c)0
-rw-r--r--src/bin/eldbus/parser.c (renamed from src/bin/edbus/parser.c)0
-rw-r--r--src/bin/eldbus/source_client.c (renamed from src/bin/edbus/source_client.c)224
-rw-r--r--src/bin/eldbus/utils.c (renamed from src/bin/edbus/utils.c)34
-rw-r--r--src/bin/ethumb_client/ethumbd.c288
-rw-r--r--src/examples/edbus/banshee.c241
-rw-r--r--src/examples/edbus/complex-types-server.c393
-rw-r--r--src/examples/edbus/complex-types.c284
-rw-r--r--src/examples/edbus/server.c247
-rw-r--r--src/examples/edbus/simple-signal-emit.c86
-rw-r--r--src/examples/eldbus/Makefile.am (renamed from src/examples/edbus/Makefile.am)16
-rw-r--r--src/examples/eldbus/Makefile.examples (renamed from src/examples/edbus/Makefile.examples)2
-rw-r--r--src/examples/eldbus/banshee.c241
-rw-r--r--src/examples/eldbus/client.c (renamed from src/examples/edbus/client.c)96
-rw-r--r--src/examples/eldbus/complex-types-client-eina-value.c (renamed from src/examples/edbus/complex-types-client-eina-value.c)92
-rw-r--r--src/examples/eldbus/complex-types-server.c393
-rw-r--r--src/examples/eldbus/complex-types.c284
-rw-r--r--src/examples/eldbus/connman-list-services.c (renamed from src/examples/edbus/connman-list-services.c)52
-rw-r--r--src/examples/eldbus/ofono-dial.c (renamed from src/examples/edbus/ofono-dial.c)36
-rw-r--r--src/examples/eldbus/server.c247
-rw-r--r--src/examples/eldbus/simple-signal-emit.c86
-rw-r--r--src/lib/edbus/EDBus.h222
-rw-r--r--src/lib/edbus/edbus_connection.h139
-rw-r--r--src/lib/edbus/edbus_freedesktop.c82
-rw-r--r--src/lib/edbus/edbus_freedesktop.h143
-rw-r--r--src/lib/edbus/edbus_message_eina_value.h36
-rw-r--r--src/lib/edbus/edbus_message_helper.c31
-rw-r--r--src/lib/edbus/edbus_message_helper.h22
-rw-r--r--src/lib/edbus/edbus_object.c676
-rw-r--r--src/lib/edbus/edbus_object.h127
-rw-r--r--src/lib/edbus/edbus_pending.h34
-rw-r--r--src/lib/edbus/edbus_private.h87
-rw-r--r--src/lib/edbus/edbus_proxy.h147
-rw-r--r--src/lib/edbus/edbus_service.h219
-rw-r--r--src/lib/edbus/edbus_signal_handler.h99
-rw-r--r--src/lib/efreet/efreet_cache.c106
-rw-r--r--src/lib/eldbus/Eldbus.h222
-rw-r--r--src/lib/eldbus/eldbus_connection.h139
-rw-r--r--src/lib/eldbus/eldbus_core.c (renamed from src/lib/edbus/edbus_core.c)640
-rw-r--r--src/lib/eldbus/eldbus_freedesktop.c82
-rw-r--r--src/lib/eldbus/eldbus_freedesktop.h143
-rw-r--r--src/lib/eldbus/eldbus_message.c (renamed from src/lib/edbus/edbus_message.c)278
-rw-r--r--src/lib/eldbus/eldbus_message.h (renamed from src/lib/edbus/edbus_message.h)148
-rw-r--r--src/lib/eldbus/eldbus_message_eina_value.h36
-rw-r--r--src/lib/eldbus/eldbus_message_from_eina_value.c (renamed from src/lib/edbus/edbus_message_from_eina_value.c)76
-rw-r--r--src/lib/eldbus/eldbus_message_helper.c31
-rw-r--r--src/lib/eldbus/eldbus_message_helper.h22
-rw-r--r--src/lib/eldbus/eldbus_message_to_eina_value.c (renamed from src/lib/edbus/edbus_message_to_eina_value.c)90
-rw-r--r--src/lib/eldbus/eldbus_object.c676
-rw-r--r--src/lib/eldbus/eldbus_object.h127
-rw-r--r--src/lib/eldbus/eldbus_pending.c (renamed from src/lib/edbus/edbus_pending.c)148
-rw-r--r--src/lib/eldbus/eldbus_pending.h34
-rw-r--r--src/lib/eldbus/eldbus_private.h87
-rw-r--r--src/lib/eldbus/eldbus_private_types.h (renamed from src/lib/edbus/edbus_private_types.h)94
-rw-r--r--src/lib/eldbus/eldbus_proxy.c (renamed from src/lib/edbus/edbus_proxy.c)464
-rw-r--r--src/lib/eldbus/eldbus_proxy.h147
-rw-r--r--src/lib/eldbus/eldbus_service.c (renamed from src/lib/edbus/edbus_service.c)570
-rw-r--r--src/lib/eldbus/eldbus_service.h219
-rw-r--r--src/lib/eldbus/eldbus_signal_handler.c (renamed from src/lib/edbus/edbus_signal_handler.c)142
-rw-r--r--src/lib/eldbus/eldbus_signal_handler.h99
-rw-r--r--src/lib/ethumb_client/ethumb_client.c190
-rw-r--r--src/tests/edbus/edbus_suite.h8
-rw-r--r--src/tests/eldbus/eldbus_suite.c (renamed from src/tests/edbus/edbus_suite.c)20
-rw-r--r--src/tests/eldbus/eldbus_suite.h8
-rw-r--r--src/tests/eldbus/eldbus_test_eldbus_init.c (renamed from src/tests/edbus/edbus_test_edbus_init.c)72
86 files changed, 5472 insertions, 5472 deletions
diff --git a/.gitignore b/.gitignore
index 81728f98aa..d24538e6d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -72,7 +72,7 @@ tags
/src/bin/evas/evas_cserve2_usage
/src/lib/eina/eina_config.h
/src/lib/ecore_x/ecore_x_version.h
-/src/bin/edbus/edbus-codegen
+/src/bin/eldbus/eldbus-codegen
/src/bin/efreet/efreet_desktop_cache_create
/src/bin/efreet/efreet_icon_cache_create
/src/bin/efreet/efreetd
@@ -202,15 +202,15 @@ tags
/src/examples/ecore/ecore_file_download_example
/src/examples/ecore/ecore_imf_example
/src/examples/ecore/ecore_pipe_gstreamer_example
-/src/examples/edbus/banshee
-/src/examples/edbus/client
-/src/examples/edbus/complex-types
-/src/examples/edbus/complex-types-client-eina-value
-/src/examples/edbus/complex-types-server
-/src/examples/edbus/connman-list-services
-/src/examples/edbus/ofono-dial
-/src/examples/edbus/server
-/src/examples/edbus/simple-signal-emit
+/src/examples/eldbus/banshee
+/src/examples/eldbus/client
+/src/examples/eldbus/complex-types
+/src/examples/eldbus/complex-types-client-eina-value
+/src/examples/eldbus/complex-types-server
+/src/examples/eldbus/connman-list-services
+/src/examples/eldbus/ofono-dial
+/src/examples/eldbus/server
+/src/examples/eldbus/simple-signal-emit
/src/examples/edje/edje-multisense
/src/examples/edje/edje_example
/src/examples/eet/eet_basic
@@ -298,9 +298,9 @@ tags
/src/tests/efreet/efreet_user_dir
/src/tests/emotion/emotion_test
/src/tests/ecore/ecore_suite
-/src/tests/edbus/edbus_suite
-/src/tests/edbus/edbus_suite.log
-/src/tests/edbus/edbus_suite.trs
+/src/tests/eldbus/eldbus_suite
+/src/tests/eldbus/eldbus_suite.log
+/src/tests/eldbus/eldbus_suite.trs
/src/tests/edje/edje_suite
/src/tests/eet/eet_suite
/src/tests/eeze/eeze_suite
@@ -322,7 +322,7 @@ tags
/src/tests/evas/evas_suite.trs
/src/test-suite.log
/src/tests/ecore/check-results.xml
-/src/tests/edbus/check-results.xml
+/src/tests/eldbus/check-results.xml
/src/tests/edje/check-results.xml
/src/tests/eet/check-results.xml
/src/tests/eeze/check-results.xml
diff --git a/AUTHORS b/AUTHORS
index 58b03ce2de..4f67e9192c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -215,7 +215,7 @@ Daniel Willmann <d.willmann@samsung.com>
Jérémy Zurcher <jeremy@asynk.ch>
-EDBus
+Eldbus
-----
Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
diff --git a/COPYING b/COPYING
index 64fa409d4b..3aa431f078 100644
--- a/COPYING
+++ b/COPYING
@@ -20,7 +20,7 @@ evas: licenses/COPYING.BSD
embryo: licenses/COPYING.SMALL
ecore: licenses/COPYING.BSD
eio: licenses/COPYING.LGPL
-edbus: licenses/COPYING.LGPL
+eldbus: licenses/COPYING.LGPL
efreet: licenses/COPYING.BSD
eeze: licenses/COPYING.BSD
ephysics: licenses/COPYING.BSD
diff --git a/Makefile.am b/Makefile.am
index d8d113113f..781c5d9487 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -92,7 +92,7 @@ old/NEWS.ethumb \
old/NEWS.evas \
old/NEWS.evil \
old/README.ecore \
-old/README.edbus \
+old/README.eldbus \
old/README.edje \
old/README.eet \
old/README.eeze \
@@ -136,7 +136,7 @@ pc/ecore-imf-evas.pc \
pc/ecore-evas.pc \
pc/embryo.pc \
pc/eio.pc \
-pc/edbus2.pc \
+pc/eldbus.pc \
pc/efreet.pc \
pc/efreet-mime.pc \
pc/efreet-trash.pc \
diff --git a/configure.ac b/configure.ac
index 82f14de512..a64251aec1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3124,8 +3124,8 @@ if test "x${want_eo_id}" = "xyes" ; then
AC_DEFINE([HAVE_EO_ID], [1], [Have eo id])
fi
-#### EDBus
-EFL_LIB_START([EDBus])
+#### Eldbus
+EFL_LIB_START([Eldbus])
### Additional options to configure
@@ -3134,16 +3134,16 @@ EFL_LIB_START([EDBus])
### Checks for programs
## Compatibility layers
-EFL_PLATFORM_DEPEND([EDBUS], [evil])
+EFL_PLATFORM_DEPEND([ELDBUS], [evil])
### Checks for libraries
-EFL_INTERNAL_DEPEND_PKG([EDBUS], [ecore])
-EFL_INTERNAL_DEPEND_PKG([EDBUS], [eo])
-EFL_INTERNAL_DEPEND_PKG([EDBUS], [eina])
+EFL_INTERNAL_DEPEND_PKG([ELDBUS], [ecore])
+EFL_INTERNAL_DEPEND_PKG([ELDBUS], [eo])
+EFL_INTERNAL_DEPEND_PKG([ELDBUS], [eina])
-EFL_DEPEND_PKG([EDBUS], [DBUS], [dbus-1])
+EFL_DEPEND_PKG([ELDBUS], [DBUS], [dbus-1])
-EFL_EVAL_PKGS([EDBUS])
+EFL_EVAL_PKGS([ELDBUS])
### Checks for header files
@@ -3157,8 +3157,8 @@ EFL_EVAL_PKGS([EDBUS])
### Checks for library functions
-EFL_LIB_END([EDBus])
-#### End of EDBus
+EFL_LIB_END([Eldbus])
+#### End of Eldbus
#### Efreet
@@ -3179,7 +3179,7 @@ EFL_PLATFORM_DEPEND([EFREET], [evil])
EFL_INTERNAL_DEPEND_PKG([EFREET], [eet])
EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore])
EFL_INTERNAL_DEPEND_PKG([EFREET], [ecore-file])
-EFL_INTERNAL_DEPEND_PKG([EFREET], [edbus])
+EFL_INTERNAL_DEPEND_PKG([EFREET], [eldbus])
EFL_INTERNAL_DEPEND_PKG([EFREET], [eo])
EFL_INTERNAL_DEPEND_PKG([EFREET], [eina])
@@ -3611,7 +3611,7 @@ EFL_PLATFORM_DEPEND([ETHUMB_CLIENT], [evil])
EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [eina])
EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [eo])
EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [ecore])
-EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [edbus])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [eldbus])
EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [ethumb])
EFL_EVAL_PKGS([ETHUMB_CLIENT])
@@ -3662,7 +3662,7 @@ src/examples/eo/Makefile
src/examples/evas/Makefile
src/examples/ecore/Makefile
src/examples/eio/Makefile
-src/examples/edbus/Makefile
+src/examples/eldbus/Makefile
src/examples/ephysics/Makefile
src/examples/edje/Makefile
src/examples/emotion/Makefile
@@ -3709,7 +3709,7 @@ pc/ecore-imf-evas.pc
pc/ecore-audio.pc
pc/embryo.pc
pc/eio.pc
-pc/edbus2.pc
+pc/eldbus.pc
pc/efreet.pc
pc/efreet-mime.pc
pc/efreet-trash.pc
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 4ee257c93f..567d18e7dc 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -601,7 +601,7 @@ INPUT = @top_srcdir@/src/lib \
@srcdir@/evas_examples.dox \
@srcdir@/eo_tutorial.dox \
@srcdir@/eio_examples.dox \
- @srcdir@/edbus_examples.dox \
+ @srcdir@/eldbus_examples.dox \
@srcdir@/ephysics_examples.dox \
@srcdir@/edje_examples.dox \
@top_srcdir@/src/bin/edje/edje_cc_handlers.c \
@@ -815,7 +815,7 @@ evas_ _evas_ Evas_ _Evas_ EVAS_ _EVAS_ \
eet_ _eet_ Eet_ _Eet_ EET_ _EET_ \
ecore_ _ecore_ Ecore_ _Ecore_ ECORE_ _ECORE_ \
eio_ _eio_ Eio_ _Eio_ EIO_ _EIO_ \
-edbus_ _edbus_ EDBus_ _EDBus_ EDBUS_ _EDBUS_ \
+eldbus_ _eldbus_ Eldbus_ _Eldbus_ ELDBUS_ _ELDBUS_ \
efreet_ _efreet_ Efreet_ _Efreet_ EFREET_ _EFREET_ \
eeze_ _eeze_ Eeze_ _Eeze_ EEZE_ _EEZE_ \
ephysics_ _ephysics_ EPhysics_ _EPhysics_ EPHYSICS_ _EPHYSICS_ \
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8c1e3fb85b..7c94bce163 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -38,7 +38,7 @@ e.css \
head.html \
foot.html \
ecore_examples.dox \
-edbus_examples.dox \
+eldbus_examples.dox \
edje_examples.dox \
eet_examples.dox \
eina_examples.dox \
diff --git a/doc/edbus_examples.dox b/doc/eldbus_examples.dox
index 08c687d675..1368c68d11 100644
--- a/doc/edbus_examples.dox
+++ b/doc/eldbus_examples.dox
@@ -1,5 +1,5 @@
/**
- * @page edbus_examples EDBus Examples
+ * @page eldbus_examples Eldbus Examples
*
* Examples:
* @li @ref banshee.c
diff --git a/doc/main.dox b/doc/main.dox
index 9faf1491e7..f132f3a465 100644
--- a/doc/main.dox
+++ b/doc/main.dox
@@ -16,7 +16,7 @@
* @li @ref escape_main playstation3 portability layer.
* @li @ref evil_main microsoft windows portability layer.
* @li @ref eio_main asynchronous input/output
- * @li @ref edbus_main d-bus integration.
+ * @li @ref eldbus_main d-bus integration.
* @li @ref efreet_main freedesktop.org (xdg) menu and desktop integration.
* @li @ref eeze_main hardware device manipulation and notification.
* @li @ref ephysics_main physics simulation integration and visual effects.
@@ -205,7 +205,7 @@
*/
/**
- * @defgroup EDBus
+ * @defgroup Eldbus
*
* @brief D-Bus integration with EFL (Ecore).
*/
diff --git a/m4/efl.m4 b/m4/efl.m4
index eb7a4beeb1..8e2ad4c9c3 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -137,9 +137,9 @@ depname="$2"
libdirname="m4_defn([DOWNOTHER])"
libname="m4_defn([DOWNOTHER])"
case "m4_defn([DOWNOTHER])" in
- edbus)
- depname="edbus2"
- libname="edbus2"
+ eldbus)
+ depname="eldbus"
+ libname="eldbus"
;;
ethumb_client)
depname="ethumb_client"
@@ -357,8 +357,8 @@ m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
libdirname="m4_defn([DOWN])"
libname="m4_defn([DOWN])"
case "m4_defn([DOWN])" in
- edbus)
- libname="edbus2"
+ eldbus)
+ libname="eldbus"
;;
esac
diff --git a/old/ChangeLog.ethumb b/old/ChangeLog.ethumb
index 2470e87074..d33204269d 100644
--- a/old/ChangeLog.ethumb
+++ b/old/ChangeLog.ethumb
@@ -1,6 +1,6 @@
2012-12-03 Gustavo Sverzut Barbieri (k-s)
- * port to edbus (v2)
+ * port to eldbus
2012-04-26 Carsten Haitzler (The Rasterman)
diff --git a/old/NEWS.ethumb b/old/NEWS.ethumb
index bf716c6880..6c38ba8269 100644
--- a/old/NEWS.ethumb
+++ b/old/NEWS.ethumb
@@ -4,7 +4,7 @@ Changes since Ethumb 1.7.0:
Additions:
- - Port to edbus (v2), added new dependency.
+ - Port to eldbus, added new dependency.
Fixes:
diff --git a/old/README.edbus b/old/README.eldbus
index 50d6d18838..bfd205f241 100644
--- a/old/README.edbus
+++ b/old/README.eldbus
@@ -1,9 +1,9 @@
ABOUT:
-----
-EDBus provides easy access to D-Bus from EFL applications.
+Eldbus provides easy access to D-Bus from EFL applications.
-EDBus allows connecting to both system and session buses acting as
+Eldbus allows connecting to both system and session buses acting as
both client and service roles.
Many official D-Bus specifications and interfaces are supported, namely:
@@ -14,8 +14,8 @@ Many official D-Bus specifications and interfaces are supported, namely:
- org.freedesktop.DBus.ObjectManager: partial support (under dev).
One can create client-side objects using the low-level methods from
-EDBus_Connection and EDBus_Object, or go high level with
-EDBus_Proxy.
+Eldbus_Connection and Eldbus_Object, or go high level with
+Eldbus_Proxy.
RELATION TO OLD E_DBUS:
diff --git a/pc/edbus2.pc.in b/pc/edbus2.pc.in
deleted file mode 100644
index 512ba7f5ef..0000000000
--- a/pc/edbus2.pc.in
+++ /dev/null
@@ -1,13 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: edbus
-Description: D-Bus access from Ecore
-Requires.private: @requirements_pc_edbus@
-Version: @VERSION@
-Libs: -L${libdir} -ledbus2
-Libs.private: @requirements_libs_edbus@
-Cflags: -I${includedir}/edbus-@VMAJ@
-
diff --git a/pc/eldbus.pc.in b/pc/eldbus.pc.in
new file mode 100644
index 0000000000..94997fc0f8
--- /dev/null
+++ b/pc/eldbus.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: eldbus
+Description: D-Bus access from Ecore
+Requires.private: @requirements_pc_eldbus@
+Version: @VERSION@
+Libs: -L${libdir} -leldbus
+Libs.private: @requirements_libs_eldbus@
+Cflags: -I${includedir}/eldbus-@VMAJ@
+
diff --git a/src/Makefile.am b/src/Makefile.am
index a903eed962..4821ebf934 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,7 +42,7 @@ include Makefile_Ecore_Evas.am
include Makefile_Ecore_Audio.am
include Makefile_Embryo.am
include Makefile_Eio.am
-include Makefile_EDBus.am
+include Makefile_Eldbus.am
include Makefile_Efreet.am
include Makefile_Eeze.am
include Makefile_EPhysics.am
@@ -71,7 +71,7 @@ examples/eet \
examples/evas \
examples/ecore \
examples/eio \
-examples/edbus \
+examples/eldbus \
examples/ephysics \
examples/edje \
examples/emotion \
diff --git a/src/Makefile_EDBus.am b/src/Makefile_EDBus.am
deleted file mode 100644
index 6f5dbd49e1..0000000000
--- a/src/Makefile_EDBus.am
+++ /dev/null
@@ -1,85 +0,0 @@
-
-### Library
-
-lib_LTLIBRARIES += lib/edbus/libedbus2.la
-
-installed_edbusmainheadersdir = $(includedir)/edbus-@VMAJ@
-dist_installed_edbusmainheaders_DATA = \
-lib/edbus/EDBus.h \
-lib/edbus/edbus_connection.h \
-lib/edbus/edbus_freedesktop.h \
-lib/edbus/edbus_message.h \
-lib/edbus/edbus_object.h \
-lib/edbus/edbus_pending.h \
-lib/edbus/edbus_proxy.h \
-lib/edbus/edbus_service.h \
-lib/edbus/edbus_signal_handler.h \
-lib/edbus/edbus_message_helper.h \
-lib/edbus/edbus_message_eina_value.h
-
-lib_edbus_libedbus2_la_SOURCES = \
-lib/edbus/edbus_private.h \
-lib/edbus/edbus_private_types.h \
-lib/edbus/edbus_proxy.c \
-lib/edbus/edbus_core.c \
-lib/edbus/edbus_message.c \
-lib/edbus/edbus_object.c \
-lib/edbus/edbus_pending.c \
-lib/edbus/edbus_freedesktop.c \
-lib/edbus/edbus_service.c \
-lib/edbus/edbus_signal_handler.c \
-lib/edbus/edbus_message_helper.c \
-lib/edbus/edbus_message_to_eina_value.c \
-lib/edbus/edbus_message_from_eina_value.c
-
-lib_edbus_libedbus2_la_CPPFLAGS = \
--include $(top_builddir)/config.h \
-@EDBUS_CFLAGS@
-lib_edbus_libedbus2_la_LIBADD = @EDBUS_LIBS@
-lib_edbus_libedbus2_la_DEPENDENCIES = @EDBUS_INTERNAL_LIBS@
-lib_edbus_libedbus2_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
-
-### Binary
-
-bin_PROGRAMS += bin/edbus/edbus-codegen
-
-bin_edbus_edbus_codegen_SOURCES = \
-bin/edbus/codegen.h \
-bin/edbus/utils.c \
-bin/edbus/parser.c \
-bin/edbus/dbus.c \
-bin/edbus/source_client.c \
-bin/edbus/client.c
-
-bin_edbus_edbus_codegen_CPPFLAGS = \
--DPACKAGE_BIN_DIR=\"$(bindir)\" \
--DPACKAGE_LIB_DIR=\"$(libdir)\" \
--DPACKAGE_DATA_DIR=\"$(datadir)/edbus\" \
-@EDBUS_CFLAGS@
-
-if HAVE_WIN32
-bin_edbus_edbus_codegen_LDADD = -L$(top_builddir)/src/lib/evil @USE_EDBUS_LIBS@
-else
-bin_edbus_edbus_codegen_LDADD = @USE_EDBUS_LIBS@
-endif
-bin_edbus_edbus_codegen_DEPENDENCIES = @USE_EDBUS_INTERNAL_LIBS@
-
-### Unit tests
-
-if EFL_ENABLE_TESTS
-
-check_PROGRAMS += tests/edbus/edbus_suite
-TESTS += tests/edbus/edbus_suite
-
-tests_edbus_edbus_suite_SOURCES = \
-tests/edbus/edbus_suite.c \
-tests/edbus/edbus_test_edbus_init.c \
-tests/edbus/edbus_suite.h
-
-tests_edbus_edbus_suite_CPPFLAGS = @CHECK_CFLAGS@ @EDBUS_CFLAGS@ \
--DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/edbus\"
-
-tests_edbus_edbus_suite_LDADD = @CHECK_LIBS@ @USE_EDBUS_LIBS@
-tests_edbus_edbus_suite_DEPENDENCIES = @USE_EDBUS_INTERNAL_LIBS@
-
-endif
diff --git a/src/Makefile_Eldbus.am b/src/Makefile_Eldbus.am
new file mode 100644
index 0000000000..b736e99303
--- /dev/null
+++ b/src/Makefile_Eldbus.am
@@ -0,0 +1,85 @@
+
+### Library
+
+lib_LTLIBRARIES += lib/eldbus/libeldbus.la
+
+installed_eldbusmainheadersdir = $(includedir)/eldbus-@VMAJ@
+dist_installed_eldbusmainheaders_DATA = \
+lib/eldbus/Eldbus.h \
+lib/eldbus/eldbus_connection.h \
+lib/eldbus/eldbus_freedesktop.h \
+lib/eldbus/eldbus_message.h \
+lib/eldbus/eldbus_object.h \
+lib/eldbus/eldbus_pending.h \
+lib/eldbus/eldbus_proxy.h \
+lib/eldbus/eldbus_service.h \
+lib/eldbus/eldbus_signal_handler.h \
+lib/eldbus/eldbus_message_helper.h \
+lib/eldbus/eldbus_message_eina_value.h
+
+lib_eldbus_libeldbus_la_SOURCES = \
+lib/eldbus/eldbus_private.h \
+lib/eldbus/eldbus_private_types.h \
+lib/eldbus/eldbus_proxy.c \
+lib/eldbus/eldbus_core.c \
+lib/eldbus/eldbus_message.c \
+lib/eldbus/eldbus_object.c \
+lib/eldbus/eldbus_pending.c \
+lib/eldbus/eldbus_freedesktop.c \
+lib/eldbus/eldbus_service.c \
+lib/eldbus/eldbus_signal_handler.c \
+lib/eldbus/eldbus_message_helper.c \
+lib/eldbus/eldbus_message_to_eina_value.c \
+lib/eldbus/eldbus_message_from_eina_value.c
+
+lib_eldbus_libeldbus_la_CPPFLAGS = \
+-include $(top_builddir)/config.h \
+@ELDBUS_CFLAGS@
+lib_eldbus_libeldbus_la_LIBADD = @ELDBUS_LIBS@
+lib_eldbus_libeldbus_la_DEPENDENCIES = @ELDBUS_INTERNAL_LIBS@
+lib_eldbus_libeldbus_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
+
+### Binary
+
+bin_PROGRAMS += bin/eldbus/eldbus-codegen
+
+bin_eldbus_eldbus_codegen_SOURCES = \
+bin/eldbus/codegen.h \
+bin/eldbus/utils.c \
+bin/eldbus/parser.c \
+bin/eldbus/dbus.c \
+bin/eldbus/source_client.c \
+bin/eldbus/client.c
+
+bin_eldbus_eldbus_codegen_CPPFLAGS = \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_DATA_DIR=\"$(datadir)/eldbus\" \
+@ELDBUS_CFLAGS@
+
+if HAVE_WIN32
+bin_eldbus_eldbus_codegen_LDADD = -L$(top_builddir)/src/lib/evil @USE_ELDBUS_LIBS@
+else
+bin_eldbus_eldbus_codegen_LDADD = @USE_ELDBUS_LIBS@
+endif
+bin_eldbus_eldbus_codegen_DEPENDENCIES = @USE_ELDBUS_INTERNAL_LIBS@
+
+### Unit tests
+
+if EFL_ENABLE_TESTS
+
+check_PROGRAMS += tests/eldbus/eldbus_suite
+TESTS += tests/eldbus/eldbus_suite
+
+tests_eldbus_eldbus_suite_SOURCES = \
+tests/eldbus/eldbus_suite.c \
+tests/eldbus/eldbus_test_eldbus_init.c \
+tests/eldbus/eldbus_suite.h
+
+tests_eldbus_eldbus_suite_CPPFLAGS = @CHECK_CFLAGS@ @ELDBUS_CFLAGS@ \
+-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eldbus\"
+
+tests_eldbus_eldbus_suite_LDADD = @CHECK_LIBS@ @USE_ELDBUS_LIBS@
+tests_eldbus_eldbus_suite_DEPENDENCIES = @USE_ELDBUS_INTERNAL_LIBS@
+
+endif
diff --git a/src/bin/efreet/efreetd_dbus.c b/src/bin/efreet/efreetd_dbus.c
index 0b305ea6f4..82a66c179f 100644
--- a/src/bin/efreet/efreetd_dbus.c
+++ b/src/bin/efreet/efreetd_dbus.c
@@ -3,7 +3,7 @@
#endif
#include <Ecore.h>
-#include <EDBus.h>
+#include <Eldbus.h>
#include "efreetd.h"
#include "efreetd_cache.h"
@@ -19,8 +19,8 @@ enum
EFREET_SIGNAL_DESKTOP_CACHE_UPDATE
};
-static EDBus_Connection *conn;
-static EDBus_Service_Interface *iface;
+static Eldbus_Connection *conn;
+static Eldbus_Service_Interface *iface;
static Ecore_Timer *_shutdown = NULL;
static int clients = 0;
@@ -33,7 +33,7 @@ do_shutdown(void *data EINA_UNUSED)
}
static void
-disconnected(void *context EINA_UNUSED, EDBus_Connection *connection EINA_UNUSED, void *event_info EINA_UNUSED)
+disconnected(void *context EINA_UNUSED, Eldbus_Connection *connection EINA_UNUSED, void *event_info EINA_UNUSED)
{
INF("disconnected");
quit();
@@ -44,7 +44,7 @@ client_name_owner_changed_cb(void *data EINA_UNUSED, const char *bus, const char
{
if (new_id[0])
return;
- edbus_name_owner_changed_callback_del(conn, bus,
+ eldbus_name_owner_changed_callback_del(conn, bus,
client_name_owner_changed_cb, NULL);
clients--;
if (clients <= 0)
@@ -55,13 +55,13 @@ client_name_owner_changed_cb(void *data EINA_UNUSED, const char *bus, const char
}
}
-static EDBus_Message *
-do_register(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message)
+static Eldbus_Message *
+do_register(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
{
- EDBus_Message *reply;
+ Eldbus_Message *reply;
const char *lang;
- if (!edbus_message_arguments_get(message, "s", &lang))
+ if (!eldbus_message_arguments_get(message, "s", &lang))
{
ERR("Error getting arguments.");
return NULL;
@@ -72,28 +72,28 @@ do_register(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message
if (_shutdown) ecore_timer_del(_shutdown);
_shutdown = NULL;
- edbus_name_owner_changed_callback_add(conn,
- edbus_message_sender_get(message),
+ eldbus_name_owner_changed_callback_add(conn,
+ eldbus_message_sender_get(message),
client_name_owner_changed_cb, NULL,
EINA_FALSE);
- reply = edbus_message_method_return_new(message);
- edbus_message_arguments_append(reply, "b", cache_desktop_exists());
+ reply = eldbus_message_method_return_new(message);
+ eldbus_message_arguments_append(reply, "b", cache_desktop_exists());
return reply;
}
-static EDBus_Message *
-add_desktop_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message)
+static Eldbus_Message *
+add_desktop_dirs(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
{
- EDBus_Message_Iter *array = NULL;
+ Eldbus_Message_Iter *array = NULL;
const char *dir;
- if (!edbus_message_arguments_get(message, "as", &array))
+ if (!eldbus_message_arguments_get(message, "as", &array))
{
ERR("Error getting arguments.");
return NULL;
}
- while (edbus_message_iter_get_and_next(array, 's', &dir))
+ while (eldbus_message_iter_get_and_next(array, 's', &dir))
{
cache_desktop_dir_add(dir);
}
@@ -101,19 +101,19 @@ add_desktop_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Mes
return NULL;
}
-static EDBus_Message *
-add_icon_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message)
+static Eldbus_Message *
+add_icon_dirs(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
{
- EDBus_Message_Iter *array = NULL;
+ Eldbus_Message_Iter *array = NULL;
const char *dir;
- if (!edbus_message_arguments_get(message, "as", &array))
+ if (!eldbus_message_arguments_get(message, "as", &array))
{
ERR("Error getting arguments.");
return NULL;
}
- while (edbus_message_iter_get_and_next(array, 's', &dir))
+ while (eldbus_message_iter_get_and_next(array, 's', &dir))
{
cache_icon_dir_add(dir);
}
@@ -121,12 +121,12 @@ add_icon_dirs(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Messag
return NULL;
}
-static EDBus_Message *
-build_desktop_cache(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message EINA_UNUSED)
+static Eldbus_Message *
+build_desktop_cache(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message EINA_UNUSED)
{
const char *lang;
- if (!edbus_message_arguments_get(message, "s", &lang))
+ if (!eldbus_message_arguments_get(message, "s", &lang))
{
ERR("Error getting arguments.");
return NULL;
@@ -137,19 +137,19 @@ build_desktop_cache(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_
return NULL;
}
-static EDBus_Message *
-add_icon_exts(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Message *message)
+static Eldbus_Message *
+add_icon_exts(const Eldbus_Service_Interface *ifc EINA_UNUSED, const Eldbus_Message *message)
{
- EDBus_Message_Iter *array = NULL;
+ Eldbus_Message_Iter *array = NULL;
const char *ext;
- if (!edbus_message_arguments_get(message, "as", &array))
+ if (!eldbus_message_arguments_get(message, "as", &array))
{
ERR("Error getting arguments.");
return NULL;
}
- while (edbus_message_iter_get_and_next(array, 's', &ext))
+ while (eldbus_message_iter_get_and_next(array, 's', &ext))
{
cache_icon_ext_add(ext);
}
@@ -157,60 +157,60 @@ add_icon_exts(const EDBus_Service_Interface *ifc EINA_UNUSED, const EDBus_Messag
return NULL;
}
-static const EDBus_Signal signals[] = {
- [EFREET_SIGNAL_ICON_CACHE_UPDATE] = {"IconCacheUpdate", EDBUS_ARGS({ "b", "update" }), 0},
- [EFREET_SIGNAL_DESKTOP_CACHE_UPDATE] = {"DesktopCacheUpdate", EDBUS_ARGS({ "b", "update" }), 0},
+static const Eldbus_Signal signals[] = {
+ [EFREET_SIGNAL_ICON_CACHE_UPDATE] = {"IconCacheUpdate", ELDBUS_ARGS({ "b", "update" }), 0},
+ [EFREET_SIGNAL_DESKTOP_CACHE_UPDATE] = {"DesktopCacheUpdate", ELDBUS_ARGS({ "b", "update" }), 0},
{ NULL, NULL, 0 }
};
-static const EDBus_Method methods[] = {
+static const Eldbus_Method methods[] = {
{
- "Register", EDBUS_ARGS({"s", "lang info"}), EDBUS_ARGS({"b", "cache exists"}),
+ "Register", ELDBUS_ARGS({"s", "lang info"}), ELDBUS_ARGS({"b", "cache exists"}),
do_register, 0
},
{
- "AddDesktopDirs", EDBUS_ARGS({"as", "dirs"}), NULL,
- add_desktop_dirs, EDBUS_METHOD_FLAG_NOREPLY
+ "AddDesktopDirs", ELDBUS_ARGS({"as", "dirs"}), NULL,
+ add_desktop_dirs, ELDBUS_METHOD_FLAG_NOREPLY
},
{
- "BuildDesktopCache", EDBUS_ARGS({"s", "lang info"}), NULL,
- build_desktop_cache, EDBUS_METHOD_FLAG_NOREPLY
+ "BuildDesktopCache", ELDBUS_ARGS({"s", "lang info"}), NULL,
+ build_desktop_cache, ELDBUS_METHOD_FLAG_NOREPLY
},
{
- "AddIconDirs", EDBUS_ARGS({"as", "dirs"}), NULL,
- add_icon_dirs, EDBUS_METHOD_FLAG_NOREPLY
+ "AddIconDirs", ELDBUS_ARGS({"as", "dirs"}), NULL,
+ add_icon_dirs, ELDBUS_METHOD_FLAG_NOREPLY
},
{
- "AddIconExts", EDBUS_ARGS({"as", "exts"}), NULL,
- add_icon_exts, EDBUS_METHOD_FLAG_NOREPLY
+ "AddIconExts", ELDBUS_ARGS({"as", "exts"}), NULL,
+ add_icon_exts, ELDBUS_METHOD_FLAG_NOREPLY
},
{ NULL, NULL, NULL, NULL, 0 }
};
-static const EDBus_Service_Interface_Desc desc = {
+static const Eldbus_Service_Interface_Desc desc = {
INTERFACE, methods, signals, NULL, NULL, NULL
};
static void
-on_name_request(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_name_request(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
unsigned int reply;
- if (edbus_message_error_get(msg, NULL, NULL))
+ if (eldbus_message_error_get(msg, NULL, NULL))
{
ERR("error on on_name_request");
quit();
return;
}
- if (!edbus_message_arguments_get(msg, "u", &reply))
+ if (!eldbus_message_arguments_get(msg, "u", &reply))
{
ERR("error getting arguments on on_name_request");
quit();
return;
}
- if (reply != EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
+ if (reply != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
{
ERR("error name already in use");
quit();
@@ -223,40 +223,40 @@ on_name_request(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
void
send_signal_icon_cache_update(Eina_Bool update)
{
- edbus_service_signal_emit(iface, EFREET_SIGNAL_ICON_CACHE_UPDATE, update);
+ eldbus_service_signal_emit(iface, EFREET_SIGNAL_ICON_CACHE_UPDATE, update);
}
void
send_signal_desktop_cache_update(Eina_Bool update)
{
- edbus_service_signal_emit(iface, EFREET_SIGNAL_DESKTOP_CACHE_UPDATE, update);
+ eldbus_service_signal_emit(iface, EFREET_SIGNAL_DESKTOP_CACHE_UPDATE, update);
}
Eina_Bool
dbus_init(void)
{
- if (!edbus_init()) return EINA_FALSE;
+ if (!eldbus_init()) return EINA_FALSE;
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
if (!conn) goto conn_error;
- edbus_connection_event_callback_add(conn,
- EDBUS_CONNECTION_EVENT_DISCONNECTED, disconnected, NULL);
- iface = edbus_service_interface_register(conn, PATH, &desc);
- edbus_name_request(conn, BUS, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
+ eldbus_connection_event_callback_add(conn,
+ ELDBUS_CONNECTION_EVENT_DISCONNECTED, disconnected, NULL);
+ iface = eldbus_service_interface_register(conn, PATH, &desc);
+ eldbus_name_request(conn, BUS, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
on_name_request, NULL);
return EINA_TRUE;
conn_error:
- edbus_shutdown();
+ eldbus_shutdown();
return EINA_FALSE;
}
Eina_Bool
dbus_shutdown(void)
{
- edbus_connection_unref(conn);
- edbus_shutdown();
+ eldbus_connection_unref(conn);
+ eldbus_shutdown();
return EINA_TRUE;
}
diff --git a/src/bin/edbus/client.c b/src/bin/eldbus/client.c
index 742a294e27..feca0841de 100644
--- a/src/bin/edbus/client.c
+++ b/src/bin/eldbus/client.c
@@ -1,7 +1,7 @@
#include "codegen.h"
static const Ecore_Getopt optdesc = {
- "edbus_codegen",
+ "eldbus_codegen",
"%prog [options] <file.xml>",
"1.0",
"(C) 2012 - The Enlightenment Project",
diff --git a/src/bin/edbus/codegen.h b/src/bin/eldbus/codegen.h
index ffcaf993ef..ffcaf993ef 100644
--- a/src/bin/edbus/codegen.h
+++ b/src/bin/eldbus/codegen.h
diff --git a/src/bin/edbus/dbus.c b/src/bin/eldbus/dbus.c
index ac9e828f57..ac9e828f57 100644
--- a/src/bin/edbus/dbus.c
+++ b/src/bin/eldbus/dbus.c
diff --git a/src/bin/edbus/parser.c b/src/bin/eldbus/parser.c
index 96a8f9e354..96a8f9e354 100644
--- a/src/bin/edbus/parser.c
+++ b/src/bin/eldbus/parser.c
diff --git a/src/bin/edbus/source_client.c b/src/bin/eldbus/source_client.c
index 6d3a34d57e..3d0bf437f4 100644
--- a/src/bin/edbus/source_client.c
+++ b/src/bin/eldbus/source_client.c
@@ -51,7 +51,7 @@ dbus_type2c_type2(const char *dbus_type, Eina_Bool with_const)
case 'v'://variant
case '{'://dict
case '('://struct
- return "EDBus_Message_Iter *";
+ return "Eldbus_Message_Iter *";
default:
{
printf("Error type not handled: %c\n", dbus_type[0]);
@@ -81,39 +81,39 @@ source_client_complex_method_call_generate(const DBus_Method *method, Eina_Strbu
if (method->no_reply)
{
- eina_strbuf_append_printf(h, "void %s_call(EDBus_Proxy *proxy, Eina_Value *args);\n", prefix_append(method->c_name));
+ eina_strbuf_append_printf(h, "void %s_call(Eldbus_Proxy *proxy, Eina_Value *args);\n", prefix_append(method->c_name));
- eina_strbuf_append_printf(c_code, "\nvoid \n%s_call(EDBus_Proxy *proxy, Eina_Value *args)\n{\n", prefix_append(method->c_name));
+ eina_strbuf_append_printf(c_code, "\nvoid \n%s_call(Eldbus_Proxy *proxy, Eina_Value *args)\n{\n", prefix_append(method->c_name));
eina_strbuf_append_printf(c_code, " EINA_SAFETY_ON_NULL_RETURN(proxy);\n");
- eina_strbuf_append_printf(c_code, " EDBus_Message *msg = edbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
- eina_strbuf_append_printf(c_code, " if (!edbus_message_from_eina_value(\"%s\", msg, args))\n", eina_strbuf_string_get(full_signature));
+ eina_strbuf_append_printf(c_code, " Eldbus_Message *msg = eldbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_from_eina_value(\"%s\", msg, args))\n", eina_strbuf_string_get(full_signature));
eina_strbuf_append_printf(c_code, " {\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message from eina value.\");\n");
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
- eina_strbuf_append_printf(c_code, " edbus_proxy_send(proxy, msg, %s, NULL, NULL, -1);\n", method->cb_name);
+ eina_strbuf_append_printf(c_code, " eldbus_proxy_send(proxy, msg, %s, NULL, NULL, -1);\n", method->cb_name);
eina_strbuf_append_printf(c_code, "}\n");
goto end;
}
- eina_strbuf_append_printf(h, "EDBus_Pending *%s_call", prefix_append(method->c_name));
- eina_strbuf_append_printf(h, "(EDBus_Proxy *proxy, %s cb, const void *data, Eina_Value *args);\n", prefix_append(method->function_cb));
+ eina_strbuf_append_printf(h, "Eldbus_Pending *%s_call", prefix_append(method->c_name));
+ eina_strbuf_append_printf(h, "(Eldbus_Proxy *proxy, %s cb, const void *data, Eina_Value *args);\n", prefix_append(method->function_cb));
- eina_strbuf_append_printf(c_code, "\nEDBus_Pending *\n%s_call(", prefix_append(method->c_name));
- eina_strbuf_append_printf(c_code, "EDBus_Proxy *proxy, %s cb, const void *data, Eina_Value *args)\n{\n", prefix_append(method->function_cb));
- eina_strbuf_append_printf(c_code, " EDBus_Message *msg;\n");
- eina_strbuf_append_printf(c_code, " EDBus_Pending *p;\n");
+ eina_strbuf_append_printf(c_code, "\nEldbus_Pending *\n%s_call(", prefix_append(method->c_name));
+ eina_strbuf_append_printf(c_code, "Eldbus_Proxy *proxy, %s cb, const void *data, Eina_Value *args)\n{\n", prefix_append(method->function_cb));
+ eina_strbuf_append_printf(c_code, " Eldbus_Message *msg;\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Pending *p;\n");
eina_strbuf_append_printf(c_code, " EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);\n");
- eina_strbuf_append_printf(c_code, " msg = edbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
- eina_strbuf_append_printf(c_code, " if (!edbus_message_from_eina_value(\"%s\", msg, args))\n", eina_strbuf_string_get(full_signature));
+ eina_strbuf_append_printf(c_code, " msg = eldbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_from_eina_value(\"%s\", msg, args))\n", eina_strbuf_string_get(full_signature));
eina_strbuf_append_printf(c_code, " {\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message from eina value.\");\n");
eina_strbuf_append_printf(c_code, " return NULL;\n");
eina_strbuf_append_printf(c_code, " }\n");
- eina_strbuf_append_printf(c_code, " p = edbus_proxy_send(proxy, msg, %s, cb, -1);\n", method->cb_name);
+ eina_strbuf_append_printf(c_code, " p = eldbus_proxy_send(proxy, msg, %s, cb, -1);\n", method->cb_name);
eina_strbuf_append_printf(c_code, " if (data)\n");
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__user_data\", data);\n");
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__proxy\", proxy);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__user_data\", data);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__proxy\", proxy);\n");
eina_strbuf_append_printf(c_code, " return p;\n");
eina_strbuf_append_printf(c_code, "}\n");
@@ -128,8 +128,8 @@ source_client_simple_method_call_no_reply_generate(const DBus_Method *method, Ei
Eina_Strbuf *full_signature = eina_strbuf_new();
Eina_Strbuf *args_call = eina_strbuf_new();
- eina_strbuf_append_printf(h, "void %s_call(EDBus_Proxy *proxy", prefix_append(method->c_name));
- eina_strbuf_append_printf(c_code, "\nvoid\n%s_call(EDBus_Proxy *proxy", prefix_append(method->c_name));
+ eina_strbuf_append_printf(h, "void %s_call(Eldbus_Proxy *proxy", prefix_append(method->c_name));
+ eina_strbuf_append_printf(c_code, "\nvoid\n%s_call(Eldbus_Proxy *proxy", prefix_append(method->c_name));
EINA_INLIST_FOREACH(method->args, arg)
{
@@ -143,15 +143,15 @@ source_client_simple_method_call_no_reply_generate(const DBus_Method *method, Ei
eina_strbuf_append_printf(h, ");\n");
eina_strbuf_append_printf(c_code, ")\n{\n");
- eina_strbuf_append_printf(c_code, " EDBus_Message *msg;\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Message *msg;\n");
eina_strbuf_append_printf(c_code, " EINA_SAFETY_ON_NULL_RETURN(proxy);\n");
- eina_strbuf_append_printf(c_code, " msg = edbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
- eina_strbuf_append_printf(c_code, " if (!edbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call));
+ eina_strbuf_append_printf(c_code, " msg = eldbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call));
eina_strbuf_append_printf(c_code, " {\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message.\");\n");
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
- eina_strbuf_append_printf(c_code, " edbus_proxy_send(proxy, msg, NULL, NULL, -1);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_proxy_send(proxy, msg, NULL, NULL, -1);\n");
eina_strbuf_append_printf(c_code, "}\n");
eina_strbuf_free(full_signature);
@@ -165,10 +165,10 @@ source_client_simple_method_call_generate(const DBus_Method *method, Eina_Strbuf
Eina_Strbuf *full_signature = eina_strbuf_new();
Eina_Strbuf *args_call = eina_strbuf_new();
- eina_strbuf_append_printf(h, "EDBus_Pending *%s_call", prefix_append(method->c_name));
- eina_strbuf_append_printf(h, "(EDBus_Proxy *proxy, %s cb, const void *data", prefix_append(method->function_cb));
- eina_strbuf_append_printf(c_code, "\nEDBus_Pending *\n%s_call", prefix_append(method->c_name));
- eina_strbuf_append_printf(c_code, "(EDBus_Proxy *proxy, %s cb, const void *data", prefix_append(method->function_cb));
+ eina_strbuf_append_printf(h, "Eldbus_Pending *%s_call", prefix_append(method->c_name));
+ eina_strbuf_append_printf(h, "(Eldbus_Proxy *proxy, %s cb, const void *data", prefix_append(method->function_cb));
+ eina_strbuf_append_printf(c_code, "\nEldbus_Pending *\n%s_call", prefix_append(method->c_name));
+ eina_strbuf_append_printf(c_code, "(Eldbus_Proxy *proxy, %s cb, const void *data", prefix_append(method->function_cb));
EINA_INLIST_FOREACH(method->args, arg)
{
@@ -182,19 +182,19 @@ source_client_simple_method_call_generate(const DBus_Method *method, Eina_Strbuf
eina_strbuf_append_printf(h, ");\n");
eina_strbuf_append_printf(c_code,")\n{\n");
- eina_strbuf_append_printf(c_code, " EDBus_Message *msg;\n");
- eina_strbuf_append_printf(c_code, " EDBus_Pending *p;\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Message *msg;\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Pending *p;\n");
eina_strbuf_append_printf(c_code, " EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);\n");
- eina_strbuf_append_printf(c_code, " msg = edbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
- eina_strbuf_append_printf(c_code, " if (!edbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call));
+ eina_strbuf_append_printf(c_code, " msg = eldbus_proxy_method_call_new(proxy, \"%s\");\n", method->name);
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_append(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(args_call));
eina_strbuf_append_printf(c_code, " {\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Filling message.\");\n");
eina_strbuf_append_printf(c_code, " return NULL;\n");
eina_strbuf_append_printf(c_code, " }\n");
- eina_strbuf_append_printf(c_code, " p = edbus_proxy_send(proxy, msg, %s, cb, -1);\n", method->cb_name);
+ eina_strbuf_append_printf(c_code, " p = eldbus_proxy_send(proxy, msg, %s, cb, -1);\n", method->cb_name);
eina_strbuf_append_printf(c_code, " if (data)\n");
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__user_data\", data);\n");
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__proxy\", proxy);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__user_data\", data);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__proxy\", proxy);\n");
eina_strbuf_append_printf(c_code, " return p;\n");
eina_strbuf_append_printf(c_code, "}\n");
@@ -205,21 +205,21 @@ source_client_simple_method_call_generate(const DBus_Method *method, Eina_Strbuf
static void
source_client_complex_method_callback_generate(const DBus_Method *method, Eina_Strbuf *c_code, Eina_Strbuf *h)
{
- eina_strbuf_append_printf(h, "typedef void (*%s)(EDBus_Proxy *proxy, void *data, EDBus_Pending *pending, EDBus_Error_Info *error, Eina_Value *args);\n", prefix_append(method->function_cb));
+ eina_strbuf_append_printf(h, "typedef void (*%s)(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error, Eina_Value *args);\n", prefix_append(method->function_cb));
- eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const EDBus_Message *msg, EDBus_Pending *pending)\n{\n", method->cb_name);
- eina_strbuf_append_printf(c_code, " void *user_data = edbus_pending_data_del(pending, \"__user_data\");\n");
+ eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)\n{\n", method->cb_name);
+ eina_strbuf_append_printf(c_code, " void *user_data = eldbus_pending_data_del(pending, \"__user_data\");\n");
eina_strbuf_append_printf(c_code, " %s cb = data;\n", prefix_append(method->function_cb));
eina_strbuf_append_printf(c_code, " const char *error, *error_msg;\n");
eina_strbuf_append_printf(c_code, " Eina_Value *value;\n");
- eina_strbuf_append_printf(c_code, " EDBus_Proxy *proxy = edbus_pending_data_del(pending, \"__proxy\");\n");
- eina_strbuf_append_printf(c_code, " if (edbus_message_error_get(msg, &error, &error_msg))\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, \"__proxy\");\n");
+ eina_strbuf_append_printf(c_code, " if (eldbus_message_error_get(msg, &error, &error_msg))\n");
eina_strbuf_append_printf(c_code, " {\n");
- eina_strbuf_append_printf(c_code, " EDBus_Error_Info error_info = {error, error_msg};\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Error_Info error_info = {error, error_msg};\n");
eina_strbuf_append_printf(c_code, " cb(proxy, user_data, pending, &error_info, NULL);\n");
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
- eina_strbuf_append_printf(c_code, " value = edbus_message_to_eina_value(msg);\n");
+ eina_strbuf_append_printf(c_code, " value = eldbus_message_to_eina_value(msg);\n");
eina_strbuf_append_printf(c_code, " cb(proxy, user_data, pending, NULL, value);\n");
eina_strbuf_append_printf(c_code, " eina_value_free(value);\n");
eina_strbuf_append_printf(c_code, " return;\n");
@@ -234,13 +234,13 @@ source_client_simple_method_callback_generate(const DBus_Method *method, Eina_St
Eina_Strbuf *end_cb = eina_strbuf_new();
Eina_Strbuf *arguments_get = eina_strbuf_new();
- eina_strbuf_append_printf(h, "typedef void (*%s)(EDBus_Proxy *proxy, void *data, EDBus_Pending *pending, EDBus_Error_Info *error", prefix_append(method->function_cb));
+ eina_strbuf_append_printf(h, "typedef void (*%s)(Eldbus_Proxy *proxy, void *data, Eldbus_Pending *pending, Eldbus_Error_Info *error", prefix_append(method->function_cb));
- eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const EDBus_Message *msg, EDBus_Pending *pending)\n{\n", method->cb_name);
- eina_strbuf_append_printf(c_code, " void *user_data = edbus_pending_data_del(pending, \"__user_data\");\n");
+ eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)\n{\n", method->cb_name);
+ eina_strbuf_append_printf(c_code, " void *user_data = eldbus_pending_data_del(pending, \"__user_data\");\n");
eina_strbuf_append_printf(c_code, " %s cb = data;\n", prefix_append(method->function_cb));
eina_strbuf_append_printf(c_code, " const char *error, *error_msg;\n");
- eina_strbuf_append_printf(c_code, " EDBus_Proxy *proxy = edbus_pending_data_del(pending, \"__proxy\");\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, \"__proxy\");\n");
EINA_INLIST_FOREACH(method->args, arg)
{
@@ -254,16 +254,16 @@ source_client_simple_method_callback_generate(const DBus_Method *method, Eina_St
}
eina_strbuf_append_printf(h, ");\n");
- eina_strbuf_append_printf(c_code, " if (edbus_message_error_get(msg, &error, &error_msg))\n");
+ eina_strbuf_append_printf(c_code, " if (eldbus_message_error_get(msg, &error, &error_msg))\n");
eina_strbuf_append_printf(c_code, " {\n");
- eina_strbuf_append_printf(c_code, " EDBus_Error_Info error_info = {error, error_msg};\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Error_Info error_info = {error, error_msg};\n");
eina_strbuf_append_printf(c_code, " cb(proxy, user_data, pending, &error_info%s);\n", eina_strbuf_string_get(end_cb));
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
- eina_strbuf_append_printf(c_code, " if (!edbus_message_arguments_get(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(arguments_get));
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_get(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(arguments_get));
eina_strbuf_append_printf(c_code, " {\n");
- eina_strbuf_append_printf(c_code, " EDBus_Error_Info error_info = {\"\", \"\"};\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Error_Info error_info = {\"\", \"\"};\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Getting arguments from message.\");\n");
eina_strbuf_append_printf(c_code, " cb(proxy, user_data, pending, &error_info%s);\n", eina_strbuf_string_get(end_cb));
eina_strbuf_append_printf(c_code, " return;\n");
@@ -308,7 +308,7 @@ source_client_signal_generate(const DBus_Signal *sig, Eina_Strbuf *c_code, Eina_
Eina_Strbuf *string_copy = eina_strbuf_new();
Eina_Strbuf *string_free = eina_strbuf_new();
- eina_strbuf_append_printf(c_init_function, " edbus_proxy_signal_handler_add(proxy, \"%s\", %s, proxy);\n", sig->name, sig->cb_name);
+ eina_strbuf_append_printf(c_init_function, " eldbus_proxy_signal_handler_add(proxy, \"%s\", %s, proxy);\n", sig->name, sig->cb_name);
eina_strbuf_append_printf(c_header, "int %s;\n", sig->signal_event);
eina_strbuf_append_printf(h, "extern int %s;\n", sig->signal_event);
eina_strbuf_append_printf(c_init_function, " if (!%s)\n", sig->signal_event);
@@ -316,7 +316,7 @@ source_client_signal_generate(const DBus_Signal *sig, Eina_Strbuf *c_code, Eina_
eina_strbuf_append_printf(h, "typedef struct _%s\n", sig->struct_name);
eina_strbuf_append_printf(h, "{\n");
- eina_strbuf_append_printf(h, " EDBus_Proxy *proxy;\n");
+ eina_strbuf_append_printf(h, " Eldbus_Proxy *proxy;\n");
if (sig->complex)
{
@@ -351,16 +351,16 @@ jump_simple_stuff:
eina_strbuf_append_printf(c_code, "}\n");
//cb function
- eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const EDBus_Message *msg)\n{\n", sig->cb_name);
- eina_strbuf_append_printf(c_code, " EDBus_Proxy *proxy = data;\n");
+ eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const Eldbus_Message *msg)\n{\n", sig->cb_name);
+ eina_strbuf_append_printf(c_code, " Eldbus_Proxy *proxy = data;\n");
eina_strbuf_append_printf(c_code, " %s *s_data = calloc(1, sizeof(%s));\n", sig->struct_name, sig->struct_name);
eina_strbuf_append_printf(c_code, " s_data->proxy = proxy;\n");
if (sig->complex)
{
- eina_strbuf_append_printf(c_code, " s_data->value = edbus_message_to_eina_value(msg);\n");
+ eina_strbuf_append_printf(c_code, " s_data->value = eldbus_message_to_eina_value(msg);\n");
goto end_signal;
}
- eina_strbuf_append_printf(c_code, " if (!edbus_message_arguments_get(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(parameters));
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_get(msg, \"%s\"%s))\n", eina_strbuf_string_get(full_signature), eina_strbuf_string_get(parameters));
eina_strbuf_append_printf(c_code, " {\n");
eina_strbuf_append_printf(c_code, " ERR(\"Error: Getting arguments from message.\");\n");
eina_strbuf_append_printf(c_code, " return;\n");
@@ -381,31 +381,31 @@ static const char *
prop_cb_get(const DBus_Property *prop)
{
if (prop->complex)
- return "EDBus_Codegen_Property_Complex_Get_Cb";
+ return "Eldbus_Codegen_Property_Complex_Get_Cb";
switch (prop->type[0])
{
case 's':
case 'o':
- return "EDBus_Codegen_Property_String_Get_Cb";
+ return "Eldbus_Codegen_Property_String_Get_Cb";
case 'i':
case 'h':
- return "EDBus_Codegen_Property_Int32_Get_Cb";
+ return "Eldbus_Codegen_Property_Int32_Get_Cb";
case 'y':
- return "EDBus_Codegen_Property_Byte_Get_Cb";
+ return "Eldbus_Codegen_Property_Byte_Get_Cb";
case 'b':
- return "EDBus_Codegen_Property_Bool_Get_Cb";
+ return "Eldbus_Codegen_Property_Bool_Get_Cb";
case 'n':
- return "EDBus_Codegen_Property_Int16_Get_Cb";
+ return "Eldbus_Codegen_Property_Int16_Get_Cb";
case 'q':
- return "EDBus_Codegen_Property_Uint16_Get_Cb";
+ return "Eldbus_Codegen_Property_Uint16_Get_Cb";
case 'u':
- return "EDBus_Codegen_Property_Uint32_Get_Cb";
+ return "Eldbus_Codegen_Property_Uint32_Get_Cb";
case 'd':
- return "EDBus_Codegen_Property_Double_Get_Cb";
+ return "Eldbus_Codegen_Property_Double_Get_Cb";
case 'x':
- return "EDBus_Codegen_Property_Int64_Get_Cb";
+ return "Eldbus_Codegen_Property_Int64_Get_Cb";
case 't':
- return "EDBus_Codegen_Property_Uint64_Get_Cb";
+ return "Eldbus_Codegen_Property_Uint64_Get_Cb";
default:
return "Unexpected_type";
}
@@ -423,33 +423,33 @@ static void
source_client_property_generate_get(const DBus_Property *prop, Eina_Strbuf *c_code, Eina_Strbuf *h)
{
//callback
- eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const EDBus_Message *msg, EDBus_Pending *pending)\n{\n", prop->cb_name);
- eina_strbuf_append_printf(c_code, " void *user_data = edbus_pending_data_del(pending, \"__user_data\");\n");
+ eina_strbuf_append_printf(c_code, "\nstatic void\n%s(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)\n{\n", prop->cb_name);
+ eina_strbuf_append_printf(c_code, " void *user_data = eldbus_pending_data_del(pending, \"__user_data\");\n");
eina_strbuf_append_printf(c_code, " const char *error, *error_msg;\n");
eina_strbuf_append_printf(c_code, " %s cb = data;\n", prop_cb_get(prop));
- eina_strbuf_append_printf(c_code, " EDBus_Proxy *proxy = edbus_pending_data_del(pending, \"__proxy\");\n");
- eina_strbuf_append_printf(c_code, " EDBus_Message_Iter *variant;\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, \"__proxy\");\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Message_Iter *variant;\n");
if (prop->complex)
eina_strbuf_append_printf(c_code, " Eina_Value *v, stack_value;\n");
else
eina_strbuf_append_printf(c_code, " %sv;\n", dbus_type2c_type(prop->type));
- eina_strbuf_append_printf(c_code, " if (edbus_message_error_get(msg, &error, &error_msg))\n");
+ eina_strbuf_append_printf(c_code, " if (eldbus_message_error_get(msg, &error, &error_msg))\n");
eina_strbuf_append_printf(c_code, " {\n");
- eina_strbuf_append_printf(c_code, " EDBus_Error_Info error_info = {error, error_msg};\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Error_Info error_info = {error, error_msg};\n");
eina_strbuf_append_printf(c_code, " cb(user_data, pending, \"%s\", proxy, &error_info, %s);\n", prop->name, null_or_zero(prop->type));
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
- eina_strbuf_append_printf(c_code, " if (!edbus_message_arguments_get(msg, \"v\", &variant))\n");
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_arguments_get(msg, \"v\", &variant))\n");
eina_strbuf_append_printf(c_code, " {\n");
- eina_strbuf_append_printf(c_code, " EDBus_Error_Info error_info = {\"\", \"\"};\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Error_Info error_info = {\"\", \"\"};\n");
eina_strbuf_append_printf(c_code, " cb(user_data, pending, \"%s\", proxy, &error_info, %s);\n", prop->name, null_or_zero(prop->type));
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
if (prop->complex)
{
- eina_strbuf_append_printf(c_code, " v = edbus_message_iter_struct_like_to_eina_value(variant);\n");
+ eina_strbuf_append_printf(c_code, " v = eldbus_message_iter_struct_like_to_eina_value(variant);\n");
eina_strbuf_append_printf(c_code, " eina_value_struct_value_get(v, \"arg0\", &stack_value);\n");
eina_strbuf_append_printf(c_code, " cb(user_data, pending, \"%s\", proxy, NULL, &stack_value);\n", prop->name);
eina_strbuf_append_printf(c_code, " eina_value_flush(&stack_value);\n");
@@ -457,9 +457,9 @@ source_client_property_generate_get(const DBus_Property *prop, Eina_Strbuf *c_co
}
else
{
- eina_strbuf_append_printf(c_code, " if (!edbus_message_iter_arguments_get(variant, \"%s\", &v))\n", prop->type);
+ eina_strbuf_append_printf(c_code, " if (!eldbus_message_iter_arguments_get(variant, \"%s\", &v))\n", prop->type);
eina_strbuf_append_printf(c_code, " {\n");
- eina_strbuf_append_printf(c_code, " EDBus_Error_Info error_info = {\"\", \"\"};\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Error_Info error_info = {\"\", \"\"};\n");
eina_strbuf_append_printf(c_code, " cb(user_data, pending, \"%s\", proxy, &error_info, %s);\n", prop->name, null_or_zero(prop->type));
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
@@ -468,15 +468,15 @@ source_client_property_generate_get(const DBus_Property *prop, Eina_Strbuf *c_co
eina_strbuf_append_printf(c_code, "}\n");
//call
- eina_strbuf_append_printf(h, "EDBus_Pending *%s_propget(EDBus_Proxy *proxy, %s cb, const void *data);\n", prefix_append(prop->c_name), prop_cb_get(prop));
+ eina_strbuf_append_printf(h, "Eldbus_Pending *%s_propget(Eldbus_Proxy *proxy, %s cb, const void *data);\n", prefix_append(prop->c_name), prop_cb_get(prop));
- eina_strbuf_append_printf(c_code, "\nEDBus_Pending *\n%s_propget(EDBus_Proxy *proxy, %s cb, const void *data)\n{\n", prefix_append(prop->c_name), prop_cb_get(prop));
- eina_strbuf_append_printf(c_code, " EDBus_Pending *p;\n");
+ eina_strbuf_append_printf(c_code, "\nEldbus_Pending *\n%s_propget(Eldbus_Proxy *proxy, %s cb, const void *data)\n{\n", prefix_append(prop->c_name), prop_cb_get(prop));
+ eina_strbuf_append_printf(c_code, " Eldbus_Pending *p;\n");
eina_strbuf_append_printf(c_code, " EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);\n");
- eina_strbuf_append_printf(c_code, " p = edbus_proxy_property_get(proxy, \"%s\", %s, cb);\n", prop->name, prop->cb_name);
+ eina_strbuf_append_printf(c_code, " p = eldbus_proxy_property_get(proxy, \"%s\", %s, cb);\n", prop->name, prop->cb_name);
eina_strbuf_append_printf(c_code, " if (data)\n");
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__user_data\", data);\n");
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__proxy\", proxy);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__user_data\", data);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__proxy\", proxy);\n");
eina_strbuf_append_printf(c_code, " return p;\n");
eina_strbuf_append_printf(c_code, "}\n");
}
@@ -485,14 +485,14 @@ static void
source_client_property_generate_set(const DBus_Property *prop, Eina_Strbuf *c_code, Eina_Strbuf *h)
{
//callback
- eina_strbuf_append_printf(c_code, "\nstatic void\n%s_set(void *data, const EDBus_Message *msg, EDBus_Pending *pending)\n{\n", prop->cb_name);
+ eina_strbuf_append_printf(c_code, "\nstatic void\n%s_set(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)\n{\n", prop->cb_name);
eina_strbuf_append_printf(c_code, " const char *error, *error_msg;\n");
- eina_strbuf_append_printf(c_code, " void *user_data = edbus_pending_data_del(pending, \"__user_data\");\n");
- eina_strbuf_append_printf(c_code, " EDBus_Proxy *proxy = edbus_pending_data_del(pending, \"__proxy\");\n");
- eina_strbuf_append_printf(c_code, " EDBus_Codegen_Property_Set_Cb cb = data;\n");
- eina_strbuf_append_printf(c_code, " if (edbus_message_error_get(msg, &error, &error_msg))");
+ eina_strbuf_append_printf(c_code, " void *user_data = eldbus_pending_data_del(pending, \"__user_data\");\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Proxy *proxy = eldbus_pending_data_del(pending, \"__proxy\");\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Codegen_Property_Set_Cb cb = data;\n");
+ eina_strbuf_append_printf(c_code, " if (eldbus_message_error_get(msg, &error, &error_msg))");
eina_strbuf_append_printf(c_code, " {\n");
- eina_strbuf_append_printf(c_code, " EDBus_Error_Info error_info = {error, error_msg};\n\n");
+ eina_strbuf_append_printf(c_code, " Eldbus_Error_Info error_info = {error, error_msg};\n\n");
eina_strbuf_append_printf(c_code, " cb(user_data, \"%s\", proxy, pending, &error_info);\n", prop->name);
eina_strbuf_append_printf(c_code, " return;\n");
eina_strbuf_append_printf(c_code, " }\n");
@@ -500,15 +500,15 @@ source_client_property_generate_set(const DBus_Property *prop, Eina_Strbuf *c_co
eina_strbuf_append_printf(c_code, "}\n");
//call
- eina_strbuf_append_printf(h, "EDBus_Pending *%s_propset(EDBus_Proxy *proxy, EDBus_Codegen_Property_Set_Cb cb, const void *data, const void *value);\n", prefix_append(prop->c_name));
+ eina_strbuf_append_printf(h, "Eldbus_Pending *%s_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value);\n", prefix_append(prop->c_name));
- eina_strbuf_append_printf(c_code, "\nEDBus_Pending *\n%s_propset(EDBus_Proxy *proxy, EDBus_Codegen_Property_Set_Cb cb, const void *data, const void *value)\n{\n", prop->c_name);
- eina_strbuf_append_printf(c_code, " EDBus_Pending *p;\n");
+ eina_strbuf_append_printf(c_code, "\nEldbus_Pending *\n%s_propset(Eldbus_Proxy *proxy, Eldbus_Codegen_Property_Set_Cb cb, const void *data, const void *value)\n{\n", prop->c_name);
+ eina_strbuf_append_printf(c_code, " Eldbus_Pending *p;\n");
eina_strbuf_append_printf(c_code, " EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);\n");
eina_strbuf_append_printf(c_code, " EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);\n");
- eina_strbuf_append_printf(c_code, " p = edbus_proxy_property_set(proxy, \"%s\", \"%s\", value, %s_set, data);\n", prop->name, prop->type, prop->cb_name);
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__user_data\", data);\n");
- eina_strbuf_append_printf(c_code, " edbus_pending_data_set(p, \"__proxy\", proxy);\n");
+ eina_strbuf_append_printf(c_code, " p = eldbus_proxy_property_set(proxy, \"%s\", \"%s\", value, %s_set, data);\n", prop->name, prop->type, prop->cb_name);
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__user_data\", data);\n");
+ eina_strbuf_append_printf(c_code, " eldbus_pending_data_set(p, \"__proxy\", proxy);\n");
eina_strbuf_append_printf(c_code, " return p;\n");
eina_strbuf_append_printf(c_code, "}\n");
}
@@ -545,7 +545,7 @@ source_client_generate(DBus_Object *path, const char *prefix, const char *interf
c_header = eina_strbuf_new();
c_code = eina_strbuf_new();
- aux = string_build("EDBUS_%s_H", iface->c_name);
+ aux = string_build("ELDBUS_%s_H", iface->c_name);
for (i = 0; aux[i]; i++)
aux[i] = toupper(aux[i]);
eina_strbuf_append_printf(h, "#ifndef %s\n", aux);
@@ -554,16 +554,16 @@ source_client_generate(DBus_Object *path, const char *prefix, const char *interf
eina_strbuf_append_printf(h, "#include <Eina.h>\n");
eina_strbuf_append_printf(h, "#include <Ecore.h>\n");
- eina_strbuf_append_printf(h, "#include <EDBus.h>\n");
- eina_strbuf_append_printf(h, "#include \"edbus_utils.h\"\n\n");
- eina_strbuf_append_printf(h, "EDBus_Proxy *%s_proxy_get(EDBus_Connection *conn, const char *bus, const char *path);\n", prefix_append(iface->c_name));
- eina_strbuf_append_printf(h, "void %s_proxy_unref(EDBus_Proxy *proxy);\n", prefix_append(iface->c_name));
+ eina_strbuf_append_printf(h, "#include <Eldbus.h>\n");
+ eina_strbuf_append_printf(h, "#include \"eldbus_utils.h\"\n\n");
+ eina_strbuf_append_printf(h, "Eldbus_Proxy *%s_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path);\n", prefix_append(iface->c_name));
+ eina_strbuf_append_printf(h, "void %s_proxy_unref(Eldbus_Proxy *proxy);\n", prefix_append(iface->c_name));
eina_strbuf_append_printf(h, "void %s_log_domain_set(int id);\n", prefix_append(iface->c_name));
if (interface_name && output_name)
eina_strbuf_append_printf(c_header, "#include \"%s.h\"\n\n", output_name);
else
- eina_strbuf_append_printf(c_header, "#include \"edbus_%s.h\"\n\n", iface->c_name);
+ eina_strbuf_append_printf(c_header, "#include \"eldbus_%s.h\"\n\n", iface->c_name);
eina_strbuf_append_printf(c_header, "static int _log_main = -1;\n");
eina_strbuf_append_printf(c_header, "#undef ERR\n");
@@ -573,20 +573,20 @@ source_client_generate(DBus_Object *path, const char *prefix, const char *interf
eina_strbuf_append_printf(c_init_function, " _log_main = id;\n");
eina_strbuf_append_printf(c_init_function, "}\n");
- eina_strbuf_append_printf(c_init_function, "\nvoid\n%s_proxy_unref(EDBus_Proxy *proxy)\n{\n", prefix_append(iface->c_name));
- eina_strbuf_append_printf(c_init_function, " EDBus_Object *obj = edbus_proxy_object_get(proxy);\n");
- eina_strbuf_append_printf(c_init_function, " edbus_proxy_unref(proxy);\n");
- eina_strbuf_append_printf(c_init_function, " edbus_object_unref(obj);\n");
+ eina_strbuf_append_printf(c_init_function, "\nvoid\n%s_proxy_unref(Eldbus_Proxy *proxy)\n{\n", prefix_append(iface->c_name));
+ eina_strbuf_append_printf(c_init_function, " Eldbus_Object *obj = eldbus_proxy_object_get(proxy);\n");
+ eina_strbuf_append_printf(c_init_function, " eldbus_proxy_unref(proxy);\n");
+ eina_strbuf_append_printf(c_init_function, " eldbus_object_unref(obj);\n");
eina_strbuf_append_printf(c_init_function, "}\n");
- eina_strbuf_append_printf(c_init_function, "\nEDBus_Proxy *\n%s_proxy_get(EDBus_Connection *conn, const char *bus, const char *path)\n{\n", prefix_append(iface->c_name));
- eina_strbuf_append_printf(c_init_function, " EDBus_Object *obj;\n");
- eina_strbuf_append_printf(c_init_function, " EDBus_Proxy *proxy;\n");
+ eina_strbuf_append_printf(c_init_function, "\nEldbus_Proxy *\n%s_proxy_get(Eldbus_Connection *conn, const char *bus, const char *path)\n{\n", prefix_append(iface->c_name));
+ eina_strbuf_append_printf(c_init_function, " Eldbus_Object *obj;\n");
+ eina_strbuf_append_printf(c_init_function, " Eldbus_Proxy *proxy;\n");
eina_strbuf_append_printf(c_init_function, " EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);\n");
eina_strbuf_append_printf(c_init_function, " EINA_SAFETY_ON_NULL_RETURN_VAL(bus, NULL);\n");
eina_strbuf_append_printf(c_init_function, " if (!path) path = \"%s\";\n", path->name);
- eina_strbuf_append_printf(c_init_function, " obj = edbus_object_get(conn, bus, path);\n");
- eina_strbuf_append_printf(c_init_function, " proxy = edbus_proxy_get(obj, \"%s\");\n", iface->name);
+ eina_strbuf_append_printf(c_init_function, " obj = eldbus_object_get(conn, bus, path);\n");
+ eina_strbuf_append_printf(c_init_function, " proxy = eldbus_proxy_get(obj, \"%s\");\n", iface->name);
EINA_INLIST_FOREACH(iface->methods, method)
source_client_method_generate(method, c_code, h);
@@ -605,7 +605,7 @@ source_client_generate(DBus_Object *path, const char *prefix, const char *interf
if (interface_name && output_name)
file_name = string_build("%s.h", output_name);
else
- file_name = string_build("edbus_%s.h", iface->c_name);
+ file_name = string_build("eldbus_%s.h", iface->c_name);
file_write(file_name, eina_strbuf_string_get(h));
eina_strbuf_free(h);
free(file_name);
@@ -618,7 +618,7 @@ source_client_generate(DBus_Object *path, const char *prefix, const char *interf
if (interface_name && output_name)
file_name = string_build("%s.c", output_name);
else
- file_name = string_build("edbus_%s.c", iface->c_name);
+ file_name = string_build("eldbus_%s.c", iface->c_name);
file_write(file_name, eina_strbuf_string_get(c_header));
eina_strbuf_free(c_header);
free(file_name);
diff --git a/src/bin/edbus/utils.c b/src/bin/eldbus/utils.c
index 47d8c77c19..a020445e1d 100644
--- a/src/bin/edbus/utils.c
+++ b/src/bin/eldbus/utils.c
@@ -132,28 +132,28 @@ string_build(const char *fmt, ...)
}
#define UTIL_H "\
-#ifndef EDBUS_UTILS_H\n\
-#define EDBUS_UTILS_H 1\n\
+#ifndef ELDBUS_UTILS_H\n\
+#define ELDBUS_UTILS_H 1\n\
\n\
-typedef struct _EDBus_Error_Info\n\
+typedef struct _Eldbus_Error_Info\n\
{\n\
const char *error;\n\
const char *message;\n\
-} EDBus_Error_Info;\n\
+} Eldbus_Error_Info;\n\
\n\
-typedef void (*EDBus_Codegen_Property_Set_Cb)(void *data, const char *propname, EDBus_Proxy *proxy, EDBus_Pending *p, EDBus_Error_Info *error_info);\n\
+typedef void (*Eldbus_Codegen_Property_Set_Cb)(void *data, const char *propname, Eldbus_Proxy *proxy, Eldbus_Pending *p, Eldbus_Error_Info *error_info);\n\
\n\
-typedef void (*EDBus_Codegen_Property_String_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, const char *value);\n\
-typedef void (*EDBus_Codegen_Property_Int32_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, int value);\n\
-typedef void (*EDBus_Codegen_Property_Byte_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, unsigned char value);\n\
-typedef void (*EDBus_Codegen_Property_Bool_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, Eina_Bool value);\n\
-typedef void (*EDBus_Codegen_Property_Int16_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, short int value);\n\
-typedef void (*EDBus_Codegen_Property_Uint16_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, unsigned short int value);\n\
-typedef void (*EDBus_Codegen_Property_Uint32_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, unsigned int value);\n\
-typedef void (*EDBus_Codegen_Property_Double_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, double value);\n\
-typedef void (*EDBus_Codegen_Property_Int64_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, int64_t value);\n\
-typedef void (*EDBus_Codegen_Property_Uint64_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, uint64_t value);\n\
-typedef void (*EDBus_Codegen_Property_Complex_Get_Cb)(void *data, EDBus_Pending *p, const char *propname, EDBus_Proxy *proxy, EDBus_Error_Info *error_info, Eina_Value *value);\n\
+typedef void (*Eldbus_Codegen_Property_String_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, const char *value);\n\
+typedef void (*Eldbus_Codegen_Property_Int32_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, int value);\n\
+typedef void (*Eldbus_Codegen_Property_Byte_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, unsigned char value);\n\
+typedef void (*Eldbus_Codegen_Property_Bool_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, Eina_Bool value);\n\
+typedef void (*Eldbus_Codegen_Property_Int16_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, short int value);\n\
+typedef void (*Eldbus_Codegen_Property_Uint16_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, unsigned short int value);\n\
+typedef void (*Eldbus_Codegen_Property_Uint32_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, unsigned int value);\n\
+typedef void (*Eldbus_Codegen_Property_Double_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, double value);\n\
+typedef void (*Eldbus_Codegen_Property_Int64_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, int64_t value);\n\
+typedef void (*Eldbus_Codegen_Property_Uint64_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, uint64_t value);\n\
+typedef void (*Eldbus_Codegen_Property_Complex_Get_Cb)(void *data, Eldbus_Pending *p, const char *propname, Eldbus_Proxy *proxy, Eldbus_Error_Info *error_info, Eina_Value *value);\n\
\n\
#endif\
"
@@ -161,5 +161,5 @@ typedef void (*EDBus_Codegen_Property_Complex_Get_Cb)(void *data, EDBus_Pending
Eina_Bool
util_h_write(void)
{
- return file_write("edbus_utils.h", UTIL_H);
+ return file_write("eldbus_utils.h", UTIL_H);
}
diff --git a/src/bin/ethumb_client/ethumbd.c b/src/bin/ethumb_client/ethumbd.c
index a68aed618c..11433ef0e9 100644
--- a/src/bin/ethumb_client/ethumbd.c
+++ b/src/bin/ethumb_client/ethumbd.c
@@ -33,7 +33,7 @@
#include <Eina.h>
#include <Ecore_Getopt.h>
#include <Ecore.h>
-#include <EDBus.h>
+#include <Eldbus.h>
#include <Ethumb.h>
#include <Ethumb_Client.h>
@@ -130,7 +130,7 @@ struct _Ethumbd_Object
int id_count;
int max_id;
int min_id;
- EDBus_Service_Interface *iface;
+ Eldbus_Service_Interface *iface;
};
struct _Ethumbd_Queue
@@ -154,7 +154,7 @@ struct _Ethumbd_Slave
struct _Ethumbd
{
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
Ecore_Idler *idler;
Ethumbd_Request *processing;
Ethumbd_Queue queue;
@@ -194,27 +194,27 @@ const Ecore_Getopt optdesc = {
}
};
-static EDBus_Message *_ethumb_dbus_queue_add_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
-static EDBus_Message *_ethumb_dbus_queue_remove_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
-static EDBus_Message *_ethumb_dbus_queue_clear_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
-static EDBus_Message *_ethumb_dbus_ethumb_setup_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
-static EDBus_Message *_ethumb_dbus_delete_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg);
+static Eldbus_Message *_ethumb_dbus_queue_add_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
+static Eldbus_Message *_ethumb_dbus_queue_remove_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
+static Eldbus_Message *_ethumb_dbus_queue_clear_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
+static Eldbus_Message *_ethumb_dbus_ethumb_setup_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
+static Eldbus_Message *_ethumb_dbus_delete_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
-static const EDBus_Method _ethumb_dbus_objects_methods[] = {
+static const Eldbus_Method _ethumb_dbus_objects_methods[] = {
{
"queue_add",
- EDBUS_ARGS({"i", "id"}, {"ay", "file"}, {"ay", "key"}, {"ay", "thumb"}, {"ay", "thumb_key"}),
- EDBUS_ARGS({"i", "queue_id"}), _ethumb_dbus_queue_add_cb, 0
+ ELDBUS_ARGS({"i", "id"}, {"ay", "file"}, {"ay", "key"}, {"ay", "thumb"}, {"ay", "thumb_key"}),
+ ELDBUS_ARGS({"i", "queue_id"}), _ethumb_dbus_queue_add_cb, 0
},
{
- "queue_remove", EDBUS_ARGS({"i", "queue_id"}), EDBUS_ARGS({"b", "result"}),
+ "queue_remove", ELDBUS_ARGS({"i", "queue_id"}), ELDBUS_ARGS({"b", "result"}),
_ethumb_dbus_queue_remove_cb, 0
},
{
"clear_queue", NULL, NULL, _ethumb_dbus_queue_clear_cb, 0
},
{
- "ethumb_setup", EDBUS_ARGS({"a{sv}", "array"}), EDBUS_ARGS({"b", "result"}),
+ "ethumb_setup", ELDBUS_ARGS({"a{sv}", "array"}), ELDBUS_ARGS({"b", "result"}),
_ethumb_dbus_ethumb_setup_cb, 0
},
{
@@ -228,9 +228,9 @@ enum
ETHUMB_DBUS_OBJECTS_SIGNAL_GENERATED = 0,
};
-static const EDBus_Signal _ethumb_dbus_objects_signals[] = {
+static const Eldbus_Signal _ethumb_dbus_objects_signals[] = {
[ETHUMB_DBUS_OBJECTS_SIGNAL_GENERATED] = { "generated",
- EDBUS_ARGS({ "i", "id" }, { "ay", "paths" }, { "ay", "keys" },
+ ELDBUS_ARGS({ "i", "id" }, { "ay", "paths" }, { "ay", "keys" },
{ "b", "success" }) },
{ }
};
@@ -851,13 +851,13 @@ _ethumb_table_del(Ethumbd *ed, int i)
}
q->nqueue -= q->table[i].nqueue;
- odata = edbus_service_object_data_del(q->table[i].iface, ODATA);
- edbus_name_owner_changed_callback_del(ed->conn, ed->queue.table[i].client,
+ odata = eldbus_service_object_data_del(q->table[i].iface, ODATA);
+ eldbus_name_owner_changed_callback_del(ed->conn, ed->queue.table[i].client,
_name_owner_changed_cb, odata);
//this string was not been freed previously
eina_stringshare_del(ed->queue.table[i].client);
free(odata);
- edbus_service_object_unregister(q->table[i].iface);
+ eldbus_service_object_unregister(q->table[i].iface);
memset(&(q->table[i]), 0, sizeof(Ethumbd_Object));
for (j = 0; j < q->count; j++)
@@ -894,24 +894,24 @@ _name_owner_changed_cb(void *context, const char *bus, const char *old_id, const
_ethumb_table_del(ed, odata->idx);
}
-static const EDBus_Service_Interface_Desc client_desc = {
+static const Eldbus_Service_Interface_Desc client_desc = {
_ethumb_dbus_objects_interface, _ethumb_dbus_objects_methods,
_ethumb_dbus_objects_signals
};
-static EDBus_Message *
-_ethumb_dbus_ethumb_new_cb(const EDBus_Service_Interface *interface, const EDBus_Message *msg)
+static Eldbus_Message *
+_ethumb_dbus_ethumb_new_cb(const Eldbus_Service_Interface *interface, const Eldbus_Message *msg)
{
- EDBus_Message *reply;
- EDBus_Service_Interface *iface;
+ Eldbus_Message *reply;
+ Eldbus_Service_Interface *iface;
Ethumbd_Object_Data *odata;
int i;
const char *return_path = "";
const char *client;
Ethumbd *ed;
- ed = edbus_service_object_data_get(interface, DAEMON);
- client = edbus_message_sender_get(msg);
+ ed = eldbus_service_object_data_get(interface, DAEMON);
+ client = eldbus_message_sender_get(msg);
if (!client)
goto end_new;
@@ -926,7 +926,7 @@ _ethumb_dbus_ethumb_new_cb(const EDBus_Service_Interface *interface, const EDBus
ed->queue.table[i].client = eina_stringshare_add(client);
return_path = ed->queue.table[i].path;
- iface = edbus_service_interface_register(ed->conn, return_path, &client_desc);
+ iface = eldbus_service_interface_register(ed->conn, return_path, &client_desc);
if (!iface)
{
ERR("could not create dbus_object.");
@@ -934,38 +934,38 @@ _ethumb_dbus_ethumb_new_cb(const EDBus_Service_Interface *interface, const EDBus
return_path = "";
goto end_new;
}
- edbus_service_object_data_set(iface, ODATA, odata);
+ eldbus_service_object_data_set(iface, ODATA, odata);
ed->queue.table[i].iface = iface;
- edbus_name_owner_changed_callback_add(ed->conn, client,
+ eldbus_name_owner_changed_callback_add(ed->conn, client,
_name_owner_changed_cb, odata,
EINA_TRUE);
_ethumbd_child_write_op_new(&ed->slave, i);
_ethumbd_timeout_stop(ed);
end_new:
- reply = edbus_message_method_return_new(msg);
- edbus_message_arguments_append(reply, "o", return_path);
+ reply = eldbus_message_method_return_new(msg);
+ eldbus_message_arguments_append(reply, "o", return_path);
return reply;
}
-static const EDBus_Method _ethumb_dbus_methods[] = {
+static const Eldbus_Method _ethumb_dbus_methods[] = {
{
- "new", NULL, EDBUS_ARGS({"o", "path"}), _ethumb_dbus_ethumb_new_cb, 0
+ "new", NULL, ELDBUS_ARGS({"o", "path"}), _ethumb_dbus_ethumb_new_cb, 0
},
{ }
};
static const char *
-_ethumb_dbus_get_bytearray(EDBus_Message_Iter *iter)
+_ethumb_dbus_get_bytearray(Eldbus_Message_Iter *iter)
{
int length;
const char *result;
- if (!edbus_message_iter_fixed_array_get(iter, 'y', &result,
+ if (!eldbus_message_iter_fixed_array_get(iter, 'y', &result,
&length))
{
ERR("not byte array element. Signature: %s",
- edbus_message_iter_signature_get(iter));
+ eldbus_message_iter_signature_get(iter));
return NULL;
}
@@ -976,7 +976,7 @@ _ethumb_dbus_get_bytearray(EDBus_Message_Iter *iter)
}
static void
-_ethumb_dbus_append_bytearray(EDBus_Message_Iter *parent, EDBus_Message_Iter *array, const char *string)
+_ethumb_dbus_append_bytearray(Eldbus_Message_Iter *parent, Eldbus_Message_Iter *array, const char *string)
{
int i, size;
@@ -985,23 +985,23 @@ _ethumb_dbus_append_bytearray(EDBus_Message_Iter *parent, EDBus_Message_Iter *ar
size = strlen(string) + 1;
for (i = 0; i < size; i++)
- edbus_message_iter_basic_append(array, 'y', string[i]);
- edbus_message_iter_container_close(parent, array);
+ eldbus_message_iter_basic_append(array, 'y', string[i]);
+ eldbus_message_iter_container_close(parent, array);
}
-static EDBus_Message *
-_ethumb_dbus_queue_add_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
+static Eldbus_Message *
+_ethumb_dbus_queue_add_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
- EDBus_Message *reply;
+ Eldbus_Message *reply;
const char *file, *key, *thumb, *thumb_key;
Ethumbd_Object_Data *odata;
Ethumbd_Object *eobject;
Ethumbd *ed;
Ethumbd_Request *request;
int id = -1;
- EDBus_Message_Iter *file_iter, *key_iter, *thumb_iter, *thumb_key_iter;
+ Eldbus_Message_Iter *file_iter, *key_iter, *thumb_iter, *thumb_key_iter;
- if (!edbus_message_arguments_get(msg, "iayayayay", &id, &file_iter,
+ if (!eldbus_message_arguments_get(msg, "iayayayay", &id, &file_iter,
&key_iter, &thumb_iter, &thumb_key_iter))
{
ERR("Error getting arguments.");
@@ -1021,7 +1021,7 @@ _ethumb_dbus_queue_add_cb(const EDBus_Service_Interface *iface, const EDBus_Mess
goto end;
}
- odata = edbus_service_object_data_get(iface, ODATA);
+ odata = eldbus_service_object_data_get(iface, ODATA);
if (!odata)
{
eina_stringshare_del(file);
@@ -1050,15 +1050,15 @@ _ethumb_dbus_queue_add_cb(const EDBus_Service_Interface *iface, const EDBus_Mess
_process_queue_start(ed);
end:
- reply = edbus_message_method_return_new(msg);
- edbus_message_arguments_append(reply, "i", id);
+ reply = eldbus_message_method_return_new(msg);
+ eldbus_message_arguments_append(reply, "i", id);
return reply;
}
-static EDBus_Message *
-_ethumb_dbus_queue_remove_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
+static Eldbus_Message *
+_ethumb_dbus_queue_remove_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
- EDBus_Message *reply;
+ Eldbus_Message *reply;
int id;
Ethumbd_Object_Data *odata;
Ethumbd_Object *eobject;
@@ -1067,12 +1067,12 @@ _ethumb_dbus_queue_remove_cb(const EDBus_Service_Interface *iface, const EDBus_M
Eina_Bool r = EINA_FALSE;
Eina_List *l;
- if (!edbus_message_arguments_get(msg, "i", &id))
+ if (!eldbus_message_arguments_get(msg, "i", &id))
{
ERR("Error getting arguments.");
goto end;
}
- odata = edbus_service_object_data_get(iface, ODATA);
+ odata = eldbus_service_object_data_get(iface, ODATA);
if (!odata)
{
ERR("could not get dbus_object data.");
@@ -1105,20 +1105,20 @@ _ethumb_dbus_queue_remove_cb(const EDBus_Service_Interface *iface, const EDBus_M
}
end:
- reply = edbus_message_method_return_new(msg);
- edbus_message_arguments_append(reply, "b", r);
+ reply = eldbus_message_method_return_new(msg);
+ eldbus_message_arguments_append(reply, "b", r);
return reply;
}
-static EDBus_Message *
-_ethumb_dbus_queue_clear_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
+static Eldbus_Message *
+_ethumb_dbus_queue_clear_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
Ethumbd_Object_Data *odata;
Ethumbd_Object *eobject;
Ethumbd *ed;
Eina_List *l;
- odata = edbus_service_object_data_get(iface, ODATA);
+ odata = eldbus_service_object_data_get(iface, ODATA);
if (!odata)
{
ERR("could not get dbus_object data.");
@@ -1142,19 +1142,19 @@ _ethumb_dbus_queue_clear_cb(const EDBus_Service_Interface *iface, const EDBus_Me
eobject->nqueue = 0;
end:
- return edbus_message_method_return_new(msg);
+ return eldbus_message_method_return_new(msg);
}
-static EDBus_Message *
-_ethumb_dbus_delete_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
+static Eldbus_Message *
+_ethumb_dbus_delete_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
- EDBus_Message *reply;
+ Eldbus_Message *reply;
Ethumbd_Object_Data *odata;
Ethumbd *ed;
- reply = edbus_message_method_return_new(msg);
+ reply = eldbus_message_method_return_new(msg);
- odata = edbus_service_object_data_get(iface, ODATA);
+ odata = eldbus_service_object_data_get(iface, ODATA);
if (!odata)
{
ERR("could not get dbus_object data for del_cb.");
@@ -1168,11 +1168,11 @@ _ethumb_dbus_delete_cb(const EDBus_Service_Interface *iface, const EDBus_Message
}
static int
-_ethumb_dbus_fdo_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_fdo_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
int fdo;
- if (!edbus_message_iter_arguments_get(variant, "i", &fdo))
+ if (!eldbus_message_iter_arguments_get(variant, "i", &fdo))
{
ERR("invalid param for fdo_set.");
return 0;
@@ -1186,18 +1186,18 @@ _ethumb_dbus_fdo_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *va
}
static int
-_ethumb_dbus_size_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_size_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
- EDBus_Message_Iter *st;
+ Eldbus_Message_Iter *st;
int w, h;
- if (!edbus_message_iter_arguments_get(variant, "(ii)", &st))
+ if (!eldbus_message_iter_arguments_get(variant, "(ii)", &st))
{
ERR("invalid param for size_set.");
return 0;
}
- edbus_message_iter_arguments_get(st, "ii", &w, &h);
+ eldbus_message_iter_arguments_get(st, "ii", &w, &h);
DBG("setting size to: %dx%d", w, h);
request->setup.flags.size = 1;
request->setup.tw = w;
@@ -1207,11 +1207,11 @@ _ethumb_dbus_size_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *v
}
static int
-_ethumb_dbus_format_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_format_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
int format;
- if (!edbus_message_iter_arguments_get(variant, "i", &format))
+ if (!eldbus_message_iter_arguments_get(variant, "i", &format))
{
ERR("invalid param for format_set.");
return 0;
@@ -1225,11 +1225,11 @@ _ethumb_dbus_format_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter
}
static int
-_ethumb_dbus_aspect_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_aspect_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
int aspect;
- if (!edbus_message_iter_arguments_get(variant, "i", &aspect))
+ if (!eldbus_message_iter_arguments_get(variant, "i", &aspect))
{
ERR("invalid param for aspect_set.");
return 0;
@@ -1243,11 +1243,11 @@ _ethumb_dbus_aspect_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter
}
static int
-_ethumb_dbus_orientation_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_orientation_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
int orientation;
- if (!edbus_message_iter_arguments_get(variant, "i", &orientation))
+ if (!eldbus_message_iter_arguments_get(variant, "i", &orientation))
{
ERR("invalid param for orientation_set.");
return 0;
@@ -1261,18 +1261,18 @@ _ethumb_dbus_orientation_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_
}
static int
-_ethumb_dbus_crop_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_crop_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
- EDBus_Message_Iter *st;
+ Eldbus_Message_Iter *st;
double x, y;
- if (!edbus_message_iter_arguments_get(variant, "(dd)", &st))
+ if (!eldbus_message_iter_arguments_get(variant, "(dd)", &st))
{
ERR("invalid param for crop_set.");
return 0;
}
- edbus_message_iter_arguments_get(st, "dd", &x, &y);
+ eldbus_message_iter_arguments_get(st, "dd", &x, &y);
DBG("setting crop to: %3.2f,%3.2f", x, y);
request->setup.flags.crop = 1;
request->setup.cx = x;
@@ -1282,11 +1282,11 @@ _ethumb_dbus_crop_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *v
}
static int
-_ethumb_dbus_quality_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_quality_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
int quality;
- if (!edbus_message_iter_arguments_get(variant, "i", &quality))
+ if (!eldbus_message_iter_arguments_get(variant, "i", &quality))
{
ERR("invalid param for quality_set.");
return 0;
@@ -1301,11 +1301,11 @@ _ethumb_dbus_quality_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter
static int
-_ethumb_dbus_compress_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_compress_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
int compress;
- if (!edbus_message_iter_arguments_get(variant, "i", &compress))
+ if (!eldbus_message_iter_arguments_get(variant, "i", &compress))
{
ERR("invalid param for compress_set.");
return 0;
@@ -1319,18 +1319,18 @@ _ethumb_dbus_compress_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Ite
}
static int
-_ethumb_dbus_frame_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_frame_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
- EDBus_Message_Iter *_struct, *file_iter, *group_iter, *swallow_iter;
+ Eldbus_Message_Iter *_struct, *file_iter, *group_iter, *swallow_iter;
const char *file, *group, *swallow;
- if (!edbus_message_iter_arguments_get(variant, "(ayayay)", &_struct))
+ if (!eldbus_message_iter_arguments_get(variant, "(ayayay)", &_struct))
{
ERR("invalid param for frame_set.");
return 0;
}
- edbus_message_iter_arguments_get(_struct, "ayayay", &file_iter, &group_iter, &swallow_iter);
+ eldbus_message_iter_arguments_get(_struct, "ayayay", &file_iter, &group_iter, &swallow_iter);
file = _ethumb_dbus_get_bytearray(file_iter);
group = _ethumb_dbus_get_bytearray(group_iter);
@@ -1345,12 +1345,12 @@ _ethumb_dbus_frame_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *
}
static int
-_ethumb_dbus_directory_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_directory_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
const char *directory;
- EDBus_Message_Iter *array;
+ Eldbus_Message_Iter *array;
- if (!edbus_message_iter_arguments_get(variant, "ay", &array))
+ if (!eldbus_message_iter_arguments_get(variant, "ay", &array))
{
ERR("invalid param for dir_path_set.");
return 0;
@@ -1365,12 +1365,12 @@ _ethumb_dbus_directory_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_It
}
static int
-_ethumb_dbus_category_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_category_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
const char *category;
- EDBus_Message_Iter *array;
+ Eldbus_Message_Iter *array;
- if (!edbus_message_iter_arguments_get(variant, "ay", &array))
+ if (!eldbus_message_iter_arguments_get(variant, "ay", &array))
{
ERR("invalid param for category.");
return 0;
@@ -1385,11 +1385,11 @@ _ethumb_dbus_category_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Ite
}
static int
-_ethumb_dbus_video_time_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_time_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
double video_time;
- if (!edbus_message_iter_arguments_get(variant, "d", &video_time))
+ if (!eldbus_message_iter_arguments_get(variant, "d", &video_time))
{
ERR("invalid param for video_time_set.");
return 0;
@@ -1403,11 +1403,11 @@ _ethumb_dbus_video_time_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_I
}
static int
-_ethumb_dbus_video_start_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_start_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
double video_start;
- if (!edbus_message_iter_arguments_get(variant, "d", &video_start))
+ if (!eldbus_message_iter_arguments_get(variant, "d", &video_start))
{
ERR("invalid param for video_start_set.");
return 0;
@@ -1421,11 +1421,11 @@ _ethumb_dbus_video_start_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_
}
static int
-_ethumb_dbus_video_interval_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_interval_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
double video_interval;
- if (!edbus_message_iter_arguments_get(variant, "d", &video_interval))
+ if (!eldbus_message_iter_arguments_get(variant, "d", &video_interval))
{
ERR("invalid param for video_interval_set.");
return 0;
@@ -1438,11 +1438,11 @@ _ethumb_dbus_video_interval_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Messa
}
static int
-_ethumb_dbus_video_ntimes_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_ntimes_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
unsigned int video_ntimes;
- if (!edbus_message_iter_arguments_get(variant, "u", &video_ntimes))
+ if (!eldbus_message_iter_arguments_get(variant, "u", &video_ntimes))
{
ERR("invalid param for video_ntimes_set.");
return 0;
@@ -1456,11 +1456,11 @@ _ethumb_dbus_video_ntimes_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message
}
static int
-_ethumb_dbus_video_fps_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_fps_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
unsigned int video_fps;
- if (!edbus_message_iter_arguments_get(variant, "u", &video_fps))
+ if (!eldbus_message_iter_arguments_get(variant, "u", &video_fps))
{
ERR("invalid param for video_fps_set.");
return 0;
@@ -1474,11 +1474,11 @@ _ethumb_dbus_video_fps_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_It
}
static int
-_ethumb_dbus_document_page_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_document_page_set(Ethumbd_Object *eobject EINA_UNUSED, Eldbus_Message_Iter *variant, Ethumbd_Request *request)
{
unsigned int document_page;
- if (!edbus_message_iter_arguments_get(variant, "u", &document_page))
+ if (!eldbus_message_iter_arguments_get(variant, "u", &document_page))
{
ERR("invalid param for document_page_set.");
return 0;
@@ -1494,7 +1494,7 @@ _ethumb_dbus_document_page_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Messag
static struct
{
const char *option;
- int (*setup_func)(Ethumbd_Object *eobject, EDBus_Message_Iter *variant, Ethumbd_Request *request);
+ int (*setup_func)(Ethumbd_Object *eobject, Eldbus_Message_Iter *variant, Ethumbd_Request *request);
} _option_cbs[] = {
{"fdo", _ethumb_dbus_fdo_set},
{"size", _ethumb_dbus_size_set},
@@ -1517,13 +1517,13 @@ static struct
};
static int
-_ethumb_dbus_ethumb_setup_parse_element(Ethumbd_Object *eobject, EDBus_Message_Iter *data, Ethumbd_Request *request)
+_ethumb_dbus_ethumb_setup_parse_element(Ethumbd_Object *eobject, Eldbus_Message_Iter *data, Ethumbd_Request *request)
{
- EDBus_Message_Iter *variant;
+ Eldbus_Message_Iter *variant;
const char *option;
int i, r;
- edbus_message_iter_arguments_get(data, "sv", &option, &variant);
+ eldbus_message_iter_arguments_get(data, "sv", &option, &variant);
r = 0;
for (i = 0; _option_cbs[i].option; i++)
@@ -1542,25 +1542,25 @@ _ethumb_dbus_ethumb_setup_parse_element(Ethumbd_Object *eobject, EDBus_Message_I
return _option_cbs[i].setup_func(eobject, variant, request);
}
-static EDBus_Message *
-_ethumb_dbus_ethumb_setup_cb(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
+static Eldbus_Message *
+_ethumb_dbus_ethumb_setup_cb(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
- EDBus_Message *reply;
+ Eldbus_Message *reply;
Ethumbd_Object_Data *odata;
Ethumbd *ed;
Ethumbd_Object *eobject;
Ethumbd_Request *request;
Eina_Bool r = EINA_FALSE;
- EDBus_Message_Iter *array;
- EDBus_Message_Iter *data;
+ Eldbus_Message_Iter *array;
+ Eldbus_Message_Iter *data;
- if (!edbus_message_arguments_get(msg, "a{sv}", &array))
+ if (!eldbus_message_arguments_get(msg, "a{sv}", &array))
{
ERR("could not get dbus_object data for setup_cb.");
goto end;
}
- odata = edbus_service_object_data_get(iface, ODATA);
+ odata = eldbus_service_object_data_get(iface, ODATA);
if (!odata)
{
ERR("could not get dbus_object data for setup_cb.");
@@ -1574,7 +1574,7 @@ _ethumb_dbus_ethumb_setup_cb(const EDBus_Service_Interface *iface, const EDBus_M
request->id = -1;
r = EINA_TRUE;
- while (edbus_message_iter_get_and_next(array, 'r', &data) && r)
+ while (eldbus_message_iter_get_and_next(array, 'r', &data) && r)
{
if (!_ethumb_dbus_ethumb_setup_parse_element(eobject, data, request))
r = EINA_FALSE;
@@ -1585,57 +1585,57 @@ _ethumb_dbus_ethumb_setup_cb(const EDBus_Service_Interface *iface, const EDBus_M
ed->queue.nqueue++;
end:
- reply = edbus_message_method_return_new(msg);
- edbus_message_arguments_append(reply, "b", r);
+ reply = eldbus_message_method_return_new(msg);
+ eldbus_message_arguments_append(reply, "b", r);
return reply;
}
static void
_ethumb_dbus_generated_signal(Ethumbd *ed, int *id, const char *thumb_path, const char *thumb_key, Eina_Bool success)
{
- EDBus_Message *sig;
- EDBus_Service_Interface *iface;
- EDBus_Message_Iter *iter, *iter_path, *iter_key;
+ Eldbus_Message *sig;
+ Eldbus_Service_Interface *iface;
+ Eldbus_Message_Iter *iter, *iter_path, *iter_key;
int id32;
id32 = *id;
iface = ed->queue.table[ed->queue.current].iface;
- sig = edbus_service_signal_new(iface, ETHUMB_DBUS_OBJECTS_SIGNAL_GENERATED);
+ sig = eldbus_service_signal_new(iface, ETHUMB_DBUS_OBJECTS_SIGNAL_GENERATED);
- iter = edbus_message_iter_get(sig);
- edbus_message_iter_arguments_append(iter, "iay", id32, &iter_path);
+ iter = eldbus_message_iter_get(sig);
+ eldbus_message_iter_arguments_append(iter, "iay", id32, &iter_path);
_ethumb_dbus_append_bytearray(iter, iter_path, thumb_path);
- edbus_message_iter_arguments_append(iter, "ay", &iter_key);
+ eldbus_message_iter_arguments_append(iter, "ay", &iter_key);
_ethumb_dbus_append_bytearray(iter, iter_key, thumb_key);
- edbus_message_iter_arguments_append(iter, "b", success);
+ eldbus_message_iter_arguments_append(iter, "b", success);
- edbus_service_signal_send(iface, sig);
+ eldbus_service_signal_send(iface, sig);
}
-static const EDBus_Service_Interface_Desc server_desc = {
+static const Eldbus_Service_Interface_Desc server_desc = {
_ethumb_dbus_interface, _ethumb_dbus_methods
};
static void
-_ethumb_dbus_request_name_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_ethumb_dbus_request_name_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
- EDBus_Service_Interface *iface;
+ Eldbus_Service_Interface *iface;
const char *errname, *errmsg;
Ethumbd *ed = data;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("request name error: %s %s", errname, errmsg);
- edbus_connection_unref(ed->conn);
+ eldbus_connection_unref(ed->conn);
return;
}
- iface = edbus_service_interface_register(ed->conn, _ethumb_dbus_path,
+ iface = eldbus_service_interface_register(ed->conn, _ethumb_dbus_path,
&server_desc);
EINA_SAFETY_ON_NULL_RETURN(iface);
- edbus_service_object_data_set(iface, DAEMON, ed);
+ eldbus_service_object_data_set(iface, DAEMON, ed);
_ethumbd_timeout_start(ed);
}
@@ -1643,7 +1643,7 @@ _ethumb_dbus_request_name_cb(void *data, const EDBus_Message *msg, EDBus_Pending
static int
_ethumb_dbus_setup(Ethumbd *ed)
{
- edbus_name_request(ed->conn, _ethumb_dbus_bus_name, 0,
+ eldbus_name_request(ed->conn, _ethumb_dbus_bus_name, 0,
_ethumb_dbus_request_name_cb, ed);
return 1;
}
@@ -1653,7 +1653,7 @@ _ethumb_dbus_finish(Ethumbd *ed)
{
_process_queue_stop(ed);
_ethumb_table_clear(ed);
- edbus_connection_unref(ed->conn);
+ eldbus_connection_unref(ed->conn);
free(ed->queue.table);
free(ed->queue.list);
}
@@ -1737,9 +1737,9 @@ main(int argc, char *argv[])
goto finish;
}
- if (!edbus_init())
+ if (!eldbus_init())
{
- ERR("could not init edbus.");
+ ERR("could not init eldbus.");
exit_value = -1;
goto finish;
}
@@ -1764,35 +1764,35 @@ main(int argc, char *argv[])
if (quit_option)
goto finish;
- ed.conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
+ ed.conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
if (!ed.conn)
{
ERR("could not connect to session bus.");
exit_value = -3;
- goto finish_edbus;
+ goto finish_eldbus;
}
ed.timeout = timeout;
if (!_ethumb_dbus_setup(&ed))
{
- edbus_connection_unref(ed.conn);
+ eldbus_connection_unref(ed.conn);
ERR("could not setup dbus connection.");
exit_value = -5;
- goto finish_edbus;
+ goto finish_eldbus;
}
ecore_main_loop_begin();
_ethumb_dbus_finish(&ed);
- finish_edbus:
+ finish_eldbus:
if (_log_domain >= 0)
{
eina_log_domain_unregister(_log_domain);
_log_domain = -1;
}
- edbus_shutdown();
+ eldbus_shutdown();
finish:
if (ed.slave.exe)
ecore_exe_quit(ed.slave.exe);
diff --git a/src/examples/edbus/banshee.c b/src/examples/edbus/banshee.c
deleted file mode 100644
index 89a005a8f6..0000000000
--- a/src/examples/edbus/banshee.c
+++ /dev/null
@@ -1,241 +0,0 @@
-//Compile with:
-// gcc -o banshee banshee.c `pkg-config --cflags --libs edbus2 ecore eina`
-
-#include "EDBus.h"
-#include <Ecore.h>
-
-#define BUS "org.bansheeproject.Banshee"
-#define ENGINE_PATH "/org/bansheeproject/Banshee/PlayerEngine"
-#define CONTROLLER_PATH "/org/bansheeproject/Banshee/PlaybackController"
-#define MPRIS_PATH "/org/mpris/MediaPlayer2"
-
-#define ENGINE_IFACE "org.bansheeproject.Banshee.PlayerEngine"
-#define CONTROLLER_IFACE "org.bansheeproject.Banshee.PlaybackController"
-#define MPRIS_IFACE "org.mpris.MediaPlayer2.Playlists"
-
-static EDBus_Signal_Handler *state_changed2;
-
-static Eina_Bool
-_timeout_application(void *data EINA_UNUSED)
-{
- printf("\n## ecore_main_loop_quit()\n");
- ecore_main_loop_quit();
- return EINA_TRUE;
-}
-
-static void
-on_get_playlists(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- EDBus_Message_Iter *array, *struct_entry;
- const char *path, *name, *image;
- int i = 0;
-
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
-
- if (!edbus_message_arguments_get(msg, "a(oss)", &array))
- {
- fprintf(stderr, "Error: could not get entry contents\n");
- return;
- }
- printf("on_get_playlists() \n\n");
- while (edbus_message_iter_get_and_next(array, 'r', &struct_entry))
- {
- if (!edbus_message_iter_arguments_get(struct_entry, "oss", &path, &name, &image))
- {
- printf("error on edbus_massage_iterator_arguments_get()");
- return;
- }
- i++;
- printf("%d - %s | %s | %s\n", i, path, name, image);
- }
- printf("end of on_get_playlists()\n\n");
-}
-
-static void
-iterate_dict(void *data EINA_UNUSED, const void *key, EDBus_Message_Iter *var)
-{
- const char *skey = key;
-
- if (!strcmp(skey, "PlaylistCount"))
- {
- unsigned count;
- if (!edbus_message_iter_arguments_get(var, "u", &count))
- printf("error2\n");
- printf("PlaylistCount=%u\n", count);
- }
- else if (!strcmp(skey, "Orderings"))
- {
- EDBus_Message_Iter *as;
- const char *txt;
- printf("- Orderings\n");
- if (!edbus_message_iter_arguments_get(var, "as", &as))
- printf("error1\n");
- while (edbus_message_iter_get_and_next(as, 's', &txt))
- printf("\t%s\n", txt);
- }
-}
-
-static void
-playlist_get_all_cb(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- EDBus_Message_Iter *array;
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
-
- if (edbus_message_arguments_get(msg, "a{sv}", &array))
- edbus_message_iter_dict_iterate(array, "sv", iterate_dict, NULL);
-}
-
-static void
-on_introspect(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- const char *string;
-
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
-
- if (!edbus_message_arguments_get(msg, "s", &string))
- {
- fprintf(stderr, "Error: could not get entry contents\n");
- return;
- }
-
- printf("on_introspect() data=\n%s\n\n", string);
-}
-
-static void
-on_next_or_pause(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- const char *status = data;
-
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
-
- printf("%s\n", status);
-}
-
-static void
-on_state_changed(void *data EINA_UNUSED, const EDBus_Message *msg)
-{
- const char *status;
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
-
- if (!edbus_message_arguments_get(msg, "s", &status))
- {
- fprintf(stderr, "Error: could not get entry contents\n");
- return;
- }
-
- printf("on_state_changed = %s\n", status);
-}
-
-static void
-on_state_changed2(void *data EINA_UNUSED, const EDBus_Message *msg)
-{
- const char *status;
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
-
- if (!edbus_message_arguments_get(msg, "s", &status))
- {
- fprintf(stderr, "Error: could not get entry contents\n");
- return;
- }
-
- printf("on_state_changed2 = %s\n", status);
- edbus_signal_handler_unref(state_changed2);
- state_changed2 = NULL;
-}
-
-static void
-on_banshee_startup(void *data EINA_UNUSED, const EDBus_Message *msg)
-{
- const char *bus, *older_id, *new_id;
-
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
- if (!edbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
- {
- printf("Error getting arguments from NameOwnerChanged");
- return;
- }
-
- printf("banshee started on id=%s\n", new_id);
-}
-
-static void
-on_name_owner_changed(void *data EINA_UNUSED, const EDBus_Message *msg)
-{
- const char *bus, *older_id, *new_id;
-
- EINA_SAFETY_ON_TRUE_RETURN(edbus_message_error_get(msg, NULL, NULL));
- if (!edbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
- {
- printf("Error getting arguments from NameOwnerChanged");
- return;
- }
-
- printf("bus = %s older=%s new=%s\n\n", bus, older_id, new_id);
-}
-
-int
-main(void)
-{
- EDBus_Connection *conn;
- EDBus_Object *engine_obj, *controller_obj, *mpris_obj;
- EDBus_Proxy *engine, *controler, *playlists;
- EDBus_Signal_Handler *sh;
-
- ecore_init();
- edbus_init();
-
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
-
- engine_obj = edbus_object_get(conn, BUS, ENGINE_PATH);
- controller_obj = edbus_object_get(conn, BUS, CONTROLLER_PATH);
- mpris_obj = edbus_object_get(conn, BUS, MPRIS_PATH);
-
- engine = edbus_proxy_get(engine_obj, ENGINE_IFACE);
- EINA_SAFETY_ON_NULL_GOTO(engine, end);
- controler = edbus_proxy_get(controller_obj, CONTROLLER_IFACE);
- EINA_SAFETY_ON_NULL_GOTO(controler, end);
- playlists = edbus_proxy_get(mpris_obj, MPRIS_IFACE);
- EINA_SAFETY_ON_NULL_GOTO(playlists, end);
-
- edbus_object_introspect(engine_obj, on_introspect, NULL);
-
- edbus_proxy_signal_handler_add(engine, "StateChanged", on_state_changed, NULL);
- edbus_proxy_call(engine, "Pause", on_next_or_pause, "Pause", -1, "");
-
- edbus_proxy_call(controler, "Next", on_next_or_pause, "Next", -1, "b", EINA_TRUE);
-
- edbus_proxy_property_get_all(playlists, playlist_get_all_cb, NULL);
- edbus_proxy_call(playlists, "GetPlaylists", on_get_playlists, NULL, -1,
- "uusb", (unsigned)0, (unsigned)30, "asc", EINA_FALSE);
-
- edbus_signal_handler_add(conn, BUS, ENGINE_PATH, ENGINE_IFACE,
- "StateChanged", on_state_changed, NULL);
- state_changed2 = edbus_signal_handler_add(conn, BUS, ENGINE_PATH, ENGINE_IFACE,
- "StateChanged", on_state_changed2, NULL);
-
- sh = edbus_signal_handler_add(conn, EDBUS_FDO_BUS, EDBUS_FDO_PATH,
- EDBUS_FDO_INTERFACE, "NameOwnerChanged",
- on_name_owner_changed, NULL);
- edbus_signal_handler_match_extra_set(sh, "arg0", BUS, NULL);
-
- sh = edbus_signal_handler_add(conn, EDBUS_FDO_BUS, EDBUS_FDO_PATH,
- EDBUS_FDO_INTERFACE, "NameOwnerChanged",
- on_banshee_startup, NULL);
- edbus_signal_handler_match_extra_set(sh, "arg0", BUS, "arg1", "", NULL);
-
- ecore_timer_add(50, _timeout_application, NULL);
-
- ecore_main_loop_begin();
-
-end:
- /**
- * It's not necessary unref all objecs, proxys and signal handlers
- * When a parent have ref = 0, it will unref all your childrens
- * before free it self.
- **/
- edbus_connection_unref(conn);
-
- edbus_shutdown();
- ecore_shutdown();
- return 0;
-}
diff --git a/src/examples/edbus/complex-types-server.c b/src/examples/edbus/complex-types-server.c
deleted file mode 100644
index 2409ce73b0..0000000000
--- a/src/examples/edbus/complex-types-server.c
+++ /dev/null
@@ -1,393 +0,0 @@
-//Compile with:
-// gcc -o complex-types-server complex-types-server.c `pkg-config --cflags --libs edbus2 ecore`
-
-#include "EDBus.h"
-#include <Ecore.h>
-
-#define BUS "com.profusion"
-#define PATH "/com/profusion/Test"
-#define IFACE "com.profusion.Test"
-
-static char *resp2;
-/* dummy, incremented each time DBus.Properties.Get() is called */
-static int int32 = 35;
-static Ecore_Timer *timer;
-
-static EDBus_Message *
-_receive_array(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- EDBus_Message_Iter *array;
- const char *txt;
-
- printf("- receiveArray\n");
- if (!edbus_message_arguments_get(msg, "as", &array))
- {
- printf("Error on edbus_message_arguments_get()\n");
- return reply;
- }
-
- while (edbus_message_iter_get_and_next(array, 's', &txt))
- printf("%s\n", txt);
- printf("}\n\n");
-
- return reply;
-}
-
-static EDBus_Message *
-_receive_array_of_string_int_with_size(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- EDBus_Message_Iter *array, *struct_si;
- int size, i = 0;
-
- printf("- receiveArrayOfStringIntWithSize\n{\n");
- if (!edbus_message_arguments_get(msg, "ia(si)", &size, &array))
- {
- printf("Error on edbus_message_arguments_get()\n");
- return reply;
- }
-
- while (edbus_message_iter_get_and_next(array, 'r', &struct_si))
- {
- const char *txt;
- int num;
- if (!edbus_message_iter_arguments_get(struct_si, "si", &txt, &num))
- {
- printf("Error on edbus_message_arguments_get()\n");
- return reply;
- }
- printf("%s | %d\n", txt, num);
- i++;
- }
- printf("size in msg %d | size read %d\n", size, i);
- printf("}\n\n");
-
- return reply;
-}
-
-static EDBus_Message *
-_receive_variant(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- EDBus_Message_Iter *var, *array, *main_iter;
-
- main_iter = edbus_message_iter_get(reply);
- var = edbus_message_iter_container_new(main_iter, 'v', "as");
- edbus_message_iter_arguments_append(var, "as", &array);
-
- edbus_message_iter_arguments_append(array, "s", "item1");
- edbus_message_iter_arguments_append(array, "s", "item2");
- edbus_message_iter_arguments_append(array, "s", "item3");
-
- edbus_message_iter_container_close(var, array);
- edbus_message_iter_container_close(main_iter, var);
-
- return reply;
-}
-
-static EDBus_Message *
-_send_variant(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- EDBus_Message_Iter *variant;
- char *type;
-
- printf("- sendVariantData\n{\n");
- if (!edbus_message_arguments_get(msg, "v", &variant))
- {
- printf("Error on edbus_message_arguments_get()\n");
- return reply;
- }
-
- type = edbus_message_iter_signature_get(variant);
- if (type[1])
- {
- printf("It is a complex type, not handle yet.\n");
- free(type);
- return reply;
- }
-
- switch (type[0])
- {
- case 's':
- case 'o':
- {
- char *txt;
- edbus_message_iter_arguments_get(variant, type, &txt);
- printf("type = %c value = %s\n", type[0], txt);
- break;
- }
- case 'i':
- {
- int num;
- edbus_message_iter_arguments_get(variant, type, &num);
- printf("type = %c value = %d\n", type[0], num);
- break;
- }
- default:
- {
- printf("Unhandled type\n");
- }
- }
-
- printf("}\n\n");
-
- free(type);
- return reply;
-}
-
-static EDBus_Message *
-_send_array_int(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- EDBus_Message_Iter *iter, *array;
- int i;
-
- printf("- sendArrayInt\n\n");
-
- iter = edbus_message_iter_get(reply);
- array = edbus_message_iter_container_new(iter, 'a', "i");
- for (i = 0; i < 5; i++)
- edbus_message_iter_arguments_append(array, "i", i);
- edbus_message_iter_container_close(iter, array);
-
- return reply;
-}
-
-static EDBus_Message *
-_send_array(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- EDBus_Message_Iter *iter, *array;
- const char *array_string[5] = {"qqqq", "wwwww", "eeeeee", "rrrrr", "ttttt"};
- int i;
-
- printf("sendArray\n\n");
-
- iter = edbus_message_iter_get(reply);
- array = edbus_message_iter_container_new(iter, 'a', "s");
- for (i = 0; i < 5; i++)
- edbus_message_iter_arguments_append(array, "s", array_string[i]);
- edbus_message_iter_container_close(iter, array);
-
- return reply;
-}
-
-static EDBus_Message *
-_plus_one(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- int num;
-
- printf("- plusOne\n\n");
- if (!edbus_message_arguments_get(msg, "i", &num))
- {
- printf("Error on edbus_message_arguments_get()\n");
- return reply;
- }
- num++;
- edbus_message_arguments_append(reply, "i", num);
-
- return reply;
-}
-
-static EDBus_Message *
-_double_container(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message_Iter *array1, *array2, *structure;
- int num1, num2;
- EDBus_Message *reply = edbus_message_method_return_new(msg);
-
- if (!edbus_message_arguments_get(msg, "a(ii)a(ii)", &array1, &array2))
- {
- printf("Error on edbus_message_arguments_get()\n");
- return NULL;
- }
-
- printf("DoubleCountainer\n{\nArray1:\n");
- while (edbus_message_iter_get_and_next(array1, 'r', &structure))
- {
- edbus_message_iter_arguments_get(structure, "ii", &num1, &num2);
- printf("1 %d - 2 %d\n", num1, num2);
- }
-
- printf("Array2:\n");
- while (edbus_message_iter_get_and_next(array2, 'r', &structure))
- {
- edbus_message_iter_arguments_get(structure, "ii", &num1, &num2);
- printf("1 %d - 2 %d\n", num1, num2);
- }
- printf("}\n\n");
- return reply;
-}
-
-static Eina_Bool
-_properties_get(const EDBus_Service_Interface *iface EINA_UNUSED, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *request_msg EINA_UNUSED, EDBus_Message **error EINA_UNUSED)
-{
- printf("Properties_get - %s\n", propname);
- if (!strcmp(propname, "Resp2"))
- edbus_message_iter_basic_append(iter, 's', resp2);
- else if (!strcmp(propname, "text"))
- edbus_message_iter_basic_append(iter, 's', "lalalala");
- else if (!strcmp(propname, "int32"))
- {
- edbus_message_iter_arguments_append(iter, "i", int32);
- int32++;
- }
- else if (!strcmp(propname, "st"))
- {
- EDBus_Message_Iter *st;
- edbus_message_iter_arguments_append(iter, "(ss)", &st);
- edbus_message_iter_arguments_append(st, "ss", "string1", "string2");
- edbus_message_iter_container_close(iter, st);
- }
- return EINA_TRUE;
-}
-
-static EDBus_Message *
-_properties_set(const EDBus_Service_Interface *iface EINA_UNUSED, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *msg)
-{
- char *type;
-
- type = edbus_message_iter_signature_get(iter);
-
- if (!strcmp(propname, "int32"))
- {
- int num;
- if (type[0] != 'i')
- goto invalid_signature;
- edbus_message_iter_arguments_get(iter, "i", &num);
- printf("int32 was set to: %d, previously was: %d\n", num, int32);
- int32 = num;
- }
- else if (!strcmp(propname, "Resp2"))
- {
- const char *txt;
- if (type[0] != 's')
- goto invalid_signature;
- edbus_message_iter_arguments_get(iter, "s", &txt);
- printf("Resp2 was set to: %s, previously was: %s\n", txt, resp2);
- free(resp2);
- resp2 = strdup(txt);
- }
- free(type);
- return edbus_message_method_return_new(msg);
-
-invalid_signature:
- free(type);
- return edbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidSignature",
- "Invalid type.");
-}
-
-static const EDBus_Method methods[] = {
- {
- "ReceiveArray", EDBUS_ARGS({"as", "array_of_strings"}),
- NULL, _receive_array
- },
- {
- "ReceiveArrayOfStringIntWithSize",
- EDBUS_ARGS({"i", "size_of_array"}, {"a(si)", "array"}),
- NULL, _receive_array_of_string_int_with_size, 0
- },
- {
- "SendVariantData", EDBUS_ARGS({"v", "variant_data"}),
- NULL, _send_variant
- },
- {
- "ReceiveVariantData", NULL, EDBUS_ARGS({"v", "variant_data"}),
- _receive_variant
- },
- {
- "SendArrayInt", NULL,
- EDBUS_ARGS({"ai", "array_of_int"}), _send_array_int, 0
- },
- {
- "SendArray", NULL, EDBUS_ARGS({"as", "array_string"}),
- _send_array
- },
- {
- "PlusOne", EDBUS_ARGS({"i", "integer"}),
- EDBUS_ARGS({"i", "integer_plus_one"}), _plus_one
- },
- {
- "DoubleContainner", EDBUS_ARGS({"a(ii)", "array1"}, {"a(ii)", "array2"}),
- NULL, _double_container
- },
- { }
-};
-
-static const EDBus_Property properties[] = {
- { "Resp2", "s", NULL, _properties_set },
- { "text", "s" },
- { "int32", "i", NULL, _properties_set },
- { "st", "(ss)" },
- { }
-};
-
-static const EDBus_Service_Interface_Desc iface_desc = {
- IFACE, methods, NULL, properties, _properties_get
-};
-
-static Eina_Bool _emit_changed(void *data)
-{
- EDBus_Service_Interface *iface = data;
- edbus_service_property_changed(iface, "int32");
- edbus_service_property_invalidate_set(iface, "Resp2", EINA_TRUE);
- return ECORE_CALLBACK_RENEW;
-}
-
-static void
-on_name_request(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- unsigned int reply;
- EDBus_Service_Interface *iface = data;
-
- if (edbus_message_error_get(msg, NULL, NULL))
- {
- printf("error on on_name_request\n");
- return;
- }
-
- if (!edbus_message_arguments_get(msg, "u", &reply))
- {
- printf("error geting arguments on on_name_request\n");
- return;
- }
-
- if (reply != EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
- {
- printf("error name already in use\n");
- return;
- }
-
- timer = ecore_timer_add(3, _emit_changed, iface);
-}
-
-int
-main(void)
-{
- EDBus_Connection *conn;
- EDBus_Service_Interface *iface;
-
- ecore_init();
- edbus_init();
-
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
-
- resp2 = malloc(sizeof(char) * 5);
- strcpy(resp2, "test");
- iface = edbus_service_interface_register(conn, PATH, &iface_desc);
- edbus_name_request(conn, BUS, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
- on_name_request, iface);
-
- ecore_main_loop_begin();
-
- free(resp2);
- ecore_timer_del(timer);
- edbus_connection_unref(conn);
-
- edbus_shutdown();
- ecore_shutdown();
- return 0;
-}
diff --git a/src/examples/edbus/complex-types.c b/src/examples/edbus/complex-types.c
deleted file mode 100644
index 3fa4e0be68..0000000000
--- a/src/examples/edbus/complex-types.c
+++ /dev/null
@@ -1,284 +0,0 @@
-//Compile with:
-// gcc -o complex-types complex-types.c `pkg-config --cflags --libs edbus2 ecore`
-
-#include "EDBus.h"
-#include <Ecore.h>
-
-#define BUS "com.profusion"
-#define PATH "/com/profusion/Test"
-#define IFACE "com.profusion.Test"
-
-EDBus_Connection *conn;
-
-static Eina_Bool
-_timer1_cb(void *data EINA_UNUSED)
-{
- printf("\nFishing...\n");
- ecore_main_loop_quit();
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void
-on_plus_one(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- int num2 = 0;
-
- if (edbus_message_error_get(msg, NULL, NULL))
- {
- printf("Message error\n\n");
- return;
- }
- if (!edbus_message_arguments_get(msg, "i", &num2))
- {
- printf("Error getting arguments.");
- return;
- }
-
- printf("on_plus_one() %d\n", num2);
-}
-
-static void
-set_property_resp2(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- const char *errname;
- const char *errmsg;
-
- printf("set_property_resp2()\n");
- if (edbus_message_error_get(msg, &errname, &errmsg))
- {
- printf("Message error %s - %s\n\n", errname, errmsg);
- return;
- }
-}
-
-static void
-get_property_resp2(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- EDBus_Proxy *proxy = data;
- EDBus_Message_Iter *variant = NULL;
- char *type;
- char *resp2;
- const char *errname;
- const char *errmsg;
-
- printf("get_property_resp2()\n");
- if (edbus_message_error_get(msg, &errname, &errmsg))
- {
- printf("Message error %s - %s\n\n", errname, errmsg);
- return;
- }
- if (!edbus_message_arguments_get(msg, "v", &variant))
- {
- printf("Error getting arguments.");
- return;
- }
-
- type = edbus_message_iter_signature_get(variant);
- if (type[1])
- {
- printf("It is a complex type, not handle yet.\n\n");
- return;
- }
- if (type[0] != 's')
- {
- printf("Expected type is string.\n\n");
- return;
- }
- if (!edbus_message_iter_arguments_get(variant, "s", &resp2))
- {
- printf("error in edbus_message_iter_arguments_get()\n\n");
- return;
- }
- printf("resp2=%s\n", resp2);
- free(type);
-
- edbus_proxy_property_set(proxy, "Resp2", "s", &"lalala", set_property_resp2, NULL);
- edbus_proxy_property_set(proxy, "int32", "i", (void*)(intptr_t)99, set_property_resp2, NULL);
-}
-
-static void
-on_send_array_int(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- EDBus_Message_Iter *array = NULL;
- int num;
-
- printf("on_send_array_int()\n");
- if (edbus_message_error_get(msg, NULL, NULL))
- {
- printf("Message error\n\n");
- return;
- }
- if (!edbus_message_arguments_get(msg, "ai", &array))
- {
- printf("Error getting arguments.");
- return;
- }
-
- while (edbus_message_iter_get_and_next(array, 'i', &num))
- {
- printf("%d\n", num);
- }
-}
-
-static void
-on_send_array(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- EDBus_Message_Iter *array = NULL;
- char *txt = NULL;
- char *string[10];
- int i = 0;
- int z;
-
- printf("on_send_array()\n");
- if (edbus_message_error_get(msg, NULL, NULL))
- {
- printf("Message error\n\n");
- return;
- }
- if (!edbus_message_arguments_get(msg, "as", &array))
- {
- printf("Error getting arguments.");
- return;
- }
-
- while (edbus_message_iter_get_and_next(array, 's', &txt))
- {
- string[i] = txt;
- i++;
- }
-
- for (z = 0; z < i; z++)
- printf("string = %s\n", string[z]);
-}
-
-static void
-on_receive_array_with_size(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- const char *errname;
- const char *errmsg;
-
- printf("on_receive_array_with_size()\n");
- if (edbus_message_error_get(msg, &errname, &errmsg))
- {
- fprintf(stderr, "Error: %s %s\n", errname, errmsg);
- }
-}
-
-static void
-on_send_variant(void *data EINA_UNUSED, const EDBus_Message *msg EINA_UNUSED, EDBus_Pending *pending EINA_UNUSED)
-{
- printf("on_send_variant()\n\n");
-}
-
-static void
-on_receive_array(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- const char *errname;
- const char *errmsg;
-
- printf("on_receive_array()\n");
- if (edbus_message_error_get(msg, &errname, &errmsg))
- {
- fprintf(stderr, "Error: %s %s\n", errname, errmsg);
- }
-}
-
-int
-main(void)
-{
- EDBus_Object *test2_obj;
- EDBus_Proxy *test2_proxy;
- EDBus_Pending *pending;
- EDBus_Message_Iter *iter, *array_of_string, *variant;
- EDBus_Message_Iter *array_itr, *structure;
- EDBus_Message *msg;
- int size_of_array = 5;
- const char *array[5] = { "aaaa", "bbbb", "cccc", "dddd", "eeee" };
- int i;
- int plus_one = 24;
-
- ecore_init();
- edbus_init();
-
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
-
- test2_obj = edbus_object_get(conn, BUS, PATH);
- test2_proxy = edbus_proxy_get(test2_obj, IFACE);
-
- msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArray");
- iter = edbus_message_iter_get(msg);
- array_of_string = edbus_message_iter_container_new(iter, 'a',"s");
- if (!array_of_string) printf("array_of_string == NULL\n\n");
- for (i = 0; i < 5; i++)
- edbus_message_iter_basic_append(array_of_string, 's', array[i]);
- edbus_message_iter_container_close(iter, array_of_string);
- pending = edbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1);
- if (!pending) printf("Error in edbus_proxy_send()\n\n");
-
- msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize");
- iter = edbus_message_iter_get(msg);
- if (!edbus_message_iter_arguments_append(iter, "ia(si)", size_of_array, &array_of_string))
- printf("error on edbus_massage_iterator_arguments_set()\n\n");
- for (i = 0; i < size_of_array; i++)
- {
- EDBus_Message_Iter *struct_of_si;
- edbus_message_iter_arguments_append(array_of_string, "(si)", &struct_of_si);
- edbus_message_iter_arguments_append(struct_of_si, "si", array[i], i);
- edbus_message_iter_container_close(array_of_string, struct_of_si);
- }
- edbus_message_iter_container_close(iter, array_of_string);
- pending = edbus_proxy_send(test2_proxy, msg, on_receive_array_with_size, NULL, -1);
-
- msg = edbus_proxy_method_call_new(test2_proxy, "SendVariantData");
- iter = edbus_message_iter_get(msg);
- variant = edbus_message_iter_container_new(iter, 'v', "s");
- edbus_message_iter_basic_append(variant, 's', "test");
- edbus_message_iter_container_close(iter, variant);
- pending = edbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1);
-
- msg = edbus_proxy_method_call_new(test2_proxy, "DoubleContainner");
- iter = edbus_message_iter_get(msg);
- /**
- * edbus_message_iterator_arguments_set(itr, "a(ii)a(ii)", &array_itr, &array_itr2);
- * this will cause a error, we could not open another container until
- * we close the first one
- */
- edbus_message_iter_arguments_append(iter, "a(ii)", &array_itr);
- for (i = 0; i < 5; i++)
- {
- edbus_message_iter_arguments_append(array_itr, "(ii)", &structure);
- edbus_message_iter_arguments_append(structure, "ii", i, i*i);
- edbus_message_iter_container_close(array_itr, structure);
- }
- edbus_message_iter_container_close(iter, array_itr);
- edbus_message_iter_arguments_append(iter, "a(ii)", &array_itr);
- for (i = 0; i < 7; i++)
- {
- edbus_message_iter_arguments_append(array_itr, "(ii)", &structure);
- edbus_message_iter_arguments_append(structure, "ii", i, i*i*i);
- edbus_message_iter_container_close(array_itr, structure);
- }
- edbus_message_iter_container_close(iter, array_itr);
- edbus_proxy_send(test2_proxy, msg, NULL, NULL, -1);
-
- pending = edbus_proxy_call(test2_proxy, "SendArrayInt", on_send_array_int, NULL,
- -1 , "");
-
- pending = edbus_proxy_call(test2_proxy, "SendArray", on_send_array, NULL,
- -1 , "");
-
- pending = edbus_proxy_call(test2_proxy, "PlusOne", on_plus_one, NULL,
- -1 , "i", plus_one);
-
- pending = edbus_proxy_property_get(test2_proxy, "Resp2", get_property_resp2, test2_proxy);
-
- ecore_timer_add(10, _timer1_cb, NULL);
-
- ecore_main_loop_begin();
-
- edbus_connection_unref(conn);
-
- edbus_shutdown();
- ecore_shutdown();
- return 0;
-}
diff --git a/src/examples/edbus/server.c b/src/examples/edbus/server.c
deleted file mode 100644
index d10a672fe6..0000000000
--- a/src/examples/edbus/server.c
+++ /dev/null
@@ -1,247 +0,0 @@
-//Compile with:
-// gcc -o server server.c `pkg-config --cflags --libs edbus2 ecore`
-
-#include "EDBus.h"
-#include <Ecore.h>
-
-#define BUS "org.Enlightenment"
-#define PATH "/org/enlightenment"
-#define PATH_TEST_SON "/org/enlightenment/son"
-#define INTERFACE "org.enlightenment.Test"
-
-static EDBus_Connection *conn;
-
-static EDBus_Message *
-_hello(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *message)
-{
- EDBus_Message *reply = edbus_message_method_return_new(message);
- edbus_message_arguments_append(reply, "s", "Hello World");
- printf("Hello\n");
- return reply;
-}
-
-static EDBus_Message *
-_quit(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *message)
-{
- printf("Quit\n");
- ecore_main_loop_quit();
- return edbus_message_method_return_new(message);
-}
-
-enum
-{
- TEST_SIGNAL_ALIVE = 0,
- TEST_SIGNAL_HELLO
-};
-
-static Eina_Bool
-send_signal_alive(void *data)
-{
- EDBus_Service_Interface *iface = data;
- edbus_service_signal_emit(iface, TEST_SIGNAL_ALIVE);
- return ECORE_CALLBACK_RENEW;
-}
-
-static Eina_Bool
-send_signal_hello(void *data)
-{
- EDBus_Service_Interface *iface = data;
- edbus_service_signal_emit(iface, TEST_SIGNAL_HELLO, "Hello World");
- return ECORE_CALLBACK_RENEW;
-}
-
-static EDBus_Message *
-_send_bool(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- Eina_Bool bool;
- if (!edbus_message_arguments_get(msg, "b", &bool))
- printf("edbus_message_arguments_get() error\n");
- edbus_message_arguments_append(reply, "b", bool);
- return reply;
-}
-
-static EDBus_Message *
-_send_byte(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- unsigned char byte;
- if (!edbus_message_arguments_get(msg, "y", &byte))
- printf("edbus_message_arguments_get() error\n");
- edbus_message_arguments_append(reply, "y", byte);
- return reply;
-}
-
-static EDBus_Message *
-_send_uint32(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- unsigned int uint32;
- if (!edbus_message_arguments_get(msg, "u", &uint32))
- printf("edbus_message_arguments_get() error\n");
- edbus_message_arguments_append(reply, "u", uint32);
- return reply;
-}
-
-static EDBus_Message *
-_send_int32(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- int int32;
- if (!edbus_message_arguments_get(msg, "i", &int32))
- printf("edbus_message_arguments_get() error\n");
- edbus_message_arguments_append(reply, "i", int32);
- return reply;
-}
-
-static EDBus_Message *
-_send_int16(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- short int int16;
- if (!edbus_message_arguments_get(msg, "n", &int16))
- printf("edbus_message_arguments_get() error\n");
- edbus_message_arguments_append(reply, "n", int16);
- return reply;
-}
-
-static EDBus_Message *
-_send_double(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- double d;
- if (!edbus_message_arguments_get(msg, "d", &d))
- printf("edbus_message_arguments_get() error\n");
- edbus_message_arguments_append(reply, "d", d);
- return reply;
-}
-
-static EDBus_Message *
-_send_string(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- const char *txt;
- if (!edbus_message_arguments_get(msg, "s", &txt))
- printf("edbus_message_arguments_get() error\n");
- edbus_message_arguments_append(reply, "s", txt);
- return reply;
-}
-
-static Eina_Bool
-_resp_async(void *data)
-{
- EDBus_Message *msg = data;
- edbus_message_arguments_append(msg, "s", "Async test ok");
- edbus_connection_send(conn, msg, NULL, NULL, -1);
- return ECORE_CALLBACK_CANCEL;
-}
-
-static EDBus_Message *
-_async_test(const EDBus_Service_Interface *iface EINA_UNUSED, const EDBus_Message *msg)
-{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- printf("Received a call to AsyncTest.\n");
- printf("Response will be send in 5 seconds.\n");
- ecore_timer_add(5, _resp_async, reply);
- return NULL;
-}
-
-static const EDBus_Signal signals[] = {
- [TEST_SIGNAL_ALIVE] = {"Alive", NULL, 0},
- [TEST_SIGNAL_HELLO] = {"Hello", EDBUS_ARGS({ "s", "message" }), 0},
- { }
-};
-
-static const EDBus_Method methods[] = {
- {
- "Hello", NULL, EDBUS_ARGS({"s", "message"}),
- _hello
- },
- {
- "Quit", NULL, NULL,
- _quit, EDBUS_METHOD_FLAG_DEPRECATED
- },
- { "SendBool", EDBUS_ARGS({"b", "bool"}), EDBUS_ARGS({"b", "bool"}),
- _send_bool
- },
- { "SendByte", EDBUS_ARGS({"y", "byte"}), EDBUS_ARGS({"y", "byte"}),
- _send_byte
- },
- { "SendUint32", EDBUS_ARGS({"u", "uint32"}), EDBUS_ARGS({"u", "uint32"}),
- _send_uint32
- },
- { "SendInt32", EDBUS_ARGS({"i", "int32"}), EDBUS_ARGS({"i", "int32"}),
- _send_int32
- },
- { "SendInt16", EDBUS_ARGS({"n", "int16"}), EDBUS_ARGS({"n", "int16"}),
- _send_int16
- },
- { "SendDouble", EDBUS_ARGS({"d", "double"}), EDBUS_ARGS({"d", "double"}),
- _send_double
- },
- { "SendString", EDBUS_ARGS({"s", "string"}), EDBUS_ARGS({"s", "string"}),
- _send_string
- },
- { "AsyncTest", NULL, EDBUS_ARGS({"s", "text"}),
- _async_test
- },
- { }
-};
-
-static const EDBus_Service_Interface_Desc iface_desc = {
- INTERFACE, methods, signals
-};
-
-static void
-on_name_request(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
-{
- EDBus_Service_Interface *iface;
- unsigned int reply;
-
- iface = data;
- if (edbus_message_error_get(msg, NULL, NULL))
- {
- printf("error on on_name_request\n");
- return;
- }
-
- if (!edbus_message_arguments_get(msg, "u", &reply))
- {
- printf("error geting arguments on on_name_request\n");
- return;
- }
-
- if (reply != EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
- {
- printf("error name already in use\n");
- return;
- }
-
- ecore_timer_add(5, send_signal_alive, iface);
- ecore_timer_add(6, send_signal_hello, iface);
-}
-
-int
-main(void)
-{
- EDBus_Service_Interface *iface;
-
- ecore_init();
- edbus_init();
-
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
-
- iface = edbus_service_interface_register(conn, PATH, &iface_desc);
- edbus_name_request(conn, BUS, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
- on_name_request, iface);
-
- edbus_service_interface_register(conn, PATH_TEST_SON, &iface_desc);
-
- ecore_main_loop_begin();
-
- edbus_connection_unref(conn);
-
- edbus_shutdown();
- ecore_shutdown();
- return 0;
-}
diff --git a/src/examples/edbus/simple-signal-emit.c b/src/examples/edbus/simple-signal-emit.c
deleted file mode 100644
index 14e1fee705..0000000000
--- a/src/examples/edbus/simple-signal-emit.c
+++ /dev/null
@@ -1,86 +0,0 @@
-//Compile with:
-// gcc -o simple-signal-emit simple-signal-emit.c `pkg-config --cflags --libs edbus2`
-
-#include <EDBus.h>
-
-enum {
- TEST_SIGNAL_ALIVE,
- TEST_SIGNAL_PROP,
- TEST_SIGNAL_NAME,
-};
-
-static const EDBus_Signal test_signals[] = {
- [TEST_SIGNAL_ALIVE] = { "Alive" },
- [TEST_SIGNAL_PROP] = { "Properties", EDBUS_ARGS({ "a{ss}", "properties"}) },
- [TEST_SIGNAL_NAME] = { "Name", EDBUS_ARGS({ "s", "name"}) },
- { }
-};
-
-/* signal with complex arguments (a dict) */
-static void emit_properties(EDBus_Service_Interface *iface)
-{
- EDBus_Message *alive2;
- EDBus_Message_Iter *iter, *dict;
- struct keyval {
- const char *key;
- const char *val;
- } keyval[] = {
- { "key1", "val1" },
- { "key2", "val2" },
- { }
- };
- struct keyval *k;
-
- alive2 = edbus_service_signal_new(iface, TEST_SIGNAL_PROP);
- iter = edbus_message_iter_get(alive2);
- dict = edbus_message_iter_container_new(iter, 'a', "{ss}");
-
- for (k = keyval; k && k->key; k++)
- {
- EDBus_Message_Iter *entry = edbus_message_iter_container_new(dict, 'e',
- NULL);
- edbus_message_iter_arguments_append(entry, "ss", k->key, k->val);
- edbus_message_iter_container_close(dict, entry);
- }
-
- edbus_message_iter_container_close(iter, dict);
- edbus_service_signal_send(iface, alive2);
-}
-
-/* signal with basic args */
-static void emit_name(EDBus_Service_Interface *iface)
-{
- edbus_service_signal_emit(iface, TEST_SIGNAL_NAME, "TEST");
-}
-
-/* simple signal example */
-static void emit_alive(EDBus_Service_Interface *iface)
-{
- edbus_service_signal_emit(iface, TEST_SIGNAL_ALIVE);
-}
-
-static const EDBus_Service_Interface_Desc iface_desc = {
- "org.enlightenment.Test", NULL, test_signals
-};
-
-int main(void)
-{
- EDBus_Connection *conn;
- EDBus_Service_Interface *iface;
-
- edbus_init();
-
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
- iface = edbus_service_interface_register(conn, "/org/enlightenment",
- &iface_desc);
-
- emit_alive(iface);
- emit_name(iface);
- emit_properties(iface);
-
- edbus_connection_unref(conn);
-
- edbus_shutdown();
-
- return 0;
-}
diff --git a/src/examples/edbus/Makefile.am b/src/examples/eldbus/Makefile.am
index 891de027bc..8163a4252e 100644
--- a/src/examples/edbus/Makefile.am
+++ b/src/examples/eldbus/Makefile.am
@@ -4,19 +4,19 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib/eina \
-I$(top_srcdir)/src/lib/eo \
-I$(top_srcdir)/src/lib/ecore \
--I$(top_srcdir)/src/lib/edbus \
+-I$(top_srcdir)/src/lib/eldbus \
-I$(top_builddir)/src/lib/eina \
-I$(top_builddir)/src/lib/eo \
-I$(top_builddir)/src/lib/ecore \
--I$(top_builddir)/src/lib/edbus \
-@EDBUS_CFLAGS@
+-I$(top_builddir)/src/lib/eldbus \
+@ELDBUS_CFLAGS@
EXAMPLES_LIBS = \
$(top_builddir)/src/lib/eo/libeo.la \
$(top_builddir)/src/lib/ecore/libecore.la \
$(top_builddir)/src/lib/eina/libeina.la \
-$(top_builddir)/src/lib/edbus/libedbus2.la \
-@EDBUS_LDFLAGS@
+$(top_builddir)/src/lib/eldbus/libeldbus.la \
+@ELDBUS_LDFLAGS@
SRCS = \
connman-list-services.c \
@@ -77,12 +77,12 @@ clean-local:
rm -f $(EXTRA_PROGRAMS)
install-examples:
- mkdir -p $(datadir)/edbus/examples
- $(install_sh_DATA) -c $(SRCS) $(DATA_FILES) $(datadir)/edbus/examples
+ mkdir -p $(datadir)/eldbus/examples
+ $(install_sh_DATA) -c $(SRCS) $(DATA_FILES) $(datadir)/eldbus/examples
uninstall-local:
for f in $(SRCS) $(DATA_FILES); do \
- rm -f $(datadir)/edbus/examples/$$f ; \
+ rm -f $(datadir)/eldbus/examples/$$f ; \
done
if ALWAYS_BUILD_EXAMPLES
diff --git a/src/examples/edbus/Makefile.examples b/src/examples/eldbus/Makefile.examples
index d1227bfb22..32d0d93858 100644
--- a/src/examples/edbus/Makefile.examples
+++ b/src/examples/eldbus/Makefile.examples
@@ -1,5 +1,5 @@
CC=gcc
-COMMON_FLAGS=`pkg-config --libs --cflags eina,ecore,edbus2`
+COMMON_FLAGS=`pkg-config --libs --cflags eina,ecore,eldbus`
EXAMPLES= banshee client \
complex-types \
diff --git a/src/examples/eldbus/banshee.c b/src/examples/eldbus/banshee.c
new file mode 100644
index 0000000000..c9d30b5bf0
--- /dev/null
+++ b/src/examples/eldbus/banshee.c
@@ -0,0 +1,241 @@
+//Compile with:
+// gcc -o banshee banshee.c `pkg-config --cflags --libs eldbus ecore eina`
+
+#include "Eldbus.h"
+#include <Ecore.h>
+
+#define BUS "org.bansheeproject.Banshee"
+#define ENGINE_PATH "/org/bansheeproject/Banshee/PlayerEngine"
+#define CONTROLLER_PATH "/org/bansheeproject/Banshee/PlaybackController"
+#define MPRIS_PATH "/org/mpris/MediaPlayer2"
+
+#define ENGINE_IFACE "org.bansheeproject.Banshee.PlayerEngine"
+#define CONTROLLER_IFACE "org.bansheeproject.Banshee.PlaybackController"
+#define MPRIS_IFACE "org.mpris.MediaPlayer2.Playlists"
+
+static Eldbus_Signal_Handler *state_changed2;
+
+static Eina_Bool
+_timeout_application(void *data EINA_UNUSED)
+{
+ printf("\n## ecore_main_loop_quit()\n");
+ ecore_main_loop_quit();
+ return EINA_TRUE;
+}
+
+static void
+on_get_playlists(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ Eldbus_Message_Iter *array, *struct_entry;
+ const char *path, *name, *image;
+ int i = 0;
+
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+
+ if (!eldbus_message_arguments_get(msg, "a(oss)", &array))
+ {
+ fprintf(stderr, "Error: could not get entry contents\n");
+ return;
+ }
+ printf("on_get_playlists() \n\n");
+ while (eldbus_message_iter_get_and_next(array, 'r', &struct_entry))
+ {
+ if (!eldbus_message_iter_arguments_get(struct_entry, "oss", &path, &name, &image))
+ {
+ printf("error on eldbus_massage_iterator_arguments_get()");
+ return;
+ }
+ i++;
+ printf("%d - %s | %s | %s\n", i, path, name, image);
+ }
+ printf("end of on_get_playlists()\n\n");
+}
+
+static void
+iterate_dict(void *data EINA_UNUSED, const void *key, Eldbus_Message_Iter *var)
+{
+ const char *skey = key;
+
+ if (!strcmp(skey, "PlaylistCount"))
+ {
+ unsigned count;
+ if (!eldbus_message_iter_arguments_get(var, "u", &count))
+ printf("error2\n");
+ printf("PlaylistCount=%u\n", count);
+ }
+ else if (!strcmp(skey, "Orderings"))
+ {
+ Eldbus_Message_Iter *as;
+ const char *txt;
+ printf("- Orderings\n");
+ if (!eldbus_message_iter_arguments_get(var, "as", &as))
+ printf("error1\n");
+ while (eldbus_message_iter_get_and_next(as, 's', &txt))
+ printf("\t%s\n", txt);
+ }
+}
+
+static void
+playlist_get_all_cb(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ Eldbus_Message_Iter *array;
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+
+ if (eldbus_message_arguments_get(msg, "a{sv}", &array))
+ eldbus_message_iter_dict_iterate(array, "sv", iterate_dict, NULL);
+}
+
+static void
+on_introspect(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ const char *string;
+
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+
+ if (!eldbus_message_arguments_get(msg, "s", &string))
+ {
+ fprintf(stderr, "Error: could not get entry contents\n");
+ return;
+ }
+
+ printf("on_introspect() data=\n%s\n\n", string);
+}
+
+static void
+on_next_or_pause(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ const char *status = data;
+
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+
+ printf("%s\n", status);
+}
+
+static void
+on_state_changed(void *data EINA_UNUSED, const Eldbus_Message *msg)
+{
+ const char *status;
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+
+ if (!eldbus_message_arguments_get(msg, "s", &status))
+ {
+ fprintf(stderr, "Error: could not get entry contents\n");
+ return;
+ }
+
+ printf("on_state_changed = %s\n", status);
+}
+
+static void
+on_state_changed2(void *data EINA_UNUSED, const Eldbus_Message *msg)
+{
+ const char *status;
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+
+ if (!eldbus_message_arguments_get(msg, "s", &status))
+ {
+ fprintf(stderr, "Error: could not get entry contents\n");
+ return;
+ }
+
+ printf("on_state_changed2 = %s\n", status);
+ eldbus_signal_handler_unref(state_changed2);
+ state_changed2 = NULL;
+}
+
+static void
+on_banshee_startup(void *data EINA_UNUSED, const Eldbus_Message *msg)
+{
+ const char *bus, *older_id, *new_id;
+
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+ if (!eldbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
+ {
+ printf("Error getting arguments from NameOwnerChanged");
+ return;
+ }
+
+ printf("banshee started on id=%s\n", new_id);
+}
+
+static void
+on_name_owner_changed(void *data EINA_UNUSED, const Eldbus_Message *msg)
+{
+ const char *bus, *older_id, *new_id;
+
+ EINA_SAFETY_ON_TRUE_RETURN(eldbus_message_error_get(msg, NULL, NULL));
+ if (!eldbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
+ {
+ printf("Error getting arguments from NameOwnerChanged");
+ return;
+ }
+
+ printf("bus = %s older=%s new=%s\n\n", bus, older_id, new_id);
+}
+
+int
+main(void)
+{
+ Eldbus_Connection *conn;
+ Eldbus_Object *engine_obj, *controller_obj, *mpris_obj;
+ Eldbus_Proxy *engine, *controler, *playlists;
+ Eldbus_Signal_Handler *sh;
+
+ ecore_init();
+ eldbus_init();
+
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+
+ engine_obj = eldbus_object_get(conn, BUS, ENGINE_PATH);
+ controller_obj = eldbus_object_get(conn, BUS, CONTROLLER_PATH);
+ mpris_obj = eldbus_object_get(conn, BUS, MPRIS_PATH);
+
+ engine = eldbus_proxy_get(engine_obj, ENGINE_IFACE);
+ EINA_SAFETY_ON_NULL_GOTO(engine, end);
+ controler = eldbus_proxy_get(controller_obj, CONTROLLER_IFACE);
+ EINA_SAFETY_ON_NULL_GOTO(controler, end);
+ playlists = eldbus_proxy_get(mpris_obj, MPRIS_IFACE);
+ EINA_SAFETY_ON_NULL_GOTO(playlists, end);
+
+ eldbus_object_introspect(engine_obj, on_introspect, NULL);
+
+ eldbus_proxy_signal_handler_add(engine, "StateChanged", on_state_changed, NULL);
+ eldbus_proxy_call(engine, "Pause", on_next_or_pause, "Pause", -1, "");
+
+ eldbus_proxy_call(controler, "Next", on_next_or_pause, "Next", -1, "b", EINA_TRUE);
+
+ eldbus_proxy_property_get_all(playlists, playlist_get_all_cb, NULL);
+ eldbus_proxy_call(playlists, "GetPlaylists", on_get_playlists, NULL, -1,
+ "uusb", (unsigned)0, (unsigned)30, "asc", EINA_FALSE);
+
+ eldbus_signal_handler_add(conn, BUS, ENGINE_PATH, ENGINE_IFACE,
+ "StateChanged", on_state_changed, NULL);
+ state_changed2 = eldbus_signal_handler_add(conn, BUS, ENGINE_PATH, ENGINE_IFACE,
+ "StateChanged", on_state_changed2, NULL);
+
+ sh = eldbus_signal_handler_add(conn, ELDBUS_FDO_BUS, ELDBUS_FDO_PATH,
+ ELDBUS_FDO_INTERFACE, "NameOwnerChanged",
+ on_name_owner_changed, NULL);
+ eldbus_signal_handler_match_extra_set(sh, "arg0", BUS, NULL);
+
+ sh = eldbus_signal_handler_add(conn, ELDBUS_FDO_BUS, ELDBUS_FDO_PATH,
+ ELDBUS_FDO_INTERFACE, "NameOwnerChanged",
+ on_banshee_startup, NULL);
+ eldbus_signal_handler_match_extra_set(sh, "arg0", BUS, "arg1", "", NULL);
+
+ ecore_timer_add(50, _timeout_application, NULL);
+
+ ecore_main_loop_begin();
+
+end:
+ /**
+ * It's not necessary unref all objecs, proxys and signal handlers
+ * When a parent have ref = 0, it will unref all your childrens
+ * before free it self.
+ **/
+ eldbus_connection_unref(conn);
+
+ eldbus_shutdown();
+ ecore_shutdown();
+ return 0;
+}
diff --git a/src/examples/edbus/client.c b/src/examples/eldbus/client.c
index 61b3e24ec7..18a1fcdf3d 100644
--- a/src/examples/edbus/client.c
+++ b/src/examples/eldbus/client.c
@@ -1,7 +1,7 @@
//Compile with:
-// gcc -o client client.c `pkg-config --cflags --libs edbus2 ecore eina`
+// gcc -o client client.c `pkg-config --cflags --libs eldbus ecore eina`
-#include "EDBus.h"
+#include "Eldbus.h"
#include <Ecore.h>
#define BUS "org.Enlightenment"
@@ -13,16 +13,16 @@ static int _client_log_dom = -1;
#define ERR(...) EINA_LOG_DOM_ERR(_client_log_dom, __VA_ARGS__)
static void
-_on_alive(void *context EINA_UNUSED, const EDBus_Message *msg EINA_UNUSED)
+_on_alive(void *context EINA_UNUSED, const Eldbus_Message *msg EINA_UNUSED)
{
printf("Alive\n\n");
}
static void
-_on_hello(void *context EINA_UNUSED, const EDBus_Message *msg)
+_on_hello(void *context EINA_UNUSED, const Eldbus_Message *msg)
{
const char *txt;
- if (edbus_message_arguments_get(msg, "s", &txt))
+ if (eldbus_message_arguments_get(msg, "s", &txt))
printf("%s\n", txt);
}
@@ -59,18 +59,18 @@ test(void)
}
static void
-_on_send_bool(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_send_bool(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
Eina_Bool b;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "b", &b))
+ if (!eldbus_message_arguments_get(msg, "b", &b))
{
ERR("Could not get entry contents");
return;
@@ -86,18 +86,18 @@ _on_send_bool(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *p
}
static void
-_on_send_byte(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_send_byte(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
uint8_t y;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "y", &y))
+ if (!eldbus_message_arguments_get(msg, "y", &y))
{
ERR("Could not get entry contents");
return;
@@ -113,18 +113,18 @@ _on_send_byte(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *p
}
static void
-_on_send_uint32(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_send_uint32(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
unsigned int u;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "u", &u))
+ if (!eldbus_message_arguments_get(msg, "u", &u))
{
ERR("Could not get entry contents");
return;
@@ -140,18 +140,18 @@ _on_send_uint32(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
}
static void
-_on_send_int32(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_send_int32(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
int32_t i;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "i", &i))
+ if (!eldbus_message_arguments_get(msg, "i", &i))
{
ERR("Could not get entry contents");
return;
@@ -167,18 +167,18 @@ _on_send_int32(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *
}
static void
-_on_send_int16(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_send_int16(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
int16_t n;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "n", &n))
+ if (!eldbus_message_arguments_get(msg, "n", &n))
{
ERR("Could not get entry contents");
return;
@@ -194,18 +194,18 @@ _on_send_int16(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *
}
static void
-_on_send_double(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_send_double(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
double d;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "d", &d))
+ if (!eldbus_message_arguments_get(msg, "d", &d))
{
ERR("Could not get entry contents");
return;
@@ -221,18 +221,18 @@ _on_send_double(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
}
static void
-_on_send_string(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_send_string(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
char *s;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "s", &s))
+ if (!eldbus_message_arguments_get(msg, "s", &s))
{
ERR("Could not get entry contents");
return;
@@ -248,11 +248,11 @@ _on_send_string(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
}
static void
-_on_async_test(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_on_async_test(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
ERR("%s %s", errname, errmsg);
return;
@@ -277,9 +277,9 @@ finish(void *data EINA_UNUSED)
int
main(void)
{
- EDBus_Connection *conn;
- EDBus_Object *obj;
- EDBus_Proxy *proxy;
+ Eldbus_Connection *conn;
+ Eldbus_Object *obj;
+ Eldbus_Proxy *proxy;
eina_init();
_client_log_dom = eina_log_domain_register("client", EINA_COLOR_CYAN);
@@ -290,40 +290,40 @@ main(void)
}
ecore_init();
- edbus_init();
+ eldbus_init();
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
- obj = edbus_object_get(conn, BUS, PATH);
- proxy = edbus_proxy_get(obj, INTERFACE);
- edbus_proxy_signal_handler_add(proxy, "Alive", _on_alive, NULL);
- edbus_proxy_signal_handler_add(proxy, "Hello", _on_hello, NULL);
+ obj = eldbus_object_get(conn, BUS, PATH);
+ proxy = eldbus_proxy_get(obj, INTERFACE);
+ eldbus_proxy_signal_handler_add(proxy, "Alive", _on_alive, NULL);
+ eldbus_proxy_signal_handler_add(proxy, "Hello", _on_hello, NULL);
- edbus_proxy_call(proxy, "SendBool", _on_send_bool, NULL, -1, "b",
+ eldbus_proxy_call(proxy, "SendBool", _on_send_bool, NULL, -1, "b",
expected.b);
- edbus_proxy_call(proxy, "SendByte", _on_send_byte, NULL, -1, "y",
+ eldbus_proxy_call(proxy, "SendByte", _on_send_byte, NULL, -1, "y",
expected.y);
- edbus_proxy_call(proxy, "SendUint32", _on_send_uint32, NULL, -1, "u",
+ eldbus_proxy_call(proxy, "SendUint32", _on_send_uint32, NULL, -1, "u",
expected.u);
- edbus_proxy_call(proxy, "SendInt32", _on_send_int32, NULL, -1, "i",
+ eldbus_proxy_call(proxy, "SendInt32", _on_send_int32, NULL, -1, "i",
expected.i);
- edbus_proxy_call(proxy, "SendInt16", _on_send_int16, NULL, -1, "n",
+ eldbus_proxy_call(proxy, "SendInt16", _on_send_int16, NULL, -1, "n",
expected.n);
- edbus_proxy_call(proxy, "SendDouble", _on_send_double, NULL, -1, "d",
+ eldbus_proxy_call(proxy, "SendDouble", _on_send_double, NULL, -1, "d",
expected.d);
- edbus_proxy_call(proxy, "SendString", _on_send_string, NULL, -1, "s",
+ eldbus_proxy_call(proxy, "SendString", _on_send_string, NULL, -1, "s",
expected.s);
- edbus_proxy_call(proxy, "AsyncTest", _on_async_test, NULL, -1, "");
+ eldbus_proxy_call(proxy, "AsyncTest", _on_async_test, NULL, -1, "");
- edbus_name_owner_changed_callback_add(conn, BUS, on_name_owner_changed,
+ eldbus_name_owner_changed_callback_add(conn, BUS, on_name_owner_changed,
conn, EINA_TRUE);
ecore_timer_add(30, finish, NULL);
ecore_main_loop_begin();
- edbus_connection_unref(conn);
+ eldbus_connection_unref(conn);
- edbus_shutdown();
+ eldbus_shutdown();
ecore_shutdown();
eina_log_domain_unregister(_client_log_dom);
diff --git a/src/examples/edbus/complex-types-client-eina-value.c b/src/examples/eldbus/complex-types-client-eina-value.c
index 91b3ecca46..3d290ae194 100644
--- a/src/examples/edbus/complex-types-client-eina-value.c
+++ b/src/examples/eldbus/complex-types-client-eina-value.c
@@ -1,7 +1,7 @@
//Compile with:
-// gcc -o complex-types-client-eina-value complex-types-client-eina-value.c `pkg-config --cflags --libs edbus2 ecore eina`
+// gcc -o complex-types-client-eina-value complex-types-client-eina-value.c `pkg-config --cflags --libs eldbus ecore eina`
-#include "EDBus.h"
+#include "Eldbus.h"
#include <Ecore.h>
#define BUS "com.profusion"
@@ -36,7 +36,7 @@ _type_offset(unsigned base, unsigned size)
}
static void
-_fill_receive_array_of_string_int_with_size(EDBus_Message *msg, int size, const char *array[])
+_fill_receive_array_of_string_int_with_size(Eldbus_Message *msg, int size, const char *array[])
{
Eina_Value *value_struct, *value_array;
int i;
@@ -86,27 +86,27 @@ _fill_receive_array_of_string_int_with_size(EDBus_Message *msg, int size, const
}
eina_value_struct_value_set(value_struct, "array", value_array);
- edbus_message_from_eina_value("ia(si)", msg, value_struct);
+ eldbus_message_from_eina_value("ia(si)", msg, value_struct);
eina_value_free(value_struct);
eina_value_free(value_array);
}
static void
-on_send_array(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_send_array(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
Eina_Value *v, array;
const char *txt;
unsigned i;
printf("2 - on_send_array()\n");
- if (edbus_message_error_get(msg, NULL, NULL))
+ if (eldbus_message_error_get(msg, NULL, NULL))
{
printf("Message error\n\n");
return;
}
- v = edbus_message_to_eina_value(msg);
+ v = eldbus_message_to_eina_value(msg);
eina_value_struct_value_get(v, "arg0", &array);
for (i = 0; i < eina_value_array_count(&array); i++)
{
@@ -119,31 +119,31 @@ on_send_array(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *p
}
static void
-on_receive_array_with_size(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_receive_array_with_size(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname;
const char *errmsg;
printf("1 - on_receive_array_with_size()\n");
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
fprintf(stderr, "Error: %s %s\n", errname, errmsg);
}
}
static void
-on_plus_one(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_plus_one(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
Eina_Value *v;
int num2;
- if (edbus_message_error_get(msg, NULL, NULL))
+ if (eldbus_message_error_get(msg, NULL, NULL))
{
printf("Message error\n\n");
return;
}
- v = edbus_message_to_eina_value(msg);
+ v = eldbus_message_to_eina_value(msg);
eina_value_struct_get(v, "arg0", &num2);
printf("3 - on_plus_one() %d\n", num2);
@@ -151,19 +151,19 @@ on_plus_one(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pen
}
static void
-receive_variant_cb(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+receive_variant_cb(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
Eina_Value *v, variant, array;
unsigned i;
printf("4 - receive a variant with an array of strings\n");
- if (edbus_message_error_get(msg, NULL, NULL))
+ if (eldbus_message_error_get(msg, NULL, NULL))
{
printf("Message error\n\n");
return;
}
- v = edbus_message_to_eina_value(msg);
+ v = eldbus_message_to_eina_value(msg);
eina_value_struct_value_get(v, "arg0", &variant);
eina_value_struct_value_get(&variant, "arg0", &array);
@@ -180,17 +180,17 @@ receive_variant_cb(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pendi
}
static void
-_property_removed(void *data EINA_UNUSED, EDBus_Proxy *proxy EINA_UNUSED, void *event_info)
+_property_removed(void *data EINA_UNUSED, Eldbus_Proxy *proxy EINA_UNUSED, void *event_info)
{
- EDBus_Proxy_Event_Property_Removed *event = event_info;
+ Eldbus_Proxy_Event_Property_Removed *event = event_info;
printf("\nproperty removed: %s", event->name);
}
static void
-_property_changed(void *data EINA_UNUSED, EDBus_Proxy *proxy EINA_UNUSED, void *event_info)
+_property_changed(void *data EINA_UNUSED, Eldbus_Proxy *proxy EINA_UNUSED, void *event_info)
{
- EDBus_Proxy_Event_Property_Changed *event = event_info;
+ Eldbus_Proxy_Event_Property_Changed *event = event_info;
const char *name;
const Eina_Value *value;
printf("\nproperty changed\n");
@@ -223,26 +223,26 @@ _property_changed(void *data EINA_UNUSED, EDBus_Proxy *proxy EINA_UNUSED, void *
static Eina_Bool
_read_cache(void *data)
{
- EDBus_Proxy *proxy = data;
+ Eldbus_Proxy *proxy = data;
const char *txt;
int num;
Eina_Value *v;
- v = edbus_proxy_property_local_get(proxy, "text");
+ v = eldbus_proxy_property_local_get(proxy, "text");
if (v)
{
eina_value_get(v, &txt);
printf("Read cache: [txt] = %s\n", txt);
}
- v = edbus_proxy_property_local_get(proxy, "int32");
+ v = eldbus_proxy_property_local_get(proxy, "int32");
if (v)
{
eina_value_get(v, &num);
printf("Read cache: [int32] = %d\n", num);
}
- v = edbus_proxy_property_local_get(proxy, "st");
+ v = eldbus_proxy_property_local_get(proxy, "st");
if (v)
{
eina_value_struct_get(v, "arg0", &txt);
@@ -255,7 +255,7 @@ _read_cache(void *data)
}
static void
-_fill_plus_one(EDBus_Message *msg, int num)
+_fill_plus_one(Eldbus_Message *msg, int num)
{
Eina_Value *v;
Eina_Value_Struct_Member main_members[] = {
@@ -271,7 +271,7 @@ _fill_plus_one(EDBus_Message *msg, int num)
v = eina_value_struct_new(&desc_struct);
eina_value_struct_set(v, "num", num);
- edbus_message_from_eina_value("i", msg, v);
+ eldbus_message_from_eina_value("i", msg, v);
eina_value_free(v);
}
@@ -279,46 +279,46 @@ _fill_plus_one(EDBus_Message *msg, int num)
int
main(void)
{
- EDBus_Connection *conn;
- EDBus_Object *obj;
- EDBus_Proxy *proxy;
- EDBus_Message *msg;
+ Eldbus_Connection *conn;
+ Eldbus_Object *obj;
+ Eldbus_Proxy *proxy;
+ Eldbus_Message *msg;
ecore_init();
- edbus_init();
+ eldbus_init();
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
- obj = edbus_object_get(conn, BUS, PATH);
- proxy = edbus_proxy_get(obj, IFACE);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+ obj = eldbus_object_get(conn, BUS, PATH);
+ proxy = eldbus_proxy_get(obj, IFACE);
- msg = edbus_proxy_method_call_new(proxy, "ReceiveArrayOfStringIntWithSize");
+ msg = eldbus_proxy_method_call_new(proxy, "ReceiveArrayOfStringIntWithSize");
_fill_receive_array_of_string_int_with_size(msg, size_of_array, array_string);
- edbus_proxy_send(proxy, msg, on_receive_array_with_size, NULL, -1);
+ eldbus_proxy_send(proxy, msg, on_receive_array_with_size, NULL, -1);
- edbus_proxy_call(proxy, "SendArray", on_send_array, NULL, -1 , "");
+ eldbus_proxy_call(proxy, "SendArray", on_send_array, NULL, -1 , "");
- msg = edbus_proxy_method_call_new(proxy, "PlusOne");
+ msg = eldbus_proxy_method_call_new(proxy, "PlusOne");
_fill_plus_one(msg, 14);
- edbus_proxy_send(proxy, msg, on_plus_one, NULL, -1);
+ eldbus_proxy_send(proxy, msg, on_plus_one, NULL, -1);
- edbus_proxy_event_callback_add(proxy,
- EDBUS_PROXY_EVENT_PROPERTY_CHANGED,
+ eldbus_proxy_event_callback_add(proxy,
+ ELDBUS_PROXY_EVENT_PROPERTY_CHANGED,
_property_changed, NULL);
- edbus_proxy_event_callback_add(proxy, EDBUS_PROXY_EVENT_PROPERTY_REMOVED,
+ eldbus_proxy_event_callback_add(proxy, ELDBUS_PROXY_EVENT_PROPERTY_REMOVED,
_property_removed, NULL);
- edbus_proxy_properties_monitor(proxy, EINA_TRUE);
+ eldbus_proxy_properties_monitor(proxy, EINA_TRUE);
ecore_timer_add(10, _read_cache, proxy);
- edbus_proxy_call(proxy, "ReceiveVariantData", receive_variant_cb, NULL, -1, "");
+ eldbus_proxy_call(proxy, "ReceiveVariantData", receive_variant_cb, NULL, -1, "");
ecore_main_loop_begin();
- edbus_proxy_event_callback_del(proxy, EDBUS_PROXY_EVENT_PROPERTY_CHANGED,
+ eldbus_proxy_event_callback_del(proxy, ELDBUS_PROXY_EVENT_PROPERTY_CHANGED,
_property_changed, NULL);
- edbus_connection_unref(conn);
+ eldbus_connection_unref(conn);
- edbus_shutdown();
+ eldbus_shutdown();
ecore_shutdown();
return 0;
}
diff --git a/src/examples/eldbus/complex-types-server.c b/src/examples/eldbus/complex-types-server.c
new file mode 100644
index 0000000000..125fef81c0
--- /dev/null
+++ b/src/examples/eldbus/complex-types-server.c
@@ -0,0 +1,393 @@
+//Compile with:
+// gcc -o complex-types-server complex-types-server.c `pkg-config --cflags --libs eldbus ecore`
+
+#include "Eldbus.h"
+#include <Ecore.h>
+
+#define BUS "com.profusion"
+#define PATH "/com/profusion/Test"
+#define IFACE "com.profusion.Test"
+
+static char *resp2;
+/* dummy, incremented each time DBus.Properties.Get() is called */
+static int int32 = 35;
+static Ecore_Timer *timer;
+
+static Eldbus_Message *
+_receive_array(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eldbus_Message_Iter *array;
+ const char *txt;
+
+ printf("- receiveArray\n");
+ if (!eldbus_message_arguments_get(msg, "as", &array))
+ {
+ printf("Error on eldbus_message_arguments_get()\n");
+ return reply;
+ }
+
+ while (eldbus_message_iter_get_and_next(array, 's', &txt))
+ printf("%s\n", txt);
+ printf("}\n\n");
+
+ return reply;
+}
+
+static Eldbus_Message *
+_receive_array_of_string_int_with_size(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eldbus_Message_Iter *array, *struct_si;
+ int size, i = 0;
+
+ printf("- receiveArrayOfStringIntWithSize\n{\n");
+ if (!eldbus_message_arguments_get(msg, "ia(si)", &size, &array))
+ {
+ printf("Error on eldbus_message_arguments_get()\n");
+ return reply;
+ }
+
+ while (eldbus_message_iter_get_and_next(array, 'r', &struct_si))
+ {
+ const char *txt;
+ int num;
+ if (!eldbus_message_iter_arguments_get(struct_si, "si", &txt, &num))
+ {
+ printf("Error on eldbus_message_arguments_get()\n");
+ return reply;
+ }
+ printf("%s | %d\n", txt, num);
+ i++;
+ }
+ printf("size in msg %d | size read %d\n", size, i);
+ printf("}\n\n");
+
+ return reply;
+}
+
+static Eldbus_Message *
+_receive_variant(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eldbus_Message_Iter *var, *array, *main_iter;
+
+ main_iter = eldbus_message_iter_get(reply);
+ var = eldbus_message_iter_container_new(main_iter, 'v', "as");
+ eldbus_message_iter_arguments_append(var, "as", &array);
+
+ eldbus_message_iter_arguments_append(array, "s", "item1");
+ eldbus_message_iter_arguments_append(array, "s", "item2");
+ eldbus_message_iter_arguments_append(array, "s", "item3");
+
+ eldbus_message_iter_container_close(var, array);
+ eldbus_message_iter_container_close(main_iter, var);
+
+ return reply;
+}
+
+static Eldbus_Message *
+_send_variant(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eldbus_Message_Iter *variant;
+ char *type;
+
+ printf("- sendVariantData\n{\n");
+ if (!eldbus_message_arguments_get(msg, "v", &variant))
+ {
+ printf("Error on eldbus_message_arguments_get()\n");
+ return reply;
+ }
+
+ type = eldbus_message_iter_signature_get(variant);
+ if (type[1])
+ {
+ printf("It is a complex type, not handle yet.\n");
+ free(type);
+ return reply;
+ }
+
+ switch (type[0])
+ {
+ case 's':
+ case 'o':
+ {
+ char *txt;
+ eldbus_message_iter_arguments_get(variant, type, &txt);
+ printf("type = %c value = %s\n", type[0], txt);
+ break;
+ }
+ case 'i':
+ {
+ int num;
+ eldbus_message_iter_arguments_get(variant, type, &num);
+ printf("type = %c value = %d\n", type[0], num);
+ break;
+ }
+ default:
+ {
+ printf("Unhandled type\n");
+ }
+ }
+
+ printf("}\n\n");
+
+ free(type);
+ return reply;
+}
+
+static Eldbus_Message *
+_send_array_int(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eldbus_Message_Iter *iter, *array;
+ int i;
+
+ printf("- sendArrayInt\n\n");
+
+ iter = eldbus_message_iter_get(reply);
+ array = eldbus_message_iter_container_new(iter, 'a', "i");
+ for (i = 0; i < 5; i++)
+ eldbus_message_iter_arguments_append(array, "i", i);
+ eldbus_message_iter_container_close(iter, array);
+
+ return reply;
+}
+
+static Eldbus_Message *
+_send_array(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eldbus_Message_Iter *iter, *array;
+ const char *array_string[5] = {"qqqq", "wwwww", "eeeeee", "rrrrr", "ttttt"};
+ int i;
+
+ printf("sendArray\n\n");
+
+ iter = eldbus_message_iter_get(reply);
+ array = eldbus_message_iter_container_new(iter, 'a', "s");
+ for (i = 0; i < 5; i++)
+ eldbus_message_iter_arguments_append(array, "s", array_string[i]);
+ eldbus_message_iter_container_close(iter, array);
+
+ return reply;
+}
+
+static Eldbus_Message *
+_plus_one(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ int num;
+
+ printf("- plusOne\n\n");
+ if (!eldbus_message_arguments_get(msg, "i", &num))
+ {
+ printf("Error on eldbus_message_arguments_get()\n");
+ return reply;
+ }
+ num++;
+ eldbus_message_arguments_append(reply, "i", num);
+
+ return reply;
+}
+
+static Eldbus_Message *
+_double_container(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message_Iter *array1, *array2, *structure;
+ int num1, num2;
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+
+ if (!eldbus_message_arguments_get(msg, "a(ii)a(ii)", &array1, &array2))
+ {
+ printf("Error on eldbus_message_arguments_get()\n");
+ return NULL;
+ }
+
+ printf("DoubleCountainer\n{\nArray1:\n");
+ while (eldbus_message_iter_get_and_next(array1, 'r', &structure))
+ {
+ eldbus_message_iter_arguments_get(structure, "ii", &num1, &num2);
+ printf("1 %d - 2 %d\n", num1, num2);
+ }
+
+ printf("Array2:\n");
+ while (eldbus_message_iter_get_and_next(array2, 'r', &structure))
+ {
+ eldbus_message_iter_arguments_get(structure, "ii", &num1, &num2);
+ printf("1 %d - 2 %d\n", num1, num2);
+ }
+ printf("}\n\n");
+ return reply;
+}
+
+static Eina_Bool
+_properties_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const char *propname, Eldbus_Message_Iter *iter, const Eldbus_Message *request_msg EINA_UNUSED, Eldbus_Message **error EINA_UNUSED)
+{
+ printf("Properties_get - %s\n", propname);
+ if (!strcmp(propname, "Resp2"))
+ eldbus_message_iter_basic_append(iter, 's', resp2);
+ else if (!strcmp(propname, "text"))
+ eldbus_message_iter_basic_append(iter, 's', "lalalala");
+ else if (!strcmp(propname, "int32"))
+ {
+ eldbus_message_iter_arguments_append(iter, "i", int32);
+ int32++;
+ }
+ else if (!strcmp(propname, "st"))
+ {
+ Eldbus_Message_Iter *st;
+ eldbus_message_iter_arguments_append(iter, "(ss)", &st);
+ eldbus_message_iter_arguments_append(st, "ss", "string1", "string2");
+ eldbus_message_iter_container_close(iter, st);
+ }
+ return EINA_TRUE;
+}
+
+static Eldbus_Message *
+_properties_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const char *propname, Eldbus_Message_Iter *iter, const Eldbus_Message *msg)
+{
+ char *type;
+
+ type = eldbus_message_iter_signature_get(iter);
+
+ if (!strcmp(propname, "int32"))
+ {
+ int num;
+ if (type[0] != 'i')
+ goto invalid_signature;
+ eldbus_message_iter_arguments_get(iter, "i", &num);
+ printf("int32 was set to: %d, previously was: %d\n", num, int32);
+ int32 = num;
+ }
+ else if (!strcmp(propname, "Resp2"))
+ {
+ const char *txt;
+ if (type[0] != 's')
+ goto invalid_signature;
+ eldbus_message_iter_arguments_get(iter, "s", &txt);
+ printf("Resp2 was set to: %s, previously was: %s\n", txt, resp2);
+ free(resp2);
+ resp2 = strdup(txt);
+ }
+ free(type);
+ return eldbus_message_method_return_new(msg);
+
+invalid_signature:
+ free(type);
+ return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidSignature",
+ "Invalid type.");
+}
+
+static const Eldbus_Method methods[] = {
+ {
+ "ReceiveArray", ELDBUS_ARGS({"as", "array_of_strings"}),
+ NULL, _receive_array
+ },
+ {
+ "ReceiveArrayOfStringIntWithSize",
+ ELDBUS_ARGS({"i", "size_of_array"}, {"a(si)", "array"}),
+ NULL, _receive_array_of_string_int_with_size, 0
+ },
+ {
+ "SendVariantData", ELDBUS_ARGS({"v", "variant_data"}),
+ NULL, _send_variant
+ },
+ {
+ "ReceiveVariantData", NULL, ELDBUS_ARGS({"v", "variant_data"}),
+ _receive_variant
+ },
+ {
+ "SendArrayInt", NULL,
+ ELDBUS_ARGS({"ai", "array_of_int"}), _send_array_int, 0
+ },
+ {
+ "SendArray", NULL, ELDBUS_ARGS({"as", "array_string"}),
+ _send_array
+ },
+ {
+ "PlusOne", ELDBUS_ARGS({"i", "integer"}),
+ ELDBUS_ARGS({"i", "integer_plus_one"}), _plus_one
+ },
+ {
+ "DoubleContainner", ELDBUS_ARGS({"a(ii)", "array1"}, {"a(ii)", "array2"}),
+ NULL, _double_container
+ },
+ { }
+};
+
+static const Eldbus_Property properties[] = {
+ { "Resp2", "s", NULL, _properties_set },
+ { "text", "s" },
+ { "int32", "i", NULL, _properties_set },
+ { "st", "(ss)" },
+ { }
+};
+
+static const Eldbus_Service_Interface_Desc iface_desc = {
+ IFACE, methods, NULL, properties, _properties_get
+};
+
+static Eina_Bool _emit_changed(void *data)
+{
+ Eldbus_Service_Interface *iface = data;
+ eldbus_service_property_changed(iface, "int32");
+ eldbus_service_property_invalidate_set(iface, "Resp2", EINA_TRUE);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static void
+on_name_request(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ unsigned int reply;
+ Eldbus_Service_Interface *iface = data;
+
+ if (eldbus_message_error_get(msg, NULL, NULL))
+ {
+ printf("error on on_name_request\n");
+ return;
+ }
+
+ if (!eldbus_message_arguments_get(msg, "u", &reply))
+ {
+ printf("error geting arguments on on_name_request\n");
+ return;
+ }
+
+ if (reply != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
+ {
+ printf("error name already in use\n");
+ return;
+ }
+
+ timer = ecore_timer_add(3, _emit_changed, iface);
+}
+
+int
+main(void)
+{
+ Eldbus_Connection *conn;
+ Eldbus_Service_Interface *iface;
+
+ ecore_init();
+ eldbus_init();
+
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+
+ resp2 = malloc(sizeof(char) * 5);
+ strcpy(resp2, "test");
+ iface = eldbus_service_interface_register(conn, PATH, &iface_desc);
+ eldbus_name_request(conn, BUS, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
+ on_name_request, iface);
+
+ ecore_main_loop_begin();
+
+ free(resp2);
+ ecore_timer_del(timer);
+ eldbus_connection_unref(conn);
+
+ eldbus_shutdown();
+ ecore_shutdown();
+ return 0;
+}
diff --git a/src/examples/eldbus/complex-types.c b/src/examples/eldbus/complex-types.c
new file mode 100644
index 0000000000..fc0063af43
--- /dev/null
+++ b/src/examples/eldbus/complex-types.c
@@ -0,0 +1,284 @@
+//Compile with:
+// gcc -o complex-types complex-types.c `pkg-config --cflags --libs eldbus ecore`
+
+#include "Eldbus.h"
+#include <Ecore.h>
+
+#define BUS "com.profusion"
+#define PATH "/com/profusion/Test"
+#define IFACE "com.profusion.Test"
+
+Eldbus_Connection *conn;
+
+static Eina_Bool
+_timer1_cb(void *data EINA_UNUSED)
+{
+ printf("\nFishing...\n");
+ ecore_main_loop_quit();
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+on_plus_one(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ int num2 = 0;
+
+ if (eldbus_message_error_get(msg, NULL, NULL))
+ {
+ printf("Message error\n\n");
+ return;
+ }
+ if (!eldbus_message_arguments_get(msg, "i", &num2))
+ {
+ printf("Error getting arguments.");
+ return;
+ }
+
+ printf("on_plus_one() %d\n", num2);
+}
+
+static void
+set_property_resp2(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ const char *errname;
+ const char *errmsg;
+
+ printf("set_property_resp2()\n");
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
+ {
+ printf("Message error %s - %s\n\n", errname, errmsg);
+ return;
+ }
+}
+
+static void
+get_property_resp2(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ Eldbus_Proxy *proxy = data;
+ Eldbus_Message_Iter *variant = NULL;
+ char *type;
+ char *resp2;
+ const char *errname;
+ const char *errmsg;
+
+ printf("get_property_resp2()\n");
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
+ {
+ printf("Message error %s - %s\n\n", errname, errmsg);
+ return;
+ }
+ if (!eldbus_message_arguments_get(msg, "v", &variant))
+ {
+ printf("Error getting arguments.");
+ return;
+ }
+
+ type = eldbus_message_iter_signature_get(variant);
+ if (type[1])
+ {
+ printf("It is a complex type, not handle yet.\n\n");
+ return;
+ }
+ if (type[0] != 's')
+ {
+ printf("Expected type is string.\n\n");
+ return;
+ }
+ if (!eldbus_message_iter_arguments_get(variant, "s", &resp2))
+ {
+ printf("error in eldbus_message_iter_arguments_get()\n\n");
+ return;
+ }
+ printf("resp2=%s\n", resp2);
+ free(type);
+
+ eldbus_proxy_property_set(proxy, "Resp2", "s", &"lalala", set_property_resp2, NULL);
+ eldbus_proxy_property_set(proxy, "int32", "i", (void*)(intptr_t)99, set_property_resp2, NULL);
+}
+
+static void
+on_send_array_int(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ Eldbus_Message_Iter *array = NULL;
+ int num;
+
+ printf("on_send_array_int()\n");
+ if (eldbus_message_error_get(msg, NULL, NULL))
+ {
+ printf("Message error\n\n");
+ return;
+ }
+ if (!eldbus_message_arguments_get(msg, "ai", &array))
+ {
+ printf("Error getting arguments.");
+ return;
+ }
+
+ while (eldbus_message_iter_get_and_next(array, 'i', &num))
+ {
+ printf("%d\n", num);
+ }
+}
+
+static void
+on_send_array(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ Eldbus_Message_Iter *array = NULL;
+ char *txt = NULL;
+ char *string[10];
+ int i = 0;
+ int z;
+
+ printf("on_send_array()\n");
+ if (eldbus_message_error_get(msg, NULL, NULL))
+ {
+ printf("Message error\n\n");
+ return;
+ }
+ if (!eldbus_message_arguments_get(msg, "as", &array))
+ {
+ printf("Error getting arguments.");
+ return;
+ }
+
+ while (eldbus_message_iter_get_and_next(array, 's', &txt))
+ {
+ string[i] = txt;
+ i++;
+ }
+
+ for (z = 0; z < i; z++)
+ printf("string = %s\n", string[z]);
+}
+
+static void
+on_receive_array_with_size(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ const char *errname;
+ const char *errmsg;
+
+ printf("on_receive_array_with_size()\n");
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
+ {
+ fprintf(stderr, "Error: %s %s\n", errname, errmsg);
+ }
+}
+
+static void
+on_send_variant(void *data EINA_UNUSED, const Eldbus_Message *msg EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED)
+{
+ printf("on_send_variant()\n\n");
+}
+
+static void
+on_receive_array(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ const char *errname;
+ const char *errmsg;
+
+ printf("on_receive_array()\n");
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
+ {
+ fprintf(stderr, "Error: %s %s\n", errname, errmsg);
+ }
+}
+
+int
+main(void)
+{
+ Eldbus_Object *test2_obj;
+ Eldbus_Proxy *test2_proxy;
+ Eldbus_Pending *pending;
+ Eldbus_Message_Iter *iter, *array_of_string, *variant;
+ Eldbus_Message_Iter *array_itr, *structure;
+ Eldbus_Message *msg;
+ int size_of_array = 5;
+ const char *array[5] = { "aaaa", "bbbb", "cccc", "dddd", "eeee" };
+ int i;
+ int plus_one = 24;
+
+ ecore_init();
+ eldbus_init();
+
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+
+ test2_obj = eldbus_object_get(conn, BUS, PATH);
+ test2_proxy = eldbus_proxy_get(test2_obj, IFACE);
+
+ msg = eldbus_proxy_method_call_new(test2_proxy, "ReceiveArray");
+ iter = eldbus_message_iter_get(msg);
+ array_of_string = eldbus_message_iter_container_new(iter, 'a',"s");
+ if (!array_of_string) printf("array_of_string == NULL\n\n");
+ for (i = 0; i < 5; i++)
+ eldbus_message_iter_basic_append(array_of_string, 's', array[i]);
+ eldbus_message_iter_container_close(iter, array_of_string);
+ pending = eldbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1);
+ if (!pending) printf("Error in eldbus_proxy_send()\n\n");
+
+ msg = eldbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize");
+ iter = eldbus_message_iter_get(msg);
+ if (!eldbus_message_iter_arguments_append(iter, "ia(si)", size_of_array, &array_of_string))
+ printf("error on eldbus_massage_iterator_arguments_set()\n\n");
+ for (i = 0; i < size_of_array; i++)
+ {
+ Eldbus_Message_Iter *struct_of_si;
+ eldbus_message_iter_arguments_append(array_of_string, "(si)", &struct_of_si);
+ eldbus_message_iter_arguments_append(struct_of_si, "si", array[i], i);
+ eldbus_message_iter_container_close(array_of_string, struct_of_si);
+ }
+ eldbus_message_iter_container_close(iter, array_of_string);
+ pending = eldbus_proxy_send(test2_proxy, msg, on_receive_array_with_size, NULL, -1);
+
+ msg = eldbus_proxy_method_call_new(test2_proxy, "SendVariantData");
+ iter = eldbus_message_iter_get(msg);
+ variant = eldbus_message_iter_container_new(iter, 'v', "s");
+ eldbus_message_iter_basic_append(variant, 's', "test");
+ eldbus_message_iter_container_close(iter, variant);
+ pending = eldbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1);
+
+ msg = eldbus_proxy_method_call_new(test2_proxy, "DoubleContainner");
+ iter = eldbus_message_iter_get(msg);
+ /**
+ * eldbus_message_iterator_arguments_set(itr, "a(ii)a(ii)", &array_itr, &array_itr2);
+ * this will cause a error, we could not open another container until
+ * we close the first one
+ */
+ eldbus_message_iter_arguments_append(iter, "a(ii)", &array_itr);
+ for (i = 0; i < 5; i++)
+ {
+ eldbus_message_iter_arguments_append(array_itr, "(ii)", &structure);
+ eldbus_message_iter_arguments_append(structure, "ii", i, i*i);
+ eldbus_message_iter_container_close(array_itr, structure);
+ }
+ eldbus_message_iter_container_close(iter, array_itr);
+ eldbus_message_iter_arguments_append(iter, "a(ii)", &array_itr);
+ for (i = 0; i < 7; i++)
+ {
+ eldbus_message_iter_arguments_append(array_itr, "(ii)", &structure);
+ eldbus_message_iter_arguments_append(structure, "ii", i, i*i*i);
+ eldbus_message_iter_container_close(array_itr, structure);
+ }
+ eldbus_message_iter_container_close(iter, array_itr);
+ eldbus_proxy_send(test2_proxy, msg, NULL, NULL, -1);
+
+ pending = eldbus_proxy_call(test2_proxy, "SendArrayInt", on_send_array_int, NULL,
+ -1 , "");
+
+ pending = eldbus_proxy_call(test2_proxy, "SendArray", on_send_array, NULL,
+ -1 , "");
+
+ pending = eldbus_proxy_call(test2_proxy, "PlusOne", on_plus_one, NULL,
+ -1 , "i", plus_one);
+
+ pending = eldbus_proxy_property_get(test2_proxy, "Resp2", get_property_resp2, test2_proxy);
+
+ ecore_timer_add(10, _timer1_cb, NULL);
+
+ ecore_main_loop_begin();
+
+ eldbus_connection_unref(conn);
+
+ eldbus_shutdown();
+ ecore_shutdown();
+ return 0;
+}
diff --git a/src/examples/edbus/connman-list-services.c b/src/examples/eldbus/connman-list-services.c
index 7bd81c2e5f..2e980975a1 100644
--- a/src/examples/edbus/connman-list-services.c
+++ b/src/examples/eldbus/connman-list-services.c
@@ -1,33 +1,33 @@
//Compile with:
-// gcc -o connman-list-services connman-list-services.c `pkg-config --cflags --libs edbus2 ecore`
+// gcc -o connman-list-services connman-list-services.c `pkg-config --cflags --libs eldbus ecore`
-#include "EDBus.h"
+#include "Eldbus.h"
#include <Ecore.h>
static void
-on_services_get(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_services_get(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
- EDBus_Message_Iter *array, *entry;
+ Eldbus_Message_Iter *array, *entry;
const char *errname, *errmsg;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
fprintf(stderr, "Error: %s %s\n", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "a(oa{sv})", &array))
+ if (!eldbus_message_arguments_get(msg, "a(oa{sv})", &array))
{
fprintf(stderr, "Error: could not get array\n");
return;
}
- while (edbus_message_iter_get_and_next(array, 'r', &entry))
+ while (eldbus_message_iter_get_and_next(array, 'r', &entry))
{
- EDBus_Message_Iter *properties, *dict_entry;
+ Eldbus_Message_Iter *properties, *dict_entry;
const char *path;
- if (!edbus_message_iter_arguments_get(entry, "oa{sv}", &path, &properties))
+ if (!eldbus_message_iter_arguments_get(entry, "oa{sv}", &path, &properties))
{
fprintf(stderr, "Error: could not get entry contents\n");
return;
@@ -35,12 +35,12 @@ on_services_get(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
printf("service: %s\n", path);
- while (edbus_message_iter_get_and_next(properties, 'e', &dict_entry))
+ while (eldbus_message_iter_get_and_next(properties, 'e', &dict_entry))
{
- EDBus_Message_Iter *variant;
+ Eldbus_Message_Iter *variant;
const char *key;
- if (!edbus_message_iter_arguments_get(dict_entry, "sv", &key,
+ if (!eldbus_message_iter_arguments_get(dict_entry, "sv", &key,
&variant))
{
fprintf(stderr,
@@ -49,7 +49,7 @@ on_services_get(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
}
printf("\t%s: type %s\n", key,
- edbus_message_iter_signature_get(variant));
+ eldbus_message_iter_signature_get(variant));
/* TODO: get the value from variant */
}
@@ -59,36 +59,36 @@ on_services_get(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
int
main(void)
{
- EDBus_Connection *conn;
- EDBus_Object *obj;
- EDBus_Proxy *manager;
- EDBus_Pending *pending;
+ Eldbus_Connection *conn;
+ Eldbus_Object *obj;
+ Eldbus_Proxy *manager;
+ Eldbus_Pending *pending;
ecore_init();
- edbus_init();
+ eldbus_init();
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
if (!conn)
{
fprintf(stderr, "Error: could not get system bus\n");
return EXIT_FAILURE;
}
- obj = edbus_object_get(conn, "net.connman", "/");
+ obj = eldbus_object_get(conn, "net.connman", "/");
if (!obj)
{
fprintf(stderr, "Error: could not get object\n");
return EXIT_FAILURE;
}
- manager = edbus_proxy_get(obj, "net.connman.Manager");
+ manager = eldbus_proxy_get(obj, "net.connman.Manager");
if (!manager)
{
fprintf(stderr, "Error: could not get proxy\n");
return EXIT_FAILURE;
}
- pending = edbus_proxy_call(manager, "GetServices", on_services_get, NULL,
+ pending = eldbus_proxy_call(manager, "GetServices", on_services_get, NULL,
-1, "");
if (!pending)
@@ -99,11 +99,11 @@ main(void)
ecore_main_loop_begin();
- edbus_proxy_unref(manager);
- edbus_object_unref(obj);
- edbus_connection_unref(conn);
+ eldbus_proxy_unref(manager);
+ eldbus_object_unref(obj);
+ eldbus_connection_unref(conn);
- edbus_shutdown();
+ eldbus_shutdown();
ecore_shutdown();
return 0;
}
diff --git a/src/examples/edbus/ofono-dial.c b/src/examples/eldbus/ofono-dial.c
index 84729db673..a672102a16 100644
--- a/src/examples/edbus/ofono-dial.c
+++ b/src/examples/eldbus/ofono-dial.c
@@ -1,22 +1,22 @@
//Compile with:
-// gcc -o ofono-dial ofono-dial.c `pkg-config --cflags --libs edbus2 ecore`
+// gcc -o ofono-dial ofono-dial.c `pkg-config --cflags --libs eldbus ecore`
-#include "EDBus.h"
+#include "Eldbus.h"
#include <Ecore.h>
static void
-on_dial(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_dial(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
const char *call_path;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
fprintf(stderr, "Error: %s %s\n", errname, errmsg);
return;
}
- if (!edbus_message_arguments_get(msg, "o", &call_path))
+ if (!eldbus_message_arguments_get(msg, "o", &call_path))
{
fprintf(stderr, "Error: could not get call path\n");
return;
@@ -28,10 +28,10 @@ on_dial(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending
int
main(int argc, char *argv[])
{
- EDBus_Connection *conn;
- EDBus_Object *obj;
- EDBus_Proxy *manager;
- EDBus_Pending *pending;
+ Eldbus_Connection *conn;
+ Eldbus_Object *obj;
+ Eldbus_Proxy *manager;
+ Eldbus_Pending *pending;
const char *number, *hide_callerid;
if (argc < 2)
@@ -44,30 +44,30 @@ main(int argc, char *argv[])
hide_callerid = (argc > 2) ? argv[2] : "";
ecore_init();
- edbus_init();
+ eldbus_init();
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM);
if (!conn)
{
fprintf(stderr, "Error: could not get system bus\n");
return EXIT_FAILURE;
}
- obj = edbus_object_get(conn, "org.ofono", "/");
+ obj = eldbus_object_get(conn, "org.ofono", "/");
if (!obj)
{
fprintf(stderr, "Error: could not get object\n");
return EXIT_FAILURE;
}
- manager = edbus_proxy_get(obj, "org.ofono.Manager");
+ manager = eldbus_proxy_get(obj, "org.ofono.Manager");
if (!manager)
{
fprintf(stderr, "Error: could not get proxy\n");
return EXIT_FAILURE;
}
- pending = edbus_proxy_call(manager, "Dial", on_dial, NULL,
+ pending = eldbus_proxy_call(manager, "Dial", on_dial, NULL,
-1, "ss", number, hide_callerid);
if (!pending)
{
@@ -77,11 +77,11 @@ main(int argc, char *argv[])
ecore_main_loop_begin();
- edbus_proxy_unref(manager);
- edbus_object_unref(obj);
- edbus_connection_unref(conn);
+ eldbus_proxy_unref(manager);
+ eldbus_object_unref(obj);
+ eldbus_connection_unref(conn);
- edbus_shutdown();
+ eldbus_shutdown();
ecore_shutdown();
return 0;
}
diff --git a/src/examples/eldbus/server.c b/src/examples/eldbus/server.c
new file mode 100644
index 0000000000..532ce4267f
--- /dev/null
+++ b/src/examples/eldbus/server.c
@@ -0,0 +1,247 @@
+//Compile with:
+// gcc -o server server.c `pkg-config --cflags --libs eldbus ecore`
+
+#include "Eldbus.h"
+#include <Ecore.h>
+
+#define BUS "org.Enlightenment"
+#define PATH "/org/enlightenment"
+#define PATH_TEST_SON "/org/enlightenment/son"
+#define INTERFACE "org.enlightenment.Test"
+
+static Eldbus_Connection *conn;
+
+static Eldbus_Message *
+_hello(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *message)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(message);
+ eldbus_message_arguments_append(reply, "s", "Hello World");
+ printf("Hello\n");
+ return reply;
+}
+
+static Eldbus_Message *
+_quit(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *message)
+{
+ printf("Quit\n");
+ ecore_main_loop_quit();
+ return eldbus_message_method_return_new(message);
+}
+
+enum
+{
+ TEST_SIGNAL_ALIVE = 0,
+ TEST_SIGNAL_HELLO
+};
+
+static Eina_Bool
+send_signal_alive(void *data)
+{
+ Eldbus_Service_Interface *iface = data;
+ eldbus_service_signal_emit(iface, TEST_SIGNAL_ALIVE);
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
+send_signal_hello(void *data)
+{
+ Eldbus_Service_Interface *iface = data;
+ eldbus_service_signal_emit(iface, TEST_SIGNAL_HELLO, "Hello World");
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eldbus_Message *
+_send_bool(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eina_Bool bool;
+ if (!eldbus_message_arguments_get(msg, "b", &bool))
+ printf("eldbus_message_arguments_get() error\n");
+ eldbus_message_arguments_append(reply, "b", bool);
+ return reply;
+}
+
+static Eldbus_Message *
+_send_byte(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ unsigned char byte;
+ if (!eldbus_message_arguments_get(msg, "y", &byte))
+ printf("eldbus_message_arguments_get() error\n");
+ eldbus_message_arguments_append(reply, "y", byte);
+ return reply;
+}
+
+static Eldbus_Message *
+_send_uint32(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ unsigned int uint32;
+ if (!eldbus_message_arguments_get(msg, "u", &uint32))
+ printf("eldbus_message_arguments_get() error\n");
+ eldbus_message_arguments_append(reply, "u", uint32);
+ return reply;
+}
+
+static Eldbus_Message *
+_send_int32(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ int int32;
+ if (!eldbus_message_arguments_get(msg, "i", &int32))
+ printf("eldbus_message_arguments_get() error\n");
+ eldbus_message_arguments_append(reply, "i", int32);
+ return reply;
+}
+
+static Eldbus_Message *
+_send_int16(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ short int int16;
+ if (!eldbus_message_arguments_get(msg, "n", &int16))
+ printf("eldbus_message_arguments_get() error\n");
+ eldbus_message_arguments_append(reply, "n", int16);
+ return reply;
+}
+
+static Eldbus_Message *
+_send_double(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ double d;
+ if (!eldbus_message_arguments_get(msg, "d", &d))
+ printf("eldbus_message_arguments_get() error\n");
+ eldbus_message_arguments_append(reply, "d", d);
+ return reply;
+}
+
+static Eldbus_Message *
+_send_string(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ const char *txt;
+ if (!eldbus_message_arguments_get(msg, "s", &txt))
+ printf("eldbus_message_arguments_get() error\n");
+ eldbus_message_arguments_append(reply, "s", txt);
+ return reply;
+}
+
+static Eina_Bool
+_resp_async(void *data)
+{
+ Eldbus_Message *msg = data;
+ eldbus_message_arguments_append(msg, "s", "Async test ok");
+ eldbus_connection_send(conn, msg, NULL, NULL, -1);
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static Eldbus_Message *
+_async_test(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ printf("Received a call to AsyncTest.\n");
+ printf("Response will be send in 5 seconds.\n");
+ ecore_timer_add(5, _resp_async, reply);
+ return NULL;
+}
+
+static const Eldbus_Signal signals[] = {
+ [TEST_SIGNAL_ALIVE] = {"Alive", NULL, 0},
+ [TEST_SIGNAL_HELLO] = {"Hello", ELDBUS_ARGS({ "s", "message" }), 0},
+ { }
+};
+
+static const Eldbus_Method methods[] = {
+ {
+ "Hello", NULL, ELDBUS_ARGS({"s", "message"}),
+ _hello
+ },
+ {
+ "Quit", NULL, NULL,
+ _quit, ELDBUS_METHOD_FLAG_DEPRECATED
+ },
+ { "SendBool", ELDBUS_ARGS({"b", "bool"}), ELDBUS_ARGS({"b", "bool"}),
+ _send_bool
+ },
+ { "SendByte", ELDBUS_ARGS({"y", "byte"}), ELDBUS_ARGS({"y", "byte"}),
+ _send_byte
+ },
+ { "SendUint32", ELDBUS_ARGS({"u", "uint32"}), ELDBUS_ARGS({"u", "uint32"}),
+ _send_uint32
+ },
+ { "SendInt32", ELDBUS_ARGS({"i", "int32"}), ELDBUS_ARGS({"i", "int32"}),
+ _send_int32
+ },
+ { "SendInt16", ELDBUS_ARGS({"n", "int16"}), ELDBUS_ARGS({"n", "int16"}),
+ _send_int16
+ },
+ { "SendDouble", ELDBUS_ARGS({"d", "double"}), ELDBUS_ARGS({"d", "double"}),
+ _send_double
+ },
+ { "SendString", ELDBUS_ARGS({"s", "string"}), ELDBUS_ARGS({"s", "string"}),
+ _send_string
+ },
+ { "AsyncTest", NULL, ELDBUS_ARGS({"s", "text"}),
+ _async_test
+ },
+ { }
+};
+
+static const Eldbus_Service_Interface_Desc iface_desc = {
+ INTERFACE, methods, signals
+};
+
+static void
+on_name_request(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
+{
+ Eldbus_Service_Interface *iface;
+ unsigned int reply;
+
+ iface = data;
+ if (eldbus_message_error_get(msg, NULL, NULL))
+ {
+ printf("error on on_name_request\n");
+ return;
+ }
+
+ if (!eldbus_message_arguments_get(msg, "u", &reply))
+ {
+ printf("error geting arguments on on_name_request\n");
+ return;
+ }
+
+ if (reply != ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)
+ {
+ printf("error name already in use\n");
+ return;
+ }
+
+ ecore_timer_add(5, send_signal_alive, iface);
+ ecore_timer_add(6, send_signal_hello, iface);
+}
+
+int
+main(void)
+{
+ Eldbus_Service_Interface *iface;
+
+ ecore_init();
+ eldbus_init();
+
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+
+ iface = eldbus_service_interface_register(conn, PATH, &iface_desc);
+ eldbus_name_request(conn, BUS, ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
+ on_name_request, iface);
+
+ eldbus_service_interface_register(conn, PATH_TEST_SON, &iface_desc);
+
+ ecore_main_loop_begin();
+
+ eldbus_connection_unref(conn);
+
+ eldbus_shutdown();
+ ecore_shutdown();
+ return 0;
+}
diff --git a/src/examples/eldbus/simple-signal-emit.c b/src/examples/eldbus/simple-signal-emit.c
new file mode 100644
index 0000000000..8b0bf8961c
--- /dev/null
+++ b/src/examples/eldbus/simple-signal-emit.c
@@ -0,0 +1,86 @@
+//Compile with:
+// gcc -o simple-signal-emit simple-signal-emit.c `pkg-config --cflags --libs eldbus`
+
+#include <Eldbus.h>
+
+enum {
+ TEST_SIGNAL_ALIVE,
+ TEST_SIGNAL_PROP,
+ TEST_SIGNAL_NAME,
+};
+
+static const Eldbus_Signal test_signals[] = {
+ [TEST_SIGNAL_ALIVE] = { "Alive" },
+ [TEST_SIGNAL_PROP] = { "Properties", ELDBUS_ARGS({ "a{ss}", "properties"}) },
+ [TEST_SIGNAL_NAME] = { "Name", ELDBUS_ARGS({ "s", "name"}) },
+ { }
+};
+
+/* signal with complex arguments (a dict) */
+static void emit_properties(Eldbus_Service_Interface *iface)
+{
+ Eldbus_Message *alive2;
+ Eldbus_Message_Iter *iter, *dict;
+ struct keyval {
+ const char *key;
+ const char *val;
+ } keyval[] = {
+ { "key1", "val1" },
+ { "key2", "val2" },
+ { }
+ };
+ struct keyval *k;
+
+ alive2 = eldbus_service_signal_new(iface, TEST_SIGNAL_PROP);
+ iter = eldbus_message_iter_get(alive2);
+ dict = eldbus_message_iter_container_new(iter, 'a', "{ss}");
+
+ for (k = keyval; k && k->key; k++)
+ {
+ Eldbus_Message_Iter *entry = eldbus_message_iter_container_new(dict, 'e',
+ NULL);
+ eldbus_message_iter_arguments_append(entry, "ss", k->key, k->val);
+ eldbus_message_iter_container_close(dict, entry);
+ }
+
+ eldbus_message_iter_container_close(iter, dict);
+ eldbus_service_signal_send(iface, alive2);
+}
+
+/* signal with basic args */
+static void emit_name(Eldbus_Service_Interface *iface)
+{
+ eldbus_service_signal_emit(iface, TEST_SIGNAL_NAME, "TEST");
+}
+
+/* simple signal example */
+static void emit_alive(Eldbus_Service_Interface *iface)
+{
+ eldbus_service_signal_emit(iface, TEST_SIGNAL_ALIVE);
+}
+
+static const Eldbus_Service_Interface_Desc iface_desc = {
+ "org.enlightenment.Test", NULL, test_signals
+};
+
+int main(void)
+{
+ Eldbus_Connection *conn;
+ Eldbus_Service_Interface *iface;
+
+ eldbus_init();
+
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
+ iface = eldbus_service_interface_register(conn, "/org/enlightenment",
+ &iface_desc);
+
+ emit_alive(iface);
+ emit_name(iface);
+ emit_properties(iface);
+
+ eldbus_connection_unref(conn);
+
+ eldbus_shutdown();
+
+ return 0;
+}
diff --git a/src/lib/edbus/EDBus.h b/src/lib/edbus/EDBus.h
deleted file mode 100644
index 925c3f1708..0000000000
--- a/src/lib/edbus/EDBus.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * @page edbus_main EDBus
- *
- * @date 2012 (created)
- *
- * @section toc Table of Contents
- *
- * @li @ref edbus_main_intro
- * @li @ref edbus_main_compiling
- * @li @ref edbus_main_next_steps
- * @li @ref edbus_main_intro_example
- *
- * @section edbus_main_intro Introduction
- *
- * EDBus is a wrapper around the
- * <a href="http://www.freedesktop.org/wiki/Software/dbus">dbus</a>
- * library, which is a message bus system. It also implements a set of
- * specifications using dbus as interprocess communication.
- *
- * @subsection edbus_modules_sec Modules
- *
- * <ul>
- * <li> @ref EDBus_Core
- * <li> @ref EDBus_Conneciton
- * <li> @ref EDBus_Object_Mapper
- * <li> @ref EDBus_Proxy
- * <li> @ref EDBus_Message
- * <ul>
- * <li>@ref EDBus_Message_Iter
- * <li>@ref EDBus_Message_Helpers
- * <li>@ref Eina_Value
- * </ul>
- * <li> @ref EDBus_Signal_Handler
- * <li> @ref EDBus_Pending
- * <li> @ref EDBus_Service
- * <li> @ref EDBus_Basic
- * </ul>
- *
- * @section edbus_main_compiling How to compile
- *
- * EDBus is a library your application links to. The procedure for this is
- * very simple. You simply have to compile your application with the
- * appropriate compiler flags that the @c pkg-config script outputs. For
- * example:
- *
- * Compiling C or C++ files into object files:
- *
- * @verbatim
- gcc -c -o main.o main.c `pkg-config --cflags edbus2`
- @endverbatim
- *
- * Linking object files into a binary executable:
- *
- * @verbatim
- gcc -o my_application main.o `pkg-config --libs edbus2`
- @endverbatim
- *
- * See @ref pkgconfig
- *
- * @section edbus_main_next_steps Next Steps
- *
- * After you understood what EDBus is and installed it in your system
- * you should proceed understanding the programming interface.
- *
- * Recommended reading:
- * @li @ref EDBus_Core for library init, shutdown and getting a connection.
- * @li @ref EDBus_Proxy to easily bind a client object to an interface.
- * @li @ref EDBus_Object_Mapper to monitor server objects and properties.
- *
- * @section edbus_main_intro_example Introductory Example
- *
- * @include ofono-dial.c
- *
- * More examples can be found at @ref edbus_examples.
- */
-#ifndef EDBUS_H
-#define EDBUS_H
-
-#include <Eina.h>
-#include <stdarg.h>
-
-#ifdef EAPI
-# undef EAPI
-#endif
-
-#ifdef _WIN32
-# ifdef EFL_EDBUS_BUILD
-# ifdef DLL_EXPORT
-# define EAPI __declspec(dllexport)
-# else
-# define EAPI
-# endif /* ! DLL_EXPORT */
-# else
-# define EAPI __declspec(dllimport)
-# endif /* ! EFL_EDBUS_BUILD */
-#else
-# ifdef __GNUC__
-# if __GNUC__ >= 4
-# define EAPI __attribute__ ((visibility("default")))
-# else
-# define EAPI
-# endif
-# else
-# define EAPI
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup EDBus_Core Core
- * @ingroup EDBus
- *
- * @{
- */
-#define EDBUS_VERSION_MAJOR 1
-#define EDBUS_VERSION_MINOR 8
-
-#define EDBUS_FDO_BUS "org.freedesktop.DBus"
-#define EDBUS_FDO_PATH "/org/freedesktop/DBus"
-#define EDBUS_FDO_INTERFACE EDBUS_FDO_BUS
-#define EDBUS_FDO_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
-#define EDBUS_FDO_INTERFACE_OBJECT_MANAGER "org.freedesktop.DBus.ObjectManager"
-#define EDBUS_FDO_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
-#define EDBUS_FDO_INTEFACE_PEER "org.freedesktop.DBus.Peer"
-#define EDBUS_ERROR_PENDING_CANCELED "org.enlightenment.DBus.Canceled"
-
-typedef struct _EDBus_Version
-{
- int major;
- int minor;
- int micro;
- int revision;
-} EDBus_Version;
-
-EAPI extern const EDBus_Version * edbus_version;
-
-/**
- * @brief Initialize edbus.
- *
- * @return 1 or greater on success, 0 otherwise
- */
-EAPI int edbus_init(void);
-/**
- * @brief Shutdown edbus.
- *
- * @return 0 if e_dbus shuts down, greater than 0 otherwise.
- */
-EAPI int edbus_shutdown(void);
-
-typedef void (*EDBus_Free_Cb)(void *data, const void *deadptr);
-
-/**
- * @typedef EDBus_Connection
- *
- * Represents a connection of one the type of connection with the DBus daemon.
- */
-typedef struct _EDBus_Connection EDBus_Connection;
-/**
- * @typedef EDBus_Object
- *
- * Represents an object path already attached with bus name or unique id.
- */
-typedef struct _EDBus_Object EDBus_Object;
-/**
- * @typedef EDBus_Proxy
- *
- * Represents an interface of an object path.
- */
-typedef struct _EDBus_Proxy EDBus_Proxy;
-/**
- * @typedef EDBus_Message
- *
- * Represents the way data is sent and received in DBus.
- */
-typedef struct _EDBus_Message EDBus_Message;
-/**
- * @typedef EDBus_Message_Iter
- *
- * Represents an iterator over a complex message type (array, dict, struct,
- * or variant). Its life is bound to the message that contains
- * it. The same applies to the returned data.
- */
-typedef struct _EDBus_Message_Iter EDBus_Message_Iter;
-/**
- * @typedef EDBus_Pending
- *
- * Represents a message that has been sent but has not yet reached its
- * destination.
- */
-typedef struct _EDBus_Pending EDBus_Pending;
-
-/**
- * @typedef EDBus_Signal_Handler
- *
- * Represents a listener that will listen for signals emitted by other
- * applications.
- */
-typedef struct _EDBus_Signal_Handler EDBus_Signal_Handler;
-
-typedef void (*EDBus_Message_Cb)(void *data, const EDBus_Message *msg, EDBus_Pending *pending);
-typedef void (*EDBus_Signal_Cb)(void *data, const EDBus_Message *msg);
-/**
- * @}
- */
-
-#include "edbus_connection.h"
-#include "edbus_message.h"
-#include "edbus_signal_handler.h"
-#include "edbus_pending.h"
-#include "edbus_object.h"
-#include "edbus_proxy.h"
-#include "edbus_freedesktop.h"
-#include "edbus_service.h"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/lib/edbus/edbus_connection.h b/src/lib/edbus/edbus_connection.h
deleted file mode 100644
index 5573f204a4..0000000000
--- a/src/lib/edbus/edbus_connection.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef EDBUS_CONNECTION_H
-#define EDBUS_CONNECTION_H 1
-
-/**
- * @defgroup EDBus_Conneciton Connection
- * @ingroup EDBus
- *
- * @{
- */
-typedef enum
-{
- EDBUS_CONNECTION_TYPE_UNKNOWN = 0, /**< sentinel, not a real type */
- EDBUS_CONNECTION_TYPE_SESSION,
- EDBUS_CONNECTION_TYPE_SYSTEM,
- EDBUS_CONNECTION_TYPE_STARTER,
- EDBUS_CONNECTION_TYPE_LAST /**< sentinel, not a real type */
-} EDBus_Connection_Type;
-
-#define EDBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
-
-/**
- * Establish a connection to bus and integrate it with the ecore main
- * loop. If a connection of given type was already created before, its
- * reference counter is incremented and the connection is returned.
- *
- * @param type type of connection e.g EDBUS_CONNECTION_TYPE_SESSION,
- * EDBUS_CONNECTION_TYPE_SYSTEM or EDBUS_CONNECTION_TYPE_STARTER
- *
- * @return connection with bus
- */
-EAPI EDBus_Connection *edbus_connection_get(EDBus_Connection_Type type);
-
-/**
- * Always create and establish a new connection to bus and integrate it with
- * the ecore main loop. Differently from edbus_connection_get(), this function
- * guarantees to create a new connection to the D-Bus daemon and the connection
- * is not shared by any means.
- *
- * @param type type of connection e.g EDBUS_CONNECTION_TYPE_SESSION,
- * EDBUS_CONNECTION_TYPE_SYSTEM or EDBUS_CONNECTION_TYPE_STARTER
- *
- * @return connection with bus
- */
-EAPI EDBus_Connection *edbus_private_connection_get(EDBus_Connection_Type type);
-
-/**
- * @brief Increment connection reference count.
- *
- * @param conn The given EDBus_Connection object to reference
- */
-EAPI EDBus_Connection *edbus_connection_ref(EDBus_Connection *conn) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Decrement connection reference count.
- *
- * If reference count reaches 0, the connection to bus will be dropped and all
- * its children will be invalidated.
- */
-EAPI void edbus_connection_unref(EDBus_Connection *conn) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Add a callback function to be called when connection is freed
- *
- * @param conn The connection object to add the callback to.
- * @param cb callback to be called
- * @param data data passed to callback
- */
-EAPI void edbus_connection_free_cb_add(EDBus_Connection *conn, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Remove callback registered in edbus_connection_free_cb_add().
- */
-EAPI void edbus_connection_free_cb_del(EDBus_Connection *conn, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Set an attached data pointer to an object with a given string key.
- *
- * @param conn The connection object to store data to
- * @param key to identify data
- * @param data data that will be stored
- */
-EAPI void edbus_connection_data_set(EDBus_Connection *conn, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
-
-/**
- * @brief Get data stored in connection.
- *
- * @param conn connection where data is stored
- * @param key key that identifies data
- *
- * @return pointer to data if found otherwise NULL
- */
-EAPI void *edbus_connection_data_get(const EDBus_Connection *conn, const char *key) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Del data stored in connection.
- *
- * @param conn connection where data is stored
- * @param key that identifies data
- *
- * @return pointer to data if found otherwise NULL
- */
-EAPI void *edbus_connection_data_del(EDBus_Connection *conn, const char *key) EINA_ARG_NONNULL(1, 2);
-
-typedef enum
-{
- EDBUS_CONNECTION_EVENT_DEL,
- EDBUS_CONNECTION_EVENT_DISCONNECTED,
- EDBUS_CONNECTION_EVENT_LAST /**< sentinel, not a real event type */
-} EDBus_Connection_Event_Type;
-
-typedef void (*EDBus_Connection_Event_Cb)(void *data, EDBus_Connection *conn, void *event_info);
-
-/**
- * @brief Add a callback function to be called when an event occurs of the
- * type passed.
- */
-EAPI void edbus_connection_event_callback_add(EDBus_Connection *conn, EDBus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
-
-/**
- * @brief Remove callback registered in edbus_connection_event_callback_add().
- */
-EAPI void edbus_connection_event_callback_del(EDBus_Connection *conn, EDBus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
-
-/**
- * @brief Send a message.
- *
- * @param conn the connection where the message will be sent
- * @param msg message that will be sent
- * @param cb if msg is a method call a callback should be passed
- * to be executed when a response arrives
- * @param cb_data data passed to callback
- * @param timeout timeout in milliseconds, -1 to use default internal value or
- * EDBUS_TIMEOUT_INFINITE for no timeout
- */
-EAPI EDBus_Pending *edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2);
-/**
- * @}
- */
-#endif
diff --git a/src/lib/edbus/edbus_freedesktop.c b/src/lib/edbus/edbus_freedesktop.c
deleted file mode 100644
index 716dcbcf22..0000000000
--- a/src/lib/edbus/edbus_freedesktop.c
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "edbus_private.h"
-#include "edbus_private_types.h"
-#include <dbus/dbus.h>
-
-EAPI EDBus_Pending *
-edbus_name_request(EDBus_Connection *conn, const char *name, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
-
- return edbus_proxy_call(conn->fdo_proxy, "RequestName", cb,
- cb_data, -1, "su", name, flags);
-}
-
-EAPI EDBus_Pending *
-edbus_name_release(EDBus_Connection *conn, const char *name, EDBus_Message_Cb cb, const void *cb_data)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
-
- return edbus_proxy_call(conn->fdo_proxy, "ReleaseName", cb,
- cb_data, -1, "s", name);
-}
-
-EAPI EDBus_Pending *
-edbus_name_owner_get(EDBus_Connection *conn, const char *name, EDBus_Message_Cb cb, const void *cb_data)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
-
- return edbus_proxy_call(conn->fdo_proxy, "GetNameOwner", cb,
- cb_data, -1, "s", name);
-}
-
-EAPI EDBus_Pending *
-edbus_name_owner_has(EDBus_Connection *conn, const char *name, EDBus_Message_Cb cb, const void *cb_data)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
-
- return edbus_proxy_call(conn->fdo_proxy, "NameHasOwner", cb,
- cb_data, -1, "s", name);
-}
-
-EAPI EDBus_Pending *
-edbus_names_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
-
- return edbus_proxy_call(conn->fdo_proxy, "ListNames", cb,
- cb_data, -1, "");
-}
-
-EAPI EDBus_Pending *
-edbus_names_activatable_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
-
- return edbus_proxy_call(conn->fdo_proxy, "ListActivatableNames", cb,
- cb_data, -1, "");
-}
-
-EAPI EDBus_Pending *
-edbus_name_start(EDBus_Connection *conn, const char *name, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
-
- return edbus_proxy_call(conn->fdo_proxy, "StartServiceByName", cb,
- cb_data, -1, "su", name, flags);
-}
-
-EAPI EDBus_Pending *
-edbus_object_managed_objects_get(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data)
-{
- EDBus_Message *msg;
- EDBus_Pending *p;
- msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_OBJECT_MANAGER,
- "GetManagedObjects");
- p = edbus_object_send(obj, msg, cb, data, -1);
- return p;
-}
diff --git a/src/lib/edbus/edbus_freedesktop.h b/src/lib/edbus/edbus_freedesktop.h
deleted file mode 100644
index f80e8c35c2..0000000000
--- a/src/lib/edbus/edbus_freedesktop.h
+++ /dev/null
@@ -1,143 +0,0 @@
-#ifndef EDBUS_FREEDESKTOP_H
-#define EDBUS_FREEDESKTOP_H 1
-
-/**
- * @defgroup EDBus_Basic Basic FreeDesktop.Org Methods
- * @ingroup EDBus
- *
- * @{
- */
-#define EDBUS_NAME_REQUEST_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
-#define EDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
-#define EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
-
-/* Replies to request for a name */
-#define EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
-#define EDBUS_NAME_REQUEST_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
-#define EDBUS_NAME_REQUEST_REPLY_EXISTS 3 /**< Service is already in the queue */
-#define EDBUS_NAME_REQUEST_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
-
-EAPI EDBus_Pending *edbus_name_request(EDBus_Connection *conn, const char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
-
-/* Replies to releasing a name */
-#define EDBUS_NAME_RELEASE_REPLY_RELEASED 1 /**< Service was released from the given name */
-#define EDBUS_NAME_RELEASE_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
-#define EDBUS_NAME_RELEASE_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
-
-EAPI EDBus_Pending *edbus_name_release(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
-EAPI EDBus_Pending *edbus_name_owner_get(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
-EAPI EDBus_Pending *edbus_name_owner_has(EDBus_Connection *conn, const char *bus, EDBus_Message_Cb cb, const void *cb_data);
-EAPI EDBus_Pending *edbus_names_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1);
-EAPI EDBus_Pending *edbus_names_activatable_list(EDBus_Connection *conn, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1);
-
-/* Replies to service starts */
-#define EDBUS_NAME_START_REPLY_SUCCESS 1 /**< Service was auto started */
-#define EDBUS_NAME_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
-
-EAPI EDBus_Pending *edbus_name_start(EDBus_Connection *conn, const char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
-
-typedef void (*EDBus_Name_Owner_Changed_Cb)(void *data, const char *bus, const char *old_id, const char *new_id);
-
-/**
- * Add a callback to be called when unique id of a bus name changed.
- *
- * This function implicitly calls edbus_name_owner_get() in order to be able to
- * monitor the name. If the only interest is to receive notifications when the
- * name in fact changes, pass EINA_FALSE to @param allow_initial_call so your
- * callback will not be called on first retrieval of name owner. If the
- * initial state is important, pass EINA_TRUE to this parameter.
- *
- * @param conn connection
- * @param bus name of bus
- * @param cb callback
- * @param cb_data context data
- * @param allow_initial_call allow call callback with actual id of the bus
- */
-EAPI void edbus_name_owner_changed_callback_add(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call) EINA_ARG_NONNULL(1, 2, 3);
-/**
- * Remove callback added with edbus_name_owner_changed_callback_add().
- *
- * @param conn connection
- * @param bus name of bus
- * @param cb callback
- * @param cb_data context data
- */
-EAPI void edbus_name_owner_changed_callback_del(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2, 3);
-
-/**
- * @defgroup EDBus_FDO_Peer org.freedesktop.DBus.Peer
- *
- * @{
- */
-EAPI EDBus_Pending *edbus_object_peer_ping(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-EAPI EDBus_Pending *edbus_object_peer_machine_id_get(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @}
- */
-
-/**
- * @defgroup EDBus_FDO_Introspectable org.freedesktop.DBus.Introspectable
- *
- * @{
- */
-EAPI EDBus_Pending *edbus_object_introspect(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-/**
- * @}
- */
-
-/**
- * @defgroup EDBus_FDO_Properties org.freedesktop.DBus.Properties
- * @{
- */
-
-/**
- * Enable or disable local cache of properties.
- *
- * After enable you can call edbus_proxy_property_local_get() or
- * edbus_proxy_property_local_get_all() to get cached properties.
- *
- * @note After enable, it will asynchrony get the properties values.
- */
-EAPI void edbus_proxy_properties_monitor(EDBus_Proxy *proxy, Eina_Bool enable) EINA_ARG_NONNULL(1);
-
-EAPI EDBus_Pending *edbus_proxy_property_get(EDBus_Proxy *proxy, const char *name, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3);
-EAPI EDBus_Pending *edbus_proxy_property_set(EDBus_Proxy *proxy, const char *name, const char *sig, const void *value, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3, 4);
-EAPI EDBus_Pending *edbus_proxy_property_get_all(EDBus_Proxy *proxy, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-EAPI EDBus_Signal_Handler *edbus_proxy_properties_changed_callback_add(EDBus_Proxy *proxy, EDBus_Signal_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * Return the cached value of property.
- * This only work if you have enable edbus_proxy_properties_monitor or
- * if you have call edbus_proxy_event_callback_add of type
- * EDBUS_PROXY_EVENT_PROPERTY_CHANGED and the property you want had changed.
- */
-EAPI Eina_Value *edbus_proxy_property_local_get(EDBus_Proxy *proxy, const char *name) EINA_ARG_NONNULL(1, 2);
-
-/**
- * Return a Eina_Hash with all cached properties.
- * This only work if you have enable edbus_proxy_properties_monitor or
- * if you have call edbus_proxy_event_callback_add of type
- * EDBUS_PROXY_EVENT_PROPERTY_CHANGED.
- */
-EAPI const Eina_Hash *edbus_proxy_property_local_get_all(EDBus_Proxy *proxy) EINA_ARG_NONNULL(1);
-
-/**
- * @}
- */
-
-/**
- * @defgroup EDBus_FDO_ObjectManager org.freedesktop.DBus.ObjectManager *
- * @{
- */
-
-EAPI EDBus_Pending *edbus_object_managed_objects_get(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @}
- */
-
-/**
- * @}
- */
-#endif
diff --git a/src/lib/edbus/edbus_message_eina_value.h b/src/lib/edbus/edbus_message_eina_value.h
deleted file mode 100644
index a57c1f72b6..0000000000
--- a/src/lib/edbus/edbus_message_eina_value.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * @ingroup EDBus_Message
- * @defgroup Eina_Value Eina_Value to/from Message
- * @{
- */
-
-/**
- * Convert EDBus_Message to Eina_Value
- *
- * @param msg Message
- * @return Eina_Value of type Eina_Value_Type_Struct
- */
-EAPI Eina_Value *edbus_message_to_eina_value(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-/**
- * Convert EDBus_Message_Iter of type variant, struct or dict entry to
- * Eina_Value.
- *
- * @param iter Message iterator
- * @return Eina_Value of type Eina_Value_Type_Struct
- */
-EAPI Eina_Value *edbus_message_iter_struct_like_to_eina_value(const EDBus_Message_Iter *iter);
-
-/**
- * Convert Eina_Value to EDBus_Message
- *
- * @param signature dbus signature
- * @param msg where data will be put
- * @param value source of data, must be of type Eina_Value_Type_Struct
- * @return success or not
- */
-EAPI Eina_Bool edbus_message_from_eina_value(const char *signature, EDBus_Message *msg, const Eina_Value *value) EINA_ARG_NONNULL(1, 2, 3);
-
-/**
- * @}
- */
diff --git a/src/lib/edbus/edbus_message_helper.c b/src/lib/edbus/edbus_message_helper.c
deleted file mode 100644
index dad50bbddf..0000000000
--- a/src/lib/edbus/edbus_message_helper.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "edbus_private.h"
-#include "edbus_private_types.h"
-
-EAPI void
-edbus_message_iter_dict_iterate(EDBus_Message_Iter *array, const char *signature, EDBus_Dict_Cb_Get cb, const void *data)
-{
- EDBus_Message_Iter *entry;
- char *iter_sig;
- unsigned len;
- EINA_SAFETY_ON_FALSE_RETURN(array);
- EINA_SAFETY_ON_NULL_RETURN(signature);
-
- iter_sig = edbus_message_iter_signature_get(array);
- len = strlen(iter_sig + 1);
- if (strncmp(signature, iter_sig + 1, len - 1))
- {
- ERR("Unexpected signature, expected is: %s", iter_sig);
- free(iter_sig);
- return;
- }
- free(iter_sig);
-
- while (edbus_message_iter_get_and_next(array, 'e', &entry))
- {
- const void *key;
- EDBus_Message_Iter *var;
- if (!edbus_message_iter_arguments_get(entry, signature, &key, &var))
- continue;
- cb((void *)data, key, var);
- }
-}
diff --git a/src/lib/edbus/edbus_message_helper.h b/src/lib/edbus/edbus_message_helper.h
deleted file mode 100644
index a3a2455314..0000000000
--- a/src/lib/edbus/edbus_message_helper.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * @ingroup EDBus_Message
- * @defgroup EDBus_Message_Helpers Message Helpers
- *
- * @{
- */
-
-typedef void (*EDBus_Dict_Cb_Get)(void *data, const void *key, EDBus_Message_Iter *var);
-
-/**
- * Iterate over a dictionary.
- *
- * @param dict iterator with array of entry
- * @param signature of entry, example: "sv"
- * @param cb callback that will be called in each entry
- * @param data context data
- */
-EAPI void edbus_message_iter_dict_iterate(EDBus_Message_Iter *dict, const char *signature, EDBus_Dict_Cb_Get cb, const void *data) EINA_ARG_NONNULL(1, 2, 3);
-
-/**
- * @}
- */
diff --git a/src/lib/edbus/edbus_object.c b/src/lib/edbus/edbus_object.c
deleted file mode 100644
index d61a74a9ab..0000000000
--- a/src/lib/edbus/edbus_object.c
+++ /dev/null
@@ -1,676 +0,0 @@
-#include "edbus_private.h"
-#include "edbus_private_types.h"
-#include <dbus/dbus.h>
-
-/* TODO: mempool of EDBus_Object, Edbus_Object_Context_Event_Cb and
- * EDBus_Object_Context_Event
- */
-
-#define EDBUS_OBJECT_CHECK(obj) \
- do \
- { \
- EINA_SAFETY_ON_NULL_RETURN(obj); \
- if (!EINA_MAGIC_CHECK(obj, EDBUS_OBJECT_MAGIC)) \
- { \
- EINA_MAGIC_FAIL(obj, EDBUS_OBJECT_MAGIC); \
- return; \
- } \
- EINA_SAFETY_ON_TRUE_RETURN(obj->refcount <= 0); \
- } \
- while (0)
-
-#define EDBUS_OBJECT_CHECK_RETVAL(obj, retval) \
- do \
- { \
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, retval); \
- if (!EINA_MAGIC_CHECK(obj, EDBUS_OBJECT_MAGIC)) \
- { \
- EINA_MAGIC_FAIL(obj, EDBUS_OBJECT_MAGIC); \
- return retval; \
- } \
- EINA_SAFETY_ON_TRUE_RETURN_VAL(obj->refcount <= 0, retval); \
- } \
- while (0)
-
-#define EDBUS_OBJECT_CHECK_GOTO(obj, label) \
- do \
- { \
- EINA_SAFETY_ON_NULL_GOTO(obj, label); \
- if (!EINA_MAGIC_CHECK(obj, EDBUS_OBJECT_MAGIC)) \
- { \
- EINA_MAGIC_FAIL(obj, EDBUS_OBJECT_MAGIC); \
- goto label; \
- } \
- EINA_SAFETY_ON_TRUE_GOTO(obj->refcount <= 0, label); \
- } \
- while (0)
-
-Eina_Bool
-edbus_object_init(void)
-{
- return EINA_TRUE;
-}
-
-void
-edbus_object_shutdown(void)
-{
-}
-
-static void _edbus_object_event_callback_call(EDBus_Object *obj, EDBus_Object_Event_Type type, const void *event_info);
-static void _edbus_object_context_event_cb_del(EDBus_Object_Context_Event *ce, EDBus_Object_Context_Event_Cb *ctx);
-static void _on_connection_free(void *data, const void *dead_pointer);
-static void _on_signal_handler_free(void *data, const void *dead_pointer);
-
-static void
-_edbus_object_call_del(EDBus_Object *obj)
-{
- EDBus_Object_Context_Event *ce;
-
- _edbus_object_event_callback_call(obj, EDBUS_OBJECT_EVENT_DEL, NULL);
-
- /* clear all del callbacks so we don't call them twice at
- * _edbus_object_clear()
- */
- ce = obj->event_handlers + EDBUS_OBJECT_EVENT_DEL;
- while (ce->list)
- {
- EDBus_Object_Context_Event_Cb *ctx;
-
- ctx = EINA_INLIST_CONTAINER_GET(ce->list,
- EDBus_Object_Context_Event_Cb);
- _edbus_object_context_event_cb_del(ce, ctx);
- }
-}
-
-static void
-_edbus_object_clear(EDBus_Object *obj)
-{
- EDBus_Signal_Handler *h;
- EDBus_Pending *p;
- Eina_List *iter, *iter_next;
- Eina_Inlist *in_l;
- DBG("obj=%p, refcount=%d, name=%s, path=%s",
- obj, obj->refcount, obj->name, obj->path);
-
- obj->refcount = 1;
- _edbus_object_call_del(obj);
- edbus_connection_name_object_del(obj->conn, obj);
-
- /* NOTE: obj->proxies is deleted from obj->cbs_free. */
-
- EINA_LIST_FOREACH_SAFE(obj->signal_handlers, iter, iter_next, h)
- {
- DBG("obj=%p delete owned signal handler %p %s",
- obj, h, edbus_signal_handler_match_get(h));
- edbus_signal_handler_del(h);
- }
- EINA_INLIST_FOREACH_SAFE(obj->pendings, in_l, p)
- {
- DBG("obj=%p delete owned pending call=%p dest=%s path=%s %s.%s()",
- obj, p,
- edbus_pending_destination_get(p),
- edbus_pending_path_get(p),
- edbus_pending_interface_get(p),
- edbus_pending_method_get(p));
- edbus_pending_cancel(p);
- }
-
- edbus_cbs_free_dispatch(&(obj->cbs_free), obj);
- obj->refcount = 0;
-}
-
-static void
-_edbus_object_free(EDBus_Object *obj)
-{
- unsigned int i;
- EDBus_Signal_Handler *h;
-
- if (obj->proxies)
- {
- Eina_Iterator *iterator = eina_hash_iterator_data_new(obj->proxies);
- EDBus_Proxy *proxy;
- EINA_ITERATOR_FOREACH(iterator, proxy)
- ERR("obj=%p alive proxy=%p %s", obj, proxy,
- edbus_proxy_interface_get(proxy));
- eina_iterator_free(iterator);
- eina_hash_free(obj->proxies);
- }
-
- EINA_LIST_FREE(obj->signal_handlers, h)
- {
- if (h->dangling)
- edbus_signal_handler_free_cb_del(h, _on_signal_handler_free, obj);
- else
- ERR("obj=%p alive handler=%p %s", obj, h,
- edbus_signal_handler_match_get(h));
- }
-
- if (obj->pendings)
- CRITICAL("Object %p released with live pending calls!", obj);
-
- for (i = 0; i < EDBUS_OBJECT_EVENT_LAST; i++)
- {
- EDBus_Object_Context_Event *ce = obj->event_handlers + i;
- while (ce->list)
- {
- EDBus_Object_Context_Event_Cb *ctx;
-
- ctx = EINA_INLIST_CONTAINER_GET(ce->list,
- EDBus_Object_Context_Event_Cb);
- _edbus_object_context_event_cb_del(ce, ctx);
- }
- eina_list_free(ce->to_delete);
- }
-
- if (obj->interfaces_added)
- edbus_signal_handler_del(obj->interfaces_added);
- if (obj->interfaces_removed)
- edbus_signal_handler_del(obj->interfaces_removed);
- if (obj->properties_changed)
- edbus_signal_handler_del(obj->properties_changed);
- eina_stringshare_del(obj->name);
- eina_stringshare_del(obj->path);
- EINA_MAGIC_SET(obj, EINA_MAGIC_NONE);
-
- free(obj);
-}
-
-static void
-_on_connection_free(void *data, const void *dead_pointer EINA_UNUSED)
-{
- EDBus_Object *obj = data;
- EDBUS_OBJECT_CHECK(obj);
- _edbus_object_clear(obj);
- _edbus_object_free(obj);
-}
-
-EAPI EDBus_Object *
-edbus_object_get(EDBus_Connection *conn, const char *bus, const char *path)
-{
- EDBus_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(bus, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
-
- obj = edbus_connection_name_object_get(conn, bus, path);
- if (obj)
- return edbus_object_ref(obj);
-
- obj = calloc(1, sizeof(EDBus_Object));
- EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
-
- obj->conn = conn;
- obj->refcount = 1;
- obj->path = eina_stringshare_add(path);
- obj->name = eina_stringshare_add(bus);
- obj->proxies = eina_hash_string_small_new(NULL);
- EINA_SAFETY_ON_NULL_GOTO(obj->proxies, cleanup);
- EINA_MAGIC_SET(obj, EDBUS_OBJECT_MAGIC);
-
- edbus_connection_name_object_set(conn, obj);
- edbus_connection_free_cb_add(obj->conn, _on_connection_free, obj);
-
- obj->properties = edbus_proxy_get(obj, EDBUS_FDO_INTERFACE_PROPERTIES);
-
- return obj;
-
-cleanup:
- eina_stringshare_del(obj->path);
- eina_stringshare_del(obj->name);
- free(obj);
-
- return NULL;
-}
-
-static void _on_signal_handler_free(void *data, const void *dead_pointer);
-
-static void
-_edbus_object_unref(EDBus_Object *obj)
-{
- obj->refcount--;
- if (obj->refcount > 0) return;
-
- edbus_connection_free_cb_del(obj->conn, _on_connection_free, obj);
- _edbus_object_clear(obj);
- _edbus_object_free(obj);
-}
-
-EAPI EDBus_Object *
-edbus_object_ref(EDBus_Object *obj)
-{
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- DBG("obj=%p, pre-refcount=%d, name=%s, path=%s",
- obj, obj->refcount, obj->name, obj->path);
- obj->refcount++;
- return obj;
-}
-
-EAPI void
-edbus_object_unref(EDBus_Object *obj)
-{
- EDBUS_OBJECT_CHECK(obj);
- DBG("obj=%p, pre-refcount=%d, name=%s, path=%s",
- obj, obj->refcount, obj->name, obj->path);
- _edbus_object_unref(obj);
-}
-
-EAPI void
-edbus_object_free_cb_add(EDBus_Object *obj, EDBus_Free_Cb cb, const void *data)
-{
- EDBUS_OBJECT_CHECK(obj);
- EINA_SAFETY_ON_NULL_RETURN(cb);
- obj->cbs_free = edbus_cbs_free_add(obj->cbs_free, cb, data);
-}
-
-EAPI void
-edbus_object_free_cb_del(EDBus_Object *obj, EDBus_Free_Cb cb, const void *data)
-{
- EDBUS_OBJECT_CHECK(obj);
- EINA_SAFETY_ON_NULL_RETURN(cb);
- obj->cbs_free = edbus_cbs_free_del(obj->cbs_free, cb, data);
-}
-
-static void
-_cb_interfaces_added(void *data, const EDBus_Message *msg)
-{
- EDBus_Object *obj = data;
- const char *obj_path;
- EDBus_Message_Iter *array_ifaces, *entry_iface;
-
- if (!edbus_message_arguments_get(msg, "oa{sa{sv}}", &obj_path, &array_ifaces))
- return;
-
- while (edbus_message_iter_get_and_next(array_ifaces, 'e', &entry_iface))
- {
- const char *iface_name;
- EDBus_Object_Event_Interface_Added event;
-
- edbus_message_iter_basic_get(entry_iface, &iface_name);
- event.proxy = edbus_proxy_get(obj, iface_name);
- EINA_SAFETY_ON_NULL_RETURN(event.proxy);
- event.interface = iface_name;
- _edbus_object_event_callback_call(obj, EDBUS_OBJECT_EVENT_IFACE_ADDED,
- &event);
- edbus_proxy_unref(event.proxy);
- }
-}
-
-static void
-_cb_interfaces_removed(void *data, const EDBus_Message *msg)
-{
- EDBus_Object *obj = data;
- const char *obj_path, *iface;
- EDBus_Message_Iter *array_ifaces;
-
- if (!edbus_message_arguments_get(msg, "oas", &obj_path, &array_ifaces))
- return;
-
- while (edbus_message_iter_get_and_next(array_ifaces, 's', &iface))
- {
- EDBus_Object_Event_Interface_Removed event;
- event.interface = iface;
- _edbus_object_event_callback_call(obj, EDBUS_OBJECT_EVENT_IFACE_REMOVED,
- &event);
- }
-}
-
-static void
-_property_changed_iter(void *data, const void *key, EDBus_Message_Iter *var)
-{
- EDBus_Proxy *proxy = data;
- const char *skey = key;
- Eina_Value *st_value, stack_value;
- EDBus_Object_Event_Property_Changed event;
-
- st_value = _message_iter_struct_to_eina_value(var);
- eina_value_struct_value_get(st_value, "arg0", &stack_value);
-
- event.interface = edbus_proxy_interface_get(proxy);
- event.proxy = proxy;
- event.name = skey;
- event.value = &stack_value;
- _edbus_object_event_callback_call(edbus_proxy_object_get(proxy),
- EDBUS_OBJECT_EVENT_PROPERTY_CHANGED,
- &event);
- eina_value_free(st_value);
- eina_value_flush(&stack_value);
-}
-
-static void
-_cb_properties_changed(void *data, const EDBus_Message *msg)
-{
- EDBus_Object *obj = data;
- EDBus_Proxy *proxy;
- EDBus_Message_Iter *array, *invalidate;
- const char *iface;
- const char *invalidate_prop;
-
- if (!edbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate))
- {
- ERR("Error getting data from properties changed signal.");
- return;
- }
-
- proxy = edbus_proxy_get(obj, iface);
- EINA_SAFETY_ON_NULL_RETURN(proxy);
-
- if (obj->event_handlers[EDBUS_OBJECT_EVENT_PROPERTY_CHANGED].list)
- edbus_message_iter_dict_iterate(array, "sv", _property_changed_iter,
- proxy);
-
- if (!obj->event_handlers[EDBUS_OBJECT_EVENT_PROPERTY_REMOVED].list)
- goto end;
-
- while (edbus_message_iter_get_and_next(invalidate, 's', &invalidate_prop))
- {
- EDBus_Object_Event_Property_Removed event;
- event.interface = iface;
- event.name = invalidate_prop;
- event.proxy = proxy;
- _edbus_object_event_callback_call(obj,
- EDBUS_OBJECT_EVENT_PROPERTY_REMOVED,
- &event);
- }
-end:
- edbus_proxy_unref(proxy);
-}
-
-EAPI void
-edbus_object_event_callback_add(EDBus_Object *obj, EDBus_Object_Event_Type type, EDBus_Object_Event_Cb cb, const void *cb_data)
-{
- EDBus_Object_Context_Event *ce;
- EDBus_Object_Context_Event_Cb *ctx;
-
- EDBUS_OBJECT_CHECK(obj);
- EINA_SAFETY_ON_NULL_RETURN(cb);
- EINA_SAFETY_ON_TRUE_RETURN(type >= EDBUS_OBJECT_EVENT_LAST);
-
- ce = obj->event_handlers + type;
-
- ctx = calloc(1, sizeof(EDBus_Object_Context_Event_Cb));
- EINA_SAFETY_ON_NULL_RETURN(ctx);
-
- ctx->cb = cb;
- ctx->cb_data = cb_data;
-
- ce->list = eina_inlist_append(ce->list, EINA_INLIST_GET(ctx));
-
- switch (type)
- {
- case EDBUS_OBJECT_EVENT_IFACE_ADDED:
- {
- if (obj->interfaces_added)
- break;
- obj->interfaces_added =
- _edbus_signal_handler_add(obj->conn, obj->name, NULL,
- EDBUS_FDO_INTERFACE_OBJECT_MANAGER,
- "InterfacesAdded",
- _cb_interfaces_added, obj);
- EINA_SAFETY_ON_NULL_RETURN(obj->interfaces_added);
- edbus_signal_handler_match_extra_set(obj->interfaces_added, "arg0",
- obj->path, NULL);
- break;
- }
- case EDBUS_OBJECT_EVENT_IFACE_REMOVED:
- {
- if (obj->interfaces_removed)
- break;
- obj->interfaces_removed =
- _edbus_signal_handler_add(obj->conn, obj->name, NULL,
- EDBUS_FDO_INTERFACE_OBJECT_MANAGER,
- "InterfacesRemoved",
- _cb_interfaces_removed, obj);
- EINA_SAFETY_ON_NULL_RETURN(obj->interfaces_added);
- edbus_signal_handler_match_extra_set(obj->interfaces_removed,
- "arg0", obj->path, NULL);
- break;
- }
- case EDBUS_OBJECT_EVENT_PROPERTY_CHANGED:
- case EDBUS_OBJECT_EVENT_PROPERTY_REMOVED:
- {
- if (obj->properties_changed)
- break;
- obj->properties_changed =
- edbus_object_signal_handler_add(obj,
- EDBUS_FDO_INTERFACE_PROPERTIES,
- "PropertiesChanged",
- _cb_properties_changed, obj);
- EINA_SAFETY_ON_NULL_RETURN(obj->properties_changed);
- break;
- }
- default:
- break;
- }
-}
-
-static void
-_edbus_object_context_event_cb_del(EDBus_Object_Context_Event *ce, EDBus_Object_Context_Event_Cb *ctx)
-{
- ce->list = eina_inlist_remove(ce->list, EINA_INLIST_GET(ctx));
- free(ctx);
-}
-
-EAPI void
-edbus_object_event_callback_del(EDBus_Object *obj, EDBus_Object_Event_Type type, EDBus_Object_Event_Cb cb, const void *cb_data)
-{
- EDBus_Object_Context_Event *ce;
- EDBus_Object_Context_Event_Cb *iter, *found = NULL;
-
- EDBUS_OBJECT_CHECK(obj);
- EINA_SAFETY_ON_NULL_RETURN(cb);
- EINA_SAFETY_ON_TRUE_RETURN(type >= EDBUS_OBJECT_EVENT_LAST);
-
- ce = obj->event_handlers + type;
-
- EINA_INLIST_FOREACH(ce->list, iter)
- {
- if (cb != iter->cb) continue;
- if ((cb_data) && (cb_data != iter->cb_data)) continue;
-
- found = iter;
- break;
- }
-
- EINA_SAFETY_ON_NULL_RETURN(found);
- EINA_SAFETY_ON_TRUE_RETURN(found->deleted);
-
- if (ce->walking)
- {
- found->deleted = EINA_TRUE;
- ce->to_delete = eina_list_append(ce->to_delete, found);
- return;
- }
-
- _edbus_object_context_event_cb_del(ce, found);
-
- switch (type)
- {
- case EDBUS_OBJECT_EVENT_IFACE_ADDED:
- {
- if (obj->event_handlers[EDBUS_OBJECT_EVENT_IFACE_ADDED].list)
- break;
- edbus_signal_handler_del(obj->interfaces_added);
- obj->interfaces_added = NULL;
- break;
- }
- case EDBUS_OBJECT_EVENT_IFACE_REMOVED:
- {
- if (obj->event_handlers[EDBUS_OBJECT_EVENT_IFACE_REMOVED].list)
- break;
- edbus_signal_handler_del(obj->interfaces_removed);
- obj->interfaces_removed = NULL;
- break;
- }
- case EDBUS_OBJECT_EVENT_PROPERTY_CHANGED:
- case EDBUS_OBJECT_EVENT_PROPERTY_REMOVED:
- {
- if (obj->event_handlers[EDBUS_OBJECT_EVENT_PROPERTY_CHANGED].list ||
- obj->event_handlers[EDBUS_OBJECT_EVENT_PROPERTY_REMOVED].list)
- break;
- edbus_signal_handler_del(obj->properties_changed);
- obj->properties_changed = NULL;
- break;
- }
- default:
- break;
- }
-}
-
-static void
-_edbus_object_event_callback_call(EDBus_Object *obj, EDBus_Object_Event_Type type, const void *event_info)
-{
- EDBus_Object_Context_Event *ce;
- EDBus_Object_Context_Event_Cb *iter;
-
- ce = obj->event_handlers + type;
-
- ce->walking++;
- EINA_INLIST_FOREACH(ce->list, iter)
- {
- if (iter->deleted) continue;
- iter->cb((void *)iter->cb_data, obj, (void *)event_info);
- }
- ce->walking--;
- if (ce->walking > 0) return;
-
- EINA_LIST_FREE(ce->to_delete, iter)
- _edbus_object_context_event_cb_del(ce, iter);
-}
-
-EAPI EDBus_Connection *
-edbus_object_connection_get(const EDBus_Object *obj)
-{
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- return obj->conn;
-}
-
-EAPI const char *
-edbus_object_bus_name_get(const EDBus_Object *obj)
-{
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- return obj->name;
-}
-
-EAPI const char *
-edbus_object_path_get(const EDBus_Object *obj)
-{
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- return obj->path;
-}
-
-static void
-_on_pending_free(void *data, const void *dead_pointer)
-{
- EDBus_Object *obj = data;
- EDBus_Pending *pending = (EDBus_Pending*) dead_pointer;
- EDBUS_OBJECT_CHECK(obj);
- obj->pendings = eina_inlist_remove(obj->pendings, EINA_INLIST_GET(pending));
-}
-
-EAPI EDBus_Pending *
-edbus_object_send(EDBus_Object *obj, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout)
-{
- EDBus_Pending *pending;
-
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
-
- pending = _edbus_connection_send(obj->conn, msg, cb, cb_data, timeout);
- if (!cb) return NULL;
- EINA_SAFETY_ON_NULL_RETURN_VAL(pending, NULL);
-
- edbus_pending_free_cb_add(pending, _on_pending_free, obj);
- obj->pendings = eina_inlist_append(obj->pendings, EINA_INLIST_GET(pending));
-
- return pending;
-}
-
-static void
-_on_signal_handler_free(void *data, const void *dead_pointer)
-{
- EDBus_Object *obj = data;
- EDBUS_OBJECT_CHECK(obj);
- obj->signal_handlers = eina_list_remove(obj->signal_handlers, dead_pointer);
-}
-
-EAPI EDBus_Signal_Handler *
-edbus_object_signal_handler_add(EDBus_Object *obj, const char *interface, const char *member, EDBus_Signal_Cb cb, const void *cb_data)
-{
- EDBus_Signal_Handler *handler;
-
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(cb, NULL);
-
- handler = _edbus_signal_handler_add(obj->conn, obj->name, obj->path,
- interface, member, cb, cb_data);
- EINA_SAFETY_ON_NULL_RETURN_VAL(handler, NULL);
-
- edbus_signal_handler_free_cb_add(handler, _on_signal_handler_free, obj);
- obj->signal_handlers = eina_list_append(obj->signal_handlers, handler);
-
- return handler;
-}
-
-EAPI EDBus_Message *
-edbus_object_method_call_new(EDBus_Object *obj, const char *interface, const char *member)
-{
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(member, NULL);
-
- return edbus_message_method_call_new(obj->name, obj->path, interface, member);
-}
-
-Eina_Bool
-edbus_object_proxy_add(EDBus_Object *obj, EDBus_Proxy *proxy)
-{
- return eina_hash_add(obj->proxies, edbus_proxy_interface_get(proxy), proxy);
-}
-
-EDBus_Proxy *
-edbus_object_proxy_get(EDBus_Object *obj, const char *interface)
-{
- return eina_hash_find(obj->proxies, interface);
-}
-
-Eina_Bool
-edbus_object_proxy_del(EDBus_Object *obj, EDBus_Proxy *proxy, const char *interface)
-{
- return eina_hash_del(obj->proxies, interface, proxy);
-}
-
-EAPI EDBus_Pending *
-edbus_object_peer_ping(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data)
-{
- EDBus_Message *msg;
- EDBus_Pending *p;
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER, "Ping");
- p = edbus_object_send(obj, msg, cb, data, -1);
- return p;
-}
-
-EAPI EDBus_Pending *
-edbus_object_peer_machine_id_get(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data)
-{
- EDBus_Message *msg;
- EDBus_Pending *p;
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTEFACE_PEER,
- "GetMachineId");
- p = edbus_object_send(obj, msg, cb, data, -1);
- return p;
-}
-
-EAPI EDBus_Pending *
-edbus_object_introspect(EDBus_Object *obj, EDBus_Message_Cb cb, const void *data)
-{
- EDBus_Message *msg;
- EDBus_Pending *p;
- EDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
- msg = edbus_object_method_call_new(obj, EDBUS_FDO_INTERFACE_INTROSPECTABLE,
- "Introspect");
- p = edbus_object_send(obj, msg, cb, data, -1);
- return p;
-}
diff --git a/src/lib/edbus/edbus_object.h b/src/lib/edbus/edbus_object.h
deleted file mode 100644
index 680cdfb4d7..0000000000
--- a/src/lib/edbus/edbus_object.h
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef EDBUS_OBJECT_H
-#define EDBUS_OBJECT_H 1
-
-/**
- * @defgroup EDBus_Object_Mapper Object Mapper
- * @ingroup EDBus
- *
- * @{
- */
-
-/**
- * @brief Get an object of the given bus and path.
- *
- * @param conn connection where object belongs
- * @param bus name of bus or unique-id of who listens for calls of this object
- * @param path object path of this object
- */
-EAPI EDBus_Object *edbus_object_get(EDBus_Connection *conn, const char *bus, const char *path) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Increase object reference.
- */
-EAPI EDBus_Object *edbus_object_ref(EDBus_Object *obj) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Decrease object reference.
- * If reference == 0 object will be freed and all its children.
- */
-EAPI void edbus_object_unref(EDBus_Object *obj) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Add a callback function to be called when object will be freed.
- *
- * @param obj object that you want to monitor
- * @param cb callback that will be executed
- * @param data passed to callback
- */
-EAPI void edbus_object_free_cb_add(EDBus_Object *obj, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Remove callback registered in edbus_object_free_cb_add().
- */
-EAPI void edbus_object_free_cb_del(EDBus_Object *obj, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-typedef enum
-{
- EDBUS_OBJECT_EVENT_IFACE_ADDED = 0, /**< a parent path must have a ObjectManager interface */
- EDBUS_OBJECT_EVENT_IFACE_REMOVED, /**< a parent path must have a ObjectManager interface */
- EDBUS_OBJECT_EVENT_PROPERTY_CHANGED,
- EDBUS_OBJECT_EVENT_PROPERTY_REMOVED,
- EDBUS_OBJECT_EVENT_DEL,
- EDBUS_OBJECT_EVENT_LAST /**< sentinel, not a real event type */
-} EDBus_Object_Event_Type;
-
-typedef struct _EDBus_Object_Event_Interface_Added
-{
- const char *interface;
- EDBus_Proxy *proxy;
-} EDBus_Object_Event_Interface_Added;
-
-typedef struct _EDBus_Object_Event_Interface_Removed
-{
- const char *interface;
-} EDBus_Object_Event_Interface_Removed;
-
-typedef struct _EDBus_Object_Event_Property_Changed
-{
- const char *interface;
- EDBus_Proxy *proxy;
- const char *name;
- const Eina_Value *value;
-} EDBus_Object_Event_Property_Changed;
-
-typedef struct _EDBus_Object_Event_Property_Removed
-{
- const char *interface;
- EDBus_Proxy *proxy;
- const char *name;
-} EDBus_Object_Event_Property_Removed;
-
-typedef void (*EDBus_Object_Event_Cb)(void *data, EDBus_Object *obj, void *event_info);
-
-/**
- * @brief Add a callback function to be called when an event of the specified
- * type occurs.
- */
-EAPI void edbus_object_event_callback_add(EDBus_Object *obj, EDBus_Object_Event_Type type, EDBus_Object_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
-
-/**
- * @brief Remove callback registered in edbus_object_event_callback_add().
- */
-EAPI void edbus_object_event_callback_del(EDBus_Object *obj, EDBus_Object_Event_Type type, EDBus_Object_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
-
-EAPI EDBus_Connection *edbus_object_connection_get(const EDBus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_object_bus_name_get(const EDBus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_object_path_get(const EDBus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Send a message.
- *
- * @param obj the msg will be sent in connection to this object
- * @param msg message that will be sent
- * @param cb if msg is a method call a callback should be passed
- * to be executed when a response arrives
- * @param cb_data data passed to callback
- * @param timeout timeout in milliseconds, -1 to default internal value or
- * EDBUS_TIMEOUT_INFINITE for no timeout
- */
-EAPI EDBus_Pending *edbus_object_send(EDBus_Object *obj, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Add a signal handler.
- *
- * @param obj where the signal is emitted
- * @param interface of the signal
- * @param member name of the signal
- * @param cb callback that will be called when this signal is received
- * @param cb_data data that will be passed to callback
- */
-EAPI EDBus_Signal_Handler *edbus_object_signal_handler_add(EDBus_Object *obj, const char *interface, const char *member, EDBus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 4);
-
-EAPI EDBus_Message *edbus_object_method_call_new(EDBus_Object *obj, const char *interface, const char *member) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @}
- */
-#endif
diff --git a/src/lib/edbus/edbus_pending.h b/src/lib/edbus/edbus_pending.h
deleted file mode 100644
index a42aa026b9..0000000000
--- a/src/lib/edbus/edbus_pending.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef EDBUS_PENDING_H
-#define EDBUS_PENDING_H 1
-
-/**
- * @defgroup EDBus_Pending Pending
- * @ingroup EDBus
- *
- * @{
- */
-
-EAPI void edbus_pending_data_set(EDBus_Pending *pending, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
-EAPI void *edbus_pending_data_get(const EDBus_Pending *pending, const char *key) EINA_ARG_NONNULL(1, 2);
-EAPI void *edbus_pending_data_del(EDBus_Pending *pending, const char *key) EINA_ARG_NONNULL(1, 2);
-EAPI void edbus_pending_cancel(EDBus_Pending *pending) EINA_ARG_NONNULL(1);
-
-EAPI const char *edbus_pending_destination_get(const EDBus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_pending_path_get(const EDBus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_pending_interface_get(const EDBus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_pending_method_get(const EDBus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Add a callback function to be called when pending will be freed.
- */
-EAPI void edbus_pending_free_cb_add(EDBus_Pending *pending, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Remove callback registered in edbus_pending_free_cb_add().
- */
-EAPI void edbus_pending_free_cb_del(EDBus_Pending *pending, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @}
- */
-#endif
diff --git a/src/lib/edbus/edbus_private.h b/src/lib/edbus/edbus_private.h
deleted file mode 100644
index a1ee0db478..0000000000
--- a/src/lib/edbus/edbus_private.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef EDBUS_PRIVATE_H
-#define EDBUS_PRIVATE_H
-
-#include <dbus/dbus.h>
-#include <Eina.h>
-#include "eina_safety_checks.h"
-#include <Ecore.h>
-#include "EDBus.h"
-#include "edbus_private_types.h"
-
-extern int _edbus_log_dom;
-#define DBG(...) EINA_LOG_DOM_DBG(_edbus_log_dom, __VA_ARGS__)
-#define INF(...) EINA_LOG_DOM_INFO(_edbus_log_dom, __VA_ARGS__)
-#define WRN(...) EINA_LOG_DOM_WARN(_edbus_log_dom, __VA_ARGS__)
-#define ERR(...) EINA_LOG_DOM_ERR(_edbus_log_dom, __VA_ARGS__)
-#define CRITICAL(...) EINA_LOG_DOM_CRIT(_edbus_log_dom, __VA_ARGS__)
-
-#define EDBUS_CONNECTION_MAGIC (0xdb050001)
-#define EDBUS_MESSAGE_MAGIC (0xdb050002)
-#define EDBUS_SIGNAL_HANDLER_MAGIC (0xdb050003)
-#define EDBUS_PENDING_MAGIC (0xdb050004)
-#define EDBUS_OBJECT_MAGIC (0xdb050005)
-#define EDBUS_PROXY_MAGIC (0xdb050006)
-#define EDBUS_MESSAGE_ITERATOR_MAGIC (0xdb050007)
-#define EDBUS_SERVICE_INTERFACE_MAGIC (0xdb050008)
-
-void edbus_cbs_free_dispatch(Eina_Inlist **p_lst, const void *dead_pointer);
-Eina_Inlist *edbus_cbs_free_add(Eina_Inlist *lst, EDBus_Free_Cb cb, const void *data);
-Eina_Inlist *edbus_cbs_free_del(Eina_Inlist *lst, EDBus_Free_Cb cb, const void *data);
-
-void edbus_data_set(Eina_Inlist **p_lst, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
-void *edbus_data_get(Eina_Inlist **p_lst, const char *key) EINA_ARG_NONNULL(1, 2);
-void *edbus_data_del(Eina_Inlist **p_lst, const char *key) EINA_ARG_NONNULL(1, 2);
-void edbus_data_del_all(Eina_Inlist **p_list) EINA_ARG_NONNULL(1);
-
-Eina_Bool edbus_message_init(void);
-void edbus_message_shutdown(void);
-EDBus_Message *edbus_message_new(Eina_Bool writable);
-
-Eina_Bool edbus_signal_handler_init(void);
-void edbus_signal_handler_shutdown(void);
-
-Eina_Bool edbus_pending_init(void);
-void edbus_pending_shutdown(void);
-
-Eina_Bool edbus_object_init(void);
-void edbus_object_shutdown(void);
-
-Eina_Bool edbus_proxy_init(void);
-void edbus_proxy_shutdown(void);
-
-Eina_Bool edbus_service_init(void);
-void edbus_service_shutdown(void);
-
-void edbus_connection_event_callback_call(EDBus_Connection *conn, EDBus_Connection_Event_Type type, const void *event_info) EINA_ARG_NONNULL(1);
-
-Eina_Bool edbus_object_proxy_del(EDBus_Object *obj, EDBus_Proxy *proxy, const char *interface) EINA_ARG_NONNULL(1, 2);
-
-void edbus_connection_signal_handler_add(EDBus_Connection *conn, EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1, 2);
-void edbus_connection_pending_add(EDBus_Connection *conn, EDBus_Pending *pending) EINA_ARG_NONNULL(1, 2);
-void edbus_connection_signal_handler_del(EDBus_Connection *conn, EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1, 2);
-void edbus_connection_signal_handler_del(EDBus_Connection *conn, EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1, 2);
-void edbus_connection_pending_del(EDBus_Connection *conn, EDBus_Pending *pending) EINA_ARG_NONNULL(1, 2);
-
-EDBus_Object *edbus_connection_name_object_get(EDBus_Connection *conn, const char *name, const char *path);
-void edbus_connection_name_object_set(EDBus_Connection *conn, EDBus_Object *obj);
-
-Eina_Bool edbus_object_proxy_add(EDBus_Object *obj, EDBus_Proxy *proxy) EINA_ARG_NONNULL(1, 2);
-EDBus_Proxy *edbus_object_proxy_get(EDBus_Object *obj, const char *interface);
-
-void edbus_connection_name_object_del(EDBus_Connection *conn, const EDBus_Object *obj);
-EDBus_Connection_Name *edbus_connection_name_get(EDBus_Connection *conn, const char *name);
-void edbus_connection_name_owner_monitor(EDBus_Connection *conn, EDBus_Connection_Name *cn, Eina_Bool enable);
-
-EDBus_Pending *_edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout);
-
-EDBus_Message_Iter *edbus_message_iter_sub_iter_get(EDBus_Message_Iter *iter);
-Eina_Value *_message_iter_struct_to_eina_value(EDBus_Message_Iter *iter);
-Eina_Bool _message_iter_from_eina_value_struct(const char *signature, EDBus_Message_Iter *iter, const Eina_Value *value);
-
-void edbus_connection_name_ref(EDBus_Connection_Name *cn);
-void edbus_connection_name_unref(EDBus_Connection *conn, EDBus_Connection_Name *cn);
-EDBus_Signal_Handler *_edbus_signal_handler_add(EDBus_Connection *conn, const char *sender, const char *path, const char *interface, const char *member, EDBus_Signal_Cb cb, const void *cb_data);
-
-EDBus_Message *edbus_message_signal_new(const char *path, const char *interface, const char *name) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
-
-#endif
diff --git a/src/lib/edbus/edbus_proxy.h b/src/lib/edbus/edbus_proxy.h
deleted file mode 100644
index 00b365266e..0000000000
--- a/src/lib/edbus/edbus_proxy.h
+++ /dev/null
@@ -1,147 +0,0 @@
-#ifndef EDBUS_PROXY_H
-#define EDBUS_PROXY_H 1
-
-/**
- * @defgroup EDBus_Proxy Proxy
- * @ingroup EDBus
- *
- * @{
- */
-
-/**
- * @brief Get a proxy of the following interface name in a EDBus_Object.
- */
-EAPI EDBus_Proxy *edbus_proxy_get(EDBus_Object *obj, const char *interface) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Increase proxy reference.
- */
-EAPI EDBus_Proxy *edbus_proxy_ref(EDBus_Proxy *proxy) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Decrease proxy reference.
- * If reference == 0 proxy will be freed and all your children.
- */
-EAPI void edbus_proxy_unref(EDBus_Proxy *proxy) EINA_ARG_NONNULL(1);
-
-EAPI EDBus_Object *edbus_proxy_object_get(const EDBus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_proxy_interface_get(const EDBus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-EAPI void edbus_proxy_data_set(EDBus_Proxy *proxy, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
-EAPI void *edbus_proxy_data_get(const EDBus_Proxy *proxy, const char *key) EINA_ARG_NONNULL(1, 2);
-EAPI void *edbus_proxy_data_del(EDBus_Proxy *proxy, const char *key) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Add a callback function to be called when occurs a event of the
- * type passed.
- */
-EAPI void edbus_proxy_free_cb_add(EDBus_Proxy *proxy, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Remove callback registered in edbus_proxy_free_cb_add().
- */
-EAPI void edbus_proxy_free_cb_del(EDBus_Proxy *proxy, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Constructs a new message to invoke a method on a remote interface.
- */
-EAPI EDBus_Message *edbus_proxy_method_call_new(EDBus_Proxy *proxy, const char *member) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Send a message.
- *
- * @param proxy the msg will be send in connection that proxy belongs
- * @param msg message that will be send
- * @param cb if msg is a method call a callback should be passed
- * @param cb_data data passed to callback
- * @param timeout timeout in milliseconds, -1 to default internal value or
- * EDBUS_TIMEOUT_INFINITE for no timeout
- */
-EAPI EDBus_Pending *edbus_proxy_send(EDBus_Proxy *proxy, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Call a method in proxy.
- * Send a method call to interface that proxy belong with data.
- *
- * @param proxy
- * @param member method name
- * @param cb if msg is a method call a callback should be passed
- * to be execute when response arrive
- * @param cb_data data passed to callback
- * @param timeout timeout in milliseconds, -1 to default internal value or
- * EDBUS_TIMEOUT_INFINITE for no timeout
- * @param signature of data that will be send
- * @param ... data value
- *
- * @note This function only support basic type to complex types use
- * edbus_message_iter_* functions.
- */
-EAPI EDBus_Pending *edbus_proxy_call(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, ...) EINA_ARG_NONNULL(1, 2, 6);
-
-/**
- * @brief Call a method in proxy.
- * Send a method call to interface that proxy belong with data.
- *
- * @param proxy
- * @param member method name
- * @param cb callback that will be called when response arrive.
- * @param cb_data data passed to callback
- * @param timeout timeout in milliseconds, -1 to default internal value or
- * EDBUS_TIMEOUT_INFINITE for no timeout
- * @param signature of data that will be send
- * @param ap va_list of data value
- *
- * @note This function only support basic type to complex types use
- * edbus_message_iter_* functions.
- */
-EAPI EDBus_Pending *edbus_proxy_vcall(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 6);
-
-/**
- * @brief Add a signal handler.
- *
- * @param proxy interface where the signal is emitted
- * @param member name of the signal
- * @param cb callback that will be called when this signal is received
- * @param cb_data data that will be passed to callback
- */
-EAPI EDBus_Signal_Handler *edbus_proxy_signal_handler_add(EDBus_Proxy *proxy, const char *member, EDBus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
-
-typedef enum
-{
- EDBUS_PROXY_EVENT_PROPERTY_CHANGED = 0,
- EDBUS_PROXY_EVENT_PROPERTY_REMOVED,
- EDBUS_PROXY_EVENT_DEL,
- EDBUS_PROXY_EVENT_LAST /**< sentinel, not a real event type */
-} EDBus_Proxy_Event_Type;
-
-typedef struct _EDBus_Proxy_Event_Property_Changed
-{
- const char *name;
- const EDBus_Proxy *proxy;
- const Eina_Value *value;
-} EDBus_Proxy_Event_Property_Changed;
-
-typedef struct _EDBus_Proxy_Event_Property_Removed
-{
- const char *interface;
- const EDBus_Proxy *proxy;
- const char *name;
-} EDBus_Proxy_Event_Property_Removed;
-
-typedef void (*EDBus_Proxy_Event_Cb)(void *data, EDBus_Proxy *proxy, void *event_info);
-
-/**
- * @brief Add a callback function to be called when occurs a event of the
- * type passed.
- */
-EAPI void edbus_proxy_event_callback_add(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, EDBus_Proxy_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
-
-/**
- * @brief Remove callback registered in edbus_proxy_event_callback_add().
- */
-EAPI void edbus_proxy_event_callback_del(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, EDBus_Proxy_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
-
-/**
- * @}
- */
-#endif
diff --git a/src/lib/edbus/edbus_service.h b/src/lib/edbus/edbus_service.h
deleted file mode 100644
index 4496a67312..0000000000
--- a/src/lib/edbus/edbus_service.h
+++ /dev/null
@@ -1,219 +0,0 @@
-#ifndef EDBUS_SERVICE_H
-#define EDBUS_SERVICE_H 1
-
-/**
- * @defgroup EDBus_Service Service
- * @ingroup EDBus
- *
- * @{
- */
-#define EDBUS_METHOD_FLAG_DEPRECATED 1
-#define EDBUS_METHOD_FLAG_NOREPLY (1 << 1)
-
-#define EDBUS_SIGNAL_FLAG_DEPRECATED 1
-
-#define EDBUS_PROPERTY_FLAG_DEPRECATED 1
-
-typedef struct _EDBus_Arg_Info
-{
- const char *signature;
- const char *name;
-} EDBus_Arg_Info;
-
-/**
- * @brief Used to insert complete types to signature of methods or signals.
- *
- * Example: EDBUS_ARGS({"s", "interface"}, {"s", "property"})
- * The signature will be "ss" and each string will have a tag name on
- * introspect XML with the respective name.
- */
-#define EDBUS_ARGS(args...) (const EDBus_Arg_Info[]){ args, { NULL, NULL } }
-
-typedef struct _EDBus_Service_Interface EDBus_Service_Interface;
-typedef EDBus_Message * (*EDBus_Method_Cb)(const EDBus_Service_Interface *iface, const EDBus_Message *message);
-
-/**
- * Callback function to append property value to message.
- *
- * @param iface interface of property
- * @param propname name of property
- * @param iter variant iterator in which value must be appended
- * @param request_msg message that request property
- * @param error if a error happen you must set a message error to be send caller
- *
- * @return EINA_TRUE if success
- *
- * @note request_msg and error arguments are only different from NULL when a
- * client request a property with Properties.Get or Properties.GetAll. Upon
- * calls to edbus_service_property_changed(), this callback will also be called.
- * It's a mistake to return an error in this case because if a property changed,
- * it must have a new value set and it should be able to be read.
- */
-typedef Eina_Bool (*EDBus_Property_Get_Cb)(const EDBus_Service_Interface *iface, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *request_msg, EDBus_Message **error);
-
-/**
- * Callback function to set property value from message.
- *
- * @param iface interface of property
- * @param propname name of property
- * @param input_msg message call where you have to get value
- *
- * @return Message of response, could be a simple method_return, error or NULL to send response later.
- */
-typedef EDBus_Message *(*EDBus_Property_Set_Cb)(const EDBus_Service_Interface *iface, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *input_msg);
-
-typedef struct _EDBus_Method
-{
- const char *member;
- const EDBus_Arg_Info *in;
- const EDBus_Arg_Info *out;
- EDBus_Method_Cb cb;
- unsigned int flags;
-} EDBus_Method;
-
-typedef struct _EDBus_Signal
-{
- const char *name;
- const EDBus_Arg_Info *args;
- unsigned int flags;
-} EDBus_Signal;
-
-typedef struct _EDBus_Property
-{
- const char *name;
- const char *type;
- EDBus_Property_Get_Cb get_func;
- EDBus_Property_Set_Cb set_func;
- unsigned int flags;
-} EDBus_Property;
-
-typedef struct _EDBus_Service_Interface_Desc
-{
- const char *interface; /**< interface name */
- const EDBus_Method *methods; /**< array of the methods that should be registered in this interface, the last item of array should be filled with NULL */
- const EDBus_Signal *signals; /**< array of signal that this interface send, the last item of array should be filled with NULL */
- const EDBus_Property *properties; /**< array of property that this interface have, the last item of array should be filled with NULL */
- const EDBus_Property_Get_Cb default_get; /**< default get function, if a property don't have a get function this will be used */
- const EDBus_Property_Set_Cb default_set; /**< default set function, if a property don't have a set function this will be used */
-} EDBus_Service_Interface_Desc;
-
-/**
- * @brief Register an interface in the given path and connection.
- *
- * @param conn where the interface should listen
- * @param path object path
- * @param desc description of interface
- *
- * @return Interface
- */
-EAPI EDBus_Service_Interface *edbus_service_interface_register(EDBus_Connection *conn, const char *path, const EDBus_Service_Interface_Desc *desc) EINA_ARG_NONNULL(1, 2, 3);
-
-/**
- * @brief Unregister a interface.
- * If this is the last interface of the object path, the object path will be
- * removed too.
- */
-EAPI void edbus_service_interface_unregister(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Unregister all interfaces of the object path that this interface belongs
- * and the object path.
- */
-EAPI void edbus_service_object_unregister(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
-EAPI EDBus_Connection *edbus_service_connection_get(const EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_service_object_path_get(const EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Emit a signal handler of the interface with non-complex types.
- * Each signal handler have a internal id, the first signal handler of
- * interface is = 0 the second = 1 and go on.
- *
- * @param iface interface of the signal
- * @param signal_id id of signal
- * @param ... values that will be send on signal
- */
-EAPI Eina_Bool edbus_service_signal_emit(const EDBus_Service_Interface *iface, unsigned int signal_id, ...) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Create signal message.
- * Each signal handler have a internal id, the first signal handler of
- * interface is = 0 the second = 1 and go on.
- * This function is used when the signal has complex types.
- *
- * @param iface interface of the signal
- * @param signal_id id of signal
- */
-EAPI EDBus_Message *edbus_service_signal_new(const EDBus_Service_Interface *iface, unsigned int signal_id) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Send a signal message.
- *
- * On success this will call edbus_message_unref() on the @param signal_msg,
- * which is the intended behavior in 99% of the cases. Remember to increment
- * the refcount if you want to keep it alive.
- */
-EAPI Eina_Bool edbus_service_signal_send(const EDBus_Service_Interface *iface, EDBus_Message *signal_msg) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Store data at object path, this data can be obtained from all interfaces
- * of the same object.
- *
- * @param iface interface that belong to the object path where data will
- * be stored
- * @param key to identify data
- * @param data
- */
-EAPI void edbus_service_object_data_set(EDBus_Service_Interface *iface, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
-
-/**
- * @brief Get data stored in object path.
- *
- * @param iface interface that belongs to the object path where data are stored
- * @param key that identify data
- *
- * @return pointer to data if found otherwise NULL
- */
-EAPI void *edbus_service_object_data_get(const EDBus_Service_Interface *iface, const char *key) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @brief Del data stored in object path.
- *
- * @param iface interface that belongs to the object path where data are stored
- * @param key that identify data
- *
- * @return pointer to data if found otherwise NULL
- */
-EAPI void *edbus_service_object_data_del(EDBus_Service_Interface *iface, const char *key) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Add property to list of changed properties
- * A DBus.PropertiesChanged signal will be sent in an idler with all properties
- * that have changed.
- *
- * @param iface Interface containing the changed property
- * @param name Property name
- */
-EAPI Eina_Bool edbus_service_property_changed(const EDBus_Service_Interface *iface, const char *name) EINA_ARG_NONNULL(1, 2);
-
-EAPI Eina_Bool edbus_service_property_invalidate_set(const EDBus_Service_Interface *iface, const char *name, Eina_Bool is_invalidate) EINA_ARG_NONNULL(1, 2);
-
-/**
- * Attach ObjectManager interface.
- *
- * @param iface ObjectManager will be attach in object path of this interface.
- * @return EINA_TRUE if success
- */
-EAPI Eina_Bool edbus_service_object_manager_attach(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
-
-/**
- * Detach ObjectManager interface.
- *
- * @param iface ObjectManager of object path of this interface will be detach.
- * @return EINA_TRUE if success
- */
-EAPI Eina_Bool edbus_service_object_manager_detach(EDBus_Service_Interface *iface) EINA_ARG_NONNULL(1);
-
-/**
- * @}
- */
-#endif
diff --git a/src/lib/edbus/edbus_signal_handler.h b/src/lib/edbus/edbus_signal_handler.h
deleted file mode 100644
index 235b209806..0000000000
--- a/src/lib/edbus/edbus_signal_handler.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef EDBUS_SIGNAL_HANDLER_H
-#define EDBUS_SIGNAL_HANDLER_H 1
-
-/**
- * @defgroup EDBus_Signal_Handler Signal Handler
- * @ingroup EDBus
- *
- * @{
- */
-
-/**
- * @brief Add a signal handler.
- *
- * @param conn connection where the signal is emitted
- * @param sender bus name or unique id of where the signal is emitted
- * @param path path of remote object
- * @param interface that signal belongs
- * @param member name of the signal
- * @param cb callback that will be called when this signal is received
- * @param cb_data data that will be passed to callback
- */
-EAPI EDBus_Signal_Handler *edbus_signal_handler_add(EDBus_Connection *conn, const char *sender, const char *path, const char *interface, const char *member, EDBus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 6);
-
-/**
- * @brief Increase signal handler reference.
- */
-EAPI EDBus_Signal_Handler *edbus_signal_handler_ref(EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Decrease signal handler reference.
- * If reference == 0 signal handler will be freed.
- */
-EAPI void edbus_signal_handler_unref(EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Decrease signal handler reference like edbus_signal_handler_unref()
- * but if reference > 0 this signal handler will stop listening to signals. In other
- * words it will be canceled but memory will not be freed.
- */
-EAPI void edbus_signal_handler_del(EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Add extra argument in match of signal handler to obtain specifics signals.
- *
- * Example:
- * edbus_signal_handler_match_extra_set(sh, "arg0", "org.bansheeproject.Banshee", "arg1", "", NULL);
- * With this extra arguments this signal handler callback only will be called
- * when Banshee is started.
- *
- * @note For now only argX is supported.
- *
- * @param sh signal handler
- * @param ... variadic of key and value and must be ended with a NULL
- *
- * @note For more information:
- * http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
- */
-EAPI Eina_Bool edbus_signal_handler_match_extra_set(EDBus_Signal_Handler *sh, ...) EINA_ARG_NONNULL(1) EINA_SENTINEL;
-
-/**
- * @brief Add extra argument in match of signal handler to obtain specifics signals.
- *
- * Example:
- * edbus_signal_handler_match_extra_set(sh, "arg0", "org.bansheeproject.Banshee", "arg1", "", NULL);
- * With this extra arguments this signal handler callback only will be called
- * when Banshee is started.
- *
- * @note For now is only supported argX.
- *
- * @param sh signal handler
- * @param ap va_list with the keys and values, must be ended with a NULL
- *
- * @note To information:
- * http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
- */
-EAPI Eina_Bool edbus_signal_handler_match_extra_vset(EDBus_Signal_Handler *sh, va_list ap) EINA_ARG_NONNULL(1);
-
-/**
- * @brief Add a callback function to be called when signal handler will be freed.
- */
-EAPI void edbus_signal_handler_free_cb_add(EDBus_Signal_Handler *handler, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-/**
- * @brief Remove callback registered in edbus_signal_handler_free_cb_add().
- */
-EAPI void edbus_signal_handler_free_cb_del(EDBus_Signal_Handler *handler, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
-
-EAPI const char *edbus_signal_handler_sender_get(const EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_signal_handler_path_get(const EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_signal_handler_interface_get(const EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_signal_handler_member_get(const EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_signal_handler_match_get(const EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-EAPI EDBus_Connection *edbus_signal_handler_connection_get(const EDBus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-
-/**
- * @}
- */
-#endif
diff --git a/src/lib/efreet/efreet_cache.c b/src/lib/efreet/efreet_cache.c
index ce5512a906..3e145d0df9 100644
--- a/src/lib/efreet/efreet_cache.c
+++ b/src/lib/efreet/efreet_cache.c
@@ -15,7 +15,7 @@
#include <Eet.h>
#include <Ecore.h>
#include <Ecore_File.h>
-#include <EDBus.h>
+#include <Eldbus.h>
/* define macros and variable for using the eina logging system */
#define EFREET_MODULE_LOG_DOM _efreet_cache_log_dom
@@ -40,8 +40,8 @@ struct _Efreet_Old_Cache
#define PATH "/org/enlightenment/Efreet"
#define INTERFACE "org.enlightenment.Efreet"
-static EDBus_Connection *conn = NULL;
-static EDBus_Proxy *proxy = NULL;
+static Eldbus_Connection *conn = NULL;
+static Eldbus_Proxy *proxy = NULL;
/**
* Data for cache files
*/
@@ -93,9 +93,9 @@ static void efreet_cache_icon_theme_free(Efreet_Icon_Theme *theme);
static Eina_Bool efreet_cache_check(Eet_File **ef, const char *path, int major);
static void *efreet_cache_close(Eet_File *ef);
-static void on_send_register(void *data, const EDBus_Message *msg, EDBus_Pending *pending);
-static void desktop_cache_update(void *context, const EDBus_Message *msg);
-static void icon_cache_update(void *context, const EDBus_Message *msg);
+static void on_send_register(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending);
+static void desktop_cache_update(void *context, const Eldbus_Message *msg);
+static void icon_cache_update(void *context, const Eldbus_Message *msg);
static void icon_cache_update_free(void *data, void *ev);
@@ -121,24 +121,24 @@ efreet_cache_init(void)
fallbacks = eina_hash_string_superfast_new(EINA_FREE_CB(efreet_cache_icon_fallback_free));
desktops = eina_hash_string_superfast_new(NULL);
- edbus_init();
+ eldbus_init();
if (efreet_cache_update)
{
- EDBus_Object *obj;
+ Eldbus_Object *obj;
- conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
+ conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
if (!conn) goto error;
- obj = edbus_object_get(conn, BUS, PATH);
- proxy = edbus_proxy_get(obj, INTERFACE);
- edbus_proxy_signal_handler_add(proxy, "IconCacheUpdate", icon_cache_update, NULL);
- edbus_proxy_signal_handler_add(proxy, "DesktopCacheUpdate", desktop_cache_update, NULL);
+ obj = eldbus_object_get(conn, BUS, PATH);
+ proxy = eldbus_proxy_get(obj, INTERFACE);
+ eldbus_proxy_signal_handler_add(proxy, "IconCacheUpdate", icon_cache_update, NULL);
+ eldbus_proxy_signal_handler_add(proxy, "DesktopCacheUpdate", desktop_cache_update, NULL);
- edbus_proxy_call(proxy, "Register", on_send_register, NULL, -1, "s", efreet_language_get());
+ eldbus_proxy_call(proxy, "Register", on_send_register, NULL, -1, "s", efreet_language_get());
/*
* TODO: Needed?
- edbus_name_owner_changed_callback_add(conn, BUS, on_name_owner_changed,
+ eldbus_name_owner_changed_callback_add(conn, BUS, on_name_owner_changed,
conn, EINA_TRUE);
*/
}
@@ -205,17 +205,17 @@ efreet_cache_shutdown(void)
/*
* TODO: Needed??
- edbus_name_owner_changed_callback_del(conn, BUS, on_name_owner_changed, conn);
+ eldbus_name_owner_changed_callback_del(conn, BUS, on_name_owner_changed, conn);
*/
if (conn)
{
- EDBus_Object *obj = edbus_proxy_object_get(proxy);
- edbus_proxy_unref(proxy);
- edbus_object_unref(obj);
- edbus_connection_unref(conn);
+ Eldbus_Object *obj = eldbus_proxy_object_get(proxy);
+ eldbus_proxy_unref(proxy);
+ eldbus_object_unref(obj);
+ eldbus_connection_unref(conn);
}
- edbus_shutdown();
+ eldbus_shutdown();
eina_log_domain_unregister(_efreet_cache_log_dom);
_efreet_cache_log_dom = -1;
@@ -865,56 +865,56 @@ efreet_cache_desktop_free(Efreet_Desktop *desktop)
void
efreet_cache_desktop_add(Efreet_Desktop *desktop)
{
- EDBus_Message *msg;
- EDBus_Message_Iter *iter, *array_of_string;
+ Eldbus_Message *msg;
+ Eldbus_Message_Iter *iter, *array_of_string;
char *path;
if (!efreet_cache_update) return;
/* TODO: Chunk updates */
path = ecore_file_dir_get(desktop->orig_path);
- msg = edbus_proxy_method_call_new(proxy, "AddDesktopDirs");
- iter = edbus_message_iter_get(msg);
- array_of_string = edbus_message_iter_container_new(iter, 'a',"s");
- edbus_message_iter_basic_append(array_of_string, 's', path);
- edbus_message_iter_container_close(iter, array_of_string);
- edbus_proxy_send(proxy, msg, NULL, NULL, -1);
+ msg = eldbus_proxy_method_call_new(proxy, "AddDesktopDirs");
+ iter = eldbus_message_iter_get(msg);
+ array_of_string = eldbus_message_iter_container_new(iter, 'a',"s");
+ eldbus_message_iter_basic_append(array_of_string, 's', path);
+ eldbus_message_iter_container_close(iter, array_of_string);
+ eldbus_proxy_send(proxy, msg, NULL, NULL, -1);
free(path);
}
void
efreet_cache_icon_exts_add(Eina_List *exts)
{
- EDBus_Message *msg;
- EDBus_Message_Iter *iter, *array_of_string;
+ Eldbus_Message *msg;
+ Eldbus_Message_Iter *iter, *array_of_string;
Eina_List *l;
const char *ext;
if (!efreet_cache_update) return;
- msg = edbus_proxy_method_call_new(proxy, "AddIconExts");
- iter = edbus_message_iter_get(msg);
- array_of_string = edbus_message_iter_container_new(iter, 'a',"s");
+ msg = eldbus_proxy_method_call_new(proxy, "AddIconExts");
+ iter = eldbus_message_iter_get(msg);
+ array_of_string = eldbus_message_iter_container_new(iter, 'a',"s");
EINA_LIST_FOREACH(exts, l, ext)
- edbus_message_iter_basic_append(array_of_string, 's', ext);
- edbus_message_iter_container_close(iter, array_of_string);
- edbus_proxy_send(proxy, msg, NULL, NULL, -1);
+ eldbus_message_iter_basic_append(array_of_string, 's', ext);
+ eldbus_message_iter_container_close(iter, array_of_string);
+ eldbus_proxy_send(proxy, msg, NULL, NULL, -1);
}
void
efreet_cache_icon_dirs_add(Eina_List *dirs)
{
- EDBus_Message *msg;
- EDBus_Message_Iter *iter, *array_of_string;
+ Eldbus_Message *msg;
+ Eldbus_Message_Iter *iter, *array_of_string;
Eina_List *l;
const char *dir;
if (!efreet_cache_update) return;
- msg = edbus_proxy_method_call_new(proxy, "AddIconDirs");
- iter = edbus_message_iter_get(msg);
- array_of_string = edbus_message_iter_container_new(iter, 'a',"s");
+ msg = eldbus_proxy_method_call_new(proxy, "AddIconDirs");
+ iter = eldbus_message_iter_get(msg);
+ array_of_string = eldbus_message_iter_container_new(iter, 'a',"s");
EINA_LIST_FOREACH(dirs, l, dir)
- edbus_message_iter_basic_append(array_of_string, 's', dir);
- edbus_message_iter_container_close(iter, array_of_string);
- edbus_proxy_send(proxy, msg, NULL, NULL, -1);
+ eldbus_message_iter_basic_append(array_of_string, 's', dir);
+ eldbus_message_iter_container_close(iter, array_of_string);
+ eldbus_proxy_send(proxy, msg, NULL, NULL, -1);
}
void
@@ -958,7 +958,7 @@ efreet_cache_desktop_build(void)
{
if (!efreet_cache_update) return;
if (proxy)
- edbus_proxy_call(proxy, "BuildDesktopCache", NULL, NULL, -1, "s", efreet_language_get());
+ eldbus_proxy_call(proxy, "BuildDesktopCache", NULL, NULL, -1, "s", efreet_language_get());
}
static Eina_Bool
@@ -1053,12 +1053,12 @@ efreet_cache_util_names(const char *key)
}
static void
-on_send_register(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_send_register(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
Eina_Bool exists;
- if (edbus_message_error_get(msg, &errname, &errmsg))
+ if (eldbus_message_error_get(msg, &errname, &errmsg))
{
Efreet_Event_Cache_Update *ev = NULL;
@@ -1071,16 +1071,16 @@ on_send_register(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending
ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, ev, NULL, NULL);
}
}
- else if (edbus_message_arguments_get(msg, "b", &exists) && exists)
+ else if (eldbus_message_arguments_get(msg, "b", &exists) && exists)
ecore_event_add(EFREET_EVENT_DESKTOP_CACHE_BUILD, NULL, NULL, NULL);
}
static void
-desktop_cache_update(void *context EINA_UNUSED, const EDBus_Message *msg)
+desktop_cache_update(void *context EINA_UNUSED, const Eldbus_Message *msg)
{
Eina_Bool update;
- if (edbus_message_arguments_get(msg, "b", &update))
+ if (eldbus_message_arguments_get(msg, "b", &update))
{
if (update)
{
@@ -1097,14 +1097,14 @@ desktop_cache_update(void *context EINA_UNUSED, const EDBus_Message *msg)
}
static void
-icon_cache_update(void *context EINA_UNUSED, const EDBus_Message *msg)
+icon_cache_update(void *context EINA_UNUSED, const Eldbus_Message *msg)
{
Efreet_Event_Cache_Update *ev = NULL;
Efreet_Old_Cache *d = NULL;
Eina_List *l = NULL;
Eina_Bool update;
- if (edbus_message_arguments_get(msg, "b", &update) && update)
+ if (eldbus_message_arguments_get(msg, "b", &update) && update)
{
ev = NEW(Efreet_Event_Cache_Update, 1);
if (!ev) goto error;
diff --git a/src/lib/eldbus/Eldbus.h b/src/lib/eldbus/Eldbus.h
new file mode 100644
index 0000000000..e49061d4d4
--- /dev/null
+++ b/src/lib/eldbus/Eldbus.h
@@ -0,0 +1,222 @@
+/**
+ * @page eldbus_main Eldbus
+ *
+ * @date 2012 (created)
+ *
+ * @section toc Table of Contents
+ *
+ * @li @ref eldbus_main_intro
+ * @li @ref eldbus_main_compiling
+ * @li @ref eldbus_main_next_steps
+ * @li @ref eldbus_main_intro_example
+ *
+ * @section eldbus_main_intro Introduction
+ *
+ * Eldbus is a wrapper around the
+ * <a href="http://www.freedesktop.org/wiki/Software/dbus">dbus</a>
+ * library, which is a message bus system. It also implements a set of
+ * specifications using dbus as interprocess communication.
+ *
+ * @subsection eldbus_modules_sec Modules
+ *
+ * <ul>
+ * <li> @ref Eldbus_Core
+ * <li> @ref Eldbus_Conneciton
+ * <li> @ref Eldbus_Object_Mapper
+ * <li> @ref Eldbus_Proxy
+ * <li> @ref Eldbus_Message
+ * <ul>
+ * <li>@ref Eldbus_Message_Iter
+ * <li>@ref Eldbus_Message_Helpers
+ * <li>@ref Eina_Value
+ * </ul>
+ * <li> @ref Eldbus_Signal_Handler
+ * <li> @ref Eldbus_Pending
+ * <li> @ref Eldbus_Service
+ * <li> @ref Eldbus_Basic
+ * </ul>
+ *
+ * @section eldbus_main_compiling How to compile
+ *
+ * Eldbus is a library your application links to. The procedure for this is
+ * very simple. You simply have to compile your application with the
+ * appropriate compiler flags that the @c pkg-config script outputs. For
+ * example:
+ *
+ * Compiling C or C++ files into object files:
+ *
+ * @verbatim
+ gcc -c -o main.o main.c `pkg-config --cflags eldbus`
+ @endverbatim
+ *
+ * Linking object files into a binary executable:
+ *
+ * @verbatim
+ gcc -o my_application main.o `pkg-config --libs eldbus`
+ @endverbatim
+ *
+ * See @ref pkgconfig
+ *
+ * @section eldbus_main_next_steps Next Steps
+ *
+ * After you understood what Eldbus is and installed it in your system
+ * you should proceed understanding the programming interface.
+ *
+ * Recommended reading:
+ * @li @ref Eldbus_Core for library init, shutdown and getting a connection.
+ * @li @ref Eldbus_Proxy to easily bind a client object to an interface.
+ * @li @ref Eldbus_Object_Mapper to monitor server objects and properties.
+ *
+ * @section eldbus_main_intro_example Introductory Example
+ *
+ * @include ofono-dial.c
+ *
+ * More examples can be found at @ref eldbus_examples.
+ */
+#ifndef ELDBUS_H
+#define ELDBUS_H
+
+#include <Eina.h>
+#include <stdarg.h>
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_ELDBUS_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
+# else
+# define EAPI __declspec(dllimport)
+# endif /* ! EFL_ELDBUS_BUILD */
+#else
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
+# else
+# define EAPI
+# endif
+# else
+# define EAPI
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup Eldbus_Core Core
+ * @ingroup Eldbus
+ *
+ * @{
+ */
+#define ELDBUS_VERSION_MAJOR 1
+#define ELDBUS_VERSION_MINOR 8
+
+#define ELDBUS_FDO_BUS "org.freedesktop.DBus"
+#define ELDBUS_FDO_PATH "/org/freedesktop/DBus"
+#define ELDBUS_FDO_INTERFACE ELDBUS_FDO_BUS
+#define ELDBUS_FDO_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
+#define ELDBUS_FDO_INTERFACE_OBJECT_MANAGER "org.freedesktop.DBus.ObjectManager"
+#define ELDBUS_FDO_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
+#define ELDBUS_FDO_INTEFACE_PEER "org.freedesktop.DBus.Peer"
+#define ELDBUS_ERROR_PENDING_CANCELED "org.enlightenment.DBus.Canceled"
+
+typedef struct _Eldbus_Version
+{
+ int major;
+ int minor;
+ int micro;
+ int revision;
+} Eldbus_Version;
+
+EAPI extern const Eldbus_Version * eldbus_version;
+
+/**
+ * @brief Initialize eldbus.
+ *
+ * @return 1 or greater on success, 0 otherwise
+ */
+EAPI int eldbus_init(void);
+/**
+ * @brief Shutdown eldbus.
+ *
+ * @return 0 if e_dbus shuts down, greater than 0 otherwise.
+ */
+EAPI int eldbus_shutdown(void);
+
+typedef void (*Eldbus_Free_Cb)(void *data, const void *deadptr);
+
+/**
+ * @typedef Eldbus_Connection
+ *
+ * Represents a connection of one the type of connection with the DBus daemon.
+ */
+typedef struct _Eldbus_Connection Eldbus_Connection;
+/**
+ * @typedef Eldbus_Object
+ *
+ * Represents an object path already attached with bus name or unique id.
+ */
+typedef struct _Eldbus_Object Eldbus_Object;
+/**
+ * @typedef Eldbus_Proxy
+ *
+ * Represents an interface of an object path.
+ */
+typedef struct _Eldbus_Proxy Eldbus_Proxy;
+/**
+ * @typedef Eldbus_Message
+ *
+ * Represents the way data is sent and received in DBus.
+ */
+typedef struct _Eldbus_Message Eldbus_Message;
+/**
+ * @typedef Eldbus_Message_Iter
+ *
+ * Represents an iterator over a complex message type (array, dict, struct,
+ * or variant). Its life is bound to the message that contains
+ * it. The same applies to the returned data.
+ */
+typedef struct _Eldbus_Message_Iter Eldbus_Message_Iter;
+/**
+ * @typedef Eldbus_Pending
+ *
+ * Represents a message that has been sent but has not yet reached its
+ * destination.
+ */
+typedef struct _Eldbus_Pending Eldbus_Pending;
+
+/**
+ * @typedef Eldbus_Signal_Handler
+ *
+ * Represents a listener that will listen for signals emitted by other
+ * applications.
+ */
+typedef struct _Eldbus_Signal_Handler Eldbus_Signal_Handler;
+
+typedef void (*Eldbus_Message_Cb)(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending);
+typedef void (*Eldbus_Signal_Cb)(void *data, const Eldbus_Message *msg);
+/**
+ * @}
+ */
+
+#include "eldbus_connection.h"
+#include "eldbus_message.h"
+#include "eldbus_signal_handler.h"
+#include "eldbus_pending.h"
+#include "eldbus_object.h"
+#include "eldbus_proxy.h"
+#include "eldbus_freedesktop.h"
+#include "eldbus_service.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/lib/eldbus/eldbus_connection.h b/src/lib/eldbus/eldbus_connection.h
new file mode 100644
index 0000000000..8fd8136195
--- /dev/null
+++ b/src/lib/eldbus/eldbus_connection.h
@@ -0,0 +1,139 @@
+#ifndef ELDBUS_CONNECTION_H
+#define ELDBUS_CONNECTION_H 1
+
+/**
+ * @defgroup Eldbus_Conneciton Connection
+ * @ingroup Eldbus
+ *
+ * @{
+ */
+typedef enum
+{
+ ELDBUS_CONNECTION_TYPE_UNKNOWN = 0, /**< sentinel, not a real type */
+ ELDBUS_CONNECTION_TYPE_SESSION,
+ ELDBUS_CONNECTION_TYPE_SYSTEM,
+ ELDBUS_CONNECTION_TYPE_STARTER,
+ ELDBUS_CONNECTION_TYPE_LAST /**< sentinel, not a real type */
+} Eldbus_Connection_Type;
+
+#define ELDBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
+
+/**
+ * Establish a connection to bus and integrate it with the ecore main
+ * loop. If a connection of given type was already created before, its
+ * reference counter is incremented and the connection is returned.
+ *
+ * @param type type of connection e.g ELDBUS_CONNECTION_TYPE_SESSION,
+ * ELDBUS_CONNECTION_TYPE_SYSTEM or ELDBUS_CONNECTION_TYPE_STARTER
+ *
+ * @return connection with bus
+ */
+EAPI Eldbus_Connection *eldbus_connection_get(Eldbus_Connection_Type type);
+
+/**
+ * Always create and establish a new connection to bus and integrate it with
+ * the ecore main loop. Differently from eldbus_connection_get(), this function
+ * guarantees to create a new connection to the D-Bus daemon and the connection
+ * is not shared by any means.
+ *
+ * @param type type of connection e.g ELDBUS_CONNECTION_TYPE_SESSION,
+ * ELDBUS_CONNECTION_TYPE_SYSTEM or ELDBUS_CONNECTION_TYPE_STARTER
+ *
+ * @return connection with bus
+ */
+EAPI Eldbus_Connection *eldbus_private_connection_get(Eldbus_Connection_Type type);
+
+/**
+ * @brief Increment connection reference count.
+ *
+ * @param conn The given Eldbus_Connection object to reference
+ */
+EAPI Eldbus_Connection *eldbus_connection_ref(Eldbus_Connection *conn) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Decrement connection reference count.
+ *
+ * If reference count reaches 0, the connection to bus will be dropped and all
+ * its children will be invalidated.
+ */
+EAPI void eldbus_connection_unref(Eldbus_Connection *conn) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Add a callback function to be called when connection is freed
+ *
+ * @param conn The connection object to add the callback to.
+ * @param cb callback to be called
+ * @param data data passed to callback
+ */
+EAPI void eldbus_connection_free_cb_add(Eldbus_Connection *conn, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Remove callback registered in eldbus_connection_free_cb_add().
+ */
+EAPI void eldbus_connection_free_cb_del(Eldbus_Connection *conn, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Set an attached data pointer to an object with a given string key.
+ *
+ * @param conn The connection object to store data to
+ * @param key to identify data
+ * @param data data that will be stored
+ */
+EAPI void eldbus_connection_data_set(Eldbus_Connection *conn, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
+
+/**
+ * @brief Get data stored in connection.
+ *
+ * @param conn connection where data is stored
+ * @param key key that identifies data
+ *
+ * @return pointer to data if found otherwise NULL
+ */
+EAPI void *eldbus_connection_data_get(const Eldbus_Connection *conn, const char *key) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Del data stored in connection.
+ *
+ * @param conn connection where data is stored
+ * @param key that identifies data
+ *
+ * @return pointer to data if found otherwise NULL
+ */
+EAPI void *eldbus_connection_data_del(Eldbus_Connection *conn, const char *key) EINA_ARG_NONNULL(1, 2);
+
+typedef enum
+{
+ ELDBUS_CONNECTION_EVENT_DEL,
+ ELDBUS_CONNECTION_EVENT_DISCONNECTED,
+ ELDBUS_CONNECTION_EVENT_LAST /**< sentinel, not a real event type */
+} Eldbus_Connection_Event_Type;
+
+typedef void (*Eldbus_Connection_Event_Cb)(void *data, Eldbus_Connection *conn, void *event_info);
+
+/**
+ * @brief Add a callback function to be called when an event occurs of the
+ * type passed.
+ */
+EAPI void eldbus_connection_event_callback_add(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, Eldbus_Connection_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
+
+/**
+ * @brief Remove callback registered in eldbus_connection_event_callback_add().
+ */
+EAPI void eldbus_connection_event_callback_del(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, Eldbus_Connection_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
+
+/**
+ * @brief Send a message.
+ *
+ * @param conn the connection where the message will be sent
+ * @param msg message that will be sent
+ * @param cb if msg is a method call a callback should be passed
+ * to be executed when a response arrives
+ * @param cb_data data passed to callback
+ * @param timeout timeout in milliseconds, -1 to use default internal value or
+ * ELDBUS_TIMEOUT_INFINITE for no timeout
+ */
+EAPI Eldbus_Pending *eldbus_connection_send(Eldbus_Connection *conn, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2);
+/**
+ * @}
+ */
+#endif
diff --git a/src/lib/edbus/edbus_core.c b/src/lib/eldbus/eldbus_core.c
index ccae5773b8..c2b3b57b8f 100644
--- a/src/lib/edbus/edbus_core.c
+++ b/src/lib/eldbus/eldbus_core.c
@@ -2,102 +2,102 @@
# include "config.h"
#endif
-#include "edbus_private.h"
-#include "edbus_private_types.h"
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
-#define EDBUS_CONNECTION_CHECK(conn) \
+#define ELDBUS_CONNECTION_CHECK(conn) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN(conn); \
- if (!EINA_MAGIC_CHECK(conn, EDBUS_CONNECTION_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(conn, ELDBUS_CONNECTION_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(conn, EDBUS_CONNECTION_MAGIC); \
+ EINA_MAGIC_FAIL(conn, ELDBUS_CONNECTION_MAGIC); \
return; \
} \
EINA_SAFETY_ON_TRUE_RETURN(conn->refcount <= 0); \
} \
while (0)
-#define EDBUS_CONNECTION_CHECK_RETVAL(conn, retval) \
+#define ELDBUS_CONNECTION_CHECK_RETVAL(conn, retval) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, retval); \
- if (!EINA_MAGIC_CHECK(conn, EDBUS_CONNECTION_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(conn, ELDBUS_CONNECTION_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(conn, EDBUS_CONNECTION_MAGIC); \
+ EINA_MAGIC_FAIL(conn, ELDBUS_CONNECTION_MAGIC); \
return retval; \
} \
EINA_SAFETY_ON_TRUE_RETURN_VAL(conn->refcount <= 0, retval); \
} \
while (0)
-typedef struct _EDBus_Connection_Context_Event_Cb
+typedef struct _Eldbus_Connection_Context_Event_Cb
{
EINA_INLIST;
- EDBus_Connection_Event_Cb cb;
+ Eldbus_Connection_Event_Cb cb;
const void *cb_data;
Eina_Bool deleted : 1;
-} EDBus_Connection_Context_Event_Cb;
+} Eldbus_Connection_Context_Event_Cb;
-typedef struct _EDBus_Connection_Context_NOC_Cb
+typedef struct _Eldbus_Connection_Context_NOC_Cb
{
EINA_INLIST;
- EDBus_Name_Owner_Changed_Cb cb;
+ Eldbus_Name_Owner_Changed_Cb cb;
const void *cb_data;
Eina_Bool deleted : 1;
Ecore_Idler *idler;
Eina_Bool allow_initial : 1;
-} EDBus_Connection_Context_NOC_Cb;
+} Eldbus_Connection_Context_NOC_Cb;
-typedef struct _EDBus_Handler_Data
+typedef struct _Eldbus_Handler_Data
{
EINA_INLIST;
int fd;
Ecore_Fd_Handler *fd_handler;
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
DBusWatch *watch;
int enabled;
-} EDBus_Handler_Data;
+} Eldbus_Handler_Data;
-typedef struct _EDBus_Timeout_Data
+typedef struct _Eldbus_Timeout_Data
{
EINA_INLIST;
Ecore_Timer *handler;
DBusTimeout *timeout;
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
int interval;
-} EDBus_Timeout_Data;
+} Eldbus_Timeout_Data;
-static const EDBus_Version _version = {VMAJ, VMIN, VMIC, VREV};
-EAPI const EDBus_Version * edbus_version = &_version;
+static const Eldbus_Version _version = {VMAJ, VMIN, VMIC, VREV};
+EAPI const Eldbus_Version * eldbus_version = &_version;
-static int _edbus_init_count = 0;
-int _edbus_log_dom = -1;
+static int _eldbus_init_count = 0;
+int _eldbus_log_dom = -1;
-/* We don't save EDBUS_CONNECTION_TYPE_UNKNOWN in here so we need room for
+/* We don't save ELDBUS_CONNECTION_TYPE_UNKNOWN in here so we need room for
* last - 1 elements */
-static EDBus_Connection *shared_connections[EDBUS_CONNECTION_TYPE_LAST - 1];
+static Eldbus_Connection *shared_connections[ELDBUS_CONNECTION_TYPE_LAST - 1];
-static void _edbus_connection_event_callback_call(EDBus_Connection *conn, EDBus_Connection_Event_Type type, const void *event_info);
-static void _edbus_connection_context_event_cb_del(EDBus_Connection_Context_Event *ce, EDBus_Connection_Context_Event_Cb *ctx);
-static void edbus_dispatch_name_owner_change(EDBus_Connection_Name *cn, const char *old_id);
+static void _eldbus_connection_event_callback_call(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, const void *event_info);
+static void _eldbus_connection_context_event_cb_del(Eldbus_Connection_Context_Event *ce, Eldbus_Connection_Context_Event_Cb *ctx);
+static void eldbus_dispatch_name_owner_change(Eldbus_Connection_Name *cn, const char *old_id);
EAPI int
-edbus_init(void)
+eldbus_init(void)
{
- if (_edbus_init_count > 0)
- return ++_edbus_init_count;
+ if (_eldbus_init_count > 0)
+ return ++_eldbus_init_count;
if (!eina_init())
{
- fputs("EDBus: Unable to initialize eina\n", stderr);
+ fputs("Eldbus: Unable to initialize eina\n", stderr);
return 0;
}
- _edbus_log_dom = eina_log_domain_register("edbus", EINA_COLOR_BLUE);
- if (_edbus_log_dom < 0)
+ _eldbus_log_dom = eina_log_domain_register("eldbus", EINA_COLOR_BLUE);
+ if (_eldbus_log_dom < 0)
{
- EINA_LOG_ERR("Unable to create an 'edbus' log domain");
+ EINA_LOG_ERR("Unable to create an 'eldbus' log domain");
eina_shutdown();
return 0;
}
@@ -105,62 +105,62 @@ edbus_init(void)
if (!ecore_init())
{
ERR("Unable to initialize ecore");
- eina_log_domain_unregister(_edbus_log_dom);
- _edbus_log_dom = -1;
+ eina_log_domain_unregister(_eldbus_log_dom);
+ _eldbus_log_dom = -1;
eina_shutdown();
return 0;
}
- eina_magic_string_set(EDBUS_CONNECTION_MAGIC, "EDBus_Connection");
- eina_magic_string_set(EDBUS_MESSAGE_MAGIC, "EDBus_Message");
- eina_magic_string_set(EDBUS_SIGNAL_HANDLER_MAGIC, "EDBus_Signal_Handler");
- eina_magic_string_set(EDBUS_PENDING_MAGIC, "EDBus_Pending");
- eina_magic_string_set(EDBUS_OBJECT_MAGIC, "EDBus_Object");
- eina_magic_string_set(EDBUS_PROXY_MAGIC, "EDBus_Proxy");
- eina_magic_string_set(EDBUS_MESSAGE_ITERATOR_MAGIC, "EDBus_Message_Iterator");
- eina_magic_string_set(EDBUS_SERVICE_INTERFACE_MAGIC, "EDBus_Service_Interface");
+ eina_magic_string_set(ELDBUS_CONNECTION_MAGIC, "Eldbus_Connection");
+ eina_magic_string_set(ELDBUS_MESSAGE_MAGIC, "Eldbus_Message");
+ eina_magic_string_set(ELDBUS_SIGNAL_HANDLER_MAGIC, "Eldbus_Signal_Handler");
+ eina_magic_string_set(ELDBUS_PENDING_MAGIC, "Eldbus_Pending");
+ eina_magic_string_set(ELDBUS_OBJECT_MAGIC, "Eldbus_Object");
+ eina_magic_string_set(ELDBUS_PROXY_MAGIC, "Eldbus_Proxy");
+ eina_magic_string_set(ELDBUS_MESSAGE_ITERATOR_MAGIC, "Eldbus_Message_Iterator");
+ eina_magic_string_set(ELDBUS_SERVICE_INTERFACE_MAGIC, "Eldbus_Service_Interface");
- if (!edbus_message_init()) goto message_failed;
- if (!edbus_signal_handler_init()) goto signal_handler_failed;
- if (!edbus_pending_init()) goto pending_failed;
- if (!edbus_object_init()) goto object_failed;
- if (!edbus_proxy_init()) goto proxy_failed;
- if (!edbus_service_init()) goto service_failed;
+ if (!eldbus_message_init()) goto message_failed;
+ if (!eldbus_signal_handler_init()) goto signal_handler_failed;
+ if (!eldbus_pending_init()) goto pending_failed;
+ if (!eldbus_object_init()) goto object_failed;
+ if (!eldbus_proxy_init()) goto proxy_failed;
+ if (!eldbus_service_init()) goto service_failed;
- return ++_edbus_init_count;
+ return ++_eldbus_init_count;
service_failed:
- edbus_proxy_shutdown();
+ eldbus_proxy_shutdown();
proxy_failed:
- edbus_object_shutdown();
+ eldbus_object_shutdown();
object_failed:
- edbus_pending_shutdown();
+ eldbus_pending_shutdown();
pending_failed:
- edbus_signal_handler_shutdown();
+ eldbus_signal_handler_shutdown();
signal_handler_failed:
- edbus_message_shutdown();
+ eldbus_message_shutdown();
message_failed:
ecore_shutdown();
- eina_log_domain_unregister(_edbus_log_dom);
- _edbus_log_dom = -1;
+ eina_log_domain_unregister(_eldbus_log_dom);
+ _eldbus_log_dom = -1;
eina_shutdown();
return 0;
}
static void
-print_live_connection(EDBus_Connection *conn)
+print_live_connection(Eldbus_Connection *conn)
{
if (!conn->names)
ERR("conn=%p has no alive objects", conn);
else
{
Eina_Iterator *iter = eina_hash_iterator_data_new(conn->names);
- EDBus_Connection_Name *name;
+ Eldbus_Connection_Name *name;
EINA_ITERATOR_FOREACH(iter, name)
{
- EDBus_Object *obj;
+ Eldbus_Object *obj;
Eina_Iterator *inner_itr;
if (!name->objects) continue;
@@ -177,79 +177,79 @@ print_live_connection(EDBus_Connection *conn)
ERR("conn=%p has no alive pending calls", conn);
else
{
- EDBus_Pending *p;
+ Eldbus_Pending *p;
EINA_INLIST_FOREACH(conn->pendings, p)
ERR("conn=%p alive pending call=%p dest=%s path=%s %s.%s()",
conn, p,
- edbus_pending_destination_get(p),
- edbus_pending_path_get(p),
- edbus_pending_interface_get(p),
- edbus_pending_method_get(p));
+ eldbus_pending_destination_get(p),
+ eldbus_pending_path_get(p),
+ eldbus_pending_interface_get(p),
+ eldbus_pending_method_get(p));
}
}
EAPI int
-edbus_shutdown(void)
+eldbus_shutdown(void)
{
- if (_edbus_init_count <= 0)
+ if (_eldbus_init_count <= 0)
{
ERR("Init count not greater than 0 in shutdown.");
- _edbus_init_count = 0;
+ _eldbus_init_count = 0;
return 0;
}
- if (--_edbus_init_count)
- return _edbus_init_count;
+ if (--_eldbus_init_count)
+ return _eldbus_init_count;
- if (shared_connections[EDBUS_CONNECTION_TYPE_SESSION - 1])
+ if (shared_connections[ELDBUS_CONNECTION_TYPE_SESSION - 1])
{
CRITICAL("Alive TYPE_SESSION connection");
- print_live_connection(shared_connections[EDBUS_CONNECTION_TYPE_SESSION - 1]);
+ print_live_connection(shared_connections[ELDBUS_CONNECTION_TYPE_SESSION - 1]);
}
- if (shared_connections[EDBUS_CONNECTION_TYPE_SYSTEM - 1])
+ if (shared_connections[ELDBUS_CONNECTION_TYPE_SYSTEM - 1])
{
CRITICAL("Alive TYPE_SYSTEM connection");
- print_live_connection(shared_connections[EDBUS_CONNECTION_TYPE_SYSTEM - 1]);
+ print_live_connection(shared_connections[ELDBUS_CONNECTION_TYPE_SYSTEM - 1]);
}
- if (shared_connections[EDBUS_CONNECTION_TYPE_STARTER - 1])
+ if (shared_connections[ELDBUS_CONNECTION_TYPE_STARTER - 1])
{
CRITICAL("Alive TYPE_STARTER connection");
- print_live_connection(shared_connections[EDBUS_CONNECTION_TYPE_STARTER - 1]);
+ print_live_connection(shared_connections[ELDBUS_CONNECTION_TYPE_STARTER - 1]);
}
- edbus_service_shutdown();
- edbus_proxy_shutdown();
- edbus_object_shutdown();
- edbus_pending_shutdown();
- edbus_signal_handler_shutdown();
- edbus_message_shutdown();
+ eldbus_service_shutdown();
+ eldbus_proxy_shutdown();
+ eldbus_object_shutdown();
+ eldbus_pending_shutdown();
+ eldbus_signal_handler_shutdown();
+ eldbus_message_shutdown();
ecore_shutdown();
- eina_log_domain_unregister(_edbus_log_dom);
- _edbus_log_dom = -1;
+ eina_log_domain_unregister(_eldbus_log_dom);
+ _eldbus_log_dom = -1;
eina_shutdown();
return 0;
}
-/* TODO: mempool of EDBus_Context_Free_Cb */
-typedef struct _EDBus_Context_Free_Cb
+/* TODO: mempool of Eldbus_Context_Free_Cb */
+typedef struct _Eldbus_Context_Free_Cb
{
EINA_INLIST;
- EDBus_Free_Cb cb;
+ Eldbus_Free_Cb cb;
const void *data;
-} EDBus_Context_Free_Cb;
+} Eldbus_Context_Free_Cb;
void
-edbus_cbs_free_dispatch(Eina_Inlist **p_lst, const void *dead_pointer)
+eldbus_cbs_free_dispatch(Eina_Inlist **p_lst, const void *dead_pointer)
{
Eina_Inlist *lst = *p_lst;
*p_lst = NULL;
while (lst)
{
Eina_Inlist *next = lst->next;
- EDBus_Context_Free_Cb *ctx;
+ Eldbus_Context_Free_Cb *ctx;
- ctx = EINA_INLIST_CONTAINER_GET(lst, EDBus_Context_Free_Cb);
+ ctx = EINA_INLIST_CONTAINER_GET(lst, Eldbus_Context_Free_Cb);
ctx->cb((void *)ctx->data, dead_pointer);
free(ctx);
@@ -258,9 +258,9 @@ edbus_cbs_free_dispatch(Eina_Inlist **p_lst, const void *dead_pointer)
}
Eina_Inlist *
-edbus_cbs_free_add(Eina_Inlist *lst, EDBus_Free_Cb cb, const void *data)
+eldbus_cbs_free_add(Eina_Inlist *lst, Eldbus_Free_Cb cb, const void *data)
{
- EDBus_Context_Free_Cb *ctx = malloc(sizeof(EDBus_Context_Free_Cb));
+ Eldbus_Context_Free_Cb *ctx = malloc(sizeof(Eldbus_Context_Free_Cb));
EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, lst);
ctx->cb = cb;
@@ -270,9 +270,9 @@ edbus_cbs_free_add(Eina_Inlist *lst, EDBus_Free_Cb cb, const void *data)
}
Eina_Inlist *
-edbus_cbs_free_del(Eina_Inlist *lst, EDBus_Free_Cb cb, const void *data)
+eldbus_cbs_free_del(Eina_Inlist *lst, Eldbus_Free_Cb cb, const void *data)
{
- EDBus_Context_Free_Cb *ctx;
+ Eldbus_Context_Free_Cb *ctx;
EINA_INLIST_FOREACH(lst, ctx)
{
@@ -288,19 +288,19 @@ edbus_cbs_free_del(Eina_Inlist *lst, EDBus_Free_Cb cb, const void *data)
return lst;
}
-typedef struct _EDBus_Data
+typedef struct _Eldbus_Data
{
EINA_INLIST;
const void *data;
unsigned int keylen;
char key[];
-} EDBus_Data;
+} Eldbus_Data;
-static inline EDBus_Data *
-edbus_data_find(Eina_Inlist **p_lst, const char *key)
+static inline Eldbus_Data *
+eldbus_data_find(Eina_Inlist **p_lst, const char *key)
{
unsigned int keylen = strlen(key);
- EDBus_Data *d;
+ Eldbus_Data *d;
EINA_INLIST_FOREACH(*p_lst, d)
{
@@ -315,9 +315,9 @@ edbus_data_find(Eina_Inlist **p_lst, const char *key)
}
void
-edbus_data_set(Eina_Inlist **p_lst, const char *key, const void *data)
+eldbus_data_set(Eina_Inlist **p_lst, const char *key, const void *data)
{
- EDBus_Data *d = edbus_data_find(p_lst, key);
+ Eldbus_Data *d = eldbus_data_find(p_lst, key);
unsigned int keylen = strlen(key);
if (d)
@@ -326,7 +326,7 @@ edbus_data_set(Eina_Inlist **p_lst, const char *key, const void *data)
free(d);
}
- d = malloc(sizeof(EDBus_Data) + keylen + 1);
+ d = malloc(sizeof(Eldbus_Data) + keylen + 1);
EINA_SAFETY_ON_NULL_RETURN(d);
d->data = data;
@@ -337,16 +337,16 @@ edbus_data_set(Eina_Inlist **p_lst, const char *key, const void *data)
}
void *
-edbus_data_get(Eina_Inlist **p_lst, const char *key)
+eldbus_data_get(Eina_Inlist **p_lst, const char *key)
{
- EDBus_Data *d = edbus_data_find(p_lst, key);
+ Eldbus_Data *d = eldbus_data_find(p_lst, key);
return d ? (void *)d->data : NULL;
}
void *
-edbus_data_del(Eina_Inlist **p_lst, const char *key)
+eldbus_data_del(Eina_Inlist **p_lst, const char *key)
{
- EDBus_Data *d = edbus_data_find(p_lst, key);
+ Eldbus_Data *d = eldbus_data_find(p_lst, key);
void *ret;
if (!d) return NULL;
@@ -358,14 +358,14 @@ edbus_data_del(Eina_Inlist **p_lst, const char *key)
}
void
-edbus_data_del_all(Eina_Inlist **p_list)
+eldbus_data_del_all(Eina_Inlist **p_list)
{
Eina_Inlist *n = *p_list;
*p_list = NULL;
while (n)
{
- EDBus_Data *d = EINA_INLIST_CONTAINER_GET(n, EDBus_Data);
+ Eldbus_Data *d = EINA_INLIST_CONTAINER_GET(n, Eldbus_Data);
n = eina_inlist_remove(n, n);
DBG("key=%s, data=%p", d->key, d->data);
free(d);
@@ -373,7 +373,7 @@ edbus_data_del_all(Eina_Inlist **p_list)
}
static void
-edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn)
+eldbus_connection_name_gc(Eldbus_Connection *conn, Eldbus_Connection_Name *cn)
{
if (cn->refcount > 0)
return;
@@ -384,12 +384,12 @@ edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn)
eina_hash_del(conn->names, cn->name, cn);
if (cn->name_owner_changed)
- edbus_signal_handler_del(cn->name_owner_changed);
+ eldbus_signal_handler_del(cn->name_owner_changed);
if (cn->objects)
eina_hash_free(cn->objects);
eina_stringshare_del(cn->name);
if (cn->name_owner_get)
- edbus_pending_cancel(cn->name_owner_get);
+ eldbus_pending_cancel(cn->name_owner_get);
if (cn->unique_id)
eina_stringshare_del(cn->unique_id);
eina_list_free(cn->event_handlers.to_delete);
@@ -397,97 +397,97 @@ edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn)
}
void
-edbus_connection_name_object_del(EDBus_Connection *conn, const EDBus_Object *obj)
+eldbus_connection_name_object_del(Eldbus_Connection *conn, const Eldbus_Object *obj)
{
- EDBus_Connection_Name *cn = eina_hash_find(conn->names, obj->name);
+ Eldbus_Connection_Name *cn = eina_hash_find(conn->names, obj->name);
if (!cn) return;
if (!cn->objects) return;
eina_hash_del(cn->objects, obj->path, obj);
- edbus_connection_name_gc(conn, cn);
+ eldbus_connection_name_gc(conn, cn);
}
void
-edbus_connection_name_object_set(EDBus_Connection *conn, EDBus_Object *obj)
+eldbus_connection_name_object_set(Eldbus_Connection *conn, Eldbus_Object *obj)
{
- EDBus_Connection_Name *cn;
+ Eldbus_Connection_Name *cn;
- cn = edbus_connection_name_get(conn, obj->name);
+ cn = eldbus_connection_name_get(conn, obj->name);
eina_hash_add(cn->objects, obj->path, obj);
return;
}
static void
-on_name_owner_changed(void *data, const EDBus_Message *msg)
+on_name_owner_changed(void *data, const Eldbus_Message *msg)
{
const char *bus, *older_id, *new_id;
- EDBus_Connection_Name *cn = data;
+ Eldbus_Connection_Name *cn = data;
- if (!edbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
+ if (!eldbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
{
ERR("Error getting arguments from NameOwnerChanged cn=%s", cn->name);
return;
}
eina_stringshare_replace(&cn->unique_id, new_id);
- edbus_dispatch_name_owner_change(cn, older_id);
+ eldbus_dispatch_name_owner_change(cn, older_id);
}
static void
-on_get_name_owner(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+on_get_name_owner(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
const char *unique_id = "", *error_name;
- EDBus_Connection_Name *cn = data;
+ Eldbus_Connection_Name *cn = data;
cn->name_owner_get = NULL;
- if (edbus_message_error_get(msg, &error_name, NULL))
+ if (eldbus_message_error_get(msg, &error_name, NULL))
{
- if (!strcmp(error_name, EDBUS_ERROR_PENDING_CANCELED))
+ if (!strcmp(error_name, ELDBUS_ERROR_PENDING_CANCELED))
return;
DBG("GetNameOwner of bus = %s returned an error", cn->name);
}
- else if (!edbus_message_arguments_get(msg, "s", &unique_id))
+ else if (!eldbus_message_arguments_get(msg, "s", &unique_id))
ERR("Error getting arguments from GetNameOwner");
cn->unique_id = eina_stringshare_add(unique_id);
- edbus_dispatch_name_owner_change(cn, NULL);
+ eldbus_dispatch_name_owner_change(cn, NULL);
}
void
-edbus_connection_name_ref(EDBus_Connection_Name *cn)
+eldbus_connection_name_ref(Eldbus_Connection_Name *cn)
{
EINA_SAFETY_ON_NULL_RETURN(cn);
cn->refcount++;
}
void
-edbus_connection_name_unref(EDBus_Connection *conn, EDBus_Connection_Name *cn)
+eldbus_connection_name_unref(Eldbus_Connection *conn, Eldbus_Connection_Name *cn)
{
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(cn);
cn->refcount--;
- edbus_connection_name_gc(conn, cn);
+ eldbus_connection_name_gc(conn, cn);
}
-EDBus_Connection_Name *
-edbus_connection_name_get(EDBus_Connection *conn, const char *name)
+Eldbus_Connection_Name *
+eldbus_connection_name_get(Eldbus_Connection *conn, const char *name)
{
- EDBus_Connection_Name *cn;
- EDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
+ Eldbus_Connection_Name *cn;
+ ELDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
cn = eina_hash_find(conn->names, name);
if (cn) return cn;
- cn = calloc(1, sizeof(EDBus_Connection_Name));
+ cn = calloc(1, sizeof(Eldbus_Connection_Name));
EINA_SAFETY_ON_NULL_RETURN_VAL(cn, NULL);
cn->name = eina_stringshare_add(name);
cn->objects = eina_hash_string_superfast_new(NULL);
- if (!strcmp(name, EDBUS_FDO_BUS))
+ if (!strcmp(name, ELDBUS_FDO_BUS))
{
cn->unique_id = eina_stringshare_add(name);
goto end;
@@ -496,14 +496,14 @@ edbus_connection_name_get(EDBus_Connection *conn, const char *name)
if (name[0] == ':')
cn->unique_id = eina_stringshare_add(name);
else
- cn->name_owner_get = edbus_name_owner_get(conn, cn->name, on_get_name_owner, cn);
+ cn->name_owner_get = eldbus_name_owner_get(conn, cn->name, on_get_name_owner, cn);
- cn->name_owner_changed = _edbus_signal_handler_add(conn, EDBUS_FDO_BUS,
- EDBUS_FDO_PATH,
- EDBUS_FDO_INTERFACE,
+ cn->name_owner_changed = _eldbus_signal_handler_add(conn, ELDBUS_FDO_BUS,
+ ELDBUS_FDO_PATH,
+ ELDBUS_FDO_INTERFACE,
"NameOwnerChanged",
on_name_owner_changed, cn);
- edbus_signal_handler_match_extra_set(cn->name_owner_changed, "arg0",
+ eldbus_signal_handler_match_extra_set(cn->name_owner_changed, "arg0",
cn->name, NULL);
end:
@@ -511,12 +511,12 @@ end:
return cn;
}
-EDBus_Object *
-edbus_connection_name_object_get(EDBus_Connection *conn, const char *name, const char *path)
+Eldbus_Object *
+eldbus_connection_name_object_get(Eldbus_Connection *conn, const char *name, const char *path)
{
- EDBus_Connection_Name *cn;
+ Eldbus_Connection_Name *cn;
- EDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
+ ELDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
cn = eina_hash_find(conn->names, name);
if (!cn) return NULL;
if (!cn->objects) return NULL;
@@ -525,11 +525,11 @@ edbus_connection_name_object_get(EDBus_Connection *conn, const char *name, const
static void
-edbus_fd_handler_del(EDBus_Handler_Data *hd)
+eldbus_fd_handler_del(Eldbus_Handler_Data *hd)
{
if (!hd->fd_handler) return;
- DBG("free EDBus_Handler_Data %d", hd->fd);
+ DBG("free Eldbus_Handler_Data %d", hd->fd);
hd->conn->fd_handlers = eina_inlist_remove(hd->conn->fd_handlers,
EINA_INLIST_GET(hd));
if (hd->fd_handler)
@@ -539,9 +539,9 @@ edbus_fd_handler_del(EDBus_Handler_Data *hd)
}
static Eina_Bool
-edbus_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
+eldbus_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
{
- EDBus_Handler_Data *hd = data;
+ Eldbus_Handler_Data *hd = data;
unsigned int condition = 0;
DBG("Got Ecore_Fd_Handle@%p", fd_handler);
@@ -561,7 +561,7 @@ edbus_fd_handler(void *data, Ecore_Fd_Handler *fd_handler)
}
static void
-edbus_fd_handler_add(EDBus_Handler_Data *hd)
+eldbus_fd_handler_add(Eldbus_Handler_Data *hd)
{
unsigned int dflags;
Ecore_Fd_Handler_Flags eflags;
@@ -578,32 +578,32 @@ edbus_fd_handler_add(EDBus_Handler_Data *hd)
hd->fd_handler = ecore_main_fd_handler_add(hd->fd,
eflags,
- edbus_fd_handler,
+ eldbus_fd_handler,
hd,
NULL,
NULL);
}
static void
-edbus_handler_data_free(void *data)
+eldbus_handler_data_free(void *data)
{
- EDBus_Handler_Data *hd = data;
- edbus_fd_handler_del(hd);
+ Eldbus_Handler_Data *hd = data;
+ eldbus_fd_handler_del(hd);
}
static dbus_bool_t
cb_watch_add(DBusWatch *watch, void *data)
{
- EDBus_Connection *conn = data;
- EDBus_Handler_Data *hd;
+ Eldbus_Connection *conn = data;
+ Eldbus_Handler_Data *hd;
if (!dbus_watch_get_enabled(watch)) return EINA_TRUE;
DBG("cb_watch_add (enabled: %d)", dbus_watch_get_unix_fd(watch));
- hd = calloc(1, sizeof(EDBus_Handler_Data));
+ hd = calloc(1, sizeof(Eldbus_Handler_Data));
EINA_SAFETY_ON_NULL_RETURN_VAL(hd, EINA_FALSE);
- dbus_watch_set_data(watch, hd, edbus_handler_data_free);
+ dbus_watch_set_data(watch, hd, eldbus_handler_data_free);
hd->conn = conn;
hd->watch = watch;
hd->enabled = dbus_watch_get_enabled(watch);
@@ -611,7 +611,7 @@ cb_watch_add(DBusWatch *watch, void *data)
conn->fd_handlers = eina_inlist_append(hd->conn->fd_handlers,
EINA_INLIST_GET(hd));
- edbus_fd_handler_add(hd);
+ eldbus_fd_handler_add(hd);
return EINA_TRUE;
}
@@ -620,14 +620,14 @@ static void
cb_watch_del(DBusWatch *watch, void *data EINA_UNUSED)
{
DBG("cb_watch_del");
- /* will trigger edbus_handler_data_free() */
+ /* will trigger eldbus_handler_data_free() */
dbus_watch_set_data(watch, NULL, NULL);
}
static void
cb_watch_toggle(DBusWatch *watch, void *data EINA_UNUSED)
{
- EDBus_Handler_Data *hd;
+ Eldbus_Handler_Data *hd;
hd = dbus_watch_get_data(watch);
if (!hd) return;
DBG("cb_watch_toggle %d", hd->fd);
@@ -635,14 +635,14 @@ cb_watch_toggle(DBusWatch *watch, void *data EINA_UNUSED)
hd->enabled = dbus_watch_get_enabled(watch);
DBG("watch %p is %sabled", hd, hd->enabled ? "en" : "dis");
- if (hd->enabled) edbus_fd_handler_add(hd);
+ if (hd->enabled) eldbus_fd_handler_add(hd);
else ecore_main_fd_handler_del(hd->fd_handler);
}
static void
-edbus_timeout_data_free(void *timeout_data)
+eldbus_timeout_data_free(void *timeout_data)
{
- EDBus_Timeout_Data *td = timeout_data;
+ Eldbus_Timeout_Data *td = timeout_data;
td->conn->timeouts = eina_inlist_remove(td->conn->timeouts,
EINA_INLIST_GET(td));
DBG("Timeout -- freeing timeout_data %p", td);
@@ -651,9 +651,9 @@ edbus_timeout_data_free(void *timeout_data)
}
static Eina_Bool
-edbus_timeout_handler(void *data)
+eldbus_timeout_handler(void *data)
{
- EDBus_Timeout_Data *td = data;
+ Eldbus_Timeout_Data *td = data;
td->handler = NULL;
if (!dbus_timeout_get_enabled(td->timeout))
@@ -670,21 +670,21 @@ edbus_timeout_handler(void *data)
static dbus_bool_t
cb_timeout_add(DBusTimeout *timeout, void *data)
{
- EDBus_Connection *conn = data;
- EDBus_Timeout_Data *td;
+ Eldbus_Connection *conn = data;
+ Eldbus_Timeout_Data *td;
if (!dbus_timeout_get_enabled(timeout))
return EINA_TRUE;
DBG("Adding timeout for connection@%p", conn);
- td = calloc(1, sizeof(EDBus_Timeout_Data));
+ td = calloc(1, sizeof(Eldbus_Timeout_Data));
EINA_SAFETY_ON_NULL_RETURN_VAL(td, EINA_FALSE);
td->conn = conn;
- dbus_timeout_set_data(timeout, (void *)td, edbus_timeout_data_free);
+ dbus_timeout_set_data(timeout, (void *)td, eldbus_timeout_data_free);
td->interval = dbus_timeout_get_interval(timeout);
td->timeout = timeout;
- td->handler = ecore_timer_add(td->interval, edbus_timeout_handler, td);
+ td->handler = ecore_timer_add(td->interval, eldbus_timeout_handler, td);
conn->timeouts = eina_inlist_append(conn->timeouts,
EINA_INLIST_GET(td));
@@ -695,14 +695,14 @@ static void
cb_timeout_del(DBusTimeout *timeout, void *data EINA_UNUSED)
{
DBG("timeout del!");
- /* will trigger edbus_timeout_data_free() */
+ /* will trigger eldbus_timeout_data_free() */
dbus_timeout_set_data(timeout, NULL, NULL);
}
static void
cb_timeout_toggle(DBusTimeout *timeout, void *data EINA_UNUSED)
{
- EDBus_Timeout_Data *td;
+ Eldbus_Timeout_Data *td;
td = dbus_timeout_get_data(timeout);
@@ -711,7 +711,7 @@ cb_timeout_toggle(DBusTimeout *timeout, void *data EINA_UNUSED)
{
td->interval = dbus_timeout_get_interval(timeout);
td->handler
- = ecore_timer_add(td->interval, edbus_timeout_handler, td);
+ = ecore_timer_add(td->interval, eldbus_timeout_handler, td);
DBG("Timeout is enabled with interval %d, timer@%p",
td->interval, td->handler);
@@ -725,9 +725,9 @@ cb_timeout_toggle(DBusTimeout *timeout, void *data EINA_UNUSED)
}
static Eina_Bool
-edbus_idler(void *data)
+eldbus_idler(void *data)
{
- EDBus_Connection *conn = data;
+ Eldbus_Connection *conn = data;
DBG("Connection@%p: Dispatch status: %d", conn,
dbus_connection_get_dispatch_status(conn->dbus_conn));
@@ -751,13 +751,13 @@ edbus_idler(void *data)
static void
cb_dispatch_status(DBusConnection *dbus_conn EINA_UNUSED, DBusDispatchStatus new_status, void *data)
{
- EDBus_Connection *conn = data;
+ Eldbus_Connection *conn = data;
DBG("Connection@%p: Dispatch status: %d", conn, new_status);
if ((new_status == DBUS_DISPATCH_DATA_REMAINS) && (!conn->idler))
{
- conn->idler = ecore_idler_add(edbus_idler, conn);
+ conn->idler = ecore_idler_add(eldbus_idler, conn);
DBG("Connection@%p: Adding idler@%p to handle remaining dispatch data",
conn, conn->idler);
}
@@ -772,7 +772,7 @@ cb_dispatch_status(DBusConnection *dbus_conn EINA_UNUSED, DBusDispatchStatus new
}
static inline Eina_Bool
-extra_arguments_check(DBusMessage *msg, EDBus_Signal_Handler *sh)
+extra_arguments_check(DBusMessage *msg, Eldbus_Signal_Handler *sh)
{
DBusMessageIter iter;
Signal_Argument *arg;
@@ -802,20 +802,20 @@ extra_arguments_check(DBusMessage *msg, EDBus_Signal_Handler *sh)
}
static void
-cb_signal_dispatcher(EDBus_Connection *conn, DBusMessage *msg)
+cb_signal_dispatcher(Eldbus_Connection *conn, DBusMessage *msg)
{
- EDBus_Message *edbus_msg;
+ Eldbus_Message *eldbus_msg;
Eina_Inlist *next;
- edbus_msg = edbus_message_new(EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN(edbus_msg);
+ eldbus_msg = eldbus_message_new(EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN(eldbus_msg);
- edbus_msg->dbus_msg = dbus_message_ref(msg);
- dbus_message_iter_init(edbus_msg->dbus_msg,
- &edbus_msg->iterator->dbus_iterator);
+ eldbus_msg->dbus_msg = dbus_message_ref(msg);
+ dbus_message_iter_init(eldbus_msg->dbus_msg,
+ &eldbus_msg->iterator->dbus_iterator);
- edbus_connection_ref(conn);
- edbus_init();
+ eldbus_connection_ref(conn);
+ eldbus_init();
/*
* Do the walking open-coded so we don't crash if a callback
* removes other signal handlers from the list and we don't own
@@ -824,9 +824,9 @@ cb_signal_dispatcher(EDBus_Connection *conn, DBusMessage *msg)
next = conn->signal_handlers;
while (next != NULL)
{
- EDBus_Signal_Handler *sh;
+ Eldbus_Signal_Handler *sh;
- sh = EINA_INLIST_CONTAINER_GET(next, EDBus_Signal_Handler);
+ sh = EINA_INLIST_CONTAINER_GET(next, Eldbus_Signal_Handler);
next = next->next;
if (sh->dangling) continue;
@@ -846,29 +846,29 @@ cb_signal_dispatcher(EDBus_Connection *conn, DBusMessage *msg)
if (sh->member && !dbus_message_has_member(msg, sh->member)) continue;
if (!extra_arguments_check(msg, sh)) continue;
- edbus_signal_handler_ref(sh);
- sh->cb((void *)sh->cb_data, edbus_msg);
+ eldbus_signal_handler_ref(sh);
+ sh->cb((void *)sh->cb_data, eldbus_msg);
/* update next signal handler because the list may have changed */
next = EINA_INLIST_GET(sh)->next;
- edbus_signal_handler_unref(sh);
+ eldbus_signal_handler_unref(sh);
/*
* Rewind iterator so another signal handler matching the same signal
* can iterate over it.
*/
- dbus_message_iter_init(edbus_msg->dbus_msg,
- &edbus_msg->iterator->dbus_iterator);
+ dbus_message_iter_init(eldbus_msg->dbus_msg,
+ &eldbus_msg->iterator->dbus_iterator);
}
- edbus_message_unref(edbus_msg);
- edbus_connection_unref(conn);
- edbus_shutdown();
+ eldbus_message_unref(eldbus_msg);
+ eldbus_connection_unref(conn);
+ eldbus_shutdown();
}
static DBusHandlerResult
-edbus_filter(DBusConnection *conn_dbus EINA_UNUSED, DBusMessage *message, void *user_data)
+eldbus_filter(DBusConnection *conn_dbus EINA_UNUSED, DBusMessage *message, void *user_data)
{
- EDBus_Connection *conn = user_data;
+ Eldbus_Connection *conn = user_data;
DBG("Connection@%p Got message:\n"
" Type: %s\n"
@@ -901,7 +901,7 @@ edbus_filter(DBusConnection *conn_dbus EINA_UNUSED, DBusMessage *message, void *
}
static void
-edbus_connection_setup(EDBus_Connection *conn)
+eldbus_connection_setup(Eldbus_Connection *conn)
{
DBG("Setting up connection %p", conn);
@@ -924,7 +924,7 @@ edbus_connection_setup(EDBus_Connection *conn)
dbus_connection_set_dispatch_status_function(conn->dbus_conn,
cb_dispatch_status,
conn, NULL);
- dbus_connection_add_filter(conn->dbus_conn, edbus_filter, conn, NULL);
+ dbus_connection_add_filter(conn->dbus_conn, eldbus_filter, conn, NULL);
cb_dispatch_status(conn->dbus_conn,
dbus_connection_get_dispatch_status(conn->dbus_conn),
@@ -932,24 +932,24 @@ edbus_connection_setup(EDBus_Connection *conn)
}
static void
-_disconnected(void *data, const EDBus_Message *msg EINA_UNUSED)
+_disconnected(void *data, const Eldbus_Message *msg EINA_UNUSED)
{
- EDBus_Connection *conn = data;
- _edbus_connection_event_callback_call(
- conn, EDBUS_CONNECTION_EVENT_DISCONNECTED, NULL);
+ Eldbus_Connection *conn = data;
+ _eldbus_connection_event_callback_call(
+ conn, ELDBUS_CONNECTION_EVENT_DISCONNECTED, NULL);
}
-static EDBus_Connection *
-_connection_get(EDBus_Connection_Type type)
+static Eldbus_Connection *
+_connection_get(Eldbus_Connection_Type type)
{
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
DBusError err;
- EDBus_Object *obj;
+ Eldbus_Object *obj;
- EINA_SAFETY_ON_FALSE_RETURN_VAL((type < EDBUS_CONNECTION_TYPE_LAST) &&
- (type > EDBUS_CONNECTION_TYPE_UNKNOWN), NULL);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL((type < ELDBUS_CONNECTION_TYPE_LAST) &&
+ (type > ELDBUS_CONNECTION_TYPE_UNKNOWN), NULL);
- conn = calloc(1, sizeof(EDBus_Connection));
+ conn = calloc(1, sizeof(Eldbus_Connection));
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
dbus_error_init(&err);
@@ -961,31 +961,31 @@ _connection_get(EDBus_Connection_Type type)
return NULL;
}
- edbus_connection_setup(conn);
+ eldbus_connection_setup(conn);
conn->type = type;
conn->refcount = 1;
- EINA_MAGIC_SET(conn, EDBUS_CONNECTION_MAGIC);
+ EINA_MAGIC_SET(conn, ELDBUS_CONNECTION_MAGIC);
conn->names = eina_hash_string_superfast_new(NULL);
- edbus_signal_handler_add(conn, NULL, DBUS_PATH_LOCAL, DBUS_INTERFACE_LOCAL,
+ eldbus_signal_handler_add(conn, NULL, DBUS_PATH_LOCAL, DBUS_INTERFACE_LOCAL,
"Disconnected", _disconnected, conn);
- obj = edbus_object_get(conn, EDBUS_FDO_BUS, EDBUS_FDO_PATH);
- conn->fdo_proxy = edbus_proxy_get(obj, EDBUS_FDO_INTERFACE);
+ obj = eldbus_object_get(conn, ELDBUS_FDO_BUS, ELDBUS_FDO_PATH);
+ conn->fdo_proxy = eldbus_proxy_get(obj, ELDBUS_FDO_INTERFACE);
DBG("Returned new connection at %p", conn);
return conn;
}
-EAPI EDBus_Connection *
-edbus_private_connection_get(EDBus_Connection_Type type)
+EAPI Eldbus_Connection *
+eldbus_private_connection_get(Eldbus_Connection_Type type)
{
return _connection_get(type);
}
-EAPI EDBus_Connection *
-edbus_connection_get(EDBus_Connection_Type type)
+EAPI Eldbus_Connection *
+eldbus_connection_get(Eldbus_Connection_Type type)
{
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
DBG("Getting connection with type %d", type);
@@ -997,7 +997,7 @@ edbus_connection_get(EDBus_Connection_Type type)
{
DBG("Connection with type %d exists at %p; reffing and returning",
type, conn);
- return edbus_connection_ref(conn);
+ return eldbus_connection_ref(conn);
}
conn = _connection_get(type);
@@ -1007,26 +1007,26 @@ edbus_connection_get(EDBus_Connection_Type type)
return conn;
}
-EAPI EDBus_Connection *
-edbus_connection_ref(EDBus_Connection *conn)
+EAPI Eldbus_Connection *
+eldbus_connection_ref(Eldbus_Connection *conn)
{
- EDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
+ ELDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
DBG("conn=%p, pre-refcount=%d", conn, conn->refcount);
conn->refcount++;
return conn;
}
static void
-_edbus_connection_unref(EDBus_Connection *conn)
+_eldbus_connection_unref(Eldbus_Connection *conn)
{
unsigned int i;
- EDBus_Handler_Data *fd_handler;
- EDBus_Timeout_Data *timer;
+ Eldbus_Handler_Data *fd_handler;
+ Eldbus_Timeout_Data *timer;
Eina_Inlist *list;
- EDBus_Signal_Handler *h;
- EDBus_Pending *p;
+ Eldbus_Signal_Handler *h;
+ Eldbus_Pending *p;
Eina_Iterator *iter;
- EDBus_Connection_Name *cn;
+ Eldbus_Connection_Name *cn;
Eina_Array *cns;
const char *name;
@@ -1037,14 +1037,14 @@ _edbus_connection_unref(EDBus_Connection *conn)
DBG("Freeing connection %p", conn);
- _edbus_connection_event_callback_call
- (conn, EDBUS_CONNECTION_EVENT_DEL, NULL);
+ _eldbus_connection_event_callback_call
+ (conn, ELDBUS_CONNECTION_EVENT_DEL, NULL);
conn->refcount = 1;
- edbus_cbs_free_dispatch(&(conn->cbs_free), conn);
+ eldbus_cbs_free_dispatch(&(conn->cbs_free), conn);
EINA_INLIST_FOREACH_SAFE(conn->pendings, list, p)
- edbus_pending_cancel(p);
+ eldbus_pending_cancel(p);
cns = eina_array_new(eina_hash_population(conn->names));
iter = eina_hash_iterator_data_new(conn->names);
@@ -1052,9 +1052,9 @@ _edbus_connection_unref(EDBus_Connection *conn)
{
while (cn->event_handlers.list)
{
- EDBus_Connection_Context_NOC_Cb *ctx;
+ Eldbus_Connection_Context_NOC_Cb *ctx;
ctx = EINA_INLIST_CONTAINER_GET(cn->event_handlers.list,
- EDBus_Connection_Context_NOC_Cb);
+ Eldbus_Connection_Context_NOC_Cb);
cn->event_handlers.list = eina_inlist_remove(cn->event_handlers.list,
cn->event_handlers.list);
free(ctx);
@@ -1066,7 +1066,7 @@ _edbus_connection_unref(EDBus_Connection *conn)
while ((name = eina_array_pop(cns)))
{
cn = eina_hash_find(conn->names, name);
- if (cn) edbus_connection_name_gc(conn, cn);
+ if (cn) eldbus_connection_name_gc(conn, cn);
eina_stringshare_del(name);
}
@@ -1083,10 +1083,10 @@ _edbus_connection_unref(EDBus_Connection *conn)
conn);
EINA_INLIST_FOREACH(conn->pendings, p)
ERR("conn=%p alive pending call=%p dest=%s path=%s %s.%s()", conn, p,
- edbus_pending_destination_get(p),
- edbus_pending_path_get(p),
- edbus_pending_interface_get(p),
- edbus_pending_method_get(p));
+ eldbus_pending_destination_get(p),
+ eldbus_pending_path_get(p),
+ eldbus_pending_interface_get(p),
+ eldbus_pending_method_get(p));
}
if (conn->signal_handlers)
@@ -1097,16 +1097,16 @@ _edbus_connection_unref(EDBus_Connection *conn)
h->member, h->path);
}
- for (i = 0; i < EDBUS_CONNECTION_EVENT_LAST; i++)
+ for (i = 0; i < ELDBUS_CONNECTION_EVENT_LAST; i++)
{
- EDBus_Connection_Context_Event *ce = conn->event_handlers + i;
+ Eldbus_Connection_Context_Event *ce = conn->event_handlers + i;
while (ce->list)
{
- EDBus_Connection_Context_Event_Cb *ctx;
+ Eldbus_Connection_Context_Event_Cb *ctx;
ctx = EINA_INLIST_CONTAINER_GET(ce->list,
- EDBus_Connection_Context_Event_Cb);
- _edbus_connection_context_event_cb_del(ce, ctx);
+ Eldbus_Connection_Context_Event_Cb);
+ _eldbus_connection_context_event_cb_del(ce, ctx);
}
eina_list_free(ce->to_delete);
}
@@ -1117,12 +1117,12 @@ _edbus_connection_unref(EDBus_Connection *conn)
conn->dbus_conn = NULL;
EINA_INLIST_FOREACH_SAFE(conn->fd_handlers, list, fd_handler)
- edbus_fd_handler_del(fd_handler);
+ eldbus_fd_handler_del(fd_handler);
EINA_INLIST_FOREACH_SAFE(conn->timeouts, list, timer)
- edbus_timeout_data_free(timer->handler);
+ eldbus_timeout_data_free(timer->handler);
- edbus_data_del_all(&conn->data);
+ eldbus_data_del_all(&conn->data);
if (conn->idler) ecore_idler_del(conn->idler);
if (conn->type && (shared_connections[conn->type - 1] == conn))
@@ -1132,58 +1132,58 @@ _edbus_connection_unref(EDBus_Connection *conn)
}
EAPI void
-edbus_connection_unref(EDBus_Connection *conn)
+eldbus_connection_unref(Eldbus_Connection *conn)
{
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
DBG("conn=%p, pre-refcount=%d", conn, conn->refcount);
- _edbus_connection_unref(conn);
+ _eldbus_connection_unref(conn);
}
EAPI void
-edbus_connection_free_cb_add(EDBus_Connection *conn, EDBus_Free_Cb cb, const void *data)
+eldbus_connection_free_cb_add(Eldbus_Connection *conn, Eldbus_Free_Cb cb, const void *data)
{
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(cb);
- conn->cbs_free = edbus_cbs_free_add(conn->cbs_free, cb, data);
+ conn->cbs_free = eldbus_cbs_free_add(conn->cbs_free, cb, data);
}
EAPI void
-edbus_connection_free_cb_del(EDBus_Connection *conn, EDBus_Free_Cb cb, const void *data)
+eldbus_connection_free_cb_del(Eldbus_Connection *conn, Eldbus_Free_Cb cb, const void *data)
{
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(cb);
- conn->cbs_free = edbus_cbs_free_del(conn->cbs_free, cb, data);
+ conn->cbs_free = eldbus_cbs_free_del(conn->cbs_free, cb, data);
}
EAPI void
-edbus_connection_data_set(EDBus_Connection *conn, const char *key, const void *data)
+eldbus_connection_data_set(Eldbus_Connection *conn, const char *key, const void *data)
{
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(key);
EINA_SAFETY_ON_NULL_RETURN(data);
- edbus_data_set(&(conn->data), key, data);
+ eldbus_data_set(&(conn->data), key, data);
}
EAPI void *
-edbus_connection_data_get(const EDBus_Connection *conn, const char *key)
+eldbus_connection_data_get(const Eldbus_Connection *conn, const char *key)
{
- EDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
+ ELDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_get(&(((EDBus_Connection *)conn)->data), key);
+ return eldbus_data_get(&(((Eldbus_Connection *)conn)->data), key);
}
EAPI void *
-edbus_connection_data_del(EDBus_Connection *conn, const char *key)
+eldbus_connection_data_del(Eldbus_Connection *conn, const char *key)
{
- EDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
+ ELDBUS_CONNECTION_CHECK_RETVAL(conn, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_del(&(((EDBus_Connection *)conn)->data), key);
+ return eldbus_data_del(&(((Eldbus_Connection *)conn)->data), key);
}
static void
-edbus_dispatch_name_owner_change(EDBus_Connection_Name *cn, const char *old_id)
+eldbus_dispatch_name_owner_change(Eldbus_Connection_Name *cn, const char *old_id)
{
- EDBus_Connection_Context_NOC_Cb *ctx;
+ Eldbus_Connection_Context_NOC_Cb *ctx;
const char *previous_id = !old_id ? "" : old_id;
cn->event_handlers.walking++;
EINA_INLIST_FOREACH(cn->event_handlers.list, ctx)
@@ -1200,13 +1200,13 @@ edbus_dispatch_name_owner_change(EDBus_Connection_Name *cn, const char *old_id)
EINA_INLIST_GET(ctx));
free(ctx);
}
- edbus_connection_name_gc(cn->name_owner_changed->conn, cn);
+ eldbus_connection_name_gc(cn->name_owner_changed->conn, cn);
}
typedef struct _dispach_name_owner_data
{
- EDBus_Connection_Context_NOC_Cb *ctx;
- const EDBus_Connection_Name *cn;
+ Eldbus_Connection_Context_NOC_Cb *ctx;
+ const Eldbus_Connection_Name *cn;
} dispatch_name_owner_data;
static Eina_Bool
@@ -1221,18 +1221,18 @@ dispach_name_owner_cb(void *context)
}
EAPI void
-edbus_name_owner_changed_callback_add(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call)
+eldbus_name_owner_changed_callback_add(Eldbus_Connection *conn, const char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call)
{
- EDBus_Connection_Name *cn;
- EDBus_Connection_Context_NOC_Cb *ctx;
+ Eldbus_Connection_Name *cn;
+ Eldbus_Connection_Context_NOC_Cb *ctx;
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(bus);
EINA_SAFETY_ON_NULL_RETURN(cb);
- cn = edbus_connection_name_get(conn, bus);
+ cn = eldbus_connection_name_get(conn, bus);
EINA_SAFETY_ON_NULL_RETURN(cn);
- ctx = calloc(1, sizeof(EDBus_Connection_Context_NOC_Cb));
+ ctx = calloc(1, sizeof(Eldbus_Connection_Context_NOC_Cb));
EINA_SAFETY_ON_NULL_GOTO(ctx, cleanup);
ctx->cb = cb;
ctx->cb_data = cb_data;
@@ -1252,16 +1252,16 @@ edbus_name_owner_changed_callback_add(EDBus_Connection *conn, const char *bus, E
return;
cleanup:
- edbus_connection_name_gc(conn, cn);
+ eldbus_connection_name_gc(conn, cn);
}
EAPI void
-edbus_name_owner_changed_callback_del(EDBus_Connection *conn, const char *bus, EDBus_Name_Owner_Changed_Cb cb, const void *cb_data)
+eldbus_name_owner_changed_callback_del(Eldbus_Connection *conn, const char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data)
{
- EDBus_Connection_Name *cn;
- EDBus_Connection_Context_NOC_Cb *iter, *found = NULL;
+ Eldbus_Connection_Name *cn;
+ Eldbus_Connection_Context_NOC_Cb *iter, *found = NULL;
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(bus);
EINA_SAFETY_ON_NULL_RETURN(cb);
@@ -1297,22 +1297,22 @@ edbus_name_owner_changed_callback_del(EDBus_Connection *conn, const char *bus, E
free(data);
}
free(found);
- edbus_connection_name_gc(conn, cn);
+ eldbus_connection_name_gc(conn, cn);
}
EAPI void
-edbus_connection_event_callback_add(EDBus_Connection *conn, EDBus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const void *cb_data)
+eldbus_connection_event_callback_add(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, Eldbus_Connection_Event_Cb cb, const void *cb_data)
{
- EDBus_Connection_Context_Event *ce;
- EDBus_Connection_Context_Event_Cb *ctx;
+ Eldbus_Connection_Context_Event *ce;
+ Eldbus_Connection_Context_Event_Cb *ctx;
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(cb);
- EINA_SAFETY_ON_TRUE_RETURN(type >= EDBUS_CONNECTION_EVENT_LAST);
+ EINA_SAFETY_ON_TRUE_RETURN(type >= ELDBUS_CONNECTION_EVENT_LAST);
ce = conn->event_handlers + type;
- ctx = calloc(1, sizeof(EDBus_Connection_Context_Event_Cb));
+ ctx = calloc(1, sizeof(Eldbus_Connection_Context_Event_Cb));
EINA_SAFETY_ON_NULL_RETURN(ctx);
ctx->cb = cb;
ctx->cb_data = cb_data;
@@ -1321,21 +1321,21 @@ edbus_connection_event_callback_add(EDBus_Connection *conn, EDBus_Connection_Eve
}
static void
-_edbus_connection_context_event_cb_del(EDBus_Connection_Context_Event *ce, EDBus_Connection_Context_Event_Cb *ctx)
+_eldbus_connection_context_event_cb_del(Eldbus_Connection_Context_Event *ce, Eldbus_Connection_Context_Event_Cb *ctx)
{
ce->list = eina_inlist_remove(ce->list, EINA_INLIST_GET(ctx));
free(ctx);
}
EAPI void
-edbus_connection_event_callback_del(EDBus_Connection *conn, EDBus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const void *cb_data)
+eldbus_connection_event_callback_del(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, Eldbus_Connection_Event_Cb cb, const void *cb_data)
{
- EDBus_Connection_Context_Event *ce;
- EDBus_Connection_Context_Event_Cb *iter, *found = NULL;
+ Eldbus_Connection_Context_Event *ce;
+ Eldbus_Connection_Context_Event_Cb *iter, *found = NULL;
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(cb);
- EINA_SAFETY_ON_TRUE_RETURN(type >= EDBUS_CONNECTION_EVENT_LAST);
+ EINA_SAFETY_ON_TRUE_RETURN(type >= ELDBUS_CONNECTION_EVENT_LAST);
ce = conn->event_handlers + type;
@@ -1358,14 +1358,14 @@ edbus_connection_event_callback_del(EDBus_Connection *conn, EDBus_Connection_Eve
return;
}
- _edbus_connection_context_event_cb_del(ce, found);
+ _eldbus_connection_context_event_cb_del(ce, found);
}
static void
-_edbus_connection_event_callback_call(EDBus_Connection *conn, EDBus_Connection_Event_Type type, const void *event_info)
+_eldbus_connection_event_callback_call(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, const void *event_info)
{
- EDBus_Connection_Context_Event *ce;
- EDBus_Connection_Context_Event_Cb *iter;
+ Eldbus_Connection_Context_Event *ce;
+ Eldbus_Connection_Context_Event_Cb *iter;
ce = conn->event_handlers + type;
@@ -1379,39 +1379,39 @@ _edbus_connection_event_callback_call(EDBus_Connection *conn, EDBus_Connection_E
if (ce->walking > 0) return;
EINA_LIST_FREE(ce->to_delete, iter)
- _edbus_connection_context_event_cb_del(ce, iter);
+ _eldbus_connection_context_event_cb_del(ce, iter);
}
void
-edbus_connection_event_callback_call(EDBus_Connection *conn, EDBus_Connection_Event_Type type, const void *event_info)
+eldbus_connection_event_callback_call(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, const void *event_info)
{
- EDBUS_CONNECTION_CHECK(conn);
- EINA_SAFETY_ON_TRUE_RETURN(type >= EDBUS_CONNECTION_EVENT_LAST);
- EINA_SAFETY_ON_TRUE_RETURN(type == EDBUS_CONNECTION_EVENT_DEL);
+ ELDBUS_CONNECTION_CHECK(conn);
+ EINA_SAFETY_ON_TRUE_RETURN(type >= ELDBUS_CONNECTION_EVENT_LAST);
+ EINA_SAFETY_ON_TRUE_RETURN(type == ELDBUS_CONNECTION_EVENT_DEL);
- _edbus_connection_event_callback_call(conn, type, event_info);
+ _eldbus_connection_event_callback_call(conn, type, event_info);
}
void
-edbus_connection_signal_handler_add(EDBus_Connection *conn, EDBus_Signal_Handler *handler)
+eldbus_connection_signal_handler_add(Eldbus_Connection *conn, Eldbus_Signal_Handler *handler)
{
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(handler);
conn->signal_handlers = eina_inlist_append(conn->signal_handlers,
EINA_INLIST_GET(handler));
}
void
-edbus_connection_pending_add(EDBus_Connection *conn, EDBus_Pending *pending)
+eldbus_connection_pending_add(Eldbus_Connection *conn, Eldbus_Pending *pending)
{
- EDBUS_CONNECTION_CHECK(conn);
+ ELDBUS_CONNECTION_CHECK(conn);
EINA_SAFETY_ON_NULL_RETURN(pending);
conn->pendings = eina_inlist_append(conn->pendings,
EINA_INLIST_GET(pending));
}
void
-edbus_connection_signal_handler_del(EDBus_Connection *conn, EDBus_Signal_Handler *handler)
+eldbus_connection_signal_handler_del(Eldbus_Connection *conn, Eldbus_Signal_Handler *handler)
{
EINA_SAFETY_ON_NULL_RETURN(conn);
EINA_SAFETY_ON_NULL_RETURN(handler);
@@ -1420,7 +1420,7 @@ edbus_connection_signal_handler_del(EDBus_Connection *conn, EDBus_Signal_Handler
}
void
-edbus_connection_pending_del(EDBus_Connection *conn, EDBus_Pending *pending)
+eldbus_connection_pending_del(Eldbus_Connection *conn, Eldbus_Pending *pending)
{
EINA_SAFETY_ON_NULL_RETURN(conn);
EINA_SAFETY_ON_NULL_RETURN(pending);
diff --git a/src/lib/eldbus/eldbus_freedesktop.c b/src/lib/eldbus/eldbus_freedesktop.c
new file mode 100644
index 0000000000..e9b4dfd6bd
--- /dev/null
+++ b/src/lib/eldbus/eldbus_freedesktop.c
@@ -0,0 +1,82 @@
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
+#include <dbus/dbus.h>
+
+EAPI Eldbus_Pending *
+eldbus_name_request(Eldbus_Connection *conn, const char *name, unsigned int flags, Eldbus_Message_Cb cb, const void *cb_data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
+
+ return eldbus_proxy_call(conn->fdo_proxy, "RequestName", cb,
+ cb_data, -1, "su", name, flags);
+}
+
+EAPI Eldbus_Pending *
+eldbus_name_release(Eldbus_Connection *conn, const char *name, Eldbus_Message_Cb cb, const void *cb_data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
+
+ return eldbus_proxy_call(conn->fdo_proxy, "ReleaseName", cb,
+ cb_data, -1, "s", name);
+}
+
+EAPI Eldbus_Pending *
+eldbus_name_owner_get(Eldbus_Connection *conn, const char *name, Eldbus_Message_Cb cb, const void *cb_data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
+
+ return eldbus_proxy_call(conn->fdo_proxy, "GetNameOwner", cb,
+ cb_data, -1, "s", name);
+}
+
+EAPI Eldbus_Pending *
+eldbus_name_owner_has(Eldbus_Connection *conn, const char *name, Eldbus_Message_Cb cb, const void *cb_data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
+
+ return eldbus_proxy_call(conn->fdo_proxy, "NameHasOwner", cb,
+ cb_data, -1, "s", name);
+}
+
+EAPI Eldbus_Pending *
+eldbus_names_list(Eldbus_Connection *conn, Eldbus_Message_Cb cb, const void *cb_data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+
+ return eldbus_proxy_call(conn->fdo_proxy, "ListNames", cb,
+ cb_data, -1, "");
+}
+
+EAPI Eldbus_Pending *
+eldbus_names_activatable_list(Eldbus_Connection *conn, Eldbus_Message_Cb cb, const void *cb_data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+
+ return eldbus_proxy_call(conn->fdo_proxy, "ListActivatableNames", cb,
+ cb_data, -1, "");
+}
+
+EAPI Eldbus_Pending *
+eldbus_name_start(Eldbus_Connection *conn, const char *name, unsigned int flags, Eldbus_Message_Cb cb, const void *cb_data)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
+
+ return eldbus_proxy_call(conn->fdo_proxy, "StartServiceByName", cb,
+ cb_data, -1, "su", name, flags);
+}
+
+EAPI Eldbus_Pending *
+eldbus_object_managed_objects_get(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data)
+{
+ Eldbus_Message *msg;
+ Eldbus_Pending *p;
+ msg = eldbus_object_method_call_new(obj, ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
+ "GetManagedObjects");
+ p = eldbus_object_send(obj, msg, cb, data, -1);
+ return p;
+}
diff --git a/src/lib/eldbus/eldbus_freedesktop.h b/src/lib/eldbus/eldbus_freedesktop.h
new file mode 100644
index 0000000000..e3903ef917
--- /dev/null
+++ b/src/lib/eldbus/eldbus_freedesktop.h
@@ -0,0 +1,143 @@
+#ifndef ELDBUS_FREEDESKTOP_H
+#define ELDBUS_FREEDESKTOP_H 1
+
+/**
+ * @defgroup Eldbus_Basic Basic FreeDesktop.Org Methods
+ * @ingroup Eldbus
+ *
+ * @{
+ */
+#define ELDBUS_NAME_REQUEST_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
+#define ELDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
+#define ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
+
+/* Replies to request for a name */
+#define ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
+#define ELDBUS_NAME_REQUEST_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
+#define ELDBUS_NAME_REQUEST_REPLY_EXISTS 3 /**< Service is already in the queue */
+#define ELDBUS_NAME_REQUEST_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
+
+EAPI Eldbus_Pending *eldbus_name_request(Eldbus_Connection *conn, const char *bus, unsigned int flags, Eldbus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
+
+/* Replies to releasing a name */
+#define ELDBUS_NAME_RELEASE_REPLY_RELEASED 1 /**< Service was released from the given name */
+#define ELDBUS_NAME_RELEASE_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
+#define ELDBUS_NAME_RELEASE_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
+
+EAPI Eldbus_Pending *eldbus_name_release(Eldbus_Connection *conn, const char *bus, Eldbus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
+EAPI Eldbus_Pending *eldbus_name_owner_get(Eldbus_Connection *conn, const char *bus, Eldbus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
+EAPI Eldbus_Pending *eldbus_name_owner_has(Eldbus_Connection *conn, const char *bus, Eldbus_Message_Cb cb, const void *cb_data);
+EAPI Eldbus_Pending *eldbus_names_list(Eldbus_Connection *conn, Eldbus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1);
+EAPI Eldbus_Pending *eldbus_names_activatable_list(Eldbus_Connection *conn, Eldbus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1);
+
+/* Replies to service starts */
+#define ELDBUS_NAME_START_REPLY_SUCCESS 1 /**< Service was auto started */
+#define ELDBUS_NAME_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
+
+EAPI Eldbus_Pending *eldbus_name_start(Eldbus_Connection *conn, const char *bus, unsigned int flags, Eldbus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2);
+
+typedef void (*Eldbus_Name_Owner_Changed_Cb)(void *data, const char *bus, const char *old_id, const char *new_id);
+
+/**
+ * Add a callback to be called when unique id of a bus name changed.
+ *
+ * This function implicitly calls eldbus_name_owner_get() in order to be able to
+ * monitor the name. If the only interest is to receive notifications when the
+ * name in fact changes, pass EINA_FALSE to @param allow_initial_call so your
+ * callback will not be called on first retrieval of name owner. If the
+ * initial state is important, pass EINA_TRUE to this parameter.
+ *
+ * @param conn connection
+ * @param bus name of bus
+ * @param cb callback
+ * @param cb_data context data
+ * @param allow_initial_call allow call callback with actual id of the bus
+ */
+EAPI void eldbus_name_owner_changed_callback_add(Eldbus_Connection *conn, const char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call) EINA_ARG_NONNULL(1, 2, 3);
+/**
+ * Remove callback added with eldbus_name_owner_changed_callback_add().
+ *
+ * @param conn connection
+ * @param bus name of bus
+ * @param cb callback
+ * @param cb_data context data
+ */
+EAPI void eldbus_name_owner_changed_callback_del(Eldbus_Connection *conn, const char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2, 3);
+
+/**
+ * @defgroup Eldbus_FDO_Peer org.freedesktop.DBus.Peer
+ *
+ * @{
+ */
+EAPI Eldbus_Pending *eldbus_object_peer_ping(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+EAPI Eldbus_Pending *eldbus_object_peer_machine_id_get(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup Eldbus_FDO_Introspectable org.freedesktop.DBus.Introspectable
+ *
+ * @{
+ */
+EAPI Eldbus_Pending *eldbus_object_introspect(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+/**
+ * @}
+ */
+
+/**
+ * @defgroup Eldbus_FDO_Properties org.freedesktop.DBus.Properties
+ * @{
+ */
+
+/**
+ * Enable or disable local cache of properties.
+ *
+ * After enable you can call eldbus_proxy_property_local_get() or
+ * eldbus_proxy_property_local_get_all() to get cached properties.
+ *
+ * @note After enable, it will asynchrony get the properties values.
+ */
+EAPI void eldbus_proxy_properties_monitor(Eldbus_Proxy *proxy, Eina_Bool enable) EINA_ARG_NONNULL(1);
+
+EAPI Eldbus_Pending *eldbus_proxy_property_get(Eldbus_Proxy *proxy, const char *name, Eldbus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3);
+EAPI Eldbus_Pending *eldbus_proxy_property_set(Eldbus_Proxy *proxy, const char *name, const char *sig, const void *value, Eldbus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3, 4);
+EAPI Eldbus_Pending *eldbus_proxy_property_get_all(Eldbus_Proxy *proxy, Eldbus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+EAPI Eldbus_Signal_Handler *eldbus_proxy_properties_changed_callback_add(Eldbus_Proxy *proxy, Eldbus_Signal_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * Return the cached value of property.
+ * This only work if you have enable eldbus_proxy_properties_monitor or
+ * if you have call eldbus_proxy_event_callback_add of type
+ * ELDBUS_PROXY_EVENT_PROPERTY_CHANGED and the property you want had changed.
+ */
+EAPI Eina_Value *eldbus_proxy_property_local_get(Eldbus_Proxy *proxy, const char *name) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * Return a Eina_Hash with all cached properties.
+ * This only work if you have enable eldbus_proxy_properties_monitor or
+ * if you have call eldbus_proxy_event_callback_add of type
+ * ELDBUS_PROXY_EVENT_PROPERTY_CHANGED.
+ */
+EAPI const Eina_Hash *eldbus_proxy_property_local_get_all(Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1);
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup Eldbus_FDO_ObjectManager org.freedesktop.DBus.ObjectManager *
+ * @{
+ */
+
+EAPI Eldbus_Pending *eldbus_object_managed_objects_get(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+#endif
diff --git a/src/lib/edbus/edbus_message.c b/src/lib/eldbus/eldbus_message.c
index 5d14efb64b..85fbe56014 100644
--- a/src/lib/edbus/edbus_message.c
+++ b/src/lib/eldbus/eldbus_message.c
@@ -1,55 +1,55 @@
-#include "edbus_private.h"
-#include "edbus_private_types.h"
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
#include <dbus/dbus.h>
#include <stdint.h>
-/* TODO: mempool of EDBus_Message and EDBus_Message_Iter */
+/* TODO: mempool of Eldbus_Message and Eldbus_Message_Iter */
-#define EDBUS_MESSAGE_CHECK(msg) \
+#define ELDBUS_MESSAGE_CHECK(msg) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN(msg); \
- if (!EINA_MAGIC_CHECK(msg, EDBUS_MESSAGE_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(msg, ELDBUS_MESSAGE_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(msg, EDBUS_MESSAGE_MAGIC); \
+ EINA_MAGIC_FAIL(msg, ELDBUS_MESSAGE_MAGIC); \
return; \
} \
EINA_SAFETY_ON_TRUE_RETURN(msg->refcount <= 0); \
} \
while (0)
-#define EDBUS_MESSAGE_CHECK_RETVAL(msg, retval) \
+#define ELDBUS_MESSAGE_CHECK_RETVAL(msg, retval) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, retval); \
- if (!EINA_MAGIC_CHECK(msg, EDBUS_MESSAGE_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(msg, ELDBUS_MESSAGE_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(msg, EDBUS_MESSAGE_MAGIC); \
+ EINA_MAGIC_FAIL(msg, ELDBUS_MESSAGE_MAGIC); \
return retval; \
} \
EINA_SAFETY_ON_TRUE_RETURN_VAL(msg->refcount <= 0, retval); \
} \
while (0)
-#define EDBUS_MESSAGE_ITERATOR_CHECK(iter) \
+#define ELDBUS_MESSAGE_ITERATOR_CHECK(iter) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN(iter); \
- if (!EINA_MAGIC_CHECK(iter, EDBUS_MESSAGE_ITERATOR_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(iter, ELDBUS_MESSAGE_ITERATOR_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(iter, EDBUS_MESSAGE_ITERATOR_MAGIC); \
+ EINA_MAGIC_FAIL(iter, ELDBUS_MESSAGE_ITERATOR_MAGIC); \
return; \
} \
} \
while (0)
-#define EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, retval) \
+#define ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, retval) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, retval); \
- if (!EINA_MAGIC_CHECK(iter, EDBUS_MESSAGE_ITERATOR_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(iter, ELDBUS_MESSAGE_ITERATOR_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(iter, EDBUS_MESSAGE_ITERATOR_MAGIC); \
+ EINA_MAGIC_FAIL(iter, ELDBUS_MESSAGE_ITERATOR_MAGIC); \
return retval; \
} \
} \
@@ -58,34 +58,34 @@
static Eina_Bool append_basic(char type, va_list *vl, DBusMessageIter *iter);
Eina_Bool
-edbus_message_init(void)
+eldbus_message_init(void)
{
return EINA_TRUE;
}
void
-edbus_message_shutdown(void)
+eldbus_message_shutdown(void)
{
}
-static EDBus_Message_Iter *
+static Eldbus_Message_Iter *
_message_iterator_new(Eina_Bool writable)
{
- EDBus_Message_Iter *iter;
+ Eldbus_Message_Iter *iter;
- iter = calloc(1, sizeof(EDBus_Message_Iter));
+ iter = calloc(1, sizeof(Eldbus_Message_Iter));
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
- EINA_MAGIC_SET(iter, EDBUS_MESSAGE_ITERATOR_MAGIC);
+ EINA_MAGIC_SET(iter, ELDBUS_MESSAGE_ITERATOR_MAGIC);
iter->writable = writable;
return iter;
}
-EDBus_Message *edbus_message_new(Eina_Bool writable)
+Eldbus_Message *eldbus_message_new(Eina_Bool writable)
{
- EDBus_Message *msg = calloc(1, sizeof(EDBus_Message));
+ Eldbus_Message *msg = calloc(1, sizeof(Eldbus_Message));
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
- EINA_MAGIC_SET(msg, EDBUS_MESSAGE_MAGIC);
+ EINA_MAGIC_SET(msg, ELDBUS_MESSAGE_MAGIC);
msg->refcount = 1;
msg->iterator = _message_iterator_new(writable);
@@ -94,21 +94,21 @@ EDBus_Message *edbus_message_new(Eina_Bool writable)
return msg;
fail:
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
return NULL;
}
-EAPI EDBus_Message *
-edbus_message_method_call_new(const char *dest, const char *path, const char *iface, const char *method)
+EAPI Eldbus_Message *
+eldbus_message_method_call_new(const char *dest, const char *path, const char *iface, const char *method)
{
- EDBus_Message *msg;
+ Eldbus_Message *msg;
EINA_SAFETY_ON_NULL_RETURN_VAL(dest, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(method, NULL);
- msg = edbus_message_new(EINA_TRUE);
+ msg = eldbus_message_new(EINA_TRUE);
EINA_SAFETY_ON_NULL_GOTO(msg, fail);
msg->dbus_msg = dbus_message_new_method_call(dest, path, iface, method);
@@ -117,31 +117,31 @@ edbus_message_method_call_new(const char *dest, const char *path, const char *if
return msg;
fail:
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
return NULL;
}
-EAPI EDBus_Message *
-edbus_message_ref(EDBus_Message *msg)
+EAPI Eldbus_Message *
+eldbus_message_ref(Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
DBG("msg=%p, pre-refcount=%d", msg, msg->refcount);
msg->refcount++;
return msg;
}
static void
-_message_iterator_free(EDBus_Message_Iter *iter)
+_message_iterator_free(Eldbus_Message_Iter *iter)
{
Eina_Inlist *lst, *next;
- EDBus_Message_Iter *sub;
+ Eldbus_Message_Iter *sub;
if (!iter) return;
lst = iter->iterators;
while (lst)
{
next = lst->next;
- sub = EINA_INLIST_CONTAINER_GET(lst, EDBus_Message_Iter);
+ sub = EINA_INLIST_CONTAINER_GET(lst, Eldbus_Message_Iter);
_message_iterator_free(sub);
lst = next;
}
@@ -149,9 +149,9 @@ _message_iterator_free(EDBus_Message_Iter *iter)
}
EAPI void
-edbus_message_unref(EDBus_Message *msg)
+eldbus_message_unref(Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK(msg);
+ ELDBUS_MESSAGE_CHECK(msg);
DBG("msg=%p, pre-refcount=%d", msg, msg->refcount);
msg->refcount--;
if (msg->refcount > 0) return;
@@ -168,54 +168,54 @@ edbus_message_unref(EDBus_Message *msg)
}
EAPI const char *
-edbus_message_path_get(const EDBus_Message *msg)
+eldbus_message_path_get(const Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
return dbus_message_get_path(msg->dbus_msg);
}
EAPI const char *
-edbus_message_interface_get(const EDBus_Message *msg)
+eldbus_message_interface_get(const Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
return dbus_message_get_interface(msg->dbus_msg);
}
EAPI const char *
-edbus_message_member_get(const EDBus_Message *msg)
+eldbus_message_member_get(const Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
return dbus_message_get_member(msg->dbus_msg);
}
EAPI const char *
-edbus_message_destination_get(const EDBus_Message *msg)
+eldbus_message_destination_get(const Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
return dbus_message_get_destination(msg->dbus_msg);
}
EAPI const char *
-edbus_message_sender_get(const EDBus_Message *msg)
+eldbus_message_sender_get(const Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
return dbus_message_get_sender(msg->dbus_msg);
}
EAPI const char *
-edbus_message_signature_get(const EDBus_Message *msg)
+eldbus_message_signature_get(const Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
return dbus_message_get_signature(msg->dbus_msg);
}
EAPI Eina_Bool
-edbus_message_error_get(const EDBus_Message *msg, const char **name, const char **text)
+eldbus_message_error_get(const Eldbus_Message *msg, const char **name, const char **text)
{
if (name) *name = NULL;
if (text) *text = NULL;
- EDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
if (dbus_message_get_type(msg->dbus_msg) != DBUS_MESSAGE_TYPE_ERROR)
return EINA_FALSE;
@@ -231,19 +231,19 @@ edbus_message_error_get(const EDBus_Message *msg, const char **name, const char
}
static Eina_Bool
-_edbus_message_arguments_vget(EDBus_Message *msg, const char *signature, va_list ap)
+_eldbus_message_arguments_vget(Eldbus_Message *msg, const char *signature, va_list ap)
{
- EDBus_Message_Iter *iter;
- iter = edbus_message_iter_get(msg);
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ Eldbus_Message_Iter *iter;
+ iter = eldbus_message_iter_get(msg);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
- return edbus_message_iter_arguments_vget(iter, signature, ap);
+ return eldbus_message_iter_arguments_vget(iter, signature, ap);
}
-EAPI EDBus_Message_Iter *
-edbus_message_iter_get(const EDBus_Message *msg)
+EAPI Eldbus_Message_Iter *
+eldbus_message_iter_get(const Eldbus_Message *msg)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
/* Something went wrong, msg->iterator should not be NULL */
EINA_SAFETY_ON_NULL_RETURN_VAL(msg->iterator, NULL);
@@ -251,36 +251,36 @@ edbus_message_iter_get(const EDBus_Message *msg)
}
EAPI Eina_Bool
-edbus_message_arguments_get(const EDBus_Message *msg, const char *signature, ...)
+eldbus_message_arguments_get(const Eldbus_Message *msg, const char *signature, ...)
{
Eina_Bool ret;
va_list ap;
- EDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
va_start(ap, signature);
- ret = _edbus_message_arguments_vget((EDBus_Message *)msg, signature, ap);
+ ret = _eldbus_message_arguments_vget((Eldbus_Message *)msg, signature, ap);
va_end(ap);
return ret;
}
EAPI Eina_Bool
-edbus_message_arguments_vget(const EDBus_Message *msg, const char *signature, va_list ap)
+eldbus_message_arguments_vget(const Eldbus_Message *msg, const char *signature, va_list ap)
{
- EDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
- return _edbus_message_arguments_vget((EDBus_Message *)msg, signature, ap);
+ return _eldbus_message_arguments_vget((Eldbus_Message *)msg, signature, ap);
}
static Eina_Bool
-_edbus_message_iter_arguments_vappend(EDBus_Message_Iter *iter, const char *signature, va_list *aq)
+_eldbus_message_iter_arguments_vappend(Eldbus_Message_Iter *iter, const char *signature, va_list *aq)
{
DBusSignatureIter signature_iter;
Eina_Bool r = EINA_TRUE;
char *type;
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(iter->writable, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
@@ -291,10 +291,10 @@ _edbus_message_iter_arguments_vappend(EDBus_Message_Iter *iter, const char *sign
r = append_basic(type[0], aq, &iter->dbus_iterator);
else
{
- EDBus_Message_Iter **user_itr;
- EDBus_Message_Iter *sub;
+ Eldbus_Message_Iter **user_itr;
+ Eldbus_Message_Iter *sub;
- user_itr = va_arg(*aq, EDBus_Message_Iter **);
+ user_itr = va_arg(*aq, Eldbus_Message_Iter **);
sub = _message_iterator_new(EINA_TRUE);
if (!sub)
{
@@ -313,8 +313,8 @@ _edbus_message_iter_arguments_vappend(EDBus_Message_Iter *iter, const char *sign
else if (type[1] == DBUS_TYPE_VARIANT)
{
ERR("variant not supported by \
- edbus_message_iter_arguments_append(), \
- try edbus_message_iter_container_new()");
+ eldbus_message_iter_arguments_append(), \
+ try eldbus_message_iter_container_new()");
r = EINA_FALSE;
goto next;
}
@@ -343,28 +343,28 @@ next:
}
EAPI Eina_Bool
-edbus_message_iter_arguments_vappend(EDBus_Message_Iter *iter, const char *signature, va_list ap)
+eldbus_message_iter_arguments_vappend(Eldbus_Message_Iter *iter, const char *signature, va_list ap)
{
va_list aq;
Eina_Bool ret;
va_copy(aq, ap);
- ret = _edbus_message_iter_arguments_vappend(iter, signature, &aq);
+ ret = _eldbus_message_iter_arguments_vappend(iter, signature, &aq);
va_end(aq);
return ret;
}
EAPI Eina_Bool
-edbus_message_iter_arguments_append(EDBus_Message_Iter *iter, const char *signature, ...)
+eldbus_message_iter_arguments_append(Eldbus_Message_Iter *iter, const char *signature, ...)
{
Eina_Bool r;
va_list ap;
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
va_start(ap, signature);
- r = edbus_message_iter_arguments_vappend(iter, signature, ap);
+ r = eldbus_message_iter_arguments_vappend(iter, signature, ap);
va_end(ap);
return r;
}
@@ -435,10 +435,10 @@ append_basic(char type, va_list *vl, DBusMessageIter *iter)
}
static Eina_Bool
-_edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_list *aq)
+_eldbus_message_arguments_vappend(Eldbus_Message *msg, const char *signature, va_list *aq)
{
DBusSignatureIter signature_iter;
- EDBus_Message_Iter *iter;
+ Eldbus_Message_Iter *iter;
int type;
Eina_Bool r = EINA_TRUE;
@@ -446,7 +446,7 @@ _edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_l
EINA_SAFETY_ON_FALSE_RETURN_VAL(dbus_signature_validate(signature, NULL),
EINA_FALSE);
- iter = edbus_message_iter_get(msg);
+ iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_FALSE_RETURN_VAL(iter->writable, EINA_FALSE);
dbus_signature_iter_init(&signature_iter, signature);
@@ -456,9 +456,9 @@ _edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_l
r = append_basic(type, aq, &iter->dbus_iterator);
else
{
- ERR("sig = %s | edbus_message_arguments_append() and \
- edbus_message_arguments_vappend() only support basic types, \
- to complex types use edbus_message_iter_* functions",
+ ERR("sig = %s | eldbus_message_arguments_append() and \
+ eldbus_message_arguments_vappend() only support basic types, \
+ to complex types use eldbus_message_iter_* functions",
signature);
r = EINA_FALSE;
}
@@ -471,42 +471,42 @@ _edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_l
}
EAPI Eina_Bool
-edbus_message_arguments_append(EDBus_Message *msg, const char *signature, ...)
+eldbus_message_arguments_append(Eldbus_Message *msg, const char *signature, ...)
{
Eina_Bool ret;
va_list ap;
- EDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
va_start(ap, signature);
- ret = _edbus_message_arguments_vappend(msg, signature, &ap);
+ ret = _eldbus_message_arguments_vappend(msg, signature, &ap);
va_end(ap);
return ret;
}
EAPI Eina_Bool
-edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_list ap)
+eldbus_message_arguments_vappend(Eldbus_Message *msg, const char *signature, va_list ap)
{
va_list aq;
Eina_Bool ret;
- EDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
va_copy(aq, ap);
- ret = _edbus_message_arguments_vappend(msg, signature, &aq);
+ ret = _eldbus_message_arguments_vappend(msg, signature, &aq);
va_end(aq);
return ret;
}
-EAPI EDBus_Message_Iter *
-edbus_message_iter_container_new(EDBus_Message_Iter *iter, int type, const char* contained_signature)
+EAPI Eldbus_Message_Iter *
+eldbus_message_iter_container_new(Eldbus_Message_Iter *iter, int type, const char* contained_signature)
{
- EDBus_Message_Iter *sub;
+ Eldbus_Message_Iter *sub;
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, NULL);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, NULL);
sub = _message_iterator_new(EINA_TRUE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sub, NULL);
@@ -524,21 +524,21 @@ cleanup:
}
EAPI Eina_Bool
-edbus_message_iter_container_close(EDBus_Message_Iter *iter, EDBus_Message_Iter *sub)
+eldbus_message_iter_container_close(Eldbus_Message_Iter *iter, Eldbus_Message_Iter *sub)
{
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(sub, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(sub, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(iter->writable, EINA_FALSE);
return dbus_message_iter_close_container(&iter->dbus_iterator,
&sub->dbus_iterator);
}
EAPI Eina_Bool
-edbus_message_iter_basic_append(EDBus_Message_Iter *iter, int type, ...)
+eldbus_message_iter_basic_append(Eldbus_Message_Iter *iter, int type, ...)
{
Eina_Bool r;
va_list vl;
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(iter->writable, EINA_FALSE);
va_start(vl, type);
@@ -549,18 +549,18 @@ edbus_message_iter_basic_append(EDBus_Message_Iter *iter, int type, ...)
}
EAPI void
-edbus_message_iter_basic_get(EDBus_Message_Iter *iter, void *value)
+eldbus_message_iter_basic_get(Eldbus_Message_Iter *iter, void *value)
{
- EDBUS_MESSAGE_ITERATOR_CHECK(iter);
+ ELDBUS_MESSAGE_ITERATOR_CHECK(iter);
EINA_SAFETY_ON_TRUE_RETURN(iter->writable);
dbus_message_iter_get_basic(&iter->dbus_iterator, value);
}
-EDBus_Message_Iter *
-edbus_message_iter_sub_iter_get(EDBus_Message_Iter *iter)
+Eldbus_Message_Iter *
+eldbus_message_iter_sub_iter_get(Eldbus_Message_Iter *iter)
{
- EDBus_Message_Iter *sub;
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, NULL);
+ Eldbus_Message_Iter *sub;
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, NULL);
EINA_SAFETY_ON_TRUE_RETURN_VAL(iter->writable, NULL);
sub = _message_iterator_new(EINA_FALSE);
@@ -571,16 +571,16 @@ edbus_message_iter_sub_iter_get(EDBus_Message_Iter *iter)
}
EAPI char *
-edbus_message_iter_signature_get(EDBus_Message_Iter *iter)
+eldbus_message_iter_signature_get(Eldbus_Message_Iter *iter)
{
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, NULL);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, NULL);
return dbus_message_iter_get_signature(&iter->dbus_iterator);
}
EAPI Eina_Bool
-edbus_message_iter_next(EDBus_Message_Iter *iter)
+eldbus_message_iter_next(Eldbus_Message_Iter *iter)
{
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(iter->writable, EINA_FALSE);
return dbus_message_iter_next(&iter->dbus_iterator);
}
@@ -665,9 +665,9 @@ get_basic(char type, DBusMessageIter *iter, va_list *vl)
}
EAPI Eina_Bool
-edbus_message_iter_fixed_array_get(EDBus_Message_Iter *iter, int signature, void *value, int *n_elements)
+eldbus_message_iter_fixed_array_get(Eldbus_Message_Iter *iter, int signature, void *value, int *n_elements)
{
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(iter->writable, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(
@@ -681,12 +681,12 @@ edbus_message_iter_fixed_array_get(EDBus_Message_Iter *iter, int signature, void
* Useful when iterating over arrays
*/
EAPI Eina_Bool
-edbus_message_iter_get_and_next(EDBus_Message_Iter *iter, char signature, ...)
+eldbus_message_iter_get_and_next(Eldbus_Message_Iter *iter, char signature, ...)
{
char type;
va_list vl;
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(iter->writable, EINA_FALSE);
va_start(vl, signature);
@@ -703,8 +703,8 @@ edbus_message_iter_get_and_next(EDBus_Message_Iter *iter, char signature, ...)
get_basic(type, &iter->dbus_iterator, &vl);
else
{
- EDBus_Message_Iter *sub;
- EDBus_Message_Iter **iter_var = va_arg(vl, EDBus_Message_Iter**);
+ Eldbus_Message_Iter *sub;
+ Eldbus_Message_Iter **iter_var = va_arg(vl, Eldbus_Message_Iter**);
sub = _message_iterator_new(EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sub, EINA_FALSE);
@@ -722,12 +722,12 @@ edbus_message_iter_get_and_next(EDBus_Message_Iter *iter, char signature, ...)
}
static Eina_Bool
-_edbus_message_iter_arguments_vget(EDBus_Message_Iter *iter, const char *signature, va_list *aq)
+_eldbus_message_iter_arguments_vget(Eldbus_Message_Iter *iter, const char *signature, va_list *aq)
{
int iter_type;
DBusSignatureIter sig_iter;
- EDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
+ ELDBUS_MESSAGE_ITERATOR_CHECK_RETVAL(iter, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(iter->writable, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(dbus_signature_validate(signature, NULL), EINA_FALSE);
@@ -749,8 +749,8 @@ _edbus_message_iter_arguments_vget(EDBus_Message_Iter *iter, const char *signatu
get_basic(iter_type, &iter->dbus_iterator, aq);
else
{
- EDBus_Message_Iter **user_itr = va_arg(*aq, EDBus_Message_Iter **);
- EDBus_Message_Iter *sub_itr;
+ Eldbus_Message_Iter **user_itr = va_arg(*aq, Eldbus_Message_Iter **);
+ Eldbus_Message_Iter *sub_itr;
sub_itr = _message_iterator_new(EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(sub_itr, EINA_FALSE);
@@ -771,48 +771,48 @@ _edbus_message_iter_arguments_vget(EDBus_Message_Iter *iter, const char *signatu
}
EAPI Eina_Bool
-edbus_message_iter_arguments_get(EDBus_Message_Iter *iter, const char *signature, ...)
+eldbus_message_iter_arguments_get(Eldbus_Message_Iter *iter, const char *signature, ...)
{
va_list ap;
Eina_Bool ret;
va_start(ap, signature);
- ret = _edbus_message_iter_arguments_vget(iter, signature, &ap);
+ ret = _eldbus_message_iter_arguments_vget(iter, signature, &ap);
va_end(ap);
return ret;
}
EAPI Eina_Bool
-edbus_message_iter_arguments_vget(EDBus_Message_Iter *iter, const char *signature, va_list ap)
+eldbus_message_iter_arguments_vget(Eldbus_Message_Iter *iter, const char *signature, va_list ap)
{
va_list aq;
Eina_Bool ret;
va_copy(aq, ap);
- ret = _edbus_message_iter_arguments_vget(iter, signature, &aq);
+ ret = _eldbus_message_iter_arguments_vget(iter, signature, &aq);
va_end(aq);
return ret;
}
EAPI void
-edbus_message_iter_del(EDBus_Message_Iter *iter)
+eldbus_message_iter_del(Eldbus_Message_Iter *iter)
{
- EDBUS_MESSAGE_ITERATOR_CHECK(iter);
+ ELDBUS_MESSAGE_ITERATOR_CHECK(iter);
_message_iterator_free(iter);
}
-EAPI EDBus_Message *
-edbus_message_error_new(const EDBus_Message *msg, const char *error_name, const char *error_msg)
+EAPI Eldbus_Message *
+eldbus_message_error_new(const Eldbus_Message *msg, const char *error_name, const char *error_msg)
{
- EDBus_Message *reply;
+ Eldbus_Message *reply;
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(error_name, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(error_msg, NULL);
- reply = edbus_message_new(EINA_FALSE);
+ reply = eldbus_message_new(EINA_FALSE);
reply->dbus_msg = dbus_message_new_error(msg->dbus_msg,
error_name, error_msg);
@@ -826,13 +826,13 @@ edbus_message_error_new(const EDBus_Message *msg, const char *error_name, const
return reply;
}
-EAPI EDBus_Message *
-edbus_message_method_return_new(const EDBus_Message *msg)
+EAPI Eldbus_Message *
+eldbus_message_method_return_new(const Eldbus_Message *msg)
{
- EDBus_Message *reply;
- EDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
+ Eldbus_Message *reply;
+ ELDBUS_MESSAGE_CHECK_RETVAL(msg, NULL);
- reply = edbus_message_new(EINA_TRUE);
+ reply = eldbus_message_new(EINA_TRUE);
reply->dbus_msg = dbus_message_new_method_return(msg->dbus_msg);
dbus_message_iter_init_append(reply->dbus_msg,
@@ -841,16 +841,16 @@ edbus_message_method_return_new(const EDBus_Message *msg)
return reply;
}
-EAPI EDBus_Message *
-edbus_message_signal_new(const char *path, const char *interface, const char *name)
+EAPI Eldbus_Message *
+eldbus_message_signal_new(const char *path, const char *interface, const char *name)
{
- EDBus_Message *msg;
+ Eldbus_Message *msg;
EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL);
EINA_SAFETY_ON_FALSE_RETURN_VAL(name, NULL);
- msg = edbus_message_new(EINA_TRUE);
+ msg = eldbus_message_new(EINA_TRUE);
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
msg->dbus_msg = dbus_message_new_signal(path, interface, name);
diff --git a/src/lib/edbus/edbus_message.h b/src/lib/eldbus/eldbus_message.h
index 000e2dd268..4c174cb747 100644
--- a/src/lib/edbus/edbus_message.h
+++ b/src/lib/eldbus/eldbus_message.h
@@ -1,9 +1,9 @@
-#ifndef EDBUS_MESSAGE_H
-#define EDBUS_MESSAGE_H 1
+#ifndef ELDBUS_MESSAGE_H
+#define ELDBUS_MESSAGE_H 1
/**
- * @defgroup EDBus_Message Message
- * @ingroup EDBus
+ * @defgroup Eldbus_Message Message
+ * @ingroup Eldbus
*
* @{
*/
@@ -11,7 +11,7 @@
/**
* @brief Increase message reference.
*/
-EAPI EDBus_Message *edbus_message_ref(EDBus_Message *msg) EINA_ARG_NONNULL(1);
+EAPI Eldbus_Message *eldbus_message_ref(Eldbus_Message *msg) EINA_ARG_NONNULL(1);
/**
* @brief Decrease message reference.
@@ -19,14 +19,14 @@ EAPI EDBus_Message *edbus_message_ref(EDBus_Message *msg) EINA_ARG_NONNUL
* When refcount reaches zero the message and all its resources will be
* freed.
*/
-EAPI void edbus_message_unref(EDBus_Message *msg) EINA_ARG_NONNULL(1);
+EAPI void eldbus_message_unref(Eldbus_Message *msg) EINA_ARG_NONNULL(1);
-EAPI const char *edbus_message_path_get(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_message_interface_get(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_message_member_get(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_message_destination_get(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_message_sender_get(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
-EAPI const char *edbus_message_signature_get(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_message_path_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_message_interface_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_message_member_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_message_destination_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_message_sender_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_message_signature_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Create a new message to invoke a method on a remote object.
@@ -36,9 +36,9 @@ EAPI const char *edbus_message_signature_get(const EDBus_Message *msg)
* @param iface interface name
* @param method name of the method to be called
*
- * @return a new EDBus_Message, free with edbus_message_unref()
+ * @return a new Eldbus_Message, free with eldbus_message_unref()
*/
-EAPI EDBus_Message *edbus_message_method_call_new(const char *dest, const char *path, const char *iface, const char *method) EINA_ARG_NONNULL(1, 2, 3, 4) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
+EAPI Eldbus_Message *eldbus_message_method_call_new(const char *dest, const char *path, const char *iface, const char *method) EINA_ARG_NONNULL(1, 2, 3, 4) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
/**
* @brief Create a new message that is an error reply to another message.
@@ -47,22 +47,22 @@ EAPI EDBus_Message *edbus_message_method_call_new(const char *dest, const
* @param error_name the error name
* @param error_msg the error message string
*
- * @return a new EDBus_Message, free with edbus_message_unref()
+ * @return a new Eldbus_Message, free with eldbus_message_unref()
*/
-EAPI EDBus_Message *edbus_message_error_new(const EDBus_Message *msg, const char *error_name, const char *error_msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI Eldbus_Message *eldbus_message_error_new(const Eldbus_Message *msg, const char *error_name, const char *error_msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Create a message that is a reply to a method call.
*
* @param msg the message we're replying to
*
- * @return new EDBus_Message, free with edbus_message_unref()
+ * @return new Eldbus_Message, free with eldbus_message_unref()
*/
-EAPI EDBus_Message *edbus_message_method_return_new(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI Eldbus_Message *eldbus_message_method_return_new(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Get the error text and name from a EDBus_Message.
+ * @brief Get the error text and name from a Eldbus_Message.
*
* If @param msg is an error message return EINA_TRUE and fill in the name and
* text of the error.
@@ -73,16 +73,16 @@ EAPI EDBus_Message *edbus_message_method_return_new(const EDBus_Message *
* @param text Variable in which to store the error text or @c NULL if it's not
* desired.
*/
-EAPI Eina_Bool edbus_message_error_get(const EDBus_Message *msg, const char **name, const char **text) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool eldbus_message_error_get(const Eldbus_Message *msg, const char **name, const char **text) EINA_ARG_NONNULL(1);
/**
- * @brief Get the arguments from an EDBus_Message
+ * @brief Get the arguments from an Eldbus_Message
*
- * Get the arguments of an EDBus_Message storing them in the locations pointed
+ * Get the arguments of an Eldbus_Message storing them in the locations pointed
* to by the pointer arguments that follow @param signature. Each pointer
* argument must be of a type that is appropriate for the correspondent complete
* type in @param signature. For complex types such as arrays, structs,
- * dictionaries or variants, a pointer to EDBus_Message_Iter* must be provided.
+ * dictionaries or variants, a pointer to Eldbus_Message_Iter* must be provided.
*
* @param msg The message to get the arguments from.
* @param signature The signature of the arguments user is expecting to read
@@ -92,31 +92,31 @@ EAPI Eina_Bool edbus_message_error_get(const EDBus_Message *msg, con
* @return EINA_TRUE if the arguments were read succesfully and stored in the
* respective pointer arguments.
*/
-EAPI Eina_Bool edbus_message_arguments_get(const EDBus_Message *msg, const char *signature, ...) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
+EAPI Eina_Bool eldbus_message_arguments_get(const Eldbus_Message *msg, const char *signature, ...) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Get the arguments from an EDBus_Message using a va_list.
+ * @brief Get the arguments from an Eldbus_Message using a va_list.
*
* @param msg The message to get the arguments from.
* @param signature The signature user is expecting to read from @param msg.
* @param ap The va_list containing the pointer arguments.
*
- * @see edbus_message_arguments_get()
+ * @see eldbus_message_arguments_get()
*
* @return EINA_TRUE if the arguments were read succesfully and stored in the
* respective pointer arguments.
*/
-EAPI Eina_Bool edbus_message_arguments_vget(const EDBus_Message *msg, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
+EAPI Eina_Bool eldbus_message_arguments_vget(const Eldbus_Message *msg, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Append arguments into an EDBus_Message
+ * @brief Append arguments into an Eldbus_Message
*
- * Append arguments into an EDBus_Message according to the @param signature
+ * Append arguments into an Eldbus_Message according to the @param signature
* provided. For each complete type in @param signature, a value of the
* corresponding type must be provided.
*
* This function supports only basic types. For complex types use
- * edbus_message_iter_* family of functions.
+ * eldbus_message_iter_* family of functions.
*
* @param msg The message in which arguments are being appended.
* @param signature Signature of the arguments that are being appended.
@@ -124,23 +124,23 @@ EAPI Eina_Bool edbus_message_arguments_vget(const EDBus_Message *msg
*
* @return EINA_TRUE on success, EINA_FALSE otherwise.
*/
-EAPI Eina_Bool edbus_message_arguments_append(EDBus_Message *msg, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool eldbus_message_arguments_append(Eldbus_Message *msg, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Append arguments into an EDBus_Message using a va_list.
+ * @brief Append arguments into an Eldbus_Message using a va_list.
*
* @param msg The message in which arguments are being appended.
* @param signature Signature of the arguments that are being appended.
* @param ap The va_list containing the arguments to append.
*
- * @see edbus_message_arguments_append().
+ * @see eldbus_message_arguments_append().
*
* @return EINA_TRUE on success, EINA_FALSE otherwise.
*/
-EAPI Eina_Bool edbus_message_arguments_vappend(EDBus_Message *msg, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool eldbus_message_arguments_vappend(Eldbus_Message *msg, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2);
/**
- * @defgroup EDBus_Message_Iter Iterator
+ * @defgroup Eldbus_Message_Iter Iterator
* @{
*/
@@ -148,7 +148,7 @@ EAPI Eina_Bool edbus_message_arguments_vappend(EDBus_Message *msg, c
* @brief Create and append a typed iterator to another iterator.
*
* After append data to returned iterator it must be closed calling
- * edbus_message_iter_container_close().
+ * eldbus_message_iter_container_close().
*
* Container types are for example struct, variant, and array.
* For variants, the contained_signature should be the type of the single
@@ -162,56 +162,56 @@ EAPI Eina_Bool edbus_message_arguments_vappend(EDBus_Message *msg, c
*
* @return the new iterator
*/
-EAPI EDBus_Message_Iter *edbus_message_iter_container_new(EDBus_Message_Iter *iter, int type, const char* contained_signature) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT;
+EAPI Eldbus_Message_Iter *eldbus_message_iter_container_new(Eldbus_Message_Iter *iter, int type, const char* contained_signature) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Append a basic type into an EDBus_Iterator.
+ * @brief Append a basic type into an Eldbus_Iterator.
*/
-EAPI Eina_Bool edbus_message_iter_basic_append(EDBus_Message_Iter *iter, int type, ...) EINA_ARG_NONNULL(1, 3);
+EAPI Eina_Bool eldbus_message_iter_basic_append(Eldbus_Message_Iter *iter, int type, ...) EINA_ARG_NONNULL(1, 3);
/**
- * @brief Append an argument into an EDBus_Message_Iter. For each complete type
+ * @brief Append an argument into an Eldbus_Message_Iter. For each complete type
* you need to provide the correspondent value. In case of complex types you
- * need to provide an EDBus_Message_Iter** to be allocated and then filled in.
+ * need to provide an Eldbus_Message_Iter** to be allocated and then filled in.
*
* It's not possible to open two iterators at same iterator with this function.
* For example, to create a message with signature="aiai" you need to create the
- * first container with edbus_message_iter_container_new(), fill the array,
- * close it with edbus_message_iter_container_close() and then do the same for
+ * first container with eldbus_message_iter_container_new(), fill the array,
+ * close it with eldbus_message_iter_container_close() and then do the same for
* the second array.
*
* @param iter iterator in which data will be appended
* @param signature signature of the contained data
* @param ... values for each complete type
*
- * @see edbus_message_iter_container_new()
- * @see edbus_message_iter_container_close()
+ * @see eldbus_message_iter_container_new()
+ * @see eldbus_message_iter_container_close()
*
* @note This function doesn't support variant, use
- * edbus_message_iter_container_new() instead to create the variant, fill
+ * eldbus_message_iter_container_new() instead to create the variant, fill
* with data and close it.
*/
-EAPI Eina_Bool edbus_message_iter_arguments_append(EDBus_Message_Iter *iter, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool eldbus_message_iter_arguments_append(Eldbus_Message_Iter *iter, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Set data to EDBus_Message_Iter. For each complete in signature
+ * @brief Set data to Eldbus_Message_Iter. For each complete in signature
* you need pass the value, in case of complex type a pointer to be allocated a
- * EDBus_Message_Iter that you need fill and close.
+ * Eldbus_Message_Iter that you need fill and close.
*
* It's not possible open two iterators at same Iterator. Example:
* "aiai", to set this you need create and put the first array with
- * edbus_message_iter_container_new() fill array with data and close then
- * you could open the second array with edbus_message_iter_container_new().
+ * eldbus_message_iter_container_new() fill array with data and close then
+ * you could open the second array with eldbus_message_iter_container_new().
*
* @param iter iterator
* @param signature of data
* @param ap va_list with the values
*
* @note This function don't support variant, use instead
- * edbus_message_iter_container_new() to create the variant fill
+ * eldbus_message_iter_container_new() to create the variant fill
* data and close it.
*/
-EAPI Eina_Bool edbus_message_iter_arguments_vappend(EDBus_Message_Iter *iter, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 3);
+EAPI Eina_Bool eldbus_message_iter_arguments_vappend(Eldbus_Message_Iter *iter, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 3);
/**
* @brief Closes a container-typed value appended to the message.
@@ -221,24 +221,24 @@ EAPI Eina_Bool edbus_message_iter_arguments_vappend(EDBus_Message_
*
* @return EINA_FALSE if iterator was already close or if not enough memory
*/
-EAPI Eina_Bool edbus_message_iter_container_close(EDBus_Message_Iter *iter, EDBus_Message_Iter *sub) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool eldbus_message_iter_container_close(Eldbus_Message_Iter *iter, Eldbus_Message_Iter *sub) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Get the main EDBus_Message_Iter from the EDBus_Message.
+ * @brief Get the main Eldbus_Message_Iter from the Eldbus_Message.
*/
-EAPI EDBus_Message_Iter *edbus_message_iter_get(const EDBus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI Eldbus_Message_Iter *eldbus_message_iter_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
- * @brief Get a basic type from EDBus_Iterator.
+ * @brief Get a basic type from Eldbus_Iterator.
*/
-EAPI void edbus_message_iter_basic_get(EDBus_Message_Iter *iter, void *value) EINA_ARG_NONNULL(1, 2);
+EAPI void eldbus_message_iter_basic_get(Eldbus_Message_Iter *iter, void *value) EINA_ARG_NONNULL(1, 2);
/**
* @brief Returns the current signature of a message iterator.
*
* @note The returned string must be freed.
*/
-EAPI char *edbus_message_iter_signature_get(EDBus_Message_Iter *iter) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI char *eldbus_message_iter_signature_get(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
/**
* @brief Moves the iterator to the next field, if any.
@@ -246,10 +246,10 @@ EAPI char *edbus_message_iter_signature_get(EDBus_Message_Iter
*
* @return if iterator was reach to end return EINA_FALSE
*/
-EAPI Eina_Bool edbus_message_iter_next(EDBus_Message_Iter *iter) EINA_ARG_NONNULL(1);
+EAPI Eina_Bool eldbus_message_iter_next(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1);
/**
- * @brief Get a complete type from EDBus_Message_Iter if is not at the end
+ * @brief Get a complete type from Eldbus_Message_Iter if is not at the end
* of iterator and move to next field.
* Useful to iterate over arrays.
*
@@ -261,7 +261,7 @@ EAPI Eina_Bool edbus_message_iter_next(EDBus_Message_Iter *iter) E
* iterator points return EINA_FALSE
*
*/
-EAPI Eina_Bool edbus_message_iter_get_and_next(EDBus_Message_Iter *iter, char type, ...) EINA_ARG_NONNULL(1, 2, 3);
+EAPI Eina_Bool eldbus_message_iter_get_and_next(Eldbus_Message_Iter *iter, char type, ...) EINA_ARG_NONNULL(1, 2, 3);
/**
* @brief Reads a block of fixed-length values from the message iterator.
@@ -270,7 +270,7 @@ EAPI Eina_Bool edbus_message_iter_get_and_next(EDBus_Message_Iter
* such as integers, bool, double. The returned block will be from the
* current position in the array until the end of the array.
*
- * There is one exception here: although EDBUS_TYPE_UNIX_FD is considered a
+ * There is one exception here: although ELDBUS_TYPE_UNIX_FD is considered a
* 'fixed' type arrays of this type may not be read with this function.
*
* The value argument should be the address of a location to store the returned
@@ -280,12 +280,12 @@ EAPI Eina_Bool edbus_message_iter_get_and_next(EDBus_Message_Iter
* Because the array is not copied, this function runs in constant time and is
* fast; it's much preferred over walking the entire array with an iterator.
*/
-EAPI Eina_Bool edbus_message_iter_fixed_array_get(EDBus_Message_Iter *iter, int signature, void *value, int *n_elements) EINA_ARG_NONNULL(1, 3, 4);
+EAPI Eina_Bool eldbus_message_iter_fixed_array_get(Eldbus_Message_Iter *iter, int signature, void *value, int *n_elements) EINA_ARG_NONNULL(1, 3, 4);
/**
- * @brief Get data from EDBus_Message_Iter, for each complete type must have
+ * @brief Get data from Eldbus_Message_Iter, for each complete type must have
* a pointer to store his value, in case of complex type a
- * EDBus_Message_Iter will be need.
+ * Eldbus_Message_Iter will be need.
*
* @param iter iterator
* @param signature of the complete data types on interator
@@ -293,12 +293,12 @@ EAPI Eina_Bool edbus_message_iter_fixed_array_get(EDBus_Message_Iter *iter, int
*
* @return EINA_FALSE if signature different from signature in iterator
*/
-EAPI Eina_Bool edbus_message_iter_arguments_get(EDBus_Message_Iter *iter, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool eldbus_message_iter_arguments_get(Eldbus_Message_Iter *iter, const char *signature, ...) EINA_ARG_NONNULL(1, 2);
/**
- * @brief Get data from EDBus_Message_Iter, for each complete type must have
+ * @brief Get data from Eldbus_Message_Iter, for each complete type must have
* a pointer to store his value, in case of complex type a
- * EDBus_Message_Iter will be need.
+ * Eldbus_Message_Iter will be need.
*
* @param iter iterator
* @param signature of the complete data types on interator
@@ -306,12 +306,12 @@ EAPI Eina_Bool edbus_message_iter_arguments_get(EDBus_Message_Iter
*
* @return EINA_FALSE if signature different from signature in iterator
*/
-EAPI Eina_Bool edbus_message_iter_arguments_vget(EDBus_Message_Iter *iter, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2);
+EAPI Eina_Bool eldbus_message_iter_arguments_vget(Eldbus_Message_Iter *iter, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2);
/**
* @brief Manually delete the iterator.
*
- * Iterators are usually bound to the life of @ref EDBus_Message
+ * Iterators are usually bound to the life of @ref Eldbus_Message
* they were created from, being deleted automatically once the
* message is deleted.
*
@@ -322,14 +322,14 @@ EAPI Eina_Bool edbus_message_iter_arguments_vget(EDBus_Message_Ite
*
* @param iter the iterator to be deleted.
*/
-EAPI void edbus_message_iter_del(EDBus_Message_Iter *iter) EINA_ARG_NONNULL(1);
+EAPI void eldbus_message_iter_del(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1);
/**
* @}
*/
-#include "edbus_message_helper.h"
-#include "edbus_message_eina_value.h"
+#include "eldbus_message_helper.h"
+#include "eldbus_message_eina_value.h"
/**
* @}
diff --git a/src/lib/eldbus/eldbus_message_eina_value.h b/src/lib/eldbus/eldbus_message_eina_value.h
new file mode 100644
index 0000000000..9e51ca96a5
--- /dev/null
+++ b/src/lib/eldbus/eldbus_message_eina_value.h
@@ -0,0 +1,36 @@
+/**
+ * @ingroup Eldbus_Message
+ * @defgroup Eina_Value Eina_Value to/from Message
+ * @{
+ */
+
+/**
+ * Convert Eldbus_Message to Eina_Value
+ *
+ * @param msg Message
+ * @return Eina_Value of type Eina_Value_Type_Struct
+ */
+EAPI Eina_Value *eldbus_message_to_eina_value(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * Convert Eldbus_Message_Iter of type variant, struct or dict entry to
+ * Eina_Value.
+ *
+ * @param iter Message iterator
+ * @return Eina_Value of type Eina_Value_Type_Struct
+ */
+EAPI Eina_Value *eldbus_message_iter_struct_like_to_eina_value(const Eldbus_Message_Iter *iter);
+
+/**
+ * Convert Eina_Value to Eldbus_Message
+ *
+ * @param signature dbus signature
+ * @param msg where data will be put
+ * @param value source of data, must be of type Eina_Value_Type_Struct
+ * @return success or not
+ */
+EAPI Eina_Bool eldbus_message_from_eina_value(const char *signature, Eldbus_Message *msg, const Eina_Value *value) EINA_ARG_NONNULL(1, 2, 3);
+
+/**
+ * @}
+ */
diff --git a/src/lib/edbus/edbus_message_from_eina_value.c b/src/lib/eldbus/eldbus_message_from_eina_value.c
index 478fe438d2..f94ca42846 100644
--- a/src/lib/edbus/edbus_message_from_eina_value.c
+++ b/src/lib/eldbus/eldbus_message_from_eina_value.c
@@ -1,5 +1,5 @@
-#include "edbus_private.h"
-#include "edbus_private_types.h"
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
static Eina_Bool
_compatible_type(int dbus_type, const Eina_Value_Type *value_type)
@@ -42,12 +42,12 @@ _compatible_type(int dbus_type, const Eina_Value_Type *value_type)
}
static Eina_Bool
-_array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Iter *iter)
+_array_append(const char *type, const Eina_Value *value_array, Eldbus_Message_Iter *iter)
{
- EDBus_Message_Iter *array;
+ Eldbus_Message_Iter *array;
EINA_SAFETY_ON_FALSE_RETURN_VAL(
- edbus_message_iter_arguments_append(iter, type, &array), EINA_FALSE);
+ eldbus_message_iter_arguments_append(iter, type, &array), EINA_FALSE);
DBG("array of type %c", type[1]);
switch (type[1])
{
@@ -62,11 +62,11 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
Eina_Value st;
- EDBus_Message_Iter *entry;
+ Eldbus_Message_Iter *entry;
eina_value_array_value_get(value_array, i, &st);
- edbus_message_iter_arguments_append(array, type+1, &entry);
+ eldbus_message_iter_arguments_append(array, type+1, &entry);
_message_iter_from_eina_value_struct(entry_sig, entry, &st);
- edbus_message_iter_container_close(array, entry);
+ eldbus_message_iter_container_close(array, entry);
eina_value_flush(&st);
}
free(entry_sig);
@@ -78,11 +78,11 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
Eina_Value inner_array;
- EDBus_Message_Iter *sub_array;
+ Eldbus_Message_Iter *sub_array;
eina_value_array_value_get(value_array, i, &inner_array);
- edbus_message_iter_arguments_append(array, type+1, &sub_array);
+ eldbus_message_iter_arguments_append(array, type+1, &sub_array);
_array_append(type+1, &inner_array, sub_array);
- edbus_message_iter_container_close(array, sub_array);
+ eldbus_message_iter_container_close(array, sub_array);
eina_value_flush(&inner_array);
}
break;
@@ -100,7 +100,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -113,7 +113,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &txt);
- edbus_message_iter_basic_append(array, type[1], txt);
+ eldbus_message_iter_basic_append(array, type[1], txt);
}
break;
}
@@ -125,7 +125,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -136,7 +136,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -147,7 +147,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -158,7 +158,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -169,7 +169,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -180,7 +180,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -191,7 +191,7 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
for (i = 0; i < eina_value_array_count(value_array); i++)
{
eina_value_array_get(value_array, i, &z);
- edbus_message_iter_basic_append(array, type[1], z);
+ eldbus_message_iter_basic_append(array, type[1], z);
}
break;
}
@@ -201,12 +201,12 @@ _array_append(const char *type, const Eina_Value *value_array, EDBus_Message_Ite
return EINA_FALSE;
}
}
- edbus_message_iter_container_close(iter, array);
+ eldbus_message_iter_container_close(iter, array);
return EINA_TRUE;
}
static Eina_Bool
-_basic_append(char type, const Eina_Value *value, const Eina_Value_Struct_Desc *desc, unsigned idx, EDBus_Message_Iter *iter)
+_basic_append(char type, const Eina_Value *value, const Eina_Value_Struct_Desc *desc, unsigned idx, Eldbus_Message_Iter *iter)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(
_compatible_type(type, desc->members[idx].type), EINA_FALSE);
@@ -217,7 +217,7 @@ _basic_append(char type, const Eina_Value *value, const Eina_Value_Struct_Desc *
{
int32_t i;
eina_value_struct_get(value, desc->members[idx].name, &i);
- edbus_message_iter_basic_append(iter, type, i);
+ eldbus_message_iter_basic_append(iter, type, i);
break;
}
case 's':
@@ -226,7 +226,7 @@ _basic_append(char type, const Eina_Value *value, const Eina_Value_Struct_Desc *
{
const char *txt;
eina_value_struct_get(value, desc->members[idx].name, &txt);
- edbus_message_iter_basic_append(iter, type, txt);
+ eldbus_message_iter_basic_append(iter, type, txt);
break;
}
case 'b'://boolean
@@ -234,49 +234,49 @@ _basic_append(char type, const Eina_Value *value, const Eina_Value_Struct_Desc *
{
unsigned char byte;
eina_value_struct_get(value, desc->members[idx].name, &byte);
- edbus_message_iter_basic_append(iter, type, byte);
+ eldbus_message_iter_basic_append(iter, type, byte);
break;
}
case 'n'://int16
{
int16_t i;
eina_value_struct_get(value, desc->members[idx].name, &i);
- edbus_message_iter_basic_append(iter, type, i);
+ eldbus_message_iter_basic_append(iter, type, i);
break;
}
case 'q'://uint16
{
uint16_t i;
eina_value_struct_get(value, desc->members[idx].name, &i);
- edbus_message_iter_basic_append(iter, type, i);
+ eldbus_message_iter_basic_append(iter, type, i);
break;
}
case 'u'://uint32
{
uint32_t i;
eina_value_struct_get(value, desc->members[idx].name, &i);
- edbus_message_iter_basic_append(iter, type, i);
+ eldbus_message_iter_basic_append(iter, type, i);
break;
}
case 'x'://int64
{
int64_t i;
eina_value_struct_get(value, desc->members[idx].name, &i);
- edbus_message_iter_basic_append(iter, type, i);
+ eldbus_message_iter_basic_append(iter, type, i);
break;
}
case 't'://uint64
{
uint64_t i;
eina_value_struct_get(value, desc->members[idx].name, &i);
- edbus_message_iter_basic_append(iter, type, i);
+ eldbus_message_iter_basic_append(iter, type, i);
break;
}
case 'd'://double
{
double d;
eina_value_struct_get(value, desc->members[idx].name, &d);
- edbus_message_iter_basic_append(iter, type, d);
+ eldbus_message_iter_basic_append(iter, type, d);
break;
}
default:
@@ -287,7 +287,7 @@ _basic_append(char type, const Eina_Value *value, const Eina_Value_Struct_Desc *
}
Eina_Bool
-_message_iter_from_eina_value_struct(const char *signature, EDBus_Message_Iter *iter, const Eina_Value *value)
+_message_iter_from_eina_value_struct(const char *signature, Eldbus_Message_Iter *iter, const Eina_Value *value)
{
unsigned i;
DBusSignatureIter signature_iter;
@@ -321,7 +321,7 @@ _message_iter_from_eina_value_struct(const char *signature, EDBus_Message_Iter *
else if (type[0] == '(')
{
Eina_Value inner_st;
- EDBus_Message_Iter *sub_iter;
+ Eldbus_Message_Iter *sub_iter;
char *sub_sig;
unsigned len = strlen(type+1) -1;
sub_sig = malloc(sizeof(char) * len);
@@ -331,10 +331,10 @@ _message_iter_from_eina_value_struct(const char *signature, EDBus_Message_Iter *
_compatible_type(type[0], st.desc->members[i].type),
EINA_FALSE);
eina_value_struct_value_get(value, st.desc->members[i].name, &inner_st);
- edbus_message_iter_arguments_append(iter, type, &sub_iter);
+ eldbus_message_iter_arguments_append(iter, type, &sub_iter);
r = _message_iter_from_eina_value_struct(sub_sig, sub_iter,
&inner_st);
- edbus_message_iter_container_close(iter, sub_iter);
+ eldbus_message_iter_container_close(iter, sub_iter);
free(sub_sig);
}
else if (type[0] == 'v')
@@ -355,14 +355,14 @@ _message_iter_from_eina_value_struct(const char *signature, EDBus_Message_Iter *
}
EAPI Eina_Bool
-edbus_message_from_eina_value(const char *signature, EDBus_Message *msg, const Eina_Value *value)
+eldbus_message_from_eina_value(const char *signature, Eldbus_Message *msg, const Eina_Value *value)
{
- EDBus_Message_Iter *iter;
+ Eldbus_Message_Iter *iter;
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE);
- iter = edbus_message_iter_get(msg);
+ iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN_VAL(iter->writable, EINA_FALSE);
diff --git a/src/lib/eldbus/eldbus_message_helper.c b/src/lib/eldbus/eldbus_message_helper.c
new file mode 100644
index 0000000000..43053acdfe
--- /dev/null
+++ b/src/lib/eldbus/eldbus_message_helper.c
@@ -0,0 +1,31 @@
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
+
+EAPI void
+eldbus_message_iter_dict_iterate(Eldbus_Message_Iter *array, const char *signature, Eldbus_Dict_Cb_Get cb, const void *data)
+{
+ Eldbus_Message_Iter *entry;
+ char *iter_sig;
+ unsigned len;
+ EINA_SAFETY_ON_FALSE_RETURN(array);
+ EINA_SAFETY_ON_NULL_RETURN(signature);
+
+ iter_sig = eldbus_message_iter_signature_get(array);
+ len = strlen(iter_sig + 1);
+ if (strncmp(signature, iter_sig + 1, len - 1))
+ {
+ ERR("Unexpected signature, expected is: %s", iter_sig);
+ free(iter_sig);
+ return;
+ }
+ free(iter_sig);
+
+ while (eldbus_message_iter_get_and_next(array, 'e', &entry))
+ {
+ const void *key;
+ Eldbus_Message_Iter *var;
+ if (!eldbus_message_iter_arguments_get(entry, signature, &key, &var))
+ continue;
+ cb((void *)data, key, var);
+ }
+}
diff --git a/src/lib/eldbus/eldbus_message_helper.h b/src/lib/eldbus/eldbus_message_helper.h
new file mode 100644
index 0000000000..3009bc1301
--- /dev/null
+++ b/src/lib/eldbus/eldbus_message_helper.h
@@ -0,0 +1,22 @@
+/**
+ * @ingroup Eldbus_Message
+ * @defgroup Eldbus_Message_Helpers Message Helpers
+ *
+ * @{
+ */
+
+typedef void (*Eldbus_Dict_Cb_Get)(void *data, const void *key, Eldbus_Message_Iter *var);
+
+/**
+ * Iterate over a dictionary.
+ *
+ * @param dict iterator with array of entry
+ * @param signature of entry, example: "sv"
+ * @param cb callback that will be called in each entry
+ * @param data context data
+ */
+EAPI void eldbus_message_iter_dict_iterate(Eldbus_Message_Iter *dict, const char *signature, Eldbus_Dict_Cb_Get cb, const void *data) EINA_ARG_NONNULL(1, 2, 3);
+
+/**
+ * @}
+ */
diff --git a/src/lib/edbus/edbus_message_to_eina_value.c b/src/lib/eldbus/eldbus_message_to_eina_value.c
index 2c01a5ffbc..3f90266726 100644
--- a/src/lib/edbus/edbus_message_to_eina_value.c
+++ b/src/lib/eldbus/eldbus_message_to_eina_value.c
@@ -1,7 +1,7 @@
-#include "edbus_private.h"
-#include "edbus_private_types.h"
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
-static void _message_iter_basic_array_to_eina_value(char type, Eina_Value *value, EDBus_Message_Iter *iter);
+static void _message_iter_basic_array_to_eina_value(char type, Eina_Value *value, Eldbus_Message_Iter *iter);
static const Eina_Value_Type *
_dbus_type_to_eina_value_type(char type)
@@ -94,24 +94,24 @@ _type_offset(char type, unsigned base)
}
static Eina_Value *
-_message_iter_array_to_eina_value(EDBus_Message_Iter *iter)
+_message_iter_array_to_eina_value(Eldbus_Message_Iter *iter)
{
Eina_Value *array_value;
char *sig;
- sig = edbus_message_iter_signature_get(iter);
+ sig = eldbus_message_iter_signature_get(iter);
DBG("array of %s", sig);
array_value = eina_value_array_new(_dbus_type_to_eina_value_type(sig[0]), 0);
if (sig[0] == '(' || sig[0] == '{' || sig[0] == 'v')
{
- EDBus_Message_Iter *entry;
+ Eldbus_Message_Iter *entry;
if (sig[0] == '{')
sig[0] = 'e';
else if (sig[0] == '(')
sig[0] = 'r';
- while (edbus_message_iter_get_and_next(iter, sig[0], &entry))
+ while (eldbus_message_iter_get_and_next(iter, sig[0], &entry))
{
Eina_Value *data = _message_iter_struct_to_eina_value(entry);
Eina_Value_Struct st;
@@ -121,8 +121,8 @@ _message_iter_array_to_eina_value(EDBus_Message_Iter *iter)
}
else if (sig[0] == 'a')
{
- EDBus_Message_Iter *entry;
- while (edbus_message_iter_get_and_next(iter, sig[0], &entry))
+ Eldbus_Message_Iter *entry;
+ while (eldbus_message_iter_get_and_next(iter, sig[0], &entry))
{
Eina_Value *data = _message_iter_array_to_eina_value(entry);
Eina_Value_Array inner_array;
@@ -139,7 +139,7 @@ _message_iter_array_to_eina_value(EDBus_Message_Iter *iter)
}
static void
-_message_iter_basic_array_to_eina_value(char type, Eina_Value *value, EDBus_Message_Iter *iter)
+_message_iter_basic_array_to_eina_value(char type, Eina_Value *value, Eldbus_Message_Iter *iter)
{
switch (type)
{
@@ -147,7 +147,7 @@ _message_iter_basic_array_to_eina_value(char type, Eina_Value *value, EDBus_Mess
case 'h'://fd
{
int32_t i;
- while (edbus_message_iter_get_and_next(iter, type, &i))
+ while (eldbus_message_iter_get_and_next(iter, type, &i))
eina_value_array_append(value, i);
break;
}
@@ -156,7 +156,7 @@ _message_iter_basic_array_to_eina_value(char type, Eina_Value *value, EDBus_Mess
case 'g'://signature
{
const char *txt;
- while (edbus_message_iter_get_and_next(iter, type, &txt))
+ while (eldbus_message_iter_get_and_next(iter, type, &txt))
eina_value_array_append(value, txt);
break;
}
@@ -164,49 +164,49 @@ _message_iter_basic_array_to_eina_value(char type, Eina_Value *value, EDBus_Mess
case 'y'://byte
{
unsigned char byte;
- while (edbus_message_iter_get_and_next(iter, type, &byte))
+ while (eldbus_message_iter_get_and_next(iter, type, &byte))
eina_value_array_append(value, byte);
break;
}
case 'n'://int16
{
int16_t i;
- while (edbus_message_iter_get_and_next(iter, type, &i))
+ while (eldbus_message_iter_get_and_next(iter, type, &i))
eina_value_array_append(value, i);
break;
}
case 'q'://uint16
{
uint16_t i;
- while (edbus_message_iter_get_and_next(iter, type, &i))
+ while (eldbus_message_iter_get_and_next(iter, type, &i))
eina_value_array_append(value, i);
break;
}
case 'u'://uint32
{
uint32_t i;
- while (edbus_message_iter_get_and_next(iter, type, &i))
+ while (eldbus_message_iter_get_and_next(iter, type, &i))
eina_value_array_append(value, i);
break;
}
case 'x'://int64
{
int64_t i;
- while (edbus_message_iter_get_and_next(iter, type, &i))
+ while (eldbus_message_iter_get_and_next(iter, type, &i))
eina_value_array_append(value, i);
break;
}
case 't'://uint64
{
uint64_t i;
- while (edbus_message_iter_get_and_next(iter, type, &i))
+ while (eldbus_message_iter_get_and_next(iter, type, &i))
eina_value_array_append(value, i);
break;
}
case 'd'://double
{
double d;
- while (edbus_message_iter_get_and_next(iter, type, &d))
+ while (eldbus_message_iter_get_and_next(iter, type, &d))
eina_value_array_append(value, d);
break;
}
@@ -215,16 +215,16 @@ _message_iter_basic_array_to_eina_value(char type, Eina_Value *value, EDBus_Mess
#define ARG "arg%u"
-typedef struct _EDBus_Struct_Desc
+typedef struct _Eldbus_Struct_Desc
{
Eina_Value_Struct_Desc base;
int refcount;
-} EDBus_Struct_Desc;
+} Eldbus_Struct_Desc;
static void *
_ops_malloc(const Eina_Value_Struct_Operations *ops EINA_UNUSED, const Eina_Value_Struct_Desc *desc)
{
- EDBus_Struct_Desc *edesc = (EDBus_Struct_Desc*)desc;
+ Eldbus_Struct_Desc *edesc = (Eldbus_Struct_Desc*)desc;
edesc->refcount++;
DBG("%p refcount=%d", edesc, edesc->refcount);
return malloc(desc->size);
@@ -233,7 +233,7 @@ _ops_malloc(const Eina_Value_Struct_Operations *ops EINA_UNUSED, const Eina_Valu
static void
_ops_free(const Eina_Value_Struct_Operations *ops EINA_UNUSED, const Eina_Value_Struct_Desc *desc, void *memory)
{
- EDBus_Struct_Desc *edesc = (EDBus_Struct_Desc*) desc;
+ Eldbus_Struct_Desc *edesc = (Eldbus_Struct_Desc*) desc;
edesc->refcount--;
free(memory);
DBG("%p refcount=%d", edesc, edesc->refcount);
@@ -258,7 +258,7 @@ static Eina_Value_Struct_Operations operations =
};
Eina_Value *
-_message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
+_message_iter_struct_to_eina_value(Eldbus_Message_Iter *iter)
{
int type;
Eina_Value *value_st = NULL;
@@ -266,11 +266,11 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
unsigned int offset = 0, z;
char name[7];//arg000 + \0
Eina_Value_Struct_Member *members;
- EDBus_Struct_Desc *st_desc;
+ Eldbus_Struct_Desc *st_desc;
Eina_Array *st_values = eina_array_new(1);
DBG("begin struct");
- st_desc = calloc(1, sizeof(EDBus_Struct_Desc));
+ st_desc = calloc(1, sizeof(Eldbus_Struct_Desc));
st_desc->base.version = EINA_VALUE_STRUCT_DESC_VERSION;
st_desc->base.ops = &operations;
@@ -298,7 +298,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
int32_t i;
v = eina_value_new(EINA_VALUE_TYPE_INT);
- edbus_message_iter_basic_get(iter, &i);
+ eldbus_message_iter_basic_get(iter, &i);
eina_value_set(v, i);
break;
}
@@ -308,7 +308,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
const char *txt;
v = eina_value_new(EINA_VALUE_TYPE_STRING);
- edbus_message_iter_basic_get(iter, &txt);
+ eldbus_message_iter_basic_get(iter, &txt);
eina_value_set(v, txt);
break;
}
@@ -317,7 +317,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
unsigned char byte;
v = eina_value_new(EINA_VALUE_TYPE_UCHAR);
- edbus_message_iter_basic_get(iter, &byte);
+ eldbus_message_iter_basic_get(iter, &byte);
eina_value_set(v, byte);
break;
}
@@ -325,7 +325,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
int16_t i;
v = eina_value_new(EINA_VALUE_TYPE_SHORT);
- edbus_message_iter_basic_get(iter, &i);
+ eldbus_message_iter_basic_get(iter, &i);
eina_value_set(v, i);
break;
}
@@ -333,7 +333,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
uint16_t i;
v = eina_value_new(EINA_VALUE_TYPE_USHORT);
- edbus_message_iter_basic_get(iter, &i);
+ eldbus_message_iter_basic_get(iter, &i);
eina_value_set(v, i);
break;
}
@@ -341,7 +341,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
uint32_t i;
v = eina_value_new(EINA_VALUE_TYPE_UINT);
- edbus_message_iter_basic_get(iter, &i);
+ eldbus_message_iter_basic_get(iter, &i);
eina_value_set(v, i);
break;
}
@@ -349,7 +349,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
int64_t i;
v = eina_value_new(EINA_VALUE_TYPE_INT64);
- edbus_message_iter_basic_get(iter, &i);
+ eldbus_message_iter_basic_get(iter, &i);
eina_value_set(v, i);
break;
}
@@ -357,7 +357,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
uint64_t i;
v = eina_value_new(EINA_VALUE_TYPE_UINT64);
- edbus_message_iter_basic_get(iter, &i);
+ eldbus_message_iter_basic_get(iter, &i);
eina_value_set(v, i);
break;
}
@@ -365,14 +365,14 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
{
double d;
v = eina_value_new(EINA_VALUE_TYPE_DOUBLE);
- edbus_message_iter_basic_get(iter, &d);
+ eldbus_message_iter_basic_get(iter, &d);
eina_value_set(v, d);
break;
}
case 'a'://array
{
- EDBus_Message_Iter *dbus_array;
- dbus_array = edbus_message_iter_sub_iter_get(iter);
+ Eldbus_Message_Iter *dbus_array;
+ dbus_array = eldbus_message_iter_sub_iter_get(iter);
v = _message_iter_array_to_eina_value(dbus_array);
break;
}
@@ -380,8 +380,8 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
case 'r'://struct
case 'v'://variant
{
- EDBus_Message_Iter *dbus_st;
- dbus_st = edbus_message_iter_sub_iter_get(iter);
+ Eldbus_Message_Iter *dbus_st;
+ dbus_st = eldbus_message_iter_sub_iter_get(iter);
v = _message_iter_struct_to_eina_value(dbus_st);
break;
}
@@ -390,7 +390,7 @@ _message_iter_struct_to_eina_value(EDBus_Message_Iter *iter)
v = NULL;
}
eina_array_push(st_values, v);
- edbus_message_iter_next(iter);
+ eldbus_message_iter_next(iter);
z++;
}
@@ -433,18 +433,18 @@ end:
}
EAPI Eina_Value *
-edbus_message_to_eina_value(const EDBus_Message *msg)
+eldbus_message_to_eina_value(const Eldbus_Message *msg)
{
- EDBus_Message_Iter *iter;
+ Eldbus_Message_Iter *iter;
EINA_SAFETY_ON_FALSE_RETURN_VAL(msg, NULL);
- iter = edbus_message_iter_get(msg);
+ iter = eldbus_message_iter_get(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
return _message_iter_struct_to_eina_value(iter);
}
EAPI Eina_Value *
-edbus_message_iter_struct_like_to_eina_value(const EDBus_Message_Iter *iter)
+eldbus_message_iter_struct_like_to_eina_value(const Eldbus_Message_Iter *iter)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(iter, NULL);
- return _message_iter_struct_to_eina_value((EDBus_Message_Iter *)iter);
+ return _message_iter_struct_to_eina_value((Eldbus_Message_Iter *)iter);
}
diff --git a/src/lib/eldbus/eldbus_object.c b/src/lib/eldbus/eldbus_object.c
new file mode 100644
index 0000000000..9b7517588d
--- /dev/null
+++ b/src/lib/eldbus/eldbus_object.c
@@ -0,0 +1,676 @@
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
+#include <dbus/dbus.h>
+
+/* TODO: mempool of Eldbus_Object, Eldbus_Object_Context_Event_Cb and
+ * Eldbus_Object_Context_Event
+ */
+
+#define ELDBUS_OBJECT_CHECK(obj) \
+ do \
+ { \
+ EINA_SAFETY_ON_NULL_RETURN(obj); \
+ if (!EINA_MAGIC_CHECK(obj, ELDBUS_OBJECT_MAGIC)) \
+ { \
+ EINA_MAGIC_FAIL(obj, ELDBUS_OBJECT_MAGIC); \
+ return; \
+ } \
+ EINA_SAFETY_ON_TRUE_RETURN(obj->refcount <= 0); \
+ } \
+ while (0)
+
+#define ELDBUS_OBJECT_CHECK_RETVAL(obj, retval) \
+ do \
+ { \
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, retval); \
+ if (!EINA_MAGIC_CHECK(obj, ELDBUS_OBJECT_MAGIC)) \
+ { \
+ EINA_MAGIC_FAIL(obj, ELDBUS_OBJECT_MAGIC); \
+ return retval; \
+ } \
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(obj->refcount <= 0, retval); \
+ } \
+ while (0)
+
+#define ELDBUS_OBJECT_CHECK_GOTO(obj, label) \
+ do \
+ { \
+ EINA_SAFETY_ON_NULL_GOTO(obj, label); \
+ if (!EINA_MAGIC_CHECK(obj, ELDBUS_OBJECT_MAGIC)) \
+ { \
+ EINA_MAGIC_FAIL(obj, ELDBUS_OBJECT_MAGIC); \
+ goto label; \
+ } \
+ EINA_SAFETY_ON_TRUE_GOTO(obj->refcount <= 0, label); \
+ } \
+ while (0)
+
+Eina_Bool
+eldbus_object_init(void)
+{
+ return EINA_TRUE;
+}
+
+void
+eldbus_object_shutdown(void)
+{
+}
+
+static void _eldbus_object_event_callback_call(Eldbus_Object *obj, Eldbus_Object_Event_Type type, const void *event_info);
+static void _eldbus_object_context_event_cb_del(Eldbus_Object_Context_Event *ce, Eldbus_Object_Context_Event_Cb *ctx);
+static void _on_connection_free(void *data, const void *dead_pointer);
+static void _on_signal_handler_free(void *data, const void *dead_pointer);
+
+static void
+_eldbus_object_call_del(Eldbus_Object *obj)
+{
+ Eldbus_Object_Context_Event *ce;
+
+ _eldbus_object_event_callback_call(obj, ELDBUS_OBJECT_EVENT_DEL, NULL);
+
+ /* clear all del callbacks so we don't call them twice at
+ * _eldbus_object_clear()
+ */
+ ce = obj->event_handlers + ELDBUS_OBJECT_EVENT_DEL;
+ while (ce->list)
+ {
+ Eldbus_Object_Context_Event_Cb *ctx;
+
+ ctx = EINA_INLIST_CONTAINER_GET(ce->list,
+ Eldbus_Object_Context_Event_Cb);
+ _eldbus_object_context_event_cb_del(ce, ctx);
+ }
+}
+
+static void
+_eldbus_object_clear(Eldbus_Object *obj)
+{
+ Eldbus_Signal_Handler *h;
+ Eldbus_Pending *p;
+ Eina_List *iter, *iter_next;
+ Eina_Inlist *in_l;
+ DBG("obj=%p, refcount=%d, name=%s, path=%s",
+ obj, obj->refcount, obj->name, obj->path);
+
+ obj->refcount = 1;
+ _eldbus_object_call_del(obj);
+ eldbus_connection_name_object_del(obj->conn, obj);
+
+ /* NOTE: obj->proxies is deleted from obj->cbs_free. */
+
+ EINA_LIST_FOREACH_SAFE(obj->signal_handlers, iter, iter_next, h)
+ {
+ DBG("obj=%p delete owned signal handler %p %s",
+ obj, h, eldbus_signal_handler_match_get(h));
+ eldbus_signal_handler_del(h);
+ }
+ EINA_INLIST_FOREACH_SAFE(obj->pendings, in_l, p)
+ {
+ DBG("obj=%p delete owned pending call=%p dest=%s path=%s %s.%s()",
+ obj, p,
+ eldbus_pending_destination_get(p),
+ eldbus_pending_path_get(p),
+ eldbus_pending_interface_get(p),
+ eldbus_pending_method_get(p));
+ eldbus_pending_cancel(p);
+ }
+
+ eldbus_cbs_free_dispatch(&(obj->cbs_free), obj);
+ obj->refcount = 0;
+}
+
+static void
+_eldbus_object_free(Eldbus_Object *obj)
+{
+ unsigned int i;
+ Eldbus_Signal_Handler *h;
+
+ if (obj->proxies)
+ {
+ Eina_Iterator *iterator = eina_hash_iterator_data_new(obj->proxies);
+ Eldbus_Proxy *proxy;
+ EINA_ITERATOR_FOREACH(iterator, proxy)
+ ERR("obj=%p alive proxy=%p %s", obj, proxy,
+ eldbus_proxy_interface_get(proxy));
+ eina_iterator_free(iterator);
+ eina_hash_free(obj->proxies);
+ }
+
+ EINA_LIST_FREE(obj->signal_handlers, h)
+ {
+ if (h->dangling)
+ eldbus_signal_handler_free_cb_del(h, _on_signal_handler_free, obj);
+ else
+ ERR("obj=%p alive handler=%p %s", obj, h,
+ eldbus_signal_handler_match_get(h));
+ }
+
+ if (obj->pendings)
+ CRITICAL("Object %p released with live pending calls!", obj);
+
+ for (i = 0; i < ELDBUS_OBJECT_EVENT_LAST; i++)
+ {
+ Eldbus_Object_Context_Event *ce = obj->event_handlers + i;
+ while (ce->list)
+ {
+ Eldbus_Object_Context_Event_Cb *ctx;
+
+ ctx = EINA_INLIST_CONTAINER_GET(ce->list,
+ Eldbus_Object_Context_Event_Cb);
+ _eldbus_object_context_event_cb_del(ce, ctx);
+ }
+ eina_list_free(ce->to_delete);
+ }
+
+ if (obj->interfaces_added)
+ eldbus_signal_handler_del(obj->interfaces_added);
+ if (obj->interfaces_removed)
+ eldbus_signal_handler_del(obj->interfaces_removed);
+ if (obj->properties_changed)
+ eldbus_signal_handler_del(obj->properties_changed);
+ eina_stringshare_del(obj->name);
+ eina_stringshare_del(obj->path);
+ EINA_MAGIC_SET(obj, EINA_MAGIC_NONE);
+
+ free(obj);
+}
+
+static void
+_on_connection_free(void *data, const void *dead_pointer EINA_UNUSED)
+{
+ Eldbus_Object *obj = data;
+ ELDBUS_OBJECT_CHECK(obj);
+ _eldbus_object_clear(obj);
+ _eldbus_object_free(obj);
+}
+
+EAPI Eldbus_Object *
+eldbus_object_get(Eldbus_Connection *conn, const char *bus, const char *path)
+{
+ Eldbus_Object *obj;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(bus, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
+
+ obj = eldbus_connection_name_object_get(conn, bus, path);
+ if (obj)
+ return eldbus_object_ref(obj);
+
+ obj = calloc(1, sizeof(Eldbus_Object));
+ EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
+
+ obj->conn = conn;
+ obj->refcount = 1;
+ obj->path = eina_stringshare_add(path);
+ obj->name = eina_stringshare_add(bus);
+ obj->proxies = eina_hash_string_small_new(NULL);
+ EINA_SAFETY_ON_NULL_GOTO(obj->proxies, cleanup);
+ EINA_MAGIC_SET(obj, ELDBUS_OBJECT_MAGIC);
+
+ eldbus_connection_name_object_set(conn, obj);
+ eldbus_connection_free_cb_add(obj->conn, _on_connection_free, obj);
+
+ obj->properties = eldbus_proxy_get(obj, ELDBUS_FDO_INTERFACE_PROPERTIES);
+
+ return obj;
+
+cleanup:
+ eina_stringshare_del(obj->path);
+ eina_stringshare_del(obj->name);
+ free(obj);
+
+ return NULL;
+}
+
+static void _on_signal_handler_free(void *data, const void *dead_pointer);
+
+static void
+_eldbus_object_unref(Eldbus_Object *obj)
+{
+ obj->refcount--;
+ if (obj->refcount > 0) return;
+
+ eldbus_connection_free_cb_del(obj->conn, _on_connection_free, obj);
+ _eldbus_object_clear(obj);
+ _eldbus_object_free(obj);
+}
+
+EAPI Eldbus_Object *
+eldbus_object_ref(Eldbus_Object *obj)
+{
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ DBG("obj=%p, pre-refcount=%d, name=%s, path=%s",
+ obj, obj->refcount, obj->name, obj->path);
+ obj->refcount++;
+ return obj;
+}
+
+EAPI void
+eldbus_object_unref(Eldbus_Object *obj)
+{
+ ELDBUS_OBJECT_CHECK(obj);
+ DBG("obj=%p, pre-refcount=%d, name=%s, path=%s",
+ obj, obj->refcount, obj->name, obj->path);
+ _eldbus_object_unref(obj);
+}
+
+EAPI void
+eldbus_object_free_cb_add(Eldbus_Object *obj, Eldbus_Free_Cb cb, const void *data)
+{
+ ELDBUS_OBJECT_CHECK(obj);
+ EINA_SAFETY_ON_NULL_RETURN(cb);
+ obj->cbs_free = eldbus_cbs_free_add(obj->cbs_free, cb, data);
+}
+
+EAPI void
+eldbus_object_free_cb_del(Eldbus_Object *obj, Eldbus_Free_Cb cb, const void *data)
+{
+ ELDBUS_OBJECT_CHECK(obj);
+ EINA_SAFETY_ON_NULL_RETURN(cb);
+ obj->cbs_free = eldbus_cbs_free_del(obj->cbs_free, cb, data);
+}
+
+static void
+_cb_interfaces_added(void *data, const Eldbus_Message *msg)
+{
+ Eldbus_Object *obj = data;
+ const char *obj_path;
+ Eldbus_Message_Iter *array_ifaces, *entry_iface;
+
+ if (!eldbus_message_arguments_get(msg, "oa{sa{sv}}", &obj_path, &array_ifaces))
+ return;
+
+ while (eldbus_message_iter_get_and_next(array_ifaces, 'e', &entry_iface))
+ {
+ const char *iface_name;
+ Eldbus_Object_Event_Interface_Added event;
+
+ eldbus_message_iter_basic_get(entry_iface, &iface_name);
+ event.proxy = eldbus_proxy_get(obj, iface_name);
+ EINA_SAFETY_ON_NULL_RETURN(event.proxy);
+ event.interface = iface_name;
+ _eldbus_object_event_callback_call(obj, ELDBUS_OBJECT_EVENT_IFACE_ADDED,
+ &event);
+ eldbus_proxy_unref(event.proxy);
+ }
+}
+
+static void
+_cb_interfaces_removed(void *data, const Eldbus_Message *msg)
+{
+ Eldbus_Object *obj = data;
+ const char *obj_path, *iface;
+ Eldbus_Message_Iter *array_ifaces;
+
+ if (!eldbus_message_arguments_get(msg, "oas", &obj_path, &array_ifaces))
+ return;
+
+ while (eldbus_message_iter_get_and_next(array_ifaces, 's', &iface))
+ {
+ Eldbus_Object_Event_Interface_Removed event;
+ event.interface = iface;
+ _eldbus_object_event_callback_call(obj, ELDBUS_OBJECT_EVENT_IFACE_REMOVED,
+ &event);
+ }
+}
+
+static void
+_property_changed_iter(void *data, const void *key, Eldbus_Message_Iter *var)
+{
+ Eldbus_Proxy *proxy = data;
+ const char *skey = key;
+ Eina_Value *st_value, stack_value;
+ Eldbus_Object_Event_Property_Changed event;
+
+ st_value = _message_iter_struct_to_eina_value(var);
+ eina_value_struct_value_get(st_value, "arg0", &stack_value);
+
+ event.interface = eldbus_proxy_interface_get(proxy);
+ event.proxy = proxy;
+ event.name = skey;
+ event.value = &stack_value;
+ _eldbus_object_event_callback_call(eldbus_proxy_object_get(proxy),
+ ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED,
+ &event);
+ eina_value_free(st_value);
+ eina_value_flush(&stack_value);
+}
+
+static void
+_cb_properties_changed(void *data, const Eldbus_Message *msg)
+{
+ Eldbus_Object *obj = data;
+ Eldbus_Proxy *proxy;
+ Eldbus_Message_Iter *array, *invalidate;
+ const char *iface;
+ const char *invalidate_prop;
+
+ if (!eldbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate))
+ {
+ ERR("Error getting data from properties changed signal.");
+ return;
+ }
+
+ proxy = eldbus_proxy_get(obj, iface);
+ EINA_SAFETY_ON_NULL_RETURN(proxy);
+
+ if (obj->event_handlers[ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED].list)
+ eldbus_message_iter_dict_iterate(array, "sv", _property_changed_iter,
+ proxy);
+
+ if (!obj->event_handlers[ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED].list)
+ goto end;
+
+ while (eldbus_message_iter_get_and_next(invalidate, 's', &invalidate_prop))
+ {
+ Eldbus_Object_Event_Property_Removed event;
+ event.interface = iface;
+ event.name = invalidate_prop;
+ event.proxy = proxy;
+ _eldbus_object_event_callback_call(obj,
+ ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED,
+ &event);
+ }
+end:
+ eldbus_proxy_unref(proxy);
+}
+
+EAPI void
+eldbus_object_event_callback_add(Eldbus_Object *obj, Eldbus_Object_Event_Type type, Eldbus_Object_Event_Cb cb, const void *cb_data)
+{
+ Eldbus_Object_Context_Event *ce;
+ Eldbus_Object_Context_Event_Cb *ctx;
+
+ ELDBUS_OBJECT_CHECK(obj);
+ EINA_SAFETY_ON_NULL_RETURN(cb);
+ EINA_SAFETY_ON_TRUE_RETURN(type >= ELDBUS_OBJECT_EVENT_LAST);
+
+ ce = obj->event_handlers + type;
+
+ ctx = calloc(1, sizeof(Eldbus_Object_Context_Event_Cb));
+ EINA_SAFETY_ON_NULL_RETURN(ctx);
+
+ ctx->cb = cb;
+ ctx->cb_data = cb_data;
+
+ ce->list = eina_inlist_append(ce->list, EINA_INLIST_GET(ctx));
+
+ switch (type)
+ {
+ case ELDBUS_OBJECT_EVENT_IFACE_ADDED:
+ {
+ if (obj->interfaces_added)
+ break;
+ obj->interfaces_added =
+ _eldbus_signal_handler_add(obj->conn, obj->name, NULL,
+ ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
+ "InterfacesAdded",
+ _cb_interfaces_added, obj);
+ EINA_SAFETY_ON_NULL_RETURN(obj->interfaces_added);
+ eldbus_signal_handler_match_extra_set(obj->interfaces_added, "arg0",
+ obj->path, NULL);
+ break;
+ }
+ case ELDBUS_OBJECT_EVENT_IFACE_REMOVED:
+ {
+ if (obj->interfaces_removed)
+ break;
+ obj->interfaces_removed =
+ _eldbus_signal_handler_add(obj->conn, obj->name, NULL,
+ ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
+ "InterfacesRemoved",
+ _cb_interfaces_removed, obj);
+ EINA_SAFETY_ON_NULL_RETURN(obj->interfaces_added);
+ eldbus_signal_handler_match_extra_set(obj->interfaces_removed,
+ "arg0", obj->path, NULL);
+ break;
+ }
+ case ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED:
+ case ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED:
+ {
+ if (obj->properties_changed)
+ break;
+ obj->properties_changed =
+ eldbus_object_signal_handler_add(obj,
+ ELDBUS_FDO_INTERFACE_PROPERTIES,
+ "PropertiesChanged",
+ _cb_properties_changed, obj);
+ EINA_SAFETY_ON_NULL_RETURN(obj->properties_changed);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+static void
+_eldbus_object_context_event_cb_del(Eldbus_Object_Context_Event *ce, Eldbus_Object_Context_Event_Cb *ctx)
+{
+ ce->list = eina_inlist_remove(ce->list, EINA_INLIST_GET(ctx));
+ free(ctx);
+}
+
+EAPI void
+eldbus_object_event_callback_del(Eldbus_Object *obj, Eldbus_Object_Event_Type type, Eldbus_Object_Event_Cb cb, const void *cb_data)
+{
+ Eldbus_Object_Context_Event *ce;
+ Eldbus_Object_Context_Event_Cb *iter, *found = NULL;
+
+ ELDBUS_OBJECT_CHECK(obj);
+ EINA_SAFETY_ON_NULL_RETURN(cb);
+ EINA_SAFETY_ON_TRUE_RETURN(type >= ELDBUS_OBJECT_EVENT_LAST);
+
+ ce = obj->event_handlers + type;
+
+ EINA_INLIST_FOREACH(ce->list, iter)
+ {
+ if (cb != iter->cb) continue;
+ if ((cb_data) && (cb_data != iter->cb_data)) continue;
+
+ found = iter;
+ break;
+ }
+
+ EINA_SAFETY_ON_NULL_RETURN(found);
+ EINA_SAFETY_ON_TRUE_RETURN(found->deleted);
+
+ if (ce->walking)
+ {
+ found->deleted = EINA_TRUE;
+ ce->to_delete = eina_list_append(ce->to_delete, found);
+ return;
+ }
+
+ _eldbus_object_context_event_cb_del(ce, found);
+
+ switch (type)
+ {
+ case ELDBUS_OBJECT_EVENT_IFACE_ADDED:
+ {
+ if (obj->event_handlers[ELDBUS_OBJECT_EVENT_IFACE_ADDED].list)
+ break;
+ eldbus_signal_handler_del(obj->interfaces_added);
+ obj->interfaces_added = NULL;
+ break;
+ }
+ case ELDBUS_OBJECT_EVENT_IFACE_REMOVED:
+ {
+ if (obj->event_handlers[ELDBUS_OBJECT_EVENT_IFACE_REMOVED].list)
+ break;
+ eldbus_signal_handler_del(obj->interfaces_removed);
+ obj->interfaces_removed = NULL;
+ break;
+ }
+ case ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED:
+ case ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED:
+ {
+ if (obj->event_handlers[ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED].list ||
+ obj->event_handlers[ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED].list)
+ break;
+ eldbus_signal_handler_del(obj->properties_changed);
+ obj->properties_changed = NULL;
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+static void
+_eldbus_object_event_callback_call(Eldbus_Object *obj, Eldbus_Object_Event_Type type, const void *event_info)
+{
+ Eldbus_Object_Context_Event *ce;
+ Eldbus_Object_Context_Event_Cb *iter;
+
+ ce = obj->event_handlers + type;
+
+ ce->walking++;
+ EINA_INLIST_FOREACH(ce->list, iter)
+ {
+ if (iter->deleted) continue;
+ iter->cb((void *)iter->cb_data, obj, (void *)event_info);
+ }
+ ce->walking--;
+ if (ce->walking > 0) return;
+
+ EINA_LIST_FREE(ce->to_delete, iter)
+ _eldbus_object_context_event_cb_del(ce, iter);
+}
+
+EAPI Eldbus_Connection *
+eldbus_object_connection_get(const Eldbus_Object *obj)
+{
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ return obj->conn;
+}
+
+EAPI const char *
+eldbus_object_bus_name_get(const Eldbus_Object *obj)
+{
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ return obj->name;
+}
+
+EAPI const char *
+eldbus_object_path_get(const Eldbus_Object *obj)
+{
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ return obj->path;
+}
+
+static void
+_on_pending_free(void *data, const void *dead_pointer)
+{
+ Eldbus_Object *obj = data;
+ Eldbus_Pending *pending = (Eldbus_Pending*) dead_pointer;
+ ELDBUS_OBJECT_CHECK(obj);
+ obj->pendings = eina_inlist_remove(obj->pendings, EINA_INLIST_GET(pending));
+}
+
+EAPI Eldbus_Pending *
+eldbus_object_send(Eldbus_Object *obj, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout)
+{
+ Eldbus_Pending *pending;
+
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
+
+ pending = _eldbus_connection_send(obj->conn, msg, cb, cb_data, timeout);
+ if (!cb) return NULL;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(pending, NULL);
+
+ eldbus_pending_free_cb_add(pending, _on_pending_free, obj);
+ obj->pendings = eina_inlist_append(obj->pendings, EINA_INLIST_GET(pending));
+
+ return pending;
+}
+
+static void
+_on_signal_handler_free(void *data, const void *dead_pointer)
+{
+ Eldbus_Object *obj = data;
+ ELDBUS_OBJECT_CHECK(obj);
+ obj->signal_handlers = eina_list_remove(obj->signal_handlers, dead_pointer);
+}
+
+EAPI Eldbus_Signal_Handler *
+eldbus_object_signal_handler_add(Eldbus_Object *obj, const char *interface, const char *member, Eldbus_Signal_Cb cb, const void *cb_data)
+{
+ Eldbus_Signal_Handler *handler;
+
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(cb, NULL);
+
+ handler = _eldbus_signal_handler_add(obj->conn, obj->name, obj->path,
+ interface, member, cb, cb_data);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(handler, NULL);
+
+ eldbus_signal_handler_free_cb_add(handler, _on_signal_handler_free, obj);
+ obj->signal_handlers = eina_list_append(obj->signal_handlers, handler);
+
+ return handler;
+}
+
+EAPI Eldbus_Message *
+eldbus_object_method_call_new(Eldbus_Object *obj, const char *interface, const char *member)
+{
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(member, NULL);
+
+ return eldbus_message_method_call_new(obj->name, obj->path, interface, member);
+}
+
+Eina_Bool
+eldbus_object_proxy_add(Eldbus_Object *obj, Eldbus_Proxy *proxy)
+{
+ return eina_hash_add(obj->proxies, eldbus_proxy_interface_get(proxy), proxy);
+}
+
+Eldbus_Proxy *
+eldbus_object_proxy_get(Eldbus_Object *obj, const char *interface)
+{
+ return eina_hash_find(obj->proxies, interface);
+}
+
+Eina_Bool
+eldbus_object_proxy_del(Eldbus_Object *obj, Eldbus_Proxy *proxy, const char *interface)
+{
+ return eina_hash_del(obj->proxies, interface, proxy);
+}
+
+EAPI Eldbus_Pending *
+eldbus_object_peer_ping(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data)
+{
+ Eldbus_Message *msg;
+ Eldbus_Pending *p;
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ msg = eldbus_object_method_call_new(obj, ELDBUS_FDO_INTEFACE_PEER, "Ping");
+ p = eldbus_object_send(obj, msg, cb, data, -1);
+ return p;
+}
+
+EAPI Eldbus_Pending *
+eldbus_object_peer_machine_id_get(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data)
+{
+ Eldbus_Message *msg;
+ Eldbus_Pending *p;
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ msg = eldbus_object_method_call_new(obj, ELDBUS_FDO_INTEFACE_PEER,
+ "GetMachineId");
+ p = eldbus_object_send(obj, msg, cb, data, -1);
+ return p;
+}
+
+EAPI Eldbus_Pending *
+eldbus_object_introspect(Eldbus_Object *obj, Eldbus_Message_Cb cb, const void *data)
+{
+ Eldbus_Message *msg;
+ Eldbus_Pending *p;
+ ELDBUS_OBJECT_CHECK_RETVAL(obj, NULL);
+ msg = eldbus_object_method_call_new(obj, ELDBUS_FDO_INTERFACE_INTROSPECTABLE,
+ "Introspect");
+ p = eldbus_object_send(obj, msg, cb, data, -1);
+ return p;
+}
diff --git a/src/lib/eldbus/eldbus_object.h b/src/lib/eldbus/eldbus_object.h
new file mode 100644
index 0000000000..514b40ec0b
--- /dev/null
+++ b/src/lib/eldbus/eldbus_object.h
@@ -0,0 +1,127 @@
+#ifndef ELDBUS_OBJECT_H
+#define ELDBUS_OBJECT_H 1
+
+/**
+ * @defgroup Eldbus_Object_Mapper Object Mapper
+ * @ingroup Eldbus
+ *
+ * @{
+ */
+
+/**
+ * @brief Get an object of the given bus and path.
+ *
+ * @param conn connection where object belongs
+ * @param bus name of bus or unique-id of who listens for calls of this object
+ * @param path object path of this object
+ */
+EAPI Eldbus_Object *eldbus_object_get(Eldbus_Connection *conn, const char *bus, const char *path) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Increase object reference.
+ */
+EAPI Eldbus_Object *eldbus_object_ref(Eldbus_Object *obj) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Decrease object reference.
+ * If reference == 0 object will be freed and all its children.
+ */
+EAPI void eldbus_object_unref(Eldbus_Object *obj) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Add a callback function to be called when object will be freed.
+ *
+ * @param obj object that you want to monitor
+ * @param cb callback that will be executed
+ * @param data passed to callback
+ */
+EAPI void eldbus_object_free_cb_add(Eldbus_Object *obj, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Remove callback registered in eldbus_object_free_cb_add().
+ */
+EAPI void eldbus_object_free_cb_del(Eldbus_Object *obj, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+typedef enum
+{
+ ELDBUS_OBJECT_EVENT_IFACE_ADDED = 0, /**< a parent path must have a ObjectManager interface */
+ ELDBUS_OBJECT_EVENT_IFACE_REMOVED, /**< a parent path must have a ObjectManager interface */
+ ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED,
+ ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED,
+ ELDBUS_OBJECT_EVENT_DEL,
+ ELDBUS_OBJECT_EVENT_LAST /**< sentinel, not a real event type */
+} Eldbus_Object_Event_Type;
+
+typedef struct _Eldbus_Object_Event_Interface_Added
+{
+ const char *interface;
+ Eldbus_Proxy *proxy;
+} Eldbus_Object_Event_Interface_Added;
+
+typedef struct _Eldbus_Object_Event_Interface_Removed
+{
+ const char *interface;
+} Eldbus_Object_Event_Interface_Removed;
+
+typedef struct _Eldbus_Object_Event_Property_Changed
+{
+ const char *interface;
+ Eldbus_Proxy *proxy;
+ const char *name;
+ const Eina_Value *value;
+} Eldbus_Object_Event_Property_Changed;
+
+typedef struct _Eldbus_Object_Event_Property_Removed
+{
+ const char *interface;
+ Eldbus_Proxy *proxy;
+ const char *name;
+} Eldbus_Object_Event_Property_Removed;
+
+typedef void (*Eldbus_Object_Event_Cb)(void *data, Eldbus_Object *obj, void *event_info);
+
+/**
+ * @brief Add a callback function to be called when an event of the specified
+ * type occurs.
+ */
+EAPI void eldbus_object_event_callback_add(Eldbus_Object *obj, Eldbus_Object_Event_Type type, Eldbus_Object_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
+
+/**
+ * @brief Remove callback registered in eldbus_object_event_callback_add().
+ */
+EAPI void eldbus_object_event_callback_del(Eldbus_Object *obj, Eldbus_Object_Event_Type type, Eldbus_Object_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
+
+EAPI Eldbus_Connection *eldbus_object_connection_get(const Eldbus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_object_bus_name_get(const Eldbus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_object_path_get(const Eldbus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Send a message.
+ *
+ * @param obj the msg will be sent in connection to this object
+ * @param msg message that will be sent
+ * @param cb if msg is a method call a callback should be passed
+ * to be executed when a response arrives
+ * @param cb_data data passed to callback
+ * @param timeout timeout in milliseconds, -1 to default internal value or
+ * ELDBUS_TIMEOUT_INFINITE for no timeout
+ */
+EAPI Eldbus_Pending *eldbus_object_send(Eldbus_Object *obj, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Add a signal handler.
+ *
+ * @param obj where the signal is emitted
+ * @param interface of the signal
+ * @param member name of the signal
+ * @param cb callback that will be called when this signal is received
+ * @param cb_data data that will be passed to callback
+ */
+EAPI Eldbus_Signal_Handler *eldbus_object_signal_handler_add(Eldbus_Object *obj, const char *interface, const char *member, Eldbus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 4);
+
+EAPI Eldbus_Message *eldbus_object_method_call_new(Eldbus_Object *obj, const char *interface, const char *member) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @}
+ */
+#endif
diff --git a/src/lib/edbus/edbus_pending.c b/src/lib/eldbus/eldbus_pending.c
index 75a981e5ce..7740901a0b 100644
--- a/src/lib/edbus/edbus_pending.c
+++ b/src/lib/eldbus/eldbus_pending.c
@@ -1,63 +1,63 @@
-#include "edbus_private.h"
-#include "edbus_private_types.h"
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
#include <dbus/dbus.h>
-/* TODO: mempool of EDBus_Pending */
-#define EDBUS_PENDING_CHECK(pending) \
+/* TODO: mempool of Eldbus_Pending */
+#define ELDBUS_PENDING_CHECK(pending) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN(pending); \
- if (!EINA_MAGIC_CHECK(pending, EDBUS_PENDING_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(pending, ELDBUS_PENDING_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(pending, EDBUS_PENDING_MAGIC); \
+ EINA_MAGIC_FAIL(pending, ELDBUS_PENDING_MAGIC); \
return; \
} \
} \
while (0)
-#define EDBUS_PENDING_CHECK_RETVAL(pending, retval) \
+#define ELDBUS_PENDING_CHECK_RETVAL(pending, retval) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(pending, retval); \
- if (!EINA_MAGIC_CHECK(pending, EDBUS_PENDING_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(pending, ELDBUS_PENDING_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(pending, EDBUS_PENDING_MAGIC); \
+ EINA_MAGIC_FAIL(pending, ELDBUS_PENDING_MAGIC); \
return retval; \
} \
} \
while (0)
-static void edbus_pending_dispatch(EDBus_Pending *pending, EDBus_Message *msg);
+static void eldbus_pending_dispatch(Eldbus_Pending *pending, Eldbus_Message *msg);
Eina_Bool
-edbus_pending_init(void)
+eldbus_pending_init(void)
{
return EINA_TRUE;
}
void
-edbus_pending_shutdown(void)
+eldbus_pending_shutdown(void)
{
}
static void
cb_pending(DBusPendingCall *dbus_pending, void *user_data)
{
- EDBus_Message *msg;
- EDBus_Pending *pending = user_data;
+ Eldbus_Message *msg;
+ Eldbus_Pending *pending = user_data;
if (!dbus_pending_call_get_completed(dbus_pending))
{
INF("timeout to pending %p", pending);
dbus_pending_call_cancel(dbus_pending);
- msg = edbus_message_error_new(pending->msg_sent,
+ msg = eldbus_message_error_new(pending->msg_sent,
"org.enlightenment.DBus.Timeout",
"This call was not completed.");
- edbus_pending_dispatch(pending, msg);
+ eldbus_pending_dispatch(pending, msg);
return;
}
- msg = edbus_message_new(EINA_FALSE);
+ msg = eldbus_message_new(EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN(msg);
msg->dbus_msg = dbus_pending_call_steal_reply(dbus_pending);
if (!msg->dbus_msg)
@@ -71,58 +71,58 @@ cb_pending(DBusPendingCall *dbus_pending, void *user_data)
}
dbus_message_iter_init(msg->dbus_msg, &msg->iterator->dbus_iterator);
- edbus_pending_dispatch(pending, msg);
+ eldbus_pending_dispatch(pending, msg);
return;
cleanup:
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
}
static void
_on_pending_free(void *data, const void *dead_pointer)
{
- EDBus_Connection *conn = data;
- edbus_connection_pending_del(conn, (void *)dead_pointer);
+ Eldbus_Connection *conn = data;
+ eldbus_connection_pending_del(conn, (void *)dead_pointer);
}
-EAPI EDBus_Pending *
-edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout)
+EAPI Eldbus_Pending *
+eldbus_connection_send(Eldbus_Connection *conn, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout)
{
- EDBus_Pending *pending;
+ Eldbus_Pending *pending;
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
- pending = _edbus_connection_send(conn, msg, cb, cb_data, timeout);
+ pending = _eldbus_connection_send(conn, msg, cb, cb_data, timeout);
if (!cb) return NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(pending, NULL);
- edbus_connection_pending_add(conn, pending);
- edbus_pending_free_cb_add(pending, _on_pending_free, conn);
+ eldbus_connection_pending_add(conn, pending);
+ eldbus_pending_free_cb_add(pending, _on_pending_free, conn);
return pending;
}
/*
* On success @param msg is unref'd or its ref is stolen by the returned
- * EDBus_Pending.
+ * Eldbus_Pending.
*/
-EDBus_Pending *
-_edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout)
+Eldbus_Pending *
+_eldbus_connection_send(Eldbus_Connection *conn, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout)
{
- EDBus_Pending *pending;
- EDBus_Message *error_msg;
+ Eldbus_Pending *pending;
+ Eldbus_Message *error_msg;
DBG("conn=%p, msg=%p, cb=%p, cb_data=%p, timeout=%f",
conn, msg, cb, cb_data, timeout);
if (!cb)
{
dbus_connection_send(conn->dbus_conn, msg->dbus_msg, NULL);
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
return NULL;
}
- pending = calloc(1, sizeof(EDBus_Pending));
+ pending = calloc(1, sizeof(Eldbus_Pending));
EINA_SAFETY_ON_NULL_RETURN_VAL(pending, NULL);
pending->cb = cb;
@@ -136,65 +136,65 @@ _edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message
/* Steal the reference */
pending->msg_sent = msg;
- EINA_MAGIC_SET(pending, EDBUS_PENDING_MAGIC);
+ EINA_MAGIC_SET(pending, ELDBUS_PENDING_MAGIC);
if (!dbus_connection_send_with_reply(conn->dbus_conn,
msg->dbus_msg,
&pending->dbus_pending, timeout))
{
- error_msg = edbus_message_error_new(msg, "org.enlightenment.DBus.NoConnection",
- "EDBus_Connection was closed.");
- edbus_pending_dispatch(pending, error_msg);
+ error_msg = eldbus_message_error_new(msg, "org.enlightenment.DBus.NoConnection",
+ "Eldbus_Connection was closed.");
+ eldbus_pending_dispatch(pending, error_msg);
return NULL;
}
if (dbus_pending_call_set_notify(pending->dbus_pending, cb_pending, pending, NULL))
return pending;
dbus_pending_call_cancel(pending->dbus_pending);
- error_msg = edbus_message_error_new(pending->msg_sent,
+ error_msg = eldbus_message_error_new(pending->msg_sent,
"org.enlightenment.DBus.Error",
"Error when try set callback to message.");
- edbus_pending_dispatch(pending, error_msg);
+ eldbus_pending_dispatch(pending, error_msg);
return NULL;
}
EAPI void
-edbus_pending_data_set(EDBus_Pending *pending, const char *key, const void *data)
+eldbus_pending_data_set(Eldbus_Pending *pending, const char *key, const void *data)
{
- EDBUS_PENDING_CHECK(pending);
+ ELDBUS_PENDING_CHECK(pending);
EINA_SAFETY_ON_NULL_RETURN(key);
EINA_SAFETY_ON_NULL_RETURN(data);
- edbus_data_set(&(pending->data), key, data);
+ eldbus_data_set(&(pending->data), key, data);
}
EAPI void *
-edbus_pending_data_get(const EDBus_Pending *pending, const char *key)
+eldbus_pending_data_get(const Eldbus_Pending *pending, const char *key)
{
- EDBUS_PENDING_CHECK_RETVAL(pending, NULL);
+ ELDBUS_PENDING_CHECK_RETVAL(pending, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_get(&(((EDBus_Pending *)pending)->data), key);
+ return eldbus_data_get(&(((Eldbus_Pending *)pending)->data), key);
}
EAPI void *
-edbus_pending_data_del(EDBus_Pending *pending, const char *key)
+eldbus_pending_data_del(Eldbus_Pending *pending, const char *key)
{
- EDBUS_PENDING_CHECK_RETVAL(pending, NULL);
+ ELDBUS_PENDING_CHECK_RETVAL(pending, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_del(&(((EDBus_Pending *)pending)->data), key);
+ return eldbus_data_del(&(((Eldbus_Pending *)pending)->data), key);
}
static void
-edbus_pending_dispatch(EDBus_Pending *pending, EDBus_Message *msg)
+eldbus_pending_dispatch(Eldbus_Pending *pending, Eldbus_Message *msg)
{
DBG("pending=%p msg=%p", pending, msg);
if (pending->cb)
pending->cb((void *)pending->cb_data, msg, pending);
- edbus_cbs_free_dispatch(&(pending->cbs_free), pending);
- edbus_data_del_all(&(pending->data));
+ eldbus_cbs_free_dispatch(&(pending->cbs_free), pending);
+ eldbus_data_del_all(&(pending->data));
- if (msg) edbus_message_unref(msg);
- edbus_message_unref(pending->msg_sent);
+ if (msg) eldbus_message_unref(msg);
+ eldbus_message_unref(pending->msg_sent);
dbus_pending_call_unref(pending->dbus_pending);
pending->cb = NULL;
@@ -208,61 +208,61 @@ edbus_pending_dispatch(EDBus_Pending *pending, EDBus_Message *msg)
}
EAPI void
-edbus_pending_cancel(EDBus_Pending *pending)
+eldbus_pending_cancel(Eldbus_Pending *pending)
{
- EDBus_Message *error_message;
- EDBUS_PENDING_CHECK(pending);
+ Eldbus_Message *error_message;
+ ELDBUS_PENDING_CHECK(pending);
EINA_SAFETY_ON_NULL_RETURN(pending->dbus_pending);
DBG("pending=%p", pending);
dbus_pending_call_cancel(pending->dbus_pending);
- error_message = edbus_message_error_new(pending->msg_sent,
- EDBUS_ERROR_PENDING_CANCELED,
+ error_message = eldbus_message_error_new(pending->msg_sent,
+ ELDBUS_ERROR_PENDING_CANCELED,
"Canceled by user.");
- edbus_pending_dispatch(pending, error_message);
+ eldbus_pending_dispatch(pending, error_message);
}
EAPI void
-edbus_pending_free_cb_add(EDBus_Pending *pending, EDBus_Free_Cb cb, const void *data)
+eldbus_pending_free_cb_add(Eldbus_Pending *pending, Eldbus_Free_Cb cb, const void *data)
{
- EDBUS_PENDING_CHECK(pending);
+ ELDBUS_PENDING_CHECK(pending);
EINA_SAFETY_ON_NULL_RETURN(cb);
- pending->cbs_free = edbus_cbs_free_add(pending->cbs_free, cb, data);
+ pending->cbs_free = eldbus_cbs_free_add(pending->cbs_free, cb, data);
}
EAPI void
-edbus_pending_free_cb_del(EDBus_Pending *pending, EDBus_Free_Cb cb, const void *data)
+eldbus_pending_free_cb_del(Eldbus_Pending *pending, Eldbus_Free_Cb cb, const void *data)
{
- EDBUS_PENDING_CHECK(pending);
+ ELDBUS_PENDING_CHECK(pending);
EINA_SAFETY_ON_NULL_RETURN(cb);
- pending->cbs_free = edbus_cbs_free_del(pending->cbs_free, cb, data);
+ pending->cbs_free = eldbus_cbs_free_del(pending->cbs_free, cb, data);
}
EAPI const char *
-edbus_pending_destination_get(const EDBus_Pending *pending)
+eldbus_pending_destination_get(const Eldbus_Pending *pending)
{
- EDBUS_PENDING_CHECK_RETVAL(pending, NULL);
+ ELDBUS_PENDING_CHECK_RETVAL(pending, NULL);
return pending->dest;
}
EAPI const char *
-edbus_pending_path_get(const EDBus_Pending *pending)
+eldbus_pending_path_get(const Eldbus_Pending *pending)
{
- EDBUS_PENDING_CHECK_RETVAL(pending, NULL);
+ ELDBUS_PENDING_CHECK_RETVAL(pending, NULL);
return pending->path;
}
EAPI const char *
-edbus_pending_interface_get(const EDBus_Pending *pending)
+eldbus_pending_interface_get(const Eldbus_Pending *pending)
{
- EDBUS_PENDING_CHECK_RETVAL(pending, NULL);
+ ELDBUS_PENDING_CHECK_RETVAL(pending, NULL);
return pending->interface;
}
EAPI const char *
-edbus_pending_method_get(const EDBus_Pending *pending)
+eldbus_pending_method_get(const Eldbus_Pending *pending)
{
- EDBUS_PENDING_CHECK_RETVAL(pending, NULL);
+ ELDBUS_PENDING_CHECK_RETVAL(pending, NULL);
return pending->method;
}
diff --git a/src/lib/eldbus/eldbus_pending.h b/src/lib/eldbus/eldbus_pending.h
new file mode 100644
index 0000000000..98c0085657
--- /dev/null
+++ b/src/lib/eldbus/eldbus_pending.h
@@ -0,0 +1,34 @@
+#ifndef ELDBUS_PENDING_H
+#define ELDBUS_PENDING_H 1
+
+/**
+ * @defgroup Eldbus_Pending Pending
+ * @ingroup Eldbus
+ *
+ * @{
+ */
+
+EAPI void eldbus_pending_data_set(Eldbus_Pending *pending, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
+EAPI void *eldbus_pending_data_get(const Eldbus_Pending *pending, const char *key) EINA_ARG_NONNULL(1, 2);
+EAPI void *eldbus_pending_data_del(Eldbus_Pending *pending, const char *key) EINA_ARG_NONNULL(1, 2);
+EAPI void eldbus_pending_cancel(Eldbus_Pending *pending) EINA_ARG_NONNULL(1);
+
+EAPI const char *eldbus_pending_destination_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_pending_path_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_pending_interface_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_pending_method_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Add a callback function to be called when pending will be freed.
+ */
+EAPI void eldbus_pending_free_cb_add(Eldbus_Pending *pending, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Remove callback registered in eldbus_pending_free_cb_add().
+ */
+EAPI void eldbus_pending_free_cb_del(Eldbus_Pending *pending, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @}
+ */
+#endif
diff --git a/src/lib/eldbus/eldbus_private.h b/src/lib/eldbus/eldbus_private.h
new file mode 100644
index 0000000000..c17e44335b
--- /dev/null
+++ b/src/lib/eldbus/eldbus_private.h
@@ -0,0 +1,87 @@
+#ifndef ELDBUS_PRIVATE_H
+#define ELDBUS_PRIVATE_H
+
+#include <dbus/dbus.h>
+#include <Eina.h>
+#include "eina_safety_checks.h"
+#include <Ecore.h>
+#include "Eldbus.h"
+#include "eldbus_private_types.h"
+
+extern int _eldbus_log_dom;
+#define DBG(...) EINA_LOG_DOM_DBG(_eldbus_log_dom, __VA_ARGS__)
+#define INF(...) EINA_LOG_DOM_INFO(_eldbus_log_dom, __VA_ARGS__)
+#define WRN(...) EINA_LOG_DOM_WARN(_eldbus_log_dom, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_eldbus_log_dom, __VA_ARGS__)
+#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eldbus_log_dom, __VA_ARGS__)
+
+#define ELDBUS_CONNECTION_MAGIC (0xdb050001)
+#define ELDBUS_MESSAGE_MAGIC (0xdb050002)
+#define ELDBUS_SIGNAL_HANDLER_MAGIC (0xdb050003)
+#define ELDBUS_PENDING_MAGIC (0xdb050004)
+#define ELDBUS_OBJECT_MAGIC (0xdb050005)
+#define ELDBUS_PROXY_MAGIC (0xdb050006)
+#define ELDBUS_MESSAGE_ITERATOR_MAGIC (0xdb050007)
+#define ELDBUS_SERVICE_INTERFACE_MAGIC (0xdb050008)
+
+void eldbus_cbs_free_dispatch(Eina_Inlist **p_lst, const void *dead_pointer);
+Eina_Inlist *eldbus_cbs_free_add(Eina_Inlist *lst, Eldbus_Free_Cb cb, const void *data);
+Eina_Inlist *eldbus_cbs_free_del(Eina_Inlist *lst, Eldbus_Free_Cb cb, const void *data);
+
+void eldbus_data_set(Eina_Inlist **p_lst, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
+void *eldbus_data_get(Eina_Inlist **p_lst, const char *key) EINA_ARG_NONNULL(1, 2);
+void *eldbus_data_del(Eina_Inlist **p_lst, const char *key) EINA_ARG_NONNULL(1, 2);
+void eldbus_data_del_all(Eina_Inlist **p_list) EINA_ARG_NONNULL(1);
+
+Eina_Bool eldbus_message_init(void);
+void eldbus_message_shutdown(void);
+Eldbus_Message *eldbus_message_new(Eina_Bool writable);
+
+Eina_Bool eldbus_signal_handler_init(void);
+void eldbus_signal_handler_shutdown(void);
+
+Eina_Bool eldbus_pending_init(void);
+void eldbus_pending_shutdown(void);
+
+Eina_Bool eldbus_object_init(void);
+void eldbus_object_shutdown(void);
+
+Eina_Bool eldbus_proxy_init(void);
+void eldbus_proxy_shutdown(void);
+
+Eina_Bool eldbus_service_init(void);
+void eldbus_service_shutdown(void);
+
+void eldbus_connection_event_callback_call(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, const void *event_info) EINA_ARG_NONNULL(1);
+
+Eina_Bool eldbus_object_proxy_del(Eldbus_Object *obj, Eldbus_Proxy *proxy, const char *interface) EINA_ARG_NONNULL(1, 2);
+
+void eldbus_connection_signal_handler_add(Eldbus_Connection *conn, Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1, 2);
+void eldbus_connection_pending_add(Eldbus_Connection *conn, Eldbus_Pending *pending) EINA_ARG_NONNULL(1, 2);
+void eldbus_connection_signal_handler_del(Eldbus_Connection *conn, Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1, 2);
+void eldbus_connection_signal_handler_del(Eldbus_Connection *conn, Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1, 2);
+void eldbus_connection_pending_del(Eldbus_Connection *conn, Eldbus_Pending *pending) EINA_ARG_NONNULL(1, 2);
+
+Eldbus_Object *eldbus_connection_name_object_get(Eldbus_Connection *conn, const char *name, const char *path);
+void eldbus_connection_name_object_set(Eldbus_Connection *conn, Eldbus_Object *obj);
+
+Eina_Bool eldbus_object_proxy_add(Eldbus_Object *obj, Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1, 2);
+Eldbus_Proxy *eldbus_object_proxy_get(Eldbus_Object *obj, const char *interface);
+
+void eldbus_connection_name_object_del(Eldbus_Connection *conn, const Eldbus_Object *obj);
+Eldbus_Connection_Name *eldbus_connection_name_get(Eldbus_Connection *conn, const char *name);
+void eldbus_connection_name_owner_monitor(Eldbus_Connection *conn, Eldbus_Connection_Name *cn, Eina_Bool enable);
+
+Eldbus_Pending *_eldbus_connection_send(Eldbus_Connection *conn, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout);
+
+Eldbus_Message_Iter *eldbus_message_iter_sub_iter_get(Eldbus_Message_Iter *iter);
+Eina_Value *_message_iter_struct_to_eina_value(Eldbus_Message_Iter *iter);
+Eina_Bool _message_iter_from_eina_value_struct(const char *signature, Eldbus_Message_Iter *iter, const Eina_Value *value);
+
+void eldbus_connection_name_ref(Eldbus_Connection_Name *cn);
+void eldbus_connection_name_unref(Eldbus_Connection *conn, Eldbus_Connection_Name *cn);
+Eldbus_Signal_Handler *_eldbus_signal_handler_add(Eldbus_Connection *conn, const char *sender, const char *path, const char *interface, const char *member, Eldbus_Signal_Cb cb, const void *cb_data);
+
+Eldbus_Message *eldbus_message_signal_new(const char *path, const char *interface, const char *name) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT;
+
+#endif
diff --git a/src/lib/edbus/edbus_private_types.h b/src/lib/eldbus/eldbus_private_types.h
index 760f1306ea..bc4765d769 100644
--- a/src/lib/edbus/edbus_private_types.h
+++ b/src/lib/eldbus/eldbus_private_types.h
@@ -1,7 +1,7 @@
-#ifndef EDBUS_PRIVATE_TYPES_H
-#define EDBUS_PRIVATE_TYPES_H 1
+#ifndef ELDBUS_PRIVATE_TYPES_H
+#define ELDBUS_PRIVATE_TYPES_H 1
-typedef struct _EDBus_Connection_Name
+typedef struct _Eldbus_Connection_Name
{
const char *name;
const char *unique_id;
@@ -9,45 +9,45 @@ typedef struct _EDBus_Connection_Name
int refcount;
struct
{
- Eina_Inlist *list; //EDBus_Connection_Context_NOC_Cb
+ Eina_Inlist *list; //Eldbus_Connection_Context_NOC_Cb
int walking;
Eina_List *to_delete;
} event_handlers;
- EDBus_Signal_Handler *name_owner_changed;
- EDBus_Pending *name_owner_get;
-} EDBus_Connection_Name;
+ Eldbus_Signal_Handler *name_owner_changed;
+ Eldbus_Pending *name_owner_get;
+} Eldbus_Connection_Name;
-typedef struct _EDBus_Object_Context_Event_Cb
+typedef struct _Eldbus_Object_Context_Event_Cb
{
EINA_INLIST;
- EDBus_Object_Event_Cb cb;
+ Eldbus_Object_Event_Cb cb;
const void *cb_data;
Eina_Bool deleted : 1;
-} EDBus_Object_Context_Event_Cb;
+} Eldbus_Object_Context_Event_Cb;
-typedef struct _EDBus_Object_Context_Event
+typedef struct _Eldbus_Object_Context_Event
{
Eina_Inlist *list;
int walking;
Eina_List *to_delete;
-} EDBus_Object_Context_Event;
+} Eldbus_Object_Context_Event;
-typedef struct _EDBus_Connection_Context_Event
+typedef struct _Eldbus_Connection_Context_Event
{
Eina_Inlist *list;
int walking;
Eina_List *to_delete;
-} EDBus_Connection_Context_Event;
+} Eldbus_Connection_Context_Event;
-struct _EDBus_Connection
+struct _Eldbus_Connection
{
EINA_MAGIC;
EINA_INLIST;
int refcount;
- EDBus_Connection_Type type;
+ Eldbus_Connection_Type type;
DBusConnection *dbus_conn;
- Eina_Hash *names; //EDBus_Connection_Name
+ Eina_Hash *names; //Eldbus_Connection_Name
Eina_Inlist *data;
Eina_Inlist *cbs_free;
Eina_Inlist *signal_handlers;
@@ -55,31 +55,31 @@ struct _EDBus_Connection
Eina_Inlist *fd_handlers;
Eina_Inlist *timeouts;
Ecore_Idler *idler;
- EDBus_Connection_Context_Event event_handlers[EDBUS_CONNECTION_EVENT_LAST];
+ Eldbus_Connection_Context_Event event_handlers[ELDBUS_CONNECTION_EVENT_LAST];
Eina_Inlist *root_objs;//service_object
- EDBus_Proxy *fdo_proxy;
+ Eldbus_Proxy *fdo_proxy;
};
-struct _EDBus_Object
+struct _Eldbus_Object
{
EINA_MAGIC;
EINA_INLIST;
int refcount;
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
const char *name;
const char *path;
Eina_Hash *proxies;
Eina_Inlist *pendings;
Eina_List *signal_handlers;
Eina_Inlist *cbs_free;
- EDBus_Object_Context_Event event_handlers[EDBUS_OBJECT_EVENT_LAST];
- EDBus_Signal_Handler *interfaces_added;
- EDBus_Signal_Handler *interfaces_removed;
- EDBus_Signal_Handler *properties_changed;
- EDBus_Proxy *properties;
+ Eldbus_Object_Context_Event event_handlers[ELDBUS_OBJECT_EVENT_LAST];
+ Eldbus_Signal_Handler *interfaces_added;
+ Eldbus_Signal_Handler *interfaces_removed;
+ Eldbus_Signal_Handler *properties_changed;
+ Eldbus_Proxy *properties;
};
-struct _EDBus_Signal_Handler
+struct _Eldbus_Signal_Handler
{
EINA_MAGIC;
EINA_INLIST;
@@ -91,32 +91,32 @@ struct _EDBus_Signal_Handler
Eina_Strbuf *match;
Eina_Inlist *args;
Eina_Inlist_Sorted_State *state_args;
- EDBus_Connection *conn;
- EDBus_Signal_Cb cb;
- EDBus_Connection_Name *bus;
+ Eldbus_Connection *conn;
+ Eldbus_Signal_Cb cb;
+ Eldbus_Connection_Name *bus;
const void *cb_data;
Eina_Inlist *cbs_free;
Eina_Bool dangling;
};
-struct _EDBus_Pending
+struct _Eldbus_Pending
{
EINA_MAGIC;
EINA_INLIST;
- EDBus_Message_Cb cb;
+ Eldbus_Message_Cb cb;
const void *cb_data;
DBusPendingCall *dbus_pending;
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
const char *dest;
const char *path;
const char *interface;
const char *method;
Eina_Inlist *data;
Eina_Inlist *cbs_free;
- EDBus_Message *msg_sent;
+ Eldbus_Message *msg_sent;
};
-struct _EDBus_Message_Iter
+struct _Eldbus_Message_Iter
{
EINA_MAGIC;
EINA_INLIST;
@@ -125,45 +125,45 @@ struct _EDBus_Message_Iter
Eina_Bool writable;
};
-struct _EDBus_Message
+struct _Eldbus_Message
{
EINA_MAGIC;
int refcount;
DBusMessage *dbus_msg;
- EDBus_Message_Iter *iterator;
+ Eldbus_Message_Iter *iterator;
};
-typedef struct _EDBus_Service_Object EDBus_Service_Object;
-struct _EDBus_Service_Object
+typedef struct _Eldbus_Service_Object Eldbus_Service_Object;
+struct _Eldbus_Service_Object
{
EINA_INLIST;
- EDBus_Connection *conn;
+ Eldbus_Connection *conn;
const char *path;
Eina_Hash *interfaces;
Eina_Strbuf *introspection_data;
Eina_Bool introspection_dirty;
Eina_Inlist *data;
- EDBus_Service_Object *parent;
+ Eldbus_Service_Object *parent;
Eina_Inlist *children;
//ObjectManager data
- EDBus_Service_Interface *objmanager;
+ Eldbus_Service_Interface *objmanager;
Eina_List *iface_added;
Eina_List *iface_removed;
Ecore_Idler *idler_iface_changed;
};
-struct _EDBus_Service_Interface
+struct _Eldbus_Service_Interface
{
EINA_MAGIC;
const char *name;
Eina_Hash *methods;
- const EDBus_Signal *signals;
+ const Eldbus_Signal *signals;
Eina_Array *sign_of_signals;
- EDBus_Service_Object *obj;
+ Eldbus_Service_Object *obj;
Eina_Hash *properties;
- EDBus_Property_Set_Cb set_func;
- EDBus_Property_Get_Cb get_func;
+ Eldbus_Property_Set_Cb set_func;
+ Eldbus_Property_Get_Cb get_func;
Ecore_Idler *idler_propschanged;
Eina_Array *props_changed;
Eina_Array *prop_invalidated;
diff --git a/src/lib/edbus/edbus_proxy.c b/src/lib/eldbus/eldbus_proxy.c
index 5b74a1184c..90f559054d 100644
--- a/src/lib/edbus/edbus_proxy.c
+++ b/src/lib/eldbus/eldbus_proxy.c
@@ -2,77 +2,77 @@
# include "config.h"
#endif
-#include "edbus_private.h"
-#include "edbus_private_types.h"
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
-/* TODO: mempool of EDBus_Proxy, Edbus_Proxy_Context_Event_Cb and
- * EDBus_Proxy_Context_Event
+/* TODO: mempool of Eldbus_Proxy, Eldbus_Proxy_Context_Event_Cb and
+ * Eldbus_Proxy_Context_Event
*/
-typedef struct _EDBus_Proxy_Context_Event_Cb
+typedef struct _Eldbus_Proxy_Context_Event_Cb
{
EINA_INLIST;
- EDBus_Proxy_Event_Cb cb;
+ Eldbus_Proxy_Event_Cb cb;
const void *cb_data;
Eina_Bool deleted : 1;
-} EDBus_Proxy_Context_Event_Cb;
+} Eldbus_Proxy_Context_Event_Cb;
-typedef struct _EDBus_Proxy_Context_Event
+typedef struct _Eldbus_Proxy_Context_Event
{
Eina_Inlist *list;
int walking;
Eina_List *to_delete;
-} EDBus_Proxy_Context_Event;
+} Eldbus_Proxy_Context_Event;
-struct _EDBus_Proxy
+struct _Eldbus_Proxy
{
EINA_MAGIC;
int refcount;
- EDBus_Object *obj;
+ Eldbus_Object *obj;
const char *interface;
Eina_Inlist *pendings;
Eina_List *handlers;
Eina_Inlist *cbs_free;
Eina_Inlist *data;
- EDBus_Proxy_Context_Event event_handlers[EDBUS_PROXY_EVENT_LAST];
+ Eldbus_Proxy_Context_Event event_handlers[ELDBUS_PROXY_EVENT_LAST];
Eina_Hash *props;
- EDBus_Signal_Handler *properties_changed;
+ Eldbus_Signal_Handler *properties_changed;
Eina_Bool monitor_enabled:1;
};
-#define EDBUS_PROXY_CHECK(proxy) \
+#define ELDBUS_PROXY_CHECK(proxy) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN(proxy); \
- if (!EINA_MAGIC_CHECK(proxy, EDBUS_PROXY_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(proxy, ELDBUS_PROXY_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(proxy, EDBUS_PROXY_MAGIC); \
+ EINA_MAGIC_FAIL(proxy, ELDBUS_PROXY_MAGIC); \
return; \
} \
EINA_SAFETY_ON_TRUE_RETURN(proxy->refcount <= 0); \
} \
while (0)
-#define EDBUS_PROXY_CHECK_RETVAL(proxy, retval) \
+#define ELDBUS_PROXY_CHECK_RETVAL(proxy, retval) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, retval); \
- if (!EINA_MAGIC_CHECK(proxy, EDBUS_PROXY_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(proxy, ELDBUS_PROXY_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(proxy, EDBUS_PROXY_MAGIC); \
+ EINA_MAGIC_FAIL(proxy, ELDBUS_PROXY_MAGIC); \
return retval; \
} \
EINA_SAFETY_ON_TRUE_RETURN_VAL(proxy->refcount <= 0, retval); \
} \
while (0)
-#define EDBUS_PROXY_CHECK_GOTO(proxy, label) \
+#define ELDBUS_PROXY_CHECK_GOTO(proxy, label) \
do \
{ \
EINA_SAFETY_ON_NULL_GOTO(proxy, label); \
- if (!EINA_MAGIC_CHECK(proxy, EDBUS_PROXY_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(proxy, ELDBUS_PROXY_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(proxy, EDBUS_PROXY_MAGIC); \
+ EINA_MAGIC_FAIL(proxy, ELDBUS_PROXY_MAGIC); \
goto label; \
} \
EINA_SAFETY_ON_TRUE_GOTO(proxy->refcount <= 0, label); \
@@ -80,105 +80,105 @@ struct _EDBus_Proxy
while (0)
Eina_Bool
-edbus_proxy_init(void)
+eldbus_proxy_init(void)
{
return EINA_TRUE;
}
void
-edbus_proxy_shutdown(void)
+eldbus_proxy_shutdown(void)
{
}
-static void _edbus_proxy_event_callback_call(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, const void *event_info);
-static void _edbus_proxy_context_event_cb_del(EDBus_Proxy_Context_Event *ce, EDBus_Proxy_Context_Event_Cb *ctx);
+static void _eldbus_proxy_event_callback_call(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, const void *event_info);
+static void _eldbus_proxy_context_event_cb_del(Eldbus_Proxy_Context_Event *ce, Eldbus_Proxy_Context_Event_Cb *ctx);
static void _on_signal_handler_free(void *data, const void *dead_pointer);
static void
-_edbus_proxy_call_del(EDBus_Proxy *proxy)
+_eldbus_proxy_call_del(Eldbus_Proxy *proxy)
{
- EDBus_Proxy_Context_Event *ce;
+ Eldbus_Proxy_Context_Event *ce;
- _edbus_proxy_event_callback_call(proxy, EDBUS_PROXY_EVENT_DEL, NULL);
+ _eldbus_proxy_event_callback_call(proxy, ELDBUS_PROXY_EVENT_DEL, NULL);
/* clear all del callbacks so we don't call them twice at
- * _edbus_proxy_clear()
+ * _eldbus_proxy_clear()
*/
- ce = proxy->event_handlers + EDBUS_PROXY_EVENT_DEL;
+ ce = proxy->event_handlers + ELDBUS_PROXY_EVENT_DEL;
while (ce->list)
{
- EDBus_Proxy_Context_Event_Cb *ctx;
+ Eldbus_Proxy_Context_Event_Cb *ctx;
ctx = EINA_INLIST_CONTAINER_GET(ce->list,
- EDBus_Proxy_Context_Event_Cb);
- _edbus_proxy_context_event_cb_del(ce, ctx);
+ Eldbus_Proxy_Context_Event_Cb);
+ _eldbus_proxy_context_event_cb_del(ce, ctx);
}
}
static void
-_edbus_proxy_clear(EDBus_Proxy *proxy)
+_eldbus_proxy_clear(Eldbus_Proxy *proxy)
{
- EDBus_Signal_Handler *h;
- EDBus_Pending *p;
+ Eldbus_Signal_Handler *h;
+ Eldbus_Pending *p;
Eina_List *iter, *iter_next;
Eina_Inlist *in_l;
DBG("proxy=%p, refcount=%d, interface=%s, obj=%p",
proxy, proxy->refcount, proxy->interface, proxy->obj);
proxy->refcount = 1;
- edbus_object_proxy_del(proxy->obj, proxy, proxy->interface);
- _edbus_proxy_call_del(proxy);
+ eldbus_object_proxy_del(proxy->obj, proxy, proxy->interface);
+ _eldbus_proxy_call_del(proxy);
EINA_LIST_FOREACH_SAFE(proxy->handlers, iter, iter_next, h)
{
DBG("proxy=%p delete owned signal handler %p %s",
- proxy, h, edbus_signal_handler_match_get(h));
- edbus_signal_handler_del(h);
+ proxy, h, eldbus_signal_handler_match_get(h));
+ eldbus_signal_handler_del(h);
}
EINA_INLIST_FOREACH_SAFE(proxy->pendings, in_l, p)
{
DBG("proxy=%p delete owned pending call=%p dest=%s path=%s %s.%s()",
proxy, p,
- edbus_pending_destination_get(p),
- edbus_pending_path_get(p),
- edbus_pending_interface_get(p),
- edbus_pending_method_get(p));
- edbus_pending_cancel(p);
+ eldbus_pending_destination_get(p),
+ eldbus_pending_path_get(p),
+ eldbus_pending_interface_get(p),
+ eldbus_pending_method_get(p));
+ eldbus_pending_cancel(p);
}
- edbus_cbs_free_dispatch(&(proxy->cbs_free), proxy);
+ eldbus_cbs_free_dispatch(&(proxy->cbs_free), proxy);
if (proxy->props)
eina_hash_free(proxy->props);
proxy->refcount = 0;
}
static void
-_edbus_proxy_free(EDBus_Proxy *proxy)
+_eldbus_proxy_free(Eldbus_Proxy *proxy)
{
unsigned int i;
- EDBus_Signal_Handler *h;
+ Eldbus_Signal_Handler *h;
EINA_LIST_FREE(proxy->handlers, h)
{
if (h->dangling)
- edbus_signal_handler_free_cb_del(h, _on_signal_handler_free, proxy);
+ eldbus_signal_handler_free_cb_del(h, _on_signal_handler_free, proxy);
else
ERR("proxy=%p alive handler=%p %s", proxy, h,
- edbus_signal_handler_match_get(h));
+ eldbus_signal_handler_match_get(h));
}
if (proxy->pendings)
CRITICAL("Proxy %p released with live pending calls!", proxy);
- for (i = 0; i < EDBUS_PROXY_EVENT_LAST; i++)
+ for (i = 0; i < ELDBUS_PROXY_EVENT_LAST; i++)
{
- EDBus_Proxy_Context_Event *ce = proxy->event_handlers + i;
+ Eldbus_Proxy_Context_Event *ce = proxy->event_handlers + i;
while (ce->list)
{
- EDBus_Proxy_Context_Event_Cb *ctx;
+ Eldbus_Proxy_Context_Event_Cb *ctx;
ctx = EINA_INLIST_CONTAINER_GET(ce->list,
- EDBus_Proxy_Context_Event_Cb);
- _edbus_proxy_context_event_cb_del(ce, ctx);
+ Eldbus_Proxy_Context_Event_Cb);
+ _eldbus_proxy_context_event_cb_del(ce, ctx);
}
eina_list_free(ce->to_delete);
}
@@ -191,37 +191,37 @@ _edbus_proxy_free(EDBus_Proxy *proxy)
static void
_on_object_free(void *data, const void *dead_pointer EINA_UNUSED)
{
- EDBus_Proxy *proxy = data;
- EDBUS_PROXY_CHECK(proxy);
+ Eldbus_Proxy *proxy = data;
+ ELDBUS_PROXY_CHECK(proxy);
DBG("proxy=%p, refcount=%d, interface=%s, obj=%p",
proxy, proxy->refcount, proxy->interface, proxy->obj);
- edbus_data_del_all(&(proxy->data));
- _edbus_proxy_clear(proxy);
- _edbus_proxy_free(proxy);
+ eldbus_data_del_all(&(proxy->data));
+ _eldbus_proxy_clear(proxy);
+ _eldbus_proxy_free(proxy);
}
-EAPI EDBus_Proxy *
-edbus_proxy_get(EDBus_Object *obj, const char *interface)
+EAPI Eldbus_Proxy *
+eldbus_proxy_get(Eldbus_Object *obj, const char *interface)
{
- EDBus_Proxy *proxy;
+ Eldbus_Proxy *proxy;
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL);
- proxy = edbus_object_proxy_get(obj, interface);
+ proxy = eldbus_object_proxy_get(obj, interface);
if (proxy)
- return edbus_proxy_ref(proxy);
+ return eldbus_proxy_ref(proxy);
- proxy = calloc(1, sizeof(EDBus_Proxy));
+ proxy = calloc(1, sizeof(Eldbus_Proxy));
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy, NULL);
proxy->refcount = 1;
proxy->obj = obj;
proxy->interface = eina_stringshare_add(interface);
- EINA_MAGIC_SET(proxy, EDBUS_PROXY_MAGIC);
- if (!edbus_object_proxy_add(obj, proxy))
+ EINA_MAGIC_SET(proxy, ELDBUS_PROXY_MAGIC);
+ if (!eldbus_object_proxy_add(obj, proxy))
goto cleanup;
- edbus_object_free_cb_add(obj, _on_object_free, proxy);
+ eldbus_object_free_cb_add(obj, _on_object_free, proxy);
return proxy;
@@ -234,21 +234,21 @@ cleanup:
static void _on_signal_handler_free(void *data, const void *dead_pointer);
static void
-_edbus_proxy_unref(EDBus_Proxy *proxy)
+_eldbus_proxy_unref(Eldbus_Proxy *proxy)
{
proxy->refcount--;
if (proxy->refcount > 0) return;
- edbus_object_free_cb_del(proxy->obj, _on_object_free, proxy);
- edbus_data_del_all(&(proxy->data));
- _edbus_proxy_clear(proxy);
- _edbus_proxy_free(proxy);
+ eldbus_object_free_cb_del(proxy->obj, _on_object_free, proxy);
+ eldbus_data_del_all(&(proxy->data));
+ _eldbus_proxy_clear(proxy);
+ _eldbus_proxy_free(proxy);
}
-EAPI EDBus_Proxy *
-edbus_proxy_ref(EDBus_Proxy *proxy)
+EAPI Eldbus_Proxy *
+eldbus_proxy_ref(Eldbus_Proxy *proxy)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
DBG("proxy=%p, pre-refcount=%d, interface=%s, obj=%p",
proxy, proxy->refcount, proxy->interface, proxy->obj);
proxy->refcount++;
@@ -256,62 +256,62 @@ edbus_proxy_ref(EDBus_Proxy *proxy)
}
EAPI void
-edbus_proxy_unref(EDBus_Proxy *proxy)
+eldbus_proxy_unref(Eldbus_Proxy *proxy)
{
- EDBUS_PROXY_CHECK(proxy);
+ ELDBUS_PROXY_CHECK(proxy);
DBG("proxy=%p, pre-refcount=%d, interface=%s, obj=%p",
proxy, proxy->refcount, proxy->interface, proxy->obj);
- _edbus_proxy_unref(proxy);
+ _eldbus_proxy_unref(proxy);
}
EAPI void
-edbus_proxy_free_cb_add(EDBus_Proxy *proxy, EDBus_Free_Cb cb, const void *data)
+eldbus_proxy_free_cb_add(Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const void *data)
{
- EDBUS_PROXY_CHECK(proxy);
+ ELDBUS_PROXY_CHECK(proxy);
EINA_SAFETY_ON_NULL_RETURN(cb);
- proxy->cbs_free = edbus_cbs_free_add(proxy->cbs_free, cb, data);
+ proxy->cbs_free = eldbus_cbs_free_add(proxy->cbs_free, cb, data);
}
EAPI void
-edbus_proxy_free_cb_del(EDBus_Proxy *proxy, EDBus_Free_Cb cb, const void *data)
+eldbus_proxy_free_cb_del(Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const void *data)
{
- EDBUS_PROXY_CHECK(proxy);
+ ELDBUS_PROXY_CHECK(proxy);
EINA_SAFETY_ON_NULL_RETURN(cb);
- proxy->cbs_free = edbus_cbs_free_del(proxy->cbs_free, cb, data);
+ proxy->cbs_free = eldbus_cbs_free_del(proxy->cbs_free, cb, data);
}
EAPI void
-edbus_proxy_data_set(EDBus_Proxy *proxy, const char *key, const void *data)
+eldbus_proxy_data_set(Eldbus_Proxy *proxy, const char *key, const void *data)
{
- EDBUS_PROXY_CHECK(proxy);
+ ELDBUS_PROXY_CHECK(proxy);
EINA_SAFETY_ON_NULL_RETURN(key);
EINA_SAFETY_ON_NULL_RETURN(data);
- edbus_data_set(&(proxy->data), key, data);
+ eldbus_data_set(&(proxy->data), key, data);
}
EAPI void *
-edbus_proxy_data_get(const EDBus_Proxy *proxy, const char *key)
+eldbus_proxy_data_get(const Eldbus_Proxy *proxy, const char *key)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_get(&(((EDBus_Proxy *)proxy)->data), key);
+ return eldbus_data_get(&(((Eldbus_Proxy *)proxy)->data), key);
}
EAPI void *
-edbus_proxy_data_del(EDBus_Proxy *proxy, const char *key)
+eldbus_proxy_data_del(Eldbus_Proxy *proxy, const char *key)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_del(&(((EDBus_Proxy *)proxy)->data), key);
+ return eldbus_data_del(&(((Eldbus_Proxy *)proxy)->data), key);
}
static void
-_property_changed_iter(void *data, const void *key, EDBus_Message_Iter *var)
+_property_changed_iter(void *data, const void *key, Eldbus_Message_Iter *var)
{
- EDBus_Proxy *proxy = data;
+ Eldbus_Proxy *proxy = data;
const char *skey = key;
Eina_Value *st_value, stack_value, *value;
- EDBus_Proxy_Event_Property_Changed event;
+ Eldbus_Proxy_Event_Property_Changed event;
st_value = _message_iter_struct_to_eina_value(var);
eina_value_struct_value_get(st_value, "arg0", &stack_value);
@@ -332,38 +332,38 @@ _property_changed_iter(void *data, const void *key, EDBus_Message_Iter *var)
event.name = skey;
event.value = value;
event.proxy = proxy;
- _edbus_proxy_event_callback_call(proxy, EDBUS_PROXY_EVENT_PROPERTY_CHANGED,
+ _eldbus_proxy_event_callback_call(proxy, ELDBUS_PROXY_EVENT_PROPERTY_CHANGED,
&event);
eina_value_free(st_value);
eina_value_flush(&stack_value);
}
static void
-_properties_changed(void *data, const EDBus_Message *msg)
+_properties_changed(void *data, const Eldbus_Message *msg)
{
- EDBus_Proxy *proxy = data;
- EDBus_Message_Iter *array, *invalidate;
+ Eldbus_Proxy *proxy = data;
+ Eldbus_Message_Iter *array, *invalidate;
const char *iface;
const char *invalidate_prop;
- if (!edbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate))
+ if (!eldbus_message_arguments_get(msg, "sa{sv}as", &iface, &array, &invalidate))
{
ERR("Error getting data from properties changed signal.");
return;
}
if (proxy->props)
- edbus_message_iter_dict_iterate(array, "sv", _property_changed_iter,
+ eldbus_message_iter_dict_iterate(array, "sv", _property_changed_iter,
proxy);
- while (edbus_message_iter_get_and_next(invalidate, 's', &invalidate_prop))
+ while (eldbus_message_iter_get_and_next(invalidate, 's', &invalidate_prop))
{
- EDBus_Proxy_Event_Property_Removed event;
+ Eldbus_Proxy_Event_Property_Removed event;
event.interface = proxy->interface;
event.name = invalidate_prop;
event.proxy = proxy;
if (proxy->props)
eina_hash_del(proxy->props, event.name, NULL);
- _edbus_proxy_event_callback_call(proxy, EDBUS_PROXY_EVENT_PROPERTY_REMOVED,
+ _eldbus_proxy_event_callback_call(proxy, ELDBUS_PROXY_EVENT_PROPERTY_REMOVED,
&event);
}
}
@@ -376,60 +376,60 @@ _props_cache_free(void *data)
}
EAPI void
-edbus_proxy_event_callback_add(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, EDBus_Proxy_Event_Cb cb, const void *cb_data)
+eldbus_proxy_event_callback_add(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const void *cb_data)
{
- EDBus_Proxy_Context_Event *ce;
- EDBus_Proxy_Context_Event_Cb *ctx;
+ Eldbus_Proxy_Context_Event *ce;
+ Eldbus_Proxy_Context_Event_Cb *ctx;
- EDBUS_PROXY_CHECK(proxy);
+ ELDBUS_PROXY_CHECK(proxy);
EINA_SAFETY_ON_NULL_RETURN(cb);
- EINA_SAFETY_ON_TRUE_RETURN(type >= EDBUS_PROXY_EVENT_LAST);
+ EINA_SAFETY_ON_TRUE_RETURN(type >= ELDBUS_PROXY_EVENT_LAST);
ce = proxy->event_handlers + type;
- ctx = calloc(1, sizeof(EDBus_Proxy_Context_Event_Cb));
+ ctx = calloc(1, sizeof(Eldbus_Proxy_Context_Event_Cb));
EINA_SAFETY_ON_NULL_RETURN(ctx);
ctx->cb = cb;
ctx->cb_data = cb_data;
ce->list = eina_inlist_append(ce->list, EINA_INLIST_GET(ctx));
- if (type == EDBUS_PROXY_EVENT_PROPERTY_CHANGED)
+ if (type == ELDBUS_PROXY_EVENT_PROPERTY_CHANGED)
{
if (proxy->properties_changed) return;
if (!proxy->props)
proxy->props = eina_hash_string_superfast_new(_props_cache_free);
proxy->properties_changed =
- edbus_proxy_properties_changed_callback_add(proxy,
+ eldbus_proxy_properties_changed_callback_add(proxy,
_properties_changed,
proxy);
}
- else if (type == EDBUS_PROXY_EVENT_PROPERTY_REMOVED)
+ else if (type == ELDBUS_PROXY_EVENT_PROPERTY_REMOVED)
{
if (proxy->properties_changed) return;
proxy->properties_changed =
- edbus_proxy_properties_changed_callback_add(proxy,
+ eldbus_proxy_properties_changed_callback_add(proxy,
_properties_changed,
proxy);
}
}
static void
-_edbus_proxy_context_event_cb_del(EDBus_Proxy_Context_Event *ce, EDBus_Proxy_Context_Event_Cb *ctx)
+_eldbus_proxy_context_event_cb_del(Eldbus_Proxy_Context_Event *ce, Eldbus_Proxy_Context_Event_Cb *ctx)
{
ce->list = eina_inlist_remove(ce->list, EINA_INLIST_GET(ctx));
free(ctx);
}
EAPI void
-edbus_proxy_event_callback_del(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, EDBus_Proxy_Event_Cb cb, const void *cb_data)
+eldbus_proxy_event_callback_del(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const void *cb_data)
{
- EDBus_Proxy_Context_Event *ce;
- EDBus_Proxy_Context_Event_Cb *iter, *found = NULL;
+ Eldbus_Proxy_Context_Event *ce;
+ Eldbus_Proxy_Context_Event_Cb *iter, *found = NULL;
- EDBUS_PROXY_CHECK(proxy);
+ ELDBUS_PROXY_CHECK(proxy);
EINA_SAFETY_ON_NULL_RETURN(cb);
- EINA_SAFETY_ON_TRUE_RETURN(type >= EDBUS_PROXY_EVENT_LAST);
+ EINA_SAFETY_ON_TRUE_RETURN(type >= ELDBUS_PROXY_EVENT_LAST);
ce = proxy->event_handlers + type;
@@ -452,13 +452,13 @@ edbus_proxy_event_callback_del(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type,
return;
}
- _edbus_proxy_context_event_cb_del(ce, found);
+ _eldbus_proxy_context_event_cb_del(ce, found);
- if (type == EDBUS_PROXY_EVENT_PROPERTY_CHANGED)
+ if (type == ELDBUS_PROXY_EVENT_PROPERTY_CHANGED)
{
- EDBus_Proxy_Context_Event *ce_prop_remove;
+ Eldbus_Proxy_Context_Event *ce_prop_remove;
ce_prop_remove = proxy->event_handlers +
- EDBUS_PROXY_EVENT_PROPERTY_REMOVED;
+ ELDBUS_PROXY_EVENT_PROPERTY_REMOVED;
if (!ce->list && !proxy->monitor_enabled)
{
eina_hash_free(proxy->props);
@@ -467,29 +467,29 @@ edbus_proxy_event_callback_del(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type,
if (!ce_prop_remove->list && !ce->list && !proxy->monitor_enabled)
{
- edbus_signal_handler_unref(proxy->properties_changed);
+ eldbus_signal_handler_unref(proxy->properties_changed);
proxy->properties_changed = NULL;
}
}
- else if (type == EDBUS_PROXY_EVENT_PROPERTY_REMOVED)
+ else if (type == ELDBUS_PROXY_EVENT_PROPERTY_REMOVED)
{
- EDBus_Proxy_Context_Event *ce_prop_changed;
+ Eldbus_Proxy_Context_Event *ce_prop_changed;
ce_prop_changed = proxy->event_handlers +
- EDBUS_PROXY_EVENT_PROPERTY_CHANGED;
+ ELDBUS_PROXY_EVENT_PROPERTY_CHANGED;
if (!ce_prop_changed->list && !ce->list && !proxy->monitor_enabled)
{
- edbus_signal_handler_unref(proxy->properties_changed);
+ eldbus_signal_handler_unref(proxy->properties_changed);
proxy->properties_changed = NULL;
}
}
}
static void
-_edbus_proxy_event_callback_call(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type, const void *event_info)
+_eldbus_proxy_event_callback_call(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, const void *event_info)
{
- EDBus_Proxy_Context_Event *ce;
- EDBus_Proxy_Context_Event_Cb *iter;
+ Eldbus_Proxy_Context_Event *ce;
+ Eldbus_Proxy_Context_Event_Cb *iter;
ce = proxy->event_handlers + type;
@@ -503,211 +503,211 @@ _edbus_proxy_event_callback_call(EDBus_Proxy *proxy, EDBus_Proxy_Event_Type type
if (ce->walking > 0) return;
EINA_LIST_FREE(ce->to_delete, iter)
- _edbus_proxy_context_event_cb_del(ce, iter);
+ _eldbus_proxy_context_event_cb_del(ce, iter);
}
-EAPI EDBus_Object *
-edbus_proxy_object_get(const EDBus_Proxy *proxy)
+EAPI Eldbus_Object *
+eldbus_proxy_object_get(const Eldbus_Proxy *proxy)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
return proxy->obj;
}
EAPI const char *
-edbus_proxy_interface_get(const EDBus_Proxy *proxy)
+eldbus_proxy_interface_get(const Eldbus_Proxy *proxy)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
return proxy->interface;
}
static void
_on_pending_free(void *data, const void *dead_pointer)
{
- EDBus_Proxy *proxy = data;
- EDBus_Pending *pending = (EDBus_Pending *)dead_pointer;
- EDBUS_PROXY_CHECK(proxy);
+ Eldbus_Proxy *proxy = data;
+ Eldbus_Pending *pending = (Eldbus_Pending *)dead_pointer;
+ ELDBUS_PROXY_CHECK(proxy);
proxy->pendings = eina_inlist_remove(proxy->pendings,
EINA_INLIST_GET(pending));
}
-static EDBus_Pending *
-_edbus_proxy_send(EDBus_Proxy *proxy, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout)
+static Eldbus_Pending *
+_eldbus_proxy_send(Eldbus_Proxy *proxy, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout)
{
- EDBus_Pending *pending;
+ Eldbus_Pending *pending;
- pending = _edbus_connection_send(proxy->obj->conn, msg, cb, cb_data, timeout);
+ pending = _eldbus_connection_send(proxy->obj->conn, msg, cb, cb_data, timeout);
if (!cb) return NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(pending, NULL);
- edbus_pending_free_cb_add(pending, _on_pending_free, proxy);
+ eldbus_pending_free_cb_add(pending, _on_pending_free, proxy);
proxy->pendings = eina_inlist_append(proxy->pendings,
EINA_INLIST_GET(pending));
return pending;
}
-EAPI EDBus_Pending *
-edbus_proxy_send(EDBus_Proxy *proxy, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout)
+EAPI Eldbus_Pending *
+eldbus_proxy_send(Eldbus_Proxy *proxy, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
- return _edbus_proxy_send(proxy, msg, cb, cb_data, timeout);
+ return _eldbus_proxy_send(proxy, msg, cb, cb_data, timeout);
}
-EAPI EDBus_Message *
-edbus_proxy_method_call_new(EDBus_Proxy *proxy, const char *member)
+EAPI Eldbus_Message *
+eldbus_proxy_method_call_new(Eldbus_Proxy *proxy, const char *member)
{
- EDBus_Message *msg;
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ Eldbus_Message *msg;
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
- msg = edbus_message_method_call_new(
- edbus_object_bus_name_get(proxy->obj),
- edbus_object_path_get(proxy->obj),
+ msg = eldbus_message_method_call_new(
+ eldbus_object_bus_name_get(proxy->obj),
+ eldbus_object_path_get(proxy->obj),
proxy->interface, member);
return msg;
}
-static EDBus_Pending *
-_edbus_proxy_vcall(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap)
+static Eldbus_Pending *
+_eldbus_proxy_vcall(Eldbus_Proxy *proxy, const char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap)
{
- EDBus_Message *msg = edbus_proxy_method_call_new(proxy, member);
+ Eldbus_Message *msg = eldbus_proxy_method_call_new(proxy, member);
EINA_SAFETY_ON_NULL_RETURN_VAL(msg, NULL);
- if (!edbus_message_arguments_vappend(msg, signature, ap))
+ if (!eldbus_message_arguments_vappend(msg, signature, ap))
{
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
ERR("Error setting arguments");
return NULL;
}
- return _edbus_proxy_send(proxy, msg, cb, cb_data, timeout);
+ return _eldbus_proxy_send(proxy, msg, cb, cb_data, timeout);
}
-EAPI EDBus_Pending *
-edbus_proxy_call(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, ...)
+EAPI Eldbus_Pending *
+eldbus_proxy_call(Eldbus_Proxy *proxy, const char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, ...)
{
- EDBus_Pending *pending;
+ Eldbus_Pending *pending;
va_list ap;
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(member, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, NULL);
va_start(ap, signature);
- pending = _edbus_proxy_vcall(proxy, member, cb, cb_data, timeout,
+ pending = _eldbus_proxy_vcall(proxy, member, cb, cb_data, timeout,
signature, ap);
va_end(ap);
return pending;
}
-EAPI EDBus_Pending *
-edbus_proxy_vcall(EDBus_Proxy *proxy, const char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap)
+EAPI Eldbus_Pending *
+eldbus_proxy_vcall(Eldbus_Proxy *proxy, const char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(member, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(signature, NULL);
- return _edbus_proxy_vcall(proxy, member, cb, cb_data, timeout,
+ return _eldbus_proxy_vcall(proxy, member, cb, cb_data, timeout,
signature, ap);
}
static void
_on_signal_handler_free(void *data, const void *dead_pointer)
{
- EDBus_Proxy *proxy = data;
- EDBUS_PROXY_CHECK(proxy);
+ Eldbus_Proxy *proxy = data;
+ ELDBUS_PROXY_CHECK(proxy);
proxy->handlers = eina_list_remove(proxy->handlers, dead_pointer);
}
-EAPI EDBus_Signal_Handler *
-edbus_proxy_signal_handler_add(EDBus_Proxy *proxy, const char *member, EDBus_Signal_Cb cb, const void *cb_data)
+EAPI Eldbus_Signal_Handler *
+eldbus_proxy_signal_handler_add(Eldbus_Proxy *proxy, const char *member, Eldbus_Signal_Cb cb, const void *cb_data)
{
- EDBus_Signal_Handler *handler;
+ Eldbus_Signal_Handler *handler;
const char *name, *path;
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(cb, NULL);
- name = edbus_object_bus_name_get(proxy->obj);
- path = edbus_object_path_get(proxy->obj);
+ name = eldbus_object_bus_name_get(proxy->obj);
+ path = eldbus_object_path_get(proxy->obj);
- handler = _edbus_signal_handler_add(proxy->obj->conn, name, path,
+ handler = _eldbus_signal_handler_add(proxy->obj->conn, name, path,
proxy->interface, member, cb, cb_data);
EINA_SAFETY_ON_NULL_RETURN_VAL(handler, NULL);
- edbus_signal_handler_free_cb_add(handler, _on_signal_handler_free, proxy);
+ eldbus_signal_handler_free_cb_add(handler, _on_signal_handler_free, proxy);
proxy->handlers = eina_list_append(proxy->handlers, handler);
return handler;
}
-EAPI EDBus_Pending *
-edbus_proxy_property_get(EDBus_Proxy *proxy, const char *name, EDBus_Message_Cb cb, const void *data)
+EAPI Eldbus_Pending *
+eldbus_proxy_property_get(Eldbus_Proxy *proxy, const char *name, Eldbus_Message_Cb cb, const void *data)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
- return edbus_proxy_call(proxy->obj->properties, "Get", cb, data, -1,
+ return eldbus_proxy_call(proxy->obj->properties, "Get", cb, data, -1,
"ss", proxy->interface, name);
}
-EAPI EDBus_Pending *
-edbus_proxy_property_set(EDBus_Proxy *proxy, const char *name, const char *sig, const void *value, EDBus_Message_Cb cb, const void *data)
+EAPI Eldbus_Pending *
+eldbus_proxy_property_set(Eldbus_Proxy *proxy, const char *name, const char *sig, const void *value, Eldbus_Message_Cb cb, const void *data)
{
- EDBus_Message *msg;
- EDBus_Message_Iter *iter, *variant;
+ Eldbus_Message *msg;
+ Eldbus_Message_Iter *iter, *variant;
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(sig, NULL);
EINA_SAFETY_ON_FALSE_RETURN_VAL(dbus_signature_validate_single(sig, NULL), NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(value, NULL);
- msg = edbus_proxy_method_call_new(proxy->obj->properties, "Set");
- iter = edbus_message_iter_get(msg);
- edbus_message_iter_basic_append(iter, 's', proxy->interface);
- edbus_message_iter_basic_append(iter, 's', name);
- variant = edbus_message_iter_container_new(iter, 'v', sig);
+ msg = eldbus_proxy_method_call_new(proxy->obj->properties, "Set");
+ iter = eldbus_message_iter_get(msg);
+ eldbus_message_iter_basic_append(iter, 's', proxy->interface);
+ eldbus_message_iter_basic_append(iter, 's', name);
+ variant = eldbus_message_iter_container_new(iter, 'v', sig);
if (dbus_type_is_basic(sig[0]))
dbus_message_iter_append_basic(&variant->dbus_iterator, sig[0], &value);
else
{
if (!_message_iter_from_eina_value_struct(sig, variant, value))
{
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
return NULL;
}
}
- edbus_message_iter_container_close(iter, variant);
+ eldbus_message_iter_container_close(iter, variant);
- return edbus_proxy_send(proxy->obj->properties, msg, cb, data, -1);
+ return eldbus_proxy_send(proxy->obj->properties, msg, cb, data, -1);
}
-EAPI EDBus_Pending *
-edbus_proxy_property_get_all(EDBus_Proxy *proxy, EDBus_Message_Cb cb, const void *data)
+EAPI Eldbus_Pending *
+eldbus_proxy_property_get_all(Eldbus_Proxy *proxy, Eldbus_Message_Cb cb, const void *data)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
- return edbus_proxy_call(proxy->obj->properties, "GetAll", cb, data, -1,
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ return eldbus_proxy_call(proxy->obj->properties, "GetAll", cb, data, -1,
"s", proxy->interface);
}
-EAPI EDBus_Signal_Handler *
-edbus_proxy_properties_changed_callback_add(EDBus_Proxy *proxy, EDBus_Signal_Cb cb, const void *data)
+EAPI Eldbus_Signal_Handler *
+eldbus_proxy_properties_changed_callback_add(Eldbus_Proxy *proxy, Eldbus_Signal_Cb cb, const void *data)
{
- EDBus_Signal_Handler *sh;
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
- sh = edbus_proxy_signal_handler_add(proxy->obj->properties,
+ Eldbus_Signal_Handler *sh;
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ sh = eldbus_proxy_signal_handler_add(proxy->obj->properties,
"PropertiesChanged", cb, data);
EINA_SAFETY_ON_NULL_RETURN_VAL(sh, NULL);
- edbus_signal_handler_match_extra_set(sh, "arg0", proxy->interface, NULL);
+ eldbus_signal_handler_match_extra_set(sh, "arg0", proxy->interface, NULL);
return sh;
}
static void
-_property_iter(void *data, const void *key, EDBus_Message_Iter *var)
+_property_iter(void *data, const void *key, Eldbus_Message_Iter *var)
{
- EDBus_Proxy *proxy = data;
+ Eldbus_Proxy *proxy = data;
const char *skey = key;
Eina_Value *st_value, stack_value, *value;
@@ -728,23 +728,23 @@ _property_iter(void *data, const void *key, EDBus_Message_Iter *var)
}
static void
-_props_get_all(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
+_props_get_all(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
- EDBus_Proxy *proxy = data;
- EDBus_Message_Iter *dict;
+ Eldbus_Proxy *proxy = data;
+ Eldbus_Message_Iter *dict;
- if (!edbus_message_arguments_get(msg, "a{sv}", &dict))
+ if (!eldbus_message_arguments_get(msg, "a{sv}", &dict))
{
ERR("Error getting data from properties getAll.");
return;
}
- edbus_message_iter_dict_iterate(dict, "sv", _property_iter, proxy);
+ eldbus_message_iter_dict_iterate(dict, "sv", _property_iter, proxy);
}
EAPI void
-edbus_proxy_properties_monitor(EDBus_Proxy *proxy, Eina_Bool enable)
+eldbus_proxy_properties_monitor(Eldbus_Proxy *proxy, Eina_Bool enable)
{
- EDBUS_PROXY_CHECK(proxy);
+ ELDBUS_PROXY_CHECK(proxy);
if (proxy->monitor_enabled == enable)
return;
@@ -753,20 +753,20 @@ edbus_proxy_properties_monitor(EDBus_Proxy *proxy, Eina_Bool enable)
{
if (!proxy->props)
proxy->props = eina_hash_string_superfast_new(_props_cache_free);
- edbus_proxy_property_get_all(proxy, _props_get_all, proxy);
+ eldbus_proxy_property_get_all(proxy, _props_get_all, proxy);
if (proxy->properties_changed)
return;
proxy->properties_changed =
- edbus_proxy_properties_changed_callback_add(proxy,
+ eldbus_proxy_properties_changed_callback_add(proxy,
_properties_changed,
proxy);
}
else
{
- EDBus_Proxy_Context_Event *ce_prop_changed, *ce_prop_removed;
- ce_prop_changed = proxy->event_handlers + EDBUS_PROXY_EVENT_PROPERTY_CHANGED;
- ce_prop_removed = proxy->event_handlers + EDBUS_PROXY_EVENT_PROPERTY_REMOVED;
+ Eldbus_Proxy_Context_Event *ce_prop_changed, *ce_prop_removed;
+ ce_prop_changed = proxy->event_handlers + ELDBUS_PROXY_EVENT_PROPERTY_CHANGED;
+ ce_prop_removed = proxy->event_handlers + ELDBUS_PROXY_EVENT_PROPERTY_REMOVED;
if (!ce_prop_changed->list)
{
@@ -775,25 +775,25 @@ edbus_proxy_properties_monitor(EDBus_Proxy *proxy, Eina_Bool enable)
}
if (!ce_prop_changed->list && !ce_prop_removed->list)
{
- edbus_signal_handler_unref(proxy->properties_changed);
+ eldbus_signal_handler_unref(proxy->properties_changed);
proxy->properties_changed = NULL;
}
}
}
EAPI Eina_Value *
-edbus_proxy_property_local_get(EDBus_Proxy *proxy, const char *name)
+eldbus_proxy_property_local_get(Eldbus_Proxy *proxy, const char *name)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy->props, NULL);
return eina_hash_find(proxy->props, name);
}
EAPI const Eina_Hash *
-edbus_proxy_property_local_get_all(EDBus_Proxy *proxy)
+eldbus_proxy_property_local_get_all(Eldbus_Proxy *proxy)
{
- EDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
+ ELDBUS_PROXY_CHECK_RETVAL(proxy, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(proxy->props, NULL);
return proxy->props;
}
diff --git a/src/lib/eldbus/eldbus_proxy.h b/src/lib/eldbus/eldbus_proxy.h
new file mode 100644
index 0000000000..9249948e60
--- /dev/null
+++ b/src/lib/eldbus/eldbus_proxy.h
@@ -0,0 +1,147 @@
+#ifndef ELDBUS_PROXY_H
+#define ELDBUS_PROXY_H 1
+
+/**
+ * @defgroup Eldbus_Proxy Proxy
+ * @ingroup Eldbus
+ *
+ * @{
+ */
+
+/**
+ * @brief Get a proxy of the following interface name in a Eldbus_Object.
+ */
+EAPI Eldbus_Proxy *eldbus_proxy_get(Eldbus_Object *obj, const char *interface) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Increase proxy reference.
+ */
+EAPI Eldbus_Proxy *eldbus_proxy_ref(Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Decrease proxy reference.
+ * If reference == 0 proxy will be freed and all your children.
+ */
+EAPI void eldbus_proxy_unref(Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1);
+
+EAPI Eldbus_Object *eldbus_proxy_object_get(const Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_proxy_interface_get(const Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
+EAPI void eldbus_proxy_data_set(Eldbus_Proxy *proxy, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
+EAPI void *eldbus_proxy_data_get(const Eldbus_Proxy *proxy, const char *key) EINA_ARG_NONNULL(1, 2);
+EAPI void *eldbus_proxy_data_del(Eldbus_Proxy *proxy, const char *key) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Add a callback function to be called when occurs a event of the
+ * type passed.
+ */
+EAPI void eldbus_proxy_free_cb_add(Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Remove callback registered in eldbus_proxy_free_cb_add().
+ */
+EAPI void eldbus_proxy_free_cb_del(Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Constructs a new message to invoke a method on a remote interface.
+ */
+EAPI Eldbus_Message *eldbus_proxy_method_call_new(Eldbus_Proxy *proxy, const char *member) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Send a message.
+ *
+ * @param proxy the msg will be send in connection that proxy belongs
+ * @param msg message that will be send
+ * @param cb if msg is a method call a callback should be passed
+ * @param cb_data data passed to callback
+ * @param timeout timeout in milliseconds, -1 to default internal value or
+ * ELDBUS_TIMEOUT_INFINITE for no timeout
+ */
+EAPI Eldbus_Pending *eldbus_proxy_send(Eldbus_Proxy *proxy, Eldbus_Message *msg, Eldbus_Message_Cb cb, const void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Call a method in proxy.
+ * Send a method call to interface that proxy belong with data.
+ *
+ * @param proxy
+ * @param member method name
+ * @param cb if msg is a method call a callback should be passed
+ * to be execute when response arrive
+ * @param cb_data data passed to callback
+ * @param timeout timeout in milliseconds, -1 to default internal value or
+ * ELDBUS_TIMEOUT_INFINITE for no timeout
+ * @param signature of data that will be send
+ * @param ... data value
+ *
+ * @note This function only support basic type to complex types use
+ * eldbus_message_iter_* functions.
+ */
+EAPI Eldbus_Pending *eldbus_proxy_call(Eldbus_Proxy *proxy, const char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, ...) EINA_ARG_NONNULL(1, 2, 6);
+
+/**
+ * @brief Call a method in proxy.
+ * Send a method call to interface that proxy belong with data.
+ *
+ * @param proxy
+ * @param member method name
+ * @param cb callback that will be called when response arrive.
+ * @param cb_data data passed to callback
+ * @param timeout timeout in milliseconds, -1 to default internal value or
+ * ELDBUS_TIMEOUT_INFINITE for no timeout
+ * @param signature of data that will be send
+ * @param ap va_list of data value
+ *
+ * @note This function only support basic type to complex types use
+ * eldbus_message_iter_* functions.
+ */
+EAPI Eldbus_Pending *eldbus_proxy_vcall(Eldbus_Proxy *proxy, const char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 6);
+
+/**
+ * @brief Add a signal handler.
+ *
+ * @param proxy interface where the signal is emitted
+ * @param member name of the signal
+ * @param cb callback that will be called when this signal is received
+ * @param cb_data data that will be passed to callback
+ */
+EAPI Eldbus_Signal_Handler *eldbus_proxy_signal_handler_add(Eldbus_Proxy *proxy, const char *member, Eldbus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
+
+typedef enum
+{
+ ELDBUS_PROXY_EVENT_PROPERTY_CHANGED = 0,
+ ELDBUS_PROXY_EVENT_PROPERTY_REMOVED,
+ ELDBUS_PROXY_EVENT_DEL,
+ ELDBUS_PROXY_EVENT_LAST /**< sentinel, not a real event type */
+} Eldbus_Proxy_Event_Type;
+
+typedef struct _Eldbus_Proxy_Event_Property_Changed
+{
+ const char *name;
+ const Eldbus_Proxy *proxy;
+ const Eina_Value *value;
+} Eldbus_Proxy_Event_Property_Changed;
+
+typedef struct _Eldbus_Proxy_Event_Property_Removed
+{
+ const char *interface;
+ const Eldbus_Proxy *proxy;
+ const char *name;
+} Eldbus_Proxy_Event_Property_Removed;
+
+typedef void (*Eldbus_Proxy_Event_Cb)(void *data, Eldbus_Proxy *proxy, void *event_info);
+
+/**
+ * @brief Add a callback function to be called when occurs a event of the
+ * type passed.
+ */
+EAPI void eldbus_proxy_event_callback_add(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
+
+/**
+ * @brief Remove callback registered in eldbus_proxy_event_callback_add().
+ */
+EAPI void eldbus_proxy_event_callback_del(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
+
+/**
+ * @}
+ */
+#endif
diff --git a/src/lib/edbus/edbus_service.c b/src/lib/eldbus/eldbus_service.c
index 07912e057f..e6946c21b1 100644
--- a/src/lib/edbus/edbus_service.c
+++ b/src/lib/eldbus/eldbus_service.c
@@ -2,8 +2,8 @@
# include "config.h"
#endif
-#include "edbus_private.h"
-#include "edbus_private_types.h"
+#include "eldbus_private.h"
+#include "eldbus_private_types.h"
#define DBUS_ANNOTATION(name, value) \
"<annotation" \
@@ -26,25 +26,25 @@
# define DBUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error.PropertyReadOnly"
#endif
-#define EDBUS_SERVICE_INTERFACE_CHECK(obj) \
+#define ELDBUS_SERVICE_INTERFACE_CHECK(obj) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN(obj); \
- if (!EINA_MAGIC_CHECK(obj, EDBUS_SERVICE_INTERFACE_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(obj, ELDBUS_SERVICE_INTERFACE_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(obj, EDBUS_SERVICE_INTERFACE_MAGIC); \
+ EINA_MAGIC_FAIL(obj, ELDBUS_SERVICE_INTERFACE_MAGIC); \
return; \
} \
} \
while (0)
-#define EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(obj, retval) \
+#define ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(obj, retval) \
do \
{ \
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, retval); \
- if (!EINA_MAGIC_CHECK(obj, EDBUS_SERVICE_INTERFACE_MAGIC)) \
+ if (!EINA_MAGIC_CHECK(obj, ELDBUS_SERVICE_INTERFACE_MAGIC)) \
{ \
- EINA_MAGIC_FAIL(obj, EDBUS_SERVICE_INTERFACE_MAGIC); \
+ EINA_MAGIC_FAIL(obj, ELDBUS_SERVICE_INTERFACE_MAGIC); \
return retval; \
} \
} \
@@ -53,8 +53,8 @@
static void _object_unregister(DBusConnection *conn, void *user_data);
static DBusHandlerResult _object_handler(DBusConnection *conn, DBusMessage *message, void *user_data);
-static void _object_free(EDBus_Service_Object *obj);
-static void _interface_free(EDBus_Service_Interface *interface);
+static void _object_free(Eldbus_Service_Object *obj);
+static void _interface_free(Eldbus_Service_Interface *interface);
static void _on_connection_free(void *data, const void *dead_pointer);
static DBusObjectPathVTable vtable = {
@@ -66,12 +66,12 @@ static DBusObjectPathVTable vtable = {
NULL
};
-EDBus_Service_Interface *introspectable;
-EDBus_Service_Interface *properties_iface;
-EDBus_Service_Interface *objmanager;
+Eldbus_Service_Interface *introspectable;
+Eldbus_Service_Interface *properties_iface;
+Eldbus_Service_Interface *objmanager;
static inline void
-_introspect_arguments_append(Eina_Strbuf *buf, const EDBus_Arg_Info *args,
+_introspect_arguments_append(Eina_Strbuf *buf, const Eldbus_Arg_Info *args,
const char *direction)
{
for (; args && args->signature; args++)
@@ -90,7 +90,7 @@ _introspect_arguments_append(Eina_Strbuf *buf, const EDBus_Arg_Info *args,
}
static inline void
-_introspect_append_signal(Eina_Strbuf *buf, const EDBus_Signal *sig)
+_introspect_append_signal(Eina_Strbuf *buf, const Eldbus_Signal *sig)
{
eina_strbuf_append_printf(buf, "<signal name=\"%s\"", sig->name);
@@ -102,7 +102,7 @@ _introspect_append_signal(Eina_Strbuf *buf, const EDBus_Signal *sig)
eina_strbuf_append(buf, ">");
- if (sig->flags & EDBUS_SIGNAL_FLAG_DEPRECATED)
+ if (sig->flags & ELDBUS_SIGNAL_FLAG_DEPRECATED)
eina_strbuf_append(buf, DBUS_ANNOTATION_DEPRECATED);
_introspect_arguments_append(buf, sig->args, NULL);
@@ -111,7 +111,7 @@ _introspect_append_signal(Eina_Strbuf *buf, const EDBus_Signal *sig)
}
static inline void
-_instrospect_append_property(Eina_Strbuf *buf, const EDBus_Property *prop, const EDBus_Service_Interface *iface)
+_instrospect_append_property(Eina_Strbuf *buf, const Eldbus_Property *prop, const Eldbus_Service_Interface *iface)
{
eina_strbuf_append_printf(buf, "<property name=\"%s\" type=\"%s\" access=\"",
prop->name, prop->type);
@@ -130,21 +130,21 @@ _instrospect_append_property(Eina_Strbuf *buf, const EDBus_Property *prop, const
eina_strbuf_append(buf, "\">");
- if (prop->flags & EDBUS_PROPERTY_FLAG_DEPRECATED)
+ if (prop->flags & ELDBUS_PROPERTY_FLAG_DEPRECATED)
eina_strbuf_append(buf, DBUS_ANNOTATION_DEPRECATED);
eina_strbuf_append(buf, "</property>");
}
static inline void
-_introspect_append_method(Eina_Strbuf *buf, const EDBus_Method *method)
+_introspect_append_method(Eina_Strbuf *buf, const Eldbus_Method *method)
{
eina_strbuf_append_printf(buf, "<method name=\"%s\">", method->member);
- if (method->flags & EDBUS_METHOD_FLAG_DEPRECATED)
+ if (method->flags & ELDBUS_METHOD_FLAG_DEPRECATED)
eina_strbuf_append(buf, DBUS_ANNOTATION_DEPRECATED);
- if (method->flags & EDBUS_METHOD_FLAG_NOREPLY)
+ if (method->flags & ELDBUS_METHOD_FLAG_NOREPLY)
eina_strbuf_append(buf, DBUS_ANNOTATION_NOREPLY);
_introspect_arguments_append(buf, method->in, "in");
@@ -154,14 +154,14 @@ _introspect_append_method(Eina_Strbuf *buf, const EDBus_Method *method)
typedef struct _Property
{
- const EDBus_Property *property;
+ const Eldbus_Property *property;
Eina_Bool is_invalidate:1;
} Property;
static void
-_introspect_append_interface(Eina_Strbuf *buf, EDBus_Service_Interface *iface)
+_introspect_append_interface(Eina_Strbuf *buf, Eldbus_Service_Interface *iface)
{
- const EDBus_Method *method;
+ const Eldbus_Method *method;
Property *prop;
Eina_Iterator *iterator;
unsigned short i;
@@ -184,24 +184,24 @@ _introspect_append_interface(Eina_Strbuf *buf, EDBus_Service_Interface *iface)
eina_strbuf_append(buf, "</interface>");
}
-static EDBus_Message *
-_cb_property_get(const EDBus_Service_Interface *piface, const EDBus_Message *msg)
+static Eldbus_Message *
+_cb_property_get(const Eldbus_Service_Interface *piface, const Eldbus_Message *msg)
{
const char *propname, *iface_name;
- EDBus_Service_Object *obj = piface->obj;
- EDBus_Service_Interface *iface;
+ Eldbus_Service_Object *obj = piface->obj;
+ Eldbus_Service_Interface *iface;
Property *prop;
- EDBus_Message *reply, *error_reply = NULL;
- EDBus_Message_Iter *main_iter, *variant;
+ Eldbus_Message *reply, *error_reply = NULL;
+ Eldbus_Message_Iter *main_iter, *variant;
Eina_Bool ret;
- EDBus_Property_Get_Cb getter = NULL;
+ Eldbus_Property_Get_Cb getter = NULL;
- if (!edbus_message_arguments_get(msg, "ss", &iface_name, &propname))
+ if (!eldbus_message_arguments_get(msg, "ss", &iface_name, &propname))
return NULL;
iface = eina_hash_find(obj->interfaces, iface_name);
if (!iface)
- return edbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_INTERFACE,
+ return eldbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_INTERFACE,
"Interface not found.");
prop = eina_hash_find(iface->properties, propname);
@@ -214,38 +214,38 @@ _cb_property_get(const EDBus_Service_Interface *piface, const EDBus_Message *msg
if (!getter) goto not_found;
- reply = edbus_message_method_return_new(msg);
+ reply = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL);
- main_iter = edbus_message_iter_get(reply);
- variant = edbus_message_iter_container_new(main_iter, 'v',
+ main_iter = eldbus_message_iter_get(reply);
+ variant = eldbus_message_iter_container_new(main_iter, 'v',
prop->property->type);
ret = getter(iface, propname, variant, msg, &error_reply);
if (ret)
{
- edbus_message_iter_container_close(main_iter, variant);
+ eldbus_message_iter_container_close(main_iter, variant);
return reply;
}
- edbus_message_unref(reply);
+ eldbus_message_unref(reply);
return error_reply;
not_found:
- return edbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_PROPERTY,
+ return eldbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_PROPERTY,
"Property not found.");
}
static Eina_Bool
-_props_getall(EDBus_Service_Interface *iface, Eina_Iterator *iterator, EDBus_Message_Iter *dict, const EDBus_Message *input_msg, EDBus_Message **error_reply)
+_props_getall(Eldbus_Service_Interface *iface, Eina_Iterator *iterator, Eldbus_Message_Iter *dict, const Eldbus_Message *input_msg, Eldbus_Message **error_reply)
{
Property *prop;
EINA_ITERATOR_FOREACH(iterator, prop)
{
- EDBus_Message_Iter *entry, *var;
+ Eldbus_Message_Iter *entry, *var;
Eina_Bool ret;
- EDBus_Property_Get_Cb getter = NULL;
+ Eldbus_Property_Get_Cb getter = NULL;
if (prop->property->get_func)
getter = prop->property->get_func;
@@ -255,85 +255,85 @@ _props_getall(EDBus_Service_Interface *iface, Eina_Iterator *iterator, EDBus_Mes
if (!getter || prop->is_invalidate)
continue;
- if (!edbus_message_iter_arguments_append(dict, "{sv}", &entry))
+ if (!eldbus_message_iter_arguments_append(dict, "{sv}", &entry))
continue;
- edbus_message_iter_basic_append(entry, 's', prop->property->name);
- var = edbus_message_iter_container_new(entry, 'v',
+ eldbus_message_iter_basic_append(entry, 's', prop->property->name);
+ var = eldbus_message_iter_container_new(entry, 'v',
prop->property->type);
ret = getter(iface, prop->property->name, var, input_msg, error_reply);
if (!ret)
return EINA_FALSE;
- edbus_message_iter_container_close(entry, var);
- edbus_message_iter_container_close(dict, entry);
+ eldbus_message_iter_container_close(entry, var);
+ eldbus_message_iter_container_close(dict, entry);
}
return EINA_TRUE;
}
-static EDBus_Message *
-_cb_property_getall(const EDBus_Service_Interface *piface, const EDBus_Message *msg)
+static Eldbus_Message *
+_cb_property_getall(const Eldbus_Service_Interface *piface, const Eldbus_Message *msg)
{
const char *iface_name;
- EDBus_Service_Object *obj = piface->obj;
- EDBus_Service_Interface *iface;
+ Eldbus_Service_Object *obj = piface->obj;
+ Eldbus_Service_Interface *iface;
Eina_Iterator *iterator;
- EDBus_Message *reply, *error_reply;
- EDBus_Message_Iter *main_iter, *dict;
+ Eldbus_Message *reply, *error_reply;
+ Eldbus_Message_Iter *main_iter, *dict;
- if (!edbus_message_arguments_get(msg, "s", &iface_name))
+ if (!eldbus_message_arguments_get(msg, "s", &iface_name))
return NULL;
iface = eina_hash_find(obj->interfaces, iface_name);
if (!iface)
- return edbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_INTERFACE,
+ return eldbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_INTERFACE,
"Interface not found.");
- reply = edbus_message_method_return_new(msg);
+ reply = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL);
- main_iter = edbus_message_iter_get(reply);
- if (!edbus_message_iter_arguments_append(main_iter, "a{sv}", &dict))
+ main_iter = eldbus_message_iter_get(reply);
+ if (!eldbus_message_iter_arguments_append(main_iter, "a{sv}", &dict))
{
- edbus_message_unref(reply);
+ eldbus_message_unref(reply);
return NULL;
}
iterator = eina_hash_iterator_data_new(iface->properties);
if (!_props_getall(iface, iterator, dict, msg, &error_reply))
{
- edbus_message_unref(reply);
+ eldbus_message_unref(reply);
eina_iterator_free(iterator);
return error_reply;
}
- edbus_message_iter_container_close(main_iter, dict);
+ eldbus_message_iter_container_close(main_iter, dict);
eina_iterator_free(iterator);
return reply;
}
-static EDBus_Message *
-_cb_property_set(const EDBus_Service_Interface *piface, const EDBus_Message *msg)
+static Eldbus_Message *
+_cb_property_set(const Eldbus_Service_Interface *piface, const Eldbus_Message *msg)
{
const char *propname, *iface_name;
- EDBus_Service_Object *obj = piface->obj;
- EDBus_Service_Interface *iface;
+ Eldbus_Service_Object *obj = piface->obj;
+ Eldbus_Service_Interface *iface;
Property *prop;
- EDBus_Message *reply;
- EDBus_Message_Iter *variant;
- EDBus_Property_Set_Cb setter = NULL;
+ Eldbus_Message *reply;
+ Eldbus_Message_Iter *variant;
+ Eldbus_Property_Set_Cb setter = NULL;
- if (!edbus_message_arguments_get(msg, "ssv", &iface_name, &propname, &variant))
+ if (!eldbus_message_arguments_get(msg, "ssv", &iface_name, &propname, &variant))
return NULL;
iface = eina_hash_find(obj->interfaces, iface_name);
if (!iface)
- return edbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_INTERFACE,
+ return eldbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_INTERFACE,
"Interface not found.");
prop = eina_hash_find(iface->properties, propname);
if (!prop || prop->is_invalidate)
- return edbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_PROPERTY,
+ return eldbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_PROPERTY,
"Property not found.");
if (prop->property->set_func)
@@ -342,23 +342,23 @@ _cb_property_set(const EDBus_Service_Interface *piface, const EDBus_Message *msg
setter = iface->set_func;
if (!setter)
- return edbus_message_error_new(msg, DBUS_ERROR_PROPERTY_READ_ONLY,
+ return eldbus_message_error_new(msg, DBUS_ERROR_PROPERTY_READ_ONLY,
"This property is read only");
reply = setter(iface, propname, variant, msg);
return reply;
}
-static EDBus_Message *
-cb_introspect(const EDBus_Service_Interface *_iface, const EDBus_Message *message)
+static Eldbus_Message *
+cb_introspect(const Eldbus_Service_Interface *_iface, const Eldbus_Message *message)
{
- EDBus_Service_Object *obj = _iface->obj;
- EDBus_Message *reply = edbus_message_method_return_new(message);
+ Eldbus_Service_Object *obj = _iface->obj;
+ Eldbus_Message *reply = eldbus_message_method_return_new(message);
if (obj->introspection_dirty || !obj->introspection_data)
{
Eina_Iterator *iterator;
- EDBus_Service_Interface *iface;
- EDBus_Service_Object *child;
+ Eldbus_Service_Interface *iface;
+ Eldbus_Service_Object *child;
size_t baselen;
if (obj->introspection_data)
@@ -390,24 +390,24 @@ cb_introspect(const EDBus_Service_Interface *_iface, const EDBus_Message *messag
obj->introspection_dirty = EINA_FALSE;
}
- edbus_message_arguments_append(reply, "s", eina_strbuf_string_get(obj->introspection_data));
+ eldbus_message_arguments_append(reply, "s", eina_strbuf_string_get(obj->introspection_data));
return reply;
}
-static const EDBus_Method introspect = {
- "Introspect", NULL, EDBUS_ARGS({ "s", "xml" }), cb_introspect
+static const Eldbus_Method introspect = {
+ "Introspect", NULL, ELDBUS_ARGS({ "s", "xml" }), cb_introspect
};
static void
_introspectable_create(void)
{
- introspectable = calloc(1, sizeof(EDBus_Service_Interface));
+ introspectable = calloc(1, sizeof(Eldbus_Service_Interface));
EINA_SAFETY_ON_NULL_RETURN(introspectable);
- EINA_MAGIC_SET(introspectable, EDBUS_SERVICE_INTERFACE_MAGIC);
+ EINA_MAGIC_SET(introspectable, ELDBUS_SERVICE_INTERFACE_MAGIC);
introspectable->sign_of_signals = eina_array_new(1);
introspectable->properties = eina_hash_string_small_new(NULL);
- introspectable->name = EDBUS_FDO_INTERFACE_INTROSPECTABLE;
+ introspectable->name = ELDBUS_FDO_INTERFACE_INTROSPECTABLE;
introspectable->methods = eina_hash_string_small_new(NULL);
eina_hash_add(introspectable->methods, introspect.member, &introspect);
@@ -432,39 +432,39 @@ _default_interfaces_free(void)
free(objmanager);
}
-static const EDBus_Method _property_methods[] = {
+static const Eldbus_Method _property_methods[] = {
{
- "Get", EDBUS_ARGS({"s", "interface"}, {"s", "property"}),
- EDBUS_ARGS({"v", "value"}), _cb_property_get
+ "Get", ELDBUS_ARGS({"s", "interface"}, {"s", "property"}),
+ ELDBUS_ARGS({"v", "value"}), _cb_property_get
},
{
- "Set", EDBUS_ARGS({"s", "interface"}, {"s", "property"}, {"v", "value"}),
+ "Set", ELDBUS_ARGS({"s", "interface"}, {"s", "property"}, {"v", "value"}),
NULL, _cb_property_set
},
{
- "GetAll", EDBUS_ARGS({"s", "interface"}), EDBUS_ARGS({"a{sv}", "props"}),
+ "GetAll", ELDBUS_ARGS({"s", "interface"}), ELDBUS_ARGS({"a{sv}", "props"}),
_cb_property_getall
}
};
-static const EDBus_Signal _properties_signals[] = {
+static const Eldbus_Signal _properties_signals[] = {
{
"PropertiesChanged",
- EDBUS_ARGS({"s", "interface"}, {"a{sv}", "changed_properties"}, {"as", "invalidated_properties"})
+ ELDBUS_ARGS({"s", "interface"}, {"a{sv}", "changed_properties"}, {"as", "invalidated_properties"})
}
};
static void
_properties_create(void)
{
- properties_iface = calloc(1, sizeof(EDBus_Service_Interface));
+ properties_iface = calloc(1, sizeof(Eldbus_Service_Interface));
if (!properties_iface) return;
properties_iface->sign_of_signals = eina_array_new(1);
properties_iface->properties = eina_hash_string_small_new(NULL);
- properties_iface->name = EDBUS_FDO_INTERFACE_PROPERTIES;
+ properties_iface->name = ELDBUS_FDO_INTERFACE_PROPERTIES;
properties_iface->methods = eina_hash_string_small_new(NULL);
- EINA_MAGIC_SET(properties_iface, EDBUS_SERVICE_INTERFACE_MAGIC);
+ EINA_MAGIC_SET(properties_iface, ELDBUS_SERVICE_INTERFACE_MAGIC);
eina_hash_add(properties_iface->methods, _property_methods[0].member,
&_property_methods[0]);
@@ -478,42 +478,42 @@ _properties_create(void)
}
static Eina_Bool
-_propmgr_iface_props_append(EDBus_Service_Interface *iface, EDBus_Message_Iter *array)
+_propmgr_iface_props_append(Eldbus_Service_Interface *iface, Eldbus_Message_Iter *array)
{
- EDBus_Message_Iter *iface_entry, *props_array;
+ Eldbus_Message_Iter *iface_entry, *props_array;
Eina_Iterator *iterator;
- EDBus_Message *error_msg;
+ Eldbus_Message *error_msg;
- edbus_message_iter_arguments_append(array, "{sa{sv}}", &iface_entry);
+ eldbus_message_iter_arguments_append(array, "{sa{sv}}", &iface_entry);
- edbus_message_iter_arguments_append(iface_entry, "sa{sv}", iface->name, &props_array);
+ eldbus_message_iter_arguments_append(iface_entry, "sa{sv}", iface->name, &props_array);
iterator = eina_hash_iterator_data_new(iface->properties);
if (!_props_getall(iface, iterator, props_array, NULL, &error_msg))
{
ERR("Error reply was set without pass any input message.");
- edbus_message_unref(error_msg);
+ eldbus_message_unref(error_msg);
eina_iterator_free(iterator);
return EINA_FALSE;
}
eina_iterator_free(iterator);
- edbus_message_iter_container_close(iface_entry, props_array);
- edbus_message_iter_container_close(array, iface_entry);
+ eldbus_message_iter_container_close(iface_entry, props_array);
+ eldbus_message_iter_container_close(array, iface_entry);
return EINA_TRUE;
}
static Eina_Bool
-_managed_obj_append(EDBus_Service_Object *obj, EDBus_Message_Iter *array, Eina_Bool first)
+_managed_obj_append(Eldbus_Service_Object *obj, Eldbus_Message_Iter *array, Eina_Bool first)
{
- EDBus_Message_Iter *obj_entry, *array_interface;
+ Eldbus_Message_Iter *obj_entry, *array_interface;
Eina_Iterator *iface_iter;
- EDBus_Service_Interface *iface;
- EDBus_Service_Object *children;
+ Eldbus_Service_Interface *iface;
+ Eldbus_Service_Object *children;
if (first) goto foreach;
if (obj->objmanager) return EINA_TRUE;
- edbus_message_iter_arguments_append(array, "{oa{sa{sv}}}", &obj_entry);
- edbus_message_iter_arguments_append(obj_entry, "oa{sa{sv}}", obj->path,
+ eldbus_message_iter_arguments_append(array, "{oa{sa{sv}}}", &obj_entry);
+ eldbus_message_iter_arguments_append(obj_entry, "oa{sa{sv}}", obj->path,
&array_interface);
iface_iter = eina_hash_iterator_data_new(obj->interfaces);
@@ -532,8 +532,8 @@ _managed_obj_append(EDBus_Service_Object *obj, EDBus_Message_Iter *array, Eina_B
return EINA_FALSE;
}
eina_iterator_free(iface_iter);
- edbus_message_iter_container_close(obj_entry, array_interface);
- edbus_message_iter_container_close(array, obj_entry);
+ eldbus_message_iter_container_close(obj_entry, array_interface);
+ eldbus_message_iter_container_close(array, obj_entry);
foreach:
EINA_INLIST_FOREACH(obj->children, children)
@@ -545,53 +545,53 @@ foreach:
return EINA_TRUE;
}
-static EDBus_Message *
-_cb_managed_objects(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
+static Eldbus_Message *
+_cb_managed_objects(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
{
- EDBus_Message *reply = edbus_message_method_return_new(msg);
- EDBus_Message_Iter *array_path, *main_iter;
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ Eldbus_Message_Iter *array_path, *main_iter;
Eina_Bool ret;
EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL);
- main_iter = edbus_message_iter_get(reply);
- edbus_message_iter_arguments_append(main_iter, "a{oa{sa{sv}}}", &array_path);
+ main_iter = eldbus_message_iter_get(reply);
+ eldbus_message_iter_arguments_append(main_iter, "a{oa{sa{sv}}}", &array_path);
ret = _managed_obj_append(iface->obj, array_path, EINA_TRUE);
if (!ret)
{
- edbus_message_unref(reply);
- return edbus_message_error_new(msg, "org.freedesktop.DBus.Error",
+ eldbus_message_unref(reply);
+ return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error",
"Irrecoverable error happen");
}
- edbus_message_iter_container_close(main_iter, array_path);
+ eldbus_message_iter_container_close(main_iter, array_path);
return reply;
}
-static EDBus_Method get_managed_objects = {
- "GetManagedObjects", NULL, EDBUS_ARGS({"a{oa{sa{sv}}}", "objects"}),
+static Eldbus_Method get_managed_objects = {
+ "GetManagedObjects", NULL, ELDBUS_ARGS({"a{oa{sa{sv}}}", "objects"}),
_cb_managed_objects
};
-static const EDBus_Signal _object_manager_signals[] = {
+static const Eldbus_Signal _object_manager_signals[] = {
{
- "InterfacesAdded", EDBUS_ARGS({"o", "object"}, {"a{sa{sv}}", "interfaces"})
+ "InterfacesAdded", ELDBUS_ARGS({"o", "object"}, {"a{sa{sv}}", "interfaces"})
},
{
- "InterfacesRemoved", EDBUS_ARGS({"o", "object"}, {"as", "interfaces"})
+ "InterfacesRemoved", ELDBUS_ARGS({"o", "object"}, {"as", "interfaces"})
}
};
static void
_object_manager_create(void)
{
- objmanager = calloc(1, sizeof(EDBus_Service_Interface));
+ objmanager = calloc(1, sizeof(Eldbus_Service_Interface));
if (!objmanager) return;
- EINA_MAGIC_SET(objmanager, EDBUS_SERVICE_INTERFACE_MAGIC);
+ EINA_MAGIC_SET(objmanager, ELDBUS_SERVICE_INTERFACE_MAGIC);
objmanager->sign_of_signals = eina_array_new(1);
objmanager->properties = eina_hash_string_small_new(NULL);
- objmanager->name = EDBUS_FDO_INTERFACE_OBJECT_MANAGER;
+ objmanager->name = ELDBUS_FDO_INTERFACE_OBJECT_MANAGER;
objmanager->methods = eina_hash_string_small_new(NULL);
eina_hash_add(objmanager->methods, get_managed_objects.member,
@@ -603,7 +603,7 @@ _object_manager_create(void)
}
Eina_Bool
-edbus_service_init(void)
+eldbus_service_init(void)
{
_introspectable_create();
EINA_SAFETY_ON_NULL_RETURN_VAL(introspectable, EINA_FALSE);
@@ -616,15 +616,15 @@ edbus_service_init(void)
}
void
-edbus_service_shutdown(void)
+eldbus_service_shutdown(void)
{
_default_interfaces_free();
}
-static EDBus_Service_Object *
-_edbus_service_object_parent_find(EDBus_Service_Object *obj)
+static Eldbus_Service_Object *
+_eldbus_service_object_parent_find(Eldbus_Service_Object *obj)
{
- EDBus_Service_Object *parent = NULL;
+ Eldbus_Service_Object *parent = NULL;
size_t len = strlen(obj->path);
char *path = strdup(obj->path);
char *slash;
@@ -646,14 +646,14 @@ _edbus_service_object_parent_find(EDBus_Service_Object *obj)
return parent;
}
-static EDBus_Service_Object *
-_edbus_service_object_add(EDBus_Connection *conn, const char *path)
+static Eldbus_Service_Object *
+_eldbus_service_object_add(Eldbus_Connection *conn, const char *path)
{
- EDBus_Service_Object *obj, *rootobj;
+ Eldbus_Service_Object *obj, *rootobj;
Eina_Inlist *safe;
size_t pathlen;
- obj = calloc(1, sizeof(EDBus_Service_Object));
+ obj = calloc(1, sizeof(Eldbus_Service_Object));
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
if (!dbus_connection_register_object_path(conn->dbus_conn, path, &vtable,
@@ -666,12 +666,12 @@ _edbus_service_object_add(EDBus_Connection *conn, const char *path)
obj->conn = conn;
obj->path = eina_stringshare_add(path);
obj->interfaces = eina_hash_string_superfast_new(NULL);
- edbus_connection_free_cb_add(conn, _on_connection_free, obj);
+ eldbus_connection_free_cb_add(conn, _on_connection_free, obj);
eina_hash_add(obj->interfaces, introspectable->name, introspectable);
eina_hash_add(obj->interfaces, properties_iface->name, properties_iface);
- obj->parent = _edbus_service_object_parent_find(obj);
+ obj->parent = _eldbus_service_object_parent_find(obj);
if (obj->parent)
{
obj->parent->children = eina_inlist_append(obj->parent->children,
@@ -711,18 +711,18 @@ _props_free(void *data)
}
static void
-_object_manager_iface_added_emit(EDBus_Service_Object *obj,
- EDBus_Service_Object *parent)
+_object_manager_iface_added_emit(Eldbus_Service_Object *obj,
+ Eldbus_Service_Object *parent)
{
Eina_List *l;
- EDBus_Service_Interface *iface;
- EDBus_Message_Iter *iter, *array;
- EDBus_Message *sig = edbus_message_signal_new(parent->path,
- EDBUS_FDO_INTERFACE_OBJECT_MANAGER,
+ Eldbus_Service_Interface *iface;
+ Eldbus_Message_Iter *iter, *array;
+ Eldbus_Message *sig = eldbus_message_signal_new(parent->path,
+ ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
"InterfacesAdded");
EINA_SAFETY_ON_NULL_RETURN(sig);
- iter = edbus_message_iter_get(sig);
- edbus_message_iter_arguments_append(iter, "oa{sa{sv}}", obj->path,
+ iter = eldbus_message_iter_get(sig);
+ eldbus_message_iter_arguments_append(iter, "oa{sa{sv}}", obj->path,
&array);
EINA_LIST_FOREACH(obj->iface_added, l, iface)
@@ -730,44 +730,44 @@ _object_manager_iface_added_emit(EDBus_Service_Object *obj,
if (!_propmgr_iface_props_append(iface, array))
{
ERR("Could not append properties to InterfacesAdded signal");
- edbus_message_unref(sig);
+ eldbus_message_unref(sig);
goto done;
}
}
- edbus_message_iter_container_close(iter, array);
- edbus_connection_send(parent->conn, sig, NULL, NULL, -1);
+ eldbus_message_iter_container_close(iter, array);
+ eldbus_connection_send(parent->conn, sig, NULL, NULL, -1);
done:
obj->iface_added = eina_list_free(obj->iface_added);
}
static void
-_object_manager_iface_removed_emit(EDBus_Service_Object *obj,
- EDBus_Service_Object *parent)
+_object_manager_iface_removed_emit(Eldbus_Service_Object *obj,
+ Eldbus_Service_Object *parent)
{
Eina_List *l;
const char *name;
- EDBus_Message_Iter *iter, *array;
- EDBus_Message *sig = edbus_message_signal_new(parent->path,
- EDBUS_FDO_INTERFACE_OBJECT_MANAGER,
+ Eldbus_Message_Iter *iter, *array;
+ Eldbus_Message *sig = eldbus_message_signal_new(parent->path,
+ ELDBUS_FDO_INTERFACE_OBJECT_MANAGER,
"InterfacesRemoved");
EINA_SAFETY_ON_NULL_RETURN(sig);
- iter = edbus_message_iter_get(sig);
- edbus_message_iter_arguments_append(iter, "oas", obj->path, &array);
+ iter = eldbus_message_iter_get(sig);
+ eldbus_message_iter_arguments_append(iter, "oas", obj->path, &array);
EINA_LIST_FOREACH(obj->iface_removed, l, name)
{
- edbus_message_iter_arguments_append(array, name);
+ eldbus_message_iter_arguments_append(array, name);
eina_stringshare_del(name);
}
- edbus_message_iter_container_close(iter, array);
- edbus_connection_send(parent->conn, sig, NULL, NULL, -1);
+ eldbus_message_iter_container_close(iter, array);
+ eldbus_connection_send(parent->conn, sig, NULL, NULL, -1);
obj->iface_removed = eina_list_free(obj->iface_removed);
}
-static EDBus_Service_Object *
-_object_manager_parent_find(EDBus_Service_Object *obj)
+static Eldbus_Service_Object *
+_object_manager_parent_find(Eldbus_Service_Object *obj)
{
if (!obj->parent)
return NULL;
@@ -779,8 +779,8 @@ _object_manager_parent_find(EDBus_Service_Object *obj)
static Eina_Bool
_object_manager_changes_process(void *data)
{
- EDBus_Service_Object *obj = data;
- EDBus_Service_Object *parent = _object_manager_parent_find(obj);
+ Eldbus_Service_Object *obj = data;
+ Eldbus_Service_Object *parent = _object_manager_parent_find(obj);
obj->idler_iface_changed = NULL;
@@ -795,18 +795,18 @@ _object_manager_changes_process(void *data)
return EINA_FALSE;
}
-static EDBus_Service_Interface *
-_edbus_service_interface_add(EDBus_Service_Object *obj, const char *interface)
+static Eldbus_Service_Interface *
+_eldbus_service_interface_add(Eldbus_Service_Object *obj, const char *interface)
{
- EDBus_Service_Interface *iface;
+ Eldbus_Service_Interface *iface;
iface = eina_hash_find(obj->interfaces, interface);
if (iface) return iface;
- iface = calloc(1, sizeof(EDBus_Service_Interface));
+ iface = calloc(1, sizeof(Eldbus_Service_Interface));
EINA_SAFETY_ON_NULL_RETURN_VAL(iface, NULL);
- EINA_MAGIC_SET(iface, EDBUS_SERVICE_INTERFACE_MAGIC);
+ EINA_MAGIC_SET(iface, ELDBUS_SERVICE_INTERFACE_MAGIC);
iface->name = eina_stringshare_add(interface);
iface->methods = eina_hash_string_superfast_new(NULL);
iface->properties = eina_hash_string_superfast_new(_props_free);
@@ -822,7 +822,7 @@ _edbus_service_interface_add(EDBus_Service_Object *obj, const char *interface)
}
static Eina_Bool
-_have_signature(const EDBus_Arg_Info *args, EDBus_Message *msg)
+_have_signature(const Eldbus_Arg_Info *args, Eldbus_Message *msg)
{
const char *sig = dbus_message_get_signature(msg->dbus_msg);
const char *p = NULL;
@@ -844,8 +844,8 @@ _have_signature(const EDBus_Arg_Info *args, EDBus_Message *msg)
}
static Eina_Bool
-_edbus_service_method_add(EDBus_Service_Interface *interface,
- const EDBus_Method *method)
+_eldbus_service_method_add(Eldbus_Service_Interface *interface,
+ const Eldbus_Method *method)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(!!eina_hash_find(interface->methods,
method->member), EINA_FALSE);
@@ -857,8 +857,8 @@ _edbus_service_method_add(EDBus_Service_Interface *interface,
}
static Eina_Bool
-_edbus_service_property_add(EDBus_Service_Interface *interface,
- const EDBus_Property *property)
+_eldbus_service_property_add(Eldbus_Service_Interface *interface,
+ const Eldbus_Property *property)
{
Property *p;
EINA_SAFETY_ON_TRUE_RETURN_VAL(!!eina_hash_find(interface->properties,
@@ -877,10 +877,10 @@ _edbus_service_property_add(EDBus_Service_Interface *interface,
/* Check if all signals in desc have valid signatures and return an Eina_Array
* with each of them. Return NULL if any of the signatures is invalid */
static inline Eina_Array *
-_edbus_service_interface_desc_signals_signatures_get(
- const EDBus_Service_Interface_Desc *desc)
+_eldbus_service_interface_desc_signals_signatures_get(
+ const Eldbus_Service_Interface_Desc *desc)
{
- const EDBus_Signal *sig;
+ const Eldbus_Signal *sig;
Eina_Strbuf *buf = eina_strbuf_new();
Eina_Array *signatures = eina_array_new(1);
@@ -889,7 +889,7 @@ _edbus_service_interface_desc_signals_signatures_get(
for (sig = desc->signals; sig && sig->name; sig++)
{
- const EDBus_Arg_Info *arg;
+ const Eldbus_Arg_Info *arg;
eina_strbuf_reset(buf);
for (arg = sig->args; arg && arg->signature; arg++)
@@ -915,13 +915,13 @@ fail_signature:
return NULL;
}
-EAPI EDBus_Service_Interface *
-edbus_service_interface_register(EDBus_Connection *conn, const char *path, const EDBus_Service_Interface_Desc *desc)
+EAPI Eldbus_Service_Interface *
+eldbus_service_interface_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc)
{
- EDBus_Service_Object *obj;
- EDBus_Service_Interface *iface;
- const EDBus_Method *method;
- const EDBus_Property *property;
+ Eldbus_Service_Object *obj;
+ Eldbus_Service_Interface *iface;
+ const Eldbus_Method *method;
+ const Eldbus_Property *property;
Eina_Array *signatures;
EINA_SAFETY_ON_NULL_RETURN_VAL(conn, EINA_FALSE);
@@ -936,28 +936,28 @@ edbus_service_interface_register(EDBus_Connection *conn, const char *path, const
return NULL;
}
- signatures = _edbus_service_interface_desc_signals_signatures_get(desc);
+ signatures = _eldbus_service_interface_desc_signals_signatures_get(desc);
if (!signatures)
return NULL;
if (!obj)
- obj = _edbus_service_object_add(conn, path);
+ obj = _eldbus_service_object_add(conn, path);
else
obj->introspection_dirty = EINA_TRUE;
EINA_SAFETY_ON_NULL_GOTO(obj, fail);
- iface = _edbus_service_interface_add(obj, desc->interface);
+ iface = _eldbus_service_interface_add(obj, desc->interface);
if (!iface)
goto fail;
for (method = desc->methods; method && method->member; method++)
- _edbus_service_method_add(iface, method);
+ _eldbus_service_method_add(iface, method);
iface->signals = desc->signals;
iface->sign_of_signals = signatures;
for (property = desc->properties; property && property->name; property++)
- _edbus_service_property_add(iface, property);
+ _eldbus_service_property_add(iface, property);
iface->get_func = desc->default_get;
iface->set_func = desc->default_set;
@@ -974,10 +974,10 @@ fail:
}
static void
-_interface_free(EDBus_Service_Interface *interface)
+_interface_free(Eldbus_Service_Interface *interface)
{
const char *sig;
- EDBus_Service_Object *obj;
+ Eldbus_Service_Object *obj;
Eina_List *l;
if (interface == introspectable || interface == properties_iface ||
@@ -1023,10 +1023,10 @@ _interface_free(EDBus_Service_Interface *interface)
}
static void
-_object_free(EDBus_Service_Object *obj)
+_object_free(Eldbus_Service_Object *obj)
{
Eina_Iterator *iterator;
- EDBus_Service_Interface *iface;
+ Eldbus_Service_Interface *iface;
/* Flush ObjectManager interface before the entire object goes away */
if (obj->idler_iface_changed)
@@ -1039,8 +1039,8 @@ _object_free(EDBus_Service_Object *obj)
while (obj->children)
{
- EDBus_Service_Object *child;
- child = EINA_INLIST_CONTAINER_GET(obj->children, EDBus_Service_Object);
+ Eldbus_Service_Object *child;
+ child = EINA_INLIST_CONTAINER_GET(obj->children, Eldbus_Service_Object);
obj->children = eina_inlist_remove(obj->children, obj->children);
if (obj->parent)
{
@@ -1062,7 +1062,7 @@ _object_free(EDBus_Service_Object *obj)
obj->conn->root_objs = eina_inlist_remove(obj->conn->root_objs,
EINA_INLIST_GET(obj));
- edbus_data_del_all(&obj->data);
+ eldbus_data_del_all(&obj->data);
eina_hash_free(obj->interfaces);
eina_iterator_free(iterator);
@@ -1075,19 +1075,19 @@ _object_free(EDBus_Service_Object *obj)
static void
_on_connection_free(void *data, const void *dead_pointer EINA_UNUSED)
{
- EDBus_Service_Object *obj = data;
+ Eldbus_Service_Object *obj = data;
dbus_connection_unregister_object_path(obj->conn->dbus_conn, obj->path);
}
EAPI void
-edbus_service_interface_unregister(EDBus_Service_Interface *iface)
+eldbus_service_interface_unregister(Eldbus_Service_Interface *iface)
{
- EDBUS_SERVICE_INTERFACE_CHECK(iface);
+ ELDBUS_SERVICE_INTERFACE_CHECK(iface);
if (!eina_hash_find(iface->obj->interfaces, objmanager->name))
{
//properties + introspectable + iface that user wants unregister
if (eina_hash_population(iface->obj->interfaces) < 4)
- edbus_service_object_unregister(iface);
+ eldbus_service_object_unregister(iface);
return;
}
eina_hash_del(iface->obj->interfaces, NULL, iface);
@@ -1096,32 +1096,32 @@ edbus_service_interface_unregister(EDBus_Service_Interface *iface)
}
EAPI void
-edbus_service_object_unregister(EDBus_Service_Interface *iface)
+eldbus_service_object_unregister(Eldbus_Service_Interface *iface)
{
- EDBUS_SERVICE_INTERFACE_CHECK(iface);
+ ELDBUS_SERVICE_INTERFACE_CHECK(iface);
/*
* It will be freed when _object_unregister() is called
* by libdbus.
*/
- edbus_connection_free_cb_del(iface->obj->conn, _on_connection_free, iface->obj);
+ eldbus_connection_free_cb_del(iface->obj->conn, _on_connection_free, iface->obj);
dbus_connection_unregister_object_path(iface->obj->conn->dbus_conn, iface->obj->path);
}
static void
_object_unregister(DBusConnection *conn EINA_UNUSED, void *user_data)
{
- EDBus_Service_Object *obj = user_data;
+ Eldbus_Service_Object *obj = user_data;
_object_free(obj);
}
static DBusHandlerResult
_object_handler(DBusConnection *conn EINA_UNUSED, DBusMessage *msg, void *user_data)
{
- EDBus_Service_Object *obj;
- EDBus_Service_Interface *iface;
- const EDBus_Method *method;
- EDBus_Message *edbus_msg;
- EDBus_Message *reply;
+ Eldbus_Service_Object *obj;
+ Eldbus_Service_Interface *iface;
+ const Eldbus_Method *method;
+ Eldbus_Message *eldbus_msg;
+ Eldbus_Message *reply;
obj = user_data;
if (!obj) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -1144,154 +1144,154 @@ _object_handler(DBusConnection *conn EINA_UNUSED, DBusMessage *msg, void *user_d
method = eina_hash_find(iface->methods, dbus_message_get_member(msg));
if (!method) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- edbus_msg = edbus_message_new(EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(edbus_msg, DBUS_HANDLER_RESULT_NEED_MEMORY);
- edbus_msg->dbus_msg = msg;
- dbus_message_iter_init(edbus_msg->dbus_msg, &edbus_msg->iterator->dbus_iterator);
+ eldbus_msg = eldbus_message_new(EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eldbus_msg, DBUS_HANDLER_RESULT_NEED_MEMORY);
+ eldbus_msg->dbus_msg = msg;
+ dbus_message_iter_init(eldbus_msg->dbus_msg, &eldbus_msg->iterator->dbus_iterator);
- if (!_have_signature(method->in, edbus_msg))
+ if (!_have_signature(method->in, eldbus_msg))
{
- reply = edbus_message_error_new(edbus_msg,
+ reply = eldbus_message_error_new(eldbus_msg,
DBUS_ERROR_INVALID_SIGNATURE,
"See introspectable to know the expected signature");
}
else
{
if (iface->obj)
- reply = method->cb(iface, edbus_msg);
+ reply = method->cb(iface, eldbus_msg);
else
{
//if iface does have obj it is some of FreeDesktop interfaces:
//Introspectable, Properties...
- EDBus_Service_Interface *cpy;
- cpy = calloc(1, sizeof(EDBus_Service_Interface));
+ Eldbus_Service_Interface *cpy;
+ cpy = calloc(1, sizeof(Eldbus_Service_Interface));
if (!cpy)
{
- dbus_message_ref(edbus_msg->dbus_msg);
- edbus_message_unref(edbus_msg);
+ dbus_message_ref(eldbus_msg->dbus_msg);
+ eldbus_message_unref(eldbus_msg);
return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
cpy->obj = obj;
- reply = method->cb(cpy, edbus_msg);
+ reply = method->cb(cpy, eldbus_msg);
free(cpy);
}
}
- dbus_message_ref(edbus_msg->dbus_msg);
- edbus_message_unref(edbus_msg);
+ dbus_message_ref(eldbus_msg->dbus_msg);
+ eldbus_message_unref(eldbus_msg);
if (!reply) return DBUS_HANDLER_RESULT_HANDLED;
- _edbus_connection_send(obj->conn, reply, NULL, NULL, -1);
+ _eldbus_connection_send(obj->conn, reply, NULL, NULL, -1);
return DBUS_HANDLER_RESULT_HANDLED;
}
-EAPI EDBus_Connection *
-edbus_service_connection_get(const EDBus_Service_Interface *iface)
+EAPI Eldbus_Connection *
+eldbus_service_connection_get(const Eldbus_Service_Interface *iface)
{
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
return iface->obj->conn;
}
EAPI const char *
-edbus_service_object_path_get(const EDBus_Service_Interface *iface)
+eldbus_service_object_path_get(const Eldbus_Service_Interface *iface)
{
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
return iface->obj->path;
}
-EAPI EDBus_Message *
-edbus_service_signal_new(const EDBus_Service_Interface *iface, unsigned int signal_id)
+EAPI Eldbus_Message *
+eldbus_service_signal_new(const Eldbus_Service_Interface *iface, unsigned int signal_id)
{
unsigned size;
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
size = eina_array_count(iface->sign_of_signals);
EINA_SAFETY_ON_FALSE_RETURN_VAL(signal_id < size, EINA_FALSE);
- return edbus_message_signal_new(iface->obj->path, iface->name,
+ return eldbus_message_signal_new(iface->obj->path, iface->name,
iface->signals[signal_id].name);
}
EAPI Eina_Bool
-edbus_service_signal_emit(const EDBus_Service_Interface *iface, unsigned int signal_id, ...)
+eldbus_service_signal_emit(const Eldbus_Service_Interface *iface, unsigned int signal_id, ...)
{
- EDBus_Message *sig;
+ Eldbus_Message *sig;
va_list ap;
Eina_Bool r;
const char *signature;
unsigned size;
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
size = eina_array_count(iface->sign_of_signals);
EINA_SAFETY_ON_FALSE_RETURN_VAL(signal_id < size, EINA_FALSE);
- sig = edbus_service_signal_new(iface, signal_id);
+ sig = eldbus_service_signal_new(iface, signal_id);
EINA_SAFETY_ON_NULL_RETURN_VAL(sig, EINA_FALSE);
signature = eina_array_data_get(iface->sign_of_signals, signal_id);
va_start(ap, signal_id);
- r = edbus_message_arguments_vappend(sig, signature, ap);
+ r = eldbus_message_arguments_vappend(sig, signature, ap);
va_end(ap);
EINA_SAFETY_ON_FALSE_RETURN_VAL(r, EINA_FALSE);
- edbus_service_signal_send(iface, sig);
+ eldbus_service_signal_send(iface, sig);
return EINA_TRUE;
}
EAPI Eina_Bool
-edbus_service_signal_send(const EDBus_Service_Interface *iface, EDBus_Message *signal_msg)
+eldbus_service_signal_send(const Eldbus_Service_Interface *iface, Eldbus_Message *signal_msg)
{
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(signal_msg, EINA_FALSE);
- _edbus_connection_send(iface->obj->conn, signal_msg, NULL, NULL, -1);
+ _eldbus_connection_send(iface->obj->conn, signal_msg, NULL, NULL, -1);
return EINA_TRUE;
}
EAPI void
-edbus_service_object_data_set(EDBus_Service_Interface *iface, const char *key, const void *data)
+eldbus_service_object_data_set(Eldbus_Service_Interface *iface, const char *key, const void *data)
{
- EDBUS_SERVICE_INTERFACE_CHECK(iface);
+ ELDBUS_SERVICE_INTERFACE_CHECK(iface);
EINA_SAFETY_ON_NULL_RETURN(key);
EINA_SAFETY_ON_NULL_RETURN(data);
- edbus_data_set(&(iface->obj->data), key, data);
+ eldbus_data_set(&(iface->obj->data), key, data);
}
EAPI void *
-edbus_service_object_data_get(const EDBus_Service_Interface *iface, const char *key)
+eldbus_service_object_data_get(const Eldbus_Service_Interface *iface, const char *key)
{
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_get(&(((EDBus_Service_Object *)iface->obj)->data), key);
+ return eldbus_data_get(&(((Eldbus_Service_Object *)iface->obj)->data), key);
}
EAPI void *
-edbus_service_object_data_del(EDBus_Service_Interface *iface, const char *key)
+eldbus_service_object_data_del(Eldbus_Service_Interface *iface, const char *key)
{
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
- return edbus_data_del(&(((EDBus_Service_Object *)iface->obj)->data), key);
+ return eldbus_data_del(&(((Eldbus_Service_Object *)iface->obj)->data), key);
}
static Eina_Bool
_idler_propschanged(void *data)
{
- EDBus_Service_Interface *iface = data;
- EDBus_Message *msg;
- EDBus_Message_Iter *main_iter, *dict, *array_invalidate;
+ Eldbus_Service_Interface *iface = data;
+ Eldbus_Message *msg;
+ Eldbus_Message_Iter *main_iter, *dict, *array_invalidate;
Eina_Hash *added = NULL;
Property *prop;
iface->idler_propschanged = NULL;
added = eina_hash_string_small_new(NULL);
- msg = edbus_message_signal_new(iface->obj->path, properties_iface->name,
+ msg = eldbus_message_signal_new(iface->obj->path, properties_iface->name,
properties_iface->signals[0].name);
EINA_SAFETY_ON_NULL_GOTO(msg, error);
- main_iter = edbus_message_iter_get(msg);
- if (!edbus_message_iter_arguments_append(main_iter, "sa{sv}", iface->name, &dict))
+ main_iter = eldbus_message_iter_get(msg);
+ if (!eldbus_message_iter_arguments_append(main_iter, "sa{sv}", iface->name, &dict))
{
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
goto error;
}
@@ -1299,10 +1299,10 @@ _idler_propschanged(void *data)
goto invalidate;
while ((prop = eina_array_pop(iface->props_changed)))
{
- EDBus_Message_Iter *entry, *var;
- EDBus_Message *error_reply = NULL;
+ Eldbus_Message_Iter *entry, *var;
+ Eldbus_Message *error_reply = NULL;
Eina_Bool ret;
- EDBus_Property_Get_Cb getter = NULL;
+ Eldbus_Property_Get_Cb getter = NULL;
if (eina_hash_find(added, prop->property->name))
continue;
@@ -1317,32 +1317,32 @@ _idler_propschanged(void *data)
continue;
EINA_SAFETY_ON_FALSE_GOTO(
- edbus_message_iter_arguments_append(dict, "{sv}", &entry), error);
+ eldbus_message_iter_arguments_append(dict, "{sv}", &entry), error);
- edbus_message_iter_basic_append(entry, 's', prop->property->name);
- var = edbus_message_iter_container_new(entry, 'v',
+ eldbus_message_iter_basic_append(entry, 's', prop->property->name);
+ var = eldbus_message_iter_container_new(entry, 'v',
prop->property->type);
ret = getter(iface, prop->property->name, var, NULL, &error_reply);
if (!ret)
{
- edbus_message_unref(msg);
+ eldbus_message_unref(msg);
if (error_reply)
{
ERR("Error reply was set without pass any input message.");
- edbus_message_unref(error_reply);
+ eldbus_message_unref(error_reply);
}
ERR("Getter of property %s returned error.", prop->property->name);
goto error;
}
- edbus_message_iter_container_close(entry, var);
- edbus_message_iter_container_close(dict, entry);
+ eldbus_message_iter_container_close(entry, var);
+ eldbus_message_iter_container_close(dict, entry);
}
invalidate:
- edbus_message_iter_container_close(main_iter, dict);
+ eldbus_message_iter_container_close(main_iter, dict);
- edbus_message_iter_arguments_append(main_iter, "as", &array_invalidate);
+ eldbus_message_iter_arguments_append(main_iter, "as", &array_invalidate);
if (!iface->prop_invalidated)
goto end;
@@ -1350,13 +1350,13 @@ invalidate:
{
if (!prop->is_invalidate)
continue;
- edbus_message_iter_basic_append(array_invalidate, 's',
+ eldbus_message_iter_basic_append(array_invalidate, 's',
prop->property->name);
}
end:
- edbus_message_iter_container_close(main_iter, array_invalidate);
+ eldbus_message_iter_container_close(main_iter, array_invalidate);
- edbus_service_signal_send(iface, msg);
+ eldbus_service_signal_send(iface, msg);
error:
if (added)
eina_hash_free(added);
@@ -1368,11 +1368,11 @@ error:
}
EAPI Eina_Bool
-edbus_service_property_changed(const EDBus_Service_Interface *interface, const char *name)
+eldbus_service_property_changed(const Eldbus_Service_Interface *interface, const char *name)
{
Property *prop;
- EDBus_Service_Interface *iface = (EDBus_Service_Interface *)interface;
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
+ Eldbus_Service_Interface *iface = (Eldbus_Service_Interface *)interface;
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
prop = eina_hash_find(iface->properties, name);
@@ -1387,12 +1387,12 @@ edbus_service_property_changed(const EDBus_Service_Interface *interface, const c
}
EAPI Eina_Bool
-edbus_service_property_invalidate_set(const EDBus_Service_Interface *interface, const char *name, Eina_Bool is_invalidate)
+eldbus_service_property_invalidate_set(const Eldbus_Service_Interface *interface, const char *name, Eina_Bool is_invalidate)
{
Property *prop;
- EDBus_Service_Interface *iface = (EDBus_Service_Interface *) interface;
+ Eldbus_Service_Interface *iface = (Eldbus_Service_Interface *) interface;
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
prop = eina_hash_find(iface->properties, name);
@@ -1419,10 +1419,10 @@ edbus_service_property_invalidate_set(const EDBus_Service_Interface *interface,
}
EAPI Eina_Bool
-edbus_service_object_manager_attach(EDBus_Service_Interface *iface)
+eldbus_service_object_manager_attach(Eldbus_Service_Interface *iface)
{
- EDBus_Service_Object *obj;
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
+ Eldbus_Service_Object *obj;
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
obj = iface->obj;
@@ -1452,12 +1452,12 @@ edbus_service_object_manager_attach(EDBus_Service_Interface *iface)
}
EAPI Eina_Bool
-edbus_service_object_manager_detach(EDBus_Service_Interface *iface)
+eldbus_service_object_manager_detach(Eldbus_Service_Interface *iface)
{
- EDBus_Service_Object *obj;
+ Eldbus_Service_Object *obj;
Eina_Bool ret;
- EDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
+ ELDBUS_SERVICE_INTERFACE_CHECK_RETVAL(iface, EINA_FALSE);
obj = iface->obj;
/* Flush our iface_added/iface_removed before our ObjectManager goes away */
@@ -1470,6 +1470,6 @@ edbus_service_object_manager_detach(EDBus_Service_Interface *iface)
obj->introspection_dirty = EINA_TRUE;
//properties + introspectable
if (eina_hash_population(iface->obj->interfaces) < 3)
- edbus_service_object_unregister(iface);
+ eldbus_service_object_unregister(iface);
return ret;
}
diff --git a/src/lib/eldbus/eldbus_service.h b/src/lib/eldbus/eldbus_service.h
new file mode 100644
index 0000000000..f36903bab1
--- /dev/null
+++ b/src/lib/eldbus/eldbus_service.h
@@ -0,0 +1,219 @@
+#ifndef ELDBUS_SERVICE_H
+#define ELDBUS_SERVICE_H 1
+
+/**
+ * @defgroup Eldbus_Service Service
+ * @ingroup Eldbus
+ *
+ * @{
+ */
+#define ELDBUS_METHOD_FLAG_DEPRECATED 1
+#define ELDBUS_METHOD_FLAG_NOREPLY (1 << 1)
+
+#define ELDBUS_SIGNAL_FLAG_DEPRECATED 1
+
+#define ELDBUS_PROPERTY_FLAG_DEPRECATED 1
+
+typedef struct _Eldbus_Arg_Info
+{
+ const char *signature;
+ const char *name;
+} Eldbus_Arg_Info;
+
+/**
+ * @brief Used to insert complete types to signature of methods or signals.
+ *
+ * Example: ELDBUS_ARGS({"s", "interface"}, {"s", "property"})
+ * The signature will be "ss" and each string will have a tag name on
+ * introspect XML with the respective name.
+ */
+#define ELDBUS_ARGS(args...) (const Eldbus_Arg_Info[]){ args, { NULL, NULL } }
+
+typedef struct _Eldbus_Service_Interface Eldbus_Service_Interface;
+typedef Eldbus_Message * (*Eldbus_Method_Cb)(const Eldbus_Service_Interface *iface, const Eldbus_Message *message);
+
+/**
+ * Callback function to append property value to message.
+ *
+ * @param iface interface of property
+ * @param propname name of property
+ * @param iter variant iterator in which value must be appended
+ * @param request_msg message that request property
+ * @param error if a error happen you must set a message error to be send caller
+ *
+ * @return EINA_TRUE if success
+ *
+ * @note request_msg and error arguments are only different from NULL when a
+ * client request a property with Properties.Get or Properties.GetAll. Upon
+ * calls to eldbus_service_property_changed(), this callback will also be called.
+ * It's a mistake to return an error in this case because if a property changed,
+ * it must have a new value set and it should be able to be read.
+ */
+typedef Eina_Bool (*Eldbus_Property_Get_Cb)(const Eldbus_Service_Interface *iface, const char *propname, Eldbus_Message_Iter *iter, const Eldbus_Message *request_msg, Eldbus_Message **error);
+
+/**
+ * Callback function to set property value from message.
+ *
+ * @param iface interface of property
+ * @param propname name of property
+ * @param input_msg message call where you have to get value
+ *
+ * @return Message of response, could be a simple method_return, error or NULL to send response later.
+ */
+typedef Eldbus_Message *(*Eldbus_Property_Set_Cb)(const Eldbus_Service_Interface *iface, const char *propname, Eldbus_Message_Iter *iter, const Eldbus_Message *input_msg);
+
+typedef struct _Eldbus_Method
+{
+ const char *member;
+ const Eldbus_Arg_Info *in;
+ const Eldbus_Arg_Info *out;
+ Eldbus_Method_Cb cb;
+ unsigned int flags;
+} Eldbus_Method;
+
+typedef struct _Eldbus_Signal
+{
+ const char *name;
+ const Eldbus_Arg_Info *args;
+ unsigned int flags;
+} Eldbus_Signal;
+
+typedef struct _Eldbus_Property
+{
+ const char *name;
+ const char *type;
+ Eldbus_Property_Get_Cb get_func;
+ Eldbus_Property_Set_Cb set_func;
+ unsigned int flags;
+} Eldbus_Property;
+
+typedef struct _Eldbus_Service_Interface_Desc
+{
+ const char *interface; /**< interface name */
+ const Eldbus_Method *methods; /**< array of the methods that should be registered in this interface, the last item of array should be filled with NULL */
+ const Eldbus_Signal *signals; /**< array of signal that this interface send, the last item of array should be filled with NULL */
+ const Eldbus_Property *properties; /**< array of property that this interface have, the last item of array should be filled with NULL */
+ const Eldbus_Property_Get_Cb default_get; /**< default get function, if a property don't have a get function this will be used */
+ const Eldbus_Property_Set_Cb default_set; /**< default set function, if a property don't have a set function this will be used */
+} Eldbus_Service_Interface_Desc;
+
+/**
+ * @brief Register an interface in the given path and connection.
+ *
+ * @param conn where the interface should listen
+ * @param path object path
+ * @param desc description of interface
+ *
+ * @return Interface
+ */
+EAPI Eldbus_Service_Interface *eldbus_service_interface_register(Eldbus_Connection *conn, const char *path, const Eldbus_Service_Interface_Desc *desc) EINA_ARG_NONNULL(1, 2, 3);
+
+/**
+ * @brief Unregister a interface.
+ * If this is the last interface of the object path, the object path will be
+ * removed too.
+ */
+EAPI void eldbus_service_interface_unregister(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Unregister all interfaces of the object path that this interface belongs
+ * and the object path.
+ */
+EAPI void eldbus_service_object_unregister(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1);
+EAPI Eldbus_Connection *eldbus_service_connection_get(const Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+EAPI const char *eldbus_service_object_path_get(const Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Emit a signal handler of the interface with non-complex types.
+ * Each signal handler have a internal id, the first signal handler of
+ * interface is = 0 the second = 1 and go on.
+ *
+ * @param iface interface of the signal
+ * @param signal_id id of signal
+ * @param ... values that will be send on signal
+ */
+EAPI Eina_Bool eldbus_service_signal_emit(const Eldbus_Service_Interface *iface, unsigned int signal_id, ...) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Create signal message.
+ * Each signal handler have a internal id, the first signal handler of
+ * interface is = 0 the second = 1 and go on.
+ * This function is used when the signal has complex types.
+ *
+ * @param iface interface of the signal
+ * @param signal_id id of signal
+ */
+EAPI Eldbus_Message *eldbus_service_signal_new(const Eldbus_Service_Interface *iface, unsigned int signal_id) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Send a signal message.
+ *
+ * On success this will call eldbus_message_unref() on the @param signal_msg,
+ * which is the intended behavior in 99% of the cases. Remember to increment
+ * the refcount if you want to keep it alive.
+ */
+EAPI Eina_Bool eldbus_service_signal_send(const Eldbus_Service_Interface *iface, Eldbus_Message *signal_msg) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Store data at object path, this data can be obtained from all interfaces
+ * of the same object.
+ *
+ * @param iface interface that belong to the object path where data will
+ * be stored
+ * @param key to identify data
+ * @param data
+ */
+EAPI void eldbus_service_object_data_set(Eldbus_Service_Interface *iface, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
+
+/**
+ * @brief Get data stored in object path.
+ *
+ * @param iface interface that belongs to the object path where data are stored
+ * @param key that identify data
+ *
+ * @return pointer to data if found otherwise NULL
+ */
+EAPI void *eldbus_service_object_data_get(const Eldbus_Service_Interface *iface, const char *key) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT;
+
+/**
+ * @brief Del data stored in object path.
+ *
+ * @param iface interface that belongs to the object path where data are stored
+ * @param key that identify data
+ *
+ * @return pointer to data if found otherwise NULL
+ */
+EAPI void *eldbus_service_object_data_del(Eldbus_Service_Interface *iface, const char *key) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * @brief Add property to list of changed properties
+ * A DBus.PropertiesChanged signal will be sent in an idler with all properties
+ * that have changed.
+ *
+ * @param iface Interface containing the changed property
+ * @param name Property name
+ */
+EAPI Eina_Bool eldbus_service_property_changed(const Eldbus_Service_Interface *iface, const char *name) EINA_ARG_NONNULL(1, 2);
+
+EAPI Eina_Bool eldbus_service_property_invalidate_set(const Eldbus_Service_Interface *iface, const char *name, Eina_Bool is_invalidate) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * Attach ObjectManager interface.
+ *
+ * @param iface ObjectManager will be attach in object path of this interface.
+ * @return EINA_TRUE if success
+ */
+EAPI Eina_Bool eldbus_service_object_manager_attach(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1);
+
+/**
+ * Detach