diff options
author | Lucas De Marchi <lucas.de.marchi@gmail.com> | 2013-01-04 14:06:22 +0000 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2013-01-04 14:06:22 +0000 |
commit | 271bc56cdd259ec86533223f7832111ae32a471a (patch) | |
tree | 0919c6c3ece76fa7ecc2e5c2dc8ce56f1f30b0e1 /src/modules/appmenu | |
parent | c83d11449164d2192ba5e8cbf90cc836879cc8c0 (diff) | |
download | enlightenment-271bc56cdd259ec86533223f7832111ae32a471a.tar.gz |
e/appmenu: sanitize method table
Patch by: Lucas De Marchi <lucas.de.marchi@gmail.com>
SVN revision: 82179
Diffstat (limited to 'src/modules/appmenu')
-rw-r--r-- | src/modules/appmenu/e_mod_dbus_registrar_server.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/modules/appmenu/e_mod_dbus_registrar_server.c b/src/modules/appmenu/e_mod_dbus_registrar_server.c index bc2b5b1a40..096b635a7f 100644 --- a/src/modules/appmenu/e_mod_dbus_registrar_server.c +++ b/src/modules/appmenu/e_mod_dbus_registrar_server.c @@ -6,11 +6,18 @@ #define ERROR_WINDOW_NOT_FOUND "com.canonical.AppMenu.Registrar.WindowNotFound" +enum +{ + SIGNAL_WINDOW_REGISTERED = 0, + SIGNAL_WINDOW_UNREGISTERED, +}; + void appmenu_application_monitor(void *data, const char *bus EINA_UNUSED, const char *old __UNUSED__, const char *new __UNUSED__) { E_AppMenu_Window *window = data; - edbus_service_signal_emit(window->ctxt->iface, 1, window->window_id); + edbus_service_signal_emit(window->ctxt->iface, SIGNAL_WINDOW_UNREGISTERED, + window->window_id); appmenu_window_free(window); } @@ -64,7 +71,8 @@ _on_register_window(const EDBus_Service_Interface *iface, const EDBus_Message *m ctxt->windows = eina_list_append(ctxt->windows, window); window->ctxt = ctxt; - edbus_service_signal_emit(iface, 0, window_id, bus_id, path); + edbus_service_signal_emit(iface, SIGNAL_WINDOW_REGISTERED, window_id, + bus_id, path); return edbus_message_method_return_new(msg); } @@ -97,7 +105,7 @@ _on_unregister_window(const EDBus_Service_Interface *iface, const EDBus_Message w = window_find(ctxt, window_id); if (w) appmenu_window_free(w); - edbus_service_signal_emit(iface, 1, window_id); + edbus_service_signal_emit(iface, SIGNAL_WINDOW_UNREGISTERED, window_id); return edbus_message_method_return_new(msg); } @@ -154,32 +162,27 @@ _on_getmenus(const EDBus_Service_Interface *iface, const EDBus_Message *msg) } static const EDBus_Method registrar_methods[] = { - { - "RegisterWindow", EDBUS_ARGS({"u", "windowId"},{"o", "menuObjectPath"}), - NULL, _on_register_window, 0 - }, - { - "UnregisterWindow", EDBUS_ARGS({"u", "windowId"}), - NULL, _on_unregister_window, 0 - }, - { - "GetMenuForWindow", EDBUS_ARGS({"u", "windowId"}), - EDBUS_ARGS({"s", "bus_id"},{"o", "menu_path"}), _on_getmenu, 0 - }, - { - "GetMenus", NULL, EDBUS_ARGS({"a(uso)", "array_of_menu"}), _on_getmenus, 0 - }, - { NULL, NULL, NULL, NULL, 0 } + { "RegisterWindow", EDBUS_ARGS({"u", "windowId"},{"o", "menuObjectPath"}), + NULL, _on_register_window }, + { "UnregisterWindow", EDBUS_ARGS({"u", "windowId"}), + NULL, _on_unregister_window }, + { "GetMenuForWindow", EDBUS_ARGS({"u", "windowId"}), + EDBUS_ARGS({"s", "bus_id"},{"o", "menu_path"}), _on_getmenu }, + { "GetMenus", NULL, EDBUS_ARGS({"a(uso)", "array_of_menu"}), _on_getmenus }, + { } }; static const EDBus_Signal registrar_signals[] = { - { "WindowRegistered", EDBUS_ARGS({"u", "windowId"}, {"s", "bus_id"}, {"o", "menu_path"}), 0 }, - { "WindowUnregistered", EDBUS_ARGS({"u", "windowId"}), 0 }, - { NULL, NULL, 0 } + [SIGNAL_WINDOW_REGISTERED] = + { "WindowRegistered", + EDBUS_ARGS({"u", "windowId"}, {"s", "bus_id"}, {"o", "menu_path"}) }, + [SIGNAL_WINDOW_UNREGISTERED] = + { "WindowUnregistered", EDBUS_ARGS({"u", "windowId"}) }, + { } }; static const EDBus_Service_Interface_Desc registrar_iface = { - REGISTRAR_IFACE, registrar_methods, registrar_signals, NULL, NULL, NULL + REGISTRAR_IFACE, registrar_methods, registrar_signals }; void |