From b8dbc2fa0e7cbaa22eec75a18b7b329270c3e816 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 2 Jan 2013 13:15:58 +0000 Subject: [PATCH] e: small fixes to e_msgbus conversion to edbus SVN revision: 81981 --- src/bin/e_msgbus.c | 124 +++++++++------------------- src/modules/msgbus/msgbus_audit.c | 6 +- src/modules/msgbus/msgbus_desktop.c | 53 ++++-------- 3 files changed, 60 insertions(+), 123 deletions(-) diff --git a/src/bin/e_msgbus.c b/src/bin/e_msgbus.c index 000ef8134..4ff255368 100644 --- a/src/bin/e_msgbus.c +++ b/src/bin/e_msgbus.c @@ -48,108 +48,64 @@ E_MSGBUS_WIN_ACTION_CB_PROTO(unmaximize); static E_Msgbus_Data *_e_msgbus_data = NULL; static const EDBus_Method core_methods[] = { - { - "Restart", NULL, NULL, _e_msgbus_core_restart_cb, 0 - }, - { - "Shutdown", NULL, NULL, _e_msgbus_core_shutdown_cb, 0 - }, - { NULL, NULL, NULL, NULL, 0 } + { "Restart", NULL, NULL, _e_msgbus_core_restart_cb }, + { "Shutdown", NULL, NULL, _e_msgbus_core_shutdown_cb }, + { } }; static const EDBus_Method module_methods[] = { - { - "Load", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_load_cb, 0 - }, - { - "Unload", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_unload_cb, 0 - }, - { - "Enable", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_enable_cb, 0 - }, - { - "Disable", EDBUS_ARGS({"s", "module"}), NULL, - _e_msgbus_module_disable_cb, 0 - }, - { - "List", NULL, EDBUS_ARGS({"a(si)", "array_of_modules"}), - _e_msgbus_module_list_cb, 0 - }, - { NULL, NULL, NULL, NULL, 0 } + { "Load", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_load_cb }, + { "Unload", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_unload_cb }, + { "Enable", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_enable_cb }, + { "Disable", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_disable_cb }, + { "List", NULL, EDBUS_ARGS({"a(si)", "modules"}), + _e_msgbus_module_list_cb }, + { } }; static const EDBus_Method profile_methods[] = { - { - "Set", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_set_cb, 0 - }, - { - "Get", NULL, EDBUS_ARGS({"s", "profile"}), _e_msgbus_profile_get_cb, 0 - }, - { - "List", NULL, EDBUS_ARGS({"as", "array_profiles"}), - _e_msgbus_profile_list_cb, 0 - }, - { - "Add", EDBUS_ARGS({"s", "profile"}), NULL, - _e_msgbus_profile_add_cb, 0 - }, - { - "Delete", EDBUS_ARGS({"s", "profile"}), NULL, - _e_msgbus_profile_delete_cb, 0 - }, - { NULL, NULL, NULL, NULL, 0 } + { "Set", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_set_cb }, + { "Get", NULL, EDBUS_ARGS({"s", "profile"}), _e_msgbus_profile_get_cb }, + { "List", NULL, EDBUS_ARGS({"as", "array_profiles"}), + _e_msgbus_profile_list_cb }, + { "Add", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_add_cb }, + { "Delete", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_delete_cb }, + { } }; static const EDBus_Method window_methods[] = { - { - "List", NULL, EDBUS_ARGS({"a(si)", "array_of_window"}), - _e_msgbus_window_list_cb, 0 - }, - { - "Close", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_close_cb, 0 - }, - { - "Kill", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_kill_cb, 0 - }, - { - "Focus", EDBUS_ARGS({"i", "window_id"}), - NULL, _e_msgbus_window_focus_cb, 0 - }, - { - "Iconify", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_iconify_cb, 0 - }, - { - "Uniconify", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_uniconify_cb, 0 - }, - { - "Maximize", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_maximize_cb, 0 - }, - { - "Unmaximize", EDBUS_ARGS({"i", "window_id"}), NULL, - _e_msgbus_window_unmaximize_cb, 0 - }, - { NULL, NULL, NULL, NULL, 0 } + { "List", NULL, EDBUS_ARGS({"a(si)", "array_of_window"}), + _e_msgbus_window_list_cb }, + { "Close", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_close_cb }, + { "Kill", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_kill_cb }, + { "Focus", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_focus_cb }, + { "Iconify", EDBUS_ARGS({"i", "window_id"}), NULL, + _e_msgbus_window_iconify_cb }, + { "Uniconify", EDBUS_ARGS({"i", "window_id"}), NULL, + _e_msgbus_window_uniconify_cb }, + { "Maximize", EDBUS_ARGS({"i", "window_id"}), NULL, + _e_msgbus_window_maximize_cb }, + { "Unmaximize", EDBUS_ARGS({"i", "window_id"}), NULL, + _e_msgbus_window_unmaximize_cb }, + { } }; #define PATH "/org/enlightenment/wm/RemoteObject" static const EDBus_Service_Interface_Desc core_desc = { - "org.enlightenment.wm.Core", core_methods, NULL, NULL, NULL, NULL + "org.enlightenment.wm.Core", core_methods }; static const EDBus_Service_Interface_Desc module_desc = { - "org.enlightenment.wm.Module", module_methods, NULL, NULL, NULL, NULL + "org.enlightenment.wm.Module", module_methods }; static const EDBus_Service_Interface_Desc profile_desc = { - "org.enlightenment.wm.Profile", profile_methods, NULL, NULL, NULL, NULL + "org.enlightenment.wm.Profile", profile_methods }; static const EDBus_Service_Interface_Desc window_desc = { - "org.enlightenment.wm.Window", window_methods, NULL, NULL, NULL, NULL + "org.enlightenment.wm.Window", window_methods }; /* externally accessible functions */ @@ -208,23 +164,21 @@ _e_msgbus_request_name_cb(void *data __UNUSED__, const EDBus_Message *msg, EDBus_Pending *pending __UNUSED__) { unsigned int flag; + if (edbus_message_error_get(msg, NULL, NULL)) { - printf("Error requesting bus name.\n"); + ERR("Could not request bus name"); return; } if (!edbus_message_arguments_get(msg, "u", &flag)) { - printf("Error getting arguments on on_name_request\n"); + ERR("Could not get arguments on on_name_request"); return; } if (!(flag & EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER)) - { - printf("error name already in use\n"); - return; - } + ERR("Name already in use\n"); } /* Core Handlers */ diff --git a/src/modules/msgbus/msgbus_audit.c b/src/modules/msgbus/msgbus_audit.c index 014cf083d..c880cba82 100644 --- a/src/modules/msgbus/msgbus_audit.c +++ b/src/modules/msgbus/msgbus_audit.c @@ -28,12 +28,12 @@ cb_audit_timer_dump(const EDBus_Service_Interface *iface __UNUSED__, } static const EDBus_Method methods[] = { - { "Timers", NULL, EDBUS_ARGS({"s", ""}), cb_audit_timer_dump, 0 }, - { NULL, NULL, NULL, NULL, 0 } + { "Timers", NULL, EDBUS_ARGS({"s", ""}), cb_audit_timer_dump }, + { } }; static const EDBus_Service_Interface_Desc audit = { - "org.enlightenment.wm.Audit", methods, NULL, NULL, NULL, NULL + "org.enlightenment.wm.Audit", methods }; void msgbus_audit_init(Eina_Array *ifaces) diff --git a/src/modules/msgbus/msgbus_desktop.c b/src/modules/msgbus/msgbus_desktop.c index 76d0a6d08..2fb41e7cc 100644 --- a/src/modules/msgbus/msgbus_desktop.c +++ b/src/modules/msgbus/msgbus_desktop.c @@ -184,50 +184,33 @@ cb_desktop_bglist(const EDBus_Service_Interface *iface __UNUSED__, } static const EDBus_Method desktop_methods[] = { - { - "GetVirtualCount", NULL, EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}), - cb_virtual_desktops, 0 - }, - { - "Show", EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}), - NULL, cb_desktop_show, 0 - }, - { - "ShowByName", EDBUS_ARGS({"s", "desk_name"}), NULL, - cb_desktop_show_by_name, 0 - }, - { - "Lock", NULL, NULL, cb_desktop_lock, 0 - }, - { - "Unlock", NULL, NULL, cb_desktop_unlock, 0 - }, - { NULL, NULL, NULL, NULL, 0 } + { "GetVirtualCount", NULL, EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}), + cb_virtual_desktops }, + { "Show", EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}), NULL, + cb_desktop_show }, + { "ShowByName", EDBUS_ARGS({"s", "desk_name"}), NULL, + cb_desktop_show_by_name }, + { "Lock", NULL, NULL, cb_desktop_lock }, + { "Unlock", NULL, NULL, cb_desktop_unlock }, + { } }; static const EDBus_Method background_methods[] = { - { - "Add", - EDBUS_ARGS({"i", "container"}, {"i", "zone"}, {"i", "desk_x"}, {"i", "desk_y"}, {"s", "path"}), - NULL, cb_desktop_bgadd, 0 - }, - { - "Del", EDBUS_ARGS({"i", "container"}, {"i", "zone"}, {"i", "desk_x"}, {"i", "desk_y"}), - NULL, cb_desktop_bgdel, 0 - }, - { - "List", EDBUS_ARGS({"a(iiiis)", "array_of_bg"}), NULL, - cb_desktop_bglist, 0 - }, - { NULL, NULL, NULL, NULL, 0 } + { "Add", + EDBUS_ARGS({"i", "container"}, {"i", "zone"}, {"i", "desk_x"}, {"i", "desk_y"}, {"s", "path"}), + NULL, cb_desktop_bgadd }, + { "Del", EDBUS_ARGS({"i", "container"}, {"i", "zone"}, {"i", "desk_x"}, {"i", "desk_y"}), + NULL, cb_desktop_bgdel }, + { "List", EDBUS_ARGS({"a(iiiis)", "array_of_bg"}), NULL, cb_desktop_bglist }, + { } }; static const EDBus_Service_Interface_Desc desktop = { - "org.enlightenment.wm.Desktop", desktop_methods, NULL, NULL, NULL, NULL + "org.enlightenment.wm.Desktop", desktop_methods }; static const EDBus_Service_Interface_Desc bg = { - "org.enlightenment.wm.Desktop.Background", background_methods, NULL, NULL, NULL, NULL + "org.enlightenment.wm.Desktop.Background", background_methods }; void msgbus_desktop_init(Eina_Array *ifaces)