Add ecore_x_mouse_in_send() and ecore_x_mouse_out_send()

Add ecore_x illume access control/action atoms+api's
                


SVN revision: 71320
This commit is contained in:
Carsten Haitzler 2012-05-22 12:09:06 +00:00
parent 5600b332a4
commit 06a3cbaf42
10 changed files with 338 additions and 1 deletions

View File

@ -653,3 +653,8 @@
2012-05-22 Cedric Bail
* Reduce race condition on Ecore_Thread shutdown.
2012-05-22 Carsten Haitzler (The Rasterman)
* Add ecore_x_mouse_in_send() and ecore_x_mouse_out_send()
* Add ecore_x illume access control/action atoms+api's

View File

@ -1807,7 +1807,11 @@ ecore_x_mouse_up_send(Ecore_X_Window win,
int x,
int y,
int b);
EAPI Eina_Bool
ecore_x_mouse_in_send(Ecore_X_Window win, int x, int y);
EAPI Eina_Bool
ecore_x_mouse_out_send(Ecore_X_Window win, int x, int y);
EAPI void
ecore_x_drawable_geometry_get(Ecore_X_Drawable d,
int *x,
@ -2348,6 +2352,19 @@ EAPI void
ecore_x_e_illume_home_new_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_home_del_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_access_action_next_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_access_action_prev_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_access_action_activate_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_access_action_read_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_access_action_read_next_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_access_action_read_prev_send(Ecore_X_Window win);
EAPI void
ecore_x_e_illume_drag_set(Ecore_X_Window win,
unsigned int drag);

View File

@ -252,6 +252,13 @@ EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_COUNTER;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE;

View File

@ -278,6 +278,13 @@ EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_COUNTER = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE = 0;

View File

@ -651,6 +651,106 @@ ecore_x_mouse_move_send(Ecore_X_Window win, int x, int y)
return EINA_TRUE;
}
EAPI Eina_Bool
ecore_x_mouse_in_send(Ecore_X_Window win, int x, int y)
{
xcb_translate_coordinates_cookie_t cookie;
xcb_translate_coordinates_reply_t *reply;
xcb_motion_notify_event_t ev;
xcb_void_cookie_t vcookie;
xcb_generic_error_t *err;
Ecore_X_Window root = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
root = ecore_x_window_root_get(win);
cookie = xcb_translate_coordinates(_ecore_xcb_conn, win, root, x, y);
reply = xcb_translate_coordinates_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return EINA_FALSE;
memset(&ev, 0, sizeof(xcb_motion_notify_event_t));
ev.response_type = XCB_ENTER_NOTIFY;
ev.event = win;
ev.child = win;
ev.root = root;
ev.event_x = x;
ev.event_y = y;
ev.same_screen = 1;
ev.mode = XCB_NOTIFY_MODE_NORMAL;
ev.detail = XCB_NOTIFY_DETAIL_NONLINEAR;
ev.focus = 0;
ev.state = 0;
ev.root_x = reply->dst_x;
ev.root_y = reply->dst_y;
ev.time = ecore_x_current_time_get();
free(reply);
vcookie = xcb_send_event(_ecore_xcb_conn, 1, win,
XCB_EVENT_MASK_ENTER_WINDOW, (const char *)&ev);
err = xcb_request_check(_ecore_xcb_conn, vcookie);
if (err)
{
_ecore_xcb_error_handle(err);
free(err);
return EINA_FALSE;
}
return EINA_TRUE;
}
EAPI Eina_Bool
ecore_x_mouse_out_send(Ecore_X_Window win, int x, int y)
{
xcb_translate_coordinates_cookie_t cookie;
xcb_translate_coordinates_reply_t *reply;
xcb_motion_notify_event_t ev;
xcb_void_cookie_t vcookie;
xcb_generic_error_t *err;
Ecore_X_Window root = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
CHECK_XCB_CONN;
root = ecore_x_window_root_get(win);
cookie = xcb_translate_coordinates(_ecore_xcb_conn, win, root, x, y);
reply = xcb_translate_coordinates_reply(_ecore_xcb_conn, cookie, NULL);
if (!reply) return EINA_FALSE;
memset(&ev, 0, sizeof(xcb_motion_notify_event_t));
ev.response_type = XCB_LEAVE_NOTIFY;
ev.event = win;
ev.child = win;
ev.root = root;
ev.event_x = x;
ev.event_y = y;
ev.same_screen = 1;
ev.mode = XCB_NOTIFY_MODE_NORMAL;
ev.detail = XCB_NOTIFY_DETAIL_NONLINEAR;
ev.focus = 0;
ev.state = 0;
ev.root_x = reply->dst_x;
ev.root_y = reply->dst_y;
ev.time = ecore_x_current_time_get();
free(reply);
vcookie = xcb_send_event(_ecore_xcb_conn, 1, win,
XCB_EVENT_MASK_LEAVE_WINDOW, (const char *)&ev);
err = xcb_request_check(_ecore_xcb_conn, vcookie);
if (err)
{
_ecore_xcb_error_handle(err);
free(err);
return EINA_FALSE;
}
return EINA_TRUE;
}
EAPI Eina_Bool
ecore_x_keyboard_grab(Ecore_X_Window win)
{

View File

@ -263,6 +263,13 @@ static Xcb_Atom atoms[] =
{ "_E_ILLUME_CLIPBOARD_ON", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON },
{ "_E_ILLUME_CLIPBOARD_OFF", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF },
{ "_E_ILLUME_CLIPBOARD_GEOMETRY", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY },
{ "_E_ILLUME_ACCESS_CONTROL", &ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL },
{ "_E_ILLUME_ACCESS_ACTION_NEXT", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT },
{ "_E_ILLUME_ACCESS_ACTION_PREV", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV },
{ "_E_ILLUME_ACCESS_ACTION_ACTIVATE", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE },
{ "_E_ILLUME_ACCESS_ACTION_READ", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ },
{ "_E_ILLUME_ACCESS_ACTION_READ_NEXT", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT },
{ "_E_ILLUME_ACCESS_ACTION_READ_PREV", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV },
{ "_E_COMP_SYNC_COUNTER", &ECORE_X_ATOM_E_COMP_SYNC_COUNTER },
{ "_E_COMP_SYNC_DRAW_DONE", &ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE },
{ "_E_COMP_SYNC_SUPPORTED", &ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED },

View File

@ -911,6 +911,72 @@ ecore_x_e_illume_home_del_send(Ecore_X_Window win)
1, 0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_next_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_prev_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_activate_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_read_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_read_next_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_read_prev_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_drag_set(Ecore_X_Window win,
unsigned int drag)

View File

@ -1957,6 +1957,66 @@ ecore_x_mouse_up_send(Ecore_X_Window win,
return XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev) ? EINA_TRUE : EINA_FALSE;
}
EAPI Eina_Bool
ecore_x_mouse_in_send(Ecore_X_Window win,
int x,
int y)
{
XEvent xev;
XWindowAttributes att;
Window tw;
int rx, ry;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XGetWindowAttributes(_ecore_x_disp, win, &att);
XTranslateCoordinates(_ecore_x_disp, win, att.root, x, y, &rx, &ry, &tw);
xev.xcrossing.type = EnterNotify;
xev.xcrossing.window = win;
xev.xcrossing.root = att.root;
xev.xcrossing.subwindow = win;
xev.xcrossing.time = _ecore_x_event_last_time;
xev.xcrossing.x = x;
xev.xcrossing.y = y;
xev.xcrossing.x_root = rx;
xev.xcrossing.y_root = ry;
xev.xcrossing.mode = NotifyNormal;
xev.xcrossing.detail = NotifyNonlinear;
xev.xcrossing.same_screen = 1;
xev.xcrossing.focus = 0;
xev.xcrossing.state = 0;
return XSendEvent(_ecore_x_disp, win, True, EnterWindowMask, &xev) ? EINA_TRUE : EINA_FALSE;
}
EAPI Eina_Bool
ecore_x_mouse_out_send(Ecore_X_Window win,
int x,
int y)
{
XEvent xev;
XWindowAttributes att;
Window tw;
int rx, ry;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XGetWindowAttributes(_ecore_x_disp, win, &att);
XTranslateCoordinates(_ecore_x_disp, win, att.root, x, y, &rx, &ry, &tw);
xev.xcrossing.type = LeaveNotify;
xev.xcrossing.window = win;
xev.xcrossing.root = att.root;
xev.xcrossing.subwindow = win;
xev.xcrossing.time = _ecore_x_event_last_time;
xev.xcrossing.x = x;
xev.xcrossing.y = y;
xev.xcrossing.x_root = rx;
xev.xcrossing.y_root = ry;
xev.xcrossing.mode = NotifyNormal;
xev.xcrossing.detail = NotifyNonlinear;
xev.xcrossing.same_screen = 1;
xev.xcrossing.focus = 0;
xev.xcrossing.state = 0;
return XSendEvent(_ecore_x_disp, win, True, LeaveWindowMask, &xev) ? EINA_TRUE : EINA_FALSE;
}
EAPI void
ecore_x_focus_reset(void)
{

View File

@ -284,6 +284,14 @@ _ecore_x_atoms_init(void)
{ "_E_ILLUME_CLIPBOARD_ON", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON },
{ "_E_ILLUME_CLIPBOARD_OFF", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF },
{ "_E_ILLUME_CLIPBOARD_GEOMETRY", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY },
{ "_E_ILLUME_ACCESS_CONTROL", &ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL },
{ "_E_ILLUME_ACCESS_ACTION_NEXT", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT },
{ "_E_ILLUME_ACCESS_ACTION_PREV", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV },
{ "_E_ILLUME_ACCESS_ACTION_ACTIVATE", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE },
{ "_E_ILLUME_ACCESS_ACTION_READ", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ },
{ "_E_ILLUME_ACCESS_ACTION_READ_NEXT", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT },
{ "_E_ILLUME_ACCESS_ACTION_READ_PREV", &ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV },
{ "_E_COMP_SYNC_COUNTER", &ECORE_X_ATOM_E_COMP_SYNC_COUNTER },
{ "_E_COMP_SYNC_DRAW_DONE", &ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE },
{ "_E_COMP_SYNC_SUPPORTED", &ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED },

View File

@ -375,6 +375,66 @@ ecore_x_e_illume_home_del_send(Ecore_X_Window win)
1, 0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_next_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_prev_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_PREV,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_activate_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_read_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_read_next_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_NEXT,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_access_action_read_prev_send(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL,
win,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ_PREV,
0, 0, 0, 0);
}
EAPI void
ecore_x_e_illume_drag_set(Ecore_X_Window win,
unsigned int drag)