ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev_move, NULL, NULL);
}
-void __transform_coordinates(int *ax, int *ay, int win_angle)
+int __get_window_angle(void)
{
- int w, h, tmp;
+ E_Client *ec;
+ E_Zone *zone;
+ int x = 0, y = 0, w = 0, h = 0;
+ E_Comp_Wl_Client_Data *cdata;
+
+ zone = e_zone_current_get();
+
+ E_CLIENT_REVERSE_FOREACH(ec)
+ {
+ if (e_object_is_del(E_OBJECT(ec))) continue;
+ if (e_client_util_ignored_get(ec)) continue;
+ if (zone && ec->zone != zone) continue;
+ if (!ec->frame) continue;
+ cdata = (E_Comp_Wl_Client_Data *)ec->comp_data;
+ if (cdata && cdata->sub.data) continue;
+
+ e_client_geometry_get(ec, &x, &y, &w, &h);
+ Eina_Bool vis = evas_object_visible_get(ec->frame);
+ if (!vis) continue;
+
+ if (E_INTERSECTS(x, y, w, h,
+ zone->x, zone->y, zone->w, zone->h))
+ break;
+ }
+ if (ec)
+ {
+ cover->angle = ec->e.state.rot.ang.curr;
+ DEBUG("Window angle: %d", cover->angle);
+ }
+ else
+ ERROR("Cannot find window");
+
+ return cover->angle;
+}
+
+void __transform_coordinates(int *ax, int *ay)
+{
+ int win_angle, w, h, tmp;
+
+ win_angle = __get_window_angle();
ecore_wl_screen_size_get(&w, &h);
+
switch (win_angle) {
case 90:
tmp = *ax;
}
}
-static void _event_emit(Gesture g, int x, int y, int x_e, int y_e, gesture_state_e state, unsigned int event_time, int angle)
+static void _event_emit(Gesture g, int x, int y, int x_e, int y_e, gesture_state_e state, unsigned int event_time)
{
Gesture_Info *info = calloc(sizeof(Gesture_Info), 1);
EINA_SAFETY_ON_NULL_RETURN(info);
- __transform_coordinates(&x, &y, angle);
- __transform_coordinates(&x_e, &y_e, angle);
+ __transform_coordinates(&x, &y);
+ __transform_coordinates(&x_e, &y_e);
info->type = g;
info->x_beg = x;
if (cov->flick_gesture.n_fingers == 3)
type = THREE_FINGERS_FLICK_RIGHT_RETURN;
}
- _event_emit(type, ax, ay, axe, aye, GESTURE_FINISHED, cov->event_time, cov->angle);
+ _event_emit(type, ax, ay, axe, aye, GESTURE_FINISHED, cov->event_time);
}
static void
cov->hover_gesture.state = GESTURE_NOT_STARTED;
}
-void __inverse_transform_coordinates(int *ax, int *ay, int win_angle)
+void __inverse_transform_coordinates(int *ax, int *ay)
{
- int w, h, tmp;
+ int win_angle, w, h, tmp;
+ win_angle = __get_window_angle();
ecore_wl_screen_size_get(&w, &h);
+
switch (win_angle) {
case 90:
tmp = *ax;
{
if (highlighted_object_x != -1 && highlighted_object_y != -1)
{
- __inverse_transform_coordinates(&highlighted_object_x, &highlighted_object_y, cov->angle);
+ __inverse_transform_coordinates(&highlighted_object_x, &highlighted_object_y);
cov->tap_n_hold_gesture_data.ev_down->x = highlighted_object_x;
cov->tap_n_hold_gesture_data.ev_down->y = highlighted_object_y;
cov->tap_n_hold_gesture_data.ev_down->root.x = highlighted_object_x;
switch (cov->hover_gesture.n_fingers)
{
case 1:
- _event_emit(ONE_FINGER_HOVER, ax, ay, ax, ay, state, cov->event_time, cov->angle);
+ _event_emit(ONE_FINGER_HOVER, ax, ay, ax, ay, state, cov->event_time);
break;
case 2:
- _event_emit(TWO_FINGERS_HOVER, ax, ay, ax, ay, state, cov->event_time, cov->angle);
+ _event_emit(TWO_FINGERS_HOVER, ax, ay, ax, ay, state, cov->event_time);
break;
default:
break;
_event_emit(ONE_FINGER_SINGLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else if(cov->tap_gesture_data.tap_type == TWO_FINGERS_GESTURE)
{
_event_emit(TWO_FINGERS_SINGLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[1], cov->tap_gesture_data.y_org[1],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else if(cov->tap_gesture_data.tap_type == THREE_FINGERS_GESTURE)
{
_event_emit(THREE_FINGERS_SINGLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[2], cov->tap_gesture_data.y_org[2],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else
{
_event_emit(ONE_FINGER_DOUBLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else if(cov->tap_gesture_data.tap_type == TWO_FINGERS_GESTURE)
{
_event_emit(TWO_FINGERS_DOUBLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[1], cov->tap_gesture_data.y_org[1],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else if(cov->tap_gesture_data.tap_type == THREE_FINGERS_GESTURE)
{
_event_emit(THREE_FINGERS_DOUBLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[2], cov->tap_gesture_data.y_org[2],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else
{
_event_emit(ONE_FINGER_TRIPLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else if(cov->tap_gesture_data.tap_type == TWO_FINGERS_GESTURE)
{
_event_emit(TWO_FINGERS_TRIPLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[1], cov->tap_gesture_data.y_org[1],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else if(cov->tap_gesture_data.tap_type == THREE_FINGERS_GESTURE)
{
_event_emit(THREE_FINGERS_TRIPLE_TAP,
cov->tap_gesture_data.x_org[0], cov->tap_gesture_data.y_org[0],
cov->tap_gesture_data.x_org[2], cov->tap_gesture_data.y_org[2],
- state, cov->event_time, cov->angle);
+ state, cov->event_time);
}
else
{