Add effect enable/disable function in the enlightenment_info
authorSeungjin Park <sj8808.park@samsung.com>
Wed, 18 May 2016 08:51:21 +0000 (17:51 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 25 May 2016 11:10:06 +0000 (20:10 +0900)
Signed-off-by: Seungjin Park <sj8808.park@samsung.com>
Change-Id: I32b3dd5138851cb6ebeb52fc2ac7c7ae96cd4e56

src/bin/e_info_client.c
src/bin/e_info_server.c

index a2e74a4cdf716654185774a41417b7f84a7494b6..8eebc664c5312a66306606fe114a7f2a3fdf0daf 100644 (file)
@@ -1193,6 +1193,31 @@ _e_info_client_proc_hwc_trace(int argc, char **argv)
 }
 #endif
 
+static void
+_e_info_client_proc_effect_control(int argc, char **argv)
+{
+   uint32_t onoff;
+
+   if (argc < 3)
+     {
+        printf("Error Check Args: enlightenment_info -effect [1: on, 0: off]\n");
+        return;
+     }
+
+   onoff = atoi(argv[2]);
+
+   if (onoff == 1 || onoff == 0)
+     {
+        if (!_e_info_client_eldbus_message_with_args("effect_control", NULL, "i", onoff))
+          {
+             printf("_e_info_client_eldbus_message_with_args error");
+             return;
+          }
+     }
+   else
+     printf("Error Check Args: enlightenment_info -effect [1: on, 0: off]\n");
+}
+
 static struct
 {
    const char *option;
@@ -1296,6 +1321,12 @@ static struct
       "Print a current keymap",
       _e_info_client_proc_keymap_info
    },
+   {
+      "effect",
+      "[on: 1, off: 0]",
+      "On/Off the window effect",
+      _e_info_client_proc_effect_control
+   }
 };
 
 static void
index 6519871fb0fdaf82364fc52f045e87942ae305bc..86291f7078099bc9f4b49841bdc86f06b410d74e 100644 (file)
@@ -1267,6 +1267,40 @@ e_info_server_cb_hwc_trace_message(const Eldbus_Service_Interface *iface EINA_UN
 }
 #endif
 
+static Eldbus_Message *
+e_info_server_cb_effect_control(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+   Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   uint32_t onoff;
+   E_Module *m;
+
+   if (!eldbus_message_arguments_get(msg, "i", &onoff))
+     {
+        ERR("Error getting arguments.");
+        return reply;
+     }
+
+   m = e_module_find("e-mod-tizen-effect");
+
+   if (onoff == 1)
+     {
+        if (!m)
+          m = e_module_new("e-mod-tizen-effect");
+        if (m)
+          e_module_enable(m);
+     }
+   else if (onoff == 0)
+     {
+        if (m)
+          {
+             e_module_disable(m);
+             e_object_del(E_OBJECT(m));
+          }
+     }
+
+   return reply;
+}
+
 static const Eldbus_Method methods[] = {
    { "get_window_info", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_TOPVWINS")", "array of ec"}), _e_info_server_cb_window_info_get, 0 },
    { "dump_topvwins", ELDBUS_ARGS({"s", "directory"}), NULL, _e_info_server_cb_topvwins_dump, 0 },
@@ -1290,6 +1324,7 @@ static const Eldbus_Method methods[] = {
    { "hwc_trace_message", ELDBUS_ARGS({"i", "hwc_trace_message"}), NULL, e_info_server_cb_hwc_trace_message, 0},
 #endif
    { "get_keymap", NULL, ELDBUS_ARGS({"hi", "keymap fd"}), _e_info_server_cb_keymap_info_get, 0},
+   { "effect_control", ELDBUS_ARGS({"i", "effect_control"}), NULL, e_info_server_cb_effect_control, 0},
    { NULL, NULL, NULL, NULL, 0 }
 };