From 094de07d9b2505e25374bf00658e02b120d7dcb8 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Tue, 28 Apr 2020 18:12:33 +0900 Subject: [PATCH] e_test_helper: add method for transient_for_below Change-Id: I7e4fe0b2868e758722ba40ed3999aa0b361b8535 --- src/bin/e_test_helper.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/bin/e_test_helper.c b/src/bin/e_test_helper.c index b247597..4510fc2 100644 --- a/src/bin/e_test_helper.c +++ b/src/bin/e_test_helper.c @@ -44,6 +44,7 @@ static Eldbus_Message *_e_test_helper_cb_activate_window(const Eldbus_Service_In static Eldbus_Message *_e_test_helper_cb_change_iconic_state(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static Eldbus_Message *_e_test_helper_cb_set_transient_for(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static Eldbus_Message *_e_test_helper_cb_unset_transient_for(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); +static Eldbus_Message *_e_test_helper_cb_set_transient_for_below(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static Eldbus_Message *_e_test_helper_cb_set_noti_level(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static Eldbus_Message *_e_test_helper_cb_set_focus_skip(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg); static Eldbus_Message *_e_test_helper_cb_get_client_info(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg); @@ -167,6 +168,12 @@ static const Eldbus_Method methods[] ={ _e_test_helper_cb_unset_transient_for, 0 }, { + "SetWindowTransientForBelow", + ELDBUS_ARGS({"uub", "child window id to set transient_for, parent window id to set transient_for, set or unset"}), + ELDBUS_ARGS({"b", "accept or not"}), + _e_test_helper_cb_set_transient_for_below, 0 + }, + { "SetWindowNotiLevel", ELDBUS_ARGS({"ui", "window id to set notification level, notification level"}), NULL, @@ -1031,6 +1038,51 @@ fin: } static Eldbus_Message* +_e_test_helper_cb_set_transient_for_below(const Eldbus_Service_Interface *iface EINA_UNUSED, + const Eldbus_Message *msg) +{ + Eldbus_Message *reply = eldbus_message_method_return_new(msg); + Ecore_Window parent = 0x0, child = 0x0; + E_Client *ec = NULL, *pec = NULL; + Eina_Bool set = EINA_FALSE; + Eina_Bool accept = EINA_FALSE; + + EINA_SAFETY_ON_NULL_GOTO(th_data, fin); + + if (!eldbus_message_arguments_get(msg, "uub", &child, &parent, &set)) + { + ERR("error on eldbus_message_arguments_get()\n"); + goto fin; + } + + if (parent && child) + { + pec = e_pixmap_find_client_by_res_id(parent); + EINA_SAFETY_ON_NULL_GOTO(pec, fin); + + ec = e_pixmap_find_client_by_res_id(child); + EINA_SAFETY_ON_NULL_GOTO(ec, fin); + + if (set) + { + ec->transient_policy = E_TRANSIENT_BELOW; + e_policy_stack_transient_for_set(ec, pec); + accept = EINA_TRUE; + } + else + { + ec->transient_policy = E_TRANSIENT_ABOVE; + e_policy_stack_transient_for_set(ec, NULL); + accept = EINA_TRUE; + } + } + +fin: + eldbus_message_arguments_append(reply, "b", accept); + return reply; +} + +static Eldbus_Message* _e_test_helper_cb_set_noti_level(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg) { -- 2.7.4