e_info: add stroke in winfo -blur_option 51/325251/1
authorhojoon-ryou <hojoon.ryou@samsung.com>
Thu, 5 Jun 2025 06:13:54 +0000 (15:13 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 5 Jun 2025 08:23:05 +0000 (17:23 +0900)
Change-Id: I6c543181eae1c80e2b8949987f2ea74902c6c204

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

index 0040ae716390c938dd105bb4a99c3f9cdcb41bd2..3023fd96f86042c5be3690ca7d424a23721a2749 100644 (file)
@@ -6630,15 +6630,15 @@ static void
 _e_info_client_proc_edit_blur_option(int argc, char **argv)
 {
    int onoff = -1;
-   char msg_args[8][512] = {"", "", "", "", "", "", "", ""};
+   char msg_args[10][512] = {"", "", "", "", "", "", "", "", "", ""};
    Eina_Bool res;
    if (argc == 2)
      {
         // print current blur_manager config
         res = _e_info_client_eldbus_message_with_args("blur_option",
                                                       _e_info_client_cb_blur_option,
-                                                      "sissssssss",
-                                                      "", -1, "", "", "", "", "", "", "", "");
+                                                      "sissssssssss",
+                                                      "", -1, "", "", "", "", "", "", "", "", "", "");
         if (!res) printf("Error occured while sending message\n\n");
      }
    else if (argc > 3)
@@ -6662,10 +6662,11 @@ _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,
-                                                      "sissssssss",
+                                                      "sissssssssss",
                                                       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[4], msg_args[5], msg_args[6], msg_args[7],
+                                                      msg_args[8], msg_args[9]);
         if (!res) printf("Error occured while sending message\n\n");
      }
    return;
index cd805fd7b156a1e10f2dc9c83b0312ac2805b1e0..9fbbdaf30acdd75558c877c9beca40c968cb70be 100644 (file)
@@ -7138,14 +7138,17 @@ _e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED,
 {
    Eldbus_Message *reply;
    const char *config_target = NULL;
-   const char *param[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
+   const char *param[10] = {0};
    int onoff = -1;
-   char msg_to_client[125] = {0};
+   char msg_to_client[4096] = {0};
    Eina_Bool res;
    E_Blur_Dim_Config dim_config;
+   E_Blur_Stroke_Config stroke_config;
 
-   if (!eldbus_message_arguments_get(msg, "sissssssss", &config_target, &onoff,
-                                     &param[0], &param[1], &param[2], &param[3], &param[4], &param[5], &param[6], &param[7]))
+   if (!eldbus_message_arguments_get(msg, "sissssssssss", &config_target, &onoff,
+                                     &param[0], &param[1], &param[2], &param[3],
+                                     &param[4], &param[5], &param[6], &param[7],
+                                     &param[8], &param[9]))
      {
         return eldbus_message_error_new(msg, GET_CALL_MSG_ARG_ERR,
                                         "blur_option: failed to get arguments from method call message\n");
@@ -7155,17 +7158,27 @@ _e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED,
    if (onoff == -1)
      {
         e_blur_dim_config_get(&dim_config);
+        e_blur_stroke_config_get(&stroke_config);
         snprintf(msg_to_client, sizeof(msg_to_client), "Current setting:\n"
                                                        "DIM - enabled:%d\n"
                                                        "      color.r:%d\n"
-                                                       "      color.g:%d\n"
-                                                       "      color.b:%d\n"
-                                                       "      color.a:%d\n",
+                                                       "           .g:%d\n"
+                                                       "           .b:%d\n"
+                                                       "           .a:%d\n"
+                                                       "STROKE - enabled:%d\n"
+                                                       "         color.r:%d\n"
+                                                       "              .g:%d\n"
+                                                       "              .b:%d\n"
+                                                       "              .a:%d\n"
+                                                       "         thickness:%d\n",
                                                        dim_config.enabled,
-                                                       dim_config.color.r, dim_config.color.g, dim_config.color.b, dim_config.color.a);
+                                                       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);
      }
 
-   if (!strncmp(config_target, "dim", 4))
+   else if (!strncmp(config_target, "dim", 4))
      {
         e_blur_dim_config_get(&dim_config);
         dim_config.enabled = onoff == 1 ? EINA_TRUE : EINA_FALSE;
@@ -7186,6 +7199,28 @@ _e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED,
           }
         e_blur_dim_config_set(&dim_config);
      }
+   else if (!strncmp(config_target, "stroke", 7))
+     {
+        e_blur_stroke_config_get(&stroke_config);
+        stroke_config.enabled = onoff == 1 ? EINA_TRUE : EINA_FALSE;
+        for (int i=0; i<10; i+=2)
+          {
+             unsigned int val;
+             if (!param[i] || strlen(param[i]) == 0) break;
+             res = e_util_string_to_uint(param[i+1], &val, 10);
+             if (!res)
+               {
+                  snprintf(msg_to_client, sizeof(msg_to_client), "Wrong value - %s is not uint\n", param[i+1]);
+                  goto reply;
+               }
+             if (!strncmp(param[i], "-R", 3)) stroke_config.color.r = val > 255 ? 255 : val;
+             if (!strncmp(param[i], "-G", 3)) stroke_config.color.g = val > 255 ? 255 : val;
+             if (!strncmp(param[i], "-B", 3)) stroke_config.color.b = val > 255 ? 255 : val;
+             if (!strncmp(param[i], "-A", 3)) stroke_config.color.a = val > 255 ? 255 : val;
+             if (!strncmp(param[i], "-thickness", 11)) stroke_config.thickness = val;
+          }
+        e_blur_stroke_config_set(&stroke_config);
+     }
    else
      snprintf(msg_to_client, sizeof(msg_to_client),
               "Config filter %s not supported!\n", config_target);
@@ -8150,7 +8185,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({"sissssssss", "config_target, on(1)/off(0), param1, param2, param3, param4, param5, param6, param7, param8"}), ELDBUS_ARGS({"s", "result of request"}), _e_info_server_cb_blur_option, 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},
    { "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 69dcf7292813a5ad7e160c936eb691c845e7479d..314f6a929e5005964ee557f5f1fc2d76efc6fe88 100644 (file)
@@ -266,18 +266,28 @@ typedef enum
 /* BLUR_OPTION                                                                   */
 /* -------------------------------------------------------------------------- */
 #define USAGE_BLUR_OPTION                                                     \
-   "-blur_option {dim} {on | off} {detail options...}\n"               \
+   "-blur_option {dim | stroke} {on | off} {detail options...}\n"             \
    "\tblur options: -radius {radius}\n"                                       \
    "\tdim options: -R {red}\n"                                                \
-   "\tdim options: -G {green}\n"                                              \
-   "\tdim options: -B {blue}\n"                                               \
-   "\tdim options: -A {alpha}\n"                                              \
+   "\t           : -G {green}\n"                                              \
+   "\t           : -B {blue}\n"                                               \
+   "\t           : -A {alpha}\n"                                              \
+   "\tstroke options: -R {red}\n"                                             \
+   "\t              : -G {green}\n"                                           \
+   "\t              : -B {blue}\n"                                            \
+   "\t              : -A {alpha}\n"                                           \
+   "\t              : -thickness {thickness}\n"                               \
    "Example:\n"                                                               \
    "\twinfo -blur_option dim on -R 15\n"                                      \
    "\twinfo -blur_option dim on -G 15\n"                                      \
    "\twinfo -blur_option dim on -B 15\n"                                      \
    "\twinfo -blur_option dim on -A 153\n"                                     \
+   "\twinfo -blur_option dim on -R 15 -G 15 -B 15 -A 153\n"                   \
    "\twinfo -blur_option dim off\n"                                           \
+   "\twinfo -blur_option stroke on -R 60\n"                                   \
+   "\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"                                        \
 
 /* -------------------------------------------------------------------------- */
 /* DESK GROUP                                                                 */