2014-08-04 09:58:49 -07:00
|
|
|
#define E_COMP_X
|
2012-05-22 05:13:18 -07:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_mod_main.h"
|
2012-09-02 21:06:02 -07:00
|
|
|
#define HISTORY_MAX 8
|
2012-12-07 01:52:52 -08:00
|
|
|
#define DEBUG_INFO 1
|
2012-05-22 05:13:18 -07:00
|
|
|
|
2012-11-15 04:30:55 -08:00
|
|
|
static E_Config_DD *conf_edd = NULL;
|
|
|
|
Config *access_config = NULL;
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
E_Zone *zone;
|
|
|
|
Ecore_X_Window win;
|
|
|
|
Ecore_Timer *timer;
|
2013-01-31 20:21:03 -08:00
|
|
|
Ecore_Timer *double_down_timer;
|
2013-01-04 20:29:24 -08:00
|
|
|
Ecore_Timer *tap_timer;
|
2012-11-28 00:34:40 -08:00
|
|
|
Evas_Object *info;
|
|
|
|
Evas_Object *text;
|
2012-09-02 21:06:02 -07:00
|
|
|
int x, y, dx, dy, mx, my;
|
|
|
|
int mouse_history[HISTORY_MAX];
|
2012-05-22 05:13:18 -07:00
|
|
|
unsigned int dt;
|
2012-09-02 21:06:02 -07:00
|
|
|
Eina_Inlist *history;
|
2012-11-15 02:08:45 -08:00
|
|
|
Eina_Bool longpressed : 1;
|
2012-09-02 21:06:02 -07:00
|
|
|
Eina_Bool two_finger_down : 1;
|
2013-01-31 20:21:03 -08:00
|
|
|
Eina_Bool double_down : 1;
|
2012-05-22 05:13:18 -07:00
|
|
|
} Cover;
|
|
|
|
|
2012-12-07 01:52:52 -08:00
|
|
|
#if DEBUG_INFO
|
|
|
|
static Ecore_Timer *dbg_timer = NULL;
|
|
|
|
static Eina_Bool
|
|
|
|
_reset_text(void *data)
|
|
|
|
{
|
|
|
|
Cover *cov = data;
|
|
|
|
if(!cov) return EINA_FALSE;
|
|
|
|
|
|
|
|
ecore_timer_del(dbg_timer);
|
|
|
|
dbg_timer = NULL;
|
|
|
|
evas_object_text_text_set(cov->text, "Screen Reader Mode");
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
#define INFO(cov, txt) \
|
|
|
|
evas_object_text_text_set(cov->text, txt); \
|
|
|
|
EINA_LOG_INFO("%s", txt); \
|
|
|
|
if (dbg_timer) \
|
|
|
|
{ \
|
|
|
|
ecore_timer_del(dbg_timer); \
|
|
|
|
dbg_timer = NULL; \
|
|
|
|
} \
|
|
|
|
dbg_timer = ecore_timer_add(1.0, _reset_text, cov);
|
|
|
|
#else
|
|
|
|
#define INFO(cov, txt) EINA_LOG_INFO("%s", txt)
|
|
|
|
#endif
|
|
|
|
|
2012-09-02 21:06:02 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
int device;
|
|
|
|
} Multi;
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
static E_Client *_prev_bd;
|
2013-01-08 01:13:14 -08:00
|
|
|
|
2012-11-28 00:34:40 -08:00
|
|
|
static Ecore_X_Atom _atom_access = 0;
|
2013-01-07 23:03:32 -08:00
|
|
|
static Ecore_X_Window target_win = 0;
|
2012-11-28 00:34:40 -08:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
static Eina_List *covers = NULL;
|
|
|
|
static Eina_List *handlers = NULL;
|
2012-11-15 02:08:45 -08:00
|
|
|
static Ecore_Event_Handler *client_message_handler = NULL;
|
2013-03-06 23:20:51 -08:00
|
|
|
static Ecore_Event_Handler *property_handler = NULL;
|
2012-09-02 21:06:02 -07:00
|
|
|
static int multi_device[3];
|
2012-05-22 05:13:18 -07:00
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
static void
|
|
|
|
_mouse_in_win_get(Cover *cov, int x, int y)
|
2012-05-22 05:13:18 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
2013-01-07 23:03:32 -08:00
|
|
|
Ecore_X_Window *skip;
|
2012-05-22 05:13:18 -07:00
|
|
|
Cover *cov2;
|
|
|
|
int i;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
skip = alloca(sizeof(Ecore_X_Window) * eina_list_count(covers));
|
|
|
|
i = 0;
|
|
|
|
EINA_LIST_FOREACH(covers, l, cov2)
|
|
|
|
{
|
|
|
|
skip[i] = cov2->win;
|
|
|
|
i++;
|
|
|
|
}
|
2013-01-08 01:13:14 -08:00
|
|
|
|
|
|
|
/* TODO: if target window is changed without highlight object,
|
|
|
|
then previous target window which has the highlight object
|
|
|
|
should get the message. how? */
|
2013-01-07 23:03:32 -08:00
|
|
|
target_win = ecore_x_window_shadow_tree_at_xy_with_skip_get
|
2014-03-27 13:54:58 -07:00
|
|
|
(cov->zone->comp->man->root, x, y, skip, i);
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
|
2013-02-22 01:51:45 -08:00
|
|
|
static unsigned int
|
|
|
|
_win_angle_get(Ecore_X_Window win)
|
|
|
|
{
|
|
|
|
Ecore_X_Window root;
|
|
|
|
|
|
|
|
if (!win) return 0;
|
|
|
|
|
|
|
|
int ret;
|
|
|
|
int count;
|
|
|
|
int angle = 0;
|
|
|
|
unsigned char *prop_data = NULL;
|
|
|
|
|
|
|
|
root = ecore_x_window_root_get(win);
|
|
|
|
ret = ecore_x_window_prop_property_get(root,
|
|
|
|
ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE,
|
|
|
|
ECORE_X_ATOM_CARDINAL,
|
|
|
|
32, &prop_data, &count);
|
|
|
|
|
|
|
|
if (ret && prop_data)
|
|
|
|
memcpy (&angle, prop_data, sizeof (int));
|
|
|
|
|
|
|
|
if (prop_data) free (prop_data);
|
|
|
|
|
|
|
|
return angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_coordinate_calibrate(Ecore_X_Window win, int *x, int *y)
|
|
|
|
{
|
|
|
|
int tx, ty, w, h;
|
|
|
|
unsigned int angle;
|
|
|
|
|
|
|
|
if (!x) return;
|
|
|
|
if (!y) return;
|
|
|
|
|
|
|
|
angle = _win_angle_get(win);
|
|
|
|
ecore_x_window_geometry_get(win, NULL, NULL, &w, &h);
|
|
|
|
|
|
|
|
tx = *x;
|
|
|
|
ty = *y;
|
|
|
|
|
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 90:
|
|
|
|
*x = h - ty;
|
|
|
|
*y = tx;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 180:
|
|
|
|
*x = w - tx;
|
|
|
|
*y = h - ty;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 270:
|
|
|
|
*x = ty;
|
|
|
|
*y = w - tx;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
static void
|
|
|
|
_mouse_win_fake_tap(Cover *cov, Ecore_Event_Mouse_Button *ev)
|
|
|
|
{
|
|
|
|
int x, y;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
/* find target window to send message */
|
|
|
|
_mouse_in_win_get(cov, ev->root.x, ev->root.y);
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_pointer_xy_get(target_win, &x, &y);
|
|
|
|
ecore_x_mouse_in_send(target_win, x, y);
|
|
|
|
ecore_x_mouse_move_send(target_win, x, y);
|
|
|
|
ecore_x_mouse_down_send(target_win, x, y, 1);
|
|
|
|
ecore_x_mouse_up_send(target_win, x, y, 1);
|
|
|
|
ecore_x_mouse_out_send(target_win, x, y);
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
|
2012-12-07 01:52:52 -08:00
|
|
|
static void
|
2013-01-07 23:03:32 -08:00
|
|
|
_messsage_read_send(Cover *cov)
|
2012-12-07 01:52:52 -08:00
|
|
|
{
|
|
|
|
int x, y;
|
2013-01-07 23:03:32 -08:00
|
|
|
|
|
|
|
/* find target window to send message */
|
|
|
|
_mouse_in_win_get(cov, cov->x, cov->y);
|
|
|
|
|
|
|
|
ecore_x_pointer_xy_get(target_win, &x, &y);
|
2013-02-22 01:51:45 -08:00
|
|
|
_coordinate_calibrate(target_win, &x, &y);
|
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_client_message32_send(target_win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
|
2012-12-07 01:52:52 -08:00
|
|
|
ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
|
2013-01-07 23:03:32 -08:00
|
|
|
target_win,
|
2012-12-07 01:52:52 -08:00
|
|
|
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ,
|
|
|
|
x, y, 0);
|
|
|
|
|
|
|
|
#if DEBUG_INFO
|
2012-12-07 02:45:50 -08:00
|
|
|
Eina_List *l;
|
2013-01-07 23:03:32 -08:00
|
|
|
Cover *ecov;
|
2012-12-07 01:52:52 -08:00
|
|
|
Eina_Strbuf *buf;
|
|
|
|
|
|
|
|
buf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(buf, "read x:%d, y:%d", x, y);
|
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
EINA_LIST_FOREACH(covers, l, ecov)
|
2012-12-07 01:52:52 -08:00
|
|
|
{
|
2013-01-07 23:03:32 -08:00
|
|
|
INFO(ecov, eina_strbuf_string_get(buf));
|
2012-12-07 01:52:52 -08:00
|
|
|
}
|
2012-12-07 02:45:50 -08:00
|
|
|
eina_strbuf_free(buf);
|
2012-12-07 01:52:52 -08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_mouse_longpress(void *data)
|
|
|
|
{
|
|
|
|
Cover *cov = data;
|
|
|
|
int distance = 40;
|
|
|
|
int dx, dy;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
cov->timer = NULL;
|
|
|
|
dx = cov->x - cov->dx;
|
|
|
|
dy = cov->y - cov->dy;
|
|
|
|
if (((dx * dx) + (dy * dy)) < (distance * distance))
|
|
|
|
{
|
2012-11-15 02:08:45 -08:00
|
|
|
cov->longpressed = EINA_TRUE;
|
2012-11-28 00:34:40 -08:00
|
|
|
INFO(cov, "longpress");
|
2012-11-15 02:08:45 -08:00
|
|
|
|
2013-02-22 02:10:54 -08:00
|
|
|
if (!cov->double_down) _messsage_read_send(cov);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
INFO(cov, "double down and longpress");
|
|
|
|
//TODO: send message to notify start longpress
|
|
|
|
}
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2012-09-02 21:06:02 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_mouse_double_down(void *data)
|
|
|
|
{
|
|
|
|
Cover *cov = data;
|
2013-01-31 20:21:03 -08:00
|
|
|
ecore_timer_del(cov->double_down_timer);
|
|
|
|
cov->double_down_timer = NULL;
|
2012-09-02 21:06:02 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-01-31 20:21:03 -08:00
|
|
|
_double_down_timeout(Cover *cov)
|
2012-09-02 21:06:02 -07:00
|
|
|
{
|
2013-02-22 02:10:54 -08:00
|
|
|
double long_time = 0.5;
|
2012-09-02 21:06:02 -07:00
|
|
|
double short_time = 0.3;
|
|
|
|
int distance = 40;
|
|
|
|
int dx, dy;
|
|
|
|
|
|
|
|
dx = cov->x - cov->dx;
|
|
|
|
dy = cov->y - cov->dy;
|
|
|
|
|
2013-01-31 20:21:03 -08:00
|
|
|
if ((cov->double_down_timer) &&
|
2012-09-02 21:06:02 -07:00
|
|
|
(((dx * dx) + (dy * dy)) < (distance * distance)))
|
|
|
|
{
|
|
|
|
// start double tap and move from here
|
2013-01-31 20:21:03 -08:00
|
|
|
cov->double_down = EINA_TRUE;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
|
|
|
if (cov->timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(cov->timer);
|
|
|
|
cov->timer = NULL;
|
|
|
|
}
|
2013-02-22 02:10:54 -08:00
|
|
|
/* check longpress after double down */
|
|
|
|
cov->timer = ecore_timer_add(long_time, _mouse_longpress, cov);
|
2012-09-02 21:06:02 -07:00
|
|
|
}
|
|
|
|
|
2013-01-31 20:21:03 -08:00
|
|
|
if (cov->double_down_timer)
|
2012-09-02 21:06:02 -07:00
|
|
|
{
|
2013-01-31 20:21:03 -08:00
|
|
|
ecore_timer_del(cov->double_down_timer);
|
|
|
|
cov->double_down_timer = NULL;
|
2012-09-02 21:06:02 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-01-31 20:21:03 -08:00
|
|
|
cov->double_down_timer = ecore_timer_add(short_time, _mouse_double_down, cov);
|
2012-09-02 21:06:02 -07:00
|
|
|
}
|
|
|
|
|
2013-01-04 20:29:24 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_mouse_tap(void *data)
|
|
|
|
{
|
|
|
|
Cover *cov = data;
|
|
|
|
cov->tap_timer = NULL;
|
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
_messsage_read_send(cov);
|
2013-01-04 20:29:24 -08:00
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
static void
|
|
|
|
_mouse_down(Cover *cov, Ecore_Event_Mouse_Button *ev)
|
|
|
|
{
|
2013-02-22 02:10:54 -08:00
|
|
|
double long_time = 0.5;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
cov->dx = ev->x;
|
|
|
|
cov->dy = ev->y;
|
2012-09-02 21:06:02 -07:00
|
|
|
cov->mx = ev->x;
|
|
|
|
cov->my = ev->y;
|
2012-05-22 05:13:18 -07:00
|
|
|
cov->x = ev->x;
|
|
|
|
cov->y = ev->y;
|
|
|
|
cov->dt = ev->timestamp;
|
2012-11-15 02:08:45 -08:00
|
|
|
cov->longpressed = EINA_FALSE;
|
2013-02-22 02:10:54 -08:00
|
|
|
cov->timer = ecore_timer_add(long_time, _mouse_longpress, cov);
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2013-01-04 20:29:24 -08:00
|
|
|
if (cov->tap_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(cov->tap_timer);
|
|
|
|
cov->tap_timer = NULL;
|
|
|
|
}
|
|
|
|
|
2012-11-28 00:34:40 -08:00
|
|
|
/* check mouse double down - not two fingers, refer to double click */
|
2013-01-31 20:21:03 -08:00
|
|
|
_double_down_timeout(cov);
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_mouse_up(Cover *cov, Ecore_Event_Mouse_Button *ev)
|
|
|
|
{
|
|
|
|
double timeout = 0.15;
|
2013-01-04 20:29:24 -08:00
|
|
|
double double_tap_timeout = 0.25;
|
2012-05-22 05:13:18 -07:00
|
|
|
int distance = 40;
|
|
|
|
int dx, dy;
|
2012-09-02 21:06:02 -07:00
|
|
|
int x, y;
|
2013-02-22 01:51:45 -08:00
|
|
|
int angle = 0;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
|
|
|
// for two finger panning
|
|
|
|
if (cov->two_finger_down)
|
|
|
|
{
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_pointer_xy_get(target_win, &x, &y);
|
|
|
|
ecore_x_mouse_up_send(target_win, x, y, 1);
|
2012-09-02 21:06:02 -07:00
|
|
|
cov->two_finger_down = EINA_FALSE;
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_mouse_out_send(target_win, x, y);
|
2012-09-02 21:06:02 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// reset double down and moving
|
2013-01-31 20:21:03 -08:00
|
|
|
cov->double_down = EINA_FALSE;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
if (cov->timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(cov->timer);
|
|
|
|
cov->timer = NULL;
|
|
|
|
}
|
2012-11-15 02:08:45 -08:00
|
|
|
|
|
|
|
if (cov->longpressed)
|
|
|
|
{
|
|
|
|
cov->longpressed = EINA_FALSE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
dx = ev->x - cov->dx;
|
|
|
|
dy = ev->y - cov->dy;
|
|
|
|
if (((dx * dx) + (dy * dy)) < (distance * distance))
|
|
|
|
{
|
2013-01-04 20:29:24 -08:00
|
|
|
if (ev->double_click)
|
2012-05-22 05:13:18 -07:00
|
|
|
{
|
2013-01-08 01:13:14 -08:00
|
|
|
/* activate message would change focused window
|
|
|
|
FIXME: but it is possibe to create unfocused window
|
|
|
|
in this case, the message should go to unfocused window? */
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
_prev_bd = e_client_focused_get();
|
2013-01-08 01:13:14 -08:00
|
|
|
|
2012-11-28 00:34:40 -08:00
|
|
|
INFO(cov, "double_click");
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_e_illume_access_action_activate_send(target_win);
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
2013-01-04 20:29:24 -08:00
|
|
|
else if ((ev->timestamp - cov->dt) <= (timeout * 1000))
|
|
|
|
{
|
|
|
|
cov->tap_timer = ecore_timer_add(double_tap_timeout,
|
|
|
|
_mouse_tap, cov);
|
|
|
|
}
|
|
|
|
else if ((ev->timestamp - cov->dt) > (timeout * 1000) &&
|
|
|
|
(ev->timestamp - cov->dt) < (2 * timeout * 1000))
|
|
|
|
{
|
|
|
|
INFO(cov, "tap");
|
|
|
|
_mouse_win_fake_tap(cov, ev);
|
|
|
|
}
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
2012-09-02 21:06:02 -07:00
|
|
|
else if (((dx * dx) + (dy * dy)) > (4 * distance * distance)
|
|
|
|
&& ((ev->timestamp - cov->dt) < (timeout * 1000)))
|
2012-05-22 05:13:18 -07:00
|
|
|
{
|
2013-02-22 01:51:45 -08:00
|
|
|
/* get root window rotation */
|
|
|
|
angle = _win_angle_get(target_win);
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
if (abs(dx) > abs(dy)) // left or right
|
|
|
|
{
|
|
|
|
if (dx > 0) // right
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
INFO(cov, "single flick right");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 180:
|
|
|
|
case 270:
|
|
|
|
ecore_x_e_illume_access_action_read_prev_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 90:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_read_next_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
else // left
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
INFO(cov, "single flick left");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 180:
|
|
|
|
case 270:
|
|
|
|
ecore_x_e_illume_access_action_read_next_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 90:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_read_prev_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
}
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else // up or down
|
|
|
|
{
|
|
|
|
if (dy > 0) // down
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
INFO(cov, "single flick down");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 90:
|
|
|
|
case 180:
|
|
|
|
ecore_x_e_illume_access_action_read_prev_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 270:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_read_next_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
}
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
else // up
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
INFO(cov, "single flick up");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 90:
|
|
|
|
case 180:
|
|
|
|
ecore_x_e_illume_access_action_read_next_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 270:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_read_prev_send
|
|
|
|
(target_win);
|
|
|
|
break;
|
|
|
|
}
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-11-15 02:08:45 -08:00
|
|
|
cov->longpressed = EINA_FALSE;
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_mouse_move(Cover *cov, Ecore_Event_Mouse_Move *ev)
|
|
|
|
{
|
2012-09-02 21:06:02 -07:00
|
|
|
int x, y;
|
|
|
|
|
|
|
|
//FIXME: why here.. after long press you cannot go below..
|
|
|
|
//if (!cov->down) return;
|
|
|
|
|
2012-11-15 02:08:45 -08:00
|
|
|
//FIXME: one finger cannot come here
|
|
|
|
//_record_mouse_history(cov, ev);
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_pointer_xy_get(target_win, &x, &y);
|
|
|
|
ecore_x_mouse_move_send(target_win, x, y);
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_mouse_wheel(Cover *cov __UNUSED__, Ecore_Event_Mouse_Wheel *ev __UNUSED__)
|
|
|
|
{
|
2012-09-03 02:42:52 -07:00
|
|
|
if (ev->z == -1) // up
|
|
|
|
{
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_e_illume_access_action_up_send(target_win);
|
2012-09-03 02:42:52 -07:00
|
|
|
}
|
|
|
|
else if (ev->z == 1) // down
|
|
|
|
{
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_e_illume_access_action_down_send(target_win);
|
2012-09-03 02:42:52 -07:00
|
|
|
}
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_mouse_down(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event)
|
|
|
|
{
|
|
|
|
Ecore_Event_Mouse_Button *ev = event;
|
|
|
|
Eina_List *l;
|
|
|
|
Cover *cov;
|
2012-09-02 21:06:02 -07:00
|
|
|
int i = 0;
|
|
|
|
int x, y;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_Client *ec;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
if (multi_device[i] == -1)
|
|
|
|
{
|
|
|
|
multi_device[i] = ev->multi.device;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (multi_device[i] == ev->multi.device) break;
|
|
|
|
}
|
|
|
|
|
2013-01-08 01:13:14 -08:00
|
|
|
/* activate message would change focused window
|
|
|
|
FIXME: but it is possibe to create unfocused window
|
|
|
|
in this case, the message should go to focused window? */
|
2014-03-27 13:54:58 -07:00
|
|
|
ec = e_client_focused_get();
|
|
|
|
if (ec && (ec != _prev_bd)) target_win = e_client_util_win_get(ec);
|
2013-01-08 01:13:14 -08:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
EINA_LIST_FOREACH(covers, l, cov)
|
|
|
|
{
|
|
|
|
if (ev->window == cov->win)
|
|
|
|
{
|
2012-09-02 21:06:02 -07:00
|
|
|
// XXX change specific number
|
|
|
|
if (ev->multi.device == multi_device[0])
|
2012-05-22 05:13:18 -07:00
|
|
|
_mouse_down(cov, ev);
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-11-15 02:08:45 -08:00
|
|
|
if (ev->multi.device == multi_device[1] && !(cov->two_finger_down))
|
2012-09-02 21:06:02 -07:00
|
|
|
{
|
2012-11-15 02:08:45 -08:00
|
|
|
// prevent longpress client message by two finger
|
|
|
|
if (cov->timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(cov->timer);
|
|
|
|
cov->timer = NULL;
|
|
|
|
}
|
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_pointer_xy_get(target_win, &x, &y);
|
2012-11-15 02:08:45 -08:00
|
|
|
|
2013-01-07 23:03:32 -08:00
|
|
|
ecore_x_mouse_in_send(target_win, x, y);
|
|
|
|
ecore_x_mouse_move_send(target_win, x, y);
|
|
|
|
ecore_x_mouse_down_send(target_win, x, y, 1);
|
2012-11-15 02:08:45 -08:00
|
|
|
|
2012-09-02 21:06:02 -07:00
|
|
|
cov->two_finger_down = EINA_TRUE;
|
|
|
|
}
|
2012-05-22 05:13:18 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_mouse_up(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event)
|
|
|
|
{
|
|
|
|
Ecore_Event_Mouse_Button *ev = event;
|
|
|
|
Eina_List *l;
|
|
|
|
Cover *cov;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
EINA_LIST_FOREACH(covers, l, cov)
|
|
|
|
{
|
|
|
|
if (ev->window == cov->win)
|
|
|
|
{
|
2012-09-02 21:06:02 -07:00
|
|
|
if (ev->buttons == 1)
|
2012-05-22 05:13:18 -07:00
|
|
|
_mouse_up(cov, ev);
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_mouse_move(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event)
|
|
|
|
{
|
|
|
|
Ecore_Event_Mouse_Move *ev = event;
|
|
|
|
Eina_List *l;
|
|
|
|
Cover *cov;
|
2013-02-22 01:51:45 -08:00
|
|
|
int angle = 0;
|
2012-11-28 00:34:40 -08:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
EINA_LIST_FOREACH(covers, l, cov)
|
|
|
|
{
|
2013-02-22 02:10:54 -08:00
|
|
|
cov->x = ev->x;
|
|
|
|
cov->y = ev->y;
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
if (ev->window == cov->win)
|
|
|
|
{
|
2012-11-15 02:08:45 -08:00
|
|
|
//if (ev->multi.device == multi_device[0] || ev->multi.device == multi_device[1])
|
|
|
|
if (cov->two_finger_down && ev->multi.device == multi_device[1])
|
2012-05-22 05:13:18 -07:00
|
|
|
_mouse_move(cov, ev);
|
2012-11-15 02:08:45 -08:00
|
|
|
else if (cov->longpressed && // client message for moving is available only after long press is detected
|
2013-02-22 02:10:54 -08:00
|
|
|
!(cov->double_down) && /* mouse move after double down should not send read message */
|
2012-11-15 02:08:45 -08:00
|
|
|
!(cov->two_finger_down) && ev->multi.device == multi_device[0])
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
INFO(cov, "read");
|
2013-01-07 23:03:32 -08:00
|
|
|
_messsage_read_send(cov);
|
2012-11-15 02:08:45 -08:00
|
|
|
}
|
2013-01-31 20:21:03 -08:00
|
|
|
else if (cov->double_down && // client message for moving is available only after long press is detected
|
2012-11-28 00:34:40 -08:00
|
|
|
!(cov->two_finger_down) && ev->multi.device == multi_device[0])
|
|
|
|
{
|
|
|
|
int distance = 5;
|
|
|
|
int dx, dy;
|
|
|
|
|
2013-02-22 02:10:54 -08:00
|
|
|
if (cov->longpressed)
|
|
|
|
{
|
|
|
|
//TODO: send message to notify move afte longpress
|
|
|
|
}
|
|
|
|
else
|
2012-11-28 00:34:40 -08:00
|
|
|
{
|
|
|
|
dx = ev->x - cov->mx;
|
|
|
|
dy = ev->y - cov->my;
|
2013-02-22 01:51:45 -08:00
|
|
|
|
|
|
|
/* get root window rotation */
|
|
|
|
angle = _win_angle_get(target_win);
|
|
|
|
|
2012-11-28 00:34:40 -08:00
|
|
|
if (((dx * dx) + (dy * dy)) > (distance * distance))
|
|
|
|
{
|
|
|
|
|
|
|
|
if (abs(dx) > abs(dy)) // left or right
|
|
|
|
{
|
|
|
|
if (dx > 0) // right
|
|
|
|
{
|
|
|
|
INFO(cov, "mouse double down and move - right");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 180:
|
|
|
|
case 270:
|
|
|
|
ecore_x_e_illume_access_action_down_send(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 90:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_up_send(target_win);
|
|
|
|
break;
|
|
|
|
}
|
2012-11-28 00:34:40 -08:00
|
|
|
}
|
|
|
|
else // left
|
|
|
|
{
|
|
|
|
INFO(cov, "mouse double down and move - left");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 180:
|
|
|
|
case 270:
|
|
|
|
ecore_x_e_illume_access_action_up_send(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 90:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_down_send(target_win);
|
|
|
|
break;
|
|
|
|
}
|
2012-11-28 00:34:40 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else // up or down
|
|
|
|
{
|
|
|
|
if (dy > 0) // down
|
|
|
|
{
|
|
|
|
INFO(cov, "mouse double down and move - down");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 90:
|
|
|
|
case 180:
|
|
|
|
ecore_x_e_illume_access_action_up_send(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 270:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_down_send(target_win);
|
|
|
|
break;
|
|
|
|
}
|
2012-11-28 00:34:40 -08:00
|
|
|
}
|
|
|
|
else // up
|
|
|
|
{
|
|
|
|
INFO(cov, "mouse double down and move - up");
|
2013-02-22 01:51:45 -08:00
|
|
|
switch (angle)
|
|
|
|
{
|
|
|
|
case 90:
|
|
|
|
case 180:
|
|
|
|
ecore_x_e_illume_access_action_down_send(target_win);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 270:
|
|
|
|
default:
|
|
|
|
ecore_x_e_illume_access_action_up_send(target_win);
|
|
|
|
break;
|
|
|
|
}
|
2012-11-28 00:34:40 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cov->mx = ev->x;
|
|
|
|
cov->my = ev->y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-11-15 02:08:45 -08:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_mouse_wheel(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event)
|
|
|
|
{
|
|
|
|
Ecore_Event_Mouse_Wheel *ev = event;
|
|
|
|
Eina_List *l;
|
|
|
|
Cover *cov;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
EINA_LIST_FOREACH(covers, l, cov)
|
|
|
|
{
|
|
|
|
if (ev->window == cov->win)
|
|
|
|
{
|
|
|
|
_mouse_wheel(cov, ev);
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Cover *
|
|
|
|
_cover_new(E_Zone *zone)
|
|
|
|
{
|
|
|
|
Cover *cov;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
cov = E_NEW(Cover, 1);
|
|
|
|
if (!cov) return NULL;
|
|
|
|
cov->zone = zone;
|
2012-11-28 00:34:40 -08:00
|
|
|
|
|
|
|
#if DEBUG_INFO
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
ee = ecore_evas_new(NULL,
|
2014-03-27 13:54:58 -07:00
|
|
|
zone->x,
|
|
|
|
zone->y,
|
2012-11-28 00:34:40 -08:00
|
|
|
zone->w, zone->h,
|
|
|
|
NULL);
|
|
|
|
ecore_evas_alpha_set(ee, EINA_TRUE);
|
|
|
|
cov->win = (Ecore_X_Window)ecore_evas_window_get(ee);
|
|
|
|
|
|
|
|
/* create infomation */
|
|
|
|
Evas *e;
|
|
|
|
e = ecore_evas_get(ee);
|
|
|
|
cov->info = evas_object_rectangle_add(e);
|
|
|
|
evas_object_color_set(cov->info, 255, 255, 255, 100);
|
2014-03-27 13:54:58 -07:00
|
|
|
evas_object_move(cov->info, zone->x, zone->y);
|
2012-11-28 00:34:40 -08:00
|
|
|
evas_object_resize(cov->info, zone->w, 30);
|
|
|
|
evas_object_show(cov->info);
|
|
|
|
|
|
|
|
cov->text = evas_object_text_add(e);
|
|
|
|
evas_object_text_style_set(cov->text, EVAS_TEXT_STYLE_PLAIN);
|
|
|
|
evas_object_text_font_set(cov->text, "DejaVu", 14);
|
2012-12-07 01:52:52 -08:00
|
|
|
INFO(cov, "Screen Reader Mode");
|
2012-11-28 00:34:40 -08:00
|
|
|
|
|
|
|
evas_object_color_set(cov->text, 0, 0, 0, 255);
|
|
|
|
evas_object_resize(cov->text, (zone->w / 8), 20);
|
2014-03-27 13:54:58 -07:00
|
|
|
evas_object_move(cov->text, zone->x + 5, zone->y + 5);
|
2012-11-28 00:34:40 -08:00
|
|
|
evas_object_show(cov->text);
|
|
|
|
|
|
|
|
#else
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
cov->win = ecore_x_window_input_new(zone->comp->manager->root,
|
|
|
|
zone->comp->x + zone->x,
|
|
|
|
zone->comp->y + zone->y,
|
2012-05-22 05:13:18 -07:00
|
|
|
zone->w, zone->h);
|
2012-11-28 00:34:40 -08:00
|
|
|
#endif
|
2012-09-02 21:06:02 -07:00
|
|
|
|
|
|
|
ecore_x_input_multi_select(cov->win);
|
|
|
|
|
2012-12-07 01:52:52 -08:00
|
|
|
ecore_x_icccm_title_set(cov->win, "access-screen-reader");
|
|
|
|
ecore_x_netwm_name_set(cov->win, "access-screen-reader");
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
ecore_x_window_ignore_set(cov->win, 1);
|
|
|
|
ecore_x_window_configure(cov->win,
|
|
|
|
ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
|
|
|
|
ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
|
|
|
|
0, 0, 0, 0, 0,
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
zone->comp->layers[8].win,
|
2012-05-22 05:13:18 -07:00
|
|
|
ECORE_X_WINDOW_STACK_ABOVE);
|
|
|
|
ecore_x_window_show(cov->win);
|
2012-09-02 21:06:02 -07:00
|
|
|
ecore_x_window_raise(cov->win);
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
return cov;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_covers_init(void)
|
|
|
|
{
|
2015-01-05 12:27:41 -08:00
|
|
|
const Eina_List *l;
|
2012-09-02 21:06:02 -07:00
|
|
|
int i = 0;
|
2015-01-05 12:27:41 -08:00
|
|
|
E_Zone *zone;
|
2012-05-22 05:13:18 -07:00
|
|
|
|
2015-01-05 12:27:41 -08:00
|
|
|
EINA_LIST_FOREACH(e_comp->zones, l, zone)
|
2012-05-22 05:13:18 -07:00
|
|
|
{
|
2015-01-05 12:27:41 -08:00
|
|
|
Cover *cov = _cover_new(zone);
|
|
|
|
if (!cov) continue;
|
|
|
|
covers = eina_list_append(covers, cov);
|
|
|
|
for (i = 0; i < HISTORY_MAX; i++) cov->mouse_history[i] = -1;
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_covers_shutdown(void)
|
|
|
|
{
|
|
|
|
Cover *cov;
|
2012-09-02 21:06:02 -07:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
EINA_LIST_FREE(covers, cov)
|
|
|
|
{
|
|
|
|
ecore_x_window_ignore_set(cov->win, 0);
|
|
|
|
ecore_x_window_free(cov->win);
|
2012-11-28 00:34:40 -08:00
|
|
|
evas_object_del(cov->info);
|
|
|
|
evas_object_del(cov->text);
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
if (cov->timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(cov->timer);
|
|
|
|
cov->timer = NULL;
|
|
|
|
}
|
2012-11-28 00:34:40 -08:00
|
|
|
|
2013-01-31 20:21:03 -08:00
|
|
|
if (cov->double_down_timer)
|
2012-11-28 00:34:40 -08:00
|
|
|
{
|
2013-01-31 20:21:03 -08:00
|
|
|
ecore_timer_del(cov->double_down_timer);
|
|
|
|
cov->double_down_timer = NULL;
|
2012-11-28 00:34:40 -08:00
|
|
|
}
|
|
|
|
|
2013-01-04 20:29:24 -08:00
|
|
|
if (cov->tap_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(cov->tap_timer);
|
|
|
|
cov->tap_timer = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if DEBUG_INFO
|
|
|
|
if (dbg_timer)
|
|
|
|
{
|
|
|
|
ecore_timer_del(dbg_timer);
|
|
|
|
dbg_timer = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
free(cov);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_zone_add(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event __UNUSED__)
|
|
|
|
{
|
|
|
|
_covers_shutdown();
|
2012-05-23 21:52:58 -07:00
|
|
|
_covers_init();
|
2012-05-22 05:13:18 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_zone_del(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event __UNUSED__)
|
|
|
|
{
|
|
|
|
_covers_shutdown();
|
2012-05-23 21:52:58 -07:00
|
|
|
_covers_init();
|
2012-05-22 05:13:18 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_cb_zone_move_resize(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *event __UNUSED__)
|
|
|
|
{
|
|
|
|
_covers_shutdown();
|
2012-05-23 21:52:58 -07:00
|
|
|
_covers_init();
|
2012-05-22 05:13:18 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_events_init(void)
|
|
|
|
{
|
2012-09-02 21:06:02 -07:00
|
|
|
int i = 0;
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
|
|
|
|
_cb_mouse_down, NULL));
|
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
|
|
|
|
_cb_mouse_up, NULL));
|
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
|
|
|
|
_cb_mouse_move, NULL));
|
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
|
|
|
|
_cb_mouse_wheel, NULL));
|
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add(E_EVENT_ZONE_ADD,
|
|
|
|
_cb_zone_add, NULL));
|
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add(E_EVENT_ZONE_DEL,
|
|
|
|
_cb_zone_del, NULL));
|
|
|
|
handlers = eina_list_append
|
|
|
|
(handlers, ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE,
|
|
|
|
_cb_zone_move_resize, NULL));
|
2012-09-02 21:06:02 -07:00
|
|
|
|
|
|
|
for (i = 0; i < 3; i++) multi_device[i] = -1;
|
2012-05-22 05:13:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_events_shutdown(void)
|
|
|
|
{
|
|
|
|
E_FREE_LIST(handlers, ecore_event_handler_del);
|
|
|
|
}
|
|
|
|
|
2013-03-06 23:20:51 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_cb_property_change(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *ev)
|
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_Client *ec;
|
2013-03-06 23:20:51 -08:00
|
|
|
Ecore_X_Event_Window_Property *event = ev;
|
|
|
|
|
|
|
|
if (event->atom == ECORE_X_ATOM_NET_ACTIVE_WINDOW)
|
|
|
|
{
|
2014-03-27 13:54:58 -07:00
|
|
|
ec = e_client_focused_get();
|
|
|
|
if (ec) target_win = e_client_util_win_get(ec);
|
2013-03-06 23:20:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
2012-11-15 02:08:45 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_cb_client_message(void *data __UNUSED__,
|
|
|
|
int type __UNUSED__,
|
|
|
|
void *ev)
|
|
|
|
{
|
2013-02-22 01:46:20 -08:00
|
|
|
int block;
|
2012-11-15 02:08:45 -08:00
|
|
|
Ecore_X_Event_Client_Message *event = ev;
|
|
|
|
|
2012-11-28 00:34:40 -08:00
|
|
|
if (event->message_type != _atom_access)
|
2012-11-15 02:08:45 -08:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
|
2013-02-22 01:46:20 -08:00
|
|
|
block = e_config_save_block_get();
|
|
|
|
if (block) e_config_save_block_set(!block);
|
|
|
|
|
2012-11-15 02:08:45 -08:00
|
|
|
if ((Eina_Bool)event->data.l[0])
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
EINA_LOG_INFO("[access module] module enable");
|
2012-11-15 02:08:45 -08:00
|
|
|
_covers_init();
|
|
|
|
_events_init();
|
2012-11-15 04:30:55 -08:00
|
|
|
access_config->window = EINA_TRUE;
|
2012-11-15 02:08:45 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
EINA_LOG_INFO("[access module] module disable");
|
2012-11-15 02:08:45 -08:00
|
|
|
_covers_shutdown();
|
|
|
|
_events_shutdown();
|
2012-11-15 04:30:55 -08:00
|
|
|
access_config->window = EINA_FALSE;
|
2012-11-15 02:08:45 -08:00
|
|
|
}
|
|
|
|
|
2012-11-15 04:30:55 -08:00
|
|
|
/* save config value */
|
2013-01-30 02:22:32 -08:00
|
|
|
e_config_domain_save("module.access", conf_edd, access_config);
|
2013-02-22 01:46:20 -08:00
|
|
|
e_config_save_block_set(block);
|
2012-11-15 04:30:55 -08:00
|
|
|
|
2012-11-15 02:08:45 -08:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
/***************************************************************************/
|
|
|
|
/* module setup */
|
|
|
|
EAPI E_Module_Api e_modapi =
|
|
|
|
{
|
|
|
|
E_MODULE_API_VERSION, "Access"
|
|
|
|
};
|
|
|
|
|
|
|
|
EAPI void *
|
|
|
|
e_modapi_init(E_Module *m)
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
if (!_atom_access)
|
|
|
|
_atom_access = ecore_x_atom_get("_E_MOD_ACC_SCR_READER_");
|
|
|
|
|
2012-11-15 02:08:45 -08:00
|
|
|
ecore_x_event_mask_set(ecore_x_window_root_first_get(),
|
|
|
|
ECORE_X_EVENT_MASK_WINDOW_CONFIGURE);
|
|
|
|
client_message_handler = ecore_event_handler_add
|
|
|
|
(ECORE_X_EVENT_CLIENT_MESSAGE, _cb_client_message, NULL);
|
|
|
|
ecore_x_event_mask_set(ecore_x_window_root_first_get(),
|
|
|
|
ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
|
2013-03-06 23:20:51 -08:00
|
|
|
property_handler = ecore_event_handler_add
|
|
|
|
(ECORE_X_EVENT_WINDOW_PROPERTY, _cb_property_change, NULL);
|
2012-11-15 04:30:55 -08:00
|
|
|
|
|
|
|
/* load config value */
|
|
|
|
conf_edd = E_CONFIG_DD_NEW("Access_Config", Config);
|
|
|
|
E_CONFIG_VAL(conf_edd, Config, window, UCHAR);
|
|
|
|
|
|
|
|
access_config = e_config_domain_load("module.access", conf_edd);
|
|
|
|
|
|
|
|
if (!access_config)
|
|
|
|
{
|
|
|
|
access_config = E_NEW(Config, 1);
|
|
|
|
access_config->window = EINA_FALSE;
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (access_config->window)
|
|
|
|
{
|
2013-03-06 23:20:51 -08:00
|
|
|
_covers_shutdown();
|
2012-11-15 04:30:55 -08:00
|
|
|
_covers_init();
|
|
|
|
_events_init();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_covers_shutdown();
|
|
|
|
_events_shutdown();
|
|
|
|
}
|
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_shutdown(E_Module *m __UNUSED__)
|
|
|
|
{
|
2012-11-28 00:34:40 -08:00
|
|
|
EINA_LOG_INFO("[access module] module shutdown");
|
2013-03-06 23:20:51 -08:00
|
|
|
if (client_message_handler) ecore_event_handler_del(client_message_handler);
|
|
|
|
if (property_handler) ecore_event_handler_del(property_handler);
|
2012-11-15 02:08:45 -08:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
_covers_shutdown();
|
|
|
|
_events_shutdown();
|
2012-11-15 02:08:45 -08:00
|
|
|
|
2012-05-22 05:13:18 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_save(E_Module *m __UNUSED__)
|
|
|
|
{
|
2012-11-15 04:30:55 -08:00
|
|
|
e_config_domain_save("module.access", conf_edd, access_config);
|
2012-05-22 05:13:18 -07:00
|
|
|
return 1;
|
|
|
|
}
|