From: Doyoun Kang Date: Wed, 1 Feb 2017 07:25:31 +0000 (+0900) Subject: add code to send E_PROCESS_ACT_LAUNCH signal after launching done X-Git-Tag: accepted/tizen/3.0/common/20170203.150739~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aab487b5162f857d8f3f15a3d4f7e97c606d1460;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-processmgr.git add code to send E_PROCESS_ACT_LAUNCH signal after launching done Change-Id: I4cc789b52dfecef41ce17a5b06b8629d298a8a71 --- diff --git a/src/e_mod_processmgr.c b/src/e_mod_processmgr.c index 67bde45..4c02421 100644 --- a/src/e_mod_processmgr.c +++ b/src/e_mod_processmgr.c @@ -5,12 +5,15 @@ #define IFACE "org.enlightenment.wm.proc" static Eina_List *hooks_ec = NULL; +static Eina_List *_e_processmgr_ec_handlers = NULL; Eldbus_Connection *_e_processmgr_conn; Eldbus_Service_Interface *_e_processmgr_iface; static void _e_processmgr_process_action_send(int pid, E_Process_Action act); static void _e_processmgr_cb_hook_action_change(void *d EINA_UNUSED, E_Process *epro, void *user); static Eldbus_Message* _e_processmgr_process_info_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg); +static Eina_Bool _e_processmgr_cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); +static Eina_Bool _e_processmgr_cb_client_remove(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static const Eldbus_Method _e_processmgr_methods[] = { { "GetProcStatus", ELDBUS_ARGS({"i", "pid"}), ELDBUS_ARGS({"i","process status"}, {"i", "focused"}), _e_processmgr_process_info_get, 0 }, @@ -151,6 +154,55 @@ _e_processmgr_dbus_shutdown(void) } } +static void +_e_processmgr_cb_launch_done(void *data, Evas_Object *obj, const char *signal, const char *source) +{ + E_Client *ec; + + ec = data; + if (!ec) return; + + _e_processmgr_process_action_send(ec->netwm.pid, E_PROCESS_ACT_LAUNCH); +} + +static Eina_Bool +_e_processmgr_cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + E_Event_Client *ev; + E_Client *ec; + + ev = event; + if (!ev) return ECORE_CALLBACK_PASS_ON; + + ec = ev->ec; + e_comp_object_signal_callback_add(ec->frame, + "e,action,launch,done", + "e", + _e_processmgr_cb_launch_done, + ec); + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_processmgr_cb_client_remove(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + E_Event_Client *ev; + E_Client *ec; + + ev = event; + if (!ev) return ECORE_CALLBACK_PASS_ON; + + ec = ev->ec; + e_comp_object_signal_callback_del_full(ec->frame, + "e,action,launch,done", + "e", + _e_processmgr_cb_launch_done, + ec); + + return ECORE_CALLBACK_PASS_ON; +} + EAPI Eina_Bool e_mod_processmgr_init(void) { @@ -164,6 +216,9 @@ e_mod_processmgr_init(void) hook = e_process_hook_add(E_PROCESS_HOOK_ACTION_CHANGE, _e_processmgr_cb_hook_action_change, NULL); if (hook) hooks_ec = eina_list_append(hooks_ec, hook); + E_LIST_HANDLER_APPEND(_e_processmgr_ec_handlers, E_EVENT_CLIENT_ADD, _e_processmgr_cb_client_add, NULL); + E_LIST_HANDLER_APPEND(_e_processmgr_ec_handlers, E_EVENT_CLIENT_REMOVE, _e_processmgr_cb_client_remove, NULL); + return EINA_TRUE; } @@ -176,6 +231,7 @@ e_mod_processmgr_shutdown(void) eldbus_shutdown(); + E_FREE_LIST(_e_processmgr_ec_handlers, ecore_event_handler_del); EINA_LIST_FREE(hooks_ec, hook) e_process_hook_del(hook); }