e_test_helper: add method for transient_for_below 13/232113/2 submit/tizen/20200429.003603
authorJunseok, Kim <juns.kim@samsung.com>
Tue, 28 Apr 2020 09:12:33 +0000 (18:12 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 29 Apr 2020 00:31:01 +0000 (00:31 +0000)
Change-Id: I7e4fe0b2868e758722ba40ed3999aa0b361b8535

src/bin/e_test_helper.c

index b247597c90d4ff752cb8fd2c2009110226cc4f62..4510fc2dbb2dd2a1d6032f71f49f6ece835872de 100644 (file)
@@ -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);
@@ -166,6 +167,12 @@ static const Eldbus_Method methods[] ={
           ELDBUS_ARGS({"b", "accept or not"}),
           _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"}),
@@ -1030,6 +1037,51 @@ fin:
    return reply;
 }
 
+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)