e_test_helper: Support method to set base, configured output resolution 98/312998/1
authorJunseok Kim <juns.kim@samsung.com>
Thu, 13 Jun 2024 07:08:57 +0000 (16:08 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 18 Jun 2024 07:07:23 +0000 (16:07 +0900)
Change-Id: I7ea7b3e0ecc06c3e89337daebd3b2bd9a4381b4f

src/bin/debug/e_test_helper.c

index 2e46a22..d69a8f6 100644 (file)
@@ -11,6 +11,7 @@
 #include "e_info_server_intern.h"
 #include "e_utils_intern.h"
 #include "e_hints_intern.h"
+#include "e_appinfo_intern.h"
 
 #define BUS "org.enlightenment.wm"
 #define PATH "/org/enlightenment/wm"
@@ -76,6 +77,8 @@ static Eldbus_Message *_e_test_helper_cb_set_render_condition(const Eldbus_Servi
 static Eldbus_Message *_e_test_helper_cb_add_supported_aux_hint(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
 static Eldbus_Message *_e_test_helper_cb_del_supported_aux_hint(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
 static Eldbus_Message *_e_test_helper_cb_get_aux_hint(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
+static Eldbus_Message *_e_test_helper_cb_set_configured_output_resolution(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
+static Eldbus_Message *_e_test_helper_cb_set_base_output_resolution(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
 static Eina_Bool _e_test_helper_cb_img_render(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
 static Eina_Bool _e_test_helper_cb_effect_start(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
 static Eina_Bool _e_test_helper_cb_effect_end(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
@@ -312,6 +315,18 @@ static const Eldbus_Method methods[] ={
           ELDBUS_ARGS({"iss", "id, name, value"}),
           _e_test_helper_cb_get_aux_hint, 0,
        },
+       {
+          "SetConfiguredOutputResolution",
+          ELDBUS_ARGS({"iii", "set or unset, width, height of configured output resolution"}),
+          ELDBUS_ARGS({"i", "configured output resolution is set or not"}),
+          _e_test_helper_cb_set_configured_output_resolution, 0,
+       },
+       {
+          "SetBasedOutputResolution",
+          ELDBUS_ARGS({"iiii", "window ID, set or unset, width, height of configured output resolution"}),
+          ELDBUS_ARGS({"i", "configured output resolution is set or not"}),
+          _e_test_helper_cb_set_base_output_resolution, 0,
+       },
        { }
 };
 
@@ -1606,6 +1621,72 @@ fin:
    return reply;
 }
 
+static Eldbus_Message *
+_e_test_helper_cb_set_configured_output_resolution(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+   Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   int set = 0, w = 0, h = 0;
+
+   if (!eldbus_message_arguments_get(msg, "iii", &set, &w, &h))
+     {
+        ERR("error on eldbus_message_arguments_get()\n");
+        goto fin;
+     }
+
+   if (!th_data) goto fin;
+
+   e_config->configured_output_resolution.use = set;
+   if (set)
+     {
+        e_config->configured_output_resolution.w = w;
+        e_config->configured_output_resolution.h = h;
+        ELOGF("TEST", "set configutred output resolution to %dx%d", NULL, w, h);
+     }
+   else
+     ELOGF("TEST", "unset configutred output resolution", NULL);
+
+fin:
+   eldbus_message_arguments_append(reply, "i", set);
+
+   return reply;
+}
+
+static Eldbus_Message *
+_e_test_helper_cb_set_base_output_resolution(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+   Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   pid_t pid = 0;
+   E_Appinfo *eai = NULL;
+   int set = 0, w = 0, h = 0;
+
+   if (!eldbus_message_arguments_get(msg, "iiii", &pid, &set, &w, &h))
+     {
+        ERR("error on eldbus_message_arguments_get()\n");
+        goto fin;
+     }
+
+   if (!th_data) goto fin;
+   if (pid <= 0) goto fin;
+
+   eai = e_appinfo_find_with_pid(pid);
+
+   if (set)
+     {
+        e_appinfo_base_output_resolution_set(eai, w, h);
+        ELOGF("TEST", "set base output resolution of eai(pid:%d): %p to %dx%d", NULL, pid, eai, w, h);
+     }
+   else
+     {
+        e_appinfo_base_output_resolution_set(eai, 0, 0);
+        ELOGF("TEST", "unset base output resolution of eai(pid:%d): %p", NULL, pid, eai);
+     }
+
+fin:
+   eldbus_message_arguments_append(reply, "i", set);
+
+   return reply;
+}
+
 static Eina_Bool
 _e_test_helper_cb_img_render(void *data EINA_UNUSED,
                              int type EINA_UNUSED,