diff --git a/.travis.yml b/.travis.yml index 1af79309c3..9da669513d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,7 +95,7 @@ before_script: if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" != "" ]]; then docker pull stefanschmidt1/ci-support-files:$DISTRO docker version - docker run --cidfile $HOME/cid -t -d -v `pwd`:/src -v $HOME/.ccache:/root/.ccache -w /src stefanschmidt1/ci-support-files:$DISTRO bash + docker run --cap-add SYS_PTRACE --cidfile $HOME/cid -t -d -v `pwd`:/src -v $HOME/.ccache:/root/.ccache -w /src stefanschmidt1/ci-support-files:$DISTRO bash fi - | if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$DISTRO" == "" ]]; then diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 0631a5fe6d..484708287c 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -917,6 +917,20 @@ EAPI void ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha); */ EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); +/** + * Get the opaque region of the Ecore_Wl2_Window + * + * @param win The window + * @param x The left point of the region. + * @param y The top point of the region. + * @param w The width of the region. + * @param h The height of the region. + * + * @ingroup Ecore_Wl2_Window_Group + * @since 1.24 + */ +EAPI void ecore_wl2_window_opaque_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h); + /** * Set the input region of the Ecore_Wl2_Window. * @@ -935,6 +949,20 @@ EAPI void ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, in */ EAPI void ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); +/** + * Get the input region of the Ecore_Wl2_Window. + * + * @param window The window to set the input region of + * @param x The left point of the region. + * @param y The top point of the region. + * @param w The width of the region. + * @param h The height of the region. + * + * @ingroup Ecore_Wl2_Window_Group + * @since 1.24 + */ +EAPI void ecore_wl2_window_input_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h); + /** * Get if a given window is maximized * @@ -1087,17 +1115,6 @@ EAPI void ecore_wl2_window_geometry_get(Ecore_Wl2_Window *window, int *x, int *y */ EAPI void ecore_wl2_window_geometry_set(Ecore_Wl2_Window *window, int x, int y, int w, int h); -/** - * Iconify a window - * - * @param win The window to iconifiy - * @param iconified The new iconified state to set - * - * @ingroup Ecore_Wl2_Window_Group - * @since 1.17 - */ -EAPI void ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified); - /** * Set the type of a given window * @@ -1300,6 +1317,18 @@ EAPI Eina_Bool ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window); */ EAPI void ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input); +/** + * @brief Get the seat for a popup window to be used with grab + * + * @param window The window + * + * @return Returns Ecore_Wl2_Input if the window has an input. + * + * @ingroup Ecore_Wl2_Window_Group + * @since 1.24 + */ +EAPI Ecore_Wl2_Input *ecore_wl2_window_popup_input_get(Ecore_Wl2_Window *window); + /** * Check if a window has a shell surface - without one it can't be visible. * @@ -1495,19 +1524,6 @@ EAPI Eina_Stringshare *ecore_wl2_input_name_get(Ecore_Wl2_Input *input); */ EAPI Eina_Bool ecore_wl2_input_keyboard_repeat_get(const Ecore_Wl2_Input *input, double *rate, double *delay); -/** - * Get the Evas_Device for the seat belonging to a window from an input - * - * @param input The input - * @param window The window - * - * @return The device object - * - * @ingroup Ecore_Wl2_Input_Group - * @since 1.20 - */ -EAPI Eo *ecore_wl2_input_seat_device_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Window *window); - /** * Retrieves the mouse position of the seat * @@ -2003,20 +2019,6 @@ EAPI void ecore_wl2_session_recovery_disable(void); */ EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush); -/** - * Check if a wayland window's surface is in the pending state. - * - * A surface is pending if it's been commit but we haven't received a - * frame callback for it yet. This mean's we're not ready to draw yet. - * - * @param window The window whose surface we want to check - * - * @return whether the window's surface is pending or not. - * - * @since 1.21 - */ -EAPI Eina_Bool ecore_wl2_window_pending_get(Ecore_Wl2_Window *window); - /** * Add a callback that fires when the window's surface_frame callback fires * diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 67a2dcba80..6694f3687d 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -1824,17 +1824,6 @@ ecore_wl2_input_keyboard_repeat_get(const Ecore_Wl2_Input *input, double *rate, return input->repeat.enabled; } -EAPI Eo * -ecore_wl2_input_seat_device_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Window *window) -{ - Ecore_Wl2_Input_Devices *devices; - EINA_SAFETY_ON_NULL_RETURN_VAL(input, NULL); - EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL); - - devices = _ecore_wl2_devices_get(input, window); - return devices ? devices->seat_dev : NULL; -} - EAPI void ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y) { diff --git a/src/lib/ecore_wl2/ecore_wl2_internal.h b/src/lib/ecore_wl2/ecore_wl2_internal.h index 2b6a965b10..cda98d6459 100644 --- a/src/lib/ecore_wl2/ecore_wl2_internal.h +++ b/src/lib/ecore_wl2/ecore_wl2_internal.h @@ -100,6 +100,31 @@ EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, void *buffer, in */ EAPI void ecore_wl2_window_buffer_transform_set(Ecore_Wl2_Window *window, int transform); +/** + * Iconify a window + * + * @param win The window to iconifiy + * @param iconified The new iconified state to set + * + * @ingroup Ecore_Wl2_Window_Group + * @since 1.17 + */ +EAPI void ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified); + +/** + * Check if a wayland window's surface is in the pending state. + * + * A surface is pending if it's been commit but we haven't received a + * frame callback for it yet. This mean's we're not ready to draw yet. + * + * @param window The window whose surface we want to check + * + * @return whether the window's surface is pending or not. + * + * @since 1.21 + */ +EAPI Eina_Bool ecore_wl2_window_pending_get(Ecore_Wl2_Window *window); + # undef EAPI # define EAPI diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 0085354d11..f596a7a9de 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -844,6 +844,17 @@ ecore_wl2_window_opaque_region_set(Ecore_Wl2_Window *window, int x, int y, int w window->pending.opaque = EINA_TRUE; } +EAPI void +ecore_wl2_window_opaque_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h) +{ + EINA_SAFETY_ON_NULL_RETURN(window); + + if (x) *x = window->opaque.x; + if (y) *y = window->opaque.y; + if (w) *w = window->opaque.w; + if (h) *h = window->opaque.h; +} + EAPI void ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, int h) { @@ -893,6 +904,17 @@ ecore_wl2_window_input_region_set(Ecore_Wl2_Window *window, int x, int y, int w, window->pending.input = EINA_TRUE; } +EAPI void +ecore_wl2_window_input_region_get(Ecore_Wl2_Window *window, int *x, int *y, int *w, int *h) +{ + EINA_SAFETY_ON_NULL_RETURN(window); + + if (x) *x = window->input_rect.x; + if (y) *y = window->input_rect.y; + if (w) *w = window->input_rect.w; + if (h) *h = window->input_rect.h; +} + EAPI Eina_Bool ecore_wl2_window_maximized_get(Ecore_Wl2_Window *window) { @@ -1117,6 +1139,14 @@ ecore_wl2_window_popup_input_set(Ecore_Wl2_Window *window, Ecore_Wl2_Input *inpu window->grab = input; } +EAPI Ecore_Wl2_Input * +ecore_wl2_window_popup_input_get(Ecore_Wl2_Window *window) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL); + + return window->grab; +} + EAPI Ecore_Wl2_Display * ecore_wl2_window_display_get(const Ecore_Wl2_Window *window) { diff --git a/src/lib/efl/interfaces/efl_text_format.eo b/src/lib/efl/interfaces/efl_text_format.eo index 5c974a675e..03a44295a5 100644 --- a/src/lib/efl/interfaces/efl_text_format.eo +++ b/src/lib/efl/interfaces/efl_text_format.eo @@ -9,10 +9,10 @@ enum @beta Efl.Text_Format_Wrap { } enum @beta Efl.Text_Format_Horizontal_Alignment_Auto_Type { - [[Auto-horizontal alignment of the text.]] - none, [[No auto-alignment rule.]] - normal, [[Respects LTR/RTL (bidirectional) settings.]] - locale, [[Respects locale's language settings.]] + [[Auto-horizontal alignment setting for the text (Left-To-Right or Right-To-Left).]] + none, [[No auto-alignment rule: Horizontal Alignment is decided by @Efl.Text_Format.text_horizontal_align]] + auto, [[Respects LTR/RTL (bidirectional) characters found inside the text content.]] + locale, [[Respects the system's language settings.]] end [[Text is placed at opposite side of LTR/RTL (bidirectional) settings.]] } @@ -55,7 +55,7 @@ interface @beta Efl.Text_Format { } @property text_horizontal_align_auto_type { - [[Horizontal alignment of text.]] + [[Specifies when the text's horizontal alignment should be set automatically.]] values { value: Efl.Text_Format_Horizontal_Alignment_Auto_Type; [[Alignment type.]] } @@ -63,7 +63,12 @@ interface @beta Efl.Text_Format { @property text_horizontal_align { [[Horizontal alignment of text. $[0.0] means "left" - and $[1.0] means "right".]] + and $[1.0] means "right". + Setting this value also sets @.text_horizontal_align_auto_type to + @Efl.Text_Format_Horizontal_Alignment_Auto_Type.none. + This value is ignored when @.text_horizontal_align_auto_type is set to anything other than + @Efl.Text_Format_Horizontal_Alignment_Auto_Type.none. + ]] values { value: double; [[Alignment value between $[0.0] and $[1.0].]] } diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 1dcad334c6..93c7a4b5d5 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -16773,7 +16773,7 @@ _efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_set(Eo *ob { _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NONE); } - else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NORMAL) + else if (type == EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_AUTO) { _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL); } @@ -16795,7 +16795,7 @@ _efl_canvas_textblock_efl_text_format_text_horizontal_align_auto_type_get(const if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL) { - ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_NORMAL; + ret = EFL_TEXT_FORMAT_HORIZONTAL_ALIGNMENT_AUTO_TYPE_AUTO; } else if (_FMT(halign_auto) == EVAS_TEXTBLOCK_ALIGN_AUTO_END) { diff --git a/src/tests/ecore_wl2/ecore_wl2_test_display.c b/src/tests/ecore_wl2/ecore_wl2_test_display.c index 99b441b433..2f77d2705f 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_display.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_display.c @@ -177,6 +177,19 @@ EFL_START_TEST(wl2_display_compositor_version_get) } EFL_END_TEST +EFL_START_TEST(wl2_display_input_find_by_name) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Input *input; + + disp = _display_connect(); + ck_assert(disp != NULL); + + input = ecore_wl2_display_input_find_by_name(disp, "default"); + ck_assert(input != NULL); +} +EFL_END_TEST + void ecore_wl2_test_display(TCase *tc) { @@ -202,5 +215,6 @@ ecore_wl2_test_display(TCase *tc) 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); } } diff --git a/src/tests/ecore_wl2/ecore_wl2_test_input.c b/src/tests/ecore_wl2/ecore_wl2_test_input.c index 73056a77fa..98b9e9758e 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_input.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_input.c @@ -102,7 +102,9 @@ EFL_START_TEST(wl2_input_keymap_get) EINA_ITERATOR_FOREACH(itr, input) { - ck_assert(ecore_wl2_input_keymap_get(input) != NULL); + if (ecore_wl2_input_seat_capabilities_get(input) == + ECORE_WL2_SEAT_CAPABILITIES_KEYBOARD) + ck_assert(ecore_wl2_input_keymap_get(input) != NULL); } eina_iterator_free(itr); @@ -130,6 +132,30 @@ EFL_START_TEST(wl2_input_name_get) } EFL_END_TEST +EFL_START_TEST(wl2_input_seat_capabilities) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Input *input; + Eina_Iterator *itr; + + disp = _display_connect(); + ck_assert(disp != NULL); + + itr = ecore_wl2_display_inputs_get(disp); + ck_assert(itr != NULL); + + EINA_ITERATOR_FOREACH(itr, input) + { + Ecore_Wl2_Seat_Capabilities cap = ECORE_WL2_SEAT_CAPABILITIES_NONE; + + cap = ecore_wl2_input_seat_capabilities_get(input); + ck_assert(cap != ECORE_WL2_SEAT_CAPABILITIES_NONE); + } + + eina_iterator_free(itr); +} +EFL_END_TEST + void ecore_wl2_test_input(TCase *tc) { @@ -140,5 +166,6 @@ ecore_wl2_test_input(TCase *tc) tcase_add_test(tc, wl2_input_display_get); tcase_add_test(tc, wl2_input_keymap_get); tcase_add_test(tc, wl2_input_name_get); + tcase_add_test(tc, wl2_input_seat_capabilities); } } diff --git a/src/tests/ecore_wl2/ecore_wl2_test_window.c b/src/tests/ecore_wl2/ecore_wl2_test_window.c index bb329195ef..611b36768c 100644 --- a/src/tests/ecore_wl2/ecore_wl2_test_window.c +++ b/src/tests/ecore_wl2/ecore_wl2_test_window.c @@ -10,6 +10,9 @@ #include "ecore_wl2_suite.h" +#define WIDTH 480 +#define HEIGHT 360 + static Ecore_Wl2_Display * _display_connect(void) { @@ -22,10 +25,13 @@ _display_connect(void) static Ecore_Wl2_Window * _window_create(Ecore_Wl2_Display *disp) { - Ecore_Wl2_Window *win; + return ecore_wl2_window_new(disp, NULL, 100, 100, WIDTH, HEIGHT); +} - win = ecore_wl2_window_new(disp, NULL, 100, 100, 500, 500); - return win; +static struct wl_surface * +_surface_get(Ecore_Wl2_Window *win) +{ + return ecore_wl2_window_surface_get(win); } EFL_START_TEST(wl2_window_new) @@ -329,24 +335,6 @@ EFL_START_TEST(wl2_window_type) } EFL_END_TEST -EFL_START_TEST(wl2_window_activated) -{ - Ecore_Wl2_Display *disp; - Ecore_Wl2_Window *win; - Eina_Bool ret; - - disp = _display_connect(); - ck_assert(disp != NULL); - - win = _window_create(disp); - ck_assert(win != NULL); - - ret = ecore_wl2_window_activated_get(win); - - fail_if(ret != EINA_TRUE); -} -EFL_END_TEST - EFL_START_TEST(wl2_window_aspect) { Ecore_Wl2_Display *disp; @@ -454,6 +442,83 @@ EFL_START_TEST(wl2_window_role) } EFL_END_TEST +EFL_START_TEST(wl2_window_input_region) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Window *win; + int x, y, w, h; + + disp = _display_connect(); + ck_assert(disp != NULL); + + win = _window_create(disp); + ck_assert(win != NULL); + + ecore_wl2_window_input_region_set(win, 10, 10, 100, 100); + + ecore_wl2_window_input_region_get(win, &x, &y, &w, &h); + fail_if(x != 10); + fail_if(y != 10); + fail_if(w != 100); + fail_if(h != 100); +} +EFL_END_TEST + +EFL_START_TEST(wl2_window_opaque_region) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Window *win; + int x, y, w, h; + + disp = _display_connect(); + ck_assert(disp != NULL); + + win = _window_create(disp); + ck_assert(win != NULL); + + ecore_wl2_window_opaque_region_set(win, 10, 10, 100, 100); + + ecore_wl2_window_opaque_region_get(win, &x, &y, &w, &h); + fail_if(x != 10); + fail_if(y != 10); + fail_if(w != 100); + fail_if(h != 100); +} +EFL_END_TEST + +EFL_START_TEST(wl2_window_popup_input) +{ + Ecore_Wl2_Display *disp; + Ecore_Wl2_Window *win; + Ecore_Wl2_Input *input; + Eina_Iterator *itr; + + disp = _display_connect(); + ck_assert(disp != NULL); + + win = _window_create(disp); + ck_assert(win != NULL); + + ecore_wl2_window_type_set(win, ECORE_WL2_WINDOW_TYPE_MENU); + + itr = ecore_wl2_display_inputs_get(disp); + ck_assert(itr != NULL); + + EINA_ITERATOR_FOREACH(itr, input) + { + if (ecore_wl2_input_seat_capabilities_get(input) != + ECORE_WL2_SEAT_CAPABILITIES_POINTER) + continue; + + ecore_wl2_window_popup_input_set(win, input); + fail_if(ecore_wl2_window_popup_input_get(win) != input); + break; + } + + eina_iterator_free(itr); +} +EFL_END_TEST + void ecore_wl2_test_window(TCase *tc) { @@ -477,11 +542,13 @@ ecore_wl2_test_window(TCase *tc) tcase_add_test(tc, wl2_wm_window_rotation_app); tcase_add_test(tc, wl2_window_geometry); tcase_add_test(tc, wl2_window_type); - tcase_add_test(tc, wl2_window_activated); tcase_add_test(tc, wl2_window_available_rotation); tcase_add_test(tc, wl2_window_aspect); tcase_add_test(tc, wl2_window_class); tcase_add_test(tc, wl2_window_title); tcase_add_test(tc, wl2_window_role); + tcase_add_test(tc, wl2_window_input_region); + tcase_add_test(tc, wl2_window_opaque_region); + tcase_add_test(tc, wl2_window_popup_input); } }