forked from enlightenment/efl
parent
bfb89c4857
commit
aef319dc5f
|
@ -7,6 +7,7 @@
|
|||
#include <X11/keysym.h>
|
||||
|
||||
#include <Ecore.h>
|
||||
#include <Ecore_Input.h>
|
||||
|
||||
#include "ecore_xcb_private.h"
|
||||
#include "Ecore_X_Atoms.h"
|
||||
|
@ -14,6 +15,8 @@
|
|||
static int _ecore_xcb_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
|
||||
static int _ecore_xcb_fd_handler_buf(void *data, Ecore_Fd_Handler *fd_handler);
|
||||
static int _ecore_xcb_key_mask_get(xcb_keysym_t sym);
|
||||
static int _ecore_xcb_event_modifier(unsigned int state);
|
||||
|
||||
static void *_ecore_xcb_event_filter_start(void *data);
|
||||
static int _ecore_xcb_event_filter_filter(void *data, void *loop_data,int type, void *event);
|
||||
static void _ecore_xcb_event_filter_end(void *data, void *loop_data);
|
||||
|
@ -21,10 +24,10 @@ static void _ecore_xcb_event_filter_end(void *data, void *loop_data);
|
|||
static Ecore_Fd_Handler *_ecore_xcb_fd_handler_handle = NULL;
|
||||
static Ecore_Event_Filter *_ecore_xcb_filter_handler = NULL;
|
||||
|
||||
static const int AnyXEvent = 0; /* 0 can be used as there are no event types
|
||||
* with index 0 and 1 as they are used for
|
||||
* errors
|
||||
*/
|
||||
static const int XCB_EVENT_ANY = 0; /* 0 can be used as there are no event types
|
||||
* with index 0 and 1 as they are used for
|
||||
* errors
|
||||
*/
|
||||
|
||||
#ifdef ECORE_XCB_DAMAGE
|
||||
static int _ecore_xcb_event_damage_id = 0;
|
||||
|
@ -124,10 +127,10 @@ EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_NEW = 0;
|
|||
EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE = 0;
|
||||
EAPI int ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE = 0;
|
||||
|
||||
int ECORE_X_MODIFIER_SHIFT = 0;
|
||||
int ECORE_X_MODIFIER_CTRL = 0;
|
||||
int ECORE_X_MODIFIER_ALT = 0;
|
||||
int ECORE_X_MODIFIER_WIN = 0;
|
||||
EAPI int ECORE_X_MODIFIER_SHIFT = 0;
|
||||
EAPI int ECORE_X_MODIFIER_CTRL = 0;
|
||||
EAPI int ECORE_X_MODIFIER_ALT = 0;
|
||||
EAPI int ECORE_X_MODIFIER_WIN = 0;
|
||||
|
||||
EAPI int ECORE_X_LOCK_SCROLL = 0;
|
||||
EAPI int ECORE_X_LOCK_NUM = 0;
|
||||
|
@ -265,6 +268,7 @@ ecore_x_init(const char *name)
|
|||
#endif /* ECORE_XCB_XPRINT */
|
||||
|
||||
/* We init some components (not related to XCB) */
|
||||
ecore_even_init();
|
||||
_ecore_x_reply_init();
|
||||
_ecore_x_dnd_init();
|
||||
ecore_x_netwm_init();
|
||||
|
@ -437,6 +441,7 @@ ecore_x_init(const char *name)
|
|||
_ecore_x_xinerama_init_finalize();
|
||||
#endif /* ECORE_XCB_XINERAMA */
|
||||
|
||||
ecore_event_shutdown();
|
||||
xcb_disconnect(_ecore_xcb_conn);
|
||||
_ecore_xcb_fd_handler_handle = NULL;
|
||||
_ecore_xcb_conn = NULL;
|
||||
|
@ -447,7 +452,7 @@ ecore_x_init(const char *name)
|
|||
_ecore_xcb_xcursor = XcursorSupportsARGB(_ecore_xcb_conn);
|
||||
#endif /* ECORE_XCB_CURSOR */
|
||||
|
||||
_ecore_xcb_event_handlers[AnyXEvent] = _ecore_x_event_handle_any_event;
|
||||
_ecore_xcb_event_handlers[XCB_EVENT_ANY] = _ecore_x_event_handle_any_event;
|
||||
_ecore_xcb_event_handlers[XCB_KEY_PRESS] = _ecore_x_event_handle_key_press;
|
||||
_ecore_xcb_event_handlers[XCB_KEY_RELEASE] = _ecore_x_event_handle_key_release;
|
||||
_ecore_xcb_event_handlers[XCB_BUTTON_PRESS] = _ecore_x_event_handle_button_press;
|
||||
|
@ -632,6 +637,7 @@ ecore_x_init(const char *name)
|
|||
_ecore_x_xinerama_init_finalize();
|
||||
#endif /* ECORE_XCB_XINERAMA */
|
||||
|
||||
ecore_event_shutdown();
|
||||
xcb_disconnect(_ecore_xcb_conn);
|
||||
free(_ecore_xcb_event_handlers);
|
||||
_ecore_xcb_fd_handler_handle = NULL;
|
||||
|
@ -694,6 +700,7 @@ _ecore_x_shutdown(int close_display)
|
|||
xcb_disconnect(_ecore_xcb_conn);
|
||||
else
|
||||
close(xcb_get_file_descriptor(_ecore_xcb_conn));
|
||||
ecore_event_shutdown();
|
||||
free(_ecore_xcb_event_handlers);
|
||||
ecore_main_fd_handler_del(_ecore_xcb_fd_handler_handle);
|
||||
ecore_event_filter_del(_ecore_xcb_filter_handler);
|
||||
|
@ -913,8 +920,8 @@ handle_event(xcb_generic_event_t *ev)
|
|||
|
||||
if (response_type < _ecore_xcb_event_handlers_num)
|
||||
{
|
||||
if (_ecore_xcb_event_handlers[AnyXEvent])
|
||||
_ecore_xcb_event_handlers[AnyXEvent] (&ev);
|
||||
if (_ecore_xcb_event_handlers[XCB_EVENT_ANY])
|
||||
_ecore_xcb_event_handlers[XCB_EVENT_ANY] (ev);
|
||||
|
||||
if (_ecore_xcb_event_handlers[response_type])
|
||||
_ecore_xcb_event_handlers[response_type] (ev);
|
||||
|
@ -1038,9 +1045,9 @@ _ecore_xcb_event_filter_filter(void *data __UNUSED__, void *loop_data,int type,
|
|||
|
||||
filter_data = loop_data;
|
||||
if (!filter_data) return 1;
|
||||
if (type == ECORE_X_EVENT_MOUSE_MOVE)
|
||||
if (type == ECORE_EVENT_MOUSE_MOVE)
|
||||
{
|
||||
if ((filter_data->last_event_type) == ECORE_X_EVENT_MOUSE_MOVE)
|
||||
if ((filter_data->last_event_type) == ECORE_EVENT_MOUSE_MOVE)
|
||||
{
|
||||
filter_data->last_event_type = type;
|
||||
return 0;
|
||||
|
@ -1376,11 +1383,13 @@ EAPI int
|
|||
ecore_x_pointer_mapping_get(unsigned char *map,
|
||||
int nmap)
|
||||
{
|
||||
xcb_get_pointer_mapping_cookie_t cookie;
|
||||
xcb_get_pointer_mapping_reply_t *reply;
|
||||
int i;
|
||||
uint8_t tmp;
|
||||
uint8_t *tmp;
|
||||
int i;
|
||||
|
||||
reply = _ecore_xcb_reply_get();
|
||||
cookie = xcb_get_pointer_mapping_unchecked(_ecore_xcb_conn);
|
||||
reply = xcb_get_pointer_mapping_reply(_ecore_xcb_conn, cookie, NULL);
|
||||
if (!reply) return 0;
|
||||
|
||||
if (nmap > xcb_get_pointer_mapping_map_length(reply))
|
||||
|
@ -1535,7 +1544,7 @@ ecore_x_window_button_grab(Ecore_X_Window window,
|
|||
uint16_t locks[8];
|
||||
uint16_t ev;
|
||||
|
||||
m = _ecore_x_event_modifier(mod);
|
||||
m = _ecore_xcb_event_modifier(mod);
|
||||
if (any_mod) m = XCB_BUTTON_MASK_ANY;
|
||||
locks[0] = 0;
|
||||
locks[1] = ECORE_X_LOCK_CAPS;
|
||||
|
@ -1606,7 +1615,7 @@ ecore_x_window_button_ungrab(Ecore_X_Window window,
|
|||
uint16_t m;
|
||||
uint16_t locks[8];
|
||||
|
||||
m = _ecore_x_event_modifier(mod);
|
||||
m = _ecore_xcb_event_modifier(mod);
|
||||
if (any_mod) m = XCB_BUTTON_MASK_ANY;
|
||||
locks[0] = 0;
|
||||
locks[1] = ECORE_X_LOCK_CAPS;
|
||||
|
@ -1649,7 +1658,7 @@ ecore_x_window_key_grab(Ecore_X_Window window,
|
|||
/* } */
|
||||
if (keycode == 0) return;
|
||||
|
||||
m = _ecore_x_event_modifier(mod);
|
||||
m = _ecore_xcb_event_modifier(mod);
|
||||
if (any_mod) m = XCB_BUTTON_MASK_ANY;
|
||||
locks[0] = 0;
|
||||
locks[1] = ECORE_X_LOCK_CAPS;
|
||||
|
@ -1715,7 +1724,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window window,
|
|||
/* } */
|
||||
if (keycode == 0) return;
|
||||
|
||||
m = _ecore_x_event_modifier(mod);
|
||||
m = _ecore_xcb_event_modifier(mod);
|
||||
if (any_mod) m = XCB_BUTTON_MASK_ANY;
|
||||
locks[0] = 0;
|
||||
locks[1] = ECORE_X_LOCK_CAPS;
|
||||
|
@ -1969,7 +1978,7 @@ ecore_x_pointer_last_xy_get(int *x,
|
|||
/*****************************************************************************/
|
||||
|
||||
static int
|
||||
_ecore_x_event_modifier(unsigned int state)
|
||||
_ecore_xcb_event_modifier(unsigned int state)
|
||||
{
|
||||
int xmodifiers = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue