e_client: remove codes related to ec->transformed 54/321954/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 1 Apr 2025 08:38:34 +0000 (17:38 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 1 Apr 2025 10:00:39 +0000 (19:00 +0900)
ec->transformed is always disabled, so the code related to it is removed.
and ec->transform structure is also deprecated.

Change-Id: Ic4c5074eb4353d91862da241c48b9e4de815783a

src/bin/core/e_client.c
src/bin/debug/e_info_server.c
src/bin/windowmgr/e_policy_desk_area.c
src/include/e_client.h

index 393b30aa01a7c47e8ec770f815e39a794592f939..d318163d85d8cbccbccaf02462cdbdad44d91daa 100644 (file)
@@ -505,314 +505,6 @@ _e_client_action_finish(void)
    action_client = NULL;
 }
 
-static void
-_e_client_transform_point_transform(int cx, int cy, double angle, int x, int y, int *tx, int *ty)
-{
-   double s = sin(angle * M_PI / 180);
-   double c = cos(angle * M_PI / 180);
-   int rx, ry;
-
-   x -= cx;
-   y -= cy;
-
-   rx = x * c + y * s;
-   ry = - x * s + y * c;
-
-   rx += cx;
-   ry += cy;
-
-   *tx = rx;
-   *ty = ry;
-}
-
-static void
-_e_client_transform_geometry_save(E_Client *ec, E_Map *map)
-{
-   int i;
-
-   if (!map) return;
-
-   for (i = 0; i < 4; i ++)
-     {
-        e_map_point_precise_coord_get(map, i,
-                                      &ec->transform.saved[i].x,
-                                      &ec->transform.saved[i].y,
-                                      &ec->transform.saved[i].z);
-     }
-}
-
-static void
-_e_client_transform_resize(E_Client *ec)
-{
-   E_Map *map;
-   int cx, cy;
-   double dx = 0, dy = 0;
-   double px[4], py[4];
-   int pw, ph;
-   int i;
-
-   if (!ec->transformed) return;
-
-   if (!e_pixmap_size_get(ec->pixmap, &pw, &ph))
-     {
-        pw = ec->client.w;
-        ph = ec->client.h;
-     }
-
-   cx = ec->client.x + pw / 2;
-   cy = ec->client.y + ph / 2;
-
-   /* step 1: Rotate resized object and get map points */
-   map = e_map_new_with_direct_render(ec->transform_core.direct_render);
-   e_map_util_points_populate_from_geometry(map,
-                                            ec->client.x, ec->client.y,
-                                            pw, ph,
-                                            0);
-   e_map_util_rotate(map, ec->transform.angle, cx, cy);
-   e_map_util_zoom(map, ec->transform.zoom, ec->transform.zoom, cx, cy);
-
-   for (i = 0; i < 4; i++)
-     e_map_point_precise_coord_get(map, i, &px[i], &py[i], NULL);
-
-   e_map_free(map);
-
-   /* step 2: get adjusted values to keep up fixed position according
-    * to resize mode */
-   switch (ec->resize_mode)
-     {
-      case E_POINTER_RESIZE_R:
-      case E_POINTER_RESIZE_BR:
-         dx = ec->transform.saved[0].x - px[0];
-         dy = ec->transform.saved[0].y - py[0];
-         break;
-      case E_POINTER_RESIZE_BL:
-      case E_POINTER_RESIZE_B:
-         dx = ec->transform.saved[1].x - px[1];
-         dy = ec->transform.saved[1].y - py[1];
-         break;
-      case E_POINTER_RESIZE_TL:
-      case E_POINTER_RESIZE_L:
-         dx = ec->transform.saved[2].x - px[2];
-         dy = ec->transform.saved[2].y - py[2];
-         break;
-      case E_POINTER_RESIZE_T:
-      case E_POINTER_RESIZE_TR:
-         dx = ec->transform.saved[3].x - px[3];
-         dy = ec->transform.saved[3].y - py[3];
-         break;
-      default:
-         break;
-     }
-
-   ec->transform.adjusted.x = dx;
-   ec->transform.adjusted.y = dy;
-
-   /* step 3: set each points of the quadrangle */
-   map = e_map_new_with_direct_render(ec->transform_core.direct_render);
-   e_map_util_points_populate_from_object_full(map, ec->frame, 0);
-
-   for (i = 0; i < 4; i++)
-      e_map_point_precise_coord_set(map, i, px[i] + dx, py[i] + dy, 0);
-
-   e_client_map_set(ec, map);
-   e_client_map_enable_set(ec, EINA_TRUE);
-   e_map_free(map);
-}
-
-static void
-_e_client_transform_resize_handle(E_Client *ec)
-{
-
-   int new_x, new_y, new_w, new_h;
-   int org_w, org_h;
-   int button_id;
-   int cx, cy;
-   Evas_Point current, moveinfo;
-   E_Zone *zone;
-
-   if (e_object_is_del(E_OBJECT(ec))) return;
-   if (e_client_util_ignored_get(ec)) return;
-   if (!ec->transformed) return;
-
-   zone = e_comp_zone_find_by_ec(ec);
-   if (!zone) return;
-
-   button_id = ec->moveinfo.down.button;
-
-   org_w = ec->mouse.last_down[button_id - 1].w;
-   org_h = ec->mouse.last_down[button_id - 1].h;
-
-   new_w = ec->client.w;
-   new_h = ec->client.h;
-   new_x = ec->client.x;
-   new_y = ec->client.y;
-
-   /* step 1: get center coordinate its' based on original object geometry*/
-   cx = ec->client.x + org_w / 2;
-   cy = ec->client.y + org_h / 2;
-
-   /* step 2: transform coordinates of mouse position
-    * subtract adjusted value from mouse position is needed */
-   current.x = ec->mouse.current.mx - ec->transform.adjusted.x;
-   current.y = ec->mouse.current.my - ec->transform.adjusted.y;
-   moveinfo.x = ec->moveinfo.down.mx - ec->transform.adjusted.x;
-   moveinfo.y = ec->moveinfo.down.my - ec->transform.adjusted.y;
-
-   _e_client_transform_point_transform(cx, cy, ec->transform.angle,
-                                       current.x, current.y,
-                                       &current.x, &current.y);
-   _e_client_transform_point_transform(cx, cy, ec->transform.angle,
-                                       moveinfo.x, moveinfo.y,
-                                       &moveinfo.x, &moveinfo.y);
-
-   /* step 3: calculate new size */
-   if ((ec->resize_mode == E_POINTER_RESIZE_TR) ||
-       (ec->resize_mode == E_POINTER_RESIZE_R) ||
-       (ec->resize_mode == E_POINTER_RESIZE_BR))
-     {
-        if ((button_id >= 1) && (button_id <= 3))
-          new_w = org_w + (current.x - moveinfo.x);
-        else
-          new_w = ec->moveinfo.down.w + (current.x - moveinfo.x);
-     }
-   else if ((ec->resize_mode == E_POINTER_RESIZE_TL) ||
-            (ec->resize_mode == E_POINTER_RESIZE_L) ||
-            (ec->resize_mode == E_POINTER_RESIZE_BL))
-     {
-        if ((button_id >= 1) && (button_id <= 3))
-          new_w = org_w - (current.x - moveinfo.x);
-        else
-          new_w = ec->moveinfo.down.w - (current.x - moveinfo.x);
-     }
-
-   if ((ec->resize_mode == E_POINTER_RESIZE_TL) ||
-       (ec->resize_mode == E_POINTER_RESIZE_T) ||
-       (ec->resize_mode == E_POINTER_RESIZE_TR))
-     {
-        if ((button_id >= 1) && (button_id <= 3))
-          new_h = org_h - (current.y - moveinfo.y);
-        else
-          new_h = ec->moveinfo.down.h - (current.y - moveinfo.y);
-     }
-   else if ((ec->resize_mode == E_POINTER_RESIZE_BL) ||
-            (ec->resize_mode == E_POINTER_RESIZE_B) ||
-            (ec->resize_mode == E_POINTER_RESIZE_BR))
-     {
-        if ((button_id >= 1) && (button_id <= 3))
-          new_h = org_h + (current.y - moveinfo.y);
-        else
-          new_h = ec->moveinfo.down.h + (current.y - moveinfo.y);
-     }
-
-   new_w = MIN(new_w, zone->w);
-   new_h = MIN(new_h, zone->h);
-
-   /* step 4: move to new position */
-   if ((ec->resize_mode == E_POINTER_RESIZE_TL) ||
-       (ec->resize_mode == E_POINTER_RESIZE_L) ||
-       (ec->resize_mode == E_POINTER_RESIZE_BL))
-     new_x += (new_w - org_w);
-   if ((ec->resize_mode == E_POINTER_RESIZE_TL) ||
-       (ec->resize_mode == E_POINTER_RESIZE_T) ||
-       (ec->resize_mode == E_POINTER_RESIZE_TR))
-     new_y += (new_h - org_h);
-
-   /* step 5: set geometry to new value */
-   e_view_client_geometry_set(PRI(ec)->view_client, new_x, new_y, new_w, new_h);
-}
-
-void
-_e_client_transform_resize_begin(E_Client *ec)
-{
-   E_Map *map;
-   if (!ec->transformed) return;
-
-   map = e_client_map_get(ec);
-   _e_client_transform_geometry_save(ec, map);
-   e_map_free(map);
-}
-
-void
-_e_client_transform_resize_end(E_Client *ec)
-{
-   E_Map *map;
-   int new_x = 0, new_y = 0;
-   int cx, cy, pw, ph;
-
-   if (!ec->transformed) return;
-
-   map = e_client_map_get(ec);
-   if (!map) return;
-
-   if (!e_pixmap_size_get(ec->pixmap, &pw, &ph))
-     {
-        pw = ec->client.w;
-        ph = ec->client.h;
-     }
-
-   cx = ec->client.x + pw / 2 + ec->transform.adjusted.x;
-   cy = ec->client.y + ph / 2 + ec->transform.adjusted.y;
-
-   if (ec->transform.zoom != 1.0)
-     {
-        E_Map *tmp_map;
-
-        tmp_map = e_map_dup(map);
-        e_map_util_zoom(tmp_map,
-                           1 / ec->transform.zoom,
-                           1 / ec->transform.zoom,
-                           cx, cy);
-
-        _e_client_transform_geometry_save(ec, tmp_map);
-        e_map_free(tmp_map);
-     }
-   else
-     {
-        _e_client_transform_geometry_save(ec, map);
-     }
-
-   /* move original object to adjusted position after resizing */
-   _e_client_transform_point_transform(cx, cy,
-                                       ec->transform.angle,
-                                       ec->transform.saved[0].x,
-                                       ec->transform.saved[0].y,
-                                       &new_x, &new_y);
-   e_client_util_move_without_frame(ec, new_x, new_y);
-   e_map_util_object_move_sync_set(map, EINA_TRUE);
-   e_map_free(map);
-}
-
-static void
-_e_client_transform_move_end(E_Client *ec)
-{
-
-   int i;
-   double dx, dy, px, py;
-   E_Map *map;
-
-   if (!ec->transformed) return;
-
-   map = e_client_map_get(ec);
-   if (!map) return;
-
-   if (ec->transform.zoom != 1.0)
-     {
-        e_map_point_precise_coord_get(map, 0, &px, &py, NULL);
-
-        dx = px - ec->transform.saved[0].x;
-        dy = py - ec->transform.saved[0].y;
-
-        for (i = 0; i < 4; i++)
-          {
-             ec->transform.saved[i].x += dx;
-             ec->transform.saved[i].y += dy;
-          }
-     }
-   else
-     _e_client_transform_geometry_save(ec, map);
-   e_map_free(map);
-}
-
 EINTERN Eina_Bool
 e_client_intercept_hook_focus_revert_call(E_Client *ec)
 {
@@ -1343,9 +1035,6 @@ _e_client_move_end(E_Client *ec)
    wl_signal_emit(&PRI(ec)->events.move_end, NULL);
    _e_client_hook_call(E_CLIENT_HOOK_MOVE_END, ec);
 
-   if (ec->transformed)
-     _e_client_transform_move_end(ec);
-
    e_comp_client_override_del(ec);
 
    ecmove = NULL;
@@ -1512,12 +1201,6 @@ e_client_resize_handle(E_Client *ec)
    int trans_x = 0, trans_y = 0;
    int trans_w = 0, trans_h = 0;
 
-   if (ec->transformed)
-     {
-        _e_client_transform_resize_handle(ec);
-        return;
-     }
-
    x = ec->x;
    y = ec->y;
    w = ec->w;
@@ -1710,9 +1393,6 @@ e_client_resize_end(E_Client *ec)
    wl_signal_emit(&PRI(ec)->events.move_resize_end, NULL);
    _e_client_hook_call(E_CLIENT_HOOK_RESIZE_END, ec);
 
-   if (ec->transformed)
-     _e_client_transform_resize_end(ec);
-
    e_comp_client_override_del(ec);
 
    ecresize = NULL;
@@ -1941,7 +1621,6 @@ static void
 _e_client_cb_evas_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
 {
    E_Client *ec = data;
-   E_Map *map;
    Evas_Coord x, y, w, h;
    Eina_Bool update = EINA_FALSE;
 
@@ -1972,13 +1651,6 @@ _e_client_cb_evas_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
         _e_client_hook_call(E_CLIENT_HOOK_MOVE_UPDATE, ec);
      }
 
-   if ((!ec->moving) && (ec->transformed))
-     {
-        map = e_client_map_get(ec);
-        _e_client_transform_geometry_save(ec, map);
-        e_map_free(map);
-     }
-
    ec->pre_cb.x = x; ec->pre_cb.y = y;
 
    wl_signal_emit(&PRI(ec)->events.move, NULL);
@@ -3403,8 +3075,6 @@ e_client_new(E_Pixmap *cp, int first_map, int internal)
    ec->visibility.skip = 0;
    ec->visibility.last_sent_type = E_VISIBILITY_UNKNOWN;
 
-   ec->transform.zoom = 1.0;
-   ec->transform.angle = 0.0;
    ec->transform_core.direct_render = EINA_TRUE;
    ec->transform_core.activate = EINA_TRUE;
 
@@ -4850,8 +4520,7 @@ e_client_resize_begin(E_Client *ec)
 
    wl_signal_emit(&PRI(ec)->events.move_begin, NULL);
    _e_client_hook_call(E_CLIENT_HOOK_RESIZE_BEGIN, ec);
-   if (ec->transformed)
-     _e_client_transform_resize_begin(ec);
+
    if (!e_client_util_resizing_get(ec))
      {
         if (ecresize == ec) ecresize = NULL;
@@ -5014,8 +4683,7 @@ e_client_redirected_set(E_Client *ec, Eina_Bool set)
 E_API void
 e_client_transform_update(E_Client *ec)
 {
-   if (e_client_util_resizing_get(ec))
-     _e_client_transform_resize(ec);
+   // Nothing Deprecated
 }
 
 E_API Eina_Bool
index 452d063e29c87d1e106cc16c255a2f859f75bd5b..1f2e3971470b1b7a505c4a4e95faf0f84ba3873d 100644 (file)
@@ -1637,15 +1637,6 @@ _get_win_prop_Video_Client(const Evas_Object *evas_obj)
    return str;
 }
 
-static const char*
-_get_win_prop_Transformed(const Evas_Object *evas_obj)
-{
-   const E_Client *ec = evas_object_data_get(evas_obj, "E_Client");
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
-
-   return ec->transformed ? strdup("TRUE") : strdup("FALSE");
-}
-
 static const char*
 _get_win_prop_Maximize_override(const Evas_Object *evas_obj)
 {
@@ -2548,11 +2539,6 @@ static struct property_manager
         _get_win_prop_Maximize_override,
         NULL
     },
-    {
-        "Transformed",
-        _get_win_prop_Transformed,
-        NULL
-    },
     {
         "Video Client",
         _get_win_prop_Video_Client,
index 9210be5c9513aab007b0e9fd7cd6de0750973d82..e2bdee675b5b39ad3caa7c941d2024b45a993858 100644 (file)
@@ -2648,7 +2648,7 @@ _desk_area_cb_comp_object_resize(struct wl_listener *listener, void *data)
 
    /* TODO: calculate x, y with transfrom object */
    comp_wl = e_comp_wl_get();
-   if ((e_client_util_resizing_get(ec)) && (!ec->transformed) && (comp_wl->resize.edges))
+   if ((e_client_util_resizing_get(ec)) && (comp_wl->resize.edges))
      {
         int w, h;
 
index 7d5209256cdb3088742c492c42a1c294778dec9b..802a7c21137dd2144033b50289a011389b376223 100644 (file)
@@ -589,17 +589,17 @@ struct _E_Client
 
    struct
    {
-      double zoom;
-      double angle;
+      E_DEPRECATED double zoom;
+      E_DEPRECATED double angle;
 
-      Evas_Point center;
-      Evas_Point adjusted;
+      E_DEPRECATED Evas_Point center;
+      E_DEPRECATED Evas_Point adjusted;
 
       struct
       {
-         double x, y, z;
-      } saved[4];
-   } transform;
+         E_DEPRECATED double x, y, z;
+      } E_DEPRECATED saved[4];
+   } E_DEPRECATED transform;
 
    unsigned int       visible : 1; // client is set to be visible by display server (never use this)
    unsigned int       hidden : 1; // set when window has been hidden by api and should not be shown
@@ -670,7 +670,7 @@ struct _E_Client
    Eina_Bool layer_pending : 1; // change inlist stack but postpone evas stack
    Eina_Bool ignored : 1; // client is comp-ignored
    Eina_Bool maximize_override : 1; // client is doing crazy stuff and should "just do it" when moving/resizing
-   Eina_Bool transformed : 1;
+   E_DEPRECATED Eina_Bool transformed : 1;
    Eina_Bool keyboard_resizing : 1;
    Eina_Bool gesture_disable : 1;
    Eina_Bool floating : 1; //client is set as floating mode
@@ -986,7 +986,7 @@ E_API E_Util_Transform *e_client_transform_core_transform_get(E_Client *ec, int
 E_API void              e_client_transform_core_input_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
 E_API void              e_client_transform_core_input_inv_transform(E_Client *ec, int x, int y, int *out_x, int *out_y);
 E_API void              e_client_transform_core_direct_render_set(E_Client *ec, Eina_Bool set);
-E_API void              e_client_transform_update(E_Client *ec);
+E_DEPRECATED E_API void              e_client_transform_update(E_Client *ec);
 
 E_API void      e_client_base_output_resolution_transform_adjust(E_Client *ec);
 E_API Eina_Bool e_client_base_output_resolution_update(E_Client *ec);