info: add screen_rotation option to test the screen rotation 22/127322/2
authorBoram Park <boram1288.park@samsung.com>
Sun, 23 Apr 2017 03:53:16 +0000 (12:53 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 27 Apr 2017 06:40:37 +0000 (15:40 +0900)
Change-Id: Id72d8c05c10763477b1e240a4eed8c9af85d350c

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

index 28875a2..08e432d 100644 (file)
@@ -2539,6 +2539,28 @@ arg_err:
 
 }
 
+static void
+_e_info_client_proc_screen_rotation(int argc, char **argv)
+{
+   int rotation;
+
+   if (argc < 3)
+     {
+        printf("Error Check Args: enlightenment_info -screen_rotation [0|90|180|270]\n");
+        return;
+     }
+
+   rotation = atoi(argv[2]);
+   if (rotation < 0 || rotation > 360 || rotation % 90)
+     {
+        printf("Error Check Args: enlightenment_info -screen_rotation [0|90|180|270]\n");
+        return;
+     }
+
+   if (!_e_info_client_eldbus_message_with_args("screen_rotation", NULL, "i", rotation))
+     printf("_e_info_client_eldbus_message_with_args error");
+}
+
 static struct
 {
    const char *option;
@@ -2725,7 +2747,13 @@ static struct
       USAGE_FORCE_RENDER,
       "force render according to parameters",
       _e_info_client_proc_force_render
-   }
+   },
+   {
+      "screen_rotation",
+      "[0|90|180|270]",
+      "to rotate screen",
+      _e_info_client_proc_screen_rotation
+   },
 };
 
 static void
index c863e58..627b687 100644 (file)
@@ -2860,6 +2860,29 @@ _e_info_server_cb_force_render(const Eldbus_Service_Interface *iface EINA_UNUSED
    return reply;
 }
 
+static Eldbus_Message *
+_e_info_server_cb_screen_rotation(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+   Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+   int rotation;
+
+   if (!eldbus_message_arguments_get(msg, "i", &rotation))
+     {
+        ERR("Error getting arguments.");
+        return reply;
+     }
+
+   if (!e_comp || !e_comp->e_comp_screen)
+     {
+        ERR("Error no screen.");
+        return reply;
+     }
+
+   e_comp_screen_rotation_setting_set(e_comp->e_comp_screen, rotation);
+
+   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 },
    { "compobjs", NULL, ELDBUS_ARGS({"a("SIGNATURE_COMPOBJS_CLIENT")", "array of comp objs"}), _e_info_server_cb_compobjs, 0 },
@@ -2899,6 +2922,7 @@ static const Eldbus_Method methods[] = {
    { "desktop_geometry_set", ELDBUS_ARGS({"iiii", "Geometry"}), NULL, _e_info_server_cb_desktop_geometry_set, 0},
    { "desk_zoom", ELDBUS_ARGS({"ddii", "Zoom"}), NULL, _e_info_server_cb_desk_zoom, 0},
    { "frender", ELDBUS_ARGS({"i", "frender"}), ELDBUS_ARGS({"s", "force_render_result"}), _e_info_server_cb_force_render, 0},
+   { "screen_rotation", ELDBUS_ARGS({"i", "value"}), NULL, _e_info_server_cb_screen_rotation, 0},
    { NULL, NULL, NULL, NULL, 0 }
 };