Apply e_zone's interfaces 98/318498/1
authorjinbong.lee <jinbong.lee@samsung.com>
Mon, 30 Sep 2024 12:04:50 +0000 (21:04 +0900)
committerjinbong.lee <jinbong.lee@samsung.com>
Mon, 30 Sep 2024 12:04:50 +0000 (21:04 +0900)
Change-Id: If45441ef3f86354b6c0fffecc27e2b9e5a5d4ad8

src/e_dispatch_gesture_event.c
src/e_dispatch_rotation_event.c
src/e_mod_utils.c
src/e_screen_reader_gestures.c

index 87f492947b641cdafce8355c038db64db3aa8b9a..6d7de5ad561620db4ffccdf2f046b3e383bd1f70 100644 (file)
@@ -129,6 +129,7 @@ static void _dispatch_mouse_up_event(int x, int y, int device)
 static Eldbus_Message *
 _check_and_correct_gesture_data(DragInfo *drag_info, const Eldbus_Message *msg)
 {
+   int zw = 0, zh = 0;
    if (during_gesture)
      return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Previous gesture is not finished yet.");
 
@@ -136,7 +137,8 @@ _check_and_correct_gesture_data(DragInfo *drag_info, const Eldbus_Message *msg)
    if (!zone)
      return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Fail to find zone.");
 
-   if (drag_info->start.x < 0 || drag_info->start.y < 0 || drag_info->start.x > zone->w || drag_info->start.y > zone->h)
+   e_zone_useful_geometry_get(zone, NULL, NULL, &zw, &zh);
+   if (drag_info->start.x < 0 || drag_info->start.y < 0 || drag_info->start.x > zw || drag_info->start.y > zh)
       {
         char message[ERROR_BUFFER_SIZE] = {0};
         snprintf(message, ERROR_BUFFER_SIZE, "Invalid value of starting point: x: %d, y: %d. Point is outside of the viewport.", drag_info->start.x, drag_info->start.y);
@@ -157,9 +159,9 @@ _check_and_correct_gesture_data(DragInfo *drag_info, const Eldbus_Message *msg)
 
    // Starting gesture from edge causes additional gesture on the screen
    if (drag_info->start.x == 0) drag_info->start.x += 1;
-   if (drag_info->start.x == zone->w) drag_info->start.x -= 1;
+   if (drag_info->start.x == zw) drag_info->start.x -= 1;
    if (drag_info->start.y == 0) drag_info->start.y += 1;
-   if (drag_info->start.y == zone->h) drag_info->start.y -= 1;
+   if (drag_info->start.y == zh) drag_info->start.y -= 1;
 
    return NULL;
 }
index bb37f807f4472640a221e6722ec8b23c198a15e5..104aea5e0416d46255eb31ec8571ff43d6fd3735 100644 (file)
@@ -25,9 +25,9 @@ void _e_dispatch_rotation_event(int angle)
        return;
      }
 
-   zone->rot.prev = zone->rot.act;
-   zone->rot.curr = angle;
-   zone->rot.wait_for_done = EINA_TRUE;
+   e_zone_rotation_prev_angle_set(zone, e_zone_rotation_act_angle_get(zone));
+   e_zone_rotation_curr_angle_set(zone, angle);
+   e_zone_rotation_wait_for_done_set(zone, EINA_TRUE);
 
    E_Event_Zone_Rotation_Change_Begin *ev = E_NEW(E_Event_Zone_Rotation_Change_Begin, 1);
    if (ev)
index 7fab7eaef8def93c7358365c76c06ce670498efc..ade755b4768e3357ba5295e4f2c4c4d020d4977c 100644 (file)
@@ -14,11 +14,12 @@ int _get_window_angle(void)
         return -1;
      }
 
-   return zone->rot.act;
+   return e_zone_rotation_act_angle_get(zone);
 }
 
 void _transform_coordinates(int *ax, int *ay)
 {
+    int zw = 0, zh = 0;
     E_Zone *zone = e_zone_current_get();
 
     if (!zone)
@@ -27,6 +28,8 @@ void _transform_coordinates(int *ax, int *ay)
          return;
       }
 
+    e_zone_useful_geometry_get(zone, NULL, NULL, &zw, &zh);
+
     int win_angle = _get_window_angle();
     switch (win_angle) {
        case 0:
@@ -35,13 +38,13 @@ void _transform_coordinates(int *ax, int *ay)
        {
            int tmp = *ax;
            *ax = *ay;
-           *ay = zone->h - tmp;
+           *ay = zh - tmp;
            break;
        }
        case 270:
        {
            int tmp = *ax;
-           *ax = zone->w - *ay;
+           *ax = zw - *ay;
            *ay = tmp;
            break;
        }
index dd6e43c80c62ad3d08048ceeda76eaa55e6719e7..16f1c4c87f5a26f542a3cb1b83597f1e7f9ca149 100644 (file)
@@ -249,7 +249,7 @@ int __get_and_set_window_angle(void)
         return cover->angle;
      }
 
-   cover->angle = zone->rot.act;
+   cover->angle = e_zone_rotation_act_angle_get(zone);
    return cover->angle;
 }
 
@@ -1653,6 +1653,7 @@ _mouse_button_down(int type, Ecore_Event_Mouse_Button *event)
 static Eina_Bool
 _is_event_on_valid_area(int type, int x, int y, double radius)
 {
+   int zw = 0, zh = 0;
    if (radius >= MAGIC_NUMBER)
      {
         return EINA_TRUE;
@@ -1671,8 +1672,10 @@ _is_event_on_valid_area(int type, int x, int y, double radius)
    zone = e_zone_current_get();
    if (!zone) return EINA_TRUE;
 
-   /*TODO: handle zone->rot.act 90, 270 */
-   if ((y > zone->h - conf->gesture.invalid_area_size.bottom) ||
+   e_zone_useful_geometry_get(zone, NULL, NULL, &zw, &zh);
+
+   /*TODO: handle zone_rotation_act_angle 90, 270 */
+   if ((y > zh - conf->gesture.invalid_area_size.bottom) ||
        (y < conf->gesture.invalid_area_size.top ))
      {
         is_invalid_area = EINA_TRUE;
@@ -1789,6 +1792,8 @@ static void
 _gesture_init()
 {
    E_Zone *zone;
+   int zx = 0, zy = 0, zw = 0, zh = 0;
+
    zone = e_zone_current_get();
    if (!zone)
      {
@@ -1814,13 +1819,14 @@ _gesture_init()
    _last_hover_event_time = -1;
 
    /* Initialize angle value */
-   cover->angle = zone->rot.act;
+   cover->angle = e_zone_rotation_act_angle_get(zone);
 
+   e_zone_useful_geometry_get(zone, &zx, &zy, &zw, &zh);
    /* Keep device geometry information */
-   cover->zone.x = zone->x;
-   cover->zone.y = zone->y;
-   cover->zone.w = zone->w;
-   cover->zone.h = zone->h;
+   cover->zone.x = zx;
+   cover->zone.y = zy;
+   cover->zone.w = zw;
+   cover->zone.h = zh;
 
    cover->up_timer = NULL;
 }