[e_info] add ability to set 'Geometry' property
authorSergey Sizonov <s.sizonov@samsung.com>
Mon, 15 May 2017 12:33:23 +0000 (15:33 +0300)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 25 May 2017 23:26:07 +0000 (08:26 +0900)
Change-Id: Icbf86c9bb4a3d0cb8d0622e0121d1fb840dc005c
Signed-off-by: Sergey Sizonov <s.sizonov@samsung.com>
src/bin/e_info_server.c

index e45b778b779d0fce6146b9394222fb6f264db5a7..dccd6038e38b785ae8a075a4d99287080489ed59 100755 (executable)
@@ -1320,14 +1320,6 @@ _get_win_prop_Moving(const Evas_Object *evas_obj)
    return ec->moving ? strdup("TRUE") : strdup("FALSE");
 }
 
-static const char*
-_get_win_prop_Hidden(const Evas_Object *evas_obj)
-{
-   const E_Client *ec = evas_object_data_get(evas_obj, "E_Client");
-
-   return ec->hidden ? strdup("TRUE") : strdup("FALSE");
-}
-
 static const char*
 _set_win_prop_Hidden(Evas_Object *evas_obj, const char *prop_value)
 {
@@ -1341,6 +1333,14 @@ _set_win_prop_Hidden(Evas_Object *evas_obj, const char *prop_value)
    return NULL;
 }
 
+static const char*
+_get_win_prop_Hidden(const Evas_Object *evas_obj)
+{
+   const E_Client *ec = evas_object_data_get(evas_obj, "E_Client");
+
+   return ec->hidden ? strdup("TRUE") : strdup("FALSE");
+}
+
 static const char*
 _get_win_prop_32bit(const Evas_Object *evas_obj)
 {
@@ -1461,6 +1461,20 @@ _get_win_prop_ParentWindowID(const Evas_Object *evas_obj)
    return str;
 }
 
+static const char*
+_set_win_prop_Geometry(Evas_Object *evas_obj, const char *prop_value)
+{
+   int x = -1, y = -1, w = -1, h = -1;
+
+   sscanf(prop_value, "%d, %d %dx%d", &x, &y, &w, &h);
+   if (x < 0 || y < 0 || w <= 0 || h <= 0)
+     return strdup("invalid property value");
+
+   evas_object_geometry_set(evas_obj, x, y, w, h);
+
+   return NULL;
+}
+
 static const char*
 _get_win_prop_Geometry(const Evas_Object *evas_obj)
 {
@@ -1469,7 +1483,7 @@ _get_win_prop_Geometry(const Evas_Object *evas_obj)
 
    ec = evas_object_data_get(evas_obj, "E_Client");
 
-   if (asprintf(&str, "[%d, %d, %d, %d]", ec->x, ec->y, ec->w, ec->h) < 0)
+   if (asprintf(&str, "[%d, %d %dx%d]", ec->x, ec->y, ec->w, ec->h) < 0)
      return NULL;
 
    return str;
@@ -1616,7 +1630,7 @@ static struct property_manager
     {
         "Geometry",
         _get_win_prop_Geometry,
-        NULL
+        _set_win_prop_Geometry
     },
     {
         "ParentWindowID",