From d504284dd241d2d1713e9e94f7e6efee8e0ee9ac Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Thu, 25 Aug 2016 19:20:10 +0900 Subject: [PATCH] efl: Rename Efl.Event.XX to Efl.Input.XX This removes: Efl.Event interface And renames: Efl.Event.Input -> Efl.Input.Event Efl.Event -> Efl.Input.Event (merged) Efl.Event.Pointer -> Efl.Input.Pointer Efl.Event.Key -> Efl.Input.Key Efl.Event.Hold -> Efl.Input.Hold This also moves some interfaces from efl/ to evas/ where they belong better. This allows renaming Eo_Event to Efl_Event. --- src/Makefile_Efl.am | 5 +- src/Makefile_Evas.am | 18 +- src/bin/elementary/test_events.c | 30 +-- src/lib/ecore_evas/ecore_evas.c | 40 ++-- src/lib/edje/edje_callbacks.c | 28 +-- src/lib/efl/Efl.h | 8 +- src/lib/efl/interfaces/efl_common_internal.h | 22 +- src/lib/efl/interfaces/efl_event.eo | 44 ---- .../{efl_event_types.eot => efl_input_types.eot} | 21 +- src/lib/efl/interfaces/efl_interfaces_main.c | 4 - src/lib/elementary/efl_ui_win.c | 24 +-- src/lib/elementary/elc_fileselector.c | 10 +- src/lib/elementary/elm_spinner.c | 4 +- src/lib/elementary/elm_widget.c | 10 +- src/lib/elementary/elm_widget.eo | 4 +- src/lib/evas/Evas_Common.h | 16 +- src/lib/evas/Evas_Eo.h | 10 +- src/lib/evas/canvas/efl_canvas_object.eo | 8 +- src/lib/evas/canvas/efl_event_hold.c | 118 ----------- src/lib/evas/canvas/efl_event_hold.eo | 26 --- src/lib/evas/canvas/efl_event_input.c | 48 ----- src/lib/evas/canvas/efl_event_input.eo | 40 ---- src/lib/evas/canvas/efl_input_event.c | 52 +++++ src/lib/evas/canvas/efl_input_event.eo | 76 +++++++ src/lib/evas/canvas/efl_input_hold.c | 118 +++++++++++ src/lib/evas/canvas/efl_input_hold.eo | 25 +++ .../canvas}/efl_input_interface.eo | 28 +-- .../canvas/{efl_event_key.c => efl_input_key.c} | 94 ++++----- .../canvas/{efl_event_key.eo => efl_input_key.eo} | 22 +- .../{efl_event_pointer.c => efl_input_pointer.c} | 124 +++++------ .../{efl_event_pointer.eo => efl_input_pointer.eo} | 24 +-- .../interfaces => evas/canvas}/efl_input_state.eo | 0 src/lib/evas/canvas/evas_callbacks.c | 16 +- src/lib/evas/canvas/evas_canvas.eo | 4 +- src/lib/evas/canvas/evas_events.c | 228 ++++++++++----------- src/lib/evas/canvas/evas_events_legacy.c | 14 +- src/lib/evas/include/evas_private.h | 6 +- src/tests/emotion/emotion_test_main-eo.c | 4 +- 38 files changed, 684 insertions(+), 689 deletions(-) delete mode 100644 src/lib/efl/interfaces/efl_event.eo rename src/lib/efl/interfaces/{efl_event_types.eot => efl_input_types.eot} (94%) delete mode 100644 src/lib/evas/canvas/efl_event_hold.c delete mode 100644 src/lib/evas/canvas/efl_event_hold.eo delete mode 100644 src/lib/evas/canvas/efl_event_input.c delete mode 100644 src/lib/evas/canvas/efl_event_input.eo create mode 100644 src/lib/evas/canvas/efl_input_event.c create mode 100644 src/lib/evas/canvas/efl_input_event.eo create mode 100644 src/lib/evas/canvas/efl_input_hold.c create mode 100644 src/lib/evas/canvas/efl_input_hold.eo rename src/lib/{efl/interfaces => evas/canvas}/efl_input_interface.eo (66%) rename src/lib/evas/canvas/{efl_event_key.c => efl_input_key.c} (53%) rename src/lib/evas/canvas/{efl_event_key.eo => efl_input_key.eo} (75%) rename src/lib/evas/canvas/{efl_event_pointer.c => efl_input_pointer.c} (67%) rename src/lib/evas/canvas/{efl_event_pointer.eo => efl_input_pointer.eo} (91%) rename src/lib/{efl/interfaces => evas/canvas}/efl_input_state.eo (100%) diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index a66ab6b..a379137 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -42,9 +42,6 @@ efl_eolian_files = \ lib/efl/interfaces/efl_vpath_file_core.eo \ lib/efl/interfaces/efl_ui_spin.eo \ lib/efl/interfaces/efl_ui_progress.eo \ - lib/efl/interfaces/efl_event.eo \ - lib/efl/interfaces/efl_input_interface.eo \ - lib/efl/interfaces/efl_input_state.eo \ lib/efl/interfaces/efl_screen.eo \ lib/efl/interfaces/efl_io_closer.eo \ lib/efl/interfaces/efl_io_positioner.eo \ @@ -58,7 +55,7 @@ efl_eolian_files = \ efl_eolian_type_files = \ lib/efl/interfaces/efl_gfx_types.eot \ - lib/efl/interfaces/efl_event_types.eot \ + lib/efl/interfaces/efl_input_types.eot \ lib/efl/interfaces/efl_types.eot \ lib/efl/interfaces/efl_text_types.eot \ $(NULL) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index e86f861..f313861 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -42,10 +42,12 @@ evas_eolian_pub_files = \ lib/evas/canvas/efl_canvas_surface_wayland.eo \ lib/evas/canvas/efl_canvas_filter_internal.eo \ lib/evas/canvas/efl_canvas_group_clipped.eo \ - lib/evas/canvas/efl_event_input.eo \ - lib/evas/canvas/efl_event_key.eo \ - lib/evas/canvas/efl_event_pointer.eo \ - lib/evas/canvas/efl_event_hold.eo \ + lib/evas/canvas/efl_input_state.eo \ + lib/evas/canvas/efl_input_interface.eo \ + lib/evas/canvas/efl_input_event.eo \ + lib/evas/canvas/efl_input_key.eo \ + lib/evas/canvas/efl_input_pointer.eo \ + lib/evas/canvas/efl_input_hold.eo \ lib/evas/canvas/efl_gfx_map.eo \ $(NULL) @@ -202,10 +204,10 @@ lib/evas/canvas/efl_canvas_surface.c \ lib/evas/canvas/efl_canvas_surface_tbm.c \ lib/evas/canvas/efl_canvas_surface_x11.c \ lib/evas/canvas/efl_canvas_surface_wayland.c \ -lib/evas/canvas/efl_event_input.c \ -lib/evas/canvas/efl_event_key.c \ -lib/evas/canvas/efl_event_pointer.c \ -lib/evas/canvas/efl_event_hold.c \ +lib/evas/canvas/efl_input_event.c \ +lib/evas/canvas/efl_input_key.c \ +lib/evas/canvas/efl_input_pointer.c \ +lib/evas/canvas/efl_input_hold.c \ $(NULL) EXTRA_DIST2 += \ diff --git a/src/bin/elementary/test_events.c b/src/bin/elementary/test_events.c index 3d7c9de..60bd7f8 100644 --- a/src/bin/elementary/test_events.c +++ b/src/bin/elementary/test_events.c @@ -23,7 +23,7 @@ _pointer_down(void *data, const Eo_Event *ev) testdata *td = data; td->down = 1; efl_del(td->evdown); - td->evdown = efl_event_dup(ev->info); + td->evdown = efl_input_dup(ev->info); } static void @@ -31,7 +31,7 @@ _pointer_move(void *data, const Eo_Event *ev) { testdata *td = data; efl_del(td->evmove); - td->evmove = efl_event_dup(ev->info); + td->evmove = efl_input_dup(ev->info); } static void @@ -40,7 +40,7 @@ _pointer_up(void *data, const Eo_Event *ev) testdata *td = data; td->down = 0; efl_del(td->evup); - td->evup = efl_event_dup(ev->info); + td->evup = efl_input_dup(ev->info); } static void @@ -56,16 +56,16 @@ _key_down(void *data, const Eo_Event *ev) // 2. ecore_evas -> evas -> focussed obj (elm_win) -> here sprintf(str, "key=%s keyname=%s string=%s compose=%s", - efl_event_key_get(ev->info), - efl_event_key_name_get(ev->info), - efl_event_key_string_get(ev->info), - efl_event_key_compose_get(ev->info)); + efl_input_key_get(ev->info), + efl_input_key_name_get(ev->info), + efl_input_key_string_get(ev->info), + efl_input_key_compose_get(ev->info)); elm_object_text_set(td->text, str); - if (!efl_event_fake_get(ev->info)) + if (!efl_input_fake_get(ev->info)) { efl_del(td->evkeydown); - td->evkeydown = efl_event_dup(ev->info); + td->evkeydown = efl_input_dup(ev->info); } } @@ -96,10 +96,10 @@ _key_up(void *data, const Eo_Event *ev) { testdata *td = data; - if (!efl_event_fake_get(ev->info)) + if (!efl_input_fake_get(ev->info)) { efl_del(td->evkeyup); - td->evkeyup = efl_event_dup(ev->info); + td->evkeyup = efl_input_dup(ev->info); } // FIXME: how to use efl_loop_timeout? @@ -119,7 +119,7 @@ _clicked_button1(void *data, const Eo_Event *ev EINA_UNUSED) Eo *txt = td->text; char buf[256]; - // Note: can't do efl_event_fake_get(ev->info) because this is a click evt + // Note: can't do efl_input_fake_get(ev->info) because this is a click evt td->id++; sprintf(buf, "Button was clicked %d time%s", td->id, td->id > 1 ? "s" : ""); @@ -140,9 +140,9 @@ _clicked_button2(void *data, const Eo_Event *ev EINA_UNUSED) x = x + w / 2; y = y + h / 2; - efl_event_pointer_position_set(td->evmove, x, y); - efl_event_pointer_position_set(td->evdown, x, y); - efl_event_pointer_position_set(td->evup, x, y); + efl_input_pointer_position_set(td->evmove, x, y); + efl_input_pointer_position_set(td->evdown, x, y); + efl_input_pointer_position_set(td->evup, x, y); efl_event_callback_call(td->win, EFL_EVENT_POINTER_MOVE, td->evmove); efl_event_callback_call(td->win, EFL_EVENT_POINTER_DOWN, td->evdown); diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index d8d5b8b..73ffc0b 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -3,7 +3,7 @@ #endif #define ECORE_EVAS_INTERNAL -#define EFL_EVENT_PROTECTED +#define EFL_INPUT_EVENT_PROTECTED #include #include @@ -4306,7 +4306,7 @@ ecore_evas_psl1ght_new(const char* name, int w, int h) } while (0) static inline void -_pointer_position_set(Efl_Event_Pointer_Data *ev, Ecore_Evas *ee, int x, int y, +_pointer_position_set(Efl_Input_Pointer_Data *ev, Ecore_Evas *ee, int x, int y, double mx, double my) { int fx, fy, fw, fh; @@ -4356,8 +4356,8 @@ _event_description_get(Efl_Pointer_Action action) static Eina_Bool _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_Pointer_Action action) { - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Evas *e = ee->evas; Eina_Bool processed; @@ -4370,7 +4370,7 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P * modifiers (already passed to evas, no need to do anything) */ - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = action; @@ -4414,8 +4414,8 @@ _direct_mouse_cancel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info) static Eina_Bool _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info) { - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Evas *e = ee->evas; Eina_Bool processed; @@ -4430,7 +4430,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info) * modifiers (already passed to evas, no need to do anything) */ - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = EFL_POINTER_ACTION_MOVE; @@ -4454,8 +4454,8 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info) static Eina_Bool _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info) { - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Evas *e = ee->evas; Eina_Bool processed; @@ -4467,7 +4467,7 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info) * modifiers (already passed to evas, no need to do anything) */ - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = EFL_POINTER_ACTION_WHEEL; @@ -4486,8 +4486,8 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info) static Eina_Bool _direct_mouse_inout(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info, Efl_Pointer_Action action) { - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Evas *e = ee->evas; Eina_Bool processed; @@ -4496,7 +4496,7 @@ _direct_mouse_inout(Ecore_Evas *ee, const Ecore_Event_Mouse_IO *info, Efl_Pointe * modifiers (already passed to evas, no need to do anything) */ - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); if (!evt) return EINA_FALSE; ev->action = action; @@ -4526,8 +4526,8 @@ static Eina_Bool _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info) { Eina_Bool haswinx = 0, haswiny = 0; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Evas *e = ee->evas; Eina_Bool processed; double x = 0, y = 0; @@ -4537,7 +4537,7 @@ _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info) * window, root_window, event_window */ - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, e, (void **) &ev); if (!ev) return EINA_FALSE; ev->action = EFL_POINTER_ACTION_AXIS; @@ -4620,8 +4620,8 @@ _direct_axis_update_cb(Ecore_Evas *ee, const Ecore_Event_Axis_Update *info) static Eina_Bool _direct_key_updown_cb(Ecore_Evas *ee, const Ecore_Event_Key *info, Eina_Bool down) { - Efl_Event_Key_Data *ev; - Efl_Event_Key *evt; + Efl_Input_Key_Data *ev; + Efl_Input_Key *evt; Evas *e = ee->evas; Eina_Bool processed; @@ -4633,7 +4633,7 @@ _direct_key_updown_cb(Ecore_Evas *ee, const Ecore_Event_Key *info, Eina_Bool dow * modifiers (already passed to evas, no need to do anything) */ - evt = efl_event_instance_get(EFL_EVENT_KEY_CLASS, e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_KEY_CLASS, e, (void **) &ev); if (!evt || !ev) return EINA_FALSE; ev->timestamp = info->timestamp; diff --git a/src/lib/edje/edje_callbacks.c b/src/lib/edje/edje_callbacks.c index 4dfa8d2..5187a24 100644 --- a/src/lib/edje/edje_callbacks.c +++ b/src/lib/edje/edje_callbacks.c @@ -6,7 +6,7 @@ static void _edje_hold_signal_cb(void *data, const Eo_Event *event) { - Efl_Event_Hold *ev; + Efl_Input_Hold *ev; Edje *ed; Edje_Real_Part *rp; @@ -14,7 +14,7 @@ _edje_hold_signal_cb(void *data, const Eo_Event *event) ed = data; rp = evas_object_data_get(event->object, "real_part"); if (!rp) return; - if (efl_event_hold_get(ev)) + if (efl_input_hold_get(ev)) _edje_emit(ed, "hold,on", rp->part->name); else _edje_emit(ed, "hold,off", rp->part->name); @@ -51,11 +51,11 @@ _edje_focus_out_signal_cb(void *data, const Eo_Event *event) static void _edje_mouse_in_signal_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer_Data *ev; + Efl_Input_Pointer_Data *ev; Edje *ed; Edje_Real_Part *rp; - ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); ed = data; rp = evas_object_data_get(event->object, "real_part"); if (rp) @@ -70,11 +70,11 @@ _edje_mouse_in_signal_cb(void *data, const Eo_Event *event) static void _edje_mouse_out_signal_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer_Data *ev; + Efl_Input_Pointer_Data *ev; Edje *ed; Edje_Real_Part *rp; - ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); ed = data; rp = evas_object_data_get(event->object, "real_part"); if (rp) @@ -89,13 +89,13 @@ _edje_mouse_out_signal_cb(void *data, const Eo_Event *event) static void _edje_mouse_down_signal_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer_Data *ev; + Efl_Input_Pointer_Data *ev; Edje *ed; Edje_Real_Part *rp; char buf[256]; int ignored; - ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); ed = data; rp = evas_object_data_get(event->object, "real_part"); if (!rp) return; @@ -158,13 +158,13 @@ _edje_mouse_down_signal_cb(void *data, const Eo_Event *event) static void _edje_mouse_up_signal_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer_Data *ev; + Efl_Input_Pointer_Data *ev; Edje *ed; Edje_Real_Part *rp; char buf[256]; int ignored; - ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); ed = data; rp = evas_object_data_get(event->object, "real_part"); if (!rp) return; @@ -231,12 +231,12 @@ _edje_mouse_up_signal_cb(void *data, const Eo_Event *event) static void _edje_mouse_move_signal_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer_Data *ev; + Efl_Input_Pointer_Data *ev; Edje *ed; Edje_Real_Part *rp; int ignored; - ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); ed = data; rp = evas_object_data_get(event->object, "real_part"); if (!rp) return; @@ -338,12 +338,12 @@ _edje_mouse_move_signal_cb(void *data, const Eo_Event *event) static void _edje_mouse_wheel_signal_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer_Data *ev; + Efl_Input_Pointer_Data *ev; Edje *ed; Edje_Real_Part *rp; char buf[256]; - ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); ed = data; rp = evas_object_data_get(event->object, "real_part"); if (rp) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 79733af..142950ae 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -39,7 +39,6 @@ extern "C" { /* Add here all the required ifdef for any @protected method */ #ifdef EFL_EFL_BUILD # define EFL_PACK_LAYOUT_PROTECTED -# define EFL_EVENT_PROTECTED # define EFL_GFX_SIZE_HINT_PROTECTED #endif @@ -123,11 +122,8 @@ EAPI extern const Efl_Event_Description _EFL_GFX_PATH_CHANGED; #include "interfaces/efl_pack_grid.eo.h" /* Input events */ -#include "interfaces/efl_event_types.eot.h" +#include "interfaces/efl_input_types.eot.h" #include "interfaces/efl_input_device.eo.h" -#include "interfaces/efl_input_state.eo.h" -#include "interfaces/efl_input_interface.eo.h" -#include "interfaces/efl_event.eo.h" /* Input and Output */ #include "interfaces/efl_io_closer.eo.h" @@ -143,7 +139,7 @@ EAPI extern const Efl_Event_Description _EFL_GFX_PATH_CHANGED; #ifndef EFL_NOLEGACY_API_SUPPORT #include "interfaces/efl_gfx_types.eot.h" -#include "interfaces/efl_event_types.eot.h" +#include "interfaces/efl_input_types.eot.h" #include "interfaces/efl_gfx_fill.eo.legacy.h" #include "interfaces/efl_gfx.eo.legacy.h" #include "interfaces/efl_image.eo.legacy.h" diff --git a/src/lib/efl/interfaces/efl_common_internal.h b/src/lib/efl/interfaces/efl_common_internal.h index 95b8681..07d6236 100644 --- a/src/lib/efl/interfaces/efl_common_internal.h +++ b/src/lib/efl/interfaces/efl_common_internal.h @@ -13,17 +13,17 @@ #include -typedef struct _Efl_Event_Pointer_Data Efl_Event_Pointer_Data; -typedef struct _Efl_Event_Key_Data Efl_Event_Key_Data; +typedef struct _Efl_Input_Pointer_Data Efl_Input_Pointer_Data; +typedef struct _Efl_Input_Key_Data Efl_Input_Key_Data; typedef struct _Efl_Input_Device_Data Efl_Input_Device_Data; -typedef struct _Efl_Event_Hold_Data Efl_Event_Hold_Data; +typedef struct _Efl_Input_Hold_Data Efl_Input_Hold_Data; #ifndef _EVAS_TYPES_EOT_H_ typedef struct _Evas_Modifier Evas_Modifier; typedef struct _Evas_Lock Evas_Lock; #endif -struct _Efl_Event_Pointer_Data +struct _Efl_Input_Pointer_Data { Eo *eo; unsigned int timestamp; /* FIXME: store as double? */ @@ -42,7 +42,7 @@ struct _Efl_Event_Pointer_Data Efl_Input_Device *device; Efl_Pointer_Action action; Efl_Pointer_Flags button_flags; - Efl_Event_Flags event_flags; + Efl_Input_Flags event_flags; void *data; /* evas data - whatever that is */ Eina_Bool window_pos; /* true if positions are window-relative (see input vs. feed: this is "input") */ @@ -55,7 +55,7 @@ struct _Efl_Event_Pointer_Data Eina_Bool win_fed : 1; }; -struct _Efl_Event_Key_Data +struct _Efl_Input_Key_Data { Eo *eo; unsigned int timestamp; /* FIXME: store as double? */ @@ -70,7 +70,7 @@ struct _Efl_Event_Key_Data void *data; Evas_Modifier *modifiers; Evas_Lock *locks; - Efl_Event_Flags event_flags; + Efl_Input_Flags event_flags; Efl_Input_Device *device; void *legacy; /* DO NOT TOUCH THIS */ Eina_Bool evas_done : 1; /* set by evas */ @@ -92,11 +92,11 @@ struct _Efl_Input_Device_Data Efl_Input_Device_Sub_Class subclass; }; -struct _Efl_Event_Hold_Data +struct _Efl_Input_Hold_Data { Eo *eo; double timestamp; - Efl_Event_Flags event_flags; + Efl_Input_Flags event_flags; Efl_Input_Device *device; void *data; void *legacy; /* DO NOT TOUCH THIS */ @@ -105,13 +105,13 @@ struct _Efl_Event_Hold_Data }; static inline Eina_Bool -_efl_input_value_has(const Efl_Event_Pointer_Data *pd, Efl_Input_Value key) +_efl_input_value_has(const Efl_Input_Pointer_Data *pd, Efl_Input_Value key) { return (pd->value_flags & (1 << (int) key)) != 0; } static inline void -_efl_input_value_mark(Efl_Event_Pointer_Data *pd, Efl_Input_Value key) +_efl_input_value_mark(Efl_Input_Pointer_Data *pd, Efl_Input_Value key) { pd->value_flags |= (1 << (int) key); } diff --git a/src/lib/efl/interfaces/efl_event.eo b/src/lib/efl/interfaces/efl_event.eo deleted file mode 100644 index 25069c6..0000000 --- a/src/lib/efl/interfaces/efl_event.eo +++ /dev/null @@ -1,44 +0,0 @@ -import efl_object; - -interface Efl.Event -{ - [[Represents a generic event data. - - Note: Most Eo Events do not carry Eo objects, rather simple data - structures. This class is intended to carry more complex event - data, such as pointer events. - - @since 1.18 - ]] - legacy_prefix: null; - methods { - @property timestamp { - [[The time at which an event was generated. - - If the event is generated by a server (eg. X.org or Wayland), then - the time may be set by the server. Usually this time will be based - on the monotonic clock, if available, but this class can not - guarantee it. - ]] - set { [[Call this when generating events manually.]] } - get {} - values { - ms: double; [[Time in milliseconds when the event happened.]] - } - } - reset { - [[Resets the internal data to 0 or default values.]] - } - dup { - [[Creates a copy of this event.]] - return: own(Efl.Event); - } - instance_get @class @protected { - params { - @in owner: Efl.Object; - @out priv: void*; - } - return: Efl.Event; - } - } -} diff --git a/src/lib/efl/interfaces/efl_event_types.eot b/src/lib/efl/interfaces/efl_input_types.eot similarity index 94% rename from src/lib/efl/interfaces/efl_event_types.eot rename to src/lib/efl/interfaces/efl_input_types.eot index 93aadb8..8a9211e 100644 --- a/src/lib/efl/interfaces/efl_event_types.eot +++ b/src/lib/efl/interfaces/efl_input_types.eot @@ -1,9 +1,8 @@ -/* FIXME: Do we need this? Or just use the Eo Event Description as a type? */ enum Efl.Pointer.Action { - [[Pointer event type. + [[Pointer event type. Represents which kind of event this is. - @since 1.18 + @since 1.19 ]] none, [[Not a valid event.]] move, [[Mouse or equivalent pointer moved.]] @@ -20,15 +19,21 @@ enum Efl.Pointer.Action enum Efl.Pointer.Flags { - /* Evas.Button_Flags */ + [[Pointer flags indicating whether a double or triple click is under way. + + @since 1.19 + ]] none = 0, [[No extra mouse button data]] double_click = (1 << 0), [[This mouse button press was the 2nd press of a double click]] triple_click = (1 << 1), [[This mouse button press was the 3rd press of a triple click]] } -enum Efl.Event.Flags +enum Efl.Input.Flags { - /* Evas.Event_Flags */ + [[Special flags set during an input event propagation. + + @since 1.19 + ]] none = 0, [[No fancy flags set]] processed = (1 << 0), [[This event is being delivered and has been processed, so it should be put "on hold" until the flag is unset. @@ -42,7 +47,7 @@ enum Efl.Event.Flags actually perform anything.]] } -enum Efl.Event.Object_Pointer_Mode { +enum Efl.Input.Object_Pointer_Mode { [[How the mouse pointer should be handled by EFL. In the mode $autograb, when a mouse button is pressed down over an @@ -54,6 +59,8 @@ enum Efl.Event.Object_Pointer_Mode { In the mode $nograb, the pointer will always be bound to the object right below it. + + @since 1.19 ]] auto_grab, [[Default, X11-like.]] no_grab, [[Pointer always bound to the object right below it.]] diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index b3d4c54..c16c8db 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -54,10 +54,6 @@ EAPI const Efl_Event_Description _EFL_GFX_PATH_CHANGED = #include "interfaces/efl_ui_spin.eo.c" #include "interfaces/efl_ui_progress.eo.c" -#include "interfaces/efl_event.eo.c" -#include "interfaces/efl_input_state.eo.c" -#include "interfaces/efl_input_interface.eo.c" - EAPI void __efl_internal_init(void) { diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 00b6ab1..aced7ba 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1665,9 +1665,9 @@ _evas_event_key_cb(void *data, const Eo_Event *ev) { Eo *win = data; Eo *evt = ev->info; - Efl_Event_Key_Data *evdata; + Efl_Input_Key_Data *evdata; - evdata = efl_data_scope_get(evt, EFL_EVENT_KEY_CLASS); + evdata = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS); if (!evdata || evdata->win_fed) return; @@ -1683,9 +1683,9 @@ _evas_event_pointer_cb(void *data, const Eo_Event *ev) { Eo *win = data; Eo *evt = ev->info; - Efl_Event_Pointer_Data *evdata; + Efl_Input_Pointer_Data *evdata; - evdata = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evdata = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!evdata || evdata->win_fed) return; @@ -1697,13 +1697,13 @@ static void _evas_event_key_feed_fake_cb(void *data, const Eo_Event *ev) { Eo *evas = data; - Efl_Event *evt = ev->info; - Efl_Event_Key_Data *evdata; + Efl_Input_Event *evt = ev->info; + Efl_Input_Key_Data *evdata; - if (!efl_event_fake_get(evt)) + if (!efl_input_fake_get(evt)) return; - evdata = efl_data_scope_get(evt, EFL_EVENT_KEY_CLASS); + evdata = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS); if (!evdata || evdata->win_fed) return; evdata->win_fed = EINA_TRUE; @@ -1717,13 +1717,13 @@ static void _evas_event_pointer_feed_fake_cb(void *data, const Eo_Event *ev) { Eo *evas = data; - Efl_Event *evt = ev->info; - Efl_Event_Pointer_Data *evdata; + Efl_Input_Event *evt = ev->info; + Efl_Input_Pointer_Data *evdata; - if (!efl_event_fake_get(evt)) + if (!efl_input_fake_get(evt)) return; - evdata = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evdata = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!evdata || evdata->win_fed) return; evdata->win_fed = EINA_TRUE; diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c index eaa2aeb..0cf92b7 100644 --- a/src/lib/elementary/elc_fileselector.c +++ b/src/lib/elementary/elc_fileselector.c @@ -1531,7 +1531,7 @@ _anchor_clicked(void *data, const Eo_Event *event) static void _files_key_down(void *data, const Eo_Event *event) { - Efl_Event_Key *ev = event->info; + Efl_Input_Key *ev = event->info; Evas_Object *par, *searchbar; const char *string, *key; @@ -1540,13 +1540,13 @@ _files_key_down(void *data, const Eo_Event *event) if (!searchbar) return; - key = efl_event_key_get(ev); - string = efl_event_key_string_get(ev); + key = efl_input_key_get(ev); + string = efl_input_key_string_get(ev); if (string && *(string) && (isalpha(*string) || isdigit(*string))) { elm_entry_entry_append(searchbar, string); - efl_event_processed_set(ev, EINA_TRUE); + efl_input_processed_set(ev, EINA_TRUE); } else if (key && *(key) && !strcmp(key, "BackSpace")) { @@ -1558,7 +1558,7 @@ _files_key_down(void *data, const Eo_Event *event) memmove(buf, en, strlen(en) -1); buf[strlen(en) -1] = '\0'; elm_entry_entry_set(searchbar, buf); - efl_event_processed_set(ev, EINA_TRUE); + efl_input_processed_set(ev, EINA_TRUE); } } } diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c index 72c3082..04478ea 100644 --- a/src/lib/elementary/elm_spinner.c +++ b/src/lib/elementary/elm_spinner.c @@ -884,10 +884,10 @@ _text_button_clicked_cb(void *data, const Eo_Event *event EINA_UNUSED) static void _inc_dec_button_mouse_move_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer *ev = event->info; + Efl_Input_Pointer *ev = event->info; ELM_SPINNER_DATA_GET(data, sd); - if (efl_event_processed_get(ev) && sd->longpress_timer) + if (efl_input_processed_get(ev) && sd->longpress_timer) { ecore_timer_del(sd->longpress_timer); sd->longpress_timer = NULL; diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c index 24119e1..c7e0185 100644 --- a/src/lib/elementary/elm_widget.c +++ b/src/lib/elementary/elm_widget.c @@ -725,11 +725,11 @@ _propagate_event(void *data EINA_UNUSED, const Eo_Event *event) /* FIXME: Avoid this translation to evas struct and use pointer/key events * in all of elementary widgets - * See also: efl_event_key_legacy_info_fill(). + * See also: efl_input_key_legacy_info_fill(). */ if (event->desc == EFL_EVENT_KEY_DOWN) { - Efl_Event_Key_Data *ev = efl_data_scope_get(event->info, EFL_EVENT_KEY_CLASS); + Efl_Input_Key_Data *ev = efl_data_scope_get(event->info, EFL_INPUT_KEY_CLASS); if (!ev) return; event_info.down.timestamp = ev->timestamp; event_info.down.keyname = (char*) ev->keyname; @@ -748,7 +748,7 @@ _propagate_event(void *data EINA_UNUSED, const Eo_Event *event) } else if (event->desc == EFL_EVENT_KEY_UP) { - Efl_Event_Key_Data *ev = efl_data_scope_get(event->info, EFL_EVENT_KEY_CLASS); + Efl_Input_Key_Data *ev = efl_data_scope_get(event->info, EFL_INPUT_KEY_CLASS); if (!ev) return; event_info.up.timestamp = ev->timestamp; event_info.up.keyname = (char*) ev->keyname; @@ -767,7 +767,7 @@ _propagate_event(void *data EINA_UNUSED, const Eo_Event *event) } else if (event->desc == EFL_EVENT_POINTER_WHEEL) { - Efl_Event_Pointer_Data *ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + Efl_Input_Pointer_Data *ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); if (!ev) return; event_info.wheel.direction = (ev->wheel.dir != EFL_ORIENT_HORIZONTAL) ? 1 : 0; event_info.wheel.z = ev->wheel.z; @@ -790,7 +790,7 @@ _propagate_event(void *data EINA_UNUSED, const Eo_Event *event) elm_widget_event_propagate(obj, type, &event_info, event_flags); if (!was_hold && (*event_flags & EVAS_EVENT_FLAG_ON_HOLD)) - efl_event_processed_set(event->info, EINA_TRUE); + efl_input_processed_set(event->info, EINA_TRUE); } /** diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo index ecb96ae..63f6d38 100644 --- a/src/lib/elementary/elm_widget.eo +++ b/src/lib/elementary/elm_widget.eo @@ -1,6 +1,6 @@ import edje_types; import elm_general; -import efl_event_types; +import efl_input_types; /* FIXME: This shouldn't be here. */ type list_data_get_func_type: __undefined_type; @@ -624,7 +624,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, Elm.Inter params { @in type: Evas.Callback_Type; @in event_info: void_ptr; - @in event_flags: Efl.Event.Flags *; + @in event_flags: Efl.Input.Flags *; } } signal_callback_add { diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 05c2a06..6b264c9 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -356,11 +356,11 @@ typedef Efl_Pointer_Flags Evas_Button_Flags; #define EVAS_BUTTON_DOUBLE_CLICK EFL_POINTER_FLAGS_DOUBLE_CLICK #define EVAS_BUTTON_TRIPLE_CLICK EFL_POINTER_FLAGS_TRIPLE_CLICK -typedef Efl_Event_Flags Evas_Event_Flags; +typedef Efl_Input_Flags Evas_Event_Flags; -#define EVAS_EVENT_FLAG_NONE EFL_EVENT_FLAGS_NONE -#define EVAS_EVENT_FLAG_ON_HOLD EFL_EVENT_FLAGS_PROCESSED -#define EVAS_EVENT_FLAG_ON_SCROLL EFL_EVENT_FLAGS_SCROLLING +#define EVAS_EVENT_FLAG_NONE EFL_INPUT_FLAGS_NONE +#define EVAS_EVENT_FLAG_ON_HOLD EFL_INPUT_FLAGS_PROCESSED +#define EVAS_EVENT_FLAG_ON_SCROLL EFL_INPUT_FLAGS_SCROLLING typedef Efl_Gfx_Size_Hint_Aspect Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set */ @@ -385,11 +385,11 @@ typedef Efl_Text_Bidirectional_Type Evas_BiDi_Direction; #define EVAS_BIDI_DIRECTION_RTL EFL_TEXT_BIDIRECTIONAL_TYPE_RTL #define EVAS_BIDI_DIRECTION_INHERIT EFL_TEXT_BIDIRECTIONAL_TYPE_INHERIT -typedef Efl_Event_Object_Pointer_Mode Evas_Object_Pointer_Mode; +typedef Efl_Input_Object_Pointer_Mode Evas_Object_Pointer_Mode; -#define EVAS_OBJECT_POINTER_MODE_AUTOGRAB EFL_EVENT_OBJECT_POINTER_MODE_AUTO_GRAB -#define EVAS_OBJECT_POINTER_MODE_NOGRAB EFL_EVENT_OBJECT_POINTER_MODE_NO_GRAB -#define EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN EFL_EVENT_OBJECT_POINTER_MODE_NO_GRAB_NO_REPEAT_UPDOWN +#define EVAS_OBJECT_POINTER_MODE_AUTOGRAB EFL_INPUT_OBJECT_POINTER_MODE_AUTO_GRAB +#define EVAS_OBJECT_POINTER_MODE_NOGRAB EFL_INPUT_OBJECT_POINTER_MODE_NO_GRAB +#define EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN EFL_INPUT_OBJECT_POINTER_MODE_NO_GRAB_NO_REPEAT_UPDOWN struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */ { diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 7cd4c68..cc7273e 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -301,8 +301,10 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, #endif /* EFL_BETA_API_SUPPORT */ #ifdef EFL_EO_API_SUPPORT -#include "canvas/efl_event_input.eo.h" -#include "canvas/efl_event_pointer.eo.h" -#include "canvas/efl_event_key.eo.h" -#include "canvas/efl_event_hold.eo.h" +#include "canvas/efl_input_state.eo.h" +#include "canvas/efl_input_event.eo.h" +#include "canvas/efl_input_pointer.eo.h" +#include "canvas/efl_input_key.eo.h" +#include "canvas/efl_input_hold.eo.h" +#include "canvas/efl_input_interface.eo.h" #endif /* EFL_EO_API_SUPPORT */ diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo index e115d16..c7d1bf4 100644 --- a/src/lib/evas/canvas/efl_canvas_object.eo +++ b/src/lib/evas/canvas/efl_canvas_object.eo @@ -26,19 +26,19 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator, This function has a direct effect on event callbacks related to pointers (mouse, ...). - If the value is @Efl.Event.Object_Pointer_Mode.auto_grab (default), + If the value is @Efl.Input.Object_Pointer_Mode.auto_grab (default), then when mouse is pressed down over this object, events will be restricted to it as source, mouse moves, for example, will be emitted even when the pointer goes outside this objects geometry. - If the value is @Efl.Event.Object_Pointer_Mode.no_grab, then events + If the value is @Efl.Input.Object_Pointer_Mode.no_grab, then events will be emitted just when inside this object area. - The default value is @Efl.Event.Object_Pointer_Mode.auto_grab. + The default value is @Efl.Input.Object_Pointer_Mode.auto_grab. ]] values { - pointer_mode: Efl.Event.Object_Pointer_Mode; + pointer_mode: Efl.Input.Object_Pointer_Mode; } } @property render_op { diff --git a/src/lib/evas/canvas/efl_event_hold.c b/src/lib/evas/canvas/efl_event_hold.c deleted file mode 100644 index 9e51da0..0000000 --- a/src/lib/evas/canvas/efl_event_hold.c +++ /dev/null @@ -1,118 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#define EFL_EVENT_PROTECTED - -#include - -#define EFL_INTERNAL_UNSTABLE -#include "interfaces/efl_common_internal.h" - -#define MY_CLASS EFL_EVENT_HOLD_CLASS - -EOLIAN static void -_efl_event_hold_hold_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd, Eina_Bool val) -{ - pd->hold = !!val; -} - -EOLIAN static Eina_Bool -_efl_event_hold_hold_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd) -{ - return pd->hold; -} - -EOLIAN static void -_efl_event_hold_efl_event_input_device_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd, Efl_Input_Device *dev) -{ - pd->device = dev; -} - -EOLIAN static Efl_Input_Device * -_efl_event_hold_efl_event_input_device_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd) -{ - return pd->device; -} - -EOLIAN static double -_efl_event_hold_efl_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd) -{ - return pd->timestamp; -} - -EOLIAN static void -_efl_event_hold_efl_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd, double ms) -{ - pd->timestamp = ms; -} - -EOLIAN static void -_efl_event_hold_efl_event_input_event_flags_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd, Efl_Event_Flags flags) -{ - pd->event_flags = flags; -} - -EOLIAN static Efl_Event_Flags -_efl_event_hold_efl_event_input_event_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd) -{ - return pd->event_flags; -} - -EOLIAN static Eo * -_efl_event_hold_efl_object_constructor(Eo *obj, Efl_Event_Hold_Data *pd EINA_UNUSED) -{ - obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_event_reset(obj); - return obj; -} - -static inline void -_efl_event_hold_free(Efl_Event_Hold_Data *pd) -{ - free(pd->legacy); -} - -EOLIAN static void -_efl_event_hold_efl_object_destructor(Eo *obj, Efl_Event_Hold_Data *pd) -{ - _efl_event_hold_free(pd); - efl_destructor(efl_super(obj, MY_CLASS)); -} - -EOLIAN static Efl_Event * -_efl_event_hold_efl_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED, - Efl_Object *owner, void **priv) -{ - // TODO: Implement a cache. Depends only on how many hold events we trigger. - Efl_Event *evt = efl_add(MY_CLASS, owner); - if (priv) *priv = efl_data_scope_get(evt, MY_CLASS); - return evt; -} - -EOLIAN static void -_efl_event_hold_efl_event_reset(Eo *obj, Efl_Event_Hold_Data *pd) -{ - _efl_event_hold_free(pd); - memset(pd, 0, sizeof(*pd)); - pd->eo = obj; -} - -EOLIAN static Efl_Event * -_efl_event_hold_efl_event_dup(Eo *obj, Efl_Event_Hold_Data *pd) -{ - Efl_Event_Hold_Data *ev; - Efl_Event *evt = efl_add(EFL_EVENT_HOLD_CLASS, efl_parent_get(obj)); - ev = efl_data_scope_get(evt, MY_CLASS); - if (!ev) return NULL; - - ev->eo = evt; - ev->timestamp = pd->timestamp; - ev->data = pd->data; - ev->hold = pd->hold; - ev->device = pd->device; // lacks a proper ref :( - - return evt; -} - -#include "efl_event_hold.eo.c" diff --git a/src/lib/evas/canvas/efl_event_hold.eo b/src/lib/evas/canvas/efl_event_hold.eo deleted file mode 100644 index 142a1b6..0000000 --- a/src/lib/evas/canvas/efl_event_hold.eo +++ /dev/null @@ -1,26 +0,0 @@ -class Efl.Event.Hold (Efl.Object, Efl.Event.Input) -{ - [[Event data sent when inputs are put on hold or resumed.]] - methods { - @property hold { - [[$true if inputs are now on hold.]] - values { - val: bool; - } - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Event.instance_get; - Efl.Event.reset; - Efl.Event.dup; - Efl.Event.timestamp.get; - Efl.Event.timestamp.set; - //Efl.Event.Input.fake.get; - Efl.Event.Input.event_flags.set; - Efl.Event.Input.event_flags.get; - Efl.Event.Input.device.set; - Efl.Event.Input.device.get; - } -} diff --git a/src/lib/evas/canvas/efl_event_input.c b/src/lib/evas/canvas/efl_event_input.c deleted file mode 100644 index a4c313d..0000000 --- a/src/lib/evas/canvas/efl_event_input.c +++ /dev/null @@ -1,48 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#define EFL_INTERNAL_UNSTABLE -#include "interfaces/efl_common_internal.h" - -#define MY_CLASS EFL_EVENT_INPUT_MIXIN - -EOLIAN static void -_efl_event_input_processed_set(Eo *obj, void *pd EINA_UNUSED, Eina_Bool val) -{ - if (val) - efl_event_flags_set(obj, efl_event_flags_get(obj) | EFL_EVENT_FLAGS_PROCESSED); - else - efl_event_flags_set(obj, efl_event_flags_get(obj) & ~EFL_EVENT_FLAGS_PROCESSED); -} - -EOLIAN static Eina_Bool -_efl_event_input_processed_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) -{ - return !!(efl_event_flags_get(obj) & EFL_EVENT_FLAGS_PROCESSED); -} - -EOLIAN static void -_efl_event_input_scrolling_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Eina_Bool val) -{ - if (val) - efl_event_flags_set(obj, efl_event_flags_get(obj) | EFL_EVENT_FLAGS_SCROLLING); - else - efl_event_flags_set(obj, efl_event_flags_get(obj) & ~EFL_EVENT_FLAGS_SCROLLING); -} - -EOLIAN static Eina_Bool -_efl_event_input_scrolling_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) -{ - return !!(efl_event_flags_get(obj) & EFL_EVENT_FLAGS_SCROLLING); -} - -EOLIAN static Eina_Bool -_efl_event_input_fake_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) -{ - return EINA_FALSE; -} - -#include "efl_event_input.eo.c" diff --git a/src/lib/evas/canvas/efl_event_input.eo b/src/lib/evas/canvas/efl_event_input.eo deleted file mode 100644 index b23fdfa..0000000 --- a/src/lib/evas/canvas/efl_event_input.eo +++ /dev/null @@ -1,40 +0,0 @@ -import efl_event_types; - -mixin Efl.Event.Input (Efl.Event) -{ - eo_prefix: efl_event; - data: null; - methods { - @property device @virtual_pure { - [[Input device that originated this event.]] - values { - dev: Efl.Input.Device; - } - } - @property event_flags @virtual_pure { - [[Extra flags for this event, may be changed by the user.]] - values { - flags: Efl.Event.Flags; - } - } - @property processed { - [[$true if @.event_flags indicates the event is on hold.]] - values { - val: bool; - } - } - @property scrolling { - [[$true if @.event_flags indicates the event happened while scrolling.]] - values { - val: bool; - } - } - @property fake { - [[$true if the event was fake, not triggered by real hardware.]] - get {} - values { - val: bool; - } - } - } -} diff --git a/src/lib/evas/canvas/efl_input_event.c b/src/lib/evas/canvas/efl_input_event.c new file mode 100644 index 0000000..8d93cb9 --- /dev/null +++ b/src/lib/evas/canvas/efl_input_event.c @@ -0,0 +1,52 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define EFL_INPUT_EVENT_PROTECTED + +#include + +#define EFL_INTERNAL_UNSTABLE +#include "interfaces/efl_common_internal.h" + +#define MY_CLASS EFL_INPUT_EVENT_MIXIN + +EOLIAN static void +_efl_input_event_processed_set(Eo *obj, void *pd EINA_UNUSED, Eina_Bool val) +{ + if (val) + efl_input_event_flags_set(obj, efl_input_event_flags_get(obj) | EFL_INPUT_FLAGS_PROCESSED); + else + efl_input_event_flags_set(obj, efl_input_event_flags_get(obj) & ~EFL_INPUT_FLAGS_PROCESSED); +} + +EOLIAN static Eina_Bool +_efl_input_event_processed_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) +{ + return !!(efl_input_event_flags_get(obj) & EFL_INPUT_FLAGS_PROCESSED); +} + +EOLIAN static void +_efl_input_event_scrolling_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Eina_Bool val) +{ + if (val) + efl_input_event_flags_set(obj, efl_input_event_flags_get(obj) | EFL_INPUT_FLAGS_SCROLLING); + else + efl_input_event_flags_set(obj, efl_input_event_flags_get(obj) & ~EFL_INPUT_FLAGS_SCROLLING); +} + +EOLIAN static Eina_Bool +_efl_input_event_scrolling_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) +{ + return !!(efl_input_event_flags_get(obj) & EFL_INPUT_FLAGS_SCROLLING); +} + +EOLIAN static Eina_Bool +_efl_input_event_fake_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED) +{ + return EINA_FALSE; +} + +#include "efl_input_event.eo.c" +#include "efl_input_state.eo.c" +#include "efl_input_interface.eo.c" diff --git a/src/lib/evas/canvas/efl_input_event.eo b/src/lib/evas/canvas/efl_input_event.eo new file mode 100644 index 0000000..9bc90e7 --- /dev/null +++ b/src/lib/evas/canvas/efl_input_event.eo @@ -0,0 +1,76 @@ +import efl_input_types; + +mixin Efl.Input.Event +{ + [[Represents a generic event data. + + Note: Most Efl Events do not carry Efl Objects, rather simple data + structures. This class is intended to carry more complex event + data, such as pointer events. + + @since 1.19 + ]] + eo_prefix: efl_input; + data: null; + methods { + @property timestamp @virtual_pure { + [[The time at which an event was generated. + + If the event is generated by a server (eg. X.org or Wayland), then + the time may be set by the server. Usually this time will be based + on the monotonic clock, if available, but this class can not + guarantee it. + ]] + set { [[Call this when generating events manually.]] } + get {} + values { + ms: double; [[Time in milliseconds when the event happened.]] + } + } + reset @virtual_pure { + [[Resets the internal data to 0 or default values.]] + } + dup @virtual_pure { + [[Creates a copy of this event.]] + return: own(Efl.Input.Event); + } + @property device @virtual_pure { + [[Input device that originated this event.]] + values { + dev: Efl.Input.Device; + } + } + @property event_flags @virtual_pure { + [[Extra flags for this event, may be changed by the user.]] + values { + flags: Efl.Input.Flags; + } + } + @property processed { + [[$true if @.event_flags indicates the event is on hold.]] + values { + val: bool; + } + } + @property scrolling { + [[$true if @.event_flags indicates the event happened while scrolling.]] + values { + val: bool; + } + } + @property fake { + [[$true if the event was fake, not triggered by real hardware.]] + get {} + values { + val: bool; + } + } + instance_get @class @protected @virtual_pure { + params { + @in owner: Efl.Object; + @out priv: void*; + } + return: own(Efl.Input.Event); + } + } +} diff --git a/src/lib/evas/canvas/efl_input_hold.c b/src/lib/evas/canvas/efl_input_hold.c new file mode 100644 index 0000000..4c509dc --- /dev/null +++ b/src/lib/evas/canvas/efl_input_hold.c @@ -0,0 +1,118 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define EFL_INPUT_EVENT_PROTECTED + +#include + +#define EFL_INTERNAL_UNSTABLE +#include "interfaces/efl_common_internal.h" + +#define MY_CLASS EFL_INPUT_HOLD_CLASS + +EOLIAN static void +_efl_input_hold_hold_set(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd, Eina_Bool val) +{ + pd->hold = !!val; +} + +EOLIAN static Eina_Bool +_efl_input_hold_hold_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd) +{ + return pd->hold; +} + +EOLIAN static void +_efl_input_hold_efl_input_event_device_set(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd, Efl_Input_Device *dev) +{ + pd->device = dev; +} + +EOLIAN static Efl_Input_Device * +_efl_input_hold_efl_input_event_device_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd) +{ + return pd->device; +} + +EOLIAN static double +_efl_input_hold_efl_input_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd) +{ + return pd->timestamp; +} + +EOLIAN static void +_efl_input_hold_efl_input_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd, double ms) +{ + pd->timestamp = ms; +} + +EOLIAN static void +_efl_input_hold_efl_input_event_event_flags_set(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd, Efl_Input_Flags flags) +{ + pd->event_flags = flags; +} + +EOLIAN static Efl_Input_Flags +_efl_input_hold_efl_input_event_event_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Hold_Data *pd) +{ + return pd->event_flags; +} + +EOLIAN static Eo * +_efl_input_hold_efl_object_constructor(Eo *obj, Efl_Input_Hold_Data *pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, MY_CLASS)); + efl_input_reset(obj); + return obj; +} + +static inline void +_efl_input_hold_free(Efl_Input_Hold_Data *pd) +{ + free(pd->legacy); +} + +EOLIAN static void +_efl_input_hold_efl_object_destructor(Eo *obj, Efl_Input_Hold_Data *pd) +{ + _efl_input_hold_free(pd); + efl_destructor(efl_super(obj, MY_CLASS)); +} + +EOLIAN static Efl_Input_Event * +_efl_input_hold_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED, + Efl_Object *owner, void **priv) +{ + // TODO: Implement a cache. Depends only on how many hold events we trigger. + Efl_Input_Event *evt = efl_add(MY_CLASS, owner); + if (priv) *priv = efl_data_scope_get(evt, MY_CLASS); + return evt; +} + +EOLIAN static void +_efl_input_hold_efl_input_event_reset(Eo *obj, Efl_Input_Hold_Data *pd) +{ + _efl_input_hold_free(pd); + memset(pd, 0, sizeof(*pd)); + pd->eo = obj; +} + +EOLIAN static Efl_Input_Event * +_efl_input_hold_efl_input_event_dup(Eo *obj, Efl_Input_Hold_Data *pd) +{ + Efl_Input_Hold_Data *ev; + Efl_Input_Event *evt = efl_add(EFL_INPUT_HOLD_CLASS, efl_parent_get(obj)); + ev = efl_data_scope_get(evt, MY_CLASS); + if (!ev) return NULL; + + ev->eo = evt; + ev->timestamp = pd->timestamp; + ev->data = pd->data; + ev->hold = pd->hold; + ev->device = pd->device; // lacks a proper ref :( + + return evt; +} + +#include "efl_input_hold.eo.c" diff --git a/src/lib/evas/canvas/efl_input_hold.eo b/src/lib/evas/canvas/efl_input_hold.eo new file mode 100644 index 0000000..0d0c86f --- /dev/null +++ b/src/lib/evas/canvas/efl_input_hold.eo @@ -0,0 +1,25 @@ +class Efl.Input.Hold (Efl.Object, Efl.Input.Event) +{ + [[Event data sent when inputs are put on hold or resumed.]] + methods { + @property hold { + [[$true if inputs are now on hold.]] + values { + val: bool; + } + } + } + implements { + Efl.Object.constructor; + Efl.Object.destructor; + Efl.Input.Event.instance_get; + Efl.Input.Event.reset; + Efl.Input.Event.dup; + Efl.Input.Event.timestamp.get; + Efl.Input.Event.timestamp.set; + Efl.Input.Event.event_flags.set; + Efl.Input.Event.event_flags.get; + Efl.Input.Event.device.set; + Efl.Input.Event.device.get; + } +} diff --git a/src/lib/efl/interfaces/efl_input_interface.eo b/src/lib/evas/canvas/efl_input_interface.eo similarity index 66% rename from src/lib/efl/interfaces/efl_input_interface.eo rename to src/lib/evas/canvas/efl_input_interface.eo index 6a66a74..609fbb1 100644 --- a/src/lib/efl/interfaces/efl_input_interface.eo +++ b/src/lib/evas/canvas/efl_input_interface.eo @@ -23,23 +23,23 @@ interface Efl.Input.Interface () ]] event_prefix: efl; events { - pointer,move: Efl.Event.Pointer; [[Main pointer move (current and previous positions are known).]] - pointer,down: Efl.Event.Pointer; [[Main pointer button pressed (button id is known).]] - pointer,up: Efl.Event.Pointer; [[Main pointer button released (button id is known).]] - pointer,cancel: Efl.Event.Pointer; [[Main pointer button press was cancelled (button id is known). + pointer,move: Efl.Input.Pointer; [[Main pointer move (current and previous positions are known).]] + pointer,down: Efl.Input.Pointer; [[Main pointer button pressed (button id is known).]] + pointer,up: Efl.Input.Pointer; [[Main pointer button released (button id is known).]] + pointer,cancel: Efl.Input.Pointer; [[Main pointer button press was cancelled (button id is known). This can happen in rare cases when the window manager passes the focus to a more urgent window, for instance. You probably don't need to listen to this event, as it will be accompanied by an up event.]] - pointer,in: Efl.Event.Pointer; [[Pointer entered a window or a widget.]] - pointer,out: Efl.Event.Pointer; [[Pointer left a window or a widget.]] - pointer,wheel: Efl.Event.Pointer; [[Mouse wheel event.]] - pointer,axis: Efl.Event.Pointer; [[Pen or other axis event update.]] - finger,move: Efl.Event.Pointer; [[Finger moved (current and previous positions are known).]] - finger,down: Efl.Event.Pointer; [[Finger pressed (finger id is known).]] - finger,up: Efl.Event.Pointer; [[Finger released (finger id is known).]] - key,down: Efl.Event.Key; [[Keyboard key press.]] - key,up: Efl.Event.Key; [[Keyboard key release.]] - hold: Efl.Event.Hold; [[All input events are on hold or resumed.]] + pointer,in: Efl.Input.Pointer; [[Pointer entered a window or a widget.]] + pointer,out: Efl.Input.Pointer; [[Pointer left a window or a widget.]] + pointer,wheel: Efl.Input.Pointer; [[Mouse wheel event.]] + pointer,axis: Efl.Input.Pointer; [[Pen or other axis event update.]] + finger,move: Efl.Input.Pointer; [[Finger moved (current and previous positions are known).]] + finger,down: Efl.Input.Pointer; [[Finger pressed (finger id is known).]] + finger,up: Efl.Input.Pointer; [[Finger released (finger id is known).]] + key,down: Efl.Input.Key; [[Keyboard key press.]] + key,up: Efl.Input.Key; [[Keyboard key release.]] + hold: Efl.Input.Hold; [[All input events are on hold or resumed.]] } } diff --git a/src/lib/evas/canvas/efl_event_key.c b/src/lib/evas/canvas/efl_input_key.c similarity index 53% rename from src/lib/evas/canvas/efl_event_key.c rename to src/lib/evas/canvas/efl_input_key.c index 3642b33..7f955f7 100644 --- a/src/lib/evas/canvas/efl_event_key.c +++ b/src/lib/evas/canvas/efl_input_key.c @@ -2,16 +2,16 @@ # include #endif -#define EFL_EVENT_PROTECTED +#define EFL_INPUT_EVENT_PROTECTED #include #define EFL_INTERNAL_UNSTABLE #include "interfaces/efl_common_internal.h" -#define MY_CLASS EFL_EVENT_KEY_CLASS +#define MY_CLASS EFL_INPUT_KEY_CLASS -static Efl_Event_Key *s_cached_event = NULL; +static Efl_Input_Key *s_cached_event = NULL; static void _del_hook(Eo *evt) @@ -32,27 +32,27 @@ _del_hook(Eo *evt) } } -EOLIAN static Efl_Event_Key * -_efl_event_key_efl_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED, - Eo *owner, void **priv) +EOLIAN static Efl_Input_Key * +_efl_input_key_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED, + Eo *owner, void **priv) { - Efl_Event_Key_Data *ev; - Efl_Event_Key *evt; + Efl_Input_Key_Data *ev; + Efl_Input_Key *evt; if (s_cached_event) { evt = s_cached_event; s_cached_event = NULL; - efl_event_reset(evt); + efl_input_reset(evt); efl_parent_set(evt, owner); } else { - evt = efl_add(EFL_EVENT_KEY_CLASS, owner); + evt = efl_add(EFL_INPUT_KEY_CLASS, owner); efl_del_intercept_set(evt, _del_hook); } - ev = efl_data_scope_get(evt, EFL_EVENT_KEY_CLASS); + ev = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS); ev->fake = EINA_FALSE; if (priv) *priv = ev; @@ -60,7 +60,7 @@ _efl_event_key_efl_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUS } EOLIAN static void -_efl_event_key_class_destructor(Efl_Class *klass EINA_UNUSED) +_efl_input_key_class_destructor(Efl_Class *klass EINA_UNUSED) { // this is a strange situation... efl_del_intercept_set(s_cached_event, NULL); @@ -69,15 +69,15 @@ _efl_event_key_class_destructor(Efl_Class *klass EINA_UNUSED) } EOLIAN static Efl_Object * -_efl_event_key_efl_object_constructor(Eo *obj, Efl_Event_Key_Data *pd EINA_UNUSED) +_efl_input_key_efl_object_constructor(Eo *obj, Efl_Input_Key_Data *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_event_reset(obj); + efl_input_reset(obj); return obj; } static inline void -_efl_event_key_free(Efl_Event_Key_Data *pd) +_efl_input_key_free(Efl_Input_Key_Data *pd) { free(pd->legacy); if (pd->no_stringshare) return; @@ -88,101 +88,101 @@ _efl_event_key_free(Efl_Event_Key_Data *pd) } EOLIAN static void -_efl_event_key_efl_object_destructor(Eo *obj, Efl_Event_Key_Data *pd) +_efl_input_key_efl_object_destructor(Eo *obj, Efl_Input_Key_Data *pd) { - _efl_event_key_free(pd); + _efl_input_key_free(pd); efl_destructor(efl_super(obj, MY_CLASS)); } EOLIAN static void -_efl_event_key_pressed_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, Eina_Bool val) +_efl_input_key_pressed_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, Eina_Bool val) { pd->pressed = !!val; } EOLIAN static Eina_Bool -_efl_event_key_pressed_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_pressed_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->pressed; } EOLIAN static void -_efl_event_key_key_name_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, const char *val) +_efl_input_key_key_name_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const char *val) { eina_stringshare_replace(&pd->keyname, val); } EOLIAN static const char * -_efl_event_key_key_name_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_key_name_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->keyname; } EOLIAN static void -_efl_event_key_key_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, const char *val) +_efl_input_key_key_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const char *val) { eina_stringshare_replace(&pd->key, val); } EOLIAN static const char * -_efl_event_key_key_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_key_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->key; } EOLIAN static void -_efl_event_key_string_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, const char *val) +_efl_input_key_string_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const char *val) { eina_stringshare_replace(&pd->string, val); } EOLIAN static const char * -_efl_event_key_string_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_string_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->string; } EOLIAN static void -_efl_event_key_compose_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, const char *val) +_efl_input_key_compose_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const char *val) { eina_stringshare_replace(&pd->compose, val); } EOLIAN static const char * -_efl_event_key_compose_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_compose_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->compose; } EOLIAN static void -_efl_event_key_key_code_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, int val) +_efl_input_key_key_code_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, int val) { pd->keycode = val; } EOLIAN static int -_efl_event_key_key_code_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_key_code_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->keycode; } EOLIAN static void -_efl_event_key_efl_event_reset(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_efl_input_event_reset(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { - _efl_event_key_free(pd); + _efl_input_key_free(pd); memset(pd, 0, sizeof(*pd)); pd->eo = obj; pd->fake = EINA_TRUE; } -EOLIAN static Efl_Event * -_efl_event_key_efl_event_dup(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +EOLIAN static Efl_Input_Event * +_efl_input_key_efl_input_event_dup(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { - Efl_Event_Key_Data *ev; - Efl_Event_Key *evt; + Efl_Input_Key_Data *ev; + Efl_Input_Key *evt; // no parent - evt = efl_event_instance_get(EFL_EVENT_KEY_CLASS, NULL, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_KEY_CLASS, NULL, (void **) &ev); if (!evt || !ev) return NULL; memcpy(ev, pd, sizeof(*ev)); @@ -201,59 +201,59 @@ _efl_event_key_efl_event_dup(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) } EOLIAN static void -_efl_event_key_efl_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, double ms) +_efl_input_key_efl_input_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, double ms) { pd->timestamp = ms; } EOLIAN static double -_efl_event_key_efl_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_efl_input_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->timestamp; } EOLIAN static void -_efl_event_key_efl_event_input_event_flags_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, Efl_Event_Flags flags) +_efl_input_key_efl_input_event_event_flags_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, Efl_Input_Flags flags) { pd->event_flags = flags; } -EOLIAN static Efl_Event_Flags -_efl_event_key_efl_event_input_event_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +EOLIAN static Efl_Input_Flags +_efl_input_key_efl_input_event_event_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->event_flags; } EOLIAN static void -_efl_event_key_efl_event_input_device_set(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, Efl_Input_Device *dev) +_efl_input_key_efl_input_event_device_set(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, Efl_Input_Device *dev) { pd->device = dev; } EOLIAN static Efl_Input_Device * -_efl_event_key_efl_event_input_device_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_efl_input_event_device_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->device; } EOLIAN static Eina_Bool -_efl_event_key_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, const char * name) +_efl_input_key_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const char * name) { if (!pd->modifiers) return EINA_FALSE; return evas_key_modifier_is_set(pd->modifiers, name); } EOLIAN static Eina_Bool -_efl_event_key_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd, const char * name) +_efl_input_key_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, const char * name) { if (!pd->locks) return EINA_FALSE; return evas_key_lock_is_set(pd->locks, name); } EOLIAN static Eina_Bool -_efl_event_key_efl_event_input_fake_get(Eo *obj EINA_UNUSED, Efl_Event_Key_Data *pd) +_efl_input_key_efl_input_event_fake_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd) { return pd->fake; } -#include "efl_event_key.eo.c" +#include "efl_input_key.eo.c" diff --git a/src/lib/evas/canvas/efl_event_key.eo b/src/lib/evas/canvas/efl_input_key.eo similarity index 75% rename from src/lib/evas/canvas/efl_event_key.eo rename to src/lib/evas/canvas/efl_input_key.eo index e85b8ae..28c3cce 100644 --- a/src/lib/evas/canvas/efl_event_key.eo +++ b/src/lib/evas/canvas/efl_input_key.eo @@ -1,4 +1,4 @@ -class Efl.Event.Key (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input) +class Efl.Input.Key (Efl.Object, Efl.Input.Event, Efl.Input.State, Efl.Input.Event) { [[Represents a single key event from a keyboard or similar device. @@ -55,16 +55,16 @@ class Efl.Event.Key (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input) class.destructor; Efl.Object.constructor; Efl.Object.destructor; - Efl.Event.instance_get; - Efl.Event.reset; - Efl.Event.dup; - Efl.Event.timestamp.set; - Efl.Event.timestamp.get; - Efl.Event.Input.fake.get; - Efl.Event.Input.event_flags.set; - Efl.Event.Input.event_flags.get; - Efl.Event.Input.device.set; - Efl.Event.Input.device.get; + Efl.Input.Event.instance_get; + Efl.Input.Event.reset; + Efl.Input.Event.dup; + Efl.Input.Event.timestamp.set; + Efl.Input.Event.timestamp.get; + Efl.Input.Event.fake.get; + Efl.Input.Event.event_flags.set; + Efl.Input.Event.event_flags.get; + Efl.Input.Event.device.set; + Efl.Input.Event.device.get; Efl.Input.State.modifier_enabled.get; Efl.Input.State.lock_enabled.get; } diff --git a/src/lib/evas/canvas/efl_event_pointer.c b/src/lib/evas/canvas/efl_input_pointer.c similarity index 67% rename from src/lib/evas/canvas/efl_event_pointer.c rename to src/lib/evas/canvas/efl_input_pointer.c index 71b78f4..dd055a1 100644 --- a/src/lib/evas/canvas/efl_event_pointer.c +++ b/src/lib/evas/canvas/efl_input_pointer.c @@ -2,14 +2,14 @@ # include #endif -#define EFL_EVENT_PROTECTED +#define EFL_INPUT_EVENT_PROTECTED #include #define EFL_INTERNAL_UNSTABLE #include "interfaces/efl_common_internal.h" -#define MY_CLASS EFL_EVENT_POINTER_CLASS +#define MY_CLASS EFL_INPUT_POINTER_CLASS /* Pointer Event @@ -22,7 +22,7 @@ * Do not add any logic here. */ -static Efl_Event_Pointer *s_cached_event = NULL; +static Efl_Input_Pointer *s_cached_event = NULL; static void _del_hook(Eo *evt) @@ -43,27 +43,27 @@ _del_hook(Eo *evt) } } -EOLIAN static Efl_Event_Pointer * -_efl_event_pointer_efl_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED, +EOLIAN static Efl_Input_Pointer * +_efl_input_pointer_efl_input_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_UNUSED, Eo *owner, void **priv) { - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; if (s_cached_event) { evt = s_cached_event; s_cached_event = NULL; - efl_event_reset(evt); + efl_input_reset(evt); efl_parent_set(evt, owner); } else { - evt = efl_add(EFL_EVENT_POINTER_CLASS, owner); + evt = efl_add(EFL_INPUT_POINTER_CLASS, owner); efl_del_intercept_set(evt, _del_hook); } - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); ev->fake = EINA_FALSE; if (priv) *priv = ev; @@ -71,7 +71,7 @@ _efl_event_pointer_efl_event_instance_get(Eo *klass EINA_UNUSED, void *_pd EINA_ } EOLIAN static void -_efl_event_pointer_class_destructor(Efl_Class *klass EINA_UNUSED) +_efl_input_pointer_class_destructor(Efl_Class *klass EINA_UNUSED) { // this is a strange situation... efl_del_intercept_set(s_cached_event, NULL); @@ -80,45 +80,45 @@ _efl_event_pointer_class_destructor(Efl_Class *klass EINA_UNUSED) } EOLIAN static Efl_Object * -_efl_event_pointer_efl_object_constructor(Eo *obj, Efl_Event_Pointer_Data *pd EINA_UNUSED) +_efl_input_pointer_efl_object_constructor(Eo *obj, Efl_Input_Pointer_Data *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_event_reset(obj); + efl_input_reset(obj); return obj; } static inline void -_efl_event_pointer_free(Efl_Event_Pointer_Data *pd) +_efl_input_pointer_free(Efl_Input_Pointer_Data *pd) { free(pd->legacy); } EOLIAN static void -_efl_event_pointer_efl_object_destructor(Eo *obj, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_efl_object_destructor(Eo *obj, Efl_Input_Pointer_Data *pd) { - _efl_event_pointer_free(pd); + _efl_input_pointer_free(pd); efl_destructor(efl_super(obj, MY_CLASS)); } EOLIAN static void -_efl_event_pointer_efl_event_reset(Eo *obj, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_efl_input_event_reset(Eo *obj, Efl_Input_Pointer_Data *pd) { Eina_Bool fake = pd->fake; - _efl_event_pointer_free(pd); + _efl_input_pointer_free(pd); memset(pd, 0, sizeof(*pd)); pd->eo = obj; pd->wheel.dir = EFL_ORIENT_VERTICAL; pd->fake = fake; } -EOLIAN static Efl_Event * -_efl_event_pointer_efl_event_dup(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +EOLIAN static Efl_Input_Event * +_efl_input_pointer_efl_input_event_dup(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; // no parent - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, NULL, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, NULL, (void **) &ev); if (!evt) return NULL; memcpy(ev, pd, sizeof(*ev)); @@ -133,31 +133,31 @@ _efl_event_pointer_efl_event_dup(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd } EOLIAN static void -_efl_event_pointer_action_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Pointer_Action act) +_efl_input_pointer_action_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Pointer_Action act) { pd->action = act; } EOLIAN static Efl_Pointer_Action -_efl_event_pointer_action_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_action_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->action; } EOLIAN static void -_efl_event_pointer_button_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int but) +_efl_input_pointer_button_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int but) { pd->button = but; } EOLIAN static int -_efl_event_pointer_button_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_button_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->button; } EOLIAN static void -_efl_event_pointer_button_pressed_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int button, Eina_Bool pressed) +_efl_input_pointer_button_pressed_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int button, Eina_Bool pressed) { if (button < 0) return; if (button > 31) return; @@ -168,7 +168,7 @@ _efl_event_pointer_button_pressed_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Dat } EOLIAN static Eina_Bool -_efl_event_pointer_button_pressed_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int button) +_efl_input_pointer_button_pressed_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int button) { if (button < 0) return EINA_FALSE; if (button > 31) return EINA_FALSE; @@ -176,35 +176,35 @@ _efl_event_pointer_button_pressed_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Dat } EOLIAN static void -_efl_event_pointer_position_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int x, int y) +_efl_input_pointer_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int x, int y) { pd->cur.x = (double) x; pd->cur.y = (double) y; } EOLIAN static void -_efl_event_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int *x, int *y) +_efl_input_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int *x, int *y) { if (x) *x = (int) pd->cur.x; if (y) *y = (int) pd->cur.y; } EOLIAN static void -_efl_event_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int x, int y) +_efl_input_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int x, int y) { pd->prev.x = (double) x; pd->prev.y = (double) y; } EOLIAN static void -_efl_event_pointer_previous_position_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int *x, int *y) +_efl_input_pointer_previous_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int *x, int *y) { if (x) *x = (int) pd->prev.x; if (y) *y = (int) pd->prev.y; } EOLIAN static void -_efl_event_pointer_delta_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int *dx, int *dy) +_efl_input_pointer_delta_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int *dx, int *dy) { // Using (int) twice to return the same as previous_position - position if (dx) *dx = (int) pd->prev.x - (int) pd->cur.x; @@ -212,119 +212,119 @@ _efl_event_pointer_delta_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, in } EOLIAN static void -_efl_event_pointer_efl_event_input_device_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Input_Device *dev) +_efl_input_pointer_efl_input_event_device_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Device *dev) { /* ref? */ pd->device = dev; } EOLIAN static Efl_Input_Device * -_efl_event_pointer_efl_event_input_device_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_efl_input_event_device_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->device; } EOLIAN static void -_efl_event_pointer_source_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Gfx *src) +_efl_input_pointer_source_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Gfx *src) { /* ref? */ pd->source = src; } EOLIAN static Efl_Gfx * -_efl_event_pointer_source_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_source_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->source; } EOLIAN static void -_efl_event_pointer_button_flags_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Pointer_Flags flags) +_efl_input_pointer_button_flags_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Pointer_Flags flags) { pd->button_flags = flags; } EOLIAN static Efl_Pointer_Flags -_efl_event_pointer_button_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_button_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->button_flags; } EOLIAN static void -_efl_event_pointer_efl_event_input_event_flags_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Event_Flags flags) +_efl_input_pointer_efl_input_event_event_flags_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Flags flags) { pd->event_flags = flags; } -EOLIAN static Efl_Event_Flags -_efl_event_pointer_efl_event_input_event_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +EOLIAN static Efl_Input_Flags +_efl_input_pointer_efl_input_event_event_flags_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->event_flags; } EOLIAN static void -_efl_event_pointer_efl_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, double ms) +_efl_input_pointer_efl_input_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, double ms) { pd->timestamp = (unsigned int) ms; } EOLIAN static double -_efl_event_pointer_efl_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_efl_input_event_timestamp_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return (double) pd->timestamp; } EOLIAN static void -_efl_event_pointer_wheel_direction_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Orient dir) +_efl_input_pointer_wheel_direction_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Orient dir) { pd->wheel.dir = dir; } EOLIAN static Efl_Orient -_efl_event_pointer_wheel_direction_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_wheel_direction_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->wheel.dir; } EOLIAN static void -_efl_event_pointer_wheel_delta_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int dist) +_efl_input_pointer_wheel_delta_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int dist) { pd->wheel.z = dist; } EOLIAN static int -_efl_event_pointer_wheel_delta_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_wheel_delta_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->wheel.z; } EOLIAN static int -_efl_event_pointer_tool_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_tool_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return pd->tool; } EOLIAN static void -_efl_event_pointer_tool_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, int id) +_efl_input_pointer_tool_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int id) { pd->tool = id; } EOLIAN static Eina_Bool -_efl_event_pointer_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, const char *name) +_efl_input_pointer_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, const char *name) { if (!pd->modifiers) return EINA_FALSE; return evas_key_modifier_is_set(pd->modifiers, name); } EOLIAN static Eina_Bool -_efl_event_pointer_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, const char *name) +_efl_input_pointer_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, const char *name) { if (!pd->locks) return EINA_FALSE; return evas_key_lock_is_set(pd->locks, name); } EOLIAN static void -_efl_event_pointer_double_click_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Eina_Bool val) +_efl_input_pointer_double_click_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Bool val) { if (val) pd->button_flags |= EFL_POINTER_FLAGS_DOUBLE_CLICK; @@ -333,13 +333,13 @@ _efl_event_pointer_double_click_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data } EOLIAN static Eina_Bool -_efl_event_pointer_double_click_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_double_click_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return !!(pd->button_flags & EFL_POINTER_FLAGS_DOUBLE_CLICK); } EOLIAN static void -_efl_event_pointer_triple_click_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Eina_Bool val) +_efl_input_pointer_triple_click_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Bool val) { if (val) pd->button_flags |= EFL_POINTER_FLAGS_TRIPLE_CLICK; @@ -348,20 +348,20 @@ _efl_event_pointer_triple_click_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data } EOLIAN static Eina_Bool -_efl_event_pointer_triple_click_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_triple_click_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { return !!(pd->button_flags & EFL_POINTER_FLAGS_TRIPLE_CLICK); } EOLIAN static Eina_Bool -_efl_event_pointer_efl_event_input_fake_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd) +_efl_input_pointer_efl_input_event_fake_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) { // read-only return pd->fake; } EOLIAN static Eina_Bool -_efl_event_pointer_value_has_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Input_Value key) +_efl_input_pointer_value_has_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Value key) { if (!pd || (key <= EFL_INPUT_VALUE_NONE) || (key > EFL_INPUT_VALUE_SLIDER)) return EINA_FALSE; @@ -369,7 +369,7 @@ _efl_event_pointer_value_has_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd } EOLIAN static Eina_Bool -_efl_event_pointer_value_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Input_Value key, double val) +_efl_input_pointer_value_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Value key, double val) { if ((key <= EFL_INPUT_VALUE_NONE) || (key > EFL_INPUT_VALUE_SLIDER)) return EINA_FALSE; @@ -469,7 +469,7 @@ _efl_event_pointer_value_set(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Ef } EOLIAN static double -_efl_event_pointer_value_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Efl_Input_Value key) +_efl_input_pointer_value_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Value key) { switch (key) { @@ -551,4 +551,4 @@ _efl_event_pointer_value_get(Eo *obj EINA_UNUSED, Efl_Event_Pointer_Data *pd, Ef } } -#include "efl_event_pointer.eo.c" +#include "efl_input_pointer.eo.c" diff --git a/src/lib/evas/canvas/efl_event_pointer.eo b/src/lib/evas/canvas/efl_input_pointer.eo similarity index 91% rename from src/lib/evas/canvas/efl_event_pointer.eo rename to src/lib/evas/canvas/efl_input_pointer.eo index 2722d1c..28a201f 100644 --- a/src/lib/evas/canvas/efl_event_pointer.eo +++ b/src/lib/evas/canvas/efl_input_pointer.eo @@ -1,7 +1,7 @@ import efl_orientation; -import efl_event_types; +import efl_input_types; -class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input) +class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State, Efl.Input.Event) { [[Event data carried over with any pointer event (mouse, touch, pen, ...) @@ -164,16 +164,16 @@ class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input Efl.Object.constructor; Efl.Object.destructor; class.destructor; - Efl.Event.instance_get; - Efl.Event.reset; - Efl.Event.dup; - Efl.Event.timestamp.set; - Efl.Event.timestamp.get; - Efl.Event.Input.fake.get; - Efl.Event.Input.event_flags.set; - Efl.Event.Input.event_flags.get; - Efl.Event.Input.device.set; - Efl.Event.Input.device.get; + Efl.Input.Event.instance_get; + Efl.Input.Event.reset; + Efl.Input.Event.dup; + Efl.Input.Event.timestamp.set; + Efl.Input.Event.timestamp.get; + Efl.Input.Event.fake.get; + Efl.Input.Event.event_flags.set; + Efl.Input.Event.event_flags.get; + Efl.Input.Event.device.set; + Efl.Input.Event.device.get; Efl.Input.State.modifier_enabled.get; Efl.Input.State.lock_enabled.get; } diff --git a/src/lib/efl/interfaces/efl_input_state.eo b/src/lib/evas/canvas/efl_input_state.eo similarity index 100% rename from src/lib/efl/interfaces/efl_input_state.eo rename to src/lib/evas/canvas/efl_input_state.eo diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index 81a1e6d..0e2835b 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c @@ -156,7 +156,7 @@ static void _eo_evas_object_cb(void *data, const Eo_Event *event) { Evas_Event_Flags *event_flags = NULL, evflags = EVAS_EVENT_FLAG_NONE; - Efl_Event *efl_event_info = event->info; + Efl_Input_Event *efl_event_info = event->info; _eo_evas_object_cb_info *info = data; void *event_info; Evas *evas; @@ -167,15 +167,15 @@ _eo_evas_object_cb(void *data, const Eo_Event *event) switch (info->efl_event_type) { case EFL_EVENT_TYPE_POINTER: - event_info = efl_event_pointer_legacy_info_fill(efl_event_info, info->type, &event_flags); + event_info = efl_input_pointer_legacy_info_fill(efl_event_info, info->type, &event_flags); break; case EFL_EVENT_TYPE_KEY: - event_info = efl_event_key_legacy_info_fill(efl_event_info, &event_flags); + event_info = efl_input_key_legacy_info_fill(efl_event_info, &event_flags); break; case EFL_EVENT_TYPE_HOLD: - event_info = efl_event_hold_legacy_info_fill(efl_event_info, &event_flags); + event_info = efl_input_hold_legacy_info_fill(efl_event_info, &event_flags); break; case EFL_EVENT_TYPE_NULL: @@ -191,7 +191,7 @@ _eo_evas_object_cb(void *data, const Eo_Event *event) if (event_flags) evflags = *event_flags; info->func(info->data, evas, event->object, event_info); if (event_flags && (evflags != *event_flags)) - efl_event_flags_set(efl_event_info, *event_flags); + efl_input_event_flags_set(efl_event_info, *event_flags); } static void @@ -327,11 +327,11 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data if ((type == EVAS_CALLBACK_MOUSE_DOWN) || (type == EVAS_CALLBACK_MOUSE_UP)) { - flags = efl_event_pointer_button_flags_get(event_info); + flags = efl_input_pointer_button_flags_get(event_info); if (flags & mask) { if (obj->last_mouse_down_counter < (e->last_mouse_down_counter - 1)) - efl_event_pointer_button_flags_set(event_info, flags & ~mask); + efl_input_pointer_button_flags_set(event_info, flags & ~mask); } obj->last_mouse_down_counter = e->last_mouse_down_counter; } @@ -345,7 +345,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data efl_event_callback_call(eo_obj, efl_event_desc, event_info); if ((type == EVAS_CALLBACK_MOUSE_DOWN) || (type == EVAS_CALLBACK_MOUSE_UP)) - efl_event_pointer_button_flags_set(event_info, flags); + efl_input_pointer_button_flags_set(event_info, flags); nothing_here: if (!obj->no_propagate) diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo index ea75d1e..a9a76dd 100644 --- a/src/lib/evas/canvas/evas_canvas.eo +++ b/src/lib/evas/canvas/evas_canvas.eo @@ -1,5 +1,5 @@ import evas_types; -import efl_event_types; +import efl_input_types; class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface) { @@ -44,7 +44,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface) ]] } values { - flags: Efl.Event.Flags; [[The default flags to use.]] + flags: Efl.Input.Flags; [[The default flags to use.]] } } @property font_cache { diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index d835947..bc09992 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -1,4 +1,4 @@ -#define EFL_EVENT_PROTECTED +#define EFL_INPUT_EVENT_PROTECTED #include "evas_common_private.h" #include "evas_private.h" @@ -18,13 +18,13 @@ static Eina_List * evas_event_list_copy(Eina_List *list); static void -_canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev); +_canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev); static void -_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev); +_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev); static void -_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev); +_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev); static void _canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int y, @@ -371,7 +371,7 @@ _transform_to_src_space_f(Evas_Object_Protected_Data *obj, Evas_Object_Protected static void _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); @@ -380,16 +380,16 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *copy, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; int addgrab = 0; int no_rep = 0; if (obj->delete_me || src->delete_me || e->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -454,7 +454,7 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e, static void _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); @@ -463,14 +463,14 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 curpt, curpt_real, prevpt, prevpt_real; if (obj->delete_me || src->delete_me || e->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; curpt_real = ev->cur; @@ -628,7 +628,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, static void _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); @@ -637,14 +637,14 @@ _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *copy, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; if (obj->delete_me || src->delete_me || e->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -685,7 +685,7 @@ _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e, } static void -_evas_event_source_hold_events(Evas_Object *eo_obj, int event_id, Efl_Event_Hold *evt) +_evas_event_source_hold_events(Evas_Object *eo_obj, int event_id, Efl_Input_Hold *evt) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); @@ -708,7 +708,7 @@ _evas_event_source_hold_events(Evas_Object *eo_obj, int event_id, Efl_Event_Hold static void _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); @@ -717,14 +717,14 @@ _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *copy, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -749,22 +749,22 @@ _evas_event_source_wheel_events(Evas_Object *eo_obj, Evas *eo_e, static void _evas_event_source_multi_down_events(Evas_Object_Protected_Data *obj, Evas_Public_Data *e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object *eo_src = _evas_object_image_source_get(obj->object); Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS); Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *copy, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; int addgrab = 0; if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -801,21 +801,21 @@ _evas_event_source_multi_down_events(Evas_Object_Protected_Data *obj, Evas_Publi static void _evas_event_source_multi_up_events(Evas_Object_Protected_Data *obj, Evas_Public_Data *e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object *eo_src = _evas_object_image_source_get(obj->object); Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS); Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *copy, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; if (obj->delete_me || src->delete_me || obj->layer->evas->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -847,22 +847,22 @@ _evas_event_source_multi_up_events(Evas_Object_Protected_Data *obj, Evas_Public_ static void _evas_event_source_multi_move_events(Evas_Object_Protected_Data *obj, Evas_Public_Data *e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object *eo_src = _evas_object_image_source_get(obj->object); Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS); Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *copy, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; Evas *eo_e = e->evas; if (obj->delete_me || src->delete_me || e->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -950,7 +950,7 @@ _evas_event_source_multi_move_events(Evas_Object_Protected_Data *obj, Evas_Publi static void _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); @@ -959,14 +959,14 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *ins = NULL, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; if (obj->delete_me || src->delete_me || e->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -1011,7 +1011,7 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, static void _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, - Efl_Event_Pointer *parent_ev, int event_id) + Efl_Input_Pointer *parent_ev, int event_id) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); @@ -1020,14 +1020,14 @@ _evas_event_source_mouse_out_events(Evas_Object *eo_obj, Evas *eo_e, Evas_Object_Protected_Data *child; Evas_Object *eo_child; Eina_List *copy, *l; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Eina_Vector2 point; if (obj->delete_me || src->delete_me || e->is_frozen) return; - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; _transform_to_src_space_f(obj, src, &ev->cur); @@ -1213,9 +1213,9 @@ evas_event_thaw_eval(Evas *eo_e) } static void -_canvas_event_feed_mouse_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_mouse_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; int event_id, b; @@ -1310,11 +1310,11 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da } static int -_post_up_handle(Evas_Public_Data *e, Efl_Event_Pointer *parent_ev) +_post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer *parent_ev) { Eina_List *l, *copy, *ins, *ll; - Efl_Event_Pointer_Data *ev; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev; + Efl_Input_Pointer *evt; Evas_Object *eo_obj; Evas *eo_e = e->evas; int post_called = 0; @@ -1323,8 +1323,8 @@ _post_up_handle(Evas_Public_Data *e, Efl_Event_Pointer *parent_ev) event_id = _evas_object_event_new(); /* Duplicating UP event */ - evt = efl_event_dup(parent_ev); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(parent_ev); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return 0; /* Actually we want an OUT */ @@ -1413,9 +1413,9 @@ _post_up_handle(Evas_Public_Data *e, Efl_Event_Pointer *parent_ev) } static void -_canvas_event_feed_mouse_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_mouse_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; int event_id, b; @@ -1508,14 +1508,14 @@ _canvas_event_feed_mouse_updown_legacy(Eo *eo_e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data, Eina_Bool down) { - Efl_Event_Pointer_Data *ev = NULL; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev = NULL; + Efl_Input_Pointer *evt; Evas_Public_Data *e; e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); if (!e) return; - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); if (!ev) return; ev->data = (void *) data; @@ -1556,10 +1556,10 @@ evas_event_feed_mouse_up(Eo *eo_e, int b, Evas_Button_Flags flags, unsigned int } static void -_canvas_event_feed_mouse_cancel_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_mouse_cancel_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { Evas_Coord_Touch_Point *point; - Efl_Event_Pointer_Data save; + Efl_Input_Pointer_Data save; Eina_List *l, *ll; Evas_Event_Flags flags; Evas *eo_e; @@ -1604,10 +1604,10 @@ evas_event_feed_mouse_cancel(Eo *eo_e, unsigned int timestamp, const void *data) { EINA_SAFETY_ON_FALSE_RETURN(efl_isa(eo_e, EVAS_CANVAS_CLASS)); Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); - Efl_Event_Pointer_Data *ev = NULL; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev = NULL; + Efl_Input_Pointer *evt; - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); if (!ev) return; ev->timestamp = timestamp; @@ -1620,11 +1620,11 @@ evas_event_feed_mouse_cancel(Eo *eo_e, unsigned int timestamp, const void *data) } static void -_canvas_event_feed_mouse_wheel_internal(Eo *eo_e, Efl_Event_Pointer_Data *pe) +_canvas_event_feed_mouse_wheel_internal(Eo *eo_e, Efl_Input_Pointer_Data *pe) { Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); - Efl_Event_Pointer_Data *ev = NULL; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev = NULL; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; int event_id = 0; @@ -1634,8 +1634,8 @@ _canvas_event_feed_mouse_wheel_internal(Eo *eo_e, Efl_Event_Pointer_Data *pe) event_id = _evas_object_event_new(); - evt = efl_event_dup(pe->eo); - ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + evt = efl_input_dup(pe->eo); + ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return; // adjust missing data based on evas state @@ -1676,8 +1676,8 @@ _canvas_event_feed_mouse_wheel_internal(Eo *eo_e, Efl_Event_Pointer_Data *pe) EAPI void evas_event_feed_mouse_wheel(Eo *eo_e, int direction, int z, unsigned int timestamp, const void *data) { - Efl_Event_Pointer_Data *ev = NULL; - Efl_Event_Pointer *evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev); + Efl_Input_Pointer_Data *ev = NULL; + Efl_Input_Pointer *evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); if (!ev) return; @@ -1691,11 +1691,11 @@ evas_event_feed_mouse_wheel(Eo *eo_e, int direction, int z, unsigned int timesta } static void -_canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { Evas_Object *nogrep_obj = NULL; Evas_Object_Protected_Data *obj; - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; Eina_Vector2 point; @@ -2042,10 +2042,10 @@ static void _canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int y, unsigned int timestamp, const void *data) { - Efl_Event_Pointer_Data *ev = NULL; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev = NULL; + Efl_Input_Pointer *evt; - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); if (!ev) return; ev->data = (void *) data; @@ -2076,10 +2076,10 @@ evas_event_feed_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const } static void -_canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev) { Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *ins; Eina_List *l; Evas_Object *eo_obj; @@ -2137,10 +2137,10 @@ _canvas_event_feed_mouse_in_internal(Evas *eo_e, Efl_Event_Pointer_Data *ev) } static void -_canvas_event_feed_mouse_out_internal(Evas *eo_e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_mouse_out_internal(Evas *eo_e, Efl_Input_Pointer_Data *ev) { Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; int event_id; @@ -2200,10 +2200,10 @@ static void _canvas_event_feed_mouse_inout_legacy(Eo *eo_e, unsigned int timestamp, const void *data, Eina_Bool in) { - Efl_Event_Pointer_Data *ev = NULL; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev = NULL; + Efl_Input_Pointer *evt; - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); if (!ev) return; ev->timestamp = timestamp; @@ -2231,9 +2231,9 @@ evas_event_feed_mouse_out(Eo *eo_e, unsigned int timestamp, const void *data) } static void -_canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; Eina_Vector2 point; @@ -2299,9 +2299,9 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Event_Pointer_Da } static void -_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_multi_up_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; Eina_Vector2 point; @@ -2370,10 +2370,10 @@ _canvas_event_feed_multi_internal(Evas *eo_e, Evas_Public_Data *e, unsigned int timestamp, const void *data, Efl_Pointer_Action action) { - Efl_Event_Pointer_Data *ev = NULL; - Efl_Event_Pointer *evt; + Efl_Input_Pointer_Data *ev = NULL; + Efl_Input_Pointer *evt; - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); if (!e || !ev) return; if (!fx) fx = x; @@ -2450,9 +2450,9 @@ evas_event_feed_multi_up(Eo *eo_e, int d, int x, int y, double rad, double radx, } static void -_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_multi_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; Eina_Vector2 point; @@ -2590,10 +2590,10 @@ evas_event_feed_multi_move(Eo *eo_e, int d, int x, int y, double rad, double rad } static void -_canvas_event_feed_key_down_internal(Evas_Public_Data *e, Efl_Event_Key_Data *ev) +_canvas_event_feed_key_down_internal(Evas_Public_Data *e, Efl_Input_Key_Data *ev) { Eina_Bool exclusive = EINA_FALSE; - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; int event_id = 0; if (!e || !ev) return; @@ -2679,10 +2679,10 @@ _canvas_event_feed_key_down_internal(Evas_Public_Data *e, Efl_Event_Key_Data *ev } static void -_canvas_event_feed_key_up_internal(Evas_Public_Data *e, Efl_Event_Key_Data *ev) +_canvas_event_feed_key_up_internal(Evas_Public_Data *e, Efl_Input_Key_Data *ev) { Eina_Bool exclusive = EINA_FALSE; - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; int event_id = 0; if (!e || !ev) return; @@ -2776,12 +2776,12 @@ _canvas_event_feed_key_legacy(Eo *eo_e, Evas_Public_Data *e, unsigned int timestamp, const void *data, unsigned int keycode, Eina_Bool down) { - Efl_Event_Key_Data *ev = NULL; - Efl_Event_Key *evt; + Efl_Input_Key_Data *ev = NULL; + Efl_Input_Key *evt; if (!keyname) return; - evt = efl_event_instance_get(EFL_EVENT_KEY_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_KEY_CLASS, eo_e, (void **) &ev); if (!ev) return; ev->keyname = (char *) keyname; @@ -2838,8 +2838,8 @@ EAPI void evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *data) { Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); - Efl_Event_Hold_Data *ev = NULL; - Efl_Event_Hold *evt; + Efl_Input_Hold_Data *ev = NULL; + Efl_Input_Hold *evt; Eina_List *l, *copy; Evas_Object *eo_obj; int event_id = 0; @@ -2849,7 +2849,7 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *dat event_id = _evas_object_event_new(); - evt = efl_event_instance_get(EFL_EVENT_HOLD_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_HOLD_CLASS, eo_e, (void **) &ev); if (!ev) return; ev->hold = !!hold; @@ -2882,9 +2882,9 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *dat } void -_canvas_event_feed_axis_update_internal(Evas_Public_Data *e, Efl_Event_Pointer_Data *ev) +_canvas_event_feed_axis_update_internal(Evas_Public_Data *e, Efl_Input_Pointer_Data *ev) { - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; Eina_List *l, *copy; Evas_Object *eo_obj; int event_id = 0; @@ -2928,13 +2928,13 @@ evas_event_feed_axis_update(Evas *eo_e, unsigned int timestamp, int device, int { EINA_SAFETY_ON_FALSE_RETURN(efl_isa(eo_e, EVAS_CANVAS_CLASS)); Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); - Efl_Event_Pointer_Data *ev = NULL; + Efl_Input_Pointer_Data *ev = NULL; Eina_Bool haswinx = 0, haswiny = 0; - Efl_Event_Pointer *evt; + Efl_Input_Pointer *evt; double x = 0, y = 0; int n; - evt = efl_event_instance_get(EFL_EVENT_POINTER_CLASS, eo_e, (void **) &ev); + evt = efl_input_instance_get(EFL_INPUT_POINTER_CLASS, eo_e, (void **) &ev); if (!ev) return; ev->data = (void *) data; @@ -3266,7 +3266,7 @@ _evas_canvas_event_down_count_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) static void _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event) { - Efl_Event_Pointer_Data *ev = efl_data_scope_get(event->info, EFL_EVENT_POINTER_CLASS); + Efl_Input_Pointer_Data *ev = efl_data_scope_get(event->info, EFL_INPUT_POINTER_CLASS); Evas_Public_Data *e = data; Evas *eo_e = event->object; Eina_Bool nodev = 0; @@ -3338,12 +3338,12 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event) static void _evas_canvas_event_key_cb(void *data, const Eo_Event *event) { - Efl_Event_Key *evt = event->info; + Efl_Input_Key *evt = event->info; Evas_Public_Data *e = data; - Efl_Event_Key_Data *ev; + Efl_Input_Key_Data *ev; Eina_Bool nodev = 0; - ev = efl_data_scope_get(evt, EFL_EVENT_KEY_CLASS); + ev = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS); if (!ev) return; if (!ev->device) diff --git a/src/lib/evas/canvas/evas_events_legacy.c b/src/lib/evas/canvas/evas_events_legacy.c index 0b79fd2..8a8067f 100644 --- a/src/lib/evas/canvas/evas_events_legacy.c +++ b/src/lib/evas/canvas/evas_events_legacy.c @@ -33,9 +33,9 @@ _event_alloc(void *old) } void * -efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags) +efl_input_pointer_legacy_info_fill(Efl_Input_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags) { - Efl_Event_Pointer_Data *ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS); + Efl_Input_Pointer_Data *ev = efl_data_scope_get(evt, EFL_INPUT_POINTER_CLASS); if (!ev) return NULL; #define COORD_DUP(e) do { (e)->output.x = (e)->canvas.x; (e)->output.y = (e)->canvas.y; } while (0) @@ -295,11 +295,11 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, } void * -efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags) +efl_input_key_legacy_info_fill(Efl_Input_Key *evt, Evas_Event_Flags **pflags) { - Efl_Event_Key_Data *ev; + Efl_Input_Key_Data *ev; - ev = efl_data_scope_get(evt, EFL_EVENT_KEY_CLASS); + ev = efl_data_scope_get(evt, EFL_INPUT_KEY_CLASS); if (!ev) return NULL; if (ev->pressed) @@ -341,9 +341,9 @@ efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags) } void * -efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags) +efl_input_hold_legacy_info_fill(Efl_Input_Hold *evt, Evas_Event_Flags **pflags) { - Efl_Event_Hold_Data *ev = efl_data_scope_get(evt, EFL_EVENT_HOLD_CLASS); + Efl_Input_Hold_Data *ev = efl_data_scope_get(evt, EFL_INPUT_HOLD_CLASS); Evas_Event_Hold *e; if (!ev) return NULL; diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index b3b52a1..0e09c99 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1955,9 +1955,9 @@ void _evas_device_cleanup(Evas *e); Evas_Device *_evas_device_top_get(const Evas *e); /* legacy/eo events */ -void *efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags); -void *efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags); -void *efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags); +void *efl_input_pointer_legacy_info_fill(Efl_Input_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags); +void *efl_input_key_legacy_info_fill(Efl_Input_Key *evt, Evas_Event_Flags **pflags); +void *efl_input_hold_legacy_info_fill(Efl_Input_Hold *evt, Evas_Event_Flags **pflags); Eina_Bool evas_vg_loader_svg(Evas_Object *vg, const Eina_File *f, const char *key EINA_UNUSED); diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c index 073db0f..07ad64a 100644 --- a/src/tests/emotion/emotion_test_main-eo.c +++ b/src/tests/emotion/emotion_test_main-eo.c @@ -134,10 +134,10 @@ broadcast_event(Emotion_Event ev) static void bg_key_down(void *data EINA_UNUSED, const Eo_Event *event) { - Efl_Event_Key *ev = event->info; + Efl_Input_Key *ev = event->info; Eina_List *l; Evas_Object *o; - const char *keyname = efl_event_key_name_get(ev); + const char *keyname = efl_input_key_name_get(ev); if (!keyname) return; -- 2.7.4