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.");
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);
// 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;
}
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)
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)
return;
}
+ e_zone_useful_geometry_get(zone, NULL, NULL, &zw, &zh);
+
int win_angle = _get_window_angle();
switch (win_angle) {
case 0:
{
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;
}
return cover->angle;
}
- cover->angle = zone->rot.act;
+ cover->angle = e_zone_rotation_act_angle_get(zone);
return cover->angle;
}
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;
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;
_gesture_init()
{
E_Zone *zone;
+ int zx = 0, zy = 0, zw = 0, zh = 0;
+
zone = e_zone_current_get();
if (!zone)
{
_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;
}