e_info : add bgcolor_set command to change the background color of enlightenment... 81/172481/5
authorSung-Jin Park <sj76.park@samsung.com>
Wed, 14 Mar 2018 06:36:20 +0000 (15:36 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Wed, 14 Mar 2018 06:54:56 +0000 (06:54 +0000)
Change-Id: If136e250ec143f11ac78a9c246e0f637048371ff
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/bin/e_info_client.c
src/bin/e_info_server.c

index 403cfad70ce22facb7e90a4e0d1e6691a245d2e3..0baba527170d7c670b80024fe013cf761097c687 100644 (file)
@@ -2119,6 +2119,37 @@ _opt_parse(char *opt, char *delims, int *vals, int n_vals)
    return EINA_TRUE;
 }
 
+static void
+_e_info_client_proc_bgcolor_set(int argc, char **argv)
+{
+   int r = 0, g = 0, b = 0, a = 0;
+   char delims_col[] = { ',', ',', ',', '\0' };
+   int vals_col[] = { 0, 0, 0, 0};
+   Eina_Bool res;
+
+   if (argc < 2)
+     goto error_msg;
+
+   res = _opt_parse(argv[2], delims_col, vals_col, (sizeof(vals_col) / sizeof(int)));
+
+   if (!res)
+     goto error_msg;
+
+   a = vals_col[0];
+   r = vals_col[1];
+   g = vals_col[2];
+   b = vals_col[3];
+
+   printf("(A, R, G, B) : %d, %d, %d, %d\n", a, r, g, b);
+
+   _e_info_client_eldbus_message_with_args("bgcolor_set", NULL, "iiii", a, r, g, b);
+   return;
+
+error_msg:
+   printf("Wrong argument(s)! (<a>,<r>,<g>,<b>)\n");
+   return;
+}
+
 static void
 _e_info_client_proc_punch(int argc, char **argv)
 {
@@ -4444,6 +4475,11 @@ static struct
       "Print connected input devices",
       _e_info_client_proc_input_device_info
    },
+   {
+      "bgcolor_set", "[<a>,<r>,<g>,<b>]",
+      "Set the background color of enlightenment canvas",
+      _e_info_client_proc_bgcolor_set
+   },
    {
       "punch", "[on/off] [<X>x<H>+<X>+<Y>] [<a>,<r>,<g>,<b>]",
       "HWC should be disabled first with \"-hwc\" option. Punch a UI framebuffer [on/off].",
index 9b542e19dc0fb240e04094b852a5ee7caa2e5ac0..5de435d6b6dbe4351bad1e1d5b21ea74b0ee8b8d 100644 (file)
@@ -3185,6 +3185,30 @@ _e_info_server_cb_keygrab_status_get(const Eldbus_Service_Interface *iface EINA_
    return reply;
 }
 
+static Eldbus_Message *
+_e_info_server_cb_bgcolor_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+   int a, r, g, b;
+   int pa, pr, pg, pb;
+   Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(reply, NULL);
+
+   if (!eldbus_message_arguments_get(msg, "iiii", &a, &r, &g, &b))
+     {
+        ERR("Error on getting argument from the given message.");
+        return reply;
+     }
+
+   evas_object_color_get(e_comp->bg_blank_object, &pa, &pr, &pg, &pb);
+   evas_object_color_set(e_comp->bg_blank_object, r, g, b, a);
+
+   INF("The background color of bg_blank_object has been changed.");
+   INF("(A, R, G, B) : %d, %d, %d, %d -> %d, %d, %d, %d", pa, pr, pg, pb, a, r, g, b);
+
+   return reply;
+}
+
 static Eldbus_Message *
 _e_info_server_cb_punch(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
 {
@@ -5303,6 +5327,7 @@ static const Eldbus_Method methods[] = {
    { "get_input_devices", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_INPUTDEV")", "array of input"}), _e_info_server_cb_input_device_info_get, 0},
    { "protocol_trace", ELDBUS_ARGS({"s", "protocol_trace"}), NULL, _e_info_server_cb_protocol_trace, 0},
    { "protocol_rule", ELDBUS_ARGS({"sss", "protocol_rule"}), ELDBUS_ARGS({"s", "rule request"}), _e_info_server_cb_protocol_rule, 0},
+   { "bgcolor_set", ELDBUS_ARGS({"iiii", "bgcolor_set"}), NULL, _e_info_server_cb_bgcolor_set, 0},
    { "punch", ELDBUS_ARGS({"iiiiiiiii", "punch_geometry"}), NULL, _e_info_server_cb_punch, 0},
    { "transform_message", ELDBUS_ARGS({"siiiiiiii", "transform_message"}), NULL, e_info_server_cb_transform_message, 0},
    { "dump_buffers", ELDBUS_ARGS({"iisdi", "start"}), NULL, _e_info_server_cb_buffer_dump, 0 },