diff options
author | Hermet Park <hermetpark@gmail.com> | 2020-01-22 10:23:51 +0900 |
---|---|---|
committer | Hermet Park <hermetpark@gmail.com> | 2020-01-22 10:23:51 +0900 |
commit | 911c1c49f97280cb7714459bf4fd9a9d09e1642b (patch) | |
tree | 2812ceb7548aea329d614727cac7f6347598ccc5 | |
parent | 4255c7896c139463f14b96c7906796b13b0681ee (diff) | |
parent | cade1b3c3ccacf9f47f5aeb366f5686eff232f6c (diff) | |
download | efl-911c1c49f97280cb7714459bf4fd9a9d09e1642b.tar.gz |
Merge branch 'master' into devs/hermet/lottie
30 files changed, 451 insertions, 345 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh index eff586b157..fcc8a88f15 100644 --- a/src/bin/eolian_mono/eolian/mono/function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh @@ -428,6 +428,10 @@ struct property_wrapper_definition_generator if (is_interface && (!is_get_public && !is_set_public)) return true; + // Do not generate set-only proeprty + if (property.setter.is_engaged() && !property.getter.is_engaged()) + return true; + // C# interface members are declared automatically as public if (is_interface) { diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 003e0d8df9..6a54812204 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -551,20 +551,6 @@ EAPI Ecore_Wl2_Display *ecore_wl2_display_connect(const char *name); EAPI void ecore_wl2_display_disconnect(Ecore_Wl2_Display *display); /** - * Terminate a Wayland display's main loop - * - * @brief This function is typically used by servers to terminate the - * Wayland display main loop. This is usually only called when a server - * encounters an error. - * - * @param display The Ecore_Wl2_Display to terminate - * - * @ingroup Ecore_Wl2_Display_Group - * @since 1.17 - */ -EAPI void ecore_wl2_display_terminate(Ecore_Wl2_Display *display); - -/** * Retrieve the existing Wayland display * * @param display The Ecore_Wl2_Display for which to retrieve the existing @@ -1489,21 +1475,6 @@ EAPI Eina_Bool ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int EAPI void ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y); /** - * Set a specific cursor on a given seat - * - * @brief This function will try to find a matching cursor inside the existing - * cursor theme and set the pointer for the specified seat to be - * the specified cursor - * - * @param input The seat to set the cursor on - * @param cursor The name of the cursor to try and set - * - * @ingroup Ecore_Wl2_Input_Group - * @since 1.20 - */ -EAPI void ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const char *cursor); - -/** * @defgroup Ecore_Wl2_Output_Group Wayland Library Output Functions * @ingroup Ecore_Wl2_Group * diff --git a/src/lib/ecore_wl2/ecore_wl2_internal.h b/src/lib/ecore_wl2/ecore_wl2_internal.h index 9b103ce9e8..111b2cad30 100644 --- a/src/lib/ecore_wl2/ecore_wl2_internal.h +++ b/src/lib/ecore_wl2/ecore_wl2_internal.h @@ -565,6 +565,35 @@ EAPI void ecore_wl2_window_aux_hint_change(Ecore_Wl2_Window *window, int id, con */ EAPI void ecore_wl2_window_aux_hint_del(Ecore_Wl2_Window *window, int id); +/** + * Terminate a Wayland display's main loop + * + * @brief This function is typically used by servers to terminate the + * Wayland display main loop. This is usually only called when a server + * encounters an error. + * + * @param display The Ecore_Wl2_Display to terminate + * + * @ingroup Ecore_Wl2_Display_Group + * @since 1.17 + */ +EAPI void ecore_wl2_display_terminate(Ecore_Wl2_Display *display); + +/** + * Set a specific cursor on a given seat + * + * @brief This function will try to find a matching cursor inside the existing + * cursor theme and set the pointer for the specified seat to be + * the specified cursor + * + * @param input The seat to set the cursor on + * @param cursor The name of the cursor to try and set + * + * @ingroup Ecore_Wl2_Input_Group + * @since 1.20 + */ +EAPI void ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const char *cursor); + # undef EAPI # define EAPI diff --git a/src/lib/elementary/efl_text_interactive.eo b/src/lib/elementary/efl_text_interactive.eo index 2f16ce89d8..933aad0cb1 100644 --- a/src/lib/elementary/efl_text_interactive.eo +++ b/src/lib/elementary/efl_text_interactive.eo @@ -25,17 +25,13 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font_Properties, } @property selection_cursors { [[The cursors used for selection handling. + If the cursors are equal there's no selection. + + You are allowed to retain and modify them. Modifying them modifies + the selection of the object. ]] - get { - [[You are allowed to retain and modify them. Modifying them modifies - the selection of the object (recommended to extend selection range).]] - } - set { - [[The positions of passed cursors will be used to set selection cursors positions. - Further modification for passed @Efl.Text.Cursor objects, will not affect selection. - Setter is recommended to set new range for selection.]] - } + get {} values { start: Efl.Text.Cursor; [[The start of the selection.]] end: Efl.Text.Cursor; [[The end of the selection.]] diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c index 42d3bdb8bb..8c39ed6287 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.c +++ b/src/lib/elementary/efl_ui_internal_text_interactive.c @@ -14,7 +14,6 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data { Efl_Text_Cursor *sel_start, *sel_end; - int sel_start_pos, sel_end_pos; Efl_Text_Cursor *main_cursor; Efl_Text_Cursor *preedit_start, *preedit_end; Ecore_Timer *pw_timer; @@ -45,11 +44,10 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data } Efl_Ui_Internal_Text_Interactive_Data; static void _sel_range_del_emit(Evas_Object *obj, Efl_Ui_Internal_Text_Interactive_Data *en); -static void _sel_init(Efl_Text_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data *en); -static void _sel_enable(Evas_Object *o,Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_event); -static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_event); -static void _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_event); -static void _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_init(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_enable(Efl_Text_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en); +static void _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en); static void _entry_imf_cursor_info_set(Efl_Ui_Internal_Text_Interactive_Data *en); @@ -203,7 +201,7 @@ _entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void { /* delete selected characters */ _sel_range_del_emit(obj, en); - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); } } @@ -628,12 +626,12 @@ _entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED } else { - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); efl_text_cursor_position_set(cur, ev->start); - _sel_enable(obj, en, EINA_TRUE); - _sel_init(cur, en); + _sel_enable(cur, obj, en); + _sel_init(cur, obj, en); efl_text_cursor_position_set(cur, ev->end); - _sel_extend(cur, obj, en, EINA_TRUE); + _sel_extend(cur, obj, en); } } @@ -749,64 +747,18 @@ _entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj EINA_UNUSED, Efl_Ui_I } static void -_sel_reset(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en){ - if (!en->have_selection && efl_text_cursor_equal(en->sel_start, en->sel_end)) - return; - - if ( en->sel_start_pos == efl_text_cursor_position_get(en->sel_start) && - en->sel_end_pos == efl_text_cursor_position_get(en->sel_end)) - return; - - if (en->have_selection) - { - if (efl_text_cursor_equal(en->sel_start, en->sel_end)) - { - _sel_clear(obj, en, EINA_TRUE); - } - else - { - _entry_imf_cursor_info_set(en); - if (en->selection) - { - free(en->selection); - en->selection = NULL; - } - _emit_sel_state(obj, en); - } - } - else - { - if (!efl_text_cursor_equal(en->sel_start, en->sel_end)) - { - _sel_enable(obj, en, EINA_TRUE); - _entry_imf_cursor_info_set(en); - if (en->selection) - { - free(en->selection); - en->selection = NULL; - } - _emit_sel_state(obj, en); - } - } -} - -static void _sel_cursor_changed(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { - Efl_Ui_Internal_Text_Interactive *obj = data; - Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); - _sel_reset(obj, en); +// Eo *obj = data; } static void -_sel_init(Efl_Text_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data *en) +_sel_init(Efl_Text_Cursor *c, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) { if (en->have_selection) return; - en->sel_start_pos = efl_text_cursor_position_get(c); _cur_pos_copy(c, en->sel_start); - en->sel_end_pos = efl_text_cursor_position_get(c); _cur_pos_copy(c, en->sel_end); en->have_selection = EINA_FALSE; @@ -818,7 +770,8 @@ _sel_init(Efl_Text_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data *en) } static void -_sel_enable(Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_event) +_sel_enable(Efl_Text_Cursor *c EINA_UNUSED, + Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) { if (en->have_selection) return; en->have_selection = EINA_TRUE; @@ -828,11 +781,8 @@ _sel_enable(Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_eve en->selection = NULL; } - if (emit_event) - { - Eina_Bool b_value = EINA_TRUE; - efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value); - } + Eina_Bool b_value = EINA_TRUE; + efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value); _entry_imf_context_reset(en); } @@ -841,7 +791,8 @@ _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en) { if (!efl_text_cursor_compare(en->sel_start, en->sel_end)) { - _sel_clear(o, en, EINA_TRUE); + Eina_Bool b_value = EINA_FALSE; + efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value); } else { @@ -853,12 +804,12 @@ _emit_sel_state( Eo *o, Efl_Ui_Internal_Text_Interactive_Data *en) } static void -_sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_event) +_sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en) { - _sel_enable(o, en, emit_event); + if (!en->sel_end) return; + _sel_enable(c, o, en); if (efl_text_cursor_equal(c, en->sel_end)) return; - en->sel_end_pos = efl_text_cursor_position_get(c); _cur_pos_copy(c, en->sel_end); _entry_imf_cursor_info_set(en); @@ -873,7 +824,7 @@ _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive } static void -_sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool emit_change) +_sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) { en->had_sel = EINA_FALSE; if (en->selection) @@ -885,10 +836,8 @@ _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en { en->have_selection = EINA_FALSE; Eina_Bool b_value = en->have_selection; - en->sel_start_pos = en->sel_end_pos = efl_text_cursor_position_get(en->sel_start); _cur_pos_copy(en->sel_start, en->sel_end); - if (emit_change) - efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value); + efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_HAVE_SELECTION_CHANGED, &b_value); } } @@ -896,32 +845,32 @@ EOLIAN static void _efl_ui_internal_text_interactive_efl_text_interactive_all_unselect( Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) { - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); } EOLIAN static Eina_Bool _efl_ui_internal_text_interactive_efl_text_interactive_have_selection_get( const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) { - if (!en->have_selection) return en->have_selection; return !efl_text_cursor_equal(en->sel_start, en->sel_end); } EOLIAN static void _efl_ui_internal_text_interactive_efl_text_interactive_all_select( - Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en EINA_UNUSED) + Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) { if (!efl_text_interactive_selection_allowed_get(obj)) return; - Eo *c1 = efl_canvas_textblock_cursor_create(obj); - Eo *c2 = efl_canvas_textblock_cursor_create(obj); - - efl_text_cursor_move(c1, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST); - efl_text_cursor_move(c2, EFL_TEXT_CURSOR_MOVE_TYPE_LAST); + Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj); + _entry_imf_context_reset(en); - efl_text_interactive_selection_cursors_set(obj, c1, c2); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST); + _entry_imf_context_reset(en); + _sel_init(cur, obj, en); + efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LAST); + _sel_extend(cur, obj, en); } @@ -954,7 +903,7 @@ static void _sel_range_del_emit(Evas_Object *obj, Efl_Ui_Internal_Text_Interactive_Data *en) { _range_del_emit(obj, en->sel_start, en->sel_end); - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); } static void @@ -1075,7 +1024,7 @@ _key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor *cur, E { if (shift) { - _sel_init(cur, en); + _sel_init(cur, obj, en); } else if (en->have_selection) { @@ -1083,9 +1032,8 @@ _key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor *cur, E if ((sel_forward && movement_forward) || (!sel_forward && !movement_forward)) _cur_pos_copy(en->sel_end, cur); else - - _cur_pos_copy(en->sel_start, cur); - _sel_clear(obj, en, EINA_TRUE); + _cur_pos_copy(en->sel_start, cur); + _sel_clear(obj, en); } } } @@ -1095,8 +1043,8 @@ _key_down_sel_post(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor *cur, { if (en->select_allow) { - if (shift) _sel_extend(cur, obj, en, EINA_TRUE); - else _sel_clear(obj, en, EINA_TRUE); + if (shift) _sel_extend(cur, obj, en); + else _sel_clear(obj, en); } } @@ -1289,7 +1237,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void _delete_emit(obj, cur, en, old_cur_pos, EINA_TRUE); } } - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if (!strcmp(ev->key, "Delete") || @@ -1325,7 +1273,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void _delete_emit(obj, cur, en, old_cur_pos, EINA_FALSE); } } - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; } else if ((!alt) && @@ -1613,19 +1561,19 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START); else efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END); - _sel_extend(cur, obj, en, EINA_TRUE); + _sel_extend(cur, obj, en); } else { en->have_selection = EINA_FALSE; en->selecting = EINA_FALSE; - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); tc = efl_canvas_textblock_cursor_create(obj); _cur_pos_copy(cur, tc); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START); - _sel_init(cur, en); + _sel_init(cur, obj, en); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END); - _sel_extend(cur, obj, en, EINA_TRUE); + _sel_extend(cur, obj, en); } goto end; } @@ -1642,20 +1590,20 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT); } - _sel_extend(cur, obj, en, EINA_TRUE); + _sel_extend(cur, obj, en); } else { en->have_selection = EINA_FALSE; en->selecting = EINA_FALSE; - _sel_clear(obj, en, EINA_TRUE); + _sel_clear(obj, en); tc = efl_canvas_textblock_cursor_create(obj); _cur_pos_copy(cur, tc); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START); - _sel_init(cur, en); + _sel_init(cur, obj, en); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END); efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHARACTER_NEXT); - _sel_extend(cur, obj, en, EINA_TRUE); + _sel_extend(cur, obj, en); } goto end; } @@ -1666,13 +1614,13 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN { if ((en->have_selection) && (shift)) { - _sel_extend(cur, obj, en, EINA_TRUE); + _sel_extend(cur, obj, en); } else { en->selecting = EINA_TRUE; - _sel_clear(obj, en, EINA_TRUE); - _sel_init(cur, en); + _sel_clear(obj, en); + _sel_init(cur, obj, en); } } @@ -1768,10 +1716,10 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo if (en->select_allow) { - _sel_extend(cur, obj, en, EINA_TRUE); + _sel_extend(cur, obj, en); if (!efl_text_cursor_equal(en->sel_start, en->sel_end)) - _sel_enable(obj, en, EINA_TRUE); + _sel_enable(cur, obj, en); } efl_del(tc); } @@ -1806,9 +1754,7 @@ _efl_ui_internal_text_interactive_efl_object_finalize(Eo *obj, Efl_Ui_Internal_T en->sel_start = efl_canvas_textblock_cursor_create(obj); en->sel_end = efl_canvas_textblock_cursor_create(obj); - efl_event_callback_add(en->sel_start, EFL_TEXT_CURSOR_EVENT_CHANGED, - _sel_cursor_changed, obj); - efl_event_callback_add(en->sel_end, EFL_TEXT_CURSOR_EVENT_CHANGED, + efl_event_callback_add(efl_text_interactive_main_cursor_get(obj), EFL_TEXT_CURSOR_EVENT_CHANGED, _sel_cursor_changed, obj); #ifdef HAVE_ECORE_IMF @@ -1901,7 +1847,7 @@ _efl_ui_internal_text_interactive_efl_text_interactive_selection_allowed_set(Eo pd->select_allow = allowed; if (!allowed) { - _sel_clear(obj, pd, EINA_TRUE); + _sel_clear(obj, pd); } } @@ -1928,16 +1874,6 @@ _efl_ui_internal_text_interactive_efl_text_interactive_selection_cursors_get(con } EOLIAN static void -_efl_ui_internal_text_interactive_efl_text_interactive_selection_cursors_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en, Efl_Text_Cursor *start, Efl_Text_Cursor *end) -{ - en->sel_start_pos = efl_text_cursor_position_get(start); - en->sel_end_pos = efl_text_cursor_position_get(en->sel_end); - efl_text_cursor_position_set(en->sel_start, en->sel_start_pos); - en->sel_end_pos = -1; - efl_text_cursor_position_set(en->sel_end, efl_text_cursor_position_get(end)); -} - -EOLIAN static void _efl_ui_internal_text_interactive_efl_text_interactive_editable_set(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *sd, Eina_Bool editable) { sd->editable = editable; diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.eo b/src/lib/elementary/efl_ui_internal_text_interactive.eo index 0688334500..448f7a0c6c 100644 --- a/src/lib/elementary/efl_ui_internal_text_interactive.eo +++ b/src/lib/elementary/efl_ui_internal_text_interactive.eo @@ -9,7 +9,7 @@ class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Textblock implem Efl.Object.finalize; Efl.Text_Interactive.main_cursor { get; } Efl.Text_Interactive.selection_allowed { get; set; } - Efl.Text_Interactive.selection_cursors { get; set; } + Efl.Text_Interactive.selection_cursors { get; } Efl.Text_Interactive.editable { get; set; } Efl.Text_Interactive.all_unselect; Efl.Text_Interactive.all_select; diff --git a/src/lib/elementary/efl_ui_pager.eo b/src/lib/elementary/efl_ui_pager.eo index 08840922e8..2adf506c86 100644 --- a/src/lib/elementary/efl_ui_pager.eo +++ b/src/lib/elementary/efl_ui_pager.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Pager extends Efl.Ui.Spotlight.Container +class Efl.Ui.Pager extends Efl.Ui.Spotlight.Container { [[A spotlight with predefined @Efl.Ui.Spotlight.Container.spotlight_manager diff --git a/src/lib/elementary/efl_ui_spotlight_container.eo b/src/lib/elementary/efl_ui_spotlight_container.eo index 857f2655e1..9acfc0c631 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.eo +++ b/src/lib/elementary/efl_ui_spotlight_container.eo @@ -4,7 +4,7 @@ struct @beta Efl.Ui.Spotlight.Transition_Event { to : int; [[The index to where the transition is headed, -1 if not known.]] } -class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack_Linear +class Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack_Linear { [[The Spotlight widget is a container for other sub-widgets, where only one sub-widget is active at any given time. @@ -28,7 +28,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack ]] c_prefix: efl_ui_spotlight; methods { - @property spotlight_manager { + @property spotlight_manager @beta { [[This object defines how sub-widgets are rendered and animated. If it is not set, only the active sub-widget is shown and transitions are instantaneous (not animated). ]] @@ -42,7 +42,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack spotlight_manager : Efl.Ui.Spotlight.Manager @move; [[The Spotlight Manager object or $NULL.]] } } - @property indicator { + @property indicator @beta { [[An indicator object to use, which will display the current state of the spotlight (number of sub-widgets and active one). When this object is set, it is immediately updated to reflect the current state of the widget. @@ -124,8 +124,8 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Widget implements Efl.Pack } } events { - transition,start : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has started.]] - transition,end : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has ended.]] + transition,start @beta : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has started.]] + transition,end @beta : Efl.Ui.Spotlight.Transition_Event; [[A transition animation has ended.]] } implements { Efl.Object.constructor; diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.c b/src/lib/elementary/efl_ui_spotlight_manager_plain.c index d9c52ab3db..81c954e62f 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_plain.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_plain.c @@ -10,6 +10,7 @@ typedef struct { Efl_Ui_Spotlight_Container * container; Eina_Size2D page_size; Efl_Ui_Widget *current_content; + Efl_Gfx_Entity *clipper; Eina_Bool animation; double last_pos; } Efl_Ui_Spotlight_Manager_Plain_Data; @@ -36,6 +37,7 @@ _geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) goal.size = pd->page_size; goal.y = (group_pos.y + group_pos.h/2)-pd->page_size.h/2; goal.x = (group_pos.x + group_pos.w/2)-pd->page_size.w/2; + efl_gfx_entity_geometry_set(pd->clipper, goal); efl_gfx_entity_geometry_set(entity, goal); } @@ -48,8 +50,15 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp pd->container = spotlight; + pd->clipper = efl_add(EFL_CANVAS_RECTANGLE_CLASS, + evas_object_evas_get(spotlight)); + evas_object_static_clip_set(pd->clipper, EINA_TRUE); + efl_canvas_group_member_add(spotlight, pd->clipper); + for (int i = 0; i < efl_content_count(spotlight) ; ++i) { Efl_Gfx_Entity *elem = efl_pack_content_get(spotlight, i); + efl_key_data_set(elem, "_elm_leaveme", spotlight); + efl_canvas_object_clipper_set(elem, pd->clipper); efl_canvas_group_member_add(pd->container, elem); efl_gfx_entity_visible_set(elem, EINA_FALSE); } @@ -81,6 +90,8 @@ _content_changed(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd) EOLIAN static void _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_add(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { + efl_key_data_set(subobj, "_elm_leaveme", pd->container); + efl_canvas_object_clipper_set(subobj, pd->clipper); efl_canvas_group_member_add(pd->container, subobj); efl_gfx_entity_visible_set(subobj, EINA_FALSE); _content_changed(obj, pd); @@ -89,6 +100,8 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_add(Eo *obj, Ef EOLIAN static void _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_content_del(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { + efl_key_data_set(subobj, "_elm_leaveme", NULL); + efl_canvas_object_clipper_set(subobj, NULL); efl_canvas_group_member_remove(pd->container, subobj); if (pd->current_content == subobj) pd->current_content = NULL; @@ -147,5 +160,17 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animated_transition_get return pd->animation; } +EOLIAN static void +_efl_ui_spotlight_manager_plain_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd) +{ + efl_del(pd->clipper); + + for (int i = 0; i < efl_content_count(pd->container); ++i) + { + efl_canvas_object_clipper_set(efl_pack_content_get(pd->container, i), NULL); + } + + efl_invalidate(efl_super(obj, MY_CLASS)); +} #include "efl_ui_spotlight_manager_plain.eo.c" diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.eo b/src/lib/elementary/efl_ui_spotlight_manager_plain.eo index fd4f5d9664..23bf0e443e 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_plain.eo +++ b/src/lib/elementary/efl_ui_spotlight_manager_plain.eo @@ -8,5 +8,6 @@ class @beta Efl.Ui.Spotlight.Manager_Plain extends Efl.Ui.Spotlight.Manager Efl.Ui.Spotlight.Manager.size {set;} Efl.Ui.Spotlight.Manager.animated_transition {set; get;} Efl.Object.destructor; + Efl.Object.invalidate; } } diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c index 1b5d974176..267b64471b 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c @@ -185,6 +185,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_S for (int i = 0; i < efl_content_count(spotlight) ; ++i) { Efl_Gfx_Entity *elem = efl_pack_content_get(spotlight, i); + efl_key_data_set(elem, "_elm_leaveme", spotlight); efl_canvas_object_clipper_set(elem, pd->backclip); efl_canvas_group_member_add(pd->container, elem); efl_gfx_entity_visible_set(elem, EINA_TRUE); @@ -197,6 +198,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_S EOLIAN static void _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_content_add(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { + efl_key_data_set(subobj, "_elm_leaveme", pd->container); efl_gfx_entity_visible_set(subobj, EINA_TRUE); efl_canvas_object_clipper_set(subobj, pd->backclip); efl_canvas_group_member_add(pd->container, subobj); @@ -209,6 +211,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_content_add(Eo *obj EI EOLIAN static void _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { + efl_key_data_set(subobj, "_elm_leaveme", NULL); efl_canvas_object_clipper_set(subobj, NULL); efl_canvas_group_member_remove(pd->container, subobj); diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_manager_stack.c index 26965326a3..dccef97cdc 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.c @@ -10,6 +10,7 @@ typedef struct { Efl_Ui_Spotlight_Container * container; Efl_Canvas_Animation_Player *alpha_anim; Efl_Gfx_Entity *content[2]; + Efl_Gfx_Entity *clipper; int ids[2]; //only used when in animation Eina_Size2D page_size; Eina_Bool animation; @@ -25,6 +26,7 @@ _geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd) goal.size = pd->page_size; goal.y = (group_pos.y + group_pos.h/2)-pd->page_size.h/2; goal.x = (group_pos.x + group_pos.w/2)-pd->page_size.w/2; + efl_gfx_entity_geometry_set(pd->clipper, goal); for (int i = 0; i < 2; ++i) { if (pd->content[i]) @@ -62,12 +64,19 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp { pd->container = spotlight; + pd->clipper = efl_add(EFL_CANVAS_RECTANGLE_CLASS, + evas_object_evas_get(pd->container)); + evas_object_static_clip_set(pd->clipper, EINA_TRUE); + efl_canvas_group_member_add(spotlight, pd->clipper); + pd->alpha_anim = efl_add(EFL_CANVAS_ALPHA_ANIMATION_CLASS, obj); efl_animation_alpha_set(pd->alpha_anim, 0.0, 1.0); efl_animation_duration_set(pd->alpha_anim, 0.5); for (int i = 0; i < efl_content_count(spotlight) ; ++i) { Efl_Gfx_Entity *elem = efl_pack_content_get(spotlight, i); + efl_key_data_set(elem, "_elm_leaveme", spotlight); + efl_canvas_object_clipper_set(elem, pd->clipper); efl_canvas_group_member_add(pd->container, elem); efl_gfx_entity_visible_set(elem, EINA_FALSE); } @@ -95,6 +104,8 @@ _update_ids(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd, int avoid_index) EOLIAN static void _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_add(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Efl_Gfx_Entity *subobj, int index EINA_UNUSED) { + efl_key_data_set(subobj, "_elm_leaveme", pd->container); + efl_canvas_object_clipper_set(subobj, pd->clipper); efl_canvas_group_member_add(pd->container, subobj); efl_gfx_entity_visible_set(subobj, EINA_FALSE); _update_ids(obj, pd, -1); @@ -103,6 +114,8 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_add(Eo *obj EIN EOLIAN static void _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_content_del(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Efl_Gfx_Entity *subobj, int index) { + efl_key_data_set(subobj, "_elm_leaveme", NULL); + efl_canvas_object_clipper_set(subobj, NULL); efl_canvas_group_member_remove(pd->container, subobj); for (int i = 0; i < 2; ++i) { @@ -169,10 +182,12 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_size_set(Eo *obj, Efl_U } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd EINA_UNUSED) +_efl_ui_spotlight_manager_stack_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd) { efl_invalidate(efl_super(obj, MY_CLASS)); + efl_del(pd->clipper); + for (int i = 0; i < efl_content_count(pd->container); ++i) { Efl_Gfx_Stack *elem = efl_pack_content_get(pd->container, i); @@ -180,6 +195,8 @@ _efl_ui_spotlight_manager_stack_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_ { efl_gfx_mapping_color_set(elem, d, 255, 255, 255, 255); } + + efl_canvas_object_clipper_set(elem, NULL); } } diff --git a/src/lib/elementary/efl_ui_stack.eo b/src/lib/elementary/efl_ui_stack.eo index bdaaeed9a2..ccb6b4cc15 100644 --- a/src/lib/elementary/efl_ui_stack.eo +++ b/src/lib/elementary/efl_ui_stack.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Stack extends Efl.Ui.Spotlight.Container +class Efl.Ui.Stack extends Efl.Ui.Spotlight.Container { [[A spotlight with predefined @Efl.Ui.Spotlight.Container.spotlight_manager diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo index 500b521f88..31105a0fc6 100644 --- a/src/lib/evas/canvas/efl_canvas_group.eo +++ b/src/lib/evas/canvas/efl_canvas_group.eo @@ -1,4 +1,4 @@ -class Efl.Canvas.Group extends Efl.Canvas.Object +class Efl.Canvas.Group extends Efl.Canvas.Object implements Efl.Gfx.Filter { [[A group object is a container for other canvas objects. Its children move along their parent and are often clipped with a common clipper. @@ -127,6 +127,8 @@ class Efl.Canvas.Group extends Efl.Canvas.Object Efl.Gfx.Color.color { set; } Efl.Gfx.Entity.visible { set; } Efl.Gfx.Entity.position { set; } + Efl.Gfx.Entity.size { set; } + Efl.Gfx.Filter.filter_program { set; } Efl.Canvas.Object.clipper { set; } Efl.Canvas.Object.no_render { set; } Efl.Canvas.Object.paragraph_direction { get; set; } diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 7f07d826e3..0af4fb5ad6 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -23,6 +23,7 @@ struct _Evas_Smart_Data Eina_Rectangle bounding_box; } cur, prev; Evas_Object *object; + Evas_Object *filter_img; void *engine_data; void *data; Eina_Inlist *callbacks; @@ -909,6 +910,9 @@ _efl_canvas_group_efl_gfx_entity_visible_set(Eo *eo_obj, Evas_Smart_Data *o, Ein efl_gfx_entity_visible_set(clipper, vis); } + + if (o->filter_img) + efl_gfx_entity_visible_set(o->filter_img, vis); } EOLIAN static void @@ -927,6 +931,55 @@ _efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Ei if (o->clipped && !is_overridden) _evas_object_smart_clipped_smart_move_internal(eo_obj, pos.x, pos.y); efl_gfx_entity_position_set(efl_super(eo_obj, MY_CLASS), pos); + efl_gfx_entity_position_set(o->filter_img, pos); +} + +EOLIAN static void +_efl_canvas_group_efl_gfx_entity_size_set(Eo *obj, Evas_Smart_Data *o, Eina_Size2D size) +{ + if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h)) + return; + + efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), size); + efl_gfx_entity_size_set(o->filter_img, size); +} + +EOLIAN static void +_efl_canvas_group_efl_gfx_filter_filter_program_set(Eo *eo_obj, Evas_Smart_Data *o, + const char *code, const char *name) +{ + Evas_Object_Protected_Data *obj, *fobj; + obj = EVAS_OBJ_GET_OR_RETURN(eo_obj); + + if (!code && !name) + { + if (o->filter_img) + { + evas_object_del(o->filter_img); + o->filter_img = NULL; + } + return; + } + + if (o->filter_img) + { + efl_gfx_filter_program_set(o->filter_img, code, name); + return; + } + + o->filter_img = efl_add(EFL_CANVAS_PROXY_CLASS, eo_obj, + efl_gfx_fill_auto_set(efl_added, EINA_TRUE), + efl_canvas_group_member_add(obj->object, efl_added), + efl_canvas_proxy_source_events_set(efl_added, EINA_TRUE), + efl_canvas_proxy_source_set(efl_added, eo_obj), + evas_object_repeat_events_set(efl_added, EINA_TRUE), + efl_gfx_filter_program_set(efl_added, code, name), + efl_gfx_entity_geometry_set(efl_added, (Eina_Rect)obj->cur->geometry), + efl_gfx_entity_visible_set(efl_added, obj->cur->visible)); + + fobj = efl_data_scope_get(o->filter_img, EFL_CANVAS_OBJECT_CLASS); + if (!fobj) return; + fobj->is_filter_object = EINA_TRUE; } EOLIAN static void diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 9010558887..4f44054152 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -8450,7 +8450,7 @@ _cursor_emit_if_changed(Efl_Text_Cursor_Handle *cur) /** * @internal - * prepends the escaped char beteewn s and s_end to the curosr + * Prepends the escaped char between s and s_end to the cursor * * * @param s the start of the string diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 70ed55a953..d655bbdc27 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -2170,6 +2170,13 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, EINA_INLIST_FOREACH (evas_object_smart_members_get_direct(eo_obj), obj2) { + /* skip proxy object if its source is its smart parent. + who makes this relation? a proxy object working for + a smart object to set a filter program. the proxy + object should be a member of smart object to sync + stacking changes. */ + if (obj2->is_filter_object) continue; + clean_them |= evas_render_mapped(evas, obj2->object, obj2, ctx, output, surface, diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 51f4ce22bd..e7de463987 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1228,6 +1228,7 @@ struct _Evas_Object_Protected_Data Eina_Bool events_filter_enabled : 1; Eina_Bool is_pointer_inside_legacy : 1; + Eina_Bool is_filter_object : 1; }; struct _Evas_Data_Node diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.c b/src/tests/ecore_wl2/ecore_wl2_suite.c index b6875c006d..90d16bea60 100644 --- a/src/tests/ecore_wl2/ecore_wl2_suite.c +++ b/src/tests/ecore_wl2/ecore_wl2_suite.c @@ -1,10 +1,4 @@ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - #include "ecore_wl2_suite.h" -#include "../efl_check.h" -#include <Ecore_Wl2.h> static const Efl_Test_Case etc[] = { diff --git a/src/tests/ecore_wl2/ecore_wl2_suite.h b/src/tests/ecore_wl2/ecore_wl2_suite.h index a8edf93074..b429bdbdbf 100644 --- a/src/tests/ecore_wl2/ecore_wl2_suite.h +++ b/src/tests/ecore_wl2/ecore_wl2_suite.h @@ -1,8 +1,16 @@ #ifndef _ECORE_WL2_SUITE_H # define _ECORE_WL2_SUITE_H -# include <check.h> -# include "../efl_check.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <check.h> +#include "../efl_check.h" +#include <stdio.h> +#include <unistd.h> +#include <Ecore.h> +#include <Ecore_Wl2.h> void ecore_wl2_test_init(TCase *tc); void ecore_wl2_test_display(TCase *tc); diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index fcc560311d..3c6dfeb394 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -1,13 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <stdio.h> -#include <unistd.h> -#include <Eina.h> -#include <Ecore.h> -#include <Ecore_Wl2.h> - #include "ecore_wl2_suite.h" #include "ecore_wl2_tests_helpers.h" @@ -183,21 +173,115 @@ EFL_START_TEST(wl2_display_compositor_version_get) } EFL_END_TEST -EFL_START_TEST(wl2_display_input_find_by_name) +Ecore_Wl2_Input *test_input; + +static Eina_Bool +_test_input_find_configure_complete(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) +{ + Test_Data *td = data; + + /* NB: Enlightenment uses "seat0" here, but Weston uses "default" */ + if (getenv("E_START")) + test_input = ecore_wl2_display_input_find_by_name(td->display, "seat0"); + else + test_input = ecore_wl2_display_input_find_by_name(td->display, "default"); + + ck_assert(test_input != NULL); + test_input = NULL; + + if (getenv("E_START")) + { + test_input = ecore_wl2_display_input_find(td->display, 13); + ck_assert(test_input != NULL); + } + + ecore_main_loop_quit(); + + return ECORE_CALLBACK_PASS_ON; +} + +EFL_START_TEST(wl2_display_input_find) +{ + Test_Data *td; + + ecore_wl2_init(); + + td = calloc(1, sizeof(Test_Data)); + td->width = WIDTH; + td->height = HEIGHT; + + td->display = _display_connect(); + ck_assert(td->display != NULL); + + td->win = _window_create(td->display); + ck_assert(td->win != NULL); + + ecore_wl2_window_show(td->win); + + td->handler = ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE_COMPLETE, + _test_input_find_configure_complete, td); + + ecore_main_loop_begin(); + + ecore_wl2_shutdown(); + free(td); +} + +EFL_END_TEST + +EFL_START_TEST(wl2_display_flush) { Ecore_Wl2_Display *disp; - Ecore_Wl2_Input *input; disp = _display_connect(); ck_assert(disp != NULL); - /* NB: Enlightenment uses "seat0" here, but Weston uses "default" */ - if (getenv("E_START")) - input = ecore_wl2_display_input_find_by_name(disp, "seat0"); - else - input = ecore_wl2_display_input_find_by_name(disp, "default"); + //FIXME: Ambiguous way to check with code to make sure flushing was successful. + // We might think it's being verified by another TC that actually draws to the screen buffer ... + ecore_wl2_display_flush(disp); +} +EFL_END_TEST + +static Eina_Bool +_test_sync_done(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) +{ + Test_Data *td = data; + Eina_Bool ret; + + ret = ecore_wl2_display_sync_is_done(td->display); + + fail_if(ret == EINA_FALSE); + + ecore_main_loop_quit(); + + return ECORE_CALLBACK_PASS_ON; +} + +EFL_START_TEST(wl2_display_sync_is_done) +{ + Test_Data *td; + + ecore_wl2_init(); + + td = calloc(1, sizeof(Test_Data)); + td->width = WIDTH; + td->height = HEIGHT; + + td->display = _display_connect(); + ck_assert(td->display != NULL); + + td->win = _window_create(td->display); + ck_assert(td->win != NULL); + + ecore_wl2_window_show(td->win); + + ecore_event_handler_add(ECORE_WL2_EVENT_SYNC_DONE, + _test_sync_done, td); + + ecore_main_loop_begin(); - ck_assert(input != NULL); + ecore_wl2_shutdown(); + free(td); } EFL_END_TEST @@ -221,11 +305,16 @@ ecore_wl2_test_display(TCase *tc) tcase_add_test(tc, wl2_display_disconnect); tcase_add_test(tc, wl2_display_registry_get); tcase_add_test(tc, wl2_display_shm_get); - tcase_add_test(tc, wl2_display_dmabuf_get); tcase_add_test(tc, wl2_display_globals_get); - tcase_add_test(tc, wl2_display_screen_size_get); tcase_add_test(tc, wl2_display_inputs_get); tcase_add_test(tc, wl2_display_compositor_version_get); - tcase_add_test(tc, wl2_display_input_find_by_name); + tcase_add_test(tc, wl2_display_input_find); + tcase_add_test(tc, wl2_display_flush); + tcase_add_test(tc, wl2_display_sync_is_done); + if (!getenv("E_START")) + { + tcase_add_test(tc, wl2_display_dmabuf_get); + tcase_add_test(tc, wl2_display_screen_size_get); + } } } diff --git a/src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c b/src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c index 6ed6b7343f..d8049cd352 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_ecore_wl2.c @@ -1,14 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <unistd.h> - -#include <Eina.h> -#include <Ecore.h> -#include <Ecore_Wl2.h> - #include "ecore_wl2_suite.h" EFL_START_TEST(ecore_wl2_simple) diff --git a/src/tests/ecore_wl2/ecore_wl2_test_input.c b/src/tests/ecore_wl2/ecore_wl2_test_input.c index 92ab2ca830..3c0330a3c8 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_input.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_input.c @@ -1,13 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <stdio.h> -#include <unistd.h> -#include <Eina.h> -#include <Ecore.h> -#include <Ecore_Wl2.h> - #include "ecore_wl2_suite.h" #include "ecore_wl2_tests_helpers.h" @@ -124,16 +114,14 @@ EFL_START_TEST(wl2_input_name_get) } EFL_END_TEST -EFL_START_TEST(wl2_input_seat_capabilities) +static Eina_Bool +_test_input_seat_capa_configure_complete(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) { - Ecore_Wl2_Display *disp; + Test_Data *td = data; Ecore_Wl2_Input *input; Eina_Iterator *itr; - disp = _display_connect(); - ck_assert(disp != NULL); - - itr = ecore_wl2_display_inputs_get(disp); + itr = ecore_wl2_display_inputs_get(td->display); ck_assert(itr != NULL); EINA_ITERATOR_FOREACH(itr, input) @@ -145,6 +133,38 @@ EFL_START_TEST(wl2_input_seat_capabilities) } eina_iterator_free(itr); + + ecore_main_loop_quit(); + + return ECORE_CALLBACK_PASS_ON; +} + +EFL_START_TEST(wl2_input_seat_capabilities) +{ + Test_Data *td; + + ecore_wl2_init(); + + td = calloc(1, sizeof(Test_Data)); + td->width = WIDTH; + td->height = HEIGHT; + + td->display = _display_connect(); + ck_assert(td->display != NULL); + + td->win = _window_create(td->display); + ck_assert(td->win != NULL); + + ecore_wl2_window_show(td->win); + + td->handler = ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE_COMPLETE, + _test_input_seat_capa_configure_complete, td); + + ecore_main_loop_begin(); + + ecore_wl2_shutdown(); + free(td); + } EFL_END_TEST diff --git a/src/tests/ecore_wl2/ecore_wl2_test_window.c b/src/tests/ecore_wl2/ecore_wl2_test_window.c index 67cf50af74..b166b4ba4e 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_window.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_window.c @@ -1,52 +1,9 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <stdio.h> -#include <unistd.h> -#include <Eina.h> -#include <Ecore.h> -#include <Ecore_Wl2.h> -#include <wayland-egl.h> - -#ifdef GL_GLES -#include <EGL/egl.h> -#include <GLES2/gl2.h> -#endif - #include "ecore_wl2_suite.h" #include "ecore_wl2_tests_helpers.h" -#define WIDTH 480 -#define HEIGHT 360 - -typedef struct _Test_Data -{ - Ecore_Wl2_Display *display; - Ecore_Wl2_Window *win; - Ecore_Wl2_Frame_Cb_Handle *frame_callback_handler; - Ecore_Event_Handler *handler; - - struct wl_surface *surface; - struct wl_egl_window *egl_window; - - int width; - int height; - int frame_callback_count; - #ifdef GL_GLES - EGLDisplay egl_display; - EGLConfig egl_conf; - EGLSurface egl_surface; - EGLContext egl_context; +#include "ecore_wl2_tests_helper_egl.h" #endif -} Test_Data; - -static Ecore_Wl2_Window * -_window_create(Ecore_Wl2_Display *disp) -{ - return ecore_wl2_window_new(disp, NULL, 100, 100, WIDTH, HEIGHT); -} static struct wl_surface * _surface_get(Ecore_Wl2_Window *win) @@ -54,42 +11,6 @@ _surface_get(Ecore_Wl2_Window *win) return ecore_wl2_window_surface_get(win); } -#ifdef GL_GLES -static void -_init_egl(Test_Data *td) -{ - eglBindAPI(EGL_OPENGL_API); - EGLint num_config; - - EGLint attributes[] = { - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_NONE - }; - - td->egl_display = eglGetDisplay((EGLNativeDisplayType)ecore_wl2_display_get(td->display)); - eglInitialize(td->egl_display, NULL, NULL); - eglChooseConfig(td->egl_display, attributes, &td->egl_conf, 1, &num_config); - td->egl_context = eglCreateContext(td->egl_display, td->egl_conf, EGL_NO_CONTEXT, NULL); - - td->egl_window = wl_egl_window_create(td->surface, td->width, td->height); - td->egl_surface = eglCreateWindowSurface(td->egl_display, - td->egl_conf, td->egl_window, NULL); - - eglMakeCurrent(td->egl_display, td->egl_surface, td->egl_surface, td->egl_context); -} - -static void -_term_egl(Test_Data *td) -{ - eglDestroySurface(td->egl_display, td->egl_surface); - wl_egl_window_destroy(td->egl_window); - eglDestroyContext(td->egl_display, td->egl_context); - eglTerminate(td->egl_display); -} -#endif - EFL_START_TEST(wl2_window_new) { Ecore_Wl2_Display *disp; diff --git a/src/tests/ecore_wl2/ecore_wl2_tests_helper_egl.h b/src/tests/ecore_wl2/ecore_wl2_tests_helper_egl.h new file mode 100644 index 0000000000..03da269c38 --- /dev/null +++ b/src/tests/ecore_wl2/ecore_wl2_tests_helper_egl.h @@ -0,0 +1,42 @@ +#ifndef ECORE_WL2_TEST_HELPER_EGL_H +# define ECORE_WL2_TEST_HELPER_EGL_H + +#include <wayland-egl.h> +#include <EGL/egl.h> +#include <GLES2/gl2.h> + +static void +_init_egl(Test_Data *td) +{ + eglBindAPI(EGL_OPENGL_API); + EGLint num_config; + + EGLint attributes[] = { + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_NONE + }; + + td->egl_display = eglGetDisplay((EGLNativeDisplayType)ecore_wl2_display_get(td->display)); + eglInitialize(td->egl_display, NULL, NULL); + eglChooseConfig(td->egl_display, attributes, &td->egl_conf, 1, &num_config); + td->egl_context = eglCreateContext(td->egl_display, td->egl_conf, EGL_NO_CONTEXT, NULL); + + td->egl_window = wl_egl_window_create(td->surface, td->width, td->height); + td->egl_surface = eglCreateWindowSurface(td->egl_display, + td->egl_conf, td->egl_window, NULL); + + eglMakeCurrent(td->egl_display, td->egl_surface, td->egl_surface, td->egl_context); +} + +static void +_term_egl(Test_Data *td) +{ + eglDestroySurface(td->egl_display, td->egl_surface); + wl_egl_window_destroy(td->egl_window); + eglDestroyContext(td->egl_display, td->egl_context); + eglTerminate(td->egl_display); +} + +#endif diff --git a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h index 257838f50c..c1fe4657a5 100644 --- a/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h +++ b/src/tests/ecore_wl2/ecore_wl2_tests_helpers.h @@ -1,7 +1,37 @@ #ifndef ECORE_WL2_TEST_HELPERS_H # define ECORE_WL2_TEST_HELPERS_H -# include <Ecore_Wl2.h> +#include <wayland-egl.h> + +#ifdef GL_GLES +#include <EGL/egl.h> +#include <GLES2/gl2.h> +#endif + +#define WIDTH 480 +#define HEIGHT 360 + +typedef struct _Test_Data +{ + Ecore_Wl2_Display *display; + Ecore_Wl2_Window *win; + Ecore_Wl2_Frame_Cb_Handle *frame_callback_handler; + Ecore_Event_Handler *handler; + + struct wl_surface *surface; + struct wl_egl_window *egl_window; + + int width; + int height; + int frame_callback_count; + +#ifdef GL_GLES + EGLDisplay egl_display; + EGLConfig egl_conf; + EGLSurface egl_surface; + EGLContext egl_context; +#endif +} Test_Data; static Ecore_Wl2_Display * _display_connect(void) @@ -9,4 +39,10 @@ _display_connect(void) return ecore_wl2_display_connect(NULL); } +static Ecore_Wl2_Window * +_window_create(Ecore_Wl2_Display *disp) +{ + return ecore_wl2_window_new(disp, NULL, 100, 100, WIDTH, HEIGHT); +} + #endif diff --git a/src/tests/ecore_wl2/meson.build b/src/tests/ecore_wl2/meson.build index 2491b6d631..0e2445ee62 100644 --- a/src/tests/ecore_wl2/meson.build +++ b/src/tests/ecore_wl2/meson.build @@ -11,6 +11,7 @@ ecore_wl2_suite_src = [ wl2_test_gl_deps = [] if get_option('opengl') == 'es-egl' + ecore_wl2_suite_src += 'ecore_wl2_tests_helper_egl.h' wl2_test_gl_deps += dependency('egl') wl2_test_gl_deps += dependency('gl') endif diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs index 7c580480ad..70e9d29c16 100644 --- a/src/tests/efl_mono/Eo.cs +++ b/src/tests/efl_mono/Eo.cs @@ -407,7 +407,7 @@ class TestCsharpProperties var obj = new Dummy.TestObject(); int val = -1984; - obj.SetterOnly = val; + obj.SetSetterOnly(val); Test.AssertEquals(val, obj.GetSetterOnly()); obj.Dispose(); } diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs index 5f8cc0fa52..c10c37911e 100644 --- a/src/tests/efl_mono/Events.cs +++ b/src/tests/efl_mono/Events.cs @@ -320,7 +320,7 @@ class TestEventWithDeadWrappers EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb) { var obj = new Dummy.TestObject(); - manager.Emitter = obj; + manager.SetEmitter(obj); obj.EvtWithIntEvent += cb; return new WeakReference(obj); diff --git a/src/tests/elementary/efl_ui_test_text.c b/src/tests/elementary/efl_ui_test_text.c index b7886544f1..a49c7e7cc9 100644 --- a/src/tests/elementary/efl_ui_test_text.c +++ b/src/tests/elementary/efl_ui_test_text.c @@ -72,45 +72,6 @@ EFL_START_TEST(text_all_select_all_unselect) ecore_main_loop_iterate(); ck_assert_int_eq(i_have_selection, 2); ck_assert_int_eq(i_selection, 1); - - /*Partial select, the select all*/ - Eo *sel1, *sel2; - i_selection = 0; - efl_text_interactive_selection_cursors_get(txt, &sel1, &sel2); - efl_text_cursor_position_set(sel1, 1); - efl_text_cursor_position_set(sel2, 2); - ck_assert_int_eq(i_selection, 2); - efl_text_interactive_all_select(txt); - ck_assert_int_eq(i_selection, 3); - ck_assert_int_eq(efl_text_cursor_position_get(sel1), 0); - ck_assert_int_eq(efl_text_cursor_position_get(sel2), 5); - - Eo *cur1 = efl_ui_textbox_cursor_create(txt); - Eo *cur2 = efl_ui_textbox_cursor_create(txt); - efl_text_cursor_position_set(cur1, 1); - efl_text_cursor_position_set(cur2, 2); - efl_text_interactive_selection_cursors_set(txt, cur1, cur2); - ck_assert_int_eq(i_selection, 4); - efl_text_interactive_selection_cursors_get(txt, &sel1, &sel2); - ck_assert_int_eq(efl_text_cursor_position_get(sel1),1); - ck_assert_int_eq(efl_text_cursor_position_get(sel2),2); - - - /*Select part then select all*/ - efl_text_interactive_all_unselect(txt); - i_have_selection = 0, i_selection = 0; - efl_text_cursor_position_set(cur1, 1); - efl_text_cursor_position_set(cur2, 2); - efl_text_interactive_selection_cursors_set(txt, cur1, cur2); - ck_assert_int_eq(i_selection, 1); - ck_assert_int_eq(i_have_selection, 1); - efl_text_interactive_all_select(txt); - ck_assert_int_eq(i_selection, 2); - ck_assert_int_eq(i_have_selection, 1); - efl_text_interactive_all_unselect(txt); - ck_assert_int_eq(i_have_selection, 2); - - efl_del(txt); efl_del(win); } |