e_info: add shadow in winfo -blur_option 14/325614/2
authorhojoon-ryou <hojoon.ryou@samsung.com>
Wed, 11 Jun 2025 08:00:35 +0000 (17:00 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 13 Jun 2025 01:15:30 +0000 (01:15 +0000)
Change-Id: Id25e519c5b3e7cb0fa1bc7f02a7607ca93d896ef

src/bin/debug/e_info_client.c
src/bin/debug/e_info_server.c
src/include/e_info_shared_types.h

index 3023fd96f86042c5be3690ca7d424a23721a2749..c0a9b2c8d4a5b32a246749fdc222d0e2fb282d00 100644 (file)
@@ -6630,15 +6630,17 @@ static void
 _e_info_client_proc_edit_blur_option(int argc, char **argv)
 {
    int onoff = -1;
-   char msg_args[10][512] = {"", "", "", "", "", "", "", "", "", ""};
+   char msg_args[14][512];
    Eina_Bool res;
+
+   memset(msg_args, 0, sizeof(msg_args));
    if (argc == 2)
      {
         // print current blur_manager config
         res = _e_info_client_eldbus_message_with_args("blur_option",
                                                       _e_info_client_cb_blur_option,
-                                                      "sissssssssss",
-                                                      "", -1, "", "", "", "", "", "", "", "", "", "");
+                                                      "sissssssssssssss",
+                                                      "", -1, "", "", "", "", "", "", "", "", "", "", "", "", "", "");
         if (!res) printf("Error occured while sending message\n\n");
      }
    else if (argc > 3)
@@ -6662,11 +6664,12 @@ _e_info_client_proc_edit_blur_option(int argc, char **argv)
           }
         res = _e_info_client_eldbus_message_with_args("blur_option",
                                                       _e_info_client_cb_blur_option,
-                                                      "sissssssssss",
+                                                      "sissssssssssssss",
                                                       argv[2], onoff,
                                                       msg_args[0], msg_args[1], msg_args[2], msg_args[3],
                                                       msg_args[4], msg_args[5], msg_args[6], msg_args[7],
-                                                      msg_args[8], msg_args[9]);
+                                                      msg_args[8], msg_args[9], msg_args[10], msg_args[11],
+                                                      msg_args[12], msg_args[13]);
         if (!res) printf("Error occured while sending message\n\n");
      }
    return;
index ee97e3b0b558bde80c29c730d8c226ddaeff2d7d..2c19d81764a1609e8fe8dce6f18646f4baef00f5 100644 (file)
@@ -7138,17 +7138,19 @@ _e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED,
 {
    Eldbus_Message *reply;
    const char *config_target = NULL;
-   const char *param[10] = {0};
+   const char *param[14] = {0};
    int onoff = -1;
    char msg_to_client[4096] = {0};
    Eina_Bool res;
    E_Blur_Dim_Config dim_config;
    E_Blur_Stroke_Config stroke_config;
+   E_Blur_Shadow_Config shadow_config;
 
-   if (!eldbus_message_arguments_get(msg, "sissssssssss", &config_target, &onoff,
+   if (!eldbus_message_arguments_get(msg, "sissssssssssssss", &config_target, &onoff,
                                      &param[0], &param[1], &param[2], &param[3],
                                      &param[4], &param[5], &param[6], &param[7],
-                                     &param[8], &param[9]))
+                                     &param[8], &param[9], &param[10], &param[11],
+                                     &param[12], &param[13]))
      {
         return eldbus_message_error_new(msg, GET_CALL_MSG_ARG_ERR,
                                         "blur_option: failed to get arguments from method call message\n");
@@ -7159,6 +7161,7 @@ _e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED,
      {
         e_blur_dim_config_get(&dim_config);
         e_blur_stroke_config_get(&stroke_config);
+        e_blur_shadow_config_get(&shadow_config);
         snprintf(msg_to_client, sizeof(msg_to_client), "Current setting:\n"
                                                        "DIM - enabled:%d\n"
                                                        "      color.r:%d\n"
@@ -7170,12 +7173,23 @@ _e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED,
                                                        "              .g:%d\n"
                                                        "              .b:%d\n"
                                                        "              .a:%d\n"
-                                                       "         thickness:%d\n",
+                                                       "         thickness:%d\n"
+                                                       "SHADOW - enabled:%d\n"
+                                                       "         color.r:%d\n"
+                                                       "              .g:%d\n"
+                                                       "              .b:%d\n"
+                                                       "              .a:%d\n"
+                                                       "         shadow_blur_radius:%d\n"
+                                                       "         offsetX:%d\n"
+                                                       "         offsetY:%d\n",
                                                        dim_config.enabled,
                                                        dim_config.color.r, dim_config.color.g, dim_config.color.b, dim_config.color.a,
                                                        stroke_config.enabled,
                                                        stroke_config.color.r, stroke_config.color.g, stroke_config.color.b, stroke_config.color.a,
-                                                       stroke_config.thickness);
+                                                       stroke_config.thickness,
+                                                       shadow_config.enabled,
+                                                       shadow_config.color.r, shadow_config.color.g, shadow_config.color.b, shadow_config.color.a,
+                                                       shadow_config.blur_radius, shadow_config.offsetX, shadow_config.offsetY);
      }
 
    else if (!strncmp(config_target, "dim", 4))
@@ -7221,6 +7235,30 @@ _e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED,
           }
         e_blur_stroke_config_set(&stroke_config);
      }
+   else if (!strncmp(config_target, "shadow", 7))
+     {
+        e_blur_shadow_config_get(&shadow_config);
+        shadow_config.enabled = onoff == 1 ? EINA_TRUE : EINA_FALSE;
+        for (int i=0; i<10; i+=2)
+          {
+             int val;
+             if (!param[i] || strlen(param[i]) == 0) break;
+             res = e_util_string_to_int(param[i+1], &val, 10);
+             if (!res)
+               {
+                  snprintf(msg_to_client, sizeof(msg_to_client), "Wrong value - %s is not int\n", param[i+1]);
+                  goto reply;
+               }
+             if (!strncmp(param[i], "-R", 3)) shadow_config.color.r = val > 255 ? 255 : (val < 0 ? 0 : val);
+             if (!strncmp(param[i], "-G", 3)) shadow_config.color.g = val > 255 ? 255 : (val < 0 ? 0 : val);
+             if (!strncmp(param[i], "-B", 3)) shadow_config.color.b = val > 255 ? 255 : (val < 0 ? 0 : val);
+             if (!strncmp(param[i], "-A", 3)) shadow_config.color.a = val > 255 ? 255 : (val < 0 ? 0 : val);
+             if (!strncmp(param[i], "-shadow_blur_radius", 20)) shadow_config.blur_radius = val < 0 ? 0 : val;
+             if (!strncmp(param[i], "-offsetX", 9)) shadow_config.offsetX = val;
+             if (!strncmp(param[i], "-offsetY", 9)) shadow_config.offsetY = val;
+          }
+        e_blur_shadow_config_set(&shadow_config);
+     }
    else
      snprintf(msg_to_client, sizeof(msg_to_client),
               "Config filter %s not supported!\n", config_target);
@@ -8185,7 +8223,7 @@ static const Eldbus_Method methods[] = {
    { "input_log_enable", ELDBUS_ARGS({"i", "set input log enable"}), ELDBUS_ARGS({"s", "result message"}), _e_info_server_cb_input_log_enable, 0},
    { "use_cursor_timer", ELDBUS_ARGS({"i", "set use_cursor_timer enable"}), ELDBUS_ARGS({"s", "result message"}), _e_info_server_cb_use_cursor_timer, 0},
    { "filter", ELDBUS_ARGS({"sisss", "win_id, on(1)/off(0), filter name, param1, param2"}), ELDBUS_ARGS({"s", "result of request"}), _e_info_server_cb_filter, 0},
-   { "blur_option", ELDBUS_ARGS({"sissssssssss", "config_target, on(1)/off(0), param1, param2, ..., param10"}), ELDBUS_ARGS({"s", "result of request"}), _e_info_server_cb_blur_option, 0},
+   { "blur_option", ELDBUS_ARGS({"sissssssssssssss", "config_target, on(1)/off(0), param1, param2, ..., param14"}), ELDBUS_ARGS({"s", "result of request"}), _e_info_server_cb_blur_option, 0},
    { "gcov", ELDBUS_ARGS({"i", "option"}), NULL, _e_info_server_cb_gcov, 0},
    { "basic_op_gen", ELDBUS_ARGS({"s","window id" }, {"s", "operation"}), NULL, _e_info_server_cb_basic_operation_generate, 0},
    { "process_info", NULL, ELDBUS_ARGS({"s", "process information"}), _e_info_server_cb_process_info, 0 },
index 314f6a929e5005964ee557f5f1fc2d76efc6fe88..b99671edd1cd3553af9980315d0e874fa2025a21 100644 (file)
@@ -277,6 +277,13 @@ typedef enum
    "\t              : -B {blue}\n"                                            \
    "\t              : -A {alpha}\n"                                           \
    "\t              : -thickness {thickness}\n"                               \
+   "\tshadow options: -R {red}\n"                                             \
+   "\t              : -G {green}\n"                                           \
+   "\t              : -B {blue}\n"                                            \
+   "\t              : -A {alpha}\n"                                           \
+   "\t              : -shadow_blur_radius {shadow_blur_radius}\n"             \
+   "\t              : -offsetX {offsetX}\n"                                   \
+   "\t              : -offsetY {offsetY}\n"                                   \
    "Example:\n"                                                               \
    "\twinfo -blur_option dim on -R 15\n"                                      \
    "\twinfo -blur_option dim on -G 15\n"                                      \
@@ -288,6 +295,10 @@ typedef enum
    "\twinfo -blur_option stroke on -thickness 4\n"                            \
    "\twinfo -blur_option stroke on -R 15 -G 15 -B 15 -A 153 -thickness 4\n"   \
    "\twinfo -blur_option stroke off\n"                                        \
+   "\twinfo -blur_option shadow on -shadow_blur_radius 20\n"                  \
+   "\twinfo -blur_option shadow on -offsetX -5 -offsetY 10\n"                 \
+   "\twinfo -blur_option shadow on -R 15 -G 15 -B 15 -A 153\n"                \
+   "\twinfo -blur_option shadow off\n"                                        \
 
 /* -------------------------------------------------------------------------- */
 /* DESK GROUP                                                                 */