From: hojoon-ryou Date: Thu, 22 May 2025 12:26:23 +0000 (+0900) Subject: e_info: add new winfo process blur_option X-Git-Tag: accepted/tizen/unified/20250610.081850~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=517363003da45a302fa2219e16faf08d7102f03f;p=platform%2Fupstream%2Fenlightenment.git e_info: add new winfo process blur_option Change-Id: I99ec19045ae6795c872c7a0fa93c56effa462a06 --- diff --git a/src/bin/debug/e_info_client.c b/src/bin/debug/e_info_client.c index bc2d5d39f2..90924f4df8 100644 --- a/src/bin/debug/e_info_client.c +++ b/src/bin/debug/e_info_client.c @@ -6605,6 +6605,67 @@ usage: printf("Usage: %s", USAGE_FILTER); } +static void +_e_info_client_cb_blur_option(const Eldbus_Message *msg) +{ + + const char *name = NULL, *text = NULL; + Eina_Bool res; + const char *reply; + + res = eldbus_message_error_get(msg, &name, &text); + EINA_SAFETY_ON_TRUE_GOTO(res, finish); + + res = eldbus_message_arguments_get(msg, "s", &reply); + printf("%s\n", reply); + +finish: + if ((name) || (text)) + { + printf("errname:%s errmsg:%s\n", name, text); + }; +} + +static void +_e_info_client_proc_edit_blur_option(int argc, char **argv) +{ + int onoff = -1; + char msg_args[8][32] = {"", "", "", "", "", "", "", ""}; + 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, "", "", "", "", "", "", "", ""); + if (!res) printf("Error occured while sending message\n\n"); + } + else if (argc > 3) + { + // filter target - argv[2] + // onoff - argv[3] + EINA_SAFETY_ON_FALSE_GOTO((!strncmp(argv[3], "on", 3)) || + (!strncmp(argv[3], "off", 4)) || + (!strncmp(argv[3], "1", 2)) || + (!strncmp(argv[3], "0", 2)), usage); + if (!strncmp(argv[3], "on", 3) || !strncmp(argv[3], "1", 2)) onoff = 1; + else onoff = 0; + for (int idx = 4; idx < argc; ++idx) + strncpy(msg_args[idx-4], argv[idx], sizeof(msg_args[idx-4])); + res = _e_info_client_eldbus_message_with_args("blur_option", + _e_info_client_cb_blur_option, + "sissssssss", + 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]); + if (!res) printf("Error occured while sending message\n\n"); + } + return; +usage: + printf("Usage: %s", USAGE_BLUR_OPTION); +} + static void _e_info_client_proc_mtrace(int argc, char **argv) { @@ -7703,6 +7764,12 @@ static ProcInfo procs_to_execute[] = "apply filter option to windows", _e_info_client_proc_apply_filter }, + { + "blur_option", + USAGE_BLUR_OPTION, + "edit blur configs", + _e_info_client_proc_edit_blur_option + }, { "gcov", NULL, diff --git a/src/bin/debug/e_info_server.c b/src/bin/debug/e_info_server.c index 0064cafa59..84e5cb03d2 100644 --- a/src/bin/debug/e_info_server.c +++ b/src/bin/debug/e_info_server.c @@ -45,6 +45,7 @@ #include "e_comp_canvas.h" #include "e_view_intern.h" #include "e_view_client_intern.h" +#include "e_blur.h" #include "e_blur_intern.h" #include "e_blur_video_capture_intern.h" #include "e_compositor_intern.h" @@ -7132,6 +7133,69 @@ reply: return reply; } +static Eldbus_Message * +_e_info_server_cb_blur_option(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg) +{ + Eldbus_Message *reply; + const char *config_target = NULL; + const char *param[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; + int onoff = -1; + char msg_to_client[125] = {0}; + Eina_Bool res; + E_Blur_Dim_Config dim_config; + + if (!eldbus_message_arguments_get(msg, "sissssssss", &config_target, &onoff, + ¶m[0], ¶m[1], ¶m[2], ¶m[3], ¶m[4], ¶m[5], ¶m[6], ¶m[7])) + { + return eldbus_message_error_new(msg, GET_CALL_MSG_ARG_ERR, + "blur_option: failed to get arguments from method call message\n"); + } + reply = eldbus_message_method_return_new(msg); + + if (onoff == -1) + { + e_blur_dim_config_get(&dim_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", + dim_config.enabled, + dim_config.color.r, dim_config.color.g, dim_config.color.b, dim_config.color.a); + } + + if (!strncmp(config_target, "dim", 4)) + { + e_blur_dim_config_get(&dim_config); + dim_config.enabled = onoff == 1 ? EINA_TRUE : EINA_FALSE; + for (int i=0; i<8; 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 || val > 255) + { + 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)) dim_config.color.r = val; + if (!strncmp(param[i], "-G", 3)) dim_config.color.g = val; + if (!strncmp(param[i], "-B", 3)) dim_config.color.b = val; + if (!strncmp(param[i], "-A", 3)) dim_config.color.a = val; + } + e_blur_dim_config_set(&dim_config); + } + else + snprintf(msg_to_client, sizeof(msg_to_client), + "Config filter %s not supported!\n", config_target); + +reply: + eldbus_message_arguments_append(reply, "s", msg_to_client); + + return reply; +} + static Eldbus_Message * _e_info_server_cb_mtrace(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg) { @@ -7960,6 +8024,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}, { "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 }, diff --git a/src/include/e_info_shared_types.h b/src/include/e_info_shared_types.h index 0406e57c4b..69dcf72928 100644 --- a/src/include/e_info_shared_types.h +++ b/src/include/e_info_shared_types.h @@ -262,6 +262,23 @@ typedef enum "\twinfo -filter 0xabcabcde blur on\n" \ "\twinfo -filter 0xbcaa11aa grayscale off\n" \ +/* -------------------------------------------------------------------------- */ +/* BLUR_OPTION */ +/* -------------------------------------------------------------------------- */ +#define USAGE_BLUR_OPTION \ + "-blur_option {dim} {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" \ + "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 off\n" \ + /* -------------------------------------------------------------------------- */ /* DESK GROUP */ /* -------------------------------------------------------------------------- */