#include "e.h"
#include "e_screen_reader_private.h"
#include "e_dispatch_gesture_event.h"
+#include "e_mod_utils.h"
#define STEP_DURATION 0.01
}
static Eldbus_Message *
-_correct_coordinates(Point *point, int steps, const Eldbus_Message *msg)
+_correct_coordinates(Point *start_point, Point *end_point, int steps, const Eldbus_Message *msg)
{
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 (point->x < 0 || point->y < 0 || point->x > zone->w || point->y > zone->h || steps < 1)
+ if (start_point->x < 0 || start_point->y < 0 || start_point->x > zone->w || start_point->y > zone->h || steps < 1)
{
- ERROR("Invalid value: start.x: %d, start.y: %d, steps: %d", point->x, point->y, steps);
+ ERROR("Invalid value: start.x: %d, start.y: %d, steps: %d", start_point->x, start_point->y, steps);
return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "Invalid starting coordinates or steps number");
}
+ _transform_coordinates(&start_point->x, &start_point->y);
+ _transform_coordinates(&end_point->x, &end_point->y);
+
// Starting gesture from edge causes additional gesture on the screen
- if (point->x == 0) point->x += 1;
- if (point->x == zone->w) point->x -= 1;
- if (point->y == 0) point->y += 1;
- if (point->y == zone->h) point->y -= 1;
+ if (start_point->x == 0) start_point->x += 1;
+ if (start_point->x == zone->w) start_point->x -= 1;
+ if (start_point->y == 0) start_point->y += 1;
+ if (start_point->y == zone->h) start_point->y -= 1;
return NULL;
}
Eldbus_Message *
_e_dispatch_drag_event(DragInfo drag_info, Eldbus_Connection *conn, const Eldbus_Message *msg)
{
- Eldbus_Message *error_message = _correct_coordinates(&drag_info.start, drag_info.steps, msg);
+ Eldbus_Message *error_message = _correct_coordinates(&drag_info.start, &drag_info.end, drag_info.steps, msg);
if (error_message)
return error_message;
if (pinch_info.radius_change < 0)
_swap_points(&temporary_drag_info[i].start, &temporary_drag_info[i].end);
- Eldbus_Message *error_message = _correct_coordinates(&temporary_drag_info[i].start, temporary_drag_info[i].steps, msg);
+ Eldbus_Message *error_message = _correct_coordinates(&temporary_drag_info[i].start, &temporary_drag_info[i].end, temporary_drag_info[i].steps, msg);
if (error_message)
return error_message;
}
during_gesture = EINA_FALSE;
eldbus_connection_send(cmd->conn, cmd->reply, NULL, NULL, -1);
free(cmd);
-}
\ No newline at end of file
+}
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev_move, NULL, NULL);
}
-int __get_window_angle(void)
+int __get_and_set_window_angle(void)
{
E_Zone *zone;
return cover->angle;
}
-void __transform_coordinates(int *ax, int *ay)
+void __update_cover_and_transform_coordinates(int *ax, int *ay)
{
int win_angle, tmp;
- win_angle = __get_window_angle();
+ win_angle = __get_and_set_window_angle();
switch (win_angle) {
case 90:
tmp = *ax;
Gesture_Info *info = calloc(sizeof(Gesture_Info), 1);
EINA_SAFETY_ON_NULL_RETURN(info);
- __transform_coordinates(&x, &y);
- __transform_coordinates(&x_e, &y_e);
+ __update_cover_and_transform_coordinates(&x, &y);
+ __update_cover_and_transform_coordinates(&x_e, &y_e);
info->type = g;
info->x_beg = x;
{
int win_angle, tmp;
- win_angle = __get_window_angle();
+ win_angle = __get_and_set_window_angle();
switch (win_angle) {
case 90:
tmp = *ax;