ecore-x.pc \
ecore-win32.pc \
ecore-sdl.pc \
+ ecore-input.pc.in \
+ ecore-input.pc \
ecore-quartz.pc \
ecore-wince.pc \
ecore.pc \
endif
if BUILD_ECORE_X
-px = ecore-x.pc
+px = ecore-x.pc ecore-input.pc
endif
if BUILD_ECORE_WIN32
endif
if BUILD_ECORE_SDL
-psdl = ecore-sdl.pc
+psdl = ecore-sdl.pc ecore-input.pc
endif
if BUILD_ECORE_QUARTZ
requirements_ecore_con=""
requirements_ecore_config=""
requirements_ecore_directfb=""
+requirements_ecore_input=""
requirements_ecore_evas=""
requirements_ecore_fb=""
requirements_ecore_file=""
requirements_ecore_win32="ecore eina-0 ${requirements_ecore_win32}"
requirements_ecore_wince="ecore eina-0 ${requirements_ecore_wince}"
+dnl ecore_input
+ECORE_CHECK_MODULE([Input], [yes])
+requirements_ecore_evas="ecore-input ${requirements_ecore_evas}"
+requirements_ecore_sdl="ecore-input ${requirements_ecore_sdl}"
+requirements_ecore_x="ecore-input ${requirements_ecore_x}"
# iconv library (ecore_txt)
AC_SUBST(requirements_ecore_con)
AC_SUBST(requirements_ecore_config)
AC_SUBST(requirements_ecore_directfb)
+AC_SUBST(requirements_ecore_input)
AC_SUBST(requirements_ecore_evas)
AC_SUBST(requirements_ecore_fb)
AC_SUBST(requirements_ecore_file)
ecore-job.pc
ecore-txt.pc
ecore-x.pc
+ecore-input.pc
ecore-win32.pc
ecore-sdl.pc
ecore-quartz.pc
src/lib/ecore_con/Makefile
src/lib/ecore_imf/Makefile
src/lib/ecore_imf_evas/Makefile
+src/lib/ecore_input/Makefile
src/lib/ecore_ipc/Makefile
src/lib/ecore_txt/Makefile
src/lib/ecore_config/Makefile
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: ecore-input
+Description: E core library, Input module
+Requires: ecore @requirements_ecore_input@
+Version: @VERSION@
+Libs: -L${libdir} -lecore_input
+Cflags: -I${includedir}
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = \
ecore \
+ecore_input \
ecore_job \
ecore_txt \
ecore_fb \
ecore_evas \
ecore_config \
ecore_file \
+ecore_input \
ecore_imf \
ecore_imf_evas
typedef struct _Ecore_Evas Ecore_Evas;
#endif
+#include <Ecore_Input.h>
+
/* module setup/shutdown calls */
EAPI int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine);
EAPI int ecore_evas_sticky_get(const Ecore_Evas *ee);
EAPI void ecore_evas_ignore_events_set(Ecore_Evas *ee, int ignore);
EAPI int ecore_evas_ignore_events_get(const Ecore_Evas *ee);
-EAPI void *ecore_evas_window_get(const Ecore_Evas *ee);
+EAPI Ecore_Window ecore_evas_window_get(const Ecore_Evas *ee);
EAPI int ecore_evas_object_associate(Ecore_Evas *ee, Evas_Object *obj, Ecore_Evas_Object_Associate_Flags flags);
if BUILD_ECORE_SDL
ECORE_SDL_INC = -I$(top_srcdir)/src/lib/ecore_sdl @SDL_CFLAGS@
ECORE_SDL_LIB = $(top_builddir)/src/lib/ecore_sdl/libecore_sdl.la
+ECORE_SDL_LIBADD = @SDL_LIBS@ $(ECORE_SDL_LIB)
else
ECORE_SDL_INC =
ECORE_SDL_LIB =
+ECORE_SDL_LIBADD =
endif
if BUILD_ECORE_QUARTZ
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib/ecore \
-I$(top_srcdir)/src/lib/ecore_evas \
+-I$(top_srcdir)/src/lib/ecore_input \
-I$(top_builddir)/src/lib/ecore \
-I$(top_builddir)/src/lib/ecore_evas \
+-I$(top_builddir)/src/lib/ecore_input \
@EFL_ECORE_EVAS_BUILD@ \
$(ECORE_X_INC) \
$(ECORE_FB_INC) \
$(ECORE_DIRECTFB_LIB) \
$(ECORE_WIN32_LIB) \
$(ECORE_SDL_LIB) \
+$(ECORE_SDL_LIBADD) \
$(ECORE_QUARTZ_LIB) \
$(ECORE_WINCE_LIB) \
$(top_builddir)/src/lib/ecore/libecore.la \
+$(top_builddir)/src/lib/ecore_input/libecore_input.la \
@EVAS_LIBS@ \
@XCB_LIBS@ \
@SDL_LIBS@ \
#include <string.h>
#include "Ecore.h"
+#include "Ecore_Evas.h"
+#include "Ecore_Input.h"
+
#include "ecore_private.h"
#include "ecore_evas_private.h"
-#include "Ecore_Evas.h"
static int _ecore_evas_init_count = 0;
static Ecore_Fd_Handler *_ecore_evas_async_events_fd = NULL;
return ee->ignore_events ? 1 : 0;
}
-EAPI void *
+EAPI Ecore_Window
ecore_evas_window_get(const Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"ecore_evas_window_get");
- return NULL;
+ return 0;
}
- if (ee->engine.func->fn_window_get) return ee->engine.func->fn_window_get(ee);
- return NULL;
+ return ee->prop.window;
}
/* fps debug calls - for debugging how much time your app actually spends */
#endif
#include "Ecore.h"
+#include "Ecore_Evas.h"
+#include "Ecore_Input.h"
+
#include "ecore_private.h"
#include "ecore_evas_private.h"
-#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
static int _ecore_evas_init_count = 0;
static Ecore_Evas *ecore_evases = NULL;
-static void
-_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
-{
- ee->mouse.x = x;
- ee->mouse.y = y;
- evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
-}
-
static int
_ecore_evas_buffer_init(void)
{
x = ev->cur.canvas.x;
y = ev->cur.canvas.y;
_ecore_evas_buffer_coord_translate(ee, &x, &y);
- _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp);
+ ecore_evas_mouse_move_process(ee, x, y, ev->timestamp);
}
static void
NULL,
NULL,
NULL,
- NULL,
- NULL,
NULL
};
#endif
#include <string.h>
#include "Ecore.h"
-#include "ecore_private.h"
-#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_DIRECTFB
#include "Ecore_DirectFB.h"
#endif
+#include "ecore_private.h"
+#include "ecore_evas_private.h"
#ifdef BUILD_ECORE_EVAS_DIRECTFB
static int _ecore_evas_init_count = 0;
return 1;
}
-static char *
-_ecore_evas_directfb_winid_str_get(Ecore_X_Window win)
-{
- const char *vals = "qWeRtYuIoP5-$&<~";
- static char id[9];
- unsigned int val;
- val = (unsigned int)win;
- id[0] = vals[(val >> 28) & 0xf];
- id[1] = vals[(val >> 24) & 0xf];
- id[2] = vals[(val >> 20) & 0xf];
- id[3] = vals[(val >> 16) & 0xf];
- id[4] = vals[(val >> 12) & 0xf];
- id[5] = vals[(val >> 8) & 0xf];
- id[6] = vals[(val >> 4) & 0xf];
- id[7] = vals[(val ) & 0xf];
- id[8] = 0;
- return id;
-}
-
-
-static Ecore_Evas *
-_ecore_evas_directfb_match(DFBWindowID win)
-{
- Ecore_Evas *ee;
-
- ee = eina_hash_find(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(win));
- return ee;
-}
-
-static void
-_ecore_evas_directfb_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
-{
- ee->mouse.x = x;
- ee->mouse.y = y;
-
- if (ee->prop.cursor.object)
- {
- evas_object_show(ee->prop.cursor.object);
- if (ee->rotation == 0)
- evas_object_move(ee->prop.cursor.object,x - ee->prop.cursor.hot.x,y - ee->prop.cursor.hot.y);
- else if (ee->rotation == 90)
- evas_object_move(ee->prop.cursor.object,
- ee->h - y - 1 - ee->prop.cursor.hot.x,
- x - ee->prop.cursor.hot.y);
- else if (ee->rotation == 180)
- evas_object_move(ee->prop.cursor.object,
- ee->w - x - 1 - ee->prop.cursor.hot.x,
- ee->h - y - 1 - ee->prop.cursor.hot.y);
- else if (ee->rotation == 270)
- evas_object_move(ee->prop.cursor.object,
- y - ee->prop.cursor.hot.x,
- ee->w - x - 1 - ee->prop.cursor.hot.y);
- }
- if (ee->rotation == 0)
- evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
- else if (ee->rotation == 90)
- evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
- else if (ee->rotation == 180)
- evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
- else if (ee->rotation == 270)
- evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
-}
-
-
static int
_ecore_evas_directfb_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
- _ecore_evas_directfb_mouse_move_process(ee, e->x, e->y, e->time);
+ ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
return 1;
}
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
- // _ecore_evas_directfb_mouse_move_process(ee, e->x, e->y, e->time);
+ // ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
evas_event_feed_mouse_down(ee->evas, e->button, EVAS_BUTTON_NONE, e->time, NULL);
return 1;
}
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
- //_ecore_evas_directfb_mouse_move_process(ee, e->x, e->y, e->time);
+ //ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
evas_event_feed_mouse_up(ee->evas, e->button, flags, e->time, NULL);
return 1;
}
if (!ee) return 1; /* pass on event */
evas_event_feed_mouse_in(ee->evas, e->time, NULL);
- //_ecore_evas_directfb_mouse_move_process(ee, e->x, e->y, e->time);
+ //ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
return 1;
}
if (!ee) return 1; /* pass on event */
evas_event_feed_mouse_out(ee->evas, e->time, NULL);
- //_ecore_evas_directfb_mouse_move_process(ee, e->x, e->y, e->time);
+ //ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
return 1;
NULL, /* withdrawn */
NULL, /* sticky */
NULL, /* ignore events */
- NULL, /* alpha */
- _ecore_evas_directfb_window_get /* window_get */
+ NULL /* alpha */
};
#endif
#include <dirent.h>
#include "Ecore.h"
-#include "ecore_private.h"
-#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_FB
#include "Ecore_Fb.h"
#include "ecore_fb_private.h"
#endif
+#include "ecore_private.h"
+#include "ecore_evas_private.h"
+
#ifdef BUILD_ECORE_EVAS_FB
static int _ecore_evas_init_count = 0;
NULL,
NULL,
NULL,
- _ecore_evas_fullscreen_set,
NULL,
NULL,
+ _ecore_evas_fullscreen_set,
+ NULL,
NULL,
NULL
};
# include <config.h>
#endif
+#include "ecore_private.h"
#include "Ecore_Data.h"
#include <sys/types.h>
#define IDLE_FLUSH_TIME 0.5
+#ifndef _ECORE_EVAS_H
+typedef struct _Ecore_Evas Ecore_Evas;
+#endif
-typedef struct _Ecore_Evas Ecore_Evas;
typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
typedef struct _Ecore_Evas_Engine_Func Ecore_Evas_Engine_Func;
void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
- void *(*fn_window_get) (const Ecore_Evas *ee);
};
struct _Ecore_Evas_Engine
#if defined (BUILD_ECORE_EVAS_SOFTWARE_X11) || defined (BUILD_ECORE_EVAS_SOFTWARE_XCB)
struct {
Ecore_X_Window win_root;
- Ecore_X_Window win;
Eina_List *win_extra;
Ecore_X_Pixmap pmap;
Ecore_X_Pixmap mask;
} hot;
} cursor;
int layer;
+ Ecore_Window window;
unsigned char avoid_damage;
char focused : 1;
char iconified : 1;
#endif
#include "Ecore.h"
+#include "Ecore_Evas.h"
+
#include "ecore_private.h"
#include "ecore_evas_private.h"
-#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_QUARTZ
#include "Ecore_Quartz.h"
#endif
#include "Ecore.h"
-#include "ecore_private.h"
-#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
+#include "Ecore_Input.h"
#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
#include "Ecore_Sdl.h"
#include "Evas_Engine_SDL.h"
#endif
+#include "ecore_evas_private.h"
+
#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
/* static char *ecore_evas_default_display = "0"; */
static int _ecore_evas_fps_debug = 0;
#endif /* _WIN32 */
static Ecore_Evas *ecore_evases = NULL;
-static Ecore_Event_Handler *ecore_evas_event_handlers[10] = {
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+static Ecore_Event_Handler *ecore_evas_event_handlers[4] = {
+ NULL, NULL, NULL, NULL
};
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
-static Ecore_Idler *ecore_evas_event = NULL;
+static Ecore_Poller *ecore_evas_event = NULL;
static const char *ecore_evas_sdl_default = "EFL SDL";
-static void
-_ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
-{
- ee->mouse.x = x;
- ee->mouse.y = y;
- if (ee->prop.cursor.object)
- {
- evas_object_show(ee->prop.cursor.object);
- evas_object_move(ee->prop.cursor.object,
- x - ee->prop.cursor.hot.x,
- y - ee->prop.cursor.hot.y);
- }
- evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
-}
-
static Ecore_Evas *
_ecore_evas_sdl_match(void)
{
}
static int
-_ecore_evas_sdl_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Sdl_Event_Key_Down *e;
- Ecore_Evas *ee;
-
- e = event;
- ee = _ecore_evas_sdl_match();
-
- if (!ee) return 1;
- /* pass on event */
- evas_event_feed_key_down(ee->evas, e->keyname, NULL, e->keycompose, NULL, e->time, NULL);
-
- return 0; /* dont pass it on */
-}
-
-static int
-_ecore_evas_sdl_event_key_up(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Sdl_Event_Key_Up *e;
- Ecore_Evas *ee;
-
- e = event;
- ee = _ecore_evas_sdl_match();
-
- if (!ee) return 1;
- /* pass on event */
- evas_event_feed_key_up(ee->evas, e->keyname, NULL, e->keycompose, NULL, e->time, NULL);
-
- return 0;
-}
-
-static int
-_ecore_evas_sdl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Sdl_Event_Mouse_Move *e;
- Ecore_Evas *ee;
-
- e = event;
- ee = _ecore_evas_sdl_match();
-
- if (!ee) return 1; /* pass on event */
- _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
-
- return 0;
-}
-
-static int
-_ecore_evas_sdl_event_button_down(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Sdl_Event_Mouse_Button_Down *e;
- Ecore_Evas *ee;
- Evas_Button_Flags flags;
-
- e = event;
- ee = _ecore_evas_sdl_match();
- flags = EVAS_BUTTON_NONE;
-
- if (!ee) return 1;
- /* pass on event */
- _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
- if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
- if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
- evas_event_feed_mouse_down(ee->evas, e->button, flags, e->time, NULL);
-
- return 0;
-}
-
-static int
-_ecore_evas_sdl_event_button_up(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Sdl_Event_Mouse_Button_Up *e;
- Ecore_Evas *ee;
- Evas_Button_Flags flags;
-
- e = event;
- ee = _ecore_evas_sdl_match();
- flags = EVAS_BUTTON_NONE;
-
- if (!ee) return 1;
- /* pass on event */
- _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
- if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
- if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
- evas_event_feed_mouse_up(ee->evas, e->button, flags, e->time, NULL);
-
- return 0;
-}
-
-static int
-_ecore_evas_sdl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Sdl_Event_Mouse_Wheel *e;
- Ecore_Evas *ee;
-
- e = event;
- ee = _ecore_evas_sdl_match();
-
- if (!ee) return 1; /* pass on event */
- _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
- evas_event_feed_mouse_wheel(ee->evas, e->direction, e->wheel, e->time, NULL);
-
- return 0;
-}
-
-static int
_ecore_evas_sdl_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
#endif /* _WIN32 */
ecore_evas_idle_enterer = ecore_idle_enterer_add(_ecore_evas_idle_enter, NULL);
- ecore_evas_event = ecore_timer_add(0.008, _ecore_evas_sdl_event, NULL);
+ ecore_evas_event = ecore_poller_add(ECORE_POLLER_CORE, 1, _ecore_evas_sdl_event, NULL);
+ ecore_poller_poll_interval_set(ECORE_POLLER_CORE, 0.006);
#ifndef _WIN32
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
#endif /* _WIN32 */
- ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_SDL_EVENT_KEY_DOWN, _ecore_evas_sdl_event_key_down, NULL);
- ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_SDL_EVENT_KEY_UP, _ecore_evas_sdl_event_key_up, NULL);
- ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_SDL_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_sdl_event_button_down, NULL);
- ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_SDL_EVENT_MOUSE_BUTTON_UP, _ecore_evas_sdl_event_button_up, NULL);
- ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_SDL_EVENT_MOUSE_MOVE, _ecore_evas_sdl_event_mouse_move, NULL);
- ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_SDL_EVENT_MOUSE_WHEEL, _ecore_evas_sdl_event_mouse_wheel, NULL);
- ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_SDL_EVENT_GOT_FOCUS, _ecore_evas_sdl_event_got_focus, NULL);
- ecore_evas_event_handlers[7] = ecore_event_handler_add(ECORE_SDL_EVENT_LOST_FOCUS, _ecore_evas_sdl_event_lost_focus, NULL);
- ecore_evas_event_handlers[8] = ecore_event_handler_add(ECORE_SDL_EVENT_RESIZE, _ecore_evas_sdl_event_video_resize, NULL);
- ecore_evas_event_handlers[9] = ecore_event_handler_add(ECORE_SDL_EVENT_EXPOSE, _ecore_evas_sdl_event_video_expose, NULL);
+ ecore_evas_event_init();
+
+ ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_SDL_EVENT_GOT_FOCUS, _ecore_evas_sdl_event_got_focus, NULL);
+ ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_SDL_EVENT_LOST_FOCUS, _ecore_evas_sdl_event_lost_focus, NULL);
+ ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_SDL_EVENT_RESIZE, _ecore_evas_sdl_event_video_resize, NULL);
+ ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_SDL_EVENT_EXPOSE, _ecore_evas_sdl_event_video_expose, NULL);
return _ecore_evas_init_count;
}
{
int i;
- while (ecore_evases) _ecore_evas_free(ecore_evases);
+ while (ecore_evases) _ecore_evas_free(ecore_evases);
for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler*); i++)
ecore_event_handler_del(ecore_evas_event_handlers[i]);
+ ecore_evas_event_shutdown();
ecore_idle_enterer_del(ecore_evas_idle_enterer);
ecore_evas_idle_enterer = NULL;
- ecore_timer_del(ecore_evas_event);
+ ecore_poller_del(ecore_evas_event);
ecore_evas_event = NULL;
#ifndef _WIN32
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
_ecore_evas_sdl_free(Ecore_Evas *ee)
{
ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+ ecore_evas_unregister(ee, 0);
_ecore_evas_sdl_shutdown();
ecore_sdl_shutdown();
}
NULL,
NULL,
NULL,
- NULL,
NULL
};
if (ecore_evases) return NULL;
- if (!ecore_sdl_init(name)) return NULL;
-
ee = calloc(1, sizeof(Ecore_Evas));
if (!ee) return NULL;
ee->prop.fullscreen = fullscreen;
ee->prop.withdrawn = 0;
ee->prop.sticky = 0;
+ ee->prop.window = 0;
/* init evas here */
ee->evas = evas_new();
einfo->info.alpha = alpha;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
- evas_key_modifier_add(ee->evas, "Shift");
- evas_key_modifier_add(ee->evas, "Control");
- evas_key_modifier_add(ee->evas, "Alt");
- evas_key_modifier_add(ee->evas, "Meta");
- evas_key_modifier_add(ee->evas, "Hyper");
- evas_key_modifier_add(ee->evas, "Super");
- evas_key_lock_add(ee->evas, "Caps_Lock");
- evas_key_lock_add(ee->evas, "Num_Lock");
- evas_key_lock_add(ee->evas, "Scroll_Lock");
+ ecore_evas_register(ee, 0);
evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
+ if (!ecore_sdl_init(name))
+ {
+ evas_free(ee->evas);
+ if (ee->name) free(ee->name);
+ free(ee);
+ return NULL;
+ }
+
_ecore_evas_sdl_init(w, h);
SDL_ShowCursor(SDL_DISABLE);
#include <string.h>
#include "Ecore.h"
-#include "ecore_private.h"
-#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
+#include "ecore_private.h"
+#include "ecore_evas_private.h"
static const char ASSOCIATE_KEY[] = "__Ecore_Evas_Associate";
#include <stdlib.h> /* for NULL */
#include "Ecore.h"
-#include "ecore_private.h"
#ifdef BUILD_ECORE_EVAS_WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include "ecore_win32_private.h"
#endif /* BUILD_ECORE_EVAS_WIN32 */
-#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
+#include "ecore_private.h"
+#include "ecore_evas_private.h"
#ifdef BUILD_ECORE_EVAS_WIN32
#include <stdlib.h> /* for NULL */
#include "Ecore.h"
-#include "ecore_private.h"
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include "ecore_wince_private.h"
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_WINCE */
-#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
+#include "ecore_private.h"
+#include "ecore_evas_private.h"
#ifdef BUILD_ECORE_EVAS_SOFTWARE_16_WINCE
#include <string.h>
#include "Ecore.h"
-#include "ecore_private.h"
+#include "Ecore_Evas.h"
+#include "Ecore_Input.h"
#ifdef BUILD_ECORE_EVAS_X11
# include "Ecore_X.h"
# include "Ecore_X_Atoms.h"
#endif
#include "ecore_evas_private.h"
-#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_X11
static int _ecore_evas_init_count = 0;
static int _ecore_evas_fps_debug = 0;
static Ecore_Evas *ecore_evases = NULL;
-static Eina_Hash *ecore_evases_hash = NULL;
-static Ecore_Event_Handler *ecore_evas_event_handlers[18];
+static Ecore_Event_Handler *ecore_evas_event_handlers[12];
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
#ifdef HAVE_ECORE_X_XCB
if (updates)
{
EINA_LIST_FOREACH(updates, l, r)
- ecore_x_window_area_clear(ee->engine.x.win, r->x, r->y, r->w, r->h);
+ ecore_x_window_area_clear(ee->prop.window, r->x, r->y, r->w, r->h);
if ((ee->shaped) && (updates))
- ecore_x_window_shape_mask_set(ee->engine.x.win, ee->engine.x.mask);
+ ecore_x_window_shape_mask_set(ee->prop.window, ee->engine.x.mask);
if ((ee->alpha) && (updates))
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, ee->engine.x.mask);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, ee->engine.x.mask);
evas_render_updates_free(updates);
_ecore_evas_idle_timeout_update(ee);
rend = 1;
{
/* if we have a damage pixmap - we can avoid exposures by
* disabling them just for setting the mask */
- ecore_x_event_mask_set(ee->engine.x.win,
+ ecore_x_event_mask_set(ee->prop.window,
ECORE_X_EVENT_MASK_KEY_DOWN |
ECORE_X_EVENT_MASK_KEY_UP |
ECORE_X_EVENT_MASK_MOUSE_DOWN |
ECORE_X_EVENT_MASK_WINDOW_COLORMAP
);
if ((ee->shaped) && (updates))
- ecore_x_window_shape_mask_set(ee->engine.x.win, ee->engine.x.mask);
+ ecore_x_window_shape_mask_set(ee->prop.window, ee->engine.x.mask);
/* and re-enable them again */
- ecore_x_event_mask_set(ee->engine.x.win,
+ ecore_x_event_mask_set(ee->prop.window,
ECORE_X_EVENT_MASK_KEY_DOWN |
ECORE_X_EVENT_MASK_KEY_UP |
ECORE_X_EVENT_MASK_MOUSE_DOWN |
/* debug rendering */
/*
XSetForeground(ecore_x_display_get(), ee->engine.x.gc, rand());
- XFillRectangle(ecore_x_display_get(), ee->engine.x.win, ee->engine.x.gc,
+ XFillRectangle(ecore_x_display_get(), ee->prop.window, ee->engine.x.gc,
0, 0, ee->w, ee->h);
XSync(ecore_x_display_get(), False);
usleep(20000);
XSync(ecore_x_display_get(), False);
*/
- ecore_x_pixmap_paste(ee->engine.x.pmap, ee->engine.x.win, ee->engine.x.gc,
+ ecore_x_pixmap_paste(ee->engine.x.pmap, ee->prop.window, ee->engine.x.gc,
0, 0, ee->w, ee->h, 0, 0);
XDestroyRegion(ee->engine.x.damages);
ee->engine.x.damages = 0;
updates = evas_render_updates(ee->evas);
if (updates)
{
- ecore_x_window_shape_mask_set(ee->engine.x.win, ee->engine.x.mask);
+ ecore_x_window_shape_mask_set(ee->prop.window, ee->engine.x.mask);
evas_render_updates_free(updates);
_ecore_evas_idle_timeout_update(ee);
rend = 1;
{
evas_render_updates_free(updates);
if (ee->alpha)
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, ee->engine.x.mask);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, ee->engine.x.mask);
_ecore_evas_idle_timeout_update(ee);
rend = 1;
}
return rend;
}
-static void
-_ecore_evas_x_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
-{
- ee->mouse.x = x;
- ee->mouse.y = y;
- if (ee->prop.cursor.object)
- {
- evas_object_show(ee->prop.cursor.object);
- if (ee->rotation == 0)
- evas_object_move(ee->prop.cursor.object,
- x - ee->prop.cursor.hot.x,
- y - ee->prop.cursor.hot.y);
- else if (ee->rotation == 90)
- evas_object_move(ee->prop.cursor.object,
- ee->h - y - 1 - ee->prop.cursor.hot.x,
- x - ee->prop.cursor.hot.y);
- else if (ee->rotation == 180)
- evas_object_move(ee->prop.cursor.object,
- ee->w - x - 1 - ee->prop.cursor.hot.x,
- ee->h - y - 1 - ee->prop.cursor.hot.y);
- else if (ee->rotation == 270)
- evas_object_move(ee->prop.cursor.object,
- y - ee->prop.cursor.hot.x,
- ee->w - x - 1 - ee->prop.cursor.hot.y);
- }
- if (ee->rotation == 0)
- evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
- else if (ee->rotation == 90)
- evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
- else if (ee->rotation == 180)
- evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
- else if (ee->rotation == 270)
- evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
-}
-
static char *
_ecore_evas_x_winid_str_get(Ecore_X_Window win)
{
return id;
}
-static Ecore_Evas *
-_ecore_evas_x_match(Ecore_X_Window win)
-{
- Ecore_Evas *ee;
-
- ee = eina_hash_find(ecore_evases_hash, _ecore_evas_x_winid_str_get(win));
- return ee;
-}
-
static void
_ecore_evas_x_resize_shape(Ecore_Evas *ee)
{
# endif /* ! BUILD_ECORE_EVAS_SOFTWARE_XCB */
if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
# ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
gc = xcb_generate_id(ecore_x_connection_get());
value_list = 0;
# endif /* ! BUILD_ECORE_EVAS_XRENDER_XCB */
if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
# ifdef BUILD_ECORE_EVAS_XRENDER_XCB
gc = xcb_generate_id(ecore_x_connection_get());
value_list = 0;
XGCValues gcv;
if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
einfo->info.mask = ee->engine.x.mask;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
}
}
-static void
-_ecore_evas_x_modifier_locks_update(Ecore_Evas *ee, int modifiers)
-{
- if (modifiers & ECORE_X_MODIFIER_SHIFT)
- evas_key_modifier_on(ee->evas, "Shift");
- else
- evas_key_modifier_off(ee->evas, "Shift");
- if (modifiers & ECORE_X_MODIFIER_CTRL)
- evas_key_modifier_on(ee->evas, "Control");
- else
- evas_key_modifier_off(ee->evas, "Control");
- if (modifiers & ECORE_X_MODIFIER_ALT)
- evas_key_modifier_on(ee->evas, "Alt");
- else
- evas_key_modifier_off(ee->evas, "Alt");
- if (modifiers & ECORE_X_MODIFIER_WIN)
- {
- evas_key_modifier_on(ee->evas, "Super");
- evas_key_modifier_on(ee->evas, "Hyper");
- }
- else
- {
- evas_key_modifier_off(ee->evas, "Super");
- evas_key_modifier_off(ee->evas, "Hyper");
- }
- if (modifiers & ECORE_X_LOCK_SCROLL)
- evas_key_lock_on(ee->evas, "Scroll_Lock");
- else
- evas_key_lock_off(ee->evas, "Scroll_Lock");
- if (modifiers & ECORE_X_LOCK_NUM)
- evas_key_lock_on(ee->evas, "Num_Lock");
- else
- evas_key_lock_off(ee->evas, "Num_Lock");
- if (modifiers & ECORE_X_LOCK_CAPS)
- evas_key_lock_on(ee->evas, "Caps_Lock");
- else
- evas_key_lock_off(ee->evas, "Caps_Lock");
-}
-
-static int
-_ecore_evas_x_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_X_Event_Key_Down *e;
-
- e = event;
- ee = _ecore_evas_x_match(e->win);
- if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
- evas_event_feed_key_down(ee->evas, e->keyname, e->keysymbol, e->key_compose, NULL, e->time, NULL);
- return 1;
-}
-
-static int
-_ecore_evas_x_event_key_up(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_X_Event_Key_Up *e;
-
- e = event;
- ee = _ecore_evas_x_match(e->win);
- if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
- evas_event_feed_key_up(ee->evas, e->keyname, e->keysymbol, e->key_compose, NULL, e->time, NULL);
- return 1;
-}
-
-static int
-_ecore_evas_x_event_mouse_button_down(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_X_Event_Mouse_Button_Down *e;
- Evas_Button_Flags flags = EVAS_BUTTON_NONE;
-
- e = event;
- ee = _ecore_evas_x_match(e->win);
- if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
- if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
- if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
- evas_event_feed_mouse_down(ee->evas, e->button, flags, e->time, NULL);
- return 1;
-}
-
-static int
-_ecore_evas_x_event_mouse_button_up(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_X_Event_Mouse_Button_Up *e;
- Evas_Button_Flags flags = EVAS_BUTTON_NONE;
-
- e = event;
- ee = _ecore_evas_x_match(e->win);
- if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
- if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
- if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
- evas_event_feed_mouse_up(ee->evas, e->button, flags, e->time, NULL);
- return 1;
-}
-
-static int
-_ecore_evas_x_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_X_Event_Mouse_Wheel *e;
-
- e = event;
- ee = _ecore_evas_x_match(e->win);
- if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
- evas_event_feed_mouse_wheel(ee->evas, e->direction, e->z, e->time, NULL);
-
- return 1;
-}
-
/* TODO: we need to make this work for all the states, not just sticky */
static int
_ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__, void *event)
Ecore_X_Event_Window_Property *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (e->atom == ECORE_X_ATOM_NET_WM_STATE)
{
unsigned int i, num;
Ecore_X_Event_Window_Visibility_Change *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if (!ee) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
// printf("VIS CHANGE OBSCURED: %p %i\n", ee, e->fully_obscured);
if (e->fully_obscured) ee->draw_ok = 0;
else ee->draw_ok = 1;
}
static int
-_ecore_evas_x_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_X_Event_Mouse_Move *e;
-
- e = event;
- ee = _ecore_evas_x_match(e->win);
- if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
- _ecore_evas_x_mouse_move_process(ee, e->x, e->y, e->time);
- return 1;
-}
-
-static int
_ecore_evas_x_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
Ecore_X_Event_Mouse_In *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
-/*
- {
- time_t t;
- char *ct;
-
- const char *modes[] = {
- "MODE_NORMAL",
- "MODE_WHILE_GRABBED",
- "MODE_GRAB",
- "MODE_UNGRAB"
- };
- const char *details[] = {
- "DETAIL_ANCESTOR",
- "DETAIL_VIRTUAL",
- "DETAIL_INFERIOR",
- "DETAIL_NON_LINEAR",
- "DETAIL_NON_LINEAR_VIRTUAL",
- "DETAIL_POINTER",
- "DETAIL_POINTER_ROOT",
- "DETAIL_DETAIL_NONE"
- };
- t = time(NULL);
- ct = ctime(&t);
- ct[strlen(ct) - 1] = 0;
- printf("@@ ->IN 0x%x 0x%x %s md=%s dt=%s\n",
- e->win, e->event_win,
- ct,
- modes[e->mode],
- details[e->detail]);
- }
- */
-// disable. causes mroe problems than it fixes
-// if ((e->mode == ECORE_X_EVENT_MODE_GRAB) ||
-// (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
-// return 0;
-/* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
+ if (e->win != ee->prop.window) return 1;
+/* { */
+/* time_t t; */
+/* char *ct; */
+
+/* const char *modes[] = { */
+/* "MODE_NORMAL", */
+/* "MODE_WHILE_GRABBED", */
+/* "MODE_GRAB", */
+/* "MODE_UNGRAB" */
+/* }; */
+/* const char *details[] = { */
+/* "DETAIL_ANCESTOR", */
+/* "DETAIL_VIRTUAL", */
+/* "DETAIL_INFERIOR", */
+/* "DETAIL_NON_LINEAR", */
+/* "DETAIL_NON_LINEAR_VIRTUAL", */
+/* "DETAIL_POINTER", */
+/* "DETAIL_POINTER_ROOT", */
+/* "DETAIL_DETAIL_NONE" */
+/* }; */
+/* t = time(NULL); */
+/* ct = ctime(&t); */
+/* ct[strlen(ct) - 1] = 0; */
+/* printf("@@ ->IN 0x%x 0x%x %s md=%s dt=%s\n", */
+/* e->win, e->event_win, */
+/* ct, */
+/* modes[e->mode], */
+/* details[e->detail]); */
+/* } */
+ // disable. causes mroe problems than it fixes
+ // if ((e->mode == ECORE_X_EVENT_MODE_GRAB) ||
+ // (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
+ // return 0;
+ /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
+ ecore_evas_event_modifier_lock_update(ee->evas, e->modifiers);
evas_event_feed_mouse_in(ee->evas, e->time, NULL);
- _ecore_evas_x_mouse_move_process(ee, e->x, e->y, e->time);
+ ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
return 1;
}
Ecore_X_Event_Mouse_Out *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
- if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
-/*
- {
- time_t t;
- char *ct;
-
- const char *modes[] = {
- "MODE_NORMAL",
- "MODE_WHILE_GRABBED",
- "MODE_GRAB",
- "MODE_UNGRAB"
- };
- const char *details[] = {
- "DETAIL_ANCESTOR",
- "DETAIL_VIRTUAL",
- "DETAIL_INFERIOR",
- "DETAIL_NON_LINEAR",
- "DETAIL_NON_LINEAR_VIRTUAL",
- "DETAIL_POINTER",
- "DETAIL_POINTER_ROOT",
- "DETAIL_DETAIL_NONE"
- };
- t = time(NULL);
- ct = ctime(&t);
- ct[strlen(ct) - 1] = 0;
- printf("@@ ->OUT 0x%x 0x%x %s md=%s dt=%s\n",
- e->win, e->event_win,
- ct,
- modes[e->mode],
- details[e->detail]);
- }
- */
-// disable. causes more problems than it fixes
-// if ((e->mode == ECORE_X_EVENT_MODE_GRAB) ||
-// (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
-// return 0;
-/* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
- _ecore_evas_x_modifier_locks_update(ee, e->modifiers);
- _ecore_evas_x_mouse_move_process(ee, e->x, e->y, e->time);
+ ee = ecore_evas_window_match(e->win);
+ if ((!ee) || (ee->ignore_events)) return 1;
+ /* pass on event */
+ if (e->win != ee->prop.window) return 1;
+/* { */
+/* time_t t; */
+/* char *ct; */
+
+/* const char *modes[] = { */
+/* "MODE_NORMAL", */
+/* "MODE_WHILE_GRABBED", */
+/* "MODE_GRAB", */
+/* "MODE_UNGRAB" */
+/* }; */
+/* const char *details[] = { */
+/* "DETAIL_ANCESTOR", */
+/* "DETAIL_VIRTUAL", */
+/* "DETAIL_INFERIOR", */
+/* "DETAIL_NON_LINEAR", */
+/* "DETAIL_NON_LINEAR_VIRTUAL", */
+/* "DETAIL_POINTER", */
+/* "DETAIL_POINTER_ROOT", */
+/* "DETAIL_DETAIL_NONE" */
+/* }; */
+/* t = time(NULL); */
+/* ct = ctime(&t); */
+/* ct[strlen(ct) - 1] = 0; */
+/* printf("@@ ->OUT 0x%x 0x%x %s md=%s dt=%s\n", */
+/* e->win, e->event_win, */
+/* ct, */
+/* modes[e->mode], */
+/* details[e->detail]); */
+/* } */
+ // disable. causes more problems than it fixes
+ // if ((e->mode == ECORE_X_EVENT_MODE_GRAB) ||
+ // (e->mode == ECORE_X_EVENT_MODE_UNGRAB))
+ // return 0;
+ /* if (e->mode != ECORE_X_EVENT_MODE_NORMAL) return 0; */
+ ecore_evas_event_modifier_lock_update(ee->evas, e->modifiers);
+ ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
if (e->mode == ECORE_X_EVENT_MODE_GRAB)
evas_event_feed_mouse_cancel(ee->evas, e->time, NULL);
evas_event_feed_mouse_out(ee->evas, e->time, NULL);
Ecore_X_Event_Window_Focus_In *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
ee->prop.focused = 1;
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
return 1;
Ecore_X_Event_Window_Focus_Out *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (ee->prop.fullscreen)
- ecore_x_window_focus(ee->engine.x.win);
+ ecore_x_window_focus(ee->prop.window);
ee->prop.focused = 0;
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
return 1;
Ecore_X_Event_Window_Damage *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if (!ee) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (ee->engine.x.using_bg_pixmap) return 1;
// printf("EXPOSE %p [%i] %i %i %ix%i\n", ee, ee->prop.avoid_damage, e->x, e->y, e->w, e->h);
if (ee->prop.avoid_damage)
Ecore_X_Event_Window_Destroy *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if (!ee) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (ee->func.fn_destroy) ee->func.fn_destroy(ee);
ecore_evas_free(ee);
return 1;
Ecore_X_Event_Window_Configure *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if (!ee) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (ee->engine.x.direct_resize) return 1;
if ((e->from_wm) || (ee->prop.override))
{
if ((ee->expecting_resize.w == ee->w) &&
(ee->expecting_resize.h == ee->h))
- _ecore_evas_x_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
- ecore_x_current_time_get());
+ ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
+ ecore_x_current_time_get());
ee->expecting_resize.w = 0;
ee->expecting_resize.h = 0;
}
Ecore_X_Event_Window_Delete_Request *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if (!ee) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee);
return 1;
}
Ecore_X_Event_Window_Show *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if (!ee) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (ee->visible) return 0; /* dont pass it on */
// printf("SHOW EVENT %p\n", ee);
ee->visible = 1;
Ecore_X_Event_Window_Hide *e;
e = event;
- ee = _ecore_evas_x_match(e->win);
+ ee = ecore_evas_window_match(e->win);
if (!ee) return 1; /* pass on event */
- if (e->win != ee->engine.x.win) return 1;
+ if (e->win != ee->prop.window) return 1;
if (!ee->visible) return 0; /* dont pass it on */
// printf("HIDE EVENT %p\n", ee);
ee->visible = 0;
_ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee)
{
# ifdef HAVE_ECORE_X_XCB
- ecore_x_icccm_size_pos_hints_get_prefetch(ee->engine.x.win);
+ ecore_x_icccm_size_pos_hints_get_prefetch(ee->prop.window);
ecore_x_icccm_size_pos_hints_get_fetch();
# endif /* HAVE_ECORE_X_XCB */
- ecore_x_icccm_size_pos_hints_set(ee->engine.x.win,
+ ecore_x_icccm_size_pos_hints_set(ee->prop.window,
ee->prop.request_pos /*request_pos */,
ECORE_X_GRAVITY_NW /* gravity */,
ee->prop.min.w /* min_w */,
if (ee->engine.x.state.below)
state[num++] = ECORE_X_WINDOW_STATE_BELOW;
- ecore_x_netwm_window_state_set(ee->engine.x.win, state, num);
+ ecore_x_netwm_window_state_set(ee->prop.window, state, num);
}
static void
if (ee->engine.x.state.above)
{
ee->engine.x.state.above = 0;
- ecore_x_netwm_state_request_send(ee->engine.x.win,
+ ecore_x_netwm_state_request_send(ee->prop.window,
ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_ABOVE, -1, 0);
}
if (!ee->engine.x.state.below)
{
ee->engine.x.state.below = 1;
- ecore_x_netwm_state_request_send(ee->engine.x.win,
+ ecore_x_netwm_state_request_send(ee->prop.window,
ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_BELOW, -1, 1);
}
if (ee->engine.x.state.below)
{
ee->engine.x.state.below = 0;
- ecore_x_netwm_state_request_send(ee->engine.x.win,
+ ecore_x_netwm_state_request_send(ee->prop.window,
ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_BELOW, -1, 0);
}
if (!ee->engine.x.state.above)
{
ee->engine.x.state.above = 1;
- ecore_x_netwm_state_request_send(ee->engine.x.win,
+ ecore_x_netwm_state_request_send(ee->prop.window,
ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_ABOVE, -1, 1);
}
if (ee->engine.x.state.below)
{
ee->engine.x.state.below = 0;
- ecore_x_netwm_state_request_send(ee->engine.x.win,
+ ecore_x_netwm_state_request_send(ee->prop.window,
ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_BELOW, -1, 0);
}
if (ee->engine.x.state.above)
{
ee->engine.x.state.above = 0;
- ecore_x_netwm_state_request_send(ee->engine.x.win,
+ ecore_x_netwm_state_request_send(ee->prop.window,
ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_ABOVE, -1, 0);
}
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
if (getenv("ECORE_EVAS_FPS_DEBUG")) _ecore_evas_fps_debug = 1;
ecore_evas_idle_enterer = ecore_idle_enterer_add(_ecore_evas_x_idle_enter, NULL);
- ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, _ecore_evas_x_event_key_down, NULL);
- ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_X_EVENT_KEY_UP, _ecore_evas_x_event_key_up, NULL);
- ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_x_event_mouse_button_down, NULL);
- ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, _ecore_evas_x_event_mouse_button_up, NULL);
- ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, _ecore_evas_x_event_mouse_move, NULL);
- ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _ecore_evas_x_event_mouse_in, NULL);
- ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _ecore_evas_x_event_mouse_out, NULL);
- ecore_evas_event_handlers[7] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, _ecore_evas_x_event_window_focus_in, NULL);
- ecore_evas_event_handlers[8] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _ecore_evas_x_event_window_focus_out, NULL);
- ecore_evas_event_handlers[9] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, _ecore_evas_x_event_window_damage, NULL);
- ecore_evas_event_handlers[10] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_evas_x_event_window_destroy, NULL);
- ecore_evas_event_handlers[11] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, _ecore_evas_x_event_window_configure, NULL);
- ecore_evas_event_handlers[12] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DELETE_REQUEST, _ecore_evas_x_event_window_delete_request, NULL);
- ecore_evas_event_handlers[13] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, _ecore_evas_x_event_window_show, NULL);
- ecore_evas_event_handlers[14] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, _ecore_evas_x_event_window_hide, NULL);
- ecore_evas_event_handlers[15] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_WHEEL, _ecore_evas_x_event_mouse_wheel, NULL);
- ecore_evas_event_handlers[16] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _ecore_evas_x_event_property_change, NULL);
- ecore_evas_event_handlers[17] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, _ecore_evas_x_event_visibility_change, NULL);
+ ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _ecore_evas_x_event_mouse_in, NULL);
+ ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _ecore_evas_x_event_mouse_out, NULL);
+ ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, _ecore_evas_x_event_window_focus_in, NULL);
+ ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _ecore_evas_x_event_window_focus_out, NULL);
+ ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, _ecore_evas_x_event_window_damage, NULL);
+ ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _ecore_evas_x_event_window_destroy, NULL);
+ ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, _ecore_evas_x_event_window_configure, NULL);
+ ecore_evas_event_handlers[7] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DELETE_REQUEST, _ecore_evas_x_event_window_delete_request, NULL);
+ ecore_evas_event_handlers[8] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, _ecore_evas_x_event_window_show, NULL);
+ ecore_evas_event_handlers[9] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, _ecore_evas_x_event_window_hide, NULL);
+ ecore_evas_event_handlers[10] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _ecore_evas_x_event_property_change, NULL);
+ ecore_evas_event_handlers[11] = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, _ecore_evas_x_event_visibility_change, NULL);
+ ecore_evas_event_init();
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
return _ecore_evas_init_count;
}
static void
_ecore_evas_x_free(Ecore_Evas *ee)
{
- ecore_x_window_del(ee->engine.x.win);
+ ecore_x_window_del(ee->prop.window);
if (ee->engine.x.pmap) ecore_x_pixmap_del(ee->engine.x.pmap);
if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
if (ee->engine.x.gc) ecore_x_gc_del(ee->engine.x.gc);
ee->engine.x.mask = 0;
ee->engine.x.gc = 0;
#ifdef HAVE_ECORE_X_XCB
-# warning [XCB] No Region code
+#warning [XCB] No Region code
#else
ee->engine.x.damages = 0;
#endif /* ! HAVE_ECORE_X_XCB */
- eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_evas_unregister(ee, ee->prop.window);
while (ee->engine.x.win_extra)
{
Ecore_X_Window *winp;
winp = ee->engine.x.win_extra->data;
ee->engine.x.win_extra = eina_list_remove_list(ee->engine.x.win_extra, ee->engine.x.win_extra);
- eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(*winp), ee);
+ ecore_evas_unregister(ee, *winp);
free(winp);
}
ecore_evases = _ecore_list2_remove(ecore_evases, ee);
_ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
{
#ifdef HAVE_ECORE_X_XCB
- ecore_x_icccm_protocol_get_prefetch(ee->engine.x.win);
+ ecore_x_icccm_protocol_get_prefetch(ee->prop.window);
ecore_x_icccm_protocol_get_fetch();
#endif /* HAVE_ECORE_X_XCB */
if (func)
- ecore_x_icccm_protocol_set(ee->engine.x.win, ECORE_X_WM_PROTOCOL_DELETE_REQUEST, 1);
+ ecore_x_icccm_protocol_set(ee->prop.window, ECORE_X_WM_PROTOCOL_DELETE_REQUEST, 1);
else
- ecore_x_icccm_protocol_set(ee->engine.x.win, ECORE_X_WM_PROTOCOL_DELETE_REQUEST, 0);
+ ecore_x_icccm_protocol_set(ee->prop.window, ECORE_X_WM_PROTOCOL_DELETE_REQUEST, 0);
ee->func.fn_delete_request = func;
#ifdef HAVE_ECORE_X_XCB
ecore_xcb_reply_free();
{
ee->x = x;
ee->y = y;
- ecore_x_window_move(ee->engine.x.win, x, y);
+ ecore_x_window_move(ee->prop.window, x, y);
if (!ee->should_be_visible)
{
/* We need to request pos */
}
else
{
- ecore_x_window_move(ee->engine.x.win, x, y);
+ ecore_x_window_move(ee->prop.window, x, y);
if (!ee->should_be_visible)
{
/* We need to request pos */
{
if ((ee->w != w) || (ee->h != h))
{
- ecore_x_window_resize(ee->engine.x.win, w, h);
+ ecore_x_window_resize(ee->prop.window, w, h);
ee->w = w;
ee->h = h;
if ((ee->rotation == 90) || (ee->rotation == 270))
}
}
else
- ecore_x_window_resize(ee->engine.x.win, w, h);
+ ecore_x_window_resize(ee->prop.window, w, h);
}
static void
{
if ((x != ee->x) || (y != ee->y)) change_pos = 1;
}
- ecore_x_window_move_resize(ee->engine.x.win, x, y, w, h);
+ ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
if (!ee->engine.x.managed)
{
ee->x = x;
}
else
{
- ecore_x_window_move_resize(ee->engine.x.win, x, y, w, h);
+ ecore_x_window_move_resize(ee->prop.window, x, y, w, h);
if (!ee->engine.x.managed)
{
ee->x = x;
evas_engine_info_set(ee->evas, einfo);
if (!ee->prop.fullscreen)
{
- ecore_x_window_resize(ee->engine.x.win, ee->h, ee->w);
+ ecore_x_window_resize(ee->prop.window, ee->h, ee->w);
ee->expecting_resize.w = ee->h;
ee->expecting_resize.h = ee->w;
}
{
int w, h;
- ecore_x_window_size_get(ee->engine.x.win, &w, &h);
- ecore_x_window_resize(ee->engine.x.win, h, w);
+ ecore_x_window_size_get(ee->prop.window, &w, &h);
+ ecore_x_window_resize(ee->prop.window, h, w);
if ((rotation == 0) || (rotation == 180))
{
evas_output_size_set(ee->evas, ee->w, ee->h);
ecore_evas_size_max_set(ee, maxh, maxw);
ecore_evas_size_base_set(ee, baseh, basew);
ecore_evas_size_step_set(ee, steph, stepw);
- _ecore_evas_x_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
- ecore_x_current_time_get());
+ ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
+ ecore_x_current_time_get());
}
else
{
evas_engine_info_set(ee->evas, einfo);
ee->rotation = rotation;
- _ecore_evas_x_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
- ecore_x_current_time_get());
+ ecore_evas_mouse_move_process(ee, ee->mouse.x, ee->mouse.y,
+ ecore_x_current_time_get());
if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
# endif /* ! BUILD_ECORE_EVAS_SOFTWARE_XCB */
if (!ee->engine.x.mask)
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
# ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
gc = xcb_generate_id(ecore_x_connection_get());
value_list = 0;
einfo->info.mask = ee->engine.x.mask;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
}
else
{
ee->engine.x.mask = 0;
einfo->info.mask = 0;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
- ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_mask_set(ee->prop.window, 0);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
}
}
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 || BUILD_ECORE_EVAS_SOFTWARE_XCB */
# endif /* ! BUILD_ECORE_EVAS_XRENDER_XCB */
if (!ee->engine.x.mask)
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
# ifdef BUILD_ECORE_EVAS_XRENDER_XCB
gc = xcb_generate_id(ecore_x_connection_get());
value_list = 0;
einfo->info.mask = ee->engine.x.mask;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
}
else
{
ee->engine.x.mask = 0;
einfo->info.mask = 0;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
- ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_mask_set(ee->prop.window, 0);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
}
}
#endif /* BUILD_ECORE_EVAS_XRENDER_X11 || BUILD_ECORE_EVAS_XRENDER_XCB */
GC gc;
XGCValues gcv;
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
einfo->info.mask = ee->engine.x.mask;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
ee->engine.x.mask = 0;
einfo->info.mask = 0;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
- ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_mask_set(ee->prop.window, 0);
}
}
# endif /* XXX no shaped window support for software_16_x11 */
ee->shaped = 0;
ee->alpha = alpha;
- ecore_x_window_del(ee->engine.x.win);
- eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_x_window_del(ee->prop.window);
+ ecore_evas_unregister(ee, ee->prop.window);
if (ee->alpha)
{
if (ee->prop.override)
- ee->engine.x.win = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
else
- ee->engine.x.win = ecore_x_window_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
if (!ee->engine.x.mask)
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
}
else
{
if (ee->prop.override)
- ee->engine.x.win = ecore_x_window_override_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_override_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
else
- ee->engine.x.win = ecore_x_window_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
ee->engine.x.mask = 0;
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
}
einfo->info.destination_alpha = alpha;
# ifdef BUILD_ECORE_EVAS_SOFTWARE_XCB
- cookie_geom = xcb_get_geometry_unchecked(ecore_x_connection_get(), ee->engine.x.win);
- cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->engine.x.win);
+ cookie_geom = xcb_get_geometry_unchecked(ecore_x_connection_get(), ee->prop.window);
+ cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->prop.window);
reply_geom = xcb_get_geometry_reply(ecore_x_connection_get(), cookie_geom, NULL);
reply_attr = xcb_get_window_attributes_reply(ecore_x_connection_get(), cookie_attr, NULL);
free(reply_geom);
free(reply_attr);
# else
- XGetWindowAttributes(ecore_x_display_get(), ee->engine.x.win, &att);
+ XGetWindowAttributes(ecore_x_display_get(), ee->prop.window, &att);
einfo->info.visual = att.visual;
einfo->info.colormap = att.colormap;
einfo->info.depth = att.depth;
// if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
// ee->engine.x.mask = 0;
einfo->info.mask = ee->engine.x.mask;
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
- ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_x_window_shape_mask_set(ee->prop.window, 0);
+ ecore_evas_register(ee, ee->prop.window);
if (ee->prop.borderless)
- ecore_x_mwm_borderless_set(ee->engine.x.win, ee->prop.borderless);
- if (ee->visible) ecore_x_window_show(ee->engine.x.win);
- if (ee->prop.focused) ecore_x_window_focus(ee->engine.x.win);
+ ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
+ if (ee->visible) ecore_x_window_show(ee->prop.window);
+ if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
if (ee->prop.title)
{
- ecore_x_icccm_title_set(ee->engine.x.win, ee->prop.title);
- ecore_x_netwm_name_set(ee->engine.x.win, ee->prop.title);
+ ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
+ ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
#endif /* BUILD_ECORE_EVAS_SOFTWARE_X11 || BUILD_ECORE_EVAS_SOFTWARE_XCB */
}
ee->shaped = 0;
ee->alpha = alpha;
- ecore_x_window_del(ee->engine.x.win);
- eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_x_window_del(ee->prop.window);
+ ecore_evas_unregister(ee, ee->prop.window);
if (ee->alpha)
{
if (ee->prop.override)
- ee->engine.x.win = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
else
- ee->engine.x.win = ecore_x_window_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
if (!ee->engine.x.mask)
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
}
else
{
if (ee->prop.override)
- ee->engine.x.win = ecore_x_window_override_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_override_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
else
- ee->engine.x.win = ecore_x_window_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
ee->engine.x.mask = 0;
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
}
einfo->info.destination_alpha = alpha;
# ifdef BUILD_ECORE_EVAS_XRENDER_XCB
- cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->engine.x.win);
+ cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->prop.window);
reply_attr = xcb_get_window_attributes_reply(ecore_x_connection_get(), cookie_attr, NULL);
einfo->info.visual = reply_attr->visual;
free(reply_attr);
# else
- XGetWindowAttributes(ecore_x_display_get(), ee->engine.x.win, &att);
+ XGetWindowAttributes(ecore_x_display_get(), ee->prop.window, &att);
einfo->info.visual = att.visual;
# endif /* ! BUILD_ECORE_EVAS_XRENDER_XCB */
// if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
// ee->engine.x.mask = 0;
einfo->info.mask = ee->engine.x.mask;
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
- ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_x_window_shape_mask_set(ee->prop.window, 0);
+ ecore_evas_register(ee, ee->prop.window);
if (ee->prop.borderless)
- ecore_x_mwm_borderless_set(ee->engine.x.win, ee->prop.borderless);
- if (ee->visible) ecore_x_window_show(ee->engine.x.win);
- if (ee->prop.focused) ecore_x_window_focus(ee->engine.x.win);
+ ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
+ if (ee->visible) ecore_x_window_show(ee->prop.window);
+ if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
if (ee->prop.title)
{
- ecore_x_icccm_title_set(ee->engine.x.win, ee->prop.title);
- ecore_x_netwm_name_set(ee->engine.x.win, ee->prop.title);
+ ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
+ ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
#endif /* BUILD_ECORE_EVAS_XRENDER_X11 || BUILD_ECORE_EVAS_XRENDER_XCB */
}
ee->shaped = 0;
ee->alpha = alpha;
- ecore_x_window_del(ee->engine.x.win);
- eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_x_window_del(ee->prop.window);
+ ecore_evas_unregister(ee, ee->prop.window);
if (ee->alpha)
{
if (ee->prop.override)
- ee->engine.x.win = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_override_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
else
- ee->engine.x.win = ecore_x_window_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_argb_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
if (!ee->engine.x.mask)
- ee->engine.x.mask = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 1);
+ ee->engine.x.mask = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 1);
}
else
{
if (ee->prop.override)
- ee->engine.x.win = ecore_x_window_override_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_override_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
else
- ee->engine.x.win = ecore_x_window_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
+ ee->prop.window = ecore_x_window_new(ee->engine.x.win_root, ee->x, ee->y, ee->w, ee->h);
if (ee->engine.x.mask) ecore_x_pixmap_del(ee->engine.x.mask);
ee->engine.x.mask = 0;
- ecore_x_window_shape_input_mask_set(ee->engine.x.win, 0);
+ ecore_x_window_shape_input_mask_set(ee->prop.window, 0);
}
# if 0 /* XXX no alpha window support for software_16_x11 */
einfo->info.mask = ee->engine.x.mask;
# endif /* XXX no shaped window support for software_16_x11 */
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
- ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_x_window_shape_mask_set(ee->prop.window, 0);
+ ecore_evas_register(ee, ee->prop.window);
if (ee->prop.borderless)
- ecore_x_mwm_borderless_set(ee->engine.x.win, ee->prop.borderless);
- if (ee->visible) ecore_x_window_show(ee->engine.x.win);
- if (ee->prop.focused) ecore_x_window_focus(ee->engine.x.win);
+ ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
+ if (ee->visible) ecore_x_window_show(ee->prop.window);
+ if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
if (ee->prop.title)
{
- ecore_x_icccm_title_set(ee->engine.x.win, ee->prop.title);
- ecore_x_netwm_name_set(ee->engine.x.win, ee->prop.title);
+ ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
+ ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
}
_ecore_evas_x_window_get(const Ecore_Evas *ee)
{
#ifdef BUILD_ECORE_EVAS_X11
- return (void *) (long)ee->engine.x.win;
+ return (void *) (long)ee->prop.window;
#else
return 0;
#endif /* BUILD_ECORE_EVAS_X11 */
ee->should_be_visible = 1;
if (ee->prop.avoid_damage)
_ecore_evas_x_render(ee);
- ecore_x_window_show(ee->engine.x.win);
+ ecore_x_window_show(ee->prop.window);
if (ee->prop.fullscreen)
- ecore_x_window_focus(ee->engine.x.win);
+ ecore_x_window_focus(ee->prop.window);
}
static void
_ecore_evas_x_hide(Ecore_Evas *ee)
{
- ecore_x_window_hide(ee->engine.x.win);
+ ecore_x_window_hide(ee->prop.window);
ee->should_be_visible = 0;
}
_ecore_evas_x_raise(Ecore_Evas *ee)
{
if (!ee->prop.fullscreen)
- ecore_x_window_raise(ee->engine.x.win);
+ ecore_x_window_raise(ee->prop.window);
else
- ecore_x_window_raise(ee->engine.x.win);
+ ecore_x_window_raise(ee->prop.window);
}
static void
_ecore_evas_x_lower(Ecore_Evas *ee)
{
if (!ee->prop.fullscreen)
- ecore_x_window_lower(ee->engine.x.win);
+ ecore_x_window_lower(ee->prop.window);
else
- ecore_x_window_lower(ee->engine.x.win);
+ ecore_x_window_lower(ee->prop.window);
}
static void
_ecore_evas_x_activate(Ecore_Evas *ee)
{
ecore_x_netwm_client_active_request(ee->engine.x.win_root,
- ee->engine.x.win, 2, 0);
+ ee->prop.window, 2, 0);
}
static void
if (ee->prop.title) free(ee->prop.title);
ee->prop.title = NULL;
if (t) ee->prop.title = strdup(t);
- ecore_x_icccm_title_set(ee->engine.x.win, ee->prop.title);
- ecore_x_netwm_name_set(ee->engine.x.win, ee->prop.title);
+ ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
+ ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
static void
ee->prop.clas = NULL;
ee->prop.name = strdup(n);
ee->prop.clas = strdup(c);
- ecore_x_icccm_name_class_set(ee->engine.x.win, ee->prop.name, ee->prop.clas);
+ ecore_x_icccm_name_class_set(ee->prop.window, ee->prop.name, ee->prop.clas);
}
static void
ee->prop.cursor.layer = 0;
ee->prop.cursor.hot.x = 0;
ee->prop.cursor.hot.y = 0;
- ecore_x_window_cursor_show(ee->engine.x.win, 1);
+ ecore_x_window_cursor_show(ee->prop.window, 1);
return;
}
ee->prop.cursor.hot.x = hot_x;
ee->prop.cursor.hot.y = hot_y;
- ecore_x_window_cursor_show(ee->engine.x.win, 0);
+ ecore_x_window_cursor_show(ee->prop.window, 0);
evas_pointer_output_xy_get(ee->evas, &x, &y);
evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
static void
_ecore_evas_x_focus_set(Ecore_Evas *ee, int on __UNUSED__)
{
- ecore_x_window_focus(ee->engine.x.win);
+ ecore_x_window_focus(ee->prop.window);
}
static void
ee->prop.iconified = on;
if (on)
{
- ecore_x_icccm_hints_set(ee->engine.x.win,
+ ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_ICONIC /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
- ecore_x_icccm_iconic_request_send(ee->engine.x.win, ee->engine.x.win_root);
+ ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root);
}
else
{
- ecore_x_icccm_hints_set(ee->engine.x.win,
+ ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
if (((ee->prop.borderless) && (on)) ||
((!ee->prop.borderless) && (!on))) return;
ee->prop.borderless = on;
- ecore_x_mwm_borderless_set(ee->engine.x.win, ee->prop.borderless);
+ ecore_x_mwm_borderless_set(ee->prop.window, ee->prop.borderless);
}
/* FIXME: This function changes the initial state of the ee
else
hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
- ecore_x_icccm_hints_set(ee->engine.x.win,
+ ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
hint /* initial_state */,
0 /* icon_pixmap */,
*/
ee->engine.x.state.sticky = sticky;
if (ee->should_be_visible)
- ecore_x_netwm_state_request_send(ee->engine.x.win, ee->engine.x.win_root,
+ ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_STICKY, -1, sticky);
else
_ecore_evas_x_state_update(ee);
if (ignore)
{
ee->ignore_events = 1;
- if (ee->engine.x.win)
- ecore_x_window_ignore_set(ee->engine.x.win, 1);
+ if (ee->prop.window)
+ ecore_x_window_ignore_set(ee->prop.window, 1);
}
else
{
ee->ignore_events = 0;
- if (ee->engine.x.win)
- ecore_x_window_ignore_set(ee->engine.x.win, 0);
+ if (ee->prop.window)
+ ecore_x_window_ignore_set(ee->prop.window, 0);
}
}
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
if (einfo)
{
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
#endif
einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(ee->evas);
if (einfo)
{
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
#endif
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
if (einfo)
{
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
#endif
{
if (((ee->prop.override) && (on)) ||
((!ee->prop.override) && (!on))) return;
- ecore_x_window_hide(ee->engine.x.win);
- ecore_x_window_override_set(ee->engine.x.win, on);
- if (ee->visible) ecore_x_window_show(ee->engine.x.win);
- if (ee->prop.focused) ecore_x_window_focus(ee->engine.x.win);
+ ecore_x_window_hide(ee->prop.window);
+ ecore_x_window_override_set(ee->prop.window, on);
+ if (ee->visible) ecore_x_window_show(ee->prop.window);
+ if (ee->prop.focused) ecore_x_window_focus(ee->prop.window);
ee->prop.override = on;
}
* i.e. reposition, resize, and change borderless hint */
ee->engine.x.state.fullscreen = on;
if (ee->should_be_visible)
- ecore_x_netwm_state_request_send(ee->engine.x.win, ee->engine.x.win_root,
+ ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_FULLSCREEN, -1, on);
else
_ecore_evas_x_state_update(ee);
{
if (ee->prop.avoid_damage)
{
- ee->engine.x.pmap = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, einfo->info.depth);
+ ee->engine.x.pmap = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, einfo->info.depth);
ee->engine.x.gc = ecore_x_gc_new(ee->engine.x.pmap);
einfo->info.drawable = ee->engine.x.pmap;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
if (ee->prop.avoid_damage == ECORE_EVAS_AVOID_DAMAGE_BUILT_IN)
{
ee->engine.x.using_bg_pixmap = 1;
- ecore_x_window_pixmap_set(ee->engine.x.win, ee->engine.x.pmap);
- ecore_x_window_area_expose(ee->engine.x.win, 0, 0, ee->w, ee->h);
+ ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
+ ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
}
if (ee->engine.x.direct_resize)
{
/* Turn this off for now
ee->engine.x.using_bg_pixmap = 1;
- ecore_x_window_pixmap_set(ee->engine.x.win, ee->engine.x.pmap);
+ ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
*/
}
}
if (ee->engine.x.gc) ecore_x_gc_del(ee->engine.x.gc);
if (ee->engine.x.using_bg_pixmap)
{
- ecore_x_window_pixmap_set(ee->engine.x.win, 0);
+ ecore_x_window_pixmap_set(ee->prop.window, 0);
ee->engine.x.using_bg_pixmap = 0;
- ecore_x_window_area_expose(ee->engine.x.win, 0, 0, ee->w, ee->h);
+ ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
}
ee->engine.x.pmap = 0;
ee->engine.x.gc = 0;
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
}
{
if (ee->prop.avoid_damage)
{
- ee->engine.x.pmap = ecore_x_pixmap_new(ee->engine.x.win, ee->w, ee->h, 16);
+ ee->engine.x.pmap = ecore_x_pixmap_new(ee->prop.window, ee->w, ee->h, 16);
ee->engine.x.gc = ecore_x_gc_new(ee->engine.x.pmap);
einfo->info.drawable = ee->engine.x.pmap;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
{
/* Turn this off for now
ee->engine.x.using_bg_pixmap = 1;
- ecore_x_window_pixmap_set(ee->engine.x.win, ee->engine.x.pmap);
+ ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
*/
}
}
if (ee->engine.x.gc) ecore_x_gc_del(ee->engine.x.gc);
if (ee->engine.x.using_bg_pixmap)
{
- ecore_x_window_pixmap_set(ee->engine.x.win, 0);
+ ecore_x_window_pixmap_set(ee->prop.window, 0);
ee->engine.x.using_bg_pixmap = 0;
}
ee->engine.x.pmap = 0;
ee->engine.x.gc = 0;
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
}
int i;
while (ecore_evases) _ecore_evas_free(ecore_evases);
- for (i = 0; i < 18; i++)
+ for (i = 0; i < sizeof(ecore_evas_event_handlers) / sizeof(Ecore_Event_Handler*); i++)
ecore_event_handler_del(ecore_evas_event_handlers[i]);
ecore_idle_enterer_del(ecore_evas_idle_enterer);
ecore_evas_idle_enterer = NULL;
if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
+ ecore_evas_event_shutdown();
}
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
return _ecore_evas_init_count;
_ecore_evas_x_withdrawn_set,
_ecore_evas_x_sticky_set,
_ecore_evas_x_ignore_events_set,
- _ecore_evas_x_alpha_set,
- _ecore_evas_x_window_get
+ _ecore_evas_x_alpha_set
};
#endif /* BUILD_ECORE_EVAS_X11 */
/* FIXME: round trip in ecore_x_window_argb_get */
if (ecore_x_window_argb_get(parent))
{
- ee->engine.x.win = ecore_x_window_argb_new(parent, x, y, w, h);
+ ee->prop.window = ecore_x_window_argb_new(parent, x, y, w, h);
argb = 1;
}
else
- ee->engine.x.win = ecore_x_window_new(parent, x, y, w, h);
+ ee->prop.window = ecore_x_window_new(parent, x, y, w, h);
}
else
- ee->engine.x.win = ecore_x_window_new(parent, x, y, w, h);
+ ee->prop.window = ecore_x_window_new(parent, x, y, w, h);
if (getenv("DESKTOP_STARTUP_ID"))
{
- ecore_x_netwm_startup_id_set(ee->engine.x.win,
+ ecore_x_netwm_startup_id_set(ee->prop.window,
getenv("DESKTOP_STARTUP_ID"));
/* NB: on linux this may simply empty the env as opposed to completely
* unset it to being empty - unsure as solartis libc crashes looking
einfo->info.connection = ecore_x_display_get();
einfo->info.screen = NULL;
# endif /* ! BUILD_ECORE_EVAS_SOFTWARE_XCB */
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
if (argb)
{
/* FIXME: round trip */
xcb_get_geometry_reply_t *reply_geom;
xcb_get_window_attributes_reply_t *reply_attr;
- cookie_geom = xcb_get_geometry_unchecked(ecore_x_connection_get(), ee->engine.x.win);
- cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->engine.x.win);
+ cookie_geom = xcb_get_geometry_unchecked(ecore_x_connection_get(), ee->prop.window);
+ cookie_attr = xcb_get_window_attributes_unchecked(ecore_x_connection_get(), ee->prop.window);
reply_geom = xcb_get_geometry_reply(ecore_x_connection_get(), cookie_geom, NULL);
reply_attr = xcb_get_window_attributes_reply(ecore_x_connection_get(), cookie_attr, NULL);
# else
XWindowAttributes at;
- if (XGetWindowAttributes(ecore_x_display_get(), ee->engine.x.win,
+ if (XGetWindowAttributes(ecore_x_display_get(), ee->prop.window,
&at))
{
einfo->info.visual = at.visual;
einfo->info.debug = redraw_debug;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
- evas_key_modifier_add(ee->evas, "Shift");
- evas_key_modifier_add(ee->evas, "Control");
- evas_key_modifier_add(ee->evas, "Alt");
- evas_key_modifier_add(ee->evas, "Meta");
- evas_key_modifier_add(ee->evas, "Hyper");
- evas_key_modifier_add(ee->evas, "Super");
- evas_key_lock_add(ee->evas, "Caps_Lock");
- evas_key_lock_add(ee->evas, "Num_Lock");
- evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_evas_register(ee, ee->prop.window);
return ee;
#else
return NULL;
-#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_X11 && ! BUILD_ECORE_EVAS_SOFTWARE_XCB */
+#endif
}
/**
ecore_evas_software_x11_window_get(const Ecore_Evas *ee)
{
#if defined (BUILD_ECORE_EVAS_SOFTWARE_X11) || defined (BUILD_ECORE_EVAS_SOFTWARE_XCB)
- return (Ecore_X_Window) (long)_ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif
ecore_evas_software_x11_subwindow_get(const Ecore_Evas *ee)
{
#if defined (BUILD_ECORE_EVAS_SOFTWARE_X11) || defined (BUILD_ECORE_EVAS_SOFTWARE_XCB)
- return (Ecore_X_Window) (long)_ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif
{
/* turn this off for now
ee->engine.x.using_bg_pixmap = 1;
- ecore_x_window_pixmap_set(ee->engine.x.win, ee->engine.x.pmap);
+ ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
*/
}
else
{
/* turn this off too- bg pixmap is controlled by avoid damage directly
ee->engine.x.using_bg_pixmap = 0;
- ecore_x_window_pixmap_set(ee->engine.x.win, 0);
- ecore_x_window_area_expose(ee->engine.x.win, 0, 0, ee->w, ee->h);
+ ecore_x_window_pixmap_set(ee->prop.window, 0);
+ ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
*/
}
}
{
*winp = win;
ee->engine.x.win_extra = eina_list_append(ee->engine.x.win_extra, winp);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee);
+ ecore_evas_register(ee, win);
}
#else
#endif
einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(ee->evas);
if (einfo)
{
- ee->engine.x.win = _ecore_evas_x_gl_window_new(ee, ee->engine.x.win_root, x, y, w, h, 0);
+ ee->prop.window = _ecore_evas_x_gl_window_new(ee, ee->engine.x.win_root, x, y, w, h, 0);
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
if (getenv("DESKTOP_STARTUP_ID"))
{
- ecore_x_netwm_startup_id_set(ee->engine.x.win,
+ ecore_x_netwm_startup_id_set(ee->prop.window,
getenv("DESKTOP_STARTUP_ID"));
/* NB: on linux this may simply empty the env as opposed to completely
* unset it to being empty - unsure as solartis libc crashes looking
* for the '=' char */
// putenv((char*)"DESKTOP_STARTUP_ID=");
}
- evas_key_modifier_add(ee->evas, "Shift");
- evas_key_modifier_add(ee->evas, "Control");
- evas_key_modifier_add(ee->evas, "Alt");
- evas_key_modifier_add(ee->evas, "Meta");
- evas_key_modifier_add(ee->evas, "Hyper");
- evas_key_modifier_add(ee->evas, "Super");
- evas_key_lock_add(ee->evas, "Caps_Lock");
- evas_key_lock_add(ee->evas, "Num_Lock");
- evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_evas_register(ee, ee->prop.window);
# endif /* HAVE_ECORE_X_XCB */
return ee;
ecore_evas_gl_x11_window_get(const Ecore_Evas *ee)
{
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
- return (Ecore_X_Window) _ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif /* ! BUILD_ECORE_EVAS_OPENGL_X11 */
ecore_evas_gl_x11_subwindow_get(const Ecore_Evas *ee)
{
#ifdef BUILD_ECORE_EVAS_OPENGL_X11
- return (Ecore_X_Window) _ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif /* ! BUILD_ECORE_EVAS_OPENGL_X11 */
evas_output_viewport_set(ee->evas, 0, 0, w, h);
ee->engine.x.win_root = parent;
- ee->engine.x.win = ecore_x_window_new(parent, x, y, w, h);
+ ee->prop.window = ecore_x_window_new(parent, x, y, w, h);
if (getenv("DESKTOP_STARTUP_ID"))
{
- ecore_x_netwm_startup_id_set(ee->engine.x.win,
+ ecore_x_netwm_startup_id_set(ee->prop.window,
getenv("DESKTOP_STARTUP_ID"));
/* NB: on linux this may simply empty the env as opposed to completely
* unset it to being empty - unsure as solartis libc crashes looking
}
einfo->info.display = ecore_x_display_get();
einfo->info.visual = DefaultVisual(ecore_x_display_get(), screen);
-# endif /* ! BUILD_ECORE_EVAS_XRENDER_XCB */
- einfo->info.drawable = ee->engine.x.win;
+# endif /* HAVE_ECORE_X_XCB */
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
- evas_key_modifier_add(ee->evas, "Shift");
- evas_key_modifier_add(ee->evas, "Control");
- evas_key_modifier_add(ee->evas, "Alt");
- evas_key_modifier_add(ee->evas, "Meta");
- evas_key_modifier_add(ee->evas, "Hyper");
- evas_key_modifier_add(ee->evas, "Super");
- evas_key_lock_add(ee->evas, "Caps_Lock");
- evas_key_lock_add(ee->evas, "Num_Lock");
- evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_evas_register(ee, ee->prop.window);
return ee;
#else
return NULL;
ecore_evas_xrender_x11_window_get(const Ecore_Evas *ee)
{
#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB)
- return (Ecore_X_Window) _ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif /* ! BUILD_ECORE_EVAS_XRENDER_X11 && ! BUILD_ECORE_EVAS_XRENDER_XCB */
ecore_evas_xrender_x11_subwindow_get(const Ecore_Evas *ee)
{
#if defined (BUILD_ECORE_EVAS_XRENDER_X11) || defined (BUILD_ECORE_EVAS_XRENDER_XCB)
- return (Ecore_X_Window) _ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif /* ! BUILD_ECORE_EVAS_XRENDER_X11 && ! BUILD_ECORE_EVAS_XRENDER_XCB */
/* FIXME: round trip in ecore_x_window_argb_get */
if (ecore_x_window_argb_get(parent))
{
- ee->engine.x.win = ecore_x_window_argb_new(parent, x, y, w, h);
+ ee->prop.window = ecore_x_window_argb_new(parent, x, y, w, h);
argb = 1;
}
else
- ee->engine.x.win = ecore_x_window_new(parent, x, y, w, h);
+ ee->prop.window = ecore_x_window_new(parent, x, y, w, h);
}
else
- ee->engine.x.win = ecore_x_window_new(parent, x, y, w, h);
+ ee->prop.window = ecore_x_window_new(parent, x, y, w, h);
if (getenv("DESKTOP_STARTUP_ID"))
{
- ecore_x_netwm_startup_id_set(ee->engine.x.win,
+ ecore_x_netwm_startup_id_set(ee->prop.window,
getenv("DESKTOP_STARTUP_ID"));
/* NB: on linux this may simply empty the env as opposed to completely
* unset it to being empty - unsure as solartis libc crashes looking
redraw_debug = 0;
}
einfo->info.display = ecore_x_display_get();
- einfo->info.drawable = ee->engine.x.win;
+ einfo->info.drawable = ee->prop.window;
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
- evas_key_modifier_add(ee->evas, "Shift");
- evas_key_modifier_add(ee->evas, "Control");
- evas_key_modifier_add(ee->evas, "Alt");
- evas_key_modifier_add(ee->evas, "Meta");
- evas_key_modifier_add(ee->evas, "Hyper");
- evas_key_modifier_add(ee->evas, "Super");
- evas_key_lock_add(ee->evas, "Caps_Lock");
- evas_key_lock_add(ee->evas, "Num_Lock");
- evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- if (!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ ecore_evas_register(ee, ee->prop.window);
return ee;
#else
return NULL;
ecore_evas_software_x11_16_window_get(const Ecore_Evas *ee)
{
#if BUILD_ECORE_EVAS_SOFTWARE_16_X11
- return (Ecore_X_Window) _ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
ecore_evas_software_x11_16_subwindow_get(const Ecore_Evas *ee)
{
#if BUILD_ECORE_EVAS_SOFTWARE_16_X11
- return (Ecore_X_Window) _ecore_evas_x_window_get(ee);
+ return (Ecore_X_Window) ecore_evas_window_get(ee);
#else
return 0;
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
{
/* turn this off for now
ee->engine.x.using_bg_pixmap = 1;
- ecore_x_window_pixmap_set(ee->engine.x.win, ee->engine.x.pmap);
+ ecore_x_window_pixmap_set(ee->prop.window, ee->engine.x.pmap);
*/
}
else
{
/* turn this off too- bg pixmap is controlled by avoid damage directly
ee->engine.x.using_bg_pixmap = 0;
- ecore_x_window_pixmap_set(ee->engine.x.win, 0);
- ecore_x_window_area_expose(ee->engine.x.win, 0, 0, ee->w, ee->h);
+ ecore_x_window_pixmap_set(ee->prop.window, 0);
+ ecore_x_window_area_expose(ee->prop.window, 0, 0, ee->w, ee->h);
*/
}
}
{
*winp = win;
ee->engine.x.win_extra = eina_list_append(ee->engine.x.win_extra, winp);
- if(!ecore_evases_hash)
- ecore_evases_hash = eina_hash_string_superfast_new(NULL);
- eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee);
+ ecore_evas_register(ee, win);
}
#else
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
--- /dev/null
+#ifndef _ECORE_INPUT_H
+# define _ECORE_INPUT_H
+
+#ifdef EAPI
+#undef EAPI
+#endif
+#ifdef _MSC_VER
+# ifdef BUILDING_DLL
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI __declspec(dllimport)
+# endif
+#else
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
+# else
+# define EAPI
+# endif
+# else
+# define EAPI
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EAPI extern int ECORE_EVENT_KEY_DOWN;
+EAPI extern int ECORE_EVENT_KEY_UP;
+EAPI extern int ECORE_EVENT_MOUSE_BUTTON_DOWN;
+EAPI extern int ECORE_EVENT_MOUSE_BUTTON_UP;
+EAPI extern int ECORE_EVENT_MOUSE_MOVE;
+EAPI extern int ECORE_EVENT_MOUSE_WHEEL;
+EAPI extern int ECORE_EVENT_MOUSE_IN;
+EAPI extern int ECORE_EVENT_MOUSE_OUT;
+
+#define ECORE_EVENT_MODIFIER_SHIFT 0x0001
+#define ECORE_EVENT_MODIFIER_CTRL 0x0002
+#define ECORE_EVENT_MODIFIER_ALT 0x0004
+#define ECORE_EVENT_MODIFIER_WIN 0x0008
+#define ECORE_EVENT_MODIFIER_SCROLL 0x0010
+#define ECORE_EVENT_MODIFIER_NUM 0x0020
+#define ECORE_EVENT_MODIFIER_CAPS 0x0040
+#define ECORE_EVENT_LOCK_SCROLL 0x0080
+#define ECORE_EVENT_LOCK_NUM 0x0100
+#define ECORE_EVENT_LOCK_CAPS 0x0200
+
+typedef unsigned int Ecore_Window;
+
+typedef struct _Ecore_Event_Key Ecore_Event_Key;
+struct _Ecore_Event_Key
+{
+ const char *keyname;
+ const char *key;
+ const char *string;
+ const char *compose;
+ Ecore_Window window;
+ Ecore_Window root_window;
+ Ecore_Window event_window;
+
+ unsigned int timestamp;
+ unsigned int modifiers;
+
+ int same_screen;
+};
+
+typedef struct _Ecore_Event_Mouse_Button Ecore_Event_Mouse_Button;
+struct _Ecore_Event_Mouse_Button
+{
+ Ecore_Window window;
+ Ecore_Window root_window;
+ Ecore_Window event_window;
+
+ unsigned int timestamp;
+ unsigned int modifiers;
+ unsigned int buttons;
+ unsigned int double_click;
+ unsigned int triple_click;
+ int same_screen;
+
+ int x;
+ int y;
+ struct
+ {
+ int x;
+ int y;
+ } root;
+};
+
+typedef struct _Ecore_Event_Mouse_Wheel Ecore_Event_Mouse_Wheel;
+struct _Ecore_Event_Mouse_Wheel
+{
+ Ecore_Window window;
+ Ecore_Window root_window;
+ Ecore_Window event_window;
+
+ unsigned int timestamp;
+ unsigned int modifiers;
+
+ int same_screen;
+ int direction;
+ int z;
+
+ int x;
+ int y;
+ struct
+ {
+ int x;
+ int y;
+ } root;
+};
+
+typedef struct _Ecore_Event_Mouse_Move Ecore_Event_Mouse_Move;
+struct _Ecore_Event_Mouse_Move
+{
+ Ecore_Window window;
+ Ecore_Window root_window;
+ Ecore_Window event_window;
+
+ unsigned int timestamp;
+ unsigned int modifiers;
+
+ int same_screen;
+
+ int x;
+ int y;
+ struct
+ {
+ int x;
+ int y;
+ } root;
+};
+
+typedef struct _Ecore_Event_Mouse_IO Ecore_Event_Mouse_IO;
+struct _Ecore_Event_Mouse_IO
+{
+ Ecore_Window window;
+ Ecore_Window event_window;
+
+ unsigned int timestamp;
+ unsigned int modifiers;
+
+ int x;
+ int y;
+};
+
+enum _Ecore_Event_Modifier
+{
+ ECORE_NONE,
+ ECORE_SHIFT,
+ ECORE_CTRL,
+ ECORE_ALT,
+ ECORE_WIN,
+ ECORE_SCROLL,
+ ECORE_CAPS,
+ ECORE_LAST
+};
+
+enum _Ecore_Event_Press
+{
+ ECORE_DOWN,
+ ECORE_UP
+};
+
+enum _Ecore_Event_IO
+{
+ ECORE_IN,
+ ECORE_OUT
+};
+
+typedef enum _Ecore_Event_IO Ecore_Event_IO;
+typedef enum _Ecore_Event_Press Ecore_Event_Press;
+typedef enum _Ecore_Event_Modifier Ecore_Event_Modifier;
+
+typedef struct _Ecore_Event_Modifiers Ecore_Event_Modifiers;
+struct _Ecore_Event_Modifiers
+{
+ unsigned int size;
+ unsigned int array[ECORE_LAST];
+};
+
+EAPI int ecore_event_init(void);
+EAPI int ecore_event_shutdown(void);
+
+EAPI Ecore_Event_Modifier ecore_event_update_modifier(const char *key, Ecore_Event_Modifiers *modifiers, int inc);
+EAPI unsigned int ecore_event_modifier_mask(Ecore_Event_Modifier modifier);
+
+#ifdef _ECORE_EVAS_H
+
+EAPI int ecore_evas_event_init(void);
+EAPI int ecore_evas_event_shutdown(void);
+
+EAPI int ecore_evas_event_key_down(void *data, int type, void *event);
+EAPI int ecore_evas_event_key_up(void *data, int type, void *event);
+EAPI int ecore_evas_event_mouse_button_up(void *data, int type, void *event);
+EAPI int ecore_evas_event_mouse_button_down(void *data, int type, void *event);
+EAPI int ecore_evas_event_mouse_wheel(void *data, int type, void *event);
+EAPI int ecore_evas_event_mouse_move(void *data, int type, void *event);
+EAPI int ecore_evas_event_mouse_in(void *data, int type, void *event);
+EAPI int ecore_evas_event_mouse_out(void *data, int type, void *event);
+
+EAPI void ecore_evas_register(Ecore_Evas *ee, Ecore_Window window);
+EAPI void ecore_evas_unregister(Ecore_Evas *ee, Ecore_Window window);
+EAPI Ecore_Evas *ecore_evas_window_match(Ecore_Window window);
+
+EAPI void ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp);
+EAPI void ecore_evas_event_modifier_lock_update(Evas *e, unsigned int modifiers);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+
+if BUILD_ECORE_X
+ECORE_X_INC = -I$(top_srcdir)/src/lib/ecore_x
+else
+ECORE_X_INC =
+endif
+
+if BUILD_ECORE_FB
+ECORE_FB_INC = -I$(top_srcdir)/src/lib/ecore_fb
+else
+ECORE_FB_INC =
+endif
+
+if BUILD_ECORE_DIRECTFB
+ECORE_DIRECTFB_INC = -I$(top_srcdir)/src/lib/ecore_directfb -I@DIRECTFB_CFLAGS@
+else
+ECORE_DIRECTFB_INC =
+endif
+
+if BUILD_ECORE_WIN32
+ECORE_WIN32_INC = -I$(top_srcdir)/src/lib/ecore_win32
+else
+ECORE_WIN32_INC =
+endif
+
+if BUILD_ECORE_SDL
+ECORE_SDL_INC = -I$(top_srcdir)/src/lib/ecore_sdl @SDL_CFLAGS@
+else
+ECORE_SDL_INC =
+endif
+
+AM_CPPFLAGS = \
+-I$(top_srcdir)/src/lib/ecore \
+-I$(top_srcdir)/src/lib/ecore_evas \
+-I$(top_builddir)/src/lib/ecore \
+-I$(top_builddir)/src/lib/ecore_evas \
+$(ECORE_X_INC) \
+$(ECORE_FB_INC) \
+$(ECORE_DIRECTFB_INC) \
+$(ECORE_WIN32_INC) \
+$(ECORE_SDL_INC) \
+@EVAS_CFLAGS@
+
+if BUILD_ECORE_INPUT
+
+lib_LTLIBRARIES = libecore_input.la
+include_HEADERS = Ecore_Input.h
+
+libecore_input_la_SOURCES = \
+ecore_input.c
+
+libecore_input_la_LIBADD = \
+$(top_builddir)/src/lib/ecore/libecore.la \
+@EVAS_LIBS@ \
+@EVIL_LIBS@
+
+libecore_input_la_LDFLAGS = @lt_enable_auto_import@ -version-info @version_info@
+
+libecore_input_la_DEPENDENCIES = \
+$(top_builddir)/src/lib/ecore/libecore.la
+
+endif
+
+EXTRA_DIST = \
+ecore_input.c \
+Ecore_Input.h
+
--- /dev/null
+#include <string.h>
+
+#include "config.h"
+#include "Ecore.h"
+#include "ecore_private.h"
+#include "Ecore_Input.h"
+
+EAPI int ECORE_EVENT_KEY_DOWN = 0;
+EAPI int ECORE_EVENT_KEY_UP = 0;
+EAPI int ECORE_EVENT_MOUSE_BUTTON_DOWN = 0;
+EAPI int ECORE_EVENT_MOUSE_BUTTON_UP = 0;
+EAPI int ECORE_EVENT_MOUSE_MOVE = 0;
+EAPI int ECORE_EVENT_MOUSE_WHEEL = 0;
+EAPI int ECORE_EVENT_MOUSE_IN = 0;
+EAPI int ECORE_EVENT_MOUSE_OUT = 0;
+
+static int _ecore_event_init_count = 0;
+
+#ifdef BUILD_ECORE_EVAS
+#include "ecore_evas_private.h"
+
+static Ecore_Event_Handler *ecore_evas_event_handlers[8];
+static Evas_Hash *_ecore_evases_hash = NULL;
+
+static int _ecore_evas_event_init_count = 0;
+
+static const char*
+_ecore_evas_winid_str_get(Ecore_Window window)
+{
+ const char *vals = "qWeRtYuIoP5-$&<~";
+ static char id[9];
+
+#define COMPUTE_ID(Result, Index, Source, Window) \
+ Result[Index] = Source[(Window >> (28 - Index * 4)) & 0xf];
+
+ COMPUTE_ID(id, 0, vals, window);
+ COMPUTE_ID(id, 1, vals, window);
+ COMPUTE_ID(id, 2, vals, window);
+ COMPUTE_ID(id, 3, vals, window);
+ COMPUTE_ID(id, 4, vals, window);
+ COMPUTE_ID(id, 5, vals, window);
+ COMPUTE_ID(id, 6, vals, window);
+ COMPUTE_ID(id, 7, vals, window);
+ id[8] = '\0';
+
+ return id;
+}
+
+EAPI void
+ecore_evas_event_modifier_lock_update(Evas *e, unsigned int modifiers)
+{
+ if (modifiers & ECORE_EVENT_MODIFIER_SHIFT)
+ evas_key_modifier_on(e, "Shift");
+ else evas_key_modifier_off(e, "Shift");
+
+ if (modifiers & ECORE_EVENT_MODIFIER_CTRL)
+ evas_key_modifier_on(e, "Control");
+ else evas_key_modifier_off(e, "Control");
+
+ if (modifiers & ECORE_EVENT_MODIFIER_ALT)
+ evas_key_modifier_on(e, "Alt");
+ else evas_key_modifier_off(e, "Alt");
+
+ if (modifiers & ECORE_EVENT_MODIFIER_WIN)
+ {
+ evas_key_modifier_on(e, "Super");
+ evas_key_modifier_on(e, "Hyper");
+ }
+ else
+ {
+ evas_key_modifier_off(e, "Super");
+ evas_key_modifier_off(e, "Hyper");
+ }
+
+ if (modifiers & ECORE_EVENT_LOCK_SCROLL)
+ evas_key_lock_on(e, "Scroll_Lock");
+ else evas_key_lock_off(e, "Scroll_Lock");
+
+ if (modifiers & ECORE_EVENT_LOCK_NUM)
+ evas_key_lock_on(e, "Num_Lock");
+ else evas_key_lock_off(e, "Num_Lock");
+
+ if (modifiers & ECORE_EVENT_LOCK_CAPS)
+ evas_key_lock_on(e, "Caps_Lock");
+ else evas_key_lock_off(e, "Caps_Lock");
+}
+
+EAPI void
+ecore_evas_register(Ecore_Evas *ee, Ecore_Window window)
+{
+ _ecore_evases_hash = evas_hash_add(_ecore_evases_hash, _ecore_evas_winid_str_get(window), ee);
+
+ evas_key_modifier_add(ee->evas, "Shift");
+ evas_key_modifier_add(ee->evas, "Control");
+ evas_key_modifier_add(ee->evas, "Alt");
+ evas_key_modifier_add(ee->evas, "Meta");
+ evas_key_modifier_add(ee->evas, "Hyper");
+ evas_key_modifier_add(ee->evas, "Super");
+ evas_key_lock_add(ee->evas, "Caps_Lock");
+ evas_key_lock_add(ee->evas, "Num_Lock");
+ evas_key_lock_add(ee->evas, "Scroll_Lock");
+}
+
+EAPI void
+ecore_evas_unregister(Ecore_Evas *ee, Ecore_Window window)
+{
+ _ecore_evases_hash = evas_hash_del(_ecore_evases_hash, _ecore_evas_winid_str_get(window), ee);
+}
+
+EAPI Ecore_Evas*
+ecore_evas_window_match(Ecore_Window window)
+{
+ return evas_hash_find(_ecore_evases_hash, _ecore_evas_winid_str_get(window));
+}
+
+EAPI void
+ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
+{
+ ee->mouse.x = x;
+ ee->mouse.y = y;
+ if (ee->prop.cursor.object)
+ {
+ evas_object_show(ee->prop.cursor.object);
+ if (ee->rotation == 0)
+ evas_object_move(ee->prop.cursor.object,
+ x - ee->prop.cursor.hot.x,
+ y - ee->prop.cursor.hot.y);
+ else if (ee->rotation == 90)
+ evas_object_move(ee->prop.cursor.object,
+ ee->h - y - 1 - ee->prop.cursor.hot.x,
+ x - ee->prop.cursor.hot.y);
+ else if (ee->rotation == 180)
+ evas_object_move(ee->prop.cursor.object,
+ ee->w - x - 1 - ee->prop.cursor.hot.x,
+ ee->h - y - 1 - ee->prop.cursor.hot.y);
+ else if (ee->rotation == 270)
+ evas_object_move(ee->prop.cursor.object,
+ y - ee->prop.cursor.hot.x,
+ ee->w - x - 1 - ee->prop.cursor.hot.y);
+ }
+ if (ee->rotation == 0)
+ evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
+ else if (ee->rotation == 90)
+ evas_event_feed_mouse_move(ee->evas, ee->h - y - 1, x, timestamp, NULL);
+ else if (ee->rotation == 180)
+ evas_event_feed_mouse_move(ee->evas, ee->w - x - 1, ee->h - y - 1, timestamp, NULL);
+ else if (ee->rotation == 270)
+ evas_event_feed_mouse_move(ee->evas, y, ee->w - x - 1, timestamp, NULL);
+}
+
+static int
+_ecore_evas_event_key(Ecore_Event_Key *e, Ecore_Event_Press press)
+{
+ Ecore_Evas *ee;
+
+ ee = ecore_evas_window_match(e->window);
+ if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
+ ecore_evas_event_modifier_lock_update(ee->evas, e->modifiers);
+ if (press == ECORE_DOWN)
+ evas_event_feed_key_down(ee->evas, e->keyname, e->key, e->string, e->compose, e->timestamp, NULL);
+ else
+ evas_event_feed_key_up(ee->evas, e->keyname, e->key, e->string, e->compose, e->timestamp, NULL);
+ return 1;
+}
+
+static int
+_ecore_evas_event_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press press)
+{
+ Ecore_Evas *ee;
+ Evas_Button_Flags flags = EVAS_BUTTON_NONE;
+
+ ee = ecore_evas_window_match(e->window);
+ if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
+ ecore_evas_event_modifier_lock_update(ee->evas, e->modifiers);
+ if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
+ if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
+ if (press == ECORE_DOWN)
+ evas_event_feed_mouse_down(ee->evas, e->buttons, flags, e->timestamp, NULL);
+ else
+ evas_event_feed_mouse_up(ee->evas, e->buttons, flags, e->timestamp, NULL);
+ return 1;
+}
+
+static int
+_ecore_evas_event_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
+{
+ Ecore_Evas *ee;
+
+ ee = ecore_evas_window_match(e->window);
+ if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
+ ecore_evas_event_modifier_lock_update(ee->evas, e->modifiers);
+ switch (io)
+ {
+ case ECORE_IN:
+ evas_event_feed_mouse_in(ee->evas, e->timestamp, NULL);
+ break;
+ case ECORE_OUT:
+ evas_event_feed_mouse_out(ee->evas, e->timestamp, NULL);
+ break;
+ default:
+ break;
+ }
+
+ ecore_evas_mouse_move_process(ee, e->x, e->y, e->timestamp);
+ return 1;
+}
+#endif
+
+EAPI int
+ecore_evas_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ return _ecore_evas_event_key((Ecore_Event_Key*) event, ECORE_DOWN);
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_key_up(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ return _ecore_evas_event_key((Ecore_Event_Key*) event, ECORE_UP);
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_mouse_button_down(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ return _ecore_evas_event_mouse_button((Ecore_Event_Mouse_Button*) event, ECORE_DOWN);
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_mouse_button_up(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ return _ecore_evas_event_mouse_button((Ecore_Event_Mouse_Button*) event, ECORE_UP);
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ Ecore_Event_Mouse_Wheel *e;
+ Ecore_Evas *ee;
+
+ e = event;
+ ee = ecore_evas_window_match(e->window);
+ if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
+ ecore_evas_event_modifier_lock_update(ee->evas, e->modifiers);
+ evas_event_feed_mouse_wheel(ee->evas, e->direction, e->z, e->timestamp, NULL);
+
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ Ecore_Event_Mouse_Move *e;
+ Ecore_Evas *ee;
+
+ e = event;
+ ee = ecore_evas_window_match(e->window);
+ if ((!ee) || (ee->ignore_events)) return 1; /* pass on event */
+ ecore_evas_event_modifier_lock_update(ee->evas, e->modifiers);
+ ecore_evas_mouse_move_process(ee, e->x, e->y, e->timestamp);
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ return _ecore_evas_event_mouse_io((Ecore_Event_Mouse_IO*) event, ECORE_IN);
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
+{
+#ifdef BUILD_ECORE_EVAS
+ return _ecore_evas_event_mouse_io((Ecore_Event_Mouse_IO*) event, ECORE_OUT);
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_init(void)
+{
+#ifdef BUILD_ECORE_EVAS
+ if (!_ecore_evas_event_init_count)
+ {
+ ecore_event_init();
+
+ ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
+ ecore_evas_event_key_down,
+ NULL);
+ ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_EVENT_KEY_UP,
+ ecore_evas_event_key_up,
+ NULL);
+ ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ ecore_evas_event_mouse_button_down,
+ NULL);
+ ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
+ ecore_evas_event_mouse_button_up,
+ NULL);
+ ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
+ ecore_evas_event_mouse_move,
+ NULL);
+ ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
+ ecore_evas_event_mouse_wheel,
+ NULL);
+ ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_EVENT_MOUSE_IN,
+ ecore_evas_event_mouse_in,
+ NULL);
+ ecore_evas_event_handlers[7] = ecore_event_handler_add(ECORE_EVENT_MOUSE_OUT,
+ ecore_evas_event_mouse_out,
+ NULL);
+ }
+ return ++_ecore_evas_event_init_count;
+#else
+ return 0;
+#endif
+}
+
+EAPI int
+ecore_evas_event_shutdown(void)
+{
+#ifdef BUILD_ECORE_EVAS
+ if (_ecore_evas_event_init_count == 1)
+ {
+ int i;
+
+ for (i = 0; i < sizeof(ecore_evas_event_handlers)/sizeof(Ecore_Event_Handler*); ++i)
+ {
+ ecore_event_handler_del(ecore_evas_event_handlers[i]);
+ ecore_evas_event_handlers[i] = NULL;
+ }
+
+ ecore_event_shutdown();
+ }
+ return --_ecore_evas_event_init_count;
+#else
+ return 0;
+#endif
+}
+
+typedef struct _Ecore_Event_Modifier_Match Ecore_Event_Modifier_Match;
+struct _Ecore_Event_Modifier_Match
+{
+ const char *key;
+ Ecore_Event_Modifier modifier;
+ unsigned int event_modifier;
+};
+
+static const Ecore_Event_Modifier_Match matchs[] = {
+ { "Shift_L", ECORE_SHIFT, ECORE_EVENT_MODIFIER_SHIFT },
+ { "Shift_R", ECORE_SHIFT, ECORE_EVENT_MODIFIER_SHIFT },
+ { "Alt_L", ECORE_ALT, ECORE_EVENT_MODIFIER_ALT },
+ { "Alt_R", ECORE_ALT, ECORE_EVENT_MODIFIER_ALT },
+ { "Control_L", ECORE_CTRL, ECORE_EVENT_MODIFIER_CTRL },
+ { "Control_R", ECORE_CTRL, ECORE_EVENT_MODIFIER_CTRL },
+ { "Caps_Lock", ECORE_CAPS, ECORE_EVENT_MODIFIER_CAPS },
+ { "Super_L", ECORE_WIN, ECORE_EVENT_MODIFIER_WIN },
+ { "Super_R", ECORE_WIN, ECORE_EVENT_MODIFIER_WIN },
+ { "Scroll_Lock", ECORE_SCROLL, ECORE_EVENT_MODIFIER_SCROLL }
+};
+
+EAPI unsigned int
+ecore_event_modifier_mask(Ecore_Event_Modifier modifier)
+{
+ int i;
+
+ for (i = 0; i < sizeof (matchs) / sizeof (Ecore_Event_Modifier_Match); i++)
+ if (matchs[i].modifier == modifier)
+ return matchs[i].event_modifier;
+
+ return 0;
+}
+
+EAPI Ecore_Event_Modifier
+ecore_event_update_modifier(const char *key, Ecore_Event_Modifiers *modifiers, int inc)
+{
+ int i;
+
+ for (i = 0; i < sizeof (matchs) / sizeof (Ecore_Event_Modifier_Match); i++)
+ if (strcmp(matchs[i].key, key) == 0)
+ {
+ if (modifiers && matchs[i].modifier < modifiers->size)
+ modifiers->array[matchs[i].modifier] += inc;
+ return matchs[i].modifier;
+ }
+
+ return ECORE_NONE;
+}
+
+EAPI int
+ecore_event_init(void)
+{
+ if (!_ecore_event_init_count)
+ {
+ ECORE_EVENT_KEY_DOWN = ecore_event_type_new();
+ ECORE_EVENT_KEY_UP = ecore_event_type_new();
+ ECORE_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
+ ECORE_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
+ ECORE_EVENT_MOUSE_MOVE = ecore_event_type_new();
+ ECORE_EVENT_MOUSE_WHEEL = ecore_event_type_new();
+ ECORE_EVENT_MOUSE_IN = ecore_event_type_new();
+ ECORE_EVENT_MOUSE_OUT = ecore_event_type_new();
+ }
+ return ++_ecore_event_init_count;
+}
+
+EAPI int
+ecore_event_shutdown(void)
+{
+ if (_ecore_event_init_count == 1)
+ {
+ ECORE_EVENT_KEY_DOWN = 0;
+ ECORE_EVENT_KEY_UP = 0;
+ ECORE_EVENT_MOUSE_BUTTON_DOWN = 0;
+ ECORE_EVENT_MOUSE_BUTTON_UP = 0;
+ ECORE_EVENT_MOUSE_MOVE = 0;
+ ECORE_EVENT_MOUSE_WHEEL = 0;
+ ECORE_EVENT_MOUSE_IN = 0;
+ ECORE_EVENT_MOUSE_OUT = 0;
+ }
+ return ++_ecore_event_init_count;
+}
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib/ecore \
+-I$(top_srcdir)/src/lib/ecore_evas \
+-I$(top_srcdir)/src/lib/ecore_input \
-I$(top_builddir)/src/lib/ecore \
+-I$(top_builddir)/src/lib/ecore_evas \
+-I$(top_builddir)/src/lib/ecore_input \
@EFL_ECORE_SDL_BUILD@ \
@SDL_CFLAGS@ \
@EINA_CFLAGS@
libecore_sdl_la_LIBADD = \
$(top_builddir)/src/lib/ecore/libecore.la \
-@SDL_LIBS@ \
-@EINA_LIBS@
+$(top_builddir)/src/lib/ecore_input/libecore_input.la \
+@SDL_LIBS@ @EVIL_LIBS@ @EINA_LIBS@
libecore_sdl_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@
#include <SDL/SDL.h>
+#include "Eina.h"
#include "Ecore_Sdl.h"
#include "ecore_private.h"
+#include "Ecore_Input.h"
#include "Ecore.h"
#include "Ecore_Data.h"
#include "Ecore_Sdl_Keys.h"
-EAPI int ECORE_SDL_EVENT_KEY_DOWN = 0;
-EAPI int ECORE_SDL_EVENT_KEY_UP = 0;
-EAPI int ECORE_SDL_EVENT_MOUSE_BUTTON_DOWN = 0;
-EAPI int ECORE_SDL_EVENT_MOUSE_BUTTON_UP = 0;
-EAPI int ECORE_SDL_EVENT_MOUSE_MOVE = 0;
-EAPI int ECORE_SDL_EVENT_MOUSE_WHEEL = 0;
+#include <eina_rbtree.h>
+
+typedef struct _Ecore_SDL_Pressed Ecore_SDL_Pressed;
+struct _Ecore_SDL_Pressed
+{
+ EINA_RBTREE;
+
+ SDLKey key;
+};
+
EAPI int ECORE_SDL_EVENT_GOT_FOCUS = 0;
EAPI int ECORE_SDL_EVENT_LOST_FOCUS = 0;
EAPI int ECORE_SDL_EVENT_RESIZE = 0;
EAPI int ECORE_SDL_EVENT_EXPOSE = 0;
static int _ecore_sdl_init_count = 0;
+static Eina_Rbtree *repeat = NULL;
+
+static Eina_Rbtree_Direction
+_ecore_sdl_pressed_key(const Ecore_SDL_Pressed *left,
+ const Ecore_SDL_Pressed *right,
+ __UNUSED__ void *data)
+{
+ return left->key < right->key ? EINA_RBTREE_LEFT : EINA_RBTREE_RIGHT;
+}
+
+static int
+_ecore_sdl_pressed_node(const Ecore_SDL_Pressed *node,
+ const SDLKey *key,
+ __UNUSED__ int length,
+ __UNUSED__ void *data)
+{
+ return node->key - *key;
+}
/**
* @defgroup Ecore_Sdl_Library_Group Framebuffer Library Functions
EAPI int
ecore_sdl_init(const char *name __UNUSED__)
{
- if(!_ecore_sdl_init_count)
- {
- ECORE_SDL_EVENT_KEY_DOWN = ecore_event_type_new();
- ECORE_SDL_EVENT_KEY_UP = ecore_event_type_new();
- ECORE_SDL_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
- ECORE_SDL_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
- ECORE_SDL_EVENT_MOUSE_MOVE = ecore_event_type_new();
- ECORE_SDL_EVENT_MOUSE_WHEEL = ecore_event_type_new();
- ECORE_SDL_EVENT_GOT_FOCUS = ecore_event_type_new();
- ECORE_SDL_EVENT_LOST_FOCUS = ecore_event_type_new();
- ECORE_SDL_EVENT_RESIZE = ecore_event_type_new();
- ECORE_SDL_EVENT_EXPOSE = ecore_event_type_new();
- }
- return ++_ecore_sdl_init_count;
+ if(!_ecore_sdl_init_count)
+ {
+ ECORE_SDL_EVENT_GOT_FOCUS = ecore_event_type_new();
+ ECORE_SDL_EVENT_LOST_FOCUS = ecore_event_type_new();
+ ECORE_SDL_EVENT_RESIZE = ecore_event_type_new();
+ ECORE_SDL_EVENT_EXPOSE = ecore_event_type_new();
+
+ SDL_EnableKeyRepeat(200, 100);
+ }
+ ecore_event_init();
+ return ++_ecore_sdl_init_count;
}
/**
EAPI int
ecore_sdl_shutdown(void)
{
- _ecore_sdl_init_count--;
- return _ecore_sdl_init_count;
+ _ecore_sdl_init_count--;
+ ecore_event_shutdown();
+ return _ecore_sdl_init_count;
+}
+
+static Ecore_Event_Key*
+_ecore_sdl_event_key(SDL_Event *event, double time)
+{
+ Ecore_Event_Key *ev;
+ unsigned int i;
+
+ ev = malloc(sizeof(Ecore_Event_Key));
+ if (!ev) return NULL;
+
+ ev->timestamp = time;
+ ev->window = 0;
+ ev->modifiers = 0; /* FIXME: keep modifier around. */
+ ev->key = NULL;
+ ev->compose = NULL;
+
+ for (i = 0; i < sizeof(keystable) / sizeof(struct _ecore_sdl_keys_s); ++i)
+ if (keystable[i].code == event->key.keysym.sym)
+ {
+ ev->keyname = keystable[i].name;
+ ev->string = keystable[i].compose;
+
+ return ev;
+ }
+
+ free(ev);
+ return NULL;
}
EAPI void
{
case SDL_MOUSEMOTION:
{
- Ecore_Sdl_Event_Mouse_Move *ev;
+ Ecore_Event_Mouse_Move *ev;
- ev = malloc(sizeof(Ecore_Sdl_Event_Mouse_Move));
+ ev = malloc(sizeof(Ecore_Event_Mouse_Move));
+ if (!ev) return ;
+
+ ev->timestamp = time;
+ ev->window = 0;
+ ev->modifiers = 0; /* FIXME: keep modifier around. */
ev->x = event.motion.x;
ev->y = event.motion.y;
- ev->time = time;
+ ev->root.x = ev->x;
+ ev->root.y = ev->y;
- ecore_event_add(ECORE_SDL_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+ ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
break;
}
case SDL_MOUSEBUTTONDOWN:
if (event.button.button == SDL_BUTTON_WHEELUP ||
event.button.button == SDL_BUTTON_WHEELDOWN)
{
- Ecore_Sdl_Event_Mouse_Wheel *ev;
+ Ecore_Event_Mouse_Wheel *ev;
+
+ ev = malloc(sizeof(Ecore_Event_Mouse_Wheel));
+ if (!ev) return ;
- ev = malloc(sizeof (Ecore_Sdl_Event_Mouse_Wheel));
- ev->x = event.button.x;
- ev->y = event.button.y;
+ ev->timestamp = time;
+ ev->window = 0;
+ ev->modifiers = 0; /* FIXME: keep modifier around. */
ev->direction = 0;
- ev->wheel = event.button.button == SDL_BUTTON_WHEELDOWN ? -1 : 1;
- ev->time = time;
+ ev->z = event.button.button == SDL_BUTTON_WHEELDOWN ? -1 : 1;
- ecore_event_add(ECORE_SDL_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
+ ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
}
else
{
- Ecore_Sdl_Event_Mouse_Button_Down *ev;
+ Ecore_Event_Mouse_Button *ev;
+
+ ev = malloc(sizeof(Ecore_Event_Mouse_Button));
+ if (!ev) return ;
- ev = malloc(sizeof (Ecore_Sdl_Event_Mouse_Button_Down));
- ev->x = event.button.x;
- ev->y = event.button.y;
- ev->button = event.button.button;
+ ev->timestamp = time;
+ ev->window = 0;
+ ev->modifiers = 0; /* FIXME: keep modifier around. */
+ ev->buttons = event.button.button;
ev->double_click = 0;
ev->triple_click = 0;
- ev->time = time;
- ecore_event_add(ECORE_SDL_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
+ ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
}
break;
}
case SDL_MOUSEBUTTONUP:
{
- Ecore_Sdl_Event_Mouse_Button_Up *ev;
+ Ecore_Event_Mouse_Button *ev;
- ev = malloc(sizeof (Ecore_Sdl_Event_Mouse_Button_Up));
- ev->x = event.button.x;
- ev->y = event.button.y;
- ev->button = event.button.button;
+ ev = malloc(sizeof(Ecore_Event_Mouse_Button));
+ if (!ev) return ;
+ ev->timestamp = time;
+ ev->window = 0;
+ ev->modifiers = 0; /* FIXME: keep modifier around. */
+ ev->buttons = event.button.button;
ev->double_click = 0;
ev->triple_click = 0;
- ev->time = time;
- ecore_event_add(ECORE_SDL_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
+ ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
break;
}
case SDL_VIDEORESIZE:
case SDL_KEYDOWN:
{
- Ecore_Sdl_Event_Key_Down *ev;
- unsigned int i;
+ Ecore_SDL_Pressed *entry;
+ Ecore_Event_Key *ev;
- ev = malloc(sizeof (Ecore_Sdl_Event_Key_Down));
- ev->time = time;
+ entry = (Ecore_SDL_Pressed*) eina_rbtree_inline_lookup(repeat, &event.key.keysym.sym, sizeof (event.key.keysym.sym),
+ EINA_RBTREE_CMP_KEY_CB(_ecore_sdl_pressed_node), NULL);
+ if (entry)
+ {
+ ev = _ecore_sdl_event_key(&event, time);
+ if (ev) ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
+ }
- for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_sdl_keys_s); ++i)
- if (keystable[i].code == event.key.keysym.sym)
- {
- ev->keyname = keystable[i].name;
- ev->keycompose = keystable[i].compose;
+ ev = _ecore_sdl_event_key(&event, time);
+ if (ev) ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, NULL, NULL);
- ecore_event_add(ECORE_SDL_EVENT_KEY_DOWN, ev, NULL, NULL);
- return ;
- }
+ if (!entry)
+ {
+ entry = malloc(sizeof (Ecore_SDL_Pressed));
+ if (!entry) break;
- free(ev);
+ entry->key = event.key.keysym.sym;
+
+ repeat = eina_rbtree_inline_insert(repeat, EINA_RBTREE_GET(entry),
+ EINA_RBTREE_CMP_NODE_CB(_ecore_sdl_pressed_key), NULL);
+ }
break;
}
case SDL_KEYUP:
{
- Ecore_Sdl_Event_Key_Up *ev;
- unsigned int i;
-
- ev = malloc(sizeof (Ecore_Sdl_Event_Key_Up));
- ev->time = time;
-
- for (i = 0; i < sizeof (keystable) / sizeof (struct _ecore_sdl_keys_s); ++i)
- if (keystable[i].code == event.key.keysym.sym)
- {
- ev->keyname = keystable[i].name;
- ev->keycompose = keystable[i].compose;
+ Ecore_Event_Key *ev;
+ Ecore_SDL_Pressed *entry;
- ecore_event_add(ECORE_SDL_EVENT_KEY_UP, ev, NULL, NULL);
- return ;
- }
+ entry = (Ecore_SDL_Pressed*) eina_rbtree_inline_lookup(repeat, &event.key.keysym.sym, sizeof (event.key.keysym.sym),
+ EINA_RBTREE_CMP_KEY_CB(_ecore_sdl_pressed_node), NULL);
+ if (entry)
+ {
+ repeat = eina_rbtree_inline_remove(repeat, EINA_RBTREE_GET(entry),
+ EINA_RBTREE_CMP_NODE_CB(_ecore_sdl_pressed_key), NULL);
+ free(entry);
+ }
- free(ev);
+ ev = _ecore_sdl_event_key(&event, time);
+ if (ev) ecore_event_add(ECORE_EVENT_KEY_UP, ev, NULL, NULL);
break;
}
case SDL_ACTIVEEVENT:
ECORE_X_SHAPE_CLIP
} Ecore_X_Shape_Type;
-typedef struct _Ecore_X_Event_Key_Down Ecore_X_Event_Key_Down;
-typedef struct _Ecore_X_Event_Key_Up Ecore_X_Event_Key_Up;
-typedef struct _Ecore_X_Event_Mouse_Button_Down Ecore_X_Event_Mouse_Button_Down;
-typedef struct _Ecore_X_Event_Mouse_Button_Up Ecore_X_Event_Mouse_Button_Up;
-typedef struct _Ecore_X_Event_Mouse_Move Ecore_X_Event_Mouse_Move;
typedef struct _Ecore_X_Event_Mouse_In Ecore_X_Event_Mouse_In;
typedef struct _Ecore_X_Event_Mouse_Out Ecore_X_Event_Mouse_Out;
-typedef struct _Ecore_X_Event_Mouse_Wheel Ecore_X_Event_Mouse_Wheel;
typedef struct _Ecore_X_Event_Window_Focus_In Ecore_X_Event_Window_Focus_In;
typedef struct _Ecore_X_Event_Window_Focus_Out Ecore_X_Event_Window_Focus_Out;
typedef struct _Ecore_X_Event_Window_Keymap Ecore_X_Event_Window_Keymap;
typedef struct _Ecore_X_Event_Startup_Sequence Ecore_X_Event_Startup_Sequence;
-struct _Ecore_X_Event_Key_Down
-{
- char *keyname;
- char *keysymbol;
- char *key_compose;
- int modifiers;
- int same_screen;
- Ecore_X_Window win;
- Ecore_X_Window event_win;
- Ecore_X_Window root_win;
- Ecore_X_Time time;
-};
-
-struct _Ecore_X_Event_Key_Up
-{
- char *keyname;
- char *keysymbol;
- char *key_compose;
- int modifiers;
- int same_screen;
- Ecore_X_Window win;
- Ecore_X_Window event_win;
- Ecore_X_Window root_win;
- Ecore_X_Time time;
-};
-
-struct _Ecore_X_Event_Mouse_Button_Down
-{
- int button;
- int modifiers;
- int x, y;
- int same_screen;
- struct {
- int x, y;
- } root;
- Ecore_X_Window win;
- Ecore_X_Window event_win;
- Ecore_X_Window root_win;
- Ecore_X_Time time;
- unsigned int double_click : 1;
- unsigned int triple_click : 1;
-};
-
-struct _Ecore_X_Event_Mouse_Button_Up
-{
- int button;
- int modifiers;
- int x, y;
- int same_screen;
- struct {
- int x, y;
- } root;
- Ecore_X_Window win;
- Ecore_X_Window event_win;
- Ecore_X_Window root_win;
- Ecore_X_Time time;
- unsigned int double_click : 1;
- unsigned int triple_click : 1;
-};
-
-struct _Ecore_X_Event_Mouse_Move
-{
- int modifiers;
- int x, y;
- int same_screen;
- struct {
- int x, y;
- } root;
- Ecore_X_Window win;
- Ecore_X_Window event_win;
- Ecore_X_Window root_win;
- Ecore_X_Time time;
-};
-
struct _Ecore_X_Event_Mouse_In
{
int modifiers;
Ecore_X_Time time;
};
-struct _Ecore_X_Event_Mouse_Wheel
-{
- int direction; /* 0 = default up/down wheel FIXME: more wheel types */
- int z; /* ...,-2,-1 = down, 1,2,... = up */
- int modifiers;
- int x, y;
- int same_screen;
-
- struct {
- int x, y;
- } root;
-
- Ecore_X_Window win;
- Ecore_X_Window event_win;
- Ecore_X_Window root_win;
- Ecore_X_Time time;
-};
-
struct _Ecore_X_Event_Window_Focus_In
{
Ecore_X_Window win;
int source;
};
-EAPI extern int ECORE_X_EVENT_KEY_DOWN;
-EAPI extern int ECORE_X_EVENT_KEY_UP;
-EAPI extern int ECORE_X_EVENT_MOUSE_BUTTON_DOWN;
-EAPI extern int ECORE_X_EVENT_MOUSE_BUTTON_UP;
-EAPI extern int ECORE_X_EVENT_MOUSE_MOVE;
EAPI extern int ECORE_X_EVENT_MOUSE_IN;
EAPI extern int ECORE_X_EVENT_MOUSE_OUT;
-EAPI extern int ECORE_X_EVENT_MOUSE_WHEEL;
EAPI extern int ECORE_X_EVENT_WINDOW_FOCUS_IN;
EAPI extern int ECORE_X_EVENT_WINDOW_FOCUS_OUT;
EAPI extern int ECORE_X_EVENT_WINDOW_KEYMAP;
-I$(top_srcdir)/src/lib/ecore \
-I$(top_srcdir)/src/lib/ecore_txt \
-I$(top_srcdir)/src/lib/ecore_x \
+-I$(top_srcdir)/src/lib/ecore_input \
-I$(top_builddir)/src/lib/ecore \
-I$(top_builddir)/src/lib/ecore_txt \
-I$(top_builddir)/src/lib/ecore_x \
+-I$(top_builddir)/src/lib/ecore_input \
@EINA_CFLAGS@
noinst_LTLIBRARIES = libecore_x_xcb.la
@XCB_LIBS@ \
$(top_builddir)/src/lib/ecore/libecore.la \
$(top_builddir)/src/lib/ecore_txt/libecore_txt.la \
+$(top_builddir)/src/lib/ecore_input/libecore_input.la \
@EINA_LIBS@
libecore_x_xcb_la_LDFLAGS = -version-info @version_info@
Ecore_X_Atom _ecore_xcb_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
-EAPI int ECORE_X_EVENT_KEY_DOWN = 0;
-EAPI int ECORE_X_EVENT_KEY_UP = 0;
-EAPI int ECORE_X_EVENT_MOUSE_BUTTON_DOWN = 0;
-EAPI int ECORE_X_EVENT_MOUSE_BUTTON_UP = 0;
-EAPI int ECORE_X_EVENT_MOUSE_MOVE = 0;
EAPI int ECORE_X_EVENT_MOUSE_IN = 0;
EAPI int ECORE_X_EVENT_MOUSE_OUT = 0;
-EAPI int ECORE_X_EVENT_MOUSE_WHEEL = 0;
EAPI int ECORE_X_EVENT_WINDOW_FOCUS_IN = 0;
EAPI int ECORE_X_EVENT_WINDOW_FOCUS_OUT = 0;
EAPI int ECORE_X_EVENT_WINDOW_KEYMAP = 0;
if (!ECORE_X_EVENT_KEY_DOWN)
{
- ECORE_X_EVENT_KEY_DOWN = ecore_event_type_new();
- ECORE_X_EVENT_KEY_UP = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_MOVE = ecore_event_type_new();
ECORE_X_EVENT_MOUSE_IN = ecore_event_type_new();
ECORE_X_EVENT_MOUSE_OUT = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_WHEEL = ecore_event_type_new();
ECORE_X_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
ECORE_X_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
ECORE_X_EVENT_WINDOW_KEYMAP = ecore_event_type_new();
-I$(top_srcdir)/src/lib/ecore \
-I$(top_srcdir)/src/lib/ecore_txt \
-I$(top_srcdir)/src/lib/ecore_x \
+-I$(top_srcdir)/src/lib/ecore_input \
-I$(top_builddir)/src/lib/ecore \
-I$(top_builddir)/src/lib/ecore_txt \
-I$(top_builddir)/src/lib/ecore_x \
+-I$(top_builddir)/src/lib/ecore_input \
@EINA_CFLAGS@
noinst_LTLIBRARIES = libecore_x_xlib.la
@x_libs@ \
$(top_builddir)/src/lib/ecore/libecore.la \
$(top_builddir)/src/lib/ecore_txt/libecore_txt.la \
+$(top_builddir)/src/lib/ecore_input/libecore_input.la \
@EINA_LIBS@
libecore_x_xlib_la_LDFLAGS = -version-info @version_info@
#endif
#include <stdlib.h>
+#include <string.h>
#include "ecore_private.h"
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
+#include "Ecore_Input.h"
static int _ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static int _ecore_x_fd_handler_buf(void *data, Ecore_Fd_Handler *fd_handler);
Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
-EAPI int ECORE_X_EVENT_KEY_DOWN = 0;
-EAPI int ECORE_X_EVENT_KEY_UP = 0;
-EAPI int ECORE_X_EVENT_MOUSE_BUTTON_DOWN = 0;
-EAPI int ECORE_X_EVENT_MOUSE_BUTTON_UP = 0;
-EAPI int ECORE_X_EVENT_MOUSE_MOVE = 0;
EAPI int ECORE_X_EVENT_MOUSE_IN = 0;
EAPI int ECORE_X_EVENT_MOUSE_OUT = 0;
-EAPI int ECORE_X_EVENT_MOUSE_WHEEL = 0;
EAPI int ECORE_X_EVENT_WINDOW_FOCUS_IN = 0;
EAPI int ECORE_X_EVENT_WINDOW_FOCUS_OUT = 0;
EAPI int ECORE_X_EVENT_WINDOW_KEYMAP = 0;
_ecore_x_init_count++;
return _ecore_x_init_count;
}
+ ecore_event_init();
+
_ecore_x_disp = XOpenDisplay((char *)name);
if (!_ecore_x_disp) return 0;
_ecore_x_error_handler_init();
while (0);
#endif
- if (!ECORE_X_EVENT_KEY_DOWN)
+ if (!ECORE_X_EVENT_MOUSE_IN)
{
- ECORE_X_EVENT_KEY_DOWN = ecore_event_type_new();
- ECORE_X_EVENT_KEY_UP = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_MOVE = ecore_event_type_new();
ECORE_X_EVENT_MOUSE_IN = ecore_event_type_new();
ECORE_X_EVENT_MOUSE_OUT = ecore_event_type_new();
- ECORE_X_EVENT_MOUSE_WHEEL = ecore_event_type_new();
ECORE_X_EVENT_WINDOW_FOCUS_IN = ecore_event_type_new();
ECORE_X_EVENT_WINDOW_FOCUS_OUT = ecore_event_type_new();
ECORE_X_EVENT_WINDOW_KEYMAP = ecore_event_type_new();
_ecore_x_selection_shutdown();
_ecore_x_dnd_shutdown();
ecore_x_netwm_shutdown();
+ ecore_event_shutdown();
if (_ecore_x_init_count < 0) _ecore_x_init_count = 0;
return _ecore_x_init_count;
}
{ "_NET_WM_WINDOW_SHADE", &ECORE_X_ATOM_NET_WM_WINDOW_SHADE },
{ "TARGETS", &ECORE_X_ATOM_SELECTION_TARGETS },
- { "PRIMARY", &ECORE_X_ATOM_SELECTION_PRIMARY },
- { "SECONDARY", &ECORE_X_ATOM_SELECTION_SECONDARY },
- { "CLIPBOARD", &ECORE_X_ATOM_SELECTION_CLIPBOARD },
+ { "CLIPBOARD", &ECORE_X_ATOM_SELECTION_PRIMARY },
+ { "PRIMARY", &ECORE_X_ATOM_SELECTION_SECONDARY },
+ { "SECONDARY", &ECORE_X_ATOM_SELECTION_CLIPBOARD },
{ "_ECORE_SELECTION_PRIMARY", &ECORE_X_ATOM_SELECTION_PROP_PRIMARY },
{ "_ECORE_SELECTION_SECONDARY", &ECORE_X_ATOM_SELECTION_PROP_SECONDARY },
{ "_ECORE_SELECTION_CLIPBOARD", &ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD },
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
+#include "Ecore_Input.h"
/** OpenBSD does not define CODESET
* FIXME ??
static void _ecore_x_event_free_window_prop_visible_icon_name_change(void *data, void *ev);
static void _ecore_x_event_free_window_prop_client_machine_change(void *data, void *ev);
#endif
-static void _ecore_x_event_free_key_down(void *data, void *ev);
-static void _ecore_x_event_free_key_up(void *data, void *ev);
-static void _ecore_x_event_free_mouse_move(void *data, void *ev);
static Window _ecore_x_mouse_down_last_win = 0;
static Window _ecore_x_mouse_down_last_last_win = 0;
static int _ecore_x_last_event_mouse_move = 0;
static Ecore_Event *_ecore_x_last_event_mouse_move_event = NULL;
+static void
+_ecore_x_event_free_mouse_move(void *data __UNUSED__, void *ev)
+{
+ Ecore_Event_Mouse_Move *e;
+
+ e = ev;
+ if (_ecore_x_last_event_mouse_move)
+ {
+ _ecore_x_last_event_mouse_move_event = NULL;
+ _ecore_x_last_event_mouse_move = 0;
+ }
+ free(e);
+}
+
EAPI void
ecore_x_event_mask_set(Ecore_X_Window w, Ecore_X_Event_Mask mask)
{
#endif
static void
-_ecore_x_event_free_key_down(void *data __UNUSED__, void *ev)
-{
- Ecore_X_Event_Key_Down *e;
-
- e = ev;
- if (e->keyname) free(e->keyname);
- if (e->keysymbol) free(e->keysymbol);
- if (e->key_compose) free(e->key_compose);
- free(e);
-}
-
-static void
-_ecore_x_event_free_key_up(void *data __UNUSED__, void *ev)
-{
- Ecore_X_Event_Key_Up *e;
-
- e = ev;
- if (e->keyname) free(e->keyname);
- if (e->keysymbol) free(e->keysymbol);
- if (e->key_compose) free(e->key_compose);
- free(e);
-}
-
-static void
-_ecore_x_event_free_mouse_move(void *data __UNUSED__, void *ev)
-{
- Ecore_X_Event_Mouse_Move *e;
-
- e = ev;
- if (_ecore_x_last_event_mouse_move)
- {
- _ecore_x_last_event_mouse_move_event = NULL;
- _ecore_x_last_event_mouse_move = 0;
- }
- free(e);
-}
-
-static void
_ecore_x_event_free_xdnd_enter(void *data __UNUSED__, void *ev)
{
Ecore_X_Event_Xdnd_Enter *e;
free(e);
}
-void
-_ecore_x_event_handle_key_press(XEvent *xevent)
+static unsigned int
+_ecore_x_event_modifiers(unsigned int state)
+{
+ unsigned int modifiers = 0;
+
+ if (state & ECORE_X_MODIFIER_SHIFT) modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
+ if (state & ECORE_X_MODIFIER_CTRL) modifiers |= ECORE_EVENT_MODIFIER_CTRL;
+ if (state & ECORE_X_MODIFIER_ALT) modifiers |= ECORE_EVENT_MODIFIER_ALT;
+ if (state & ECORE_X_MODIFIER_WIN) modifiers |= ECORE_EVENT_MODIFIER_WIN;
+ if (state & ECORE_X_LOCK_SCROLL) modifiers |= ECORE_EVENT_LOCK_SCROLL;
+ if (state & ECORE_X_LOCK_NUM) modifiers |= ECORE_EVENT_LOCK_NUM;
+ if (state & ECORE_X_LOCK_CAPS) modifiers |= ECORE_EVENT_LOCK_CAPS;
+
+ return modifiers;
+}
+
+static void
+_ecore_mouse_move(unsigned int timestamp, unsigned int xmodifiers,
+ int x, int y,
+ int x_root, int y_root,
+ unsigned int event_window,
+ unsigned int window,
+ unsigned int root_win,
+ int same_screen)
{
- Ecore_X_Event_Key_Down *e;
- char *keyname, *buf;
- int val, buflen = 256;
+ Ecore_Event_Mouse_Move *e;
+ Ecore_Event *event;
+
+ e = malloc(sizeof(Ecore_Event_Mouse_Move));
+ if (!e) return ;
+
+ e->window = window;
+ e->root_window = root_win;
+ e->timestamp = timestamp;
+ e->same_screen = same_screen;
+ e->event_window = event_window;
+
+ e->modifiers = _ecore_x_event_modifiers(xmodifiers);
+ e->x = x;
+ e->y = y;
+ e->root.x = x_root;
+ e->root.y = y_root;
+
+ event = ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, _ecore_x_event_free_mouse_move, NULL);
+
+ _ecore_x_event_last_time = timestamp;
+ _ecore_x_event_last_win = window;
+ _ecore_x_event_last_root_x = x_root;
+ _ecore_x_event_last_root_y = y_root;
+
+ _ecore_x_last_event_mouse_move_event = event;
+}
+
+static void
+_ecore_key_press(int event,
+ XKeyEvent *xevent)
+{
+ Ecore_Event_Key *e;
+ const char *compose = NULL;
+ char *tmp = NULL;
+ char *keyname;
+ char *key;
+ char keyname_buffer[256];
+ char compose_buffer[256];
KeySym sym;
XComposeStatus status;
+ int val;
_ecore_x_last_event_mouse_move = 0;
- e = calloc(1, sizeof(Ecore_X_Event_Key_Down));
- if (!e) return;
- buf = malloc(buflen);
- if (!buf)
- {
- free(e);
- return;
- }
- keyname = XKeysymToString(XKeycodeToKeysym(xevent->xkey.display,
- xevent->xkey.keycode, 0));
+ keyname = XKeysymToString(XKeycodeToKeysym(xevent->display,
+ xevent->keycode, 0));
if (!keyname)
{
- snprintf(buf, buflen, "Keycode-%i", xevent->xkey.keycode);
- keyname = buf;
- }
- e->keyname = strdup(keyname);
- if (!e->keyname)
- {
- free(buf);
- free(e);
- return;
+ snprintf(keyname_buffer, sizeof(keyname_buffer), "Keycode-%i", xevent->keycode);
+ keyname = keyname_buffer;
+ if (!keyname) return ;
}
+
+ sym = 0;
+ key = NULL;
+ compose = NULL;
if (_ecore_x_ic)
{
Status mbstatus;
-
#ifdef X_HAVE_UTF8_STRING
- val = Xutf8LookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus);
+ val = Xutf8LookupString(_ecore_x_ic, (XKeyEvent *)xevent, compose_buffer, sizeof(compose_buffer) - 1, &sym, &mbstatus);
#else
- val = XmbLookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus);
+ val = XmbLookupString(_ecore_x_ic, (XKeyEvent *)xevent, compose_buffer, sizeof(compose_buffer) - 1, &sym, &mbstatus);
#endif
if (mbstatus == XBufferOverflow)
{
- buflen = val + 1;
- buf = realloc(buf, buflen);
+ tmp = malloc(sizeof (char) * (val + 1));
+ if (!tmp) return ;
+
+ compose = tmp;
+
#ifdef X_HAVE_UTF8_STRING
- val = Xutf8LookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus);
+ val = Xutf8LookupString(_ecore_x_ic, (XKeyEvent *)xevent, tmp, val, &sym, &mbstatus);
#else
- val = XmbLookupString(_ecore_x_ic, (XKeyEvent *)xevent, buf, buflen - 1, &sym, &mbstatus);
+ val = XmbLookupString(_ecore_x_ic, (XKeyEvent *)xevent, tmp, val, &sym, &mbstatus);
+#endif
+ if (val > 0)
+ {
+ tmp[val] = 0;
+
+#ifndef X_HAVE_UTF8_STRING
+ compose = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8", tmp);
+ free(tmp);
+ tmp = compose;
#endif
+ }
+ else compose = NULL;
}
- if (val > 0)
- {
- buf[val] = 0;
+ else
+ if (val > 0)
+ {
+ compose_buffer[val] = 0;
#ifdef X_HAVE_UTF8_STRING
- e->key_compose = strdup(buf);
+ compose = compose_buffer;
#else
- e->key_compose = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8", buf);
+ compose = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8", compose_buffer);
+ tmp = compose;
#endif
- }
+ }
}
else
{
- val = XLookupString((XKeyEvent *)xevent, buf, sizeof(buf), &sym, &status);
+ val = XLookupString(xevent, compose_buffer, sizeof(compose_buffer), &sym, &status);
if (val > 0)
{
- buf[val] = 0;
- e->key_compose = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8", buf);
+ compose_buffer[val] = 0;
+ compose = ecore_txt_convert(nl_langinfo(CODESET), "UTF-8", compose_buffer);
+ tmp = compose;
}
- else e->key_compose = NULL;
}
- keyname = XKeysymToString(sym);
- if (keyname) e->keysymbol = strdup(keyname);
- else e->keysymbol = strdup(e->keyname);
- if (!e->keysymbol)
+
+ key = XKeysymToString(sym);
+ if (!key) key = keyname;
+ if (!key) goto on_error;
+
+ e = malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) + (compose ? strlen(compose) : 0) + 3);
+ if (!e) goto on_error;
+
+ e->keyname = (char*) (e + 1);
+ e->key = e->keyname + strlen(keyname) + 1;
+ e->compose = (compose) ? e->key + strlen(key) + 1 : NULL;
+ e->string = e->compose;
+
+ strcpy((char *) e->keyname, keyname);
+ strcpy((char *) e->key, key);
+ if (compose) strcpy((char *) e->compose, compose);
+
+ e->modifiers = _ecore_x_event_modifiers(xevent->state);
+
+ e->timestamp = xevent->time;
+ e->window = xevent->subwindow ? xevent->subwindow : xevent->window;
+ e->event_window = xevent->window;
+ e->same_screen = xevent->same_screen;
+ e->root_window = xevent->root;
+
+ ecore_event_add(event, e, NULL, NULL);
+
+ _ecore_x_event_last_time = e->timestamp;
+
+ on_error:
+ if (tmp) free(tmp);
+}
+
+static Ecore_Event_Mouse_Button*
+_ecore_mouse_button(int event,
+ unsigned int timestamp, unsigned int xmodifiers,
+ unsigned int buttons,
+ int x, int y,
+ int x_root, int y_root,
+ unsigned int event_window,
+ unsigned int window,
+ unsigned int root_win,
+ int same_screen)
+{
+ Ecore_Event_Mouse_Button *e;
+
+ e = malloc(sizeof(Ecore_Event_Mouse_Button));
+ if (!e) return NULL;
+
+ e->window = window;
+ e->root_window = root_win;
+ e->timestamp = timestamp;
+ e->same_screen = same_screen;
+ e->event_window = event_window;
+
+ e->buttons = buttons;
+ e->modifiers = _ecore_x_event_modifiers(xmodifiers);
+ e->double_click = 0;
+ e->triple_click = 0;
+ e->x = x;
+ e->y = y;
+ e->root.x = x_root;
+ e->root.y = y_root;
+
+ if (event_window == window)
{
- if (e->keyname) free(e->keyname);
- if (e->key_compose) free(e->key_compose);
- free(buf);
- free(e);
- return;
+ if (((int)(timestamp - _ecore_x_mouse_down_last_time) <=
+ (int)(1000 * _ecore_x_double_click_time)) &&
+ (window == _ecore_x_mouse_down_last_win) &&
+ (event_window == _ecore_x_mouse_down_last_event_win)
+ )
+ e->double_click = 1;
+ if (((int)(timestamp - _ecore_x_mouse_down_last_last_time) <=
+ (int)(2 * 1000 * _ecore_x_double_click_time)) &&
+ (window == _ecore_x_mouse_down_last_win) &&
+ (window == _ecore_x_mouse_down_last_last_win) &&
+ (event_window == _ecore_x_mouse_down_last_event_win) &&
+ (event_window == _ecore_x_mouse_down_last_last_event_win)
+ )
+ {
+ e->triple_click = 1;
+ _ecore_x_mouse_down_did_triple = 1;
+ }
+ else
+ _ecore_x_mouse_down_did_triple = 0;
}
- if (xevent->xkey.subwindow) e->win = xevent->xkey.subwindow;
- else e->win = xevent->xkey.window;
- e->event_win = xevent->xkey.window;
- e->time = xevent->xkey.time;
- e->modifiers = xevent->xkey.state;
- e->same_screen = xevent->xkey.same_screen;
- e->root_win = xevent->xkey.root;
- _ecore_x_event_last_time = e->time;
- ecore_event_add(ECORE_X_EVENT_KEY_DOWN, e, _ecore_x_event_free_key_down, NULL);
- free(buf);
+
+ if (event == ECORE_EVENT_MOUSE_BUTTON_DOWN
+ && !e->double_click
+ && !e->triple_click)
+ _ecore_x_mouse_up_count = 0;
+
+ _ecore_x_event_last_time = e->timestamp;
+ _ecore_x_event_last_win = e->window;
+ _ecore_x_event_last_root_x = x_root;
+ _ecore_x_event_last_root_y = y_root;
+
+ ecore_event_add(event, e, NULL, NULL);
+
+ return e;
}
void
-_ecore_x_event_handle_key_release(XEvent *xevent)
+_ecore_x_event_handle_key_press(XEvent *xevent)
{
- Ecore_X_Event_Key_Up *e;
- char *keyname;
- int val;
- char buf[256];
- KeySym sym;
- XComposeStatus status;
+ _ecore_key_press(ECORE_EVENT_KEY_DOWN, (XKeyEvent *) xevent);
+}
- _ecore_x_last_event_mouse_move = 0;
- e = calloc(1, sizeof(Ecore_X_Event_Key_Up));
- if (!e) return;
- keyname = XKeysymToString(XKeycodeToKeysym(xevent->xkey.display,
- xevent->xkey.keycode, 0));
- if (!keyname)
- {
- snprintf(buf, sizeof(buf), "Keycode-%i", xevent->xkey.keycode);
- keyname = buf;
- }
- e->keyname = strdup(keyname);
- if (!e->keyname)
- {
- free(e);
- return;
- }
- val = XLookupString((XKeyEvent *)xevent, buf, sizeof(buf), &sym, &status);
- if (val > 0)
- {
- buf[val] = 0;
- e->key_compose = ecore_txt_convert("ISO8859-1", "UTF-8", buf);
- }
- else e->key_compose = NULL;
- keyname = XKeysymToString(sym);
- if (keyname) e->keysymbol = strdup(keyname);
- else e->keysymbol = strdup(e->keyname);
- if (!e->keysymbol)
- {
- if (e->keyname) free(e->keyname);
- if (e->key_compose) free(e->key_compose);
- free(e);
- return;
- }
- if (xevent->xkey.subwindow) e->win = xevent->xkey.subwindow;
- else e->win = xevent->xkey.window;
- e->event_win = xevent->xkey.window;
- e->time = xevent->xkey.time;
- e->modifiers = xevent->xkey.state;
- e->same_screen = xevent->xkey.same_screen;
- e->root_win = xevent->xkey.root;
- _ecore_x_event_last_time = e->time;
- ecore_event_add(ECORE_X_EVENT_KEY_UP, e, _ecore_x_event_free_key_up, NULL);
+void
+_ecore_x_event_handle_key_release(XEvent *xevent)
+{
+ _ecore_key_press(ECORE_EVENT_KEY_UP, (XKeyEvent *) xevent);
}
void
_ecore_x_last_event_mouse_move = 0;
if ((xevent->xbutton.button > 3) && (xevent->xbutton.button < 8))
{
- Ecore_X_Event_Mouse_Wheel *e;
+ Ecore_Event_Mouse_Wheel *e;
- e = malloc(sizeof(Ecore_X_Event_Mouse_Wheel));
+ e = malloc(sizeof(Ecore_Event_Mouse_Wheel));
if (!e) return;
- e->modifiers = xevent->xbutton.state;
- e->direction = 0;
- e->z = 0;
- if (xevent->xbutton.button == 4)
- {
- e->direction = 0;
- e->z = -1;
- }
- else if (xevent->xbutton.button == 5)
+ e->timestamp = xevent->xbutton.time;
+ e->modifiers = _ecore_x_event_modifiers(xevent->xbutton.state);
+ switch (xevent->xbutton.button)
{
- e->direction = 0;
- e->z = 1;
- }
- else if (xevent->xbutton.button == 6)
- {
- e->direction = 1;
- e->z = -1;
- }
- else if (xevent->xbutton.button == 7)
- {
- e->direction = 1;
- e->z = 1;
+ case 4: e->direction = 0; e->z = -1; break;
+ case 5: e->direction = 0; e->z = 1; break;
+ case 6: e->direction = 1; e->z = -1; break;
+ case 7: e->direction = 1; e->z = 1; break;
}
+
e->x = xevent->xbutton.x;
e->y = xevent->xbutton.y;
e->root.x = xevent->xbutton.x_root;
e->root.y = xevent->xbutton.y_root;
- if (xevent->xbutton.subwindow)
- e->win = xevent->xbutton.subwindow;
- else
- e->win = xevent->xbutton.window;
-
- e->event_win = xevent->xbutton.window;
+ if (xevent->xbutton.subwindow) e->window = xevent->xbutton.subwindow;
+ else e->window = xevent->xbutton.window;
+ e->event_window = xevent->xbutton.window;
e->same_screen = xevent->xbutton.same_screen;
- e->root_win = xevent->xbutton.root;
- e->time = xevent->xbutton.time;
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- ecore_event_add(ECORE_X_EVENT_MOUSE_WHEEL, e, NULL, NULL);
+ e->root_window = xevent->xbutton.root;
+
+ _ecore_x_event_last_time = e->timestamp;
+ _ecore_x_event_last_win = e->window;
+ _ecore_x_event_last_root_x = xevent->xbutton.x_root;
+ _ecore_x_event_last_root_y = xevent->xbutton.y_root;
+ ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, e, NULL, NULL);
+
for (i = 0; i < _ecore_window_grabs_num; i++)
{
if ((_ecore_window_grabs[i] == xevent->xbutton.window) ||
int replay = 0;
if (_ecore_window_grab_replay_func)
- replay = _ecore_window_grab_replay_func(_ecore_window_grab_replay_data,
- ECORE_X_EVENT_MOUSE_WHEEL,
+ replay = _ecore_window_grab_replay_func(_ecore_window_grab_replay_data,
+ ECORE_EVENT_MOUSE_WHEEL,
e);
if (replay)
XAllowEvents(xevent->xbutton.display,
}
else
{
- {
- Ecore_X_Event_Mouse_Move *e;
-
- e = calloc(1, sizeof(Ecore_X_Event_Mouse_Move));
- if (!e) return;
- e->modifiers = xevent->xbutton.state;
- e->x = xevent->xbutton.x;
- e->y = xevent->xbutton.y;
- e->root.x = xevent->xbutton.x_root;
- e->root.y = xevent->xbutton.y_root;
- if (xevent->xbutton.subwindow) e->win = xevent->xbutton.subwindow;
- else e->win = xevent->xbutton.window;
- e->same_screen = xevent->xbutton.same_screen;
- e->root_win = xevent->xbutton.root;
- e->event_win = xevent->xbutton.window;
- e->time = xevent->xbutton.time;
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- ecore_event_add(ECORE_X_EVENT_MOUSE_MOVE, e, NULL, NULL);
- }
- {
- Ecore_X_Event_Mouse_Button_Down *e;
-
- if (_ecore_x_mouse_down_did_triple)
- {
- _ecore_x_mouse_down_last_win = 0;
- _ecore_x_mouse_down_last_last_win = 0;
- _ecore_x_mouse_down_last_event_win = 0;
- _ecore_x_mouse_down_last_last_event_win = 0;
- _ecore_x_mouse_down_last_time = 0;
- _ecore_x_mouse_down_last_last_time = 0;
- }
-
- e = calloc(1, sizeof(Ecore_X_Event_Mouse_Button_Down));
- if (!e) return;
- e->button = xevent->xbutton.button;
- e->modifiers = xevent->xbutton.state;
- e->x = xevent->xbutton.x;
- e->y = xevent->xbutton.y;
- e->root.x = xevent->xbutton.x_root;
- e->root.y = xevent->xbutton.y_root;
- if (xevent->xbutton.subwindow) e->win = xevent->xbutton.subwindow;
- else e->win = xevent->xbutton.window;
- e->same_screen = xevent->xbutton.same_screen;
- e->root_win = xevent->xbutton.root;
- e->event_win = xevent->xbutton.window;
- e->time = xevent->xbutton.time;
- if (e->win == e->event_win)
- {
- if (((int)(e->time - _ecore_x_mouse_down_last_time) <=
- (int)(1000 * _ecore_x_double_click_time)) &&
- (e->win == _ecore_x_mouse_down_last_win) &&
- (e->event_win == _ecore_x_mouse_down_last_event_win)
- )
- e->double_click = 1;
- if (((int)(e->time - _ecore_x_mouse_down_last_last_time) <=
- (int)(2 * 1000 * _ecore_x_double_click_time)) &&
- (e->win == _ecore_x_mouse_down_last_win) &&
- (e->win == _ecore_x_mouse_down_last_last_win) &&
- (e->event_win == _ecore_x_mouse_down_last_event_win) &&
- (e->event_win == _ecore_x_mouse_down_last_last_event_win)
- )
- {
- e->triple_click = 1;
- _ecore_x_mouse_down_did_triple = 1;
- }
- else
- _ecore_x_mouse_down_did_triple = 0;
- }
- if (!e->double_click && !e->triple_click)
- _ecore_x_mouse_up_count = 0;
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- ecore_event_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
+ {
+ _ecore_mouse_move(xevent->xbutton.time, xevent->xbutton.state,
+ xevent->xbutton.x, xevent->xbutton.y,
+ xevent->xbutton.x_root, xevent->xbutton.y_root,
+ xevent->xbutton.window,
+ (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->xbutton.window),
+ xevent->xbutton.root,
+ xevent->xbutton.same_screen);
+ }
+ {
+ Ecore_Event_Mouse_Button *e;
+ int event_window;
+ int window;
+
+ if (_ecore_x_mouse_down_did_triple)
+ {
+ _ecore_x_mouse_down_last_win = 0;
+ _ecore_x_mouse_down_last_last_win = 0;
+ _ecore_x_mouse_down_last_event_win = 0;
+ _ecore_x_mouse_down_last_last_event_win = 0;
+ _ecore_x_mouse_down_last_time = 0;
+ _ecore_x_mouse_down_last_last_time = 0;
+ }
+
+ window = (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->xbutton.window);
+ event_window = xevent->xbutton.window;
+
+ e = _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ xevent->xbutton.time, xevent->xbutton.state,
+ xevent->xbutton.button,
+ xevent->xbutton.x, xevent->xbutton.y,
+ xevent->xbutton.x_root, xevent->xbutton.y_root,
+ event_window, window,
+ xevent->xbutton.root, xevent->xbutton.same_screen);
+ if (e)
for (i = 0; i < _ecore_window_grabs_num; i++)
{
if ((_ecore_window_grabs[i] == xevent->xbutton.window) ||
int replay = 0;
if (_ecore_window_grab_replay_func)
- replay = _ecore_window_grab_replay_func(_ecore_window_grab_replay_data,
- ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
+ replay = _ecore_window_grab_replay_func(_ecore_window_grab_replay_data,
+ ECORE_EVENT_MOUSE_BUTTON_DOWN,
e);
if (replay)
XAllowEvents(xevent->xbutton.display,
break;
}
}
- if (e->win == e->event_win)
- {
- if (!_ecore_x_mouse_down_did_triple)
- {
- _ecore_x_mouse_down_last_last_win = _ecore_x_mouse_down_last_win;
- if (xevent->xbutton.subwindow)
- _ecore_x_mouse_down_last_win = xevent->xbutton.subwindow;
- else
- _ecore_x_mouse_down_last_win = xevent->xbutton.window;
- _ecore_x_mouse_down_last_last_event_win = _ecore_x_mouse_down_last_event_win;
- _ecore_x_mouse_down_last_event_win = xevent->xbutton.window;
- _ecore_x_mouse_down_last_last_time = _ecore_x_mouse_down_last_time;
- _ecore_x_mouse_down_last_time = xevent->xbutton.time;
- }
- }
- }
+
+ if (window == event_window)
+ {
+ if (!_ecore_x_mouse_down_did_triple)
+ {
+ _ecore_x_mouse_down_last_last_win = _ecore_x_mouse_down_last_win;
+ if (xevent->xbutton.subwindow)
+ _ecore_x_mouse_down_last_win = xevent->xbutton.subwindow;
+ else
+ _ecore_x_mouse_down_last_win = xevent->xbutton.window;
+ _ecore_x_mouse_down_last_last_event_win = _ecore_x_mouse_down_last_event_win;
+ _ecore_x_mouse_down_last_event_win = xevent->xbutton.window;
+ _ecore_x_mouse_down_last_last_time = _ecore_x_mouse_down_last_time;
+ _ecore_x_mouse_down_last_time = xevent->xbutton.time;
+ }
+ }
+ }
}
}
/* filter out wheel buttons */
if ((xevent->xbutton.button <= 3) || (xevent->xbutton.button > 7))
{
- {
- Ecore_X_Event_Mouse_Move *e;
-
- e = calloc(1, sizeof(Ecore_X_Event_Mouse_Move));
- if (!e) return;
- e->modifiers = xevent->xbutton.state;
- e->x = xevent->xbutton.x;
- e->y = xevent->xbutton.y;
- e->root.x = xevent->xbutton.x_root;
- e->root.y = xevent->xbutton.y_root;
- if (xevent->xbutton.subwindow) e->win = xevent->xbutton.subwindow;
- else e->win = xevent->xbutton.window;
- e->same_screen = xevent->xbutton.same_screen;
- e->root_win = xevent->xbutton.root;
- e->event_win = xevent->xbutton.window;
- e->time = xevent->xbutton.time;
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- ecore_event_add(ECORE_X_EVENT_MOUSE_MOVE, e, NULL, NULL);
- }
- {
- Ecore_X_Event_Mouse_Button_Up *e;
-
- e = calloc(1, sizeof(Ecore_X_Event_Mouse_Button_Up));
- if (!e) return;
- e->button = xevent->xbutton.button;
- e->modifiers = xevent->xbutton.state;
- e->x = xevent->xbutton.x;
- e->y = xevent->xbutton.y;
- e->root.x = xevent->xbutton.x_root;
- e->root.y = xevent->xbutton.y_root;
- if (xevent->xbutton.subwindow) e->win = xevent->xbutton.subwindow;
- else e->win = xevent->xbutton.window;
- e->same_screen = xevent->xbutton.same_screen;
- e->root_win = xevent->xbutton.root;
- e->event_win = xevent->xbutton.window;
- e->time = xevent->xbutton.time;
- _ecore_x_mouse_up_count++;
- if (e->win == e->event_win)
- {
- if ((_ecore_x_mouse_up_count >= 2) &&
- ((int)(e->time - _ecore_x_mouse_down_last_time) <=
- (int)(1000 * _ecore_x_double_click_time)) &&
- (e->win == _ecore_x_mouse_down_last_win) &&
- (e->event_win == _ecore_x_mouse_down_last_event_win)
- )
- e->double_click = 1;
- if ((_ecore_x_mouse_up_count >= 3) &&
- ((int)(e->time - _ecore_x_mouse_down_last_last_time) <=
- (int)(2 * 1000 * _ecore_x_double_click_time)) &&
- (e->win == _ecore_x_mouse_down_last_win) &&
- (e->win == _ecore_x_mouse_down_last_last_win) &&
- (e->event_win == _ecore_x_mouse_down_last_event_win) &&
- (e->event_win == _ecore_x_mouse_down_last_last_event_win)
- )
- e->triple_click = 1;
- }
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- ecore_event_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
- }
+ _ecore_mouse_move(xevent->xbutton.time, xevent->xbutton.state,
+ xevent->xbutton.x, xevent->xbutton.y,
+ xevent->xbutton.x_root, xevent->xbutton.y_root,
+ xevent->xbutton.window,
+ (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->xbutton.window),
+ xevent->xbutton.root,
+ xevent->xbutton.same_screen);
+
+ _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP,
+ xevent->xbutton.time, xevent->xbutton.state,
+ xevent->xbutton.button,
+ xevent->xbutton.x, xevent->xbutton.y,
+ xevent->xbutton.x_root, xevent->xbutton.y_root,
+ xevent->xbutton.window,
+ (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->xbutton.window),
+ xevent->xbutton.root,
+ xevent->xbutton.same_screen);
}
}
void
_ecore_x_event_handle_motion_notify(XEvent *xevent)
{
- Ecore_X_Event_Mouse_Move *e;
- Ecore_Event *event;
-
if (_ecore_x_last_event_mouse_move)
{
ecore_event_del(_ecore_x_last_event_mouse_move_event);
_ecore_x_last_event_mouse_move = 0;
_ecore_x_last_event_mouse_move_event = NULL;
}
- e = calloc(1, sizeof(Ecore_X_Event_Mouse_Move));
- if (!e) return;
- e->modifiers = xevent->xmotion.state;
- e->x = xevent->xmotion.x;
- e->y = xevent->xmotion.y;
- e->root.x = xevent->xmotion.x_root;
- e->root.y = xevent->xmotion.y_root;
- if (xevent->xmotion.subwindow) e->win = xevent->xmotion.subwindow;
- else e->win = xevent->xmotion.window;
- e->same_screen = xevent->xmotion.same_screen;
- e->root_win = xevent->xmotion.root;
- e->event_win = xevent->xmotion.window;
- e->time = xevent->xmotion.time;
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- /* Xdnd handling */
- _ecore_x_dnd_drag(xevent->xmotion.root, e->root.x, e->root.y);
+ _ecore_mouse_move(xevent->xmotion.time, xevent->xmotion.state,
+ xevent->xmotion.x, xevent->xmotion.y,
+ xevent->xmotion.x_root, xevent->xmotion.y_root,
+ xevent->xmotion.window,
+ (xevent->xmotion.subwindow ? xevent->xmotion.subwindow : xevent->xmotion.window),
+ xevent->xmotion.root,
+ xevent->xmotion.same_screen);
- event = ecore_event_add(ECORE_X_EVENT_MOUSE_MOVE, e, _ecore_x_event_free_mouse_move, NULL);
_ecore_x_last_event_mouse_move = 1;
- _ecore_x_last_event_mouse_move_event = event;
+
+ /* Xdnd handling */
+ _ecore_x_dnd_drag(xevent->xmotion.root, xevent->xmotion.x_root, xevent->xmotion.y_root);
}
void
{
_ecore_x_last_event_mouse_move = 0;
{
- Ecore_X_Event_Mouse_Move *e;
-
- e = calloc(1, sizeof(Ecore_X_Event_Mouse_Move));
- if (!e) return;
- e->modifiers = xevent->xcrossing.state;
- e->x = xevent->xcrossing.x;
- e->y = xevent->xcrossing.y;
- e->root.x = xevent->xcrossing.x_root;
- e->root.y = xevent->xcrossing.y_root;
- if (xevent->xcrossing.subwindow) e->win = xevent->xcrossing.subwindow;
- else e->win = xevent->xcrossing.window;
- e->same_screen = xevent->xcrossing.same_screen;
- e->root_win = xevent->xcrossing.root;
- e->event_win = xevent->xcrossing.window;
- e->time = xevent->xcrossing.time;
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- ecore_event_add(ECORE_X_EVENT_MOUSE_MOVE, e, NULL, NULL);
+ _ecore_mouse_move(xevent->xmotion.time, xevent->xcrossing.state,
+ xevent->xcrossing.x, xevent->xcrossing.y,
+ xevent->xcrossing.x_root, xevent->xcrossing.y_root,
+ xevent->xcrossing.window,
+ (xevent->xcrossing.subwindow ? xevent->xcrossing.subwindow : xevent->xcrossing.window),
+ xevent->xcrossing.root,
+ xevent->xcrossing.same_screen);
}
{
Ecore_X_Event_Mouse_In *e;
e = calloc(1, sizeof(Ecore_X_Event_Mouse_In));
if (!e) return;
- e->modifiers = xevent->xcrossing.state;
+ e->modifiers = _ecore_x_event_modifiers(xevent->xcrossing.state);
e->x = xevent->xcrossing.x;
e->y = xevent->xcrossing.y;
e->root.x = xevent->xcrossing.x_root;
{
_ecore_x_last_event_mouse_move = 0;
{
- Ecore_X_Event_Mouse_Move *e;
-
- e = calloc(1, sizeof(Ecore_X_Event_Mouse_Move));
- if (!e) return;
- e->modifiers = xevent->xcrossing.state;
- e->x = xevent->xcrossing.x;
- e->y = xevent->xcrossing.y;
- e->root.x = xevent->xcrossing.x_root;
- e->root.y = xevent->xcrossing.y_root;
- if (xevent->xcrossing.subwindow) e->win = xevent->xcrossing.subwindow;
- else e->win = xevent->xcrossing.window;
- e->same_screen = xevent->xcrossing.same_screen;
- e->root_win = xevent->xcrossing.root;
- e->event_win = xevent->xcrossing.window;
- e->time = xevent->xcrossing.time;
- _ecore_x_event_last_time = e->time;
- _ecore_x_event_last_win = e->win;
- _ecore_x_event_last_root_x = e->root.x;
- _ecore_x_event_last_root_y = e->root.y;
- ecore_event_add(ECORE_X_EVENT_MOUSE_MOVE, e, NULL, NULL);
+ _ecore_mouse_move(xevent->xmotion.time, xevent->xcrossing.state,
+ xevent->xcrossing.x, xevent->xcrossing.y,
+ xevent->xcrossing.x_root, xevent->xcrossing.y_root,
+ xevent->xcrossing.window,
+ (xevent->xcrossing.subwindow ? xevent->xcrossing.subwindow : xevent->xcrossing.window),
+ xevent->xcrossing.root,
+ xevent->xcrossing.same_screen);
}
{
Ecore_X_Event_Mouse_Out *e;
e = calloc(1, sizeof(Ecore_X_Event_Mouse_Out));
if (!e) return;
- e->modifiers = xevent->xcrossing.state;
+ e->modifiers = _ecore_x_event_modifiers(xevent->xcrossing.state);
e->x = xevent->xcrossing.x;
e->y = xevent->xcrossing.y;
e->root.x = xevent->xcrossing.x_root;
# include <config.h>
#endif
+#include <string.h>
+
#include "Ecore.h"
#include "Ecore_Data.h"
#include "ecore_x_private.h"
int will_accept;
} Ecore_X_DND_Target;
+
+extern int ECORE_X_MODIFIER_SHIFT;
+extern int ECORE_X_MODIFIER_CTRL;
+extern int ECORE_X_MODIFIER_ALT;
+extern int ECORE_X_MODIFIER_WIN;
+
+extern int ECORE_X_LOCK_SCROLL;
+extern int ECORE_X_LOCK_NUM;
+extern int ECORE_X_LOCK_CAPS;
+
extern Display *_ecore_x_disp;
extern double _ecore_x_double_click_time;
extern Time _ecore_x_event_last_time;