From c322573793f833fc52e55f8d2df2dc53219562e1 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 13 Jun 2013 15:02:24 +0100 Subject: [PATCH] Start to process mouse down & up events ... Prelude to working menus ;) Signed-off-by: Chris Michael --- src/modules/wl_x11/e_mod_main.c | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/modules/wl_x11/e_mod_main.c b/src/modules/wl_x11/e_mod_main.c index bb8d62ccd..36a0c3838 100644 --- a/src/modules/wl_x11/e_mod_main.c +++ b/src/modules/wl_x11/e_mod_main.c @@ -15,6 +15,8 @@ static void _output_cb_destroy(E_Output *output); static Eina_Bool _output_cb_window_damage(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static Eina_Bool _output_cb_window_destroy(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static Eina_Bool _output_cb_window_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); +static Eina_Bool _output_cb_window_mouse_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); +static Eina_Bool _output_cb_window_mouse_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); /* local variables */ static E_Compositor_X11 *_e_x11_comp; @@ -78,6 +80,10 @@ e_modapi_init(E_Module *m) _output_cb_window_destroy, NULL); E_LIST_HANDLER_APPEND(_hdlrs, ECORE_EVENT_MOUSE_MOVE, _output_cb_window_mouse_move, NULL); + E_LIST_HANDLER_APPEND(_hdlrs, ECORE_EVENT_MOUSE_BUTTON_DOWN, + _output_cb_window_mouse_down, NULL); + E_LIST_HANDLER_APPEND(_hdlrs, ECORE_EVENT_MOUSE_BUTTON_UP, + _output_cb_window_mouse_up, NULL); /* flush any pending events * @@ -443,3 +449,49 @@ _output_cb_window_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void return ECORE_CALLBACK_PASS_ON; } + +static Eina_Bool +_output_cb_window_mouse_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + Ecore_Event_Mouse_Button *ev; + E_Output_X11 *output; + Eina_List *l; + + ev = event; + + /* loop the existing outputs */ + EINA_LIST_FOREACH(_e_x11_comp->base.outputs, l, output) + { + /* try to match the output window */ + if (ev->window == output->win) + { + printf("Send Mouse Down !!\n"); + break; + } + } + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_output_cb_window_mouse_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + Ecore_Event_Mouse_Button *ev; + E_Output_X11 *output; + Eina_List *l; + + ev = event; + + /* loop the existing outputs */ + EINA_LIST_FOREACH(_e_x11_comp->base.outputs, l, output) + { + /* try to match the output window */ + if (ev->window == output->win) + { + printf("Send Mouse Up !!\n"); + break; + } + } + + return ECORE_CALLBACK_PASS_ON; +}