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 {} \;
This commit is contained in:
Lucas De Marchi 2013-04-23 11:40:05 -03:00
parent 4cf68bf728
commit 4e3804041f
86 changed files with 5472 additions and 5472 deletions

28
.gitignore vendored
View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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_ \

View File

@ -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 \

View File

@ -1,5 +1,5 @@
/**
* @page edbus_examples EDBus Examples
* @page eldbus_examples Eldbus Examples
*
* Examples:
* @li @ref banshee.c

View File

@ -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).
*/

View File

@ -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

View File

@ -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)

View File

@ -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:

View File

@ -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:

View File

@ -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@

13
pc/eldbus.pc.in Normal file
View File

@ -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@

View File

@ -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 \

View File

@ -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

85
src/Makefile_Eldbus.am Normal file
View File

@ -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

View File

@ -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;
}

View File

@ -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",

View File

@ -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");