add dbus method org.enlightenment.wm.Core.Version

returns VERSION as in config.h
call: enlightenment_remote -version
devs/devilhorns/xwayland
Jérémy Zurcher 9 years ago
parent 28ac706fb0
commit 4ba2359ce9
  1. 11
      data/tools/enlightenment_remote
  2. 13
      src/bin/e_msgbus.c

@ -16,6 +16,7 @@ OPTIONS:
--h This help
--help-new Info about this tool
-version Show Enlightenment Version
-restart Restart Enlightenment
-exit Exit Enlightenment
@ -219,6 +220,13 @@ er_lock(){
ERC org.enlightenment.wm.Desktop.Lock
}
#-------------------------------------------------------------------------------
# E Version
#-------------------------------------------------------------------------------
er_version(){
ERGS org.enlightenment.wm.Core.Version
}
#-------------------------------------------------------------------------------
# E Restart
#-------------------------------------------------------------------------------
@ -436,6 +444,9 @@ case "$1" in
--help-new)
show_help_new_tool
;;
-version)
er_version
;;
-restart)
er_restart
;;

@ -4,6 +4,8 @@
static void _e_msgbus_request_name_cb(void *data, const Eldbus_Message *msg,
Eldbus_Pending *pending);
static Eldbus_Message *_e_msgbus_core_version_cb(const Eldbus_Service_Interface *iface,
const Eldbus_Message *msg);
static Eldbus_Message *_e_msgbus_core_restart_cb(const Eldbus_Service_Interface *iface,
const Eldbus_Message *msg);
static Eldbus_Message *_e_msgbus_core_shutdown_cb(const Eldbus_Service_Interface *iface,
@ -48,6 +50,7 @@ E_MSGBUS_WIN_ACTION_CB_PROTO(unmaximize);
static E_Msgbus_Data *_e_msgbus_data = NULL;
static const Eldbus_Method core_methods[] = {
{ "Version", NULL, ELDBUS_ARGS({"s", "version"}), _e_msgbus_core_version_cb },
{ "Restart", NULL, NULL, _e_msgbus_core_restart_cb },
{ "Shutdown", NULL, NULL, _e_msgbus_core_shutdown_cb },
{ }
@ -182,6 +185,16 @@ _e_msgbus_request_name_cb(void *data __UNUSED__, const Eldbus_Message *msg,
}
/* Core Handlers */
static Eldbus_Message *
_e_msgbus_core_version_cb(const Eldbus_Service_Interface *iface __UNUSED__,
const Eldbus_Message *msg)
{
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL);
eldbus_message_arguments_append(reply, "s", VERSION);
return reply;
}
static Eldbus_Message *
_e_msgbus_core_restart_cb(const Eldbus_Service_Interface *iface __UNUSED__,
const Eldbus_Message *msg)

Loading…
Cancel
Save