diff --git a/legacy/ecore/src/lib/ecore_dbus/Makefile.am b/legacy/ecore/src/lib/ecore_dbus/Makefile.am index 771c9b0eee..54ffd2e892 100644 --- a/legacy/ecore/src/lib/ecore_dbus/Makefile.am +++ b/legacy/ecore/src/lib/ecore_dbus/Makefile.am @@ -24,6 +24,7 @@ ecore_dbus.c \ ecore_dbus_message.c \ ecore_dbus_marshal.c \ ecore_dbus_unmarshal.c \ +ecore_dbus_methods.c \ ecore_dbus_utils.c \ ecore_dbus_private.h diff --git a/legacy/ecore/src/lib/ecore_dbus/ecore_dbus.c b/legacy/ecore/src/lib/ecore_dbus/ecore_dbus.c index 154e0fae15..38ff0183a0 100644 --- a/legacy/ecore/src/lib/ecore_dbus/ecore_dbus.c +++ b/legacy/ecore/src/lib/ecore_dbus/ecore_dbus.c @@ -124,6 +124,7 @@ ecore_dbus_server_connect(Ecore_DBus_Type compl_type, char *name, int port, switch (type) { #if 0 + /* Get address from DBUS_SESSION_BUS_ADDRESS env */ case ECORE_DBUS_BUS_SESSION: svr->server = ecore_con_server_connect(ECORE_CON_LOCAL_USER | extra, name, port, svr); diff --git a/legacy/ecore/src/lib/ecore_dbus/ecore_dbus_methods.c b/legacy/ecore/src/lib/ecore_dbus/ecore_dbus_methods.c new file mode 100644 index 0000000000..77c86ab988 --- /dev/null +++ b/legacy/ecore/src/lib/ecore_dbus/ecore_dbus_methods.c @@ -0,0 +1,95 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +/* Standard dbus methods */ + +#include "ecore_private.h" +#include "Ecore_Con.h" +#include "Ecore_DBus.h" +#include "ecore_dbus_private.h" + +int +ecore_dbus_method_hello(Ecore_DBus_Server *svr) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "Hello" /*method*/, NULL /*fmt*/); +} + +int +ecore_dbus_method_list_names(Ecore_DBus_Server *svr) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "ListNames" /*method*/, NULL /*fmt*/); +} + +int +ecore_dbus_method_name_has_owner(Ecore_DBus_Server *svr, char *name) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "NameHasOwner" /*method*/, + "s" /*fmt*/, name); +} + +int +ecore_dbus_method_start_service_by_name(Ecore_DBus_Server *svr, char *name, unsigned int flags) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "StartServiceByName" /*method*/, + "su" /*fmt*/, name, flags); +} + +int +ecore_dbus_method_get_name_owner(Ecore_DBus_Server *svr, char *name) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "GetNameOwner" /*method*/, + "s" /*fmt*/, name); +} + +int +ecore_dbus_method_get_connection_unix_user(Ecore_DBus_Server *svr, char *connection) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "GetConnectionUnixUser" /*method*/, + "s" /*fmt*/, connection); +} + +int +ecore_dbus_method_add_match(Ecore_DBus_Server *svr, char *match) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "AddMatch" /*method*/, + "s" /*fmt*/, match); +} + +int +ecore_dbus_method_remove_match(Ecore_DBus_Server *svr, char *match) +{ + return ecore_dbus_message_new_method_call(svr, + "org.freedesktop.DBus" /*destination*/, + "/org/freedesktop/DBus" /*path*/, + "org.freedesktop.DBus" /*interface*/, + "RemoveMatch" /*method*/, + "s" /*fmt*/, match); +}