#include "e_comp.h"
#include "e_screen_reader_private.h"
-
+#define QUICKPANEL_AREA_SIZE 40 /* area size to open/close quickpanel */
#define HISTORY_MAX 8
#define LONGPRESS_TIMEOUT 0.4
double MAGIC_NUMBER = 987654321.0;
unsigned int n_taps; /**< Number of fingers touching screen */
unsigned int event_time;
int angle;
+ Eina_Rectangle zone; // keeps E_Zone size
struct {
gesture_state_e state; // current state of gesture
unsigned int timestamp[3]; // time of gesture;
} flick_gesture;
struct {
- gesture_state_e state; // currest gesture state
+ gesture_state_e state; // current gesture state
int x[2], y[2];
int n_fingers;
int finger[2];
cov->hover_gesture.y[1] = ev->root.y;
cov->hover_gesture.finger[1] = ev->multi.device;
cov->hover_gesture.n_fingers = 2;
+
+ /* Make Quickpanel Open Easy */
+ if (((cov->hover_gesture.y[0] < cov->zone.y + QUICKPANEL_AREA_SIZE)
+ && (cov->hover_gesture.y[1] < cov->zone.y + QUICKPANEL_AREA_SIZE)) ||
+ ((cov->hover_gesture.y[0] > cov->zone.y + cov->zone.h - QUICKPANEL_AREA_SIZE)
+ && (cov->hover_gesture.y[1] > cov->zone.y + cov->zone.h - QUICKPANEL_AREA_SIZE)))
+ {
+ /* Do what _on_hover_timeout does */
+ cov->hover_gesture.longpressed = EINA_TRUE;
+ if (cov->hover_gesture.timer)
+ ecore_timer_del(cov->hover_gesture.timer);
+ cov->hover_gesture.timer = NULL;
+
+ if (cov->hover_gesture.last_emission_time == -1)
+ {
+ _hover_event_emit(cov, GESTURE_NOT_STARTED);
+ cov->hover_gesture.last_emission_time = cov->event_time;
+ }
+
+ /* start_scroll is necessary for mouse down event */
+ if (!cov->flick_gesture.flick_to_scroll) {
+ start_scroll(ev->x, ev->y, cov);
+ cov->flick_gesture.flick_to_scroll = EINA_TRUE;
+ }
+ }
}
// abort gesture if more then 2 fingers touched screen
if ((cov->hover_gesture.state == GESTURE_ONGOING) &&
cov->n_taps > 2)
{
- DEBUG("More then 2 finged. Abort hover gesture");
+ DEBUG("More than 2 fingers. Abort hover gesture");
_hover_event_emit(cov, GESTURE_FINISHED);
goto abort;
}
static void
_gesture_init()
{
+ E_Zone *ez;
E_Client *ec;
cover = E_NEW(Cover, 1);
if (!cover)
ERROR("Fatal Memory error!");
return;
}
- is_slider = EINA_FALSE;
- is_screen_reader_support = EINA_TRUE;
- highlighted_object_x = -1;
- highlighted_object_y = -1;
- scrolling = EINA_FALSE;
- ec = e_client_top_get();
- if (ec)
- {
- cover->angle = ec->e.state.rot.ang.curr;
- DEBUG("Default angle: %d", cover->angle);
- }
+ is_slider = EINA_FALSE;
+ is_screen_reader_support = EINA_TRUE;
+ highlighted_object_x = -1;
+ highlighted_object_y = -1;
+ scrolling = EINA_FALSE;
+
+ /* Initialize angle value */
+ ec = e_client_top_get();
+ if (ec)
+ {
+ cover->angle = ec->e.state.rot.ang.curr;
+ DEBUG("Default angle: %d", cover->angle);
+ }
+
+ /* Keep device geometry information */
+ ez = e_zone_current_get();
+ if (ez)
+ {
+ cover->zone.x = ez->x;
+ cover->zone.y = ez->y;
+ cover->zone.w = ez->w;
+ cover->zone.h = ez->h;
+ }
}
static void