forked from enlightenment/enlightenment
e: small fixes to e_msgbus conversion to edbus
SVN revision: 81981
This commit is contained in:
parent
a84987cd60
commit
b8dbc2fa0e
|
@ -48,108 +48,64 @@ E_MSGBUS_WIN_ACTION_CB_PROTO(unmaximize);
|
||||||
static E_Msgbus_Data *_e_msgbus_data = NULL;
|
static E_Msgbus_Data *_e_msgbus_data = NULL;
|
||||||
|
|
||||||
static const EDBus_Method core_methods[] = {
|
static const EDBus_Method core_methods[] = {
|
||||||
{
|
{ "Restart", NULL, NULL, _e_msgbus_core_restart_cb },
|
||||||
"Restart", NULL, NULL, _e_msgbus_core_restart_cb, 0
|
{ "Shutdown", NULL, NULL, _e_msgbus_core_shutdown_cb },
|
||||||
},
|
{ }
|
||||||
{
|
|
||||||
"Shutdown", NULL, NULL, _e_msgbus_core_shutdown_cb, 0
|
|
||||||
},
|
|
||||||
{ NULL, NULL, NULL, NULL, 0 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Method module_methods[] = {
|
static const EDBus_Method module_methods[] = {
|
||||||
{
|
{ "Load", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_load_cb },
|
||||||
"Load", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_load_cb, 0
|
{ "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 },
|
||||||
"Unload", EDBUS_ARGS({"s", "module"}), NULL, _e_msgbus_module_unload_cb, 0
|
{ "List", NULL, EDBUS_ARGS({"a(si)", "modules"}),
|
||||||
},
|
_e_msgbus_module_list_cb },
|
||||||
{
|
{ }
|
||||||
"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 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Method profile_methods[] = {
|
static const EDBus_Method profile_methods[] = {
|
||||||
{
|
{ "Set", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_set_cb },
|
||||||
"Set", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_set_cb, 0
|
{ "Get", NULL, EDBUS_ARGS({"s", "profile"}), _e_msgbus_profile_get_cb },
|
||||||
},
|
{ "List", NULL, EDBUS_ARGS({"as", "array_profiles"}),
|
||||||
{
|
_e_msgbus_profile_list_cb },
|
||||||
"Get", NULL, EDBUS_ARGS({"s", "profile"}), _e_msgbus_profile_get_cb, 0
|
{ "Add", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_add_cb },
|
||||||
},
|
{ "Delete", EDBUS_ARGS({"s", "profile"}), NULL, _e_msgbus_profile_delete_cb },
|
||||||
{
|
{ }
|
||||||
"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 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Method window_methods[] = {
|
static const EDBus_Method window_methods[] = {
|
||||||
{
|
{ "List", NULL, EDBUS_ARGS({"a(si)", "array_of_window"}),
|
||||||
"List", NULL, EDBUS_ARGS({"a(si)", "array_of_window"}),
|
_e_msgbus_window_list_cb },
|
||||||
_e_msgbus_window_list_cb, 0
|
{ "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 },
|
||||||
"Close", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_close_cb, 0
|
{ "Iconify", EDBUS_ARGS({"i", "window_id"}), NULL,
|
||||||
},
|
_e_msgbus_window_iconify_cb },
|
||||||
{
|
{ "Uniconify", EDBUS_ARGS({"i", "window_id"}), NULL,
|
||||||
"Kill", EDBUS_ARGS({"i", "window_id"}), NULL, _e_msgbus_window_kill_cb, 0
|
_e_msgbus_window_uniconify_cb },
|
||||||
},
|
{ "Maximize", EDBUS_ARGS({"i", "window_id"}), NULL,
|
||||||
{
|
_e_msgbus_window_maximize_cb },
|
||||||
"Focus", EDBUS_ARGS({"i", "window_id"}),
|
{ "Unmaximize", EDBUS_ARGS({"i", "window_id"}), NULL,
|
||||||
NULL, _e_msgbus_window_focus_cb, 0
|
_e_msgbus_window_unmaximize_cb },
|
||||||
},
|
{ }
|
||||||
{
|
|
||||||
"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 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PATH "/org/enlightenment/wm/RemoteObject"
|
#define PATH "/org/enlightenment/wm/RemoteObject"
|
||||||
|
|
||||||
static const EDBus_Service_Interface_Desc core_desc = {
|
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 = {
|
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 = {
|
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 = {
|
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 */
|
/* externally accessible functions */
|
||||||
|
@ -208,23 +164,21 @@ _e_msgbus_request_name_cb(void *data __UNUSED__, const EDBus_Message *msg,
|
||||||
EDBus_Pending *pending __UNUSED__)
|
EDBus_Pending *pending __UNUSED__)
|
||||||
{
|
{
|
||||||
unsigned int flag;
|
unsigned int flag;
|
||||||
|
|
||||||
if (edbus_message_error_get(msg, NULL, NULL))
|
if (edbus_message_error_get(msg, NULL, NULL))
|
||||||
{
|
{
|
||||||
printf("Error requesting bus name.\n");
|
ERR("Could not request bus name");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!edbus_message_arguments_get(msg, "u", &flag))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flag & EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER))
|
if (!(flag & EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER))
|
||||||
{
|
ERR("Name already in use\n");
|
||||||
printf("error name already in use\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Core Handlers */
|
/* Core Handlers */
|
||||||
|
|
|
@ -28,12 +28,12 @@ cb_audit_timer_dump(const EDBus_Service_Interface *iface __UNUSED__,
|
||||||
}
|
}
|
||||||
|
|
||||||
static const EDBus_Method methods[] = {
|
static const EDBus_Method methods[] = {
|
||||||
{ "Timers", NULL, EDBUS_ARGS({"s", ""}), cb_audit_timer_dump, 0 },
|
{ "Timers", NULL, EDBUS_ARGS({"s", ""}), cb_audit_timer_dump },
|
||||||
{ NULL, NULL, NULL, NULL, 0 }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Service_Interface_Desc audit = {
|
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)
|
void msgbus_audit_init(Eina_Array *ifaces)
|
||||||
|
|
|
@ -184,50 +184,33 @@ cb_desktop_bglist(const EDBus_Service_Interface *iface __UNUSED__,
|
||||||
}
|
}
|
||||||
|
|
||||||
static const EDBus_Method desktop_methods[] = {
|
static const EDBus_Method desktop_methods[] = {
|
||||||
{
|
{ "GetVirtualCount", NULL, EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}),
|
||||||
"GetVirtualCount", NULL, EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}),
|
cb_virtual_desktops },
|
||||||
cb_virtual_desktops, 0
|
{ "Show", EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}), NULL,
|
||||||
},
|
cb_desktop_show },
|
||||||
{
|
{ "ShowByName", EDBUS_ARGS({"s", "desk_name"}), NULL,
|
||||||
"Show", EDBUS_ARGS({"i", "desk_x"}, {"i", "desk_y"}),
|
cb_desktop_show_by_name },
|
||||||
NULL, cb_desktop_show, 0
|
{ "Lock", NULL, NULL, cb_desktop_lock },
|
||||||
},
|
{ "Unlock", NULL, NULL, cb_desktop_unlock },
|
||||||
{
|
{ }
|
||||||
"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 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Method background_methods[] = {
|
static const EDBus_Method background_methods[] = {
|
||||||
{
|
{ "Add",
|
||||||
"Add",
|
EDBUS_ARGS({"i", "container"}, {"i", "zone"}, {"i", "desk_x"}, {"i", "desk_y"}, {"s", "path"}),
|
||||||
EDBUS_ARGS({"i", "container"}, {"i", "zone"}, {"i", "desk_x"}, {"i", "desk_y"}, {"s", "path"}),
|
NULL, cb_desktop_bgadd },
|
||||||
NULL, cb_desktop_bgadd, 0
|
{ "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 },
|
||||||
"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 }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const EDBus_Service_Interface_Desc desktop = {
|
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 = {
|
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)
|
void msgbus_desktop_init(Eina_Array *ifaces)
|
||||||
|
|
Loading…
Reference in New Issue