From 149042a3baa0c6df7c5ea8b0f549d465a5fb6975 Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Wed, 11 Mar 2020 12:37:47 +0100 Subject: [PATCH 01/36] evas_textblock: replace evil tabs with spaces Reviewers: devilhorns, ali.alzyod Reviewed By: devilhorns Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11482 --- src/lib/evas/canvas/evas_object_textblock.c | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index c8c7e12f92..b52f97cf01 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -557,24 +557,24 @@ static void evas_object_textblock_render(Evas_Object *eo_obj, int x, int y, Eina_Bool do_async); static void evas_object_textblock_free(Evas_Object *eo_obj); static void evas_object_textblock_render_pre(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static void evas_object_textblock_render_post(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static Evas_Object_Textblock_Node_Text *_evas_textblock_node_text_new(void); static void *evas_object_textblock_engine_data_get(Evas_Object *eo_obj); static int evas_object_textblock_is_opaque(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static int evas_object_textblock_was_opaque(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static void _canvas_text_format_changed(Eo *eo_obj, Efl_Canvas_Textblock_Data *o); static const Evas_Object_Func object_func = @@ -6350,7 +6350,7 @@ _layout_handle_ellipsis(Ctxt *c, Evas_Object_Textblock_Item *it, Eina_List *i) /* Don't do much for the meanwhile. */ static inline void _layout_paragraph_render(Efl_Canvas_Textblock_Data *o, - Evas_Object_Textblock_Paragraph *par) + Evas_Object_Textblock_Paragraph *par) { if (par->rendered) return; @@ -14504,7 +14504,7 @@ evas_object_textblock_init(Evas_Object *eo_obj) linebreak_init = EINA_TRUE; init_linebreak(); init_wordbreak(); - init_graphemebreak(); + init_graphemebreak(); } o = obj->private_data; @@ -15762,8 +15762,8 @@ evas_object_textblock_coords_recalc(Evas_Object *eo_obj, static void evas_object_textblock_render_pre(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data) + Evas_Object_Protected_Data *obj, + void *type_private_data) { Efl_Canvas_Textblock_Data *o = type_private_data; ASYNC_BLOCK; From 190cf149599465620b8d5b2fef5643ba8ab3268e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 11 Mar 2020 09:37:42 -0400 Subject: [PATCH 02/36] efl_ui/layout: skip versioning checks for legacy widgets Summary: legacy widgets are always stable fix T8630 Reviewers: eagleeye Reviewed By: eagleeye Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8630 Differential Revision: https://phab.enlightenment.org/D11481 --- src/lib/elementary/efl_ui_layout.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 8569735005..cc1f8e93a0 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -576,6 +576,7 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) Eina_Error theme_apply_ret, theme_apply_internal_ret; Elm_Widget_Smart_Data *wd = NULL; char buf[64]; + Eina_Bool legacy; static unsigned int version = 0; sd->needs_theme_apply = EINA_FALSE; @@ -591,9 +592,10 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) (theme_apply_internal_ret == EFL_UI_THEME_APPLY_ERROR_DEFAULT)) return EFL_UI_THEME_APPLY_ERROR_DEFAULT; + legacy = elm_widget_is_legacy(obj); /* unset existing size hints to force accurate recalc */ efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(0, 0)); - if (elm_widget_is_legacy(obj)) + if (legacy) efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(0, 0)); else { @@ -623,6 +625,7 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd) } if (sd->deferred_signals) _deferred_signals_emit(sd); + if (legacy) return EFL_UI_THEME_APPLY_ERROR_NONE; if (!version) { From f4164bbcb8ab18f053ee40fe5f5e4fc02a4e058f Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Thu, 12 Mar 2020 14:43:37 +0900 Subject: [PATCH 03/36] edje_util: Prevent null pointer access Summary: locale can be null. so add null check. Test Plan: N/A Reviewers: Hermet, kimcinoo, herb Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11490 --- src/lib/edje/edje_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 67b458495d..a8071531e1 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -326,6 +326,7 @@ edje_language_set(const char *locale) char *loc; int length; + if (!locale) return; lookup = strstr(locale, "."); length = lookup ? lookup - locale : (int)strlen(locale); loc = alloca(length + 1); From 06e9af1b0cee7194bf6dc848b195caed1295847e Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Thu, 12 Mar 2020 20:07:12 +0900 Subject: [PATCH 04/36] edje_textblock: style font size override size_range max Summary: style font size (also text_class) will change size_range max value, regardless of what user specifed in textblock description Reviewers: woohyun Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11493 --- src/lib/edje/edje_textblock.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c index d0c5c6d30d..fe3ec439fb 100644 --- a/src/lib/edje/edje_textblock.c +++ b/src/lib/edje/edje_textblock.c @@ -493,6 +493,20 @@ _edje_part_textblock_style_text_set(Edje *ed, return EINA_FALSE; } +static char* +strrstr(const char* haystack, const char* violate) +{ + char *s_ret = NULL; + char *tmp = NULL; + const char *_haystack = haystack; + size_t len = strlen(violate); + while((tmp = strstr(_haystack, violate))){ + s_ret = tmp; + _haystack = tmp + len; + } + return s_ret; +} + void _edje_part_recalc_single_textblock(FLOAT_T sc, Edje *ed, @@ -522,11 +536,21 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, size_t size_array_len = 0; Eina_List *l; unsigned int *value; + Evas_Textblock_Style *st = _edje_textblock_style_get(ed, chosen_desc->text.style.str); + const char *text_style = evas_textblock_style_get(st); + char *s_font_size = (text_style) ? strrstr(text_style,"font_size=") : NULL; + if (s_font_size) + { + int font_size = strtol(&s_font_size[10], NULL, 10); + chosen_desc->text.size_range_max = font_size; + if (chosen_desc->text.size_range_min > chosen_desc->text.size_range_max) + chosen_desc->text.size_range_min = chosen_desc->text.size_range_max; + } EINA_LIST_FOREACH(chosen_desc->text.fit_size_array, l, value) { size_array[size_array_len++] = *value; } - unsigned int mode = TEXTBLOCK_FIT_MODE_NONE; + unsigned int mode = TEXTBLOCK_FIT_MODE_NONE; if (chosen_desc->text.fit_x) mode |= TEXTBLOCK_FIT_MODE_WIDTH; From f257401a4f7a3c6ee922bbf7cc311793b5345b1d Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 12 Mar 2020 20:39:12 +0900 Subject: [PATCH 05/36] canvas proxy: fix a missing case that proxy not updated properly. Very complex to say, if its source object is remained as chaged state in pending object in rendering stage, the proxy object could miss to update in the next frame because source object won't be changed again in evas_object_change(). Thus we need to double-check if the proxy missed update or not just in the rendering. Not clean but this is a compromised solution to not be burden for finding/checking proxies in object trees every time. @fix --- src/lib/evas/canvas/evas_render.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 3d478a429b..53179ec5bc 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -379,6 +379,9 @@ _evas_proxy_redraw_set(Evas_Public_Data *e, Evas_Object_Protected_Data *obj, if (render) { + /* Not good... but make it sure if the proxies have missed at update + if its sources are remained changed as pending objects in the prev frame. */ + evas_object_change(eo_proxy, proxy); proxy->func->render_pre(eo_proxy, proxy, proxy->private_data); _evas_render_prev_cur_clip_cache_add(e, proxy); } From b319f15c99fdb9947d73b5abfb04a0fa155dd367 Mon Sep 17 00:00:00 2001 From: Woochanlee Date: Thu, 12 Mar 2020 09:09:34 -0400 Subject: [PATCH 06/36] efl_gesture_manager: Fix incorrect override system config value. Summary: The glayer_tap_finger_size can get diffrent value on each profile. Need to get system config value and will set it for gesture manager. Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11485 --- src/lib/evas/gesture/efl_canvas_gesture_manager.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c index a05794fd91..48f515471c 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c @@ -3,7 +3,6 @@ #include "efl_canvas_gesture_private.h" #define MY_CLASS EFL_CANVAS_GESTURE_MANAGER_CLASS -#define EFL_GESTURE_RECOGNIZER_TYPE_TAP_FINGER_SIZE 10 typedef struct _Object_Gesture { @@ -150,7 +149,6 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M /* this needs to always be present */ config = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); - efl_config_int_set(config, "glayer_tap_finger_size", EFL_GESTURE_RECOGNIZER_TYPE_TAP_FINGER_SIZE); efl_event_callback_add(config, EFL_CONFIG_EVENT_CONFIG_CHANGED, _gesture_manager_config_changed, pd); //Register all types of recognizers at very first time. @@ -162,7 +160,7 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_FLICK_CLASS, obj)); efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ROTATE_CLASS, obj)); efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ZOOM_CLASS, obj)); - _update_finger_sizes(pd, EFL_GESTURE_RECOGNIZER_TYPE_TAP_FINGER_SIZE); + _update_finger_sizes(pd, efl_config_int_get(config, "glayer_tap_finger_size")); return obj; } From b98f8bdbe4296f902708d90db2bd2604219db34e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 12 Mar 2020 13:13:35 +0000 Subject: [PATCH 07/36] edje_cc - provide better error info log on part id out of range --- src/bin/edje/edje_cc_out.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index af093b4d08..111116c52f 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -744,7 +744,8 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef) if (et->id >= (int) pc->parts_count) { - ERR("Target id '%d' greater than possible index '%d'.", et->id, (int) pc->parts_count - 1); + ERR("In group '%s' program '%s', target id '%d' greater than possible index '%d'.", + pc->part ? pc->part : "", ep->name ? ep->name : "", et->id, (int) pc->parts_count - 1); exit(-1); } From 5c8942bf393f239d9860cb663d1bc6bcbee368e8 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 12 Mar 2020 13:35:50 +0000 Subject: [PATCH 08/36] eina log bt - on by default always if unwind found i'm tried of telling people how to turn this on. enough. on by default. if you dont want bt's and its just some helpful log output then just printf it or use WRN, INF and set log levels... --- src/lib/eina/eina_log.c | 2 +- src/lib/eina/meson.build | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c index 81be34a1b2..7c66ee0b53 100644 --- a/src/lib/eina/eina_log.c +++ b/src/lib/eina/eina_log.c @@ -127,7 +127,7 @@ static int _abort_level_on_critical = EINA_LOG_LEVEL_CRITICAL; # ifndef EINA_LOG_BACKTRACE_ENABLE static int _backtrace_level = -1; # else -static int _backtrace_level = 1; +static int _backtrace_level = EINA_LOG_LEVEL_ERR; # endif #endif diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build index d3d30fcf43..003dc6b3b4 100644 --- a/src/lib/eina/meson.build +++ b/src/lib/eina/meson.build @@ -357,6 +357,7 @@ unwind = dependency('libunwind-generic', required: false) if unwind.found() config_h.set('HAVE_UNWIND', 1) eina_deps += unwind + config_h.set('EINA_LOG_BACKTRACE_ENABLE', 1) endif #for the case that the iconv library is not part of libc but rather libiconv or smth. like that From f8299e054234d73ba27b0bf7a6a07120279c92f1 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 3 Mar 2020 17:03:41 +0100 Subject: [PATCH 09/36] exactness: factor out _printf() handling into common part First step to do some re-factoring of the exactness binaries. We will share common parts from the different binaries in common.{c,h} to reduce the code duplication. The start makes _printf() used in various places. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D11456 --- src/bin/exactness/common.c | 14 ++++++++ src/bin/exactness/common.h | 9 +++++ src/bin/exactness/exactness.c | 14 ++------ src/bin/exactness/injector.c | 42 +++++++++------------- src/bin/exactness/inspect.c | 2 ++ src/bin/exactness/meson.build | 16 +++++---- src/bin/exactness/player.c | 66 +++++++++++++++-------------------- src/bin/exactness/recorder.c | 28 +++++---------- 8 files changed, 90 insertions(+), 101 deletions(-) create mode 100644 src/bin/exactness/common.c create mode 100644 src/bin/exactness/common.h diff --git a/src/bin/exactness/common.c b/src/bin/exactness/common.c new file mode 100644 index 0000000000..17983cdbc6 --- /dev/null +++ b/src/bin/exactness/common.c @@ -0,0 +1,14 @@ +#include "common.h" + +static int _verbose = 0; + +void +ex_printf(int verbose, const char *fmt, ...) +{ + va_list ap; + if (!_verbose || verbose > _verbose) return; + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); +} diff --git a/src/bin/exactness/common.h b/src/bin/exactness/common.h new file mode 100644 index 0000000000..1f84d80db7 --- /dev/null +++ b/src/bin/exactness/common.h @@ -0,0 +1,9 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +void ex_printf(int verbose, const char *fmt, ...); diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index 9214236045..ebcae7f4a1 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -8,6 +8,7 @@ #include #include "exactness_private.h" +#include "common.h" #ifdef _WIN32 # include /* mkdir */ @@ -52,17 +53,6 @@ static Eina_List *_compare_errors; static Eina_Bool _job_consume(); -static void -_printf(int verbose, const char *fmt, ...) -{ - va_list ap; - if (!_verbose || verbose > _verbose) return; - - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); -} - static Exactness_Image * _image_load(const char *filename) { @@ -283,7 +273,7 @@ ok: } strncpy(buf, eina_strbuf_string_get(sbuf), SCHEDULER_CMD_SIZE-1); eina_strbuf_free(sbuf); - _printf(1, "Command: %s\n", buf); + ex_printf(1, "Command: %s\n", buf); return EINA_TRUE; } diff --git a/src/bin/exactness/injector.c b/src/bin/exactness/injector.c index d2b29d014b..882752620d 100644 --- a/src/bin/exactness/injector.c +++ b/src/bin/exactness/injector.c @@ -14,6 +14,7 @@ #include #include +#include "common.h" typedef struct { @@ -134,17 +135,6 @@ EINA_DEBUG_OPCODES_ARRAY_DEFINE(_debug_ops, {NULL, NULL, NULL} ); -static void -_printf(int verbose, const char *fmt, ...) -{ - va_list ap; - if (!_verbose || verbose > _verbose) return; - - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); -} - static void _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) { @@ -152,15 +142,15 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) { case EXACTNESS_ACTION_MOUSE_IN: { - _printf(1, "Mouse in\n"); - _printf(2, "%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas); + ex_printf(1, "Mouse in\n"); + ex_printf(2, "%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas); eina_debug_session_send(_session, _cid, _mouse_in_op, &n_evas, sizeof(int)); break; } case EXACTNESS_ACTION_MOUSE_OUT: { - _printf(1, "Mouse out\n"); - _printf(2, "%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas); + ex_printf(1, "Mouse out\n"); + ex_printf(2, "%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas); eina_debug_session_send(_session, _cid, _mouse_out_op, &n_evas, sizeof(int)); break; } @@ -169,8 +159,8 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) Exactness_Action_Mouse_Wheel *t = data; int len = 3*sizeof(int); char *buf = malloc(len), *tmp = buf; - _printf(1, "Mouse wheel\n"); - _printf(2, "%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas); + ex_printf(1, "Mouse wheel\n"); + ex_printf(2, "%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas); STORE_INT(tmp, n_evas); STORE_INT(tmp, t->direction); STORE_INT(tmp, t->z); @@ -184,7 +174,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) Exactness_Action_Multi_Event *t = data; int len = 5*sizeof(int)+7*sizeof(double)+sizeof(int); char *buf = malloc(len), *tmp = buf; - _printf(2, "%s %s n_evas=<%d>\n", __func__, + ex_printf(2, "%s %s n_evas=<%d>\n", __func__, type == EXACTNESS_ACTION_MULTI_DOWN ? "evas_event_feed_multi_down" : "evas_event_feed_multi_up", n_evas); STORE_INT(tmp, n_evas); @@ -211,7 +201,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) Exactness_Action_Multi_Move *t = data; int len = 4*sizeof(int)+7*sizeof(double); char *buf = malloc(len), *tmp = buf; - _printf(2, "%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas); STORE_INT(tmp, n_evas); STORE_INT(tmp, t->d); STORE_INT(tmp, t->x); @@ -237,7 +227,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) len += t->string ? strlen(t->string) : 0; len += t->compose ? strlen(t->compose) : 0; char *buf = malloc(len), *tmp = buf; - _printf(2, "%s %s n_evas=<%d>\n", __func__, + ex_printf(2, "%s %s n_evas=<%d>\n", __func__, type == EXACTNESS_ACTION_KEY_DOWN ? "evas_event_feed_key_down " : "evas_event_feed_key_up", n_evas); STORE_INT(tmp, n_evas); @@ -254,7 +244,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) } case EXACTNESS_ACTION_TAKE_SHOT: { - _printf(2, "%s take shot n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s take shot n_evas=<%d>\n", __func__, n_evas); eina_debug_session_send(_session, _cid, _take_shot_op, &n_evas, sizeof(int)); break; } @@ -265,7 +255,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) len += t->wdg_name ? strlen(t->wdg_name) : 0; len += t->event_name ? strlen(t->event_name) : 0; char *buf = malloc(len), *tmp = buf; - _printf(2, "%s %s\n", __func__, "EFL event"); + ex_printf(2, "%s %s\n", __func__, "EFL event"); STORE_STRING(tmp, t->wdg_name); STORE_STRING(tmp, t->event_name); eina_debug_session_send(_session, _cid, _efl_event_op, buf, len); @@ -278,7 +268,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) int len = 0; len += t->wdg_name ? strlen(t->wdg_name) : 0; char *buf = malloc(len), *tmp = buf; - _printf(2, "%s %s\n", __func__, "Click On"); + ex_printf(2, "%s %s\n", __func__, "Click On"); STORE_STRING(tmp, t->wdg_name); eina_debug_session_send(_session, _cid, _click_on_op, buf, len); free(buf); @@ -286,7 +276,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) } case EXACTNESS_ACTION_STABILIZE: { - _printf(2, "%s stabilize\n", __func__); + ex_printf(2, "%s stabilize\n", __func__); eina_debug_session_send(_session, _cid, _stabilize_op, NULL, 0); break; } @@ -321,7 +311,7 @@ _src_open() { double diff_time = 0; /* Time to wait before feeding the first event */ - _printf(2, "<%s> Source file is <%s>\n", __func__, _src_filename); + ex_printf(2, "<%s> Source file is <%s>\n", __func__, _src_filename); if (!strcmp(_src_filename + strlen(_src_filename) - 4,".exu")) { _src_unit = exactness_unit_file_read(_src_filename); @@ -336,7 +326,7 @@ _src_open() if (act->delay_ms) { - _printf(2, " Waiting <%f>\n", diff_time); + ex_printf(2, " Waiting <%f>\n", diff_time); ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); } else diff --git a/src/bin/exactness/inspect.c b/src/bin/exactness/inspect.c index a04a5217df..384cda81b6 100644 --- a/src/bin/exactness/inspect.c +++ b/src/bin/exactness/inspect.c @@ -9,6 +9,8 @@ #include #include +#include "common.h" + #define LDIFF(x) ""#x"" #define RDIFF(x) ""#x"" diff --git a/src/bin/exactness/meson.build b/src/bin/exactness/meson.build index b01c77de1e..f835cd40ea 100644 --- a/src/bin/exactness/meson.build +++ b/src/bin/exactness/meson.build @@ -1,18 +1,21 @@ exactness_bin = executable('exactness', - [ 'exactness.c' ], - dependencies: [ ecore, ecore_evas, ecore_file, exactness ], + [ 'exactness.c', 'common.c', 'common.h' ], + dependencies: [ ecore, ecore_evas, ecore_file, elementary, exactness ], + c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', install: true, ) exactness_inject_bin = executable('exactness_inject', - [ 'injector.c' ], + [ 'injector.c', 'common.c', 'common.h' ], dependencies: [ elementary, exactness ], + c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', install: true, ) exactness_inspect_bin = executable('exactness_inspect', - [ 'inspect.c' ], + [ 'inspect.c', 'common.c', 'common.h' ], dependencies: [ elementary, exactness ], + c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', install: true, ) @@ -28,15 +31,16 @@ edjs = custom_target('player_entry', depends : edje_depends) exactness_play_bin = executable('exactness_play', - [ 'player.c', edjs ], + [ 'player.c', 'common.c', 'common.h', edjs ], dependencies: [ elementary, exactness ], c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', install: true, ) exactness_record_bin = executable('exactness_record', - [ 'recorder.c' ], + [ 'recorder.c', 'common.c', 'common.h' ], dependencies: [ elementary, exactness ], + c_args: '-DDATA_DIR="'+join_paths(dir_data, 'exactness')+'"', install: true, ) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 260d433b46..9e5629aa5b 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -30,6 +30,7 @@ #include #include "exactness_private.h" +#include "common.h" #define PATH_ 1024 #define CMD_LINE_MAX 256 @@ -152,17 +153,6 @@ static Eina_Bool _exit_required = EINA_FALSE; static Eina_Bool _pause_request = EINA_FALSE; static Eina_Bool _playing_status = EINA_FALSE; -static void -_printf(int verbose, const char *fmt, ...) -{ - va_list ap; - if (!_verbose || verbose > _verbose) return; - - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); -} - static Exactness_Image * _snapshot_shot_get(Evas *e) { @@ -226,7 +216,7 @@ _evas_render_post_cb(void *data EINA_UNUSED, const Efl_Event *event) Eo *o = evas_object_image_add(event->object); evas_object_image_size_set(o, ex_shot->w, ex_shot->h); evas_object_image_data_set(o, ex_shot->pixels); - _printf(1, "Shot taken (%s).\n", filename); + ex_printf(1, "Shot taken (%s).\n", filename); if (!evas_object_image_save(o, filename, NULL, NULL)) { printf("Cannot save widget to <%s>\n", filename); @@ -238,7 +228,7 @@ _evas_render_post_cb(void *data EINA_UNUSED, const Efl_Event *event) Exactness_Image *ex_img = e_data; memcpy(ex_img, ex_shot, sizeof(Exactness_Image)); ex_shot->pixels = NULL; - _printf(1, "Shot taken (in %s).\n", _dest); + ex_printf(1, "Shot taken (in %s).\n", _dest); } else if (_dest_type == FTYPE_REMOTE) { @@ -369,23 +359,23 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) { case EXACTNESS_ACTION_MOUSE_IN: { - _printf(1, "Mouse in\n"); - _printf(2, "%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas); + ex_printf(1, "Mouse in\n"); + ex_printf(2, "%s evas_event_feed_mouse_in n_evas=<%d>\n", __func__, n_evas); if (e) evas_event_feed_mouse_in(e, time(NULL), NULL); break; } case EXACTNESS_ACTION_MOUSE_OUT: { - _printf(1, "Mouse out\n"); - _printf(2, "%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas); + ex_printf(1, "Mouse out\n"); + ex_printf(2, "%s evas_event_feed_mouse_out n_evas=<%d>\n", __func__, n_evas); if (e) evas_event_feed_mouse_out(e, time(NULL), NULL); break; } case EXACTNESS_ACTION_MOUSE_WHEEL: { Exactness_Action_Mouse_Wheel *t = data; - _printf(1, "Mouse wheel\n"); - _printf(2, "%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas); + ex_printf(1, "Mouse wheel\n"); + ex_printf(2, "%s evas_event_feed_mouse_wheel n_evas=<%d>\n", __func__, n_evas); if (e) evas_event_feed_mouse_wheel(e, t->direction, t->z, time(NULL), NULL); break; @@ -393,7 +383,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) case EXACTNESS_ACTION_MULTI_DOWN: { Exactness_Action_Multi_Event *t = data; - _printf(2, "%s evas_event_feed_multi_down n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s evas_event_feed_multi_down n_evas=<%d>\n", __func__, n_evas); if (!t->d) { if (e) evas_event_feed_mouse_down(e, t->b, t->flags, time(NULL), NULL); @@ -412,7 +402,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) case EXACTNESS_ACTION_MULTI_UP: { Exactness_Action_Multi_Event *t = data; - _printf(2, "%s evas_event_feed_multi_up n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s evas_event_feed_multi_up n_evas=<%d>\n", __func__, n_evas); if (!t->d) { if (e) evas_event_feed_mouse_up(e, t->b, t->flags, time(NULL), NULL); @@ -431,7 +421,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) case EXACTNESS_ACTION_MULTI_MOVE: { Exactness_Action_Multi_Move *t = data; - _printf(2, "%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s evas_event_feed_multi_move n_evas=<%d>\n", __func__, n_evas); if (!t->d) { if (e) evas_event_feed_mouse_move(e, t->x, t->y, time(NULL), NULL); @@ -454,7 +444,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) case EXACTNESS_ACTION_KEY_DOWN: { Exactness_Action_Key_Down_Up *t = data; - _printf(2, "%s evas_event_feed_key_down n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s evas_event_feed_key_down n_evas=<%d>\n", __func__, n_evas); if (e) evas_event_feed_key_down_with_keycode(e, t->keyname, t->key, t->string, @@ -464,7 +454,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) case EXACTNESS_ACTION_KEY_UP: { Exactness_Action_Key_Down_Up *t = data; - _printf(2, "%s evas_event_feed_key_up n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s evas_event_feed_key_up n_evas=<%d>\n", __func__, n_evas); if (e) evas_event_feed_key_up_with_keycode(e, t->keyname, t->key, t->string, t->compose, time(NULL), NULL, t->keycode); @@ -473,7 +463,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) } case EXACTNESS_ACTION_TAKE_SHOT: { - _printf(2, "%s take shot n_evas=<%d>\n", __func__, n_evas); + ex_printf(2, "%s take shot n_evas=<%d>\n", __func__, n_evas); if (rect) evas_object_color_set(rect, 0, 0, 255, 255); _cur_shot_id++; if (_dest_type != FTYPE_UNKNOWN && e) _shot_do(e); @@ -489,7 +479,7 @@ _feed_event(Exactness_Action_Type type, unsigned int n_evas, void *data) Eo *o = efl_name_find(e, t->wdg_name); if (o) { - _printf(2, "%s EFL event invoke %s on %s\n", + ex_printf(2, "%s EFL event invoke %s on %s\n", __func__, t->event_name, t->wdg_name); Efl_Event_Description d; found = EINA_TRUE; @@ -526,7 +516,7 @@ wdg_found: Exactness_Action_Multi_Event *d_event = calloc(1, sizeof(*d_event)); Exactness_Action *act, *prev_act = eina_list_data_get(_cur_event_list); - _printf(2, "%s click on %s\n", __func__, t->wdg_name); + ex_printf(2, "%s click on %s\n", __func__, t->wdg_name); act = calloc(1, sizeof(*act)); act->type = EXACTNESS_ACTION_MULTI_MOVE; act->delay_ms = 100; @@ -563,7 +553,7 @@ wdg_found: } case EXACTNESS_ACTION_STABILIZE: { - _printf(2, "%s stabilize\n", __func__); + ex_printf(2, "%s stabilize\n", __func__); if (rect) evas_object_color_set(rect, 255, 165, 0, 255); ecore_timer_add(0.1, _stabilization_timer_cb, NULL); break; @@ -591,7 +581,7 @@ _feed_event_timer_cb(void *data EINA_UNUSED) if (act->type != EXACTNESS_ACTION_STABILIZE) { act = eina_list_data_get(_cur_event_list); - _printf(2, " %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0); + ex_printf(2, " %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0); ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); } } @@ -605,7 +595,7 @@ _stabilization_timer_cb(void *data EINA_UNUSED) Evas *e; #define STAB_MAX 5 static int need_more = STAB_MAX; - _printf(2, "Not stable yet!\n"); + ex_printf(2, "Not stable yet!\n"); EINA_LIST_FOREACH(_evas_list, itr, e) { if (!e) continue; @@ -629,7 +619,7 @@ _stabilization_timer_cb(void *data EINA_UNUSED) if (_src_type != FTYPE_REMOTE && !_pause_request) { Exactness_Action *act = eina_list_data_get(_cur_event_list); - _printf(2, " %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0); + ex_printf(2, " %s timer_time=<%f>\n", __func__, act->delay_ms / 1000.0); ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); } need_more = STAB_MAX; @@ -836,7 +826,7 @@ _src_feed(void *data EINA_UNUSED) if (act && act->delay_ms) { - _printf(2, " Waiting <%f>\n", act->delay_ms / 1000.0); + ex_printf(2, " Waiting <%f>\n", act->delay_ms / 1000.0); ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL); } else @@ -853,7 +843,7 @@ _src_open() { Eina_List *itr, *itr2; Exactness_Action *act; - _printf(2, "<%s> Source file is <%s>\n", __func__, _src_filename); + ex_printf(2, "<%s> Source file is <%s>\n", __func__, _src_filename); if (_src_type == FTYPE_EXU) { _src_unit = exactness_unit_file_read(_src_filename); @@ -1035,10 +1025,10 @@ _event_key_cb(void *data EINA_UNUSED, const Efl_Event *event) if (!strcmp(key, PAUSE_KEY_STR) && efl_input_key_pressed_get(evk)) { _pause_request = !_pause_request; - if (_pause_request) _printf(1, "Pausing scenario\n"); + if (_pause_request) ex_printf(1, "Pausing scenario\n"); else { - _printf(1, "Playing scenario\n"); + ex_printf(1, "Playing scenario\n"); if (!_playing_status) _feed_event_timer_cb(NULL); } @@ -1060,7 +1050,7 @@ _my_evas_new(int w EINA_UNUSED, int h EINA_UNUSED) e = _evas_new(); if (e) { - _printf(1, "New Evas\n"); + ex_printf(1, "New Evas\n"); _evas_list = eina_list_append(_evas_list, e); efl_event_callback_array_add(e, _evas_callbacks(), NULL); } @@ -1297,9 +1287,9 @@ int main(int argc, char **argv) { argv[i - opt_args] = argv[0] + (argv[i] - argv[opt_args]); } - _printf(1, "%s ", argv[i - opt_args]); + ex_printf(1, "%s ", argv[i - opt_args]); } - _printf(1, "\n"); + ex_printf(1, "\n"); } else { diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index 59a4d3106e..812ef737e7 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -23,6 +23,7 @@ #include #include +#include "common.h" #define MAX_PATH 1024 #define STABILIZE_KEY_STR "F1" @@ -42,17 +43,6 @@ static Exactness_Unit *_unit = NULL; static char *_shot_key = NULL; static unsigned int _last_timestamp = 0.0; -static void -_printf(int verbose, const char *fmt, ...) -{ - va_list ap; - if (!_verbose || verbose > _verbose) return; - - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); -} - static Exactness_Action_Type _event_pointer_type_get(Efl_Pointer_Action t) { @@ -87,7 +77,7 @@ _add_to_list(Exactness_Action_Type type, unsigned int n_evas, unsigned int times prev_v->n_evas == n_evas && (!len || !memcmp(prev_v->data, data, len))) return; } - _printf(1, "Recording %s\n", _exactness_action_type_to_string_get(type)); + ex_printf(1, "Recording %s\n", _exactness_action_type_to_string_get(type)); Exactness_Action *act = malloc(sizeof(*act)); act->type = type; act->n_evas = n_evas; @@ -122,7 +112,7 @@ _event_pointer_cb(void *data, const Efl_Event *event) if (!timestamp) return; - _printf(2, "Calling \"%s\" timestamp=<%u>\n", _exactness_action_type_to_string_get(evt), timestamp); + ex_printf(2, "Calling \"%s\" timestamp=<%u>\n", _exactness_action_type_to_string_get(evt), timestamp); switch (action) { @@ -182,20 +172,20 @@ _event_key_cb(void *data, const Efl_Event *event) { if (!strcmp(key, _shot_key)) { - _printf(2, "Take Screenshot: %s timestamp=<%u>\n", __func__, timestamp); + ex_printf(2, "Take Screenshot: %s timestamp=<%u>\n", __func__, timestamp); _add_to_list(EXACTNESS_ACTION_TAKE_SHOT, n_evas, timestamp, NULL, 0); return; } if (!strcmp(key, STABILIZE_KEY_STR)) { - _printf(2, "Stabilize: %s timestamp=<%u>\n", __func__, timestamp); + ex_printf(2, "Stabilize: %s timestamp=<%u>\n", __func__, timestamp); _add_to_list(EXACTNESS_ACTION_STABILIZE, n_evas, timestamp, NULL, 0); return; } if (!strcmp(key, SAVE_KEY_STR)) { _output_write(); - _printf(2, "Save events: %s timestamp=<%u>\n", __func__, timestamp); + ex_printf(2, "Save events: %s timestamp=<%u>\n", __func__, timestamp); return; } evt = EXACTNESS_ACTION_KEY_DOWN; @@ -239,7 +229,7 @@ _my_evas_new(int w EINA_UNUSED, int h EINA_UNUSED) e = _evas_new(); if (e) { - _printf(1, "New Evas\n"); + ex_printf(1, "New Evas\n"); _evas_list = eina_list_append(_evas_list, e); efl_key_data_set(e, "__evas_id", (void *)(intptr_t)_last_evas_id++); efl_event_callback_array_add(e, _event_pointer_callbacks(), e); @@ -502,9 +492,9 @@ int main(int argc, char **argv) { argv[i - opt_args] = argv[0] + (argv[i] - argv[opt_args]); } - _printf(1, "%s ", argv[i - opt_args]); + ex_printf(1, "%s ", argv[i - opt_args]); } - _printf(1, "\n"); + ex_printf(1, "\n"); if (!_shot_key) _shot_key = getenv("SHOT_KEY"); if (!_shot_key) _shot_key = SHOT_KEY_STR; From 525113650d7551f57d1b7e2006fbb071232b0f5f Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 3 Mar 2020 17:36:15 +0100 Subject: [PATCH 10/36] exactness: hamonize use of PATH_MAX as maximal path length allowed There have been to many different defines for this in exactness. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D11457 --- src/bin/exactness/exactness.c | 26 ++++++++++++-------------- src/bin/exactness/player.c | 5 ++--- src/bin/exactness/recorder.c | 5 ++--- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/bin/exactness/exactness.c b/src/bin/exactness/exactness.c index ebcae7f4a1..c594b28a60 100644 --- a/src/bin/exactness/exactness.c +++ b/src/bin/exactness/exactness.c @@ -19,8 +19,6 @@ #define ORIG_SUBDIR "orig" #define CURRENT_SUBDIR "current" -#define EXACTNESS_PATH_MAX 1024 - #define BUF_SIZE 1024 typedef struct @@ -144,7 +142,7 @@ _exu_imgs_unpack(const char *exu_path, const char *dir, const char *ent_name) { Eo *o = evas_object_image_add(e); char *filename = alloca(strlen(dir) + strlen(ent_name) + 20); - snprintf(filename, EXACTNESS_PATH_MAX, "%s/%s%c%.3d.png", + snprintf(filename, PATH_MAX, "%s/%s%c%.3d.png", dir, ent_name, SHOT_DELIMITER, n++); evas_object_image_size_set(o, img->w, img->h); evas_object_image_data_set(o, img->pixels); @@ -161,7 +159,7 @@ _exu_imgs_unpack(const char *exu_path, const char *dir, const char *ent_name) static void _run_test_compare(const List_Entry *ent) { - char *path = alloca(EXACTNESS_PATH_MAX); + char *path = alloca(PATH_MAX); char *origdir = alloca(strlen(_dest_dir) + 20); const char *base_dir; Eina_List *itr; @@ -218,7 +216,7 @@ found: static Eina_Bool _run_command_prepare(const List_Entry *ent, char *buf) { - char scn_path[EXACTNESS_PATH_MAX]; + char scn_path[PATH_MAX]; Eina_Strbuf *sbuf; const char *base_dir; Eina_List *itr; @@ -464,7 +462,7 @@ main(int argc, char *argv[]) const char *list_file; Eina_List *itr; const char *base_dir; - char tmp[EXACTNESS_PATH_MAX]; + char tmp[PATH_MAX]; Eina_Bool mode_play = EINA_FALSE, mode_init = EINA_FALSE, mode_simulation = EINA_FALSE; Eina_Bool want_quit = EINA_FALSE, scan_objs = EINA_FALSE; Ecore_Getopt_Value values[] = { @@ -548,8 +546,8 @@ main(int argc, char *argv[]) if (mode_play) { _mode = RUN_PLAY; - if (snprintf(tmp, EXACTNESS_PATH_MAX, "%s/%s", _dest_dir, CURRENT_SUBDIR) - >= EXACTNESS_PATH_MAX) + if (snprintf(tmp, PATH_MAX, "%s/%s", _dest_dir, CURRENT_SUBDIR) + >= PATH_MAX) { fprintf(stderr, "Path too long: %s", tmp); ret = 1; @@ -565,8 +563,8 @@ main(int argc, char *argv[]) else if (mode_init) { _mode = RUN_INIT; - if (snprintf(tmp, EXACTNESS_PATH_MAX, "%s/%s", _dest_dir, ORIG_SUBDIR) - >= EXACTNESS_PATH_MAX) + if (snprintf(tmp, PATH_MAX, "%s/%s", _dest_dir, ORIG_SUBDIR) + >= PATH_MAX) { fprintf(stderr, "Path too long: %s", tmp); ret = 1; @@ -614,9 +612,9 @@ main(int argc, char *argv[]) if (_errors || _compare_errors) { FILE *report_file; - char report_filename[EXACTNESS_PATH_MAX] = ""; + char report_filename[PATH_MAX] = ""; /* Generate the filename. */ - snprintf(report_filename, EXACTNESS_PATH_MAX, + snprintf(report_filename, PATH_MAX, "%s/%s/errors.html", _dest_dir, mode_init ? ORIG_SUBDIR : CURRENT_SUBDIR); report_file = fopen(report_filename, "w+"); @@ -650,8 +648,8 @@ main(int argc, char *argv[]) EINA_LIST_FREE(_compare_errors, test_name) { Eina_Bool is_from_exu; - char origpath[EXACTNESS_PATH_MAX]; - snprintf(origpath, EXACTNESS_PATH_MAX, "%s/%s/orig/%s", + char origpath[PATH_MAX]; + snprintf(origpath, PATH_MAX, "%s/%s/orig/%s", _dest_dir, CURRENT_SUBDIR, test_name); is_from_exu = ecore_file_exists(origpath); printf("\t* %s\n", test_name); diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 9e5629aa5b..b11a843205 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -32,7 +32,6 @@ #include "exactness_private.h" #include "common.h" -#define PATH_ 1024 #define CMD_LINE_MAX 256 #define IMAGE_FILENAME_EXT ".png" #define PAUSE_KEY_STR "F2" @@ -941,7 +940,7 @@ _prg_invoke(const char *full_path, int argc, char **argv) static Eina_Stringshare * _prg_full_path_guess(const char *prg) { - char full_path[PATH_]; + char full_path[PATH_MAX]; if (strchr(prg, '/')) return eina_stringshare_add(prg); char *env_path = eina_strdup(getenv("PATH")); Eina_Stringshare *ret = NULL; @@ -1232,7 +1231,7 @@ int main(int argc, char **argv) if (!show_on_screen) setenv("ELM_ENGINE", "buffer", 1); if (_src_unit && _src_unit->fonts_path) { - char buf[PATH_]; + char buf[PATH_MAX]; if (!fonts_dir) fonts_dir = "./fonts"; sprintf(buf, "%s/%s", fonts_dir, _src_unit->fonts_path); if (!ecore_file_exists(buf)) diff --git a/src/bin/exactness/recorder.c b/src/bin/exactness/recorder.c index 812ef737e7..f8eefe591e 100644 --- a/src/bin/exactness/recorder.c +++ b/src/bin/exactness/recorder.c @@ -25,7 +25,6 @@ #include #include "common.h" -#define MAX_PATH 1024 #define STABILIZE_KEY_STR "F1" #define SHOT_KEY_STR "F2" #define SAVE_KEY_STR "F3" @@ -293,7 +292,7 @@ _prg_invoke(const char *full_path, int argc, char **argv) static Eina_Stringshare * _prg_full_path_guess(const char *prg) { - char full_path[MAX_PATH]; + char full_path[PATH_MAX]; if (strchr(prg, '/')) return eina_stringshare_add(prg); char *env_path = eina_strdup(getenv("PATH")); Eina_Stringshare *ret = NULL; @@ -483,7 +482,7 @@ int main(int argc, char **argv) /* Replace the current command line to hide the Exactness part */ int len = argv[argc - 1] + strlen(argv[argc - 1]) - argv[opt_args]; memcpy(argv[0], argv[opt_args], len); - memset(argv[0] + len, 0, MAX_PATH - len); + memset(argv[0] + len, 0, PATH_MAX - len); int i; for (i = opt_args; i < argc; i++) From b69bc02c022955c00243cbcdd1b97276fb470190 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Mon, 9 Mar 2020 17:25:03 +0100 Subject: [PATCH 11/36] exactness: factor out duplicated code for debug session handling No need to have these macros ducplicated in two file, we can just share them and reduce maintenance. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D11459 --- src/bin/exactness/common.h | 91 ++++++++++++++++++++++++++++++++++++ src/bin/exactness/injector.c | 75 ----------------------------- src/bin/exactness/player.c | 76 ------------------------------ 3 files changed, 91 insertions(+), 151 deletions(-) diff --git a/src/bin/exactness/common.h b/src/bin/exactness/common.h index 1f84d80db7..2581c63392 100644 --- a/src/bin/exactness/common.h +++ b/src/bin/exactness/common.h @@ -6,4 +6,95 @@ #include #include +typedef struct +{ + Eina_Debug_Session *session; + int srcid; + void *buffer; + unsigned int size; +} _Main_Loop_Info; + +#define WRAPPER_TO_XFER_MAIN_LOOP(foo) \ +static void \ +_intern_main_loop ## foo(void *data) \ +{ \ + _Main_Loop_Info *info = data; \ + _main_loop ## foo(info->session, info->srcid, info->buffer, info->size); \ + free(info->buffer); \ + free(info); \ +} \ +static Eina_Bool \ +foo(Eina_Debug_Session *session, int srcid, void *buffer, int size) \ +{ \ + _Main_Loop_Info *info = calloc(1, sizeof(*info)); \ + info->session = session; \ + info->srcid = srcid; \ + info->size = size; \ + if (info->size) \ + { \ + info->buffer = malloc(info->size); \ + memcpy(info->buffer, buffer, info->size); \ + } \ + ecore_main_loop_thread_safe_call_async(_intern_main_loop ## foo, info); \ + return EINA_TRUE; \ +} + +#ifndef WORDS_BIGENDIAN +#define SWAP_64(x) x +#define SWAP_32(x) x +#define SWAP_16(x) x +#define SWAP_DBL(x) x +#else +#define SWAP_64(x) eina_swap64(x) +#define SWAP_32(x) eina_swap32(x) +#define SWAP_16(x) eina_swap16(x) +#define SWAP_DBL(x) SWAP_64(x) +#endif + +#define EXTRACT_INT(_buf) \ +({ \ + int __i; \ + memcpy(&__i, _buf, sizeof(int)); \ + _buf += sizeof(int); \ + SWAP_32(__i); \ +}) + +#define EXTRACT_DOUBLE(_buf) \ +({ \ + double __d; \ + memcpy(&__d, _buf, sizeof(double)); \ + _buf += sizeof(double); \ + SWAP_DBL(__d); \ +}) + +#define EXTRACT_STRING(_buf) \ +({ \ + char *__s = _buf ? strdup(_buf) : NULL; \ + int __len = (__s ? strlen(__s) : 0) + 1; \ + _buf += __len; \ + __s; \ +}) + +#define STORE_INT(_buf, __i) \ +({ \ + int __si = SWAP_32(__i); \ + memcpy(_buf, &__si, sizeof(int)); \ + _buf += sizeof(int); \ +}) + +#define STORE_DOUBLE(_buf, __d) \ +{ \ + double __d2 = SWAP_DBL(__d); \ + memcpy(_buf, &__d2, sizeof(double)); \ + _buf += sizeof(double); \ +} + +#define STORE_STRING(_buf, __s) \ +{ \ + int __len = (__s ? strlen(__s) : 0) + 1; \ + if (__s) memcpy(_buf, __s, __len); \ + else *_buf = '\0'; \ + _buf += __len; \ +} + void ex_printf(int verbose, const char *fmt, ...); diff --git a/src/bin/exactness/injector.c b/src/bin/exactness/injector.c index 882752620d..928de47a62 100644 --- a/src/bin/exactness/injector.c +++ b/src/bin/exactness/injector.c @@ -16,81 +16,6 @@ #include #include "common.h" -typedef struct -{ - Eina_Debug_Session *session; - int srcid; - void *buffer; - unsigned int size; -} _Main_Loop_Info; - -#define WRAPPER_TO_XFER_MAIN_LOOP(foo) \ -static void \ -_intern_main_loop ## foo(void *data) \ -{ \ - _Main_Loop_Info *info = data; \ - _main_loop ## foo(info->session, info->srcid, info->buffer, info->size); \ - free(info->buffer); \ - free(info); \ -} \ -static Eina_Bool \ -foo(Eina_Debug_Session *session, int srcid, void *buffer, int size) \ -{ \ - _Main_Loop_Info *info = calloc(1, sizeof(*info)); \ - info->session = session; \ - info->srcid = srcid; \ - info->size = size; \ - if (info->size) \ - { \ - info->buffer = malloc(info->size); \ - memcpy(info->buffer, buffer, info->size); \ - } \ - ecore_main_loop_thread_safe_call_async(_intern_main_loop ## foo, info); \ - return EINA_TRUE; \ -} - -#ifndef WORDS_BIGENDIAN -#define SWAP_64(x) x -#define SWAP_32(x) x -#define SWAP_16(x) x -#define SWAP_DBL(x) x -#else -#define SWAP_64(x) eina_swap64(x) -#define SWAP_32(x) eina_swap32(x) -#define SWAP_16(x) eina_swap16(x) -#define SWAP_DBL(x) SWAP_64(x) -#endif - -#define EXTRACT_INT(_buf) \ -({ \ - int __i; \ - memcpy(&__i, _buf, sizeof(int)); \ - _buf += sizeof(int); \ - SWAP_32(__i); \ -}) - -#define STORE_INT(_buf, __i) \ -{ \ - int __i2 = SWAP_32(__i); \ - memcpy(_buf, &__i2, sizeof(int)); \ - _buf += sizeof(int); \ -} - -#define STORE_DOUBLE(_buf, __d) \ -{ \ - double __d2 = SWAP_DBL(__d); \ - memcpy(_buf, &__d2, sizeof(double)); \ - _buf += sizeof(double); \ -} - -#define STORE_STRING(_buf, __s) \ -{ \ - int __len = (__s ? strlen(__s) : 0) + 1; \ - if (__s) memcpy(_buf, __s, __len); \ - else *_buf = '\0'; \ - _buf += __len; \ -} - static Eina_Stringshare *_src_filename = NULL; static Exactness_Unit *_src_unit = NULL; static int _verbose = 0; diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index b11a843205..fa9f0c63d3 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -36,82 +36,6 @@ #define IMAGE_FILENAME_EXT ".png" #define PAUSE_KEY_STR "F2" -typedef struct -{ - Eina_Debug_Session *session; - int srcid; - void *buffer; - unsigned int size; -} _Main_Loop_Info; - -#define WRAPPER_TO_XFER_MAIN_LOOP(foo) \ -static void \ -_intern_main_loop ## foo(void *data) \ -{ \ - _Main_Loop_Info *info = data; \ - _main_loop ## foo(info->session, info->srcid, info->buffer, info->size); \ - free(info->buffer); \ - free(info); \ -} \ -static Eina_Bool \ -foo(Eina_Debug_Session *session, int srcid, void *buffer, int size) \ -{ \ - _Main_Loop_Info *info = calloc(1, sizeof(*info)); \ - info->session = session; \ - info->srcid = srcid; \ - info->size = size; \ - if (info->size) \ - { \ - info->buffer = malloc(info->size); \ - memcpy(info->buffer, buffer, info->size); \ - } \ - ecore_main_loop_thread_safe_call_async(_intern_main_loop ## foo, info); \ - return EINA_TRUE; \ -} - -#ifndef WORDS_BIGENDIAN -#define SWAP_64(x) x -#define SWAP_32(x) x -#define SWAP_16(x) x -#define SWAP_DBL(x) x -#else -#define SWAP_64(x) eina_swap64(x) -#define SWAP_32(x) eina_swap32(x) -#define SWAP_16(x) eina_swap16(x) -#define SWAP_DBL(x) SWAP_64(x) -#endif - -#define EXTRACT_INT(_buf) \ -({ \ - int __i; \ - memcpy(&__i, _buf, sizeof(int)); \ - _buf += sizeof(int); \ - SWAP_32(__i); \ -}) - -#define EXTRACT_DOUBLE(_buf) \ -({ \ - double __d; \ - memcpy(&__d, _buf, sizeof(double)); \ - _buf += sizeof(double); \ - SWAP_DBL(__d); \ -}) - -#define EXTRACT_STRING(_buf) \ -({ \ - char *__s = _buf ? strdup(_buf) : NULL; \ - int __len = (__s ? strlen(__s) : 0) + 1; \ - _buf += __len; \ - __s; \ -}) - -#define STORE_INT(_buf, __i) \ -({ \ - int __si = SWAP_32(__i); \ - memcpy(_buf, &__si, sizeof(int)); \ - _buf += sizeof(int); \ -}) - typedef enum { FTYPE_UNKNOWN, From 798fdfbc70a8160d7ec89a5829c01a0fccb40dd9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:20 -0400 Subject: [PATCH 12/36] efl/exe: add 'pid' property Reviewers: bu5hm4n, segfaultxavi Reviewed By: bu5hm4n Subscribers: bu5hm4n, vtorri, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11451 --- src/lib/ecore/efl_exe.c | 10 ++++++++++ src/lib/ecore/efl_exe.eo | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index b2c6341523..4580a41351 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -580,6 +580,16 @@ _efl_exe_exit_signal_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) return pd->exit_signal; } +EOLIAN static int +_efl_exe_pid_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) +{ +#ifndef _WIN32 + if (pd->pid != -1) + return pd->pid; +#endif + return 0; +} + EOLIAN static Efl_Object * _efl_exe_efl_object_constructor(Eo *obj, Efl_Exe_Data *pd) { diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo index 23b68935e4..11f6519be3 100644 --- a/src/lib/ecore/efl_exe.eo +++ b/src/lib/ecore/efl_exe.eo @@ -51,6 +51,15 @@ class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Ef sig: int; [[The exit signal, or -1 if no exit signal happened.]] } } + @property pid { + [[The pid of the process, which is only accessible after the object has been finalized. + @since 1.24 + ]] + get { } + values { + pid: int; [[The pid, or 0 on failure.]] + } + } @property env { [[If $env is $NULL then the process created by this object is going to inherit the environment of this process. From e6573154dcb291dc38099fba1055293b1e7b85d7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:27 -0400 Subject: [PATCH 13/36] efl-wl: start conversion to eo Summary: this converts the main efl-wl object to an eo-based canvas group object Depends on D11465 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11454 --- meson.build | 2 +- src/bin/efl_wl/efl_wl_test.c | 13 +- src/bin/efl_wl/efl_wl_test_stack.c | 6 +- src/bin/efl_wl/meson.build | 4 +- src/lib/efl_wl/Efl_Wl.h | 60 ++-- src/lib/efl_wl/efl_wl.c | 442 +++++++++++------------------ src/lib/efl_wl/efl_wl.eo | 99 +++++++ src/lib/efl_wl/meson.build | 37 ++- 8 files changed, 347 insertions(+), 316 deletions(-) create mode 100644 src/lib/efl_wl/efl_wl.eo diff --git a/meson.build b/meson.build index 256256d8a8..6ad434980c 100644 --- a/meson.build +++ b/meson.build @@ -331,7 +331,7 @@ subprojects = [ ['ethumb' ,[] , true, true, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ethumb_client' ,[] , false, true, true, false, false, true, ['eina', 'efl', 'eo', 'ethumb'], []], ['elementary' ,[] , true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']], -['efl_wl' ,['wl'] , false, true, true, false, false, false, ['evas', 'ecore'], []], +['efl_wl' ,['wl'] , false, true, true, false, false, false, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], ['elua' ,['elua'] , false, true, true, false, true, false, ['eina', 'luajit'], []], ['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, ['eina'], []], ['ecore_drm' ,['drm-deprecated'] , false, true, false, false, false, false, ['eina'], []], diff --git a/src/bin/efl_wl/efl_wl_test.c b/src/bin/efl_wl/efl_wl_test.c index bf5b2ad4d1..b9f9f6b450 100644 --- a/src/bin/efl_wl/efl_wl_test.c +++ b/src/bin/efl_wl/efl_wl_test.c @@ -6,13 +6,12 @@ static Evas_Object *win; static Eina_Strbuf *buf; -static Ecore_Exe *exe; +static Eo *exe; -static Eina_Bool -del_handler(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Exe_Event_Del *ev) +static void +del_handler(void *d EINA_UNUSED, const Efl_Event *ev) { - if (ev->exe == exe) ecore_main_loop_quit(); - return ECORE_CALLBACK_RENEW; + if (ev->object == exe) ecore_main_loop_quit(); } static void @@ -25,7 +24,7 @@ static Eina_Bool dostuff(void *data) { exe = efl_wl_run(data, eina_strbuf_string_get(buf)); - ecore_event_handler_add(ECORE_EXE_EVENT_DEL, (Ecore_Event_Handler_Cb)del_handler, NULL); + efl_event_callback_add(exe, EFL_TASK_EVENT_EXIT, del_handler, NULL); evas_object_focus_set(data, 1); return EINA_FALSE; } @@ -63,7 +62,7 @@ main(int argc, char *argv[]) elm_win_autodel_set(win, 1); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); - o = efl_wl_add(evas_object_evas_get(win)); + o = efl_add(EFL_WL_CLASS, win); efl_wl_aspect_set(o, 1); efl_wl_minmax_set(o, 1); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/bin/efl_wl/efl_wl_test_stack.c b/src/bin/efl_wl/efl_wl_test_stack.c index 51cd598984..e6eaa34760 100644 --- a/src/bin/efl_wl/efl_wl_test_stack.c +++ b/src/bin/efl_wl/efl_wl_test_stack.c @@ -26,13 +26,13 @@ dostuff(void *data) static void prev_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - efl_wl_prev(data); + efl_wl_surface_prev(data); } static void next_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - efl_wl_next(data); + efl_wl_surface_next(data); } int @@ -69,7 +69,7 @@ main(int argc, char *argv[]) evas_object_show(next); elm_table_pack(o, next, 1, 0, 1, 1); - comp = efl_wl_add(evas_object_evas_get(win)); + comp = efl_add(EFL_WL_CLASS, win); evas_object_size_hint_min_set(comp, 640, 480); elm_table_pack(o, comp, 0, 1, 2, 1); evas_object_size_hint_align_set(comp, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/bin/efl_wl/meson.build b/src/bin/efl_wl/meson.build index c95cd0e767..dc0f0d248c 100644 --- a/src/bin/efl_wl/meson.build +++ b/src/bin/efl_wl/meson.build @@ -1,13 +1,13 @@ executable('efl_wl_test', 'efl_wl_test.c', include_directories : config_dir, - dependencies: [efl_wl, elementary], + dependencies: [efl_wl, efl_wl_deps, efl_wl_pub_deps, elementary], install: true, ) executable('efl_wl_test_stack', 'efl_wl_test_stack.c', include_directories : config_dir, - dependencies: [efl_wl, elementary], + dependencies: [efl_wl, efl_wl_deps, efl_wl_pub_deps, elementary], install: true, ) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index a866a4ee13..ee36eb74bb 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -1,24 +1,35 @@ -#ifdef EFL_BETA_API_SUPPORT - #ifndef EFL_WL_H # define EFL_WL_H #include -#include +#include #ifdef EAPI # undef EAPI #endif - -#ifdef __GNUC__ -# if __GNUC__ >= 4 -# define EAPI __attribute__ ((visibility("default"))) -# else -# define EAPI -# endif -#else -# define EAPI +#ifdef EAPI_WEAK +# undef EAPI_WEAK #endif +# ifdef __GNUC__ +# if __GNUC__ >= 4 +# define EAPI __attribute__ ((visibility("default"))) +# define EAPI_WEAK +# else +# define EAPI +# define EAPI_WEAK +# endif +# endif + +#define EWAPI EAPI EAPI_WEAK + + +typedef struct Efl_Wl_Wl_Surface Efl_Wl_Wl_Surface; +typedef struct Efl_Wl_Wl_Global Efl_Wl_Wl_Global; +typedef struct Efl_Wl_Wl_Interface Efl_Wl_Wl_Interface; +typedef void * Efl_Wl_Wl_Interface_Data; +typedef void * Efl_Wl_Wl_Interface_Bind_Cb; + +#include /** * @defgroup Efl_Wl_Group EFL Wayland * @@ -27,19 +38,7 @@ * @since 1.20 * @{ */ - -/** - * @typedef Efl_Wl_Rotation - * The rotation to apply to the compositor's internal wl_output - */ -typedef enum -{ - EFL_WL_ROTATION_0, - EFL_WL_ROTATION_90, - EFL_WL_ROTATION_180, - EFL_WL_ROTATION_270 -} Efl_Wl_Rotation; - +#if 0 /** * Add a compositor widget to the given canvas. * @@ -103,7 +102,7 @@ EAPI void efl_wl_pid_del(Evas_Object *obj, int32_t pid); * @param obj The compositor widget * @return EINA_TRUE if the window stacking was changed */ -EAPI Eina_Bool efl_wl_next(Evas_Object *obj); +EAPI Eina_Bool efl_wl_surface_next(Evas_Object *obj); /** * Put the second top-most toplevel window on top and apply focus to it @@ -111,7 +110,7 @@ EAPI Eina_Bool efl_wl_next(Evas_Object *obj); * @param obj The compositor widget * @return EINA_TRUE if the window stacking was changed */ -EAPI Eina_Bool efl_wl_prev(Evas_Object *obj); +EAPI Eina_Bool efl_wl_surface_prev(Evas_Object *obj); /** * Set rotation and flip for the compositor's output @@ -165,7 +164,7 @@ EAPI void efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set); * @since 1.21 */ EAPI void *efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb); - +#endif /** * Extract a child surface from the compositor * @@ -236,6 +235,9 @@ EAPI void efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char * * @since 1.21 */ EAPI void efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay); -#endif +#undef EAPI +#define EAPI +#undef EAPI_WEAK +#define EAPI_WEAK #endif diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 2aef1368ce..defa800066 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -1,3 +1,6 @@ +#define EFL_INTERNAL_UNSTABLE +#define EFL_CANVAS_GROUP_PROTECTED + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -34,7 +37,8 @@ # ifdef HAVE_ECORE_X #include "Ecore_X.h" #endif - +#include "Evas_Internal.h" +#include "canvas/evas_canvas_eo.h" #include "Efl_Wl.h" #undef COORDS_INSIDE @@ -84,6 +88,7 @@ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE | \ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK) +#define MY_CLASS EFL_WL_CLASS typedef struct Input_Sequence { @@ -124,12 +129,11 @@ typedef struct Comp struct wl_display *display; double wayland_time_base; - Evas_Object *obj; - Evas_Object *clip; - Evas_Object *events; + Eo *obj; + Eo *clip; + Eo *events; Eina_Hash *exes; - Ecore_Event_Handler *exe_handler; Eina_Inlist *surfaces; unsigned int surfaces_count; @@ -229,7 +233,7 @@ typedef struct Comp_Seat } cursor; struct { - Evas_Object *obj; + Eo *obj; int layer; int x, y; } efl; @@ -294,9 +298,9 @@ struct Comp_Surface { EINA_INLIST; Comp *c; - Evas_Object *obj; - Evas_Object *clip; - Evas_Object *img; + Eo *obj; + Eo *clip; + Eo *img; Eina_Array *input_rects; Eina_Array *opaque_rects; Eina_List *proxies; @@ -571,12 +575,12 @@ seat_tch_resources_get(Comp_Seat *s, struct wl_client *client) return s->tch.resources ? eina_hash_find(s->tch.resources, &client) : NULL; } -static void comp_render_pre_proxied(Evas_Object *o, Evas *e, void *event_info); +static void comp_render_pre_proxied(Eo *o, Evas *e, void *event_info); static void comp_render_post_proxied(Comp_Surface *cs, Evas *e, void *event_info); -static void comp_surface_commit_image_state(Comp_Surface *cs, Comp_Buffer *buffer, Evas_Object *o); +static void comp_surface_commit_image_state(Comp_Surface *cs, Comp_Buffer *buffer, Eo *o); static void -comp_surface_proxy_del(void *data, Evas *e, Evas_Object *obj, void *event_info EINA_UNUSED) +comp_surface_proxy_del(void *data, Evas *e, Eo *obj, void *event_info EINA_UNUSED) { Comp_Surface *cs = data; int i; @@ -598,7 +602,7 @@ comp_surface_proxy_del(void *data, Evas *e, Evas_Object *obj, void *event_info E } static void -comp_surface_proxy_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +comp_surface_proxy_resize(void *data, Evas *e EINA_UNUSED, Eo *obj, void *event_info EINA_UNUSED) { int w, h; @@ -643,7 +647,7 @@ comp_surface_proxy_win_del(Ecore_Evas *ee) static void seat_drag_proxy_win_add(Comp_Seat *s) { - Evas_Object *o; + Eo *o; if (s->drag.proxy_win) abort(); evas_object_hide(s->drag.surface->obj); @@ -1344,7 +1348,7 @@ comp_surface_buffer_post_render(Comp_Surface *cs) } static void -comp_surface_pixels_get(void *data, Evas_Object *obj) +comp_surface_pixels_get(void *data, Eo *obj) { Comp_Surface *cs = data; Comp_Buffer *buffer; @@ -1358,7 +1362,7 @@ comp_surface_pixels_get(void *data, Evas_Object *obj) } static void -comp_surface_commit_image_state(Comp_Surface *cs, Comp_Buffer *buffer, Evas_Object *o) +comp_surface_commit_image_state(Comp_Surface *cs, Comp_Buffer *buffer, Eo *o) { if ((!buffer->renders) || (!eina_list_data_find(buffer->renders, evas_object_evas_get(o)))) buffer->renders = eina_list_append(buffer->renders, evas_object_evas_get(o)); @@ -1410,7 +1414,7 @@ comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state) { int x, y; Eina_List *l; - Evas_Object *o; + Eo *o; Comp_Buffer *buffer = NULL; Eina_Bool newly_new = EINA_FALSE; @@ -1513,7 +1517,7 @@ comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state) { Eina_Iterator *it; Eina_Rectangle *rect; - Evas_Object *r; + Eo *r; it = eina_tiler_iterator_new(state->opaque); cs->opaque_rects = eina_array_new(1); @@ -1550,7 +1554,7 @@ comp_surface_commit_state(Comp_Surface *cs, Comp_Buffer_State *state) { Eina_Iterator *it; Eina_Rectangle *rect; - Evas_Object *r; + Eo *r; array_clear(&cs->input_rects); it = eina_tiler_iterator_new(state->input); @@ -1906,7 +1910,7 @@ comp_surface_impl_destroy(struct wl_resource *resource) if (cs->post_render_queue && (!cs->dead)) { Eina_List *l; - Evas_Object *o; + Eo *o; cs->dead = 1; evas_object_hide(cs->obj); @@ -2017,7 +2021,7 @@ comp_surface_send_pointer_enter(Comp_Surface *cs, Comp_Seat *s, int cx, int cy) } static void -comp_surface_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_mouse_in(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Mouse_In *ev = event_info; Comp_Seat *s; @@ -2071,7 +2075,7 @@ comp_surface_send_pointer_leave(Comp_Surface *cs, Comp_Seat *s) } static void -comp_surface_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_mouse_out(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Mouse_Out *ev = event_info; Comp_Seat *s; @@ -2154,7 +2158,7 @@ comp_surface_mouse_button(Comp_Surface *cs, Comp_Seat *s, uint32_t timestamp, ui } static void -comp_surface_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_mouse_down(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Mouse_Down *ev = event_info; Comp_Seat *s; @@ -2169,7 +2173,7 @@ comp_surface_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U } static void -comp_surface_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_mouse_up(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Mouse_Down *ev = event_info; Comp_Seat *s; @@ -2184,7 +2188,7 @@ comp_surface_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU } static void -comp_surface_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_mouse_move(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Mouse_Move *ev = event_info; Comp_Surface *cs = data; @@ -2229,7 +2233,7 @@ comp_surface_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U } static void -comp_surface_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) +comp_surface_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Eo *obj EINA_UNUSED, void *event) { Evas_Event_Mouse_Wheel *ev = event; Comp_Surface *cs = data; @@ -2262,7 +2266,7 @@ comp_surface_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EI } static void -comp_surface_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_multi_down(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Multi_Down *ev = event_info; Comp_Surface *cs = data; @@ -2296,7 +2300,7 @@ comp_surface_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U } static void -comp_surface_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_multi_up(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Multi_Up *ev = event_info; Comp_Surface *cs = data; @@ -2335,7 +2339,7 @@ comp_surface_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU } static void -comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Evas_Event_Multi_Move *ev = event_info; Comp_Surface *cs = data; @@ -2376,7 +2380,7 @@ comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_U } static void -comp_surface_smart_add(Evas_Object *obj) +comp_surface_smart_add(Eo *obj) { Comp_Surface *cs; Evas *e; @@ -2405,7 +2409,7 @@ comp_surface_smart_add(Evas_Object *obj) } static void -comp_surface_smart_del(Evas_Object *obj) +comp_surface_smart_del(Eo *obj) { Comp_Surface *cs = evas_object_smart_data_get(obj); @@ -2435,10 +2439,10 @@ comp_surface_smart_del(Evas_Object *obj) } static void -comp_surface_smart_move(Evas_Object *obj, int x, int y) +comp_surface_smart_move(Eo *obj, int x, int y) { Eina_List *l; - Evas_Object *o; + Eo *o; int px, py, cx, cy; evas_object_geometry_get(obj, &px, &py, NULL, NULL); @@ -2457,7 +2461,7 @@ comp_surface_smart_move(Evas_Object *obj, int x, int y) } static void -comp_surface_smart_resize(Evas_Object *obj, int w, int h) +comp_surface_smart_resize(Eo *obj, int w, int h) { Comp_Surface *cs = evas_object_smart_data_get(obj); evas_object_resize(cs->clip, w, h); @@ -2467,7 +2471,7 @@ comp_surface_smart_resize(Evas_Object *obj, int w, int h) } static void -comp_surface_smart_show(Evas_Object *obj) +comp_surface_smart_show(Eo *obj) { Comp_Surface *cs = evas_object_smart_data_get(obj); evas_object_show(cs->clip); @@ -2475,7 +2479,7 @@ comp_surface_smart_show(Evas_Object *obj) } static void -comp_surface_smart_hide(Evas_Object *obj) +comp_surface_smart_hide(Eo *obj) { Comp_Surface *pcs = NULL, *lcs, *cs = evas_object_smart_data_get(obj); @@ -2516,28 +2520,28 @@ comp_surface_smart_hide(Evas_Object *obj) } static void -comp_surface_smart_clip_set(Evas_Object *obj, Evas_Object *clip) +comp_surface_smart_clip_set(Eo *obj, Eo *clip) { Comp_Surface *cs = evas_object_smart_data_get(obj); evas_object_clip_set(cs->clip, clip); } static void -comp_surface_smart_clip_unset(Evas_Object *obj) +comp_surface_smart_clip_unset(Eo *obj) { Comp_Surface *cs = evas_object_smart_data_get(obj); evas_object_clip_unset(cs->clip); } static void -comp_surface_smart_member_add(Evas_Object *obj, Evas_Object *child) +comp_surface_smart_member_add(Eo *obj, Eo *child) { Comp_Surface *cs = evas_object_smart_data_get(obj); if (child != cs->clip) evas_object_clip_set(child, cs->clip); } static void -comp_surface_smart_member_del(Evas_Object *obj, Evas_Object *child) +comp_surface_smart_member_del(Eo *obj, Eo *child) { Comp_Surface *cs = evas_object_smart_data_get(obj); if (child != cs->clip) evas_object_clip_unset(child); @@ -2580,7 +2584,7 @@ comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint struct wl_resource *res; Comp_Surface *cs; Comp *c = wl_resource_get_user_data(resource); - Evas_Object *obj; + Eo *obj; int x, y; res = wl_resource_create(client, &wl_surface_interface, wl_resource_get_version(resource), id); @@ -3164,16 +3168,16 @@ output_resize(Comp *c, struct wl_resource *res) int rot[][4] = { { - [EFL_WL_ROTATION_0] = WL_OUTPUT_TRANSFORM_NORMAL, - [EFL_WL_ROTATION_90] = WL_OUTPUT_TRANSFORM_90, - [EFL_WL_ROTATION_180] = WL_OUTPUT_TRANSFORM_180, - [EFL_WL_ROTATION_270] = WL_OUTPUT_TRANSFORM_270, + [EFL_WL_ROTATION_ROTATE_0] = WL_OUTPUT_TRANSFORM_NORMAL, + [EFL_WL_ROTATION_ROTATE_90] = WL_OUTPUT_TRANSFORM_90, + [EFL_WL_ROTATION_ROTATE_180] = WL_OUTPUT_TRANSFORM_180, + [EFL_WL_ROTATION_ROTATE_270] = WL_OUTPUT_TRANSFORM_270, }, { - [EFL_WL_ROTATION_0] = WL_OUTPUT_TRANSFORM_FLIPPED, - [EFL_WL_ROTATION_90] = WL_OUTPUT_TRANSFORM_FLIPPED_90, - [EFL_WL_ROTATION_180] = WL_OUTPUT_TRANSFORM_FLIPPED_180, - [EFL_WL_ROTATION_270] = WL_OUTPUT_TRANSFORM_FLIPPED_270, + [EFL_WL_ROTATION_ROTATE_0] = WL_OUTPUT_TRANSFORM_FLIPPED, + [EFL_WL_ROTATION_ROTATE_90] = WL_OUTPUT_TRANSFORM_FLIPPED_90, + [EFL_WL_ROTATION_ROTATE_180] = WL_OUTPUT_TRANSFORM_FLIPPED_180, + [EFL_WL_ROTATION_ROTATE_270] = WL_OUTPUT_TRANSFORM_FLIPPED_270, }, }; @@ -3240,7 +3244,7 @@ shell_surface_toplevel_set_parent(struct wl_client *client EINA_UNUSED, struct w comp_surface_reparent(cs, pcs); if (parent_resource) - evas_object_smart_callback_call(cs->c->obj, "child_added", cs->obj); + efl_event_callback_call(cs->c->obj, EFL_WL_EVENT_CHILD_ADDED, cs->obj); } static void @@ -3334,7 +3338,7 @@ shell_surface_toplevel_create(struct wl_client *client EINA_UNUSED, struct wl_re cs->role = wl_resource_create(client, &xdg_toplevel_interface, 1, id); wl_resource_set_implementation(cs->role, &shell_surface_toplevel_interface, cs, shell_surface_toplevel_impl_destroy); cs->shell.new = 1; - evas_object_smart_callback_call(cs->c->obj, "toplevel_added", cs->obj); + efl_event_callback_call(cs->c->obj, EFL_WL_EVENT_TOPLEVEL_ADDED, cs->obj); } static void @@ -3423,7 +3427,7 @@ shell_surface_popup_create(struct wl_client *client, struct wl_resource *resourc comp_surface_reparent(cs, wl_resource_get_user_data(parent_resource)); cs->shell.positioner = wl_resource_get_user_data(positioner_resource); _apply_positioner(cs, cs->shell.positioner); - evas_object_smart_callback_call(cs->c->obj, "popup_added", cs->obj); + efl_event_callback_call(cs->c->obj, EFL_WL_EVENT_POPUP_ADDED, cs->obj); } static void @@ -3894,7 +3898,7 @@ seat_kbd_create(struct wl_client *client, struct wl_resource *resource, uint32_t } static void -seat_ptr_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +seat_ptr_del(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Comp_Seat *s = data; @@ -4206,7 +4210,7 @@ comp_render_pre(Comp *c, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) if (cs->opaque_rects && (eina_array_count(cs->opaque_rects) == 1)) { - Evas_Object *r = eina_array_data_get(cs->opaque_rects, 0); + Eo *r = eina_array_data_get(cs->opaque_rects, 0); int x, y, w, h, ox, oy, ow, oh; evas_object_geometry_get(cs->img, &x, &y, &w, &h); @@ -4228,7 +4232,7 @@ comp_render_pre(Comp *c, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) } static void -comp_render_pre_proxied(Evas_Object *o, Evas *e, void *event_info) +comp_render_pre_proxied(Eo *o, Evas *e, void *event_info) { Comp_Surface *cs = evas_object_data_get(o, "comp_surface"); Comp_Buffer *buffer = cs->buffer[!cs->render_queue]; @@ -4302,8 +4306,6 @@ comp_render_post(Comp *c, Evas *e, void *event_info EINA_UNUSED) } } -static Evas_Smart *comp_smart = NULL; - static void comp_seat_selection_update(Comp_Seat *s) { @@ -4541,7 +4543,7 @@ comp_seats_proxy(Comp *c) else if (!c->parent_disp) comp_device_caps_update(s); s->global = wl_global_create(c->display, &wl_seat_interface, 4, s, seat_bind); - evas_object_smart_callback_call(s->c->obj, "seat_added", dev); + efl_event_callback_call(s->c->obj, EFL_WL_EVENT_SEAT_ADDED, dev); if (ecore_wl2_display_sync_is_done(c->client_disp)) seat_proxy_update(s); } @@ -5081,7 +5083,7 @@ comp_handlers_init(void) } static void -comp_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +comp_focus_in(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Comp *c = data; //Efl_Input_Focus_Data *ev = event_info; @@ -5128,7 +5130,7 @@ comp_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi } static void -comp_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +comp_focus_out(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Comp *c = data; //Efl_Input_Focus_Data *ev = event_info; @@ -5143,7 +5145,7 @@ comp_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo } static void -comp_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) +comp_mouse_in(void *data, Evas *e, Eo *obj, void *event_info) { Comp *c = data; Evas_Event_Mouse_In *ev = event_info; @@ -5181,7 +5183,7 @@ comp_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) } static void -comp_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_multi_move(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Comp *c = data; Evas_Event_Multi_Move *ev = event_info; @@ -5202,7 +5204,7 @@ comp_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v } static void -comp_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +comp_mouse_move(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info) { Comp *c = data; Evas_Event_Mouse_Move *ev = event_info; @@ -5223,7 +5225,7 @@ comp_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v } static void -comp_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info) +comp_mouse_out(void *data, Evas *e EINA_UNUSED, Eo *obj, void *event_info) { Comp *c = data; Evas_Event_Mouse_Out *ev = event_info; @@ -5337,18 +5339,22 @@ efl_hints_bind(struct wl_client *client, void *data, uint32_t version, uint32_t wl_resource_set_implementation(res, &hints_interface, data, NULL); } - - -static void -comp_smart_add(Evas_Object *obj) +EOLIAN static Eo * +_efl_wl_efl_object_constructor(Eo *obj, Comp *c) +{ + efl_canvas_group_clipped_set(obj, EINA_TRUE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(!ecore_wl2_init(), NULL); + return efl_constructor(efl_super(obj, MY_CLASS)); +} + +EOLIAN static void +_efl_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) { - Comp *c; char *env, *dbg = NULL; - c = calloc(1, sizeof(Comp)); + efl_canvas_group_add(efl_super(obj, MY_CLASS)); c->wayland_time_base = ecore_loop_time_get(); c->obj = obj; - evas_object_smart_data_set(obj, c); env = getenv("WAYLAND_DISPLAY"); if (env) env = strdup(env); @@ -5369,9 +5375,9 @@ comp_smart_add(Evas_Object *obj) else unsetenv("WAYLAND_DISPLAY"); c->display = ecore_wl2_display_get(c->disp); c->client_surfaces = eina_hash_pointer_new(NULL); - c->evas = evas_object_evas_get(obj); - c->clip = evas_object_rectangle_add(c->evas); - evas_object_smart_member_add(c->clip, obj); + c->evas = efl_provider_find(obj, EVAS_CANVAS_CLASS); + c->clip = (Eo*)efl_canvas_group_clipper_get(obj); + efl_gfx_entity_geometry_set(c->clip, efl_gfx_entity_geometry_get(obj)); c->events = evas_object_rectangle_add(c->evas); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_IN, comp_mouse_in, c); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, comp_mouse_move, c); @@ -5429,11 +5435,9 @@ comp_smart_add(Evas_Object *obj) free(env); } -static void -comp_smart_del(Evas_Object *obj) +EOLIAN static void +_efl_wl_efl_canvas_group_group_del(Eo *obj, Comp *c) { - Comp *c = evas_object_smart_data_get(obj); - evas_object_del(c->clip); evas_object_del(c->events); free(c->env); @@ -5461,10 +5465,8 @@ comp_smart_del(Evas_Object *obj) evas_event_callback_del_full(c->evas, EVAS_CALLBACK_RENDER_PRE, (Evas_Event_Cb)comp_render_pre, c); evas_event_callback_del_full(c->evas, EVAS_CALLBACK_RENDER_POST, (Evas_Event_Cb)comp_render_post, c); efl_event_callback_array_del(c->evas, comp_device_cbs(), c); - ecore_event_handler_del(c->exe_handler); eina_hash_free(c->exes); comps = eina_list_remove(comps, c); - free(c); if (!comps) { void *h; @@ -5475,35 +5477,25 @@ comp_smart_del(Evas_Object *obj) #endif } ecore_wl2_shutdown(); + efl_canvas_group_del(efl_super(obj, MY_CLASS)); } static void -comp_smart_move(Evas_Object *obj, int x, int y) +_efl_wl_efl_gfx_entity_position_set(Eo *obj, Comp *c, Eina_Position2D pos) { - Comp_Surface *cs; - Comp *c = evas_object_smart_data_get(obj); - int dx, dy; - evas_object_geometry_get(obj, &dx, &dy, NULL, NULL); - dx = x - dx; - dy = y - dy; - evas_object_move(c->clip, x, y); - evas_object_move(c->events, x, y); - EINA_INLIST_FOREACH(c->surfaces, cs) - { - int cx, cy; - evas_object_geometry_get(cs->obj, &cx, &cy, NULL, NULL); - evas_object_move(cs->obj, cx + dx, cy + dy); - } + efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos); + efl_gfx_entity_position_set(c->clip, pos); } static void -comp_smart_resize(Evas_Object *obj, int w, int h) +_efl_wl_efl_gfx_entity_size_set(Eo *obj, Comp *c, Eina_Size2D sz) { - Comp *c = evas_object_smart_data_get(obj); Eina_List *l; Comp_Surface *cs; struct wl_resource *res; + int w = sz.w, h = sz.h; + efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz); evas_object_resize(c->clip, w, h); evas_object_resize(c->events, w, h); EINA_LIST_FOREACH(c->output_resources, l, res) @@ -5515,101 +5507,25 @@ comp_smart_resize(Evas_Object *obj, int w, int h) } static void -comp_smart_show(Evas_Object *obj) +_efl_wl_efl_gfx_entity_visible_set(Eo *obj, Comp *c, Eina_Bool vis) { - Comp *c = evas_object_smart_data_get(obj); Comp_Surface *cs; - evas_object_show(c->clip); + efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis); EINA_INLIST_FOREACH(c->surfaces, cs) - comp_surface_output_enter(cs); + if (vis) + comp_surface_output_enter(cs); + else + comp_surface_output_leave(cs); } static void -comp_smart_hide(Evas_Object *obj) -{ - Comp *c = evas_object_smart_data_get(obj); - Comp_Surface *cs; - - evas_object_hide(c->clip); - EINA_INLIST_FOREACH(c->surfaces, cs) - comp_surface_output_leave(cs); -} - -static void -comp_smart_color_set(Evas_Object *obj, int r, int g, int b, int a) -{ - Comp *c = evas_object_smart_data_get(obj); - evas_object_color_set(c->clip, r, g, b, a); -} - -static void -comp_smart_clip_set(Evas_Object *obj, Evas_Object *clip) -{ - Comp *c = evas_object_smart_data_get(obj); - evas_object_clip_set(c->clip, clip); -} - -static void -comp_smart_clip_unset(Evas_Object *obj) -{ - Comp *c = evas_object_smart_data_get(obj); - evas_object_clip_unset(c->clip); -} - -static void -comp_smart_member_add(Evas_Object *obj, Evas_Object *child) -{ - Comp *c = evas_object_smart_data_get(obj); - if (child != c->clip) evas_object_clip_set(child, c->clip); -} - -static void -comp_smart_member_del(Evas_Object *obj, Evas_Object *child) -{ - Comp *c = evas_object_smart_data_get(obj); - if (child != c->clip) evas_object_clip_unset(child); -} - -static void -comp_smart_init(void) -{ - if (comp_smart) return; - { - static const Evas_Smart_Class sc = - { - "comp", - EVAS_SMART_CLASS_VERSION, - comp_smart_add, - comp_smart_del, - comp_smart_move, - comp_smart_resize, - comp_smart_show, - comp_smart_hide, - comp_smart_color_set, - comp_smart_clip_set, - comp_smart_clip_unset, - NULL, - comp_smart_member_add, - comp_smart_member_del, - - NULL, - NULL, - NULL, - NULL - }; - comp_smart = evas_smart_class_new(&sc); - } -} - -static Eina_Bool -exe_event_del(void *data, int t EINA_UNUSED, Ecore_Exe_Event_Del *ev) +exe_event_del(void *data, const Efl_Event *ev) { Comp *c = data; - int32_t pid = ev->pid; + int32_t pid = efl_exe_pid_get(ev->object); eina_hash_del_by_key(c->exes, &pid); - return ECORE_CALLBACK_RENEW; } # ifdef __GNUC__ @@ -5621,7 +5537,7 @@ Eina_Bool comp_dmabuf_test(struct linux_dmabuf_buffer *dmabuf) { Evas_Native_Surface ns; - Evas_Object *test; + Eo *test; int size; void *data; Comp *c = dmabuf->compositor; @@ -5669,28 +5585,14 @@ comp_dmabuf_modifiers_query(void *compositor EINA_UNUSED, int format EINA_UNUSED *num_modifiers = 0; } -Evas_Object * -efl_wl_add(Evas *e) -{ - comp_smart_init(); - EINA_SAFETY_ON_TRUE_RETURN_VAL(!ecore_wl2_init(), NULL); - return evas_object_smart_add(e, comp_smart); -} - -Ecore_Exe * -comp_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags) +Eo * +comp_run(Eo *obj, Comp *c, const char *cmd, Efl_Exe_Flags flags) { char *env, *disp, *gl = NULL; - Comp *c; - Ecore_Exe *exe; + Efl_Exe *exe; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); if (!c->exes) c->exes = eina_hash_int32_new(NULL); - if (!c->exe_handler) - c->exe_handler = - ecore_event_handler_add(ECORE_EXE_EVENT_DEL, (Ecore_Event_Handler_Cb)exe_event_del, c); disp = getenv("DISPLAY"); if (disp) disp = strdup(disp); unsetenv("DISPLAY"); @@ -5703,7 +5605,10 @@ comp_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags) if (gl) gl = strdup(gl); setenv("ELM_ACCEL", "gl", 1); } - exe = ecore_exe_pipe_run(cmd, flags, c); + exe = efl_add(EFL_EXE_CLASS, obj, + efl_core_command_line_command_string_set(efl_added, cmd), + efl_exe_flags_set(efl_added, flags), + efl_task_run(efl_added)); if (disp) setenv("DISPLAY", disp, 1); if (env) setenv("WAYLAND_DISPLAY", env, 1); else unsetenv("WAYLAND_DISPLAY"); @@ -5717,55 +5622,45 @@ comp_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags) free(disp); if (exe) { - int32_t pid = ecore_exe_pid_get(exe); + int32_t pid = efl_exe_pid_get(exe); eina_hash_add(c->exes, &pid, (void*)1); + efl_event_callback_add(exe, EFL_TASK_EVENT_EXIT, exe_event_del, c); } return exe; } -Ecore_Exe * -efl_wl_run(Evas_Object *obj, const char *cmd) +EOLIAN static Efl_Exe * +_efl_wl_run(Eo *obj, Comp *c, const char *cmd) { - return comp_run(obj, cmd, ECORE_EXE_TERM_WITH_PARENT); + return comp_run(obj, c, cmd, EFL_EXE_FLAGS_TERM_WITH_PARENT); } -Ecore_Exe * -efl_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags) +EOLIAN static Eo * +_efl_wl_flags_run(Eo *obj, Comp *c, const char *cmd, Efl_Exe_Flags flags) { - return comp_run(obj, cmd, flags); + return comp_run(obj, c, cmd, flags); } -void -efl_wl_pid_add(Evas_Object *obj, int32_t pid) +EOLIAN static void +_efl_wl_allowed_pid_add(Eo *obj, Comp *c, int32_t pid) { - Comp *c; - - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); if (!c->exes) c->exes = eina_hash_int32_new(NULL); eina_hash_add(c->exes, &pid, (void*)1); } -void -efl_wl_pid_del(Evas_Object *obj, int32_t pid) +EOLIAN static void +_efl_wl_allowed_pid_del(Eo *obj, Comp *c, int32_t pid) { - Comp *c; - - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); if (!c->exes) return; eina_hash_del_by_key(c->exes, &pid); } -Eina_Bool -efl_wl_next(Evas_Object *obj) +EOLIAN static Eina_Bool +_efl_wl_surface_next(Eo *obj, Comp *c) { - Comp *c; Comp_Surface *cs; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); if (c->surfaces_count < 2) return EINA_FALSE; EINA_INLIST_REVERSE_FOREACH(c->surfaces, cs) { @@ -5779,14 +5674,11 @@ efl_wl_next(Evas_Object *obj) return EINA_FALSE; } -Eina_Bool -efl_wl_prev(Evas_Object *obj) +EOLIAN static Eina_Bool +_efl_wl_surface_prev(Eo *obj, Comp *c) { - Comp *c; Comp_Surface *cs; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); if (c->surfaces_count < 2) return EINA_FALSE; EINA_INLIST_FOREACH(c->surfaces, cs) { @@ -5800,30 +5692,37 @@ efl_wl_prev(Evas_Object *obj) return EINA_FALSE; } -void -efl_wl_rotate(Evas_Object *obj, Efl_Wl_Rotation rot, Eina_Bool rtl) +EOLIAN static void +_efl_wl_rotation_get(const Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation *rotation, Eina_Bool *rtl) +{ + if (rotation) *rotation = c->rotation; + if (rtl) *rtl = c->rtl; +} + +EOLIAN static void +_efl_wl_rotation_set(Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation rot, Eina_Bool rtl) { - Comp *c; Eina_List *l; struct wl_resource *res; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); c->rtl = !!rtl; c->rotation = rot; EINA_LIST_FOREACH(c->output_resources, l, res) output_resize(c, res); } -void -efl_wl_scale_set(Evas_Object *obj, double scale) +EOLIAN static double +_efl_wl_efl_gfx_entity_scale_get(const Eo *obj EINA_UNUSED, Comp *c) +{ + return c->scale; +} + +EOLIAN static void +_efl_wl_efl_gfx_entity_scale_set(Eo *obj EINA_UNUSED, Comp *c, double scale) { - Comp *c; Eina_List *l; struct wl_resource *res; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); c->scale = scale; EINA_LIST_FOREACH(c->output_resources, l, res) @@ -5831,13 +5730,15 @@ efl_wl_scale_set(Evas_Object *obj, double scale) wl_output_send_scale(res, lround(c->scale)); } -void -efl_wl_aspect_set(Evas_Object *obj, Eina_Bool set) +EOLIAN static Eina_Bool +_efl_wl_aspect_get(const Eo *obj EINA_UNUSED, Comp *c) { - Comp *c; + return c->aspect; +} - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); +EOLIAN static void +_efl_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) +{ if (c->aspect == (!!set)) return; c->aspect = !!set; if (c->aspect) @@ -5846,13 +5747,15 @@ efl_wl_aspect_set(Evas_Object *obj, Eina_Bool set) evas_object_size_hint_aspect_set(obj, EVAS_ASPECT_CONTROL_NONE, 0, 0); } -void -efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set) +EOLIAN static Eina_Bool +_efl_wl_minmax_get(const Eo *obj EINA_UNUSED, Comp *c) { - Comp *c; + return c->minmax; +} - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); +EOLIAN static void +_efl_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) +{ if (c->minmax == (!!set)) return; c->minmax = !!set; if (c->minmax) @@ -5864,19 +5767,15 @@ efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set) } } -void * -efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb) +EOLIAN static Efl_Wl_Global * +_efl_wl_global_add(Eo *obj, Comp *c, const Efl_Wl_Interface *interface, uint32_t version, Efl_Wl_Interface_Data *data, Efl_Wl_Interface_Bind_Cb *bind_cb) { - Comp *c; - - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL); - c = evas_object_smart_data_get(obj); - return wl_global_create(c->display, interface, version, data, bind_cb); + return (void*)wl_global_create(c->display, (void*)interface, version, (void*)data, (void*)bind_cb); } static void -extracted_focus(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +extracted_focus(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Comp_Surface *cs = data; @@ -5890,10 +5789,10 @@ extracted_focus(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v } static void -extracted_unfocus(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +extracted_unfocus(void *data, Evas *e EINA_UNUSED, Eo *obj, void *event_info EINA_UNUSED) { Comp_Surface *cs = data; - Evas_Object *focus; + Eo *focus; if (cs->dead) return; focus = evas_focus_get(cs->c->evas); @@ -5903,7 +5802,7 @@ extracted_unfocus(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event } static void -extracted_changed(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +extracted_changed(void *data, Evas *e EINA_UNUSED, Eo *obj, void *event_info EINA_UNUSED) { Comp_Surface *cs = data; @@ -5912,7 +5811,7 @@ extracted_changed(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event } int32_t -efl_wl_surface_pid_get(Evas_Object *surface) +efl_wl_surface_pid_get(Eo *surface) { Comp_Surface *cs; int32_t pid; @@ -5924,7 +5823,7 @@ efl_wl_surface_pid_get(Evas_Object *surface) } Eina_Bool -efl_wl_surface_extract(Evas_Object *surface) +efl_wl_surface_extract(Eo *surface) { Comp_Surface *cs; if (!eina_streq(evas_object_type_get(surface), "comp_surface")) abort(); @@ -5940,7 +5839,7 @@ efl_wl_surface_extract(Evas_Object *surface) return EINA_TRUE; } -Evas_Object * +Eo * efl_wl_extracted_surface_object_find(void *surface_resource) { Comp_Surface *cs = wl_resource_get_user_data(surface_resource); @@ -5952,8 +5851,8 @@ efl_wl_extracted_surface_object_find(void *surface_resource) return cs->obj; } -Evas_Object * -efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface) +Eo * +efl_wl_extracted_surface_extracted_parent_get(Eo *surface) { Comp_Surface *cs; @@ -5973,13 +5872,13 @@ efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface) } void -efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char *str, void *key_array) +efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_array) { Comp *c; Comp_Seat *s; if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); + c = efl_data_scope_get(obj, MY_CLASS); EINA_INLIST_FOREACH(c->seats, s) { if (!seat) efl_wl_seat_keymap_set(obj, s->dev, state, str, key_array); @@ -6003,13 +5902,13 @@ efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char *str, void } void -efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay) +efl_wl_seat_key_repeat_set(Eo *obj, Eo *seat, int repeat_rate, int repeat_delay) { Comp *c; Comp_Seat *s; if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = evas_object_smart_data_get(obj); + c = efl_data_scope_get(obj, MY_CLASS); EINA_INLIST_FOREACH(c->seats, s) { if (!seat) efl_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay); @@ -6021,3 +5920,8 @@ efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repe s->kbd.repeat_delay = repeat_delay; seat_kbd_repeat_rate_send(s); } + +#define EFL_WL_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_wl), \ + +#include "efl_wl.eo.c" diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo new file mode 100644 index 0000000000..1f28738c49 --- /dev/null +++ b/src/lib/efl_wl/efl_wl.eo @@ -0,0 +1,99 @@ +import efl_exe; +import efl_input_device; +import efl_wl_surface; + +struct @beta @extern Efl.Wl_Wl_Surface; [[ struct wl_surface. @since 1.24 ]] +struct @beta @extern Efl.Wl_Wl_Global; [[ struct wl_global. @since 1.24 ]] +struct @beta @extern Efl.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]] +struct @beta @extern Efl.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]] +struct @beta @extern Efl.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]] + + +enum @beta Efl.Wl.Rotation +{ + [[Orientation of the internal compositor object in degrees. These values are COUNTER-CLOCKWISE. + ]] + rotate_0 = 0, + rotate_90 = 1, + rotate_180 = 2, + rotate_270 = 3 +} + +class @beta Efl.Wl extends Efl.Canvas.Group +{ + [[ + @since 1.24 + ]] + data: Comp; + methods { + run { + [[This runs a command in the compositor using the @Efl.Exe_Flags.term_with_parent flag. + ]] + params { + cmd: string; + } + return: Efl.Exe; + } + flags_run { + params { + cmd: string; + flags: Efl.Exe_Flags; + } + return: Efl.Exe; + } + allowed_pid_add { + params { + pid: int; + } + } + allowed_pid_del { + params { + pid: int; + } + } + surface_next { + return: bool; + } + surface_prev { + return: bool; + } + @property aspect { + values { + set: bool; + } + } + @property minmax { + values { + set: bool; + } + } + @property rotation { + values { + rotation: Efl.Wl.Rotation; + rtl: bool; + } + } + global_add { + params { + interface: const(Efl.Wl_Wl_Interface) @by_ref; + version: uint; + data: Efl.Wl_Wl_Interface_Data @by_ref; + bind_cb: Efl.Wl_Wl_Interface_Bind_Cb @by_ref; + } + return: Efl.Wl_Wl_Global @by_ref; + } + } + implements { + Efl.Object.constructor; + Efl.Gfx.Entity.visible { set; } + Efl.Gfx.Entity.size { set; } + Efl.Gfx.Entity.position { set; } + Efl.Gfx.Entity.scale { get; set; } + } + events { + toplevel,added: Efl.Gfx.Entity; [[]] + child,added: Efl.Gfx.Entity; [[]] + popup,added: Efl.Gfx.Entity; [[]] + seat,added: Efl.Input.Device; [[The seat object added.]] + } +} diff --git a/src/lib/efl_wl/meson.build b/src/lib/efl_wl/meson.build index 35f20ec404..3976b97ab0 100644 --- a/src/lib/efl_wl/meson.build +++ b/src/lib/efl_wl/meson.build @@ -1,32 +1,59 @@ -efl_wl_deps = [ecore_wl2, ecore_input, ecore, ecore_evas, evas, emile, eo, efl, eina] -efl_wl_pub_deps = [evas, dependency('wayland-server', version : '>= 1.11.0'), dependency('xkbcommon', version : '>= 0.6.0')] +efl_wl_deps = [ecore_wl2, ecore_input, ecore, ecore_evas, evas, emile, eina] +efl_wl_pub_deps = [eo, efl, evas, dependency('wayland-server', version : '>= 1.11.0'), dependency('xkbcommon', version : '>= 0.6.0')] if (get_option('x11')) efl_wl_deps += [ecore_x] efl_wl_pub_deps += [dependency('xkbcommon-x11')] endif +pub_eo_files = [ + 'efl_wl.eo', +] + +foreach eo_file : pub_eo_files + pub_eo_file_target += custom_target('eolian_gen_' + eo_file, + input : eo_file, + output : [eo_file + '.h'], + depfile : eo_file + '.d', + install : true, + install_dir : dir_package_include, + command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, + '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), + '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), + '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), + '-gchd', '@INPUT@']) +endforeach + efl_wl_src = [ 'dmabuf.c', - 'efl_wl.c' + 'efl_wl.c', ] efl_wl_header_src = ['Efl_Wl.h'] - +eolian_include_directories += ['-I', meson.current_source_dir()] efl_wl_lib = library('efl_wl', - efl_wl_src, + efl_wl_src, pub_eo_file_target, dependencies: [m, dl] + efl_wl_deps + efl_wl_pub_deps, include_directories : config_dir + [include_directories(join_paths('..','..'))], install: true, + c_args : package_c_args, version : meson.project_version() ) efl_wl = declare_dependency( include_directories: [include_directories('.')], link_with: efl_wl_lib, + sources: pub_eo_file_target, dependencies: efl_wl_pub_deps, ) install_headers(efl_wl_header_src, install_dir : dir_package_include, ) + +eolian_efl_wl_dir = join_paths(eolian_include_dir, package_version_name) +if get_option('install-eo-files') + install_data(pub_eo_files, + install_dir: eolian_efl_wl_dir + ) +endif From 043a2c90ff5f56abcb39c382af85f6bd3019f6fc Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:34 -0400 Subject: [PATCH 14/36] efl/exe: add term_with_parent flag Summary: same as ecore_exe Depends on D11451 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11465 --- src/lib/ecore/efl_exe.c | 13 ++++++++++++- src/lib/ecore/efl_exe.eo | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index 4580a41351..1cb0276205 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -552,7 +552,18 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd) int except[2] = { 0, -1 }; except[0] = pd->fd.exited_write; eina_file_close_from(3, except); - +#ifdef HAVE_PRCTL + if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT)) + { + prctl(PR_SET_PDEATHSIG, SIGTERM); + } +#elif defined(HAVE_PROCCTL) + if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT)) + { + int sig = SIGTERM; + procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &sig); + } +#endif // actually execute! _exec(cmd, pd->flags, td->flags); // we couldn't exec... uh oh. HAAAAAAAALP! diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo index 11f6519be3..c4cc2d7ebf 100644 --- a/src/lib/ecore/efl_exe.eo +++ b/src/lib/ecore/efl_exe.eo @@ -18,7 +18,8 @@ enum @beta Efl.Exe_Flags { [[Flags to customize process behavior.]] none = 0, [[No special flags.]] group_leader = 1, [[Process will be executed in its own session.]] - hide_io = 4 [[All console IO will be hidden.]] + hide_io = 4, [[All console IO will be hidden.]] + term_with_parent = 8, [[Makes child receive SIGTERM when parent dies.]] } class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line From 453a0fb82ae62757dab0590d4af00731ce5afe2b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:40 -0400 Subject: [PATCH 15/36] efl-wl: convert comp surface object to eo Summary: this is a 1:1 conversion Depends on D11454 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11466 --- src/lib/efl_wl/Efl_Wl.h | 5 +- src/lib/efl_wl/efl_wl.c | 161 +++++++++---------------------- src/lib/efl_wl/efl_wl.eo | 6 +- src/lib/efl_wl/efl_wl_surface.eo | 22 +++++ src/lib/efl_wl/meson.build | 1 + 5 files changed, 72 insertions(+), 123 deletions(-) create mode 100644 src/lib/efl_wl/efl_wl_surface.eo diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index ee36eb74bb..06fca3f5b5 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -30,6 +30,7 @@ typedef void * Efl_Wl_Wl_Interface_Data; typedef void * Efl_Wl_Wl_Interface_Bind_Cb; #include +#include /** * @defgroup Efl_Wl_Group EFL Wayland * @@ -164,7 +165,7 @@ EAPI void efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set); * @since 1.21 */ EAPI void *efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb); -#endif + /** * Extract a child surface from the compositor * @@ -187,7 +188,7 @@ EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface); * @since 1.24 */ EAPI int32_t efl_wl_surface_pid_get(Evas_Object *surface); - +#endif /** * Get the Evas_Object for an extracted wl_surface resource created by an efl_wl object * diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index defa800066..d6b77f4f44 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -1925,8 +1925,6 @@ comp_surface_impl_destroy(struct wl_resource *resource) } -static Evas_Smart *comp_surface_smart = NULL; - static inline Eina_Bool comp_surface_check_grab(Comp_Surface *cs, Comp_Seat *s) { @@ -2379,14 +2377,19 @@ comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, vo } } -static void -comp_surface_smart_add(Eo *obj) +EOLIAN static Eo * +_efl_wl_surface_efl_object_constructor(Eo *obj, Comp_Surface *cs EINA_UNUSED) +{ + efl_canvas_group_clipped_set(obj, EINA_TRUE); + return efl_constructor(efl_super(obj, EFL_WL_SURFACE_CLASS)); +} + +static void +_efl_wl_surface_efl_canvas_group_group_add(Eo *obj, Comp_Surface *cs) { - Comp_Surface *cs; Evas *e; - cs = calloc(1, sizeof(Comp_Surface)); - evas_object_smart_data_set(obj, cs); + efl_canvas_group_add(efl_super(obj, EFL_WL_SURFACE_CLASS)); cs->obj = obj; evas_object_event_callback_add(cs->obj, EVAS_CALLBACK_MOUSE_DOWN, comp_surface_mouse_down, cs); evas_object_event_callback_add(cs->obj, EVAS_CALLBACK_MOUSE_UP, comp_surface_mouse_up, cs); @@ -2400,19 +2403,17 @@ comp_surface_smart_add(Eo *obj) e = evas_object_evas_get(obj); cs->img = evas_object_image_filled_add(e); evas_object_show(cs->img); - cs->clip = evas_object_rectangle_add(e); + cs->clip = (Eo*)efl_canvas_group_clipper_get(obj); + efl_gfx_entity_geometry_set(cs->clip, efl_gfx_entity_geometry_get(obj)); evas_object_smart_member_add(cs->img, cs->obj); - evas_object_smart_member_add(cs->clip, cs->obj); evas_object_image_border_center_fill_set(cs->img, EVAS_BORDER_FILL_SOLID); evas_object_image_colorspace_set(cs->img, EVAS_COLORSPACE_ARGB8888); } static void -comp_surface_smart_del(Eo *obj) +_efl_wl_surface_efl_canvas_group_group_del(Eo *obj, Comp_Surface *cs) { - Comp_Surface *cs = evas_object_smart_data_get(obj); - array_clear(&cs->input_rects); array_clear(&cs->opaque_rects); eina_tiler_free(cs->opaque); @@ -2426,7 +2427,6 @@ comp_surface_smart_del(Eo *obj) wl_resource_destroy(cs->res); } evas_object_del(cs->img); - evas_object_del(cs->clip); if (cs->shell.surface) { if (cs->role) @@ -2435,54 +2435,41 @@ comp_surface_smart_del(Eo *obj) } cs->c->surfaces = eina_inlist_remove(cs->c->surfaces, EINA_INLIST_GET(cs)); cs->c->surfaces_count--; - free(cs); } static void -comp_surface_smart_move(Eo *obj, int x, int y) +_efl_wl_surface_efl_gfx_entity_position_set(Eo *obj, Comp_Surface *cs, Eina_Position2D pos) { - Eina_List *l; - Eo *o; - int px, py, cx, cy; + efl_gfx_entity_position_set(efl_super(obj, EFL_WL_SURFACE_CLASS), pos); + efl_gfx_entity_position_set(cs->clip, pos); - evas_object_geometry_get(obj, &px, &py, NULL, NULL); //{ - //Comp_Surface *cs = evas_object_smart_data_get(obj); //if (cs->cursor) //fprintf(stderr, "COMP %sSURFACE(%p) %d,%d\n", cs->subsurface ? "SUB" : "", cs, x, y); //} - l = evas_object_smart_members_get(obj); - EINA_LIST_FREE(l, o) - { - evas_object_geometry_get(o, &cx, &cy, NULL, NULL); - evas_object_move(o, x + (cx - px), y + (cy - py)); - //fprintf(stderr, "SUBOBJ %d,%d\n", x + (cx - px), y + (cy - py)); - } } static void -comp_surface_smart_resize(Eo *obj, int w, int h) +_efl_wl_surface_efl_gfx_entity_size_set(Eo *obj, Comp_Surface *cs, Eina_Size2D sz) { - Comp_Surface *cs = evas_object_smart_data_get(obj); - evas_object_resize(cs->clip, w, h); + efl_gfx_entity_size_set(efl_super(obj, EFL_WL_SURFACE_CLASS), sz); + evas_object_resize(cs->clip, sz.w, sz.h); //if (cs->cursor) fprintf(stderr, "COMP %sSURFACE(%p) %dx%d\n", cs->subsurface ? "SUB" : "", cs, w, h); if (cs->drag) evas_object_move(cs->obj, cs->drag->ptr.pos.x, cs->drag->ptr.pos.y); } static void -comp_surface_smart_show(Eo *obj) +_efl_wl_surface_efl_gfx_entity_visible_set(Eo *obj, Comp_Surface *cs, Eina_Bool vis) { - Comp_Surface *cs = evas_object_smart_data_get(obj); - evas_object_show(cs->clip); - cs->mapped = 1; -} - -static void -comp_surface_smart_hide(Eo *obj) -{ - Comp_Surface *pcs = NULL, *lcs, *cs = evas_object_smart_data_get(obj); - + Comp_Surface *pcs = NULL, *lcs; + efl_gfx_entity_visible_set(efl_super(obj, EFL_WL_SURFACE_CLASS), vis); + if (vis) + { + evas_object_show(cs->clip); + cs->mapped = 1; + return; + } evas_object_hide(cs->clip); cs->mapped = 0; @@ -2519,65 +2506,6 @@ comp_surface_smart_hide(Eo *obj) comp_seats_redo_enter(cs->c, pcs); } -static void -comp_surface_smart_clip_set(Eo *obj, Eo *clip) -{ - Comp_Surface *cs = evas_object_smart_data_get(obj); - evas_object_clip_set(cs->clip, clip); -} - -static void -comp_surface_smart_clip_unset(Eo *obj) -{ - Comp_Surface *cs = evas_object_smart_data_get(obj); - evas_object_clip_unset(cs->clip); -} - -static void -comp_surface_smart_member_add(Eo *obj, Eo *child) -{ - Comp_Surface *cs = evas_object_smart_data_get(obj); - if (child != cs->clip) evas_object_clip_set(child, cs->clip); -} - -static void -comp_surface_smart_member_del(Eo *obj, Eo *child) -{ - Comp_Surface *cs = evas_object_smart_data_get(obj); - if (child != cs->clip) evas_object_clip_unset(child); -} - -static void -comp_surface_smart_init(void) -{ - if (comp_surface_smart) return; - { - static const Evas_Smart_Class sc = - { - "comp_surface", - EVAS_SMART_CLASS_VERSION, - comp_surface_smart_add, - comp_surface_smart_del, - comp_surface_smart_move, - comp_surface_smart_resize, - comp_surface_smart_show, - comp_surface_smart_hide, - NULL, //color_set - comp_surface_smart_clip_set, - comp_surface_smart_clip_unset, - NULL, - comp_surface_smart_member_add, - comp_surface_smart_member_del, - - NULL, - NULL, - NULL, - NULL - }; - comp_surface_smart = evas_smart_class_new(&sc); - } -} - static void comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id) { @@ -2588,9 +2516,9 @@ comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint int x, y; res = wl_resource_create(client, &wl_surface_interface, wl_resource_get_version(resource), id); - comp_surface_smart_init(); - obj = evas_object_smart_add(c->evas, comp_surface_smart); - cs = evas_object_smart_data_get(obj); + obj = efl_add(EFL_WL_SURFACE_CLASS, c->obj); + efl_gfx_entity_visible_set(obj, EINA_FALSE); + cs = efl_data_scope_get(obj, EFL_WL_SURFACE_CLASS); cs->res = res; evas_object_smart_member_add(cs->obj, c->obj); cs->c = c; @@ -5767,8 +5695,8 @@ _efl_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) } } -EOLIAN static Efl_Wl_Global * -_efl_wl_global_add(Eo *obj, Comp *c, const Efl_Wl_Interface *interface, uint32_t version, Efl_Wl_Interface_Data *data, Efl_Wl_Interface_Bind_Cb *bind_cb) +EOLIAN static Efl_Wl_Wl_Global * +_efl_wl_global_add(Eo *obj, Comp *c, const Efl_Wl_Wl_Interface *interface, uint32_t version, Efl_Wl_Wl_Interface_Data *data, Efl_Wl_Wl_Interface_Bind_Cb *bind_cb) { EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL); return (void*)wl_global_create(c->display, (void*)interface, version, (void*)data, (void*)bind_cb); @@ -5810,24 +5738,18 @@ extracted_changed(void *data, Evas *e EINA_UNUSED, Eo *obj, void *event_info EIN shell_surface_send_configure(data); } -int32_t -efl_wl_surface_pid_get(Eo *surface) +static EOLIAN int32_t +_efl_wl_surface_pid_get(const Eo *surface, Comp_Surface *cs) { - Comp_Surface *cs; int32_t pid; - if (!eina_streq(evas_object_type_get(surface), "comp_surface")) abort(); - cs = evas_object_smart_data_get(surface); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, -1); wl_client_get_credentials(wl_resource_get_client(cs->res), &pid, NULL, NULL); return pid; } -Eina_Bool -efl_wl_surface_extract(Eo *surface) +static EOLIAN Eina_Bool +_efl_wl_surface_extract(Eo *surface, Comp_Surface *cs) { - Comp_Surface *cs; - if (!eina_streq(evas_object_type_get(surface), "comp_surface")) abort(); - cs = evas_object_smart_data_get(surface); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->extracted, EINA_FALSE); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, EINA_FALSE); cs->extracted = 1; @@ -5857,9 +5779,8 @@ efl_wl_extracted_surface_extracted_parent_get(Eo *surface) Comp_Surface *cs; EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); - if (!eina_streq(evas_object_type_get(surface), "comp_surface")) abort(); - - cs = evas_object_smart_data_get(surface); + cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS); + if (!cs) abort(); EINA_SAFETY_ON_TRUE_RETURN_VAL(!cs->extracted, NULL); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL); @@ -5924,4 +5845,8 @@ efl_wl_seat_key_repeat_set(Eo *obj, Eo *seat, int repeat_rate, int repeat_delay) #define EFL_WL_EXTRA_OPS \ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_wl), \ +#define EFL_WL_SURFACE_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_wl_surface), \ + #include "efl_wl.eo.c" +#include "efl_wl_surface.eo.c" diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index 1f28738c49..ffd2e9d5c7 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -91,9 +91,9 @@ class @beta Efl.Wl extends Efl.Canvas.Group Efl.Gfx.Entity.scale { get; set; } } events { - toplevel,added: Efl.Gfx.Entity; [[]] - child,added: Efl.Gfx.Entity; [[]] - popup,added: Efl.Gfx.Entity; [[]] + toplevel,added: Efl.Wl.Surface; [[]] + child,added: Efl.Wl.Surface; [[]] + popup,added: Efl.Wl.Surface; [[]] seat,added: Efl.Input.Device; [[The seat object added.]] } } diff --git a/src/lib/efl_wl/efl_wl_surface.eo b/src/lib/efl_wl/efl_wl_surface.eo new file mode 100644 index 0000000000..8f8e44c893 --- /dev/null +++ b/src/lib/efl_wl/efl_wl_surface.eo @@ -0,0 +1,22 @@ +class @beta Efl.Wl.Surface extends Efl.Canvas.Group +{ + [[@since 1.24]] + data: Comp_Surface; + methods { + extract { + return: bool; + } + @property pid { + get {} + values { + pid: int; + } + } + } + implements { + Efl.Object.constructor; + Efl.Gfx.Entity.visible { set; } + Efl.Gfx.Entity.size { set; } + Efl.Gfx.Entity.position { set; } + } +} diff --git a/src/lib/efl_wl/meson.build b/src/lib/efl_wl/meson.build index 3976b97ab0..ca1a082e36 100644 --- a/src/lib/efl_wl/meson.build +++ b/src/lib/efl_wl/meson.build @@ -8,6 +8,7 @@ endif pub_eo_files = [ 'efl_wl.eo', + 'efl_wl_surface.eo', ] foreach eo_file : pub_eo_files From b51d45835c534970361845e4f666d405d5b66d6a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:43 -0400 Subject: [PATCH 16/36] efl-wl: rework parent surface getter to a more useful property Summary: getting any parent is probably fine Depends on D11466 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11467 --- src/lib/efl_wl/Efl_Wl.h | 4 ++-- src/lib/efl_wl/efl_wl.c | 16 +++------------- src/lib/efl_wl/efl_wl_surface.eo | 6 ++++++ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 06fca3f5b5..5676d892ae 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -199,7 +199,7 @@ EAPI int32_t efl_wl_surface_pid_get(Evas_Object *surface); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); - +#if 0 /** * Get the Evas_Object for an extracted surface's parent, or NULL if the parent is not extracted * @@ -210,7 +210,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); - +#endif /** * Set external xkbcommon resources to be used read-only by the compositor object * diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index d6b77f4f44..c56ec323f7 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5773,22 +5773,12 @@ efl_wl_extracted_surface_object_find(void *surface_resource) return cs->obj; } -Eo * -efl_wl_extracted_surface_extracted_parent_get(Eo *surface) +static EOLIAN Eo * +_efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) { - Comp_Surface *cs; - - EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); - cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS); - if (!cs) abort(); - EINA_SAFETY_ON_TRUE_RETURN_VAL(!cs->extracted, NULL); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL); - if (cs->parent) - { - if (!cs->parent->extracted) return NULL; - return cs->parent->obj; - } + if (cs->parent && cs->role) return cs->parent->obj; return NULL; } diff --git a/src/lib/efl_wl/efl_wl_surface.eo b/src/lib/efl_wl/efl_wl_surface.eo index 8f8e44c893..65c7327c95 100644 --- a/src/lib/efl_wl/efl_wl_surface.eo +++ b/src/lib/efl_wl/efl_wl_surface.eo @@ -12,6 +12,12 @@ class @beta Efl.Wl.Surface extends Efl.Canvas.Group pid: int; } } + @property parent_surface { + get {} + values { + parent: Efl.Wl.Surface; + } + } } implements { Efl.Object.constructor; From 12854eac34d8d1decc3c61867d242887a288ac6e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:50 -0400 Subject: [PATCH 17/36] efl-wl: move keymap functions to eo Summary: more 1:1 changes Depends on D11467 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11468 --- src/lib/efl_wl/Efl_Wl.h | 6 ++++-- src/lib/efl_wl/efl_wl.c | 20 +++++++------------- src/lib/efl_wl/efl_wl.eo | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 5676d892ae..71b3c2c190 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -26,8 +26,10 @@ typedef struct Efl_Wl_Wl_Surface Efl_Wl_Wl_Surface; typedef struct Efl_Wl_Wl_Global Efl_Wl_Wl_Global; typedef struct Efl_Wl_Wl_Interface Efl_Wl_Wl_Interface; +typedef struct Efl_Wl_Wl_Array Efl_Wl_Wl_Array; typedef void * Efl_Wl_Wl_Interface_Data; typedef void * Efl_Wl_Wl_Interface_Bind_Cb; +typedef struct Efl_Wl_Xkb_State Efl_Wl_Xkb_State; #include #include @@ -210,7 +212,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); -#endif + /** * Set external xkbcommon resources to be used read-only by the compositor object * @@ -236,7 +238,7 @@ EAPI void efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char * * @since 1.21 */ EAPI void efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay); - +#endif #undef EAPI #define EAPI #undef EAPI_WEAK diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index c56ec323f7..0aa1d23096 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -210,7 +210,7 @@ typedef struct Comp_Seat struct xkb_context *context; struct xkb_keymap *keymap; struct xkb_state *state; - char *keymap_str; + const char *keymap_str; int keymap_str_size; int repeat_rate; int repeat_delay; @@ -5782,14 +5782,11 @@ _efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) return NULL; } -void -efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_array) +static EOLIAN void +_efl_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Wl_Xkb_State *state, const char *str, Efl_Wl_Wl_Array *key_array) { - Comp *c; Comp_Seat *s; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = efl_data_scope_get(obj, MY_CLASS); EINA_INLIST_FOREACH(c->seats, s) { if (!seat) efl_wl_seat_keymap_set(obj, s->dev, state, str, key_array); @@ -5799,8 +5796,8 @@ efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_arra EINA_SAFETY_ON_NULL_RETURN(s); seat_kbd_destroy(s); s->kbd.external = 1; - s->kbd.keys_external = key_array; - s->kbd.state = state; + s->kbd.keys_external = (void*)key_array; + s->kbd.state = (void*)state; s->kbd.keymap_str = str; if (str) s->kbd.keymap_str_size = strlen(str) + 1; @@ -5812,14 +5809,11 @@ efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_arra seat_kbd_external_init(s); } -void -efl_wl_seat_key_repeat_set(Eo *obj, Eo *seat, int repeat_rate, int repeat_delay) +static EOLIAN void +_efl_wl_seat_key_repeat_set(Eo *obj, Comp *c, Eo *seat, int repeat_rate, int repeat_delay) { - Comp *c; Comp_Seat *s; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = efl_data_scope_get(obj, MY_CLASS); EINA_INLIST_FOREACH(c->seats, s) { if (!seat) efl_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay); diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index ffd2e9d5c7..20663624cb 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -7,6 +7,8 @@ struct @beta @extern Efl.Wl_Wl_Global; [[ struct wl_global. @since 1.24 ]] struct @beta @extern Efl.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]] struct @beta @extern Efl.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]] struct @beta @extern Efl.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]] +struct @beta @extern Efl.Wl_Xkb_State; [[ struct xkb_state. @since 1.24 ]] +struct @beta @extern Efl.Wl_Wl_Array; [[ struct wl_array. @since 1.24 ]] enum @beta Efl.Wl.Rotation @@ -82,6 +84,21 @@ class @beta Efl.Wl extends Efl.Canvas.Group } return: Efl.Wl_Wl_Global @by_ref; } + seat_keymap_set { + params { + seat: Efl.Input.Device; + state: Efl.Wl_Xkb_State @by_ref; + keymap_str: string; + key_array: Efl.Wl_Wl_Array @by_ref; + } + } + seat_key_repeat_set { + params { + seat: Efl.Input.Device; + repeat_rate: int; + repeat_delay: int; + } + } } implements { Efl.Object.constructor; From 09aba19cc9db289e4c30ff25bb61974f4afcad18 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:57 -0400 Subject: [PATCH 18/36] efl-wl: make surface restacking functions return the current surface Summary: seems more useful Depends on D11468 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11469 --- src/lib/efl_wl/Efl_Wl.h | 2 +- src/lib/efl_wl/efl_wl.c | 16 ++++++++-------- src/lib/efl_wl/efl_wl.eo | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 71b3c2c190..d24557dc1a 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -31,8 +31,8 @@ typedef void * Efl_Wl_Wl_Interface_Data; typedef void * Efl_Wl_Wl_Interface_Bind_Cb; typedef struct Efl_Wl_Xkb_State Efl_Wl_Xkb_State; -#include #include +#include /** * @defgroup Efl_Wl_Group EFL Wayland * diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 0aa1d23096..84a61e83ae 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5584,40 +5584,40 @@ _efl_wl_allowed_pid_del(Eo *obj, Comp *c, int32_t pid) eina_hash_del_by_key(c->exes, &pid); } -EOLIAN static Eina_Bool +EOLIAN static Eo * _efl_wl_surface_next(Eo *obj, Comp *c) { Comp_Surface *cs; - if (c->surfaces_count < 2) return EINA_FALSE; + if (c->surfaces_count < 2) return NULL; EINA_INLIST_REVERSE_FOREACH(c->surfaces, cs) { if (cs->shell.activated) continue; if ((!cs->role) || (!cs->shell.surface) || cs->dead) continue; cs->shell.activated = 1; shell_surface_send_configure(cs); - return EINA_TRUE; + return cs->obj; } - return EINA_FALSE; + return NULL; } -EOLIAN static Eina_Bool +EOLIAN static Eo * _efl_wl_surface_prev(Eo *obj, Comp *c) { Comp_Surface *cs; - if (c->surfaces_count < 2) return EINA_FALSE; + if (c->surfaces_count < 2) return NULL; EINA_INLIST_FOREACH(c->surfaces, cs) { if (cs->shell.activated) continue; if ((!cs->role) || (!cs->shell.surface) || cs->dead) continue; cs->shell.activated = 1; shell_surface_send_configure(cs); - return EINA_TRUE; + return cs->obj; } - return EINA_FALSE; + return NULL; } EOLIAN static void diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index 20663624cb..af7f79393c 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -54,10 +54,10 @@ class @beta Efl.Wl extends Efl.Canvas.Group } } surface_next { - return: bool; + return: Efl.Wl.Surface; } surface_prev { - return: bool; + return: Efl.Wl.Surface; } @property aspect { values { From 2754b24cdd2901e839a070e88b899907a1496406 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:16:04 -0400 Subject: [PATCH 19/36] efl-wl: add active_surface property Summary: this is probably useful? Depends on D11469 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11470 --- src/lib/efl_wl/efl_wl.c | 22 ++++++++++++++++++++++ src/lib/efl_wl/efl_wl.eo | 9 +++++++++ 2 files changed, 31 insertions(+) diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 84a61e83ae..56efb5c6d7 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5620,6 +5620,28 @@ _efl_wl_surface_prev(Eo *obj, Comp *c) return NULL; } +EOLIAN static Eo * +_efl_wl_active_surface_get(const Eo *obj, Comp *c) +{ + if (c->active_surface && (!c->active_surface->dead)) + return c->active_surface->obj; + return NULL; +} + +EOLIAN static Eina_Bool +_efl_wl_active_surface_set(Eo *obj, Comp *c, Eo *surface) +{ + Comp_Surface *cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(cs, EINA_FALSE); + if (cs->dead) return EINA_FALSE; + if (c->active_surface == cs) return EINA_TRUE; + /* can't activate a popup */ + if (cs->shell.popup) return EINA_FALSE; + cs->shell.activated = 1; + shell_surface_send_configure(cs); + return EINA_TRUE; +} + EOLIAN static void _efl_wl_rotation_get(const Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation *rotation, Eina_Bool *rtl) { diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index af7f79393c..b41b429871 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -59,6 +59,15 @@ class @beta Efl.Wl extends Efl.Canvas.Group surface_prev { return: Efl.Wl.Surface; } + @property active_surface { + get {} + set { + return: bool; + } + values { + surface: Efl.Wl.Surface; + } + } @property aspect { values { set: bool; From d284d19429d482dd0636b1f1aab8b5502c572975 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:16:10 -0400 Subject: [PATCH 20/36] efl-wl: move flags_run to exec_flags property Summary: typically the compositor wants to run all exes with the same flags so this makes more sense Depends on D11470 Reviewers: segfaultxavi, bu5hm4n Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11475 --- src/lib/efl_wl/efl_wl.c | 14 +++++++++++--- src/lib/efl_wl/efl_wl.eo | 6 ++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 56efb5c6d7..060c3837aa 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -123,6 +123,7 @@ typedef struct Comp Efl_Wl_Rotation rotation; double scale; char *env; + Efl_Exe_Flags flags; Ecore_Wl2_Display *disp; Ecore_Wl2_Display *parent_disp; Ecore_Wl2_Display *client_disp; @@ -5283,6 +5284,7 @@ _efl_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) efl_canvas_group_add(efl_super(obj, MY_CLASS)); c->wayland_time_base = ecore_loop_time_get(); c->obj = obj; + c->flags = EFL_EXE_FLAGS_TERM_WITH_PARENT; env = getenv("WAYLAND_DISPLAY"); if (env) env = strdup(env); @@ -5563,10 +5565,16 @@ _efl_wl_run(Eo *obj, Comp *c, const char *cmd) return comp_run(obj, c, cmd, EFL_EXE_FLAGS_TERM_WITH_PARENT); } -EOLIAN static Eo * -_efl_wl_flags_run(Eo *obj, Comp *c, const char *cmd, Efl_Exe_Flags flags) +EOLIAN static Efl_Exe_Flags +_efl_wl_exec_flags_get(const Eo *obj, Comp *c) { - return comp_run(obj, c, cmd, flags); + return c->flags; +} + +EOLIAN static void +_efl_wl_exec_flags_set(Eo *obj, Comp *c, Efl_Exe_Flags flags) +{ + c->flags = flags; } EOLIAN static void diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index b41b429871..f52fa1a8c6 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -36,12 +36,10 @@ class @beta Efl.Wl extends Efl.Canvas.Group } return: Efl.Exe; } - flags_run { - params { - cmd: string; + @property exec_flags { + values { flags: Efl.Exe_Flags; } - return: Efl.Exe; } allowed_pid_add { params { From 42480c5ebf32be52c3d5c5e484d5e8d5eac92fcb Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:16:14 -0400 Subject: [PATCH 21/36] efl-wl: rename to efl.canvas.wl Summary: this is a canvas object so it needs to be in the canvas namespace Depends on D11475 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11476 --- meson.build | 2 +- .../efl_canvas_wl_test.c} | 10 +- .../efl_canvas_wl_test_stack.c} | 10 +- src/bin/efl_canvas_wl/meson.build | 13 ++ src/bin/efl_wl/meson.build | 13 -- .../Efl_Canvas_Wl.h} | 66 ++++---- .../copiedfromweston.x | 0 src/lib/{efl_wl => efl_canvas_wl}/dmabuf.c | 0 src/lib/{efl_wl => efl_canvas_wl}/dmabuf.h | 0 .../efl_canvas_wl.c} | 141 +++++++++--------- .../efl_canvas_wl.eo} | 46 +++--- .../efl_canvas_wl_surface.eo} | 4 +- src/lib/{efl_wl => efl_canvas_wl}/meson.build | 36 ++--- src/lib/{efl_wl => efl_canvas_wl}/x11.x | 0 14 files changed, 171 insertions(+), 170 deletions(-) rename src/bin/{efl_wl/efl_wl_test.c => efl_canvas_wl/efl_canvas_wl_test.c} (90%) rename src/bin/{efl_wl/efl_wl_test_stack.c => efl_canvas_wl/efl_canvas_wl_test_stack.c} (92%) create mode 100644 src/bin/efl_canvas_wl/meson.build delete mode 100644 src/bin/efl_wl/meson.build rename src/lib/{efl_wl/Efl_Wl.h => efl_canvas_wl/Efl_Canvas_Wl.h} (73%) rename src/lib/{efl_wl => efl_canvas_wl}/copiedfromweston.x (100%) rename src/lib/{efl_wl => efl_canvas_wl}/dmabuf.c (100%) rename src/lib/{efl_wl => efl_canvas_wl}/dmabuf.h (100%) rename src/lib/{efl_wl/efl_wl.c => efl_canvas_wl/efl_canvas_wl.c} (97%) rename src/lib/{efl_wl/efl_wl.eo => efl_canvas_wl/efl_canvas_wl.eo} (55%) rename src/lib/{efl_wl/efl_wl_surface.eo => efl_canvas_wl/efl_canvas_wl_surface.eo} (81%) rename src/lib/{efl_wl => efl_canvas_wl}/meson.build (56%) rename src/lib/{efl_wl => efl_canvas_wl}/x11.x (100%) diff --git a/meson.build b/meson.build index 6ad434980c..bbf99d427a 100644 --- a/meson.build +++ b/meson.build @@ -331,7 +331,7 @@ subprojects = [ ['ethumb' ,[] , true, true, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ethumb_client' ,[] , false, true, true, false, false, true, ['eina', 'efl', 'eo', 'ethumb'], []], ['elementary' ,[] , true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']], -['efl_wl' ,['wl'] , false, true, true, false, false, false, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], +['efl_canvas_wl' ,['wl'] , false, true, true, false, false, false, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], ['elua' ,['elua'] , false, true, true, false, true, false, ['eina', 'luajit'], []], ['ecore_wayland' ,['wl-deprecated'] , false, true, false, false, false, false, ['eina'], []], ['ecore_drm' ,['drm-deprecated'] , false, true, false, false, false, false, ['eina'], []], diff --git a/src/bin/efl_wl/efl_wl_test.c b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c similarity index 90% rename from src/bin/efl_wl/efl_wl_test.c rename to src/bin/efl_canvas_wl/efl_canvas_wl_test.c index b9f9f6b450..4bb7e616af 100644 --- a/src/bin/efl_wl/efl_wl_test.c +++ b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c @@ -1,7 +1,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "Efl_Wl.h" +#include "Efl_Canvas_Wl.h" #include "Elementary.h" static Evas_Object *win; @@ -23,7 +23,7 @@ focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev static Eina_Bool dostuff(void *data) { - exe = efl_wl_run(data, eina_strbuf_string_get(buf)); + exe = efl_canvas_wl_run(data, eina_strbuf_string_get(buf)); efl_event_callback_add(exe, EFL_TASK_EVENT_EXIT, del_handler, NULL); evas_object_focus_set(data, 1); return EINA_FALSE; @@ -62,9 +62,9 @@ main(int argc, char *argv[]) elm_win_autodel_set(win, 1); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); - o = efl_add(EFL_WL_CLASS, win); - efl_wl_aspect_set(o, 1); - efl_wl_minmax_set(o, 1); + o = efl_add(EFL_CANVAS_WL_CLASS, win); + efl_canvas_wl_aspect_set(o, 1); + efl_canvas_wl_minmax_set(o, 1); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, hints_changed, win); diff --git a/src/bin/efl_wl/efl_wl_test_stack.c b/src/bin/efl_canvas_wl/efl_canvas_wl_test_stack.c similarity index 92% rename from src/bin/efl_wl/efl_wl_test_stack.c rename to src/bin/efl_canvas_wl/efl_canvas_wl_test_stack.c index e6eaa34760..49849e07e8 100644 --- a/src/bin/efl_wl/efl_wl_test_stack.c +++ b/src/bin/efl_canvas_wl/efl_canvas_wl_test_stack.c @@ -1,7 +1,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "Efl_Wl.h" +#include "Efl_Canvas_Wl.h" #include "Elementary.h" static Evas_Object *win; @@ -18,7 +18,7 @@ static unsigned int n; static Eina_Bool dostuff(void *data) { - efl_wl_run(data, cmds[n++]); + efl_canvas_wl_run(data, cmds[n++]); evas_object_focus_set(data, 1); return n != num_cmds; } @@ -26,13 +26,13 @@ dostuff(void *data) static void prev_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - efl_wl_surface_prev(data); + efl_canvas_wl_surface_prev(data); } static void next_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - efl_wl_surface_next(data); + efl_canvas_wl_surface_next(data); } int @@ -69,7 +69,7 @@ main(int argc, char *argv[]) evas_object_show(next); elm_table_pack(o, next, 1, 0, 1, 1); - comp = efl_add(EFL_WL_CLASS, win); + comp = efl_add(EFL_CANVAS_WL_CLASS, win); evas_object_size_hint_min_set(comp, 640, 480); elm_table_pack(o, comp, 0, 1, 2, 1); evas_object_size_hint_align_set(comp, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/bin/efl_canvas_wl/meson.build b/src/bin/efl_canvas_wl/meson.build new file mode 100644 index 0000000000..278a2c58db --- /dev/null +++ b/src/bin/efl_canvas_wl/meson.build @@ -0,0 +1,13 @@ +executable('efl_canvas_wl_test', + 'efl_canvas_wl_test.c', + include_directories : config_dir, + dependencies: [efl_canvas_wl, efl_canvas_wl_deps, efl_canvas_wl_pub_deps, elementary], + install: true, +) + +executable('efl_canvas_wl_test_stack', + 'efl_canvas_wl_test_stack.c', + include_directories : config_dir, + dependencies: [efl_canvas_wl, efl_canvas_wl_deps, efl_canvas_wl_pub_deps, elementary], + install: true, +) diff --git a/src/bin/efl_wl/meson.build b/src/bin/efl_wl/meson.build deleted file mode 100644 index dc0f0d248c..0000000000 --- a/src/bin/efl_wl/meson.build +++ /dev/null @@ -1,13 +0,0 @@ -executable('efl_wl_test', - 'efl_wl_test.c', - include_directories : config_dir, - dependencies: [efl_wl, efl_wl_deps, efl_wl_pub_deps, elementary], - install: true, -) - -executable('efl_wl_test_stack', - 'efl_wl_test_stack.c', - include_directories : config_dir, - dependencies: [efl_wl, efl_wl_deps, efl_wl_pub_deps, elementary], - install: true, -) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h similarity index 73% rename from src/lib/efl_wl/Efl_Wl.h rename to src/lib/efl_canvas_wl/Efl_Canvas_Wl.h index d24557dc1a..b62f0de729 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h @@ -1,5 +1,5 @@ -#ifndef EFL_WL_H -# define EFL_WL_H +#ifndef EFL_CANVAS_WL_H +# define EFL_CANVAS_WL_H #include #include @@ -23,16 +23,16 @@ #define EWAPI EAPI EAPI_WEAK -typedef struct Efl_Wl_Wl_Surface Efl_Wl_Wl_Surface; -typedef struct Efl_Wl_Wl_Global Efl_Wl_Wl_Global; -typedef struct Efl_Wl_Wl_Interface Efl_Wl_Wl_Interface; -typedef struct Efl_Wl_Wl_Array Efl_Wl_Wl_Array; -typedef void * Efl_Wl_Wl_Interface_Data; -typedef void * Efl_Wl_Wl_Interface_Bind_Cb; -typedef struct Efl_Wl_Xkb_State Efl_Wl_Xkb_State; +typedef struct Efl_Canvas_Wl_Wl_Surface Efl_Canvas_Wl_Wl_Surface; +typedef struct Efl_Canvas_Wl_Wl_Global Efl_Canvas_Wl_Wl_Global; +typedef struct Efl_Canvas_Wl_Wl_Interface Efl_Canvas_Wl_Wl_Interface; +typedef struct Efl_Canvas_Wl_Wl_Array Efl_Canvas_Wl_Wl_Array; +typedef void * Efl_Canvas_Wl_Wl_Interface_Data; +typedef void * Efl_Canvas_Wl_Wl_Interface_Bind_Cb; +typedef struct Efl_Canvas_Wl_Xkb_State Efl_Canvas_Wl_Xkb_State; -#include -#include +#include +#include /** * @defgroup Efl_Wl_Group EFL Wayland * @@ -54,7 +54,7 @@ typedef struct Efl_Wl_Xkb_State Efl_Wl_Xkb_State; * @param e The canvas * @return The compositor object, @c NULL on failure */ -EAPI Evas_Object *efl_wl_add(Evas *e); +EAPI Evas_Object *efl_canvas_wl_add(Evas *e); /** * Run a command in the compositor widget. @@ -66,7 +66,7 @@ EAPI Evas_Object *efl_wl_add(Evas *e); * @param cmd The command to run * @return The Ecore_Exe from the executed process, @c NULL on failure */ -EAPI Ecore_Exe *efl_wl_run(Evas_Object *obj, const char *cmd); +EAPI Ecore_Exe *efl_canvas_wl_run(Evas_Object *obj, const char *cmd); /** * Run a command in the compositor widget with specified flags. @@ -79,7 +79,7 @@ EAPI Ecore_Exe *efl_wl_run(Evas_Object *obj, const char *cmd); * @param flags The flags to use * @return The Ecore_Exe from the executed process, @c NULL on failure */ -Ecore_Exe *efl_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags); +Ecore_Exe *efl_canvas_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags); /** * Add a process to the list of allowed clients for the compositor widget @@ -88,7 +88,7 @@ Ecore_Exe *efl_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags f * @param pid The process to allow * @since 1.21 */ -EAPI void efl_wl_pid_add(Evas_Object *obj, int32_t pid); +EAPI void efl_canvas_wl_pid_add(Evas_Object *obj, int32_t pid); /** * Remove a process from the list of allowed clients for the compositor widget @@ -97,7 +97,7 @@ EAPI void efl_wl_pid_add(Evas_Object *obj, int32_t pid); * @param pid The process to deny * @since 1.21 */ -EAPI void efl_wl_pid_del(Evas_Object *obj, int32_t pid); +EAPI void efl_canvas_wl_pid_del(Evas_Object *obj, int32_t pid); /** * Put the bottom-most toplevel window on top and apply focus to it @@ -105,7 +105,7 @@ EAPI void efl_wl_pid_del(Evas_Object *obj, int32_t pid); * @param obj The compositor widget * @return EINA_TRUE if the window stacking was changed */ -EAPI Eina_Bool efl_wl_surface_next(Evas_Object *obj); +EAPI Eina_Bool efl_canvas_wl_surface_next(Evas_Object *obj); /** * Put the second top-most toplevel window on top and apply focus to it @@ -113,7 +113,7 @@ EAPI Eina_Bool efl_wl_surface_next(Evas_Object *obj); * @param obj The compositor widget * @return EINA_TRUE if the window stacking was changed */ -EAPI Eina_Bool efl_wl_surface_prev(Evas_Object *obj); +EAPI Eina_Bool efl_canvas_wl_surface_prev(Evas_Object *obj); /** * Set rotation and flip for the compositor's output @@ -124,7 +124,7 @@ EAPI Eina_Bool efl_wl_surface_prev(Evas_Object *obj); * @note rtl is equivalent to WL_OUTPUT_TRANSFORM_FLIPPED and rotations are applied * on top */ -EAPI void efl_wl_rotate(Evas_Object *obj, Efl_Wl_Rotation rot, Eina_Bool rtl); +EAPI void efl_canvas_wl_rotate(Evas_Object *obj, Efl_Wl_Rotation rot, Eina_Bool rtl); /** * Set the scale factor for the compositor's output @@ -132,25 +132,25 @@ EAPI void efl_wl_rotate(Evas_Object *obj, Efl_Wl_Rotation rot, Eina_Bool rtl); * @param obj The compositor widget * @param scale The scale factor to set */ -EAPI void efl_wl_scale_set(Evas_Object *obj, double scale); +EAPI void efl_canvas_wl_scale_set(Evas_Object *obj, double scale); /** - * Transfer aspect hints from top-most surface onto the efl_wl object + * Transfer aspect hints from top-most surface onto the efl_canvas_wl object * * @param obj The compositor widget * @param set Whether to enable aspect setting * @since 1.21 */ -EAPI void efl_wl_aspect_set(Evas_Object *obj, Eina_Bool set); +EAPI void efl_canvas_wl_aspect_set(Evas_Object *obj, Eina_Bool set); /** - * Transfer min/max hints from top-most surface onto the efl_wl object + * Transfer min/max hints from top-most surface onto the efl_canvas_wl object * * @param obj The compositor widget * @param set Whether to enable min/max setting * @since 1.21 */ -EAPI void efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set); +EAPI void efl_canvas_wl_minmax_set(Evas_Object *obj, Eina_Bool set); /** * Add an externally-managed global to the compositor @@ -166,7 +166,7 @@ EAPI void efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set); * @return The created global (struct wl_global), or NULL on failure * @since 1.21 */ -EAPI void *efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb); +EAPI void *efl_canvas_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb); /** * Extract a child surface from the compositor @@ -178,7 +178,7 @@ EAPI void *efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t v * @return True if the surface was successfully extracted * @since 1.21 */ -EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface); +EAPI Eina_Bool efl_canvas_wl_surface_extract(Evas_Object *surface); /** * Return the pid for the surface's client @@ -189,18 +189,18 @@ EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface); * @return The pid of the surface, or -1 on failure * @since 1.24 */ -EAPI int32_t efl_wl_surface_pid_get(Evas_Object *surface); +EAPI int32_t efl_canvas_wl_surface_pid_get(Evas_Object *surface); #endif /** - * Get the Evas_Object for an extracted wl_surface resource created by an efl_wl object + * Get the Evas_Object for an extracted wl_surface resource created by an efl_canvas_wl object * - * @note Passing anything other than a valid wl_surface resource from an efl_wl object will guarantee a crash. + * @note Passing anything other than a valid wl_surface resource from an efl_canvas_wl object will guarantee a crash. * * @param surface_resource The wl_resource for a wl_surface * @return The Evas_Object of the surface, NULL on failure * @since 1.21 */ -EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); +EAPI Evas_Object *efl_canvas_wl_extracted_surface_object_find(void *surface_resource); #if 0 /** * Get the Evas_Object for an extracted surface's parent, or NULL if the parent is not extracted @@ -211,7 +211,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); * @return The Evas_Object of the parent surface, NULL on failure or if there is no parent * @since 1.21 */ -EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); +EAPI Evas_Object *efl_canvas_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); /** * Set external xkbcommon resources to be used read-only by the compositor object @@ -229,7 +229,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *sur * @param wl_key_array A pointer to the wl_array in which keys are stored * @since 1.21 */ -EAPI void efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char *str, void *wl_key_array); +EAPI void efl_canvas_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char *str, void *wl_key_array); /** * Set the key repeat rate for a seat in the compositor @@ -237,7 +237,7 @@ EAPI void efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char * * @param obj The compositor widget * @since 1.21 */ -EAPI void efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay); +EAPI void efl_canvas_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay); #endif #undef EAPI #define EAPI diff --git a/src/lib/efl_wl/copiedfromweston.x b/src/lib/efl_canvas_wl/copiedfromweston.x similarity index 100% rename from src/lib/efl_wl/copiedfromweston.x rename to src/lib/efl_canvas_wl/copiedfromweston.x diff --git a/src/lib/efl_wl/dmabuf.c b/src/lib/efl_canvas_wl/dmabuf.c similarity index 100% rename from src/lib/efl_wl/dmabuf.c rename to src/lib/efl_canvas_wl/dmabuf.c diff --git a/src/lib/efl_wl/dmabuf.h b/src/lib/efl_canvas_wl/dmabuf.h similarity index 100% rename from src/lib/efl_wl/dmabuf.h rename to src/lib/efl_canvas_wl/dmabuf.h diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c similarity index 97% rename from src/lib/efl_wl/efl_wl.c rename to src/lib/efl_canvas_wl/efl_canvas_wl.c index 060c3837aa..801c3f3fd3 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c @@ -39,7 +39,7 @@ #endif #include "Evas_Internal.h" #include "canvas/evas_canvas_eo.h" -#include "Efl_Wl.h" +#include "Efl_Canvas_Wl.h" #undef COORDS_INSIDE #define COORDS_INSIDE(x, y, xx, yy, ww, hh) \ @@ -88,7 +88,7 @@ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE | \ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK) -#define MY_CLASS EFL_WL_CLASS +#define MY_CLASS EFL_CANVAS_WL_CLASS typedef struct Input_Sequence { @@ -120,7 +120,7 @@ typedef struct Comp_Buffer typedef struct Comp { - Efl_Wl_Rotation rotation; + Efl_Canvas_Wl_Rotation rotation; double scale; char *env; Efl_Exe_Flags flags; @@ -2379,18 +2379,18 @@ comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, vo } EOLIAN static Eo * -_efl_wl_surface_efl_object_constructor(Eo *obj, Comp_Surface *cs EINA_UNUSED) +_efl_canvas_wl_surface_efl_object_constructor(Eo *obj, Comp_Surface *cs EINA_UNUSED) { efl_canvas_group_clipped_set(obj, EINA_TRUE); - return efl_constructor(efl_super(obj, EFL_WL_SURFACE_CLASS)); + return efl_constructor(efl_super(obj, EFL_CANVAS_WL_SURFACE_CLASS)); } static void -_efl_wl_surface_efl_canvas_group_group_add(Eo *obj, Comp_Surface *cs) +_efl_canvas_wl_surface_efl_canvas_group_group_add(Eo *obj, Comp_Surface *cs) { Evas *e; - efl_canvas_group_add(efl_super(obj, EFL_WL_SURFACE_CLASS)); + efl_canvas_group_add(efl_super(obj, EFL_CANVAS_WL_SURFACE_CLASS)); cs->obj = obj; evas_object_event_callback_add(cs->obj, EVAS_CALLBACK_MOUSE_DOWN, comp_surface_mouse_down, cs); evas_object_event_callback_add(cs->obj, EVAS_CALLBACK_MOUSE_UP, comp_surface_mouse_up, cs); @@ -2413,7 +2413,7 @@ _efl_wl_surface_efl_canvas_group_group_add(Eo *obj, Comp_Surface *cs) } static void -_efl_wl_surface_efl_canvas_group_group_del(Eo *obj, Comp_Surface *cs) +_efl_canvas_wl_surface_efl_canvas_group_group_del(Eo *obj, Comp_Surface *cs) { array_clear(&cs->input_rects); array_clear(&cs->opaque_rects); @@ -2436,12 +2436,13 @@ _efl_wl_surface_efl_canvas_group_group_del(Eo *obj, Comp_Surface *cs) } cs->c->surfaces = eina_inlist_remove(cs->c->surfaces, EINA_INLIST_GET(cs)); cs->c->surfaces_count--; + efl_canvas_group_del(efl_super(obj, EFL_CANVAS_WL_SURFACE_CLASS)); } static void -_efl_wl_surface_efl_gfx_entity_position_set(Eo *obj, Comp_Surface *cs, Eina_Position2D pos) +_efl_canvas_wl_surface_efl_gfx_entity_position_set(Eo *obj, Comp_Surface *cs, Eina_Position2D pos) { - efl_gfx_entity_position_set(efl_super(obj, EFL_WL_SURFACE_CLASS), pos); + efl_gfx_entity_position_set(efl_super(obj, EFL_CANVAS_WL_SURFACE_CLASS), pos); efl_gfx_entity_position_set(cs->clip, pos); //{ @@ -2451,9 +2452,9 @@ _efl_wl_surface_efl_gfx_entity_position_set(Eo *obj, Comp_Surface *cs, Eina_Posi } static void -_efl_wl_surface_efl_gfx_entity_size_set(Eo *obj, Comp_Surface *cs, Eina_Size2D sz) +_efl_canvas_wl_surface_efl_gfx_entity_size_set(Eo *obj, Comp_Surface *cs, Eina_Size2D sz) { - efl_gfx_entity_size_set(efl_super(obj, EFL_WL_SURFACE_CLASS), sz); + efl_gfx_entity_size_set(efl_super(obj, EFL_CANVAS_WL_SURFACE_CLASS), sz); evas_object_resize(cs->clip, sz.w, sz.h); //if (cs->cursor) fprintf(stderr, "COMP %sSURFACE(%p) %dx%d\n", cs->subsurface ? "SUB" : "", cs, w, h); if (cs->drag) @@ -2461,10 +2462,10 @@ _efl_wl_surface_efl_gfx_entity_size_set(Eo *obj, Comp_Surface *cs, Eina_Size2D s } static void -_efl_wl_surface_efl_gfx_entity_visible_set(Eo *obj, Comp_Surface *cs, Eina_Bool vis) +_efl_canvas_wl_surface_efl_gfx_entity_visible_set(Eo *obj, Comp_Surface *cs, Eina_Bool vis) { Comp_Surface *pcs = NULL, *lcs; - efl_gfx_entity_visible_set(efl_super(obj, EFL_WL_SURFACE_CLASS), vis); + efl_gfx_entity_visible_set(efl_super(obj, EFL_CANVAS_WL_SURFACE_CLASS), vis); if (vis) { evas_object_show(cs->clip); @@ -2517,9 +2518,9 @@ comp_surface_create(struct wl_client *client, struct wl_resource *resource, uint int x, y; res = wl_resource_create(client, &wl_surface_interface, wl_resource_get_version(resource), id); - obj = efl_add(EFL_WL_SURFACE_CLASS, c->obj); + obj = efl_add(EFL_CANVAS_WL_SURFACE_CLASS, c->obj); efl_gfx_entity_visible_set(obj, EINA_FALSE); - cs = efl_data_scope_get(obj, EFL_WL_SURFACE_CLASS); + cs = efl_data_scope_get(obj, EFL_CANVAS_WL_SURFACE_CLASS); cs->res = res; evas_object_smart_member_add(cs->obj, c->obj); cs->c = c; @@ -3097,16 +3098,16 @@ output_resize(Comp *c, struct wl_resource *res) int rot[][4] = { { - [EFL_WL_ROTATION_ROTATE_0] = WL_OUTPUT_TRANSFORM_NORMAL, - [EFL_WL_ROTATION_ROTATE_90] = WL_OUTPUT_TRANSFORM_90, - [EFL_WL_ROTATION_ROTATE_180] = WL_OUTPUT_TRANSFORM_180, - [EFL_WL_ROTATION_ROTATE_270] = WL_OUTPUT_TRANSFORM_270, + [EFL_CANVAS_WL_ROTATION_ROTATE_0] = WL_OUTPUT_TRANSFORM_NORMAL, + [EFL_CANVAS_WL_ROTATION_ROTATE_90] = WL_OUTPUT_TRANSFORM_90, + [EFL_CANVAS_WL_ROTATION_ROTATE_180] = WL_OUTPUT_TRANSFORM_180, + [EFL_CANVAS_WL_ROTATION_ROTATE_270] = WL_OUTPUT_TRANSFORM_270, }, { - [EFL_WL_ROTATION_ROTATE_0] = WL_OUTPUT_TRANSFORM_FLIPPED, - [EFL_WL_ROTATION_ROTATE_90] = WL_OUTPUT_TRANSFORM_FLIPPED_90, - [EFL_WL_ROTATION_ROTATE_180] = WL_OUTPUT_TRANSFORM_FLIPPED_180, - [EFL_WL_ROTATION_ROTATE_270] = WL_OUTPUT_TRANSFORM_FLIPPED_270, + [EFL_CANVAS_WL_ROTATION_ROTATE_0] = WL_OUTPUT_TRANSFORM_FLIPPED, + [EFL_CANVAS_WL_ROTATION_ROTATE_90] = WL_OUTPUT_TRANSFORM_FLIPPED_90, + [EFL_CANVAS_WL_ROTATION_ROTATE_180] = WL_OUTPUT_TRANSFORM_FLIPPED_180, + [EFL_CANVAS_WL_ROTATION_ROTATE_270] = WL_OUTPUT_TRANSFORM_FLIPPED_270, }, }; @@ -3173,7 +3174,7 @@ shell_surface_toplevel_set_parent(struct wl_client *client EINA_UNUSED, struct w comp_surface_reparent(cs, pcs); if (parent_resource) - efl_event_callback_call(cs->c->obj, EFL_WL_EVENT_CHILD_ADDED, cs->obj); + efl_event_callback_call(cs->c->obj, EFL_CANVAS_WL_EVENT_CHILD_ADDED, cs->obj); } static void @@ -3267,7 +3268,7 @@ shell_surface_toplevel_create(struct wl_client *client EINA_UNUSED, struct wl_re cs->role = wl_resource_create(client, &xdg_toplevel_interface, 1, id); wl_resource_set_implementation(cs->role, &shell_surface_toplevel_interface, cs, shell_surface_toplevel_impl_destroy); cs->shell.new = 1; - efl_event_callback_call(cs->c->obj, EFL_WL_EVENT_TOPLEVEL_ADDED, cs->obj); + efl_event_callback_call(cs->c->obj, EFL_CANVAS_WL_EVENT_TOPLEVEL_ADDED, cs->obj); } static void @@ -3356,7 +3357,7 @@ shell_surface_popup_create(struct wl_client *client, struct wl_resource *resourc comp_surface_reparent(cs, wl_resource_get_user_data(parent_resource)); cs->shell.positioner = wl_resource_get_user_data(positioner_resource); _apply_positioner(cs, cs->shell.positioner); - efl_event_callback_call(cs->c->obj, EFL_WL_EVENT_POPUP_ADDED, cs->obj); + efl_event_callback_call(cs->c->obj, EFL_CANVAS_WL_EVENT_POPUP_ADDED, cs->obj); } static void @@ -4472,7 +4473,7 @@ comp_seats_proxy(Comp *c) else if (!c->parent_disp) comp_device_caps_update(s); s->global = wl_global_create(c->display, &wl_seat_interface, 4, s, seat_bind); - efl_event_callback_call(s->c->obj, EFL_WL_EVENT_SEAT_ADDED, dev); + efl_event_callback_call(s->c->obj, EFL_CANVAS_WL_EVENT_SEAT_ADDED, dev); if (ecore_wl2_display_sync_is_done(c->client_disp)) seat_proxy_update(s); } @@ -5269,7 +5270,7 @@ efl_hints_bind(struct wl_client *client, void *data, uint32_t version, uint32_t } EOLIAN static Eo * -_efl_wl_efl_object_constructor(Eo *obj, Comp *c) +_efl_canvas_wl_efl_object_constructor(Eo *obj, Comp *c) { efl_canvas_group_clipped_set(obj, EINA_TRUE); EINA_SAFETY_ON_TRUE_RETURN_VAL(!ecore_wl2_init(), NULL); @@ -5277,7 +5278,7 @@ _efl_wl_efl_object_constructor(Eo *obj, Comp *c) } EOLIAN static void -_efl_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) +_efl_canvas_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) { char *env, *dbg = NULL; @@ -5288,13 +5289,13 @@ _efl_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) env = getenv("WAYLAND_DISPLAY"); if (env) env = strdup(env); - if (getenv("EFL_WL_DEBUG")) + if (getenv("EFL_CANVAS_WL_DEBUG")) { dbg = eina_strdup(getenv("WAYLAND_DEBUG")); setenv("WAYLAND_DEBUG", "1", 1); } c->disp = ecore_wl2_display_create(NULL); - if (getenv("EFL_WL_DEBUG")) + if (getenv("EFL_CANVAS_WL_DEBUG")) { if (dbg) setenv("WAYLAND_DEBUG", dbg, 1); else unsetenv("WAYLAND_DEBUG"); @@ -5366,7 +5367,7 @@ _efl_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) } EOLIAN static void -_efl_wl_efl_canvas_group_group_del(Eo *obj, Comp *c) +_efl_canvas_wl_efl_canvas_group_group_del(Eo *obj, Comp *c) { evas_object_del(c->clip); evas_object_del(c->events); @@ -5411,14 +5412,14 @@ _efl_wl_efl_canvas_group_group_del(Eo *obj, Comp *c) } static void -_efl_wl_efl_gfx_entity_position_set(Eo *obj, Comp *c, Eina_Position2D pos) +_efl_canvas_wl_efl_gfx_entity_position_set(Eo *obj, Comp *c, Eina_Position2D pos) { efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos); efl_gfx_entity_position_set(c->clip, pos); } static void -_efl_wl_efl_gfx_entity_size_set(Eo *obj, Comp *c, Eina_Size2D sz) +_efl_canvas_wl_efl_gfx_entity_size_set(Eo *obj, Comp *c, Eina_Size2D sz) { Eina_List *l; Comp_Surface *cs; @@ -5437,7 +5438,7 @@ _efl_wl_efl_gfx_entity_size_set(Eo *obj, Comp *c, Eina_Size2D sz) } static void -_efl_wl_efl_gfx_entity_visible_set(Eo *obj, Comp *c, Eina_Bool vis) +_efl_canvas_wl_efl_gfx_entity_visible_set(Eo *obj, Comp *c, Eina_Bool vis) { Comp_Surface *cs; @@ -5560,25 +5561,25 @@ comp_run(Eo *obj, Comp *c, const char *cmd, Efl_Exe_Flags flags) } EOLIAN static Efl_Exe * -_efl_wl_run(Eo *obj, Comp *c, const char *cmd) +_efl_canvas_wl_run(Eo *obj, Comp *c, const char *cmd) { return comp_run(obj, c, cmd, EFL_EXE_FLAGS_TERM_WITH_PARENT); } EOLIAN static Efl_Exe_Flags -_efl_wl_exec_flags_get(const Eo *obj, Comp *c) +_efl_canvas_wl_exec_flags_get(const Eo *obj, Comp *c) { return c->flags; } EOLIAN static void -_efl_wl_exec_flags_set(Eo *obj, Comp *c, Efl_Exe_Flags flags) +_efl_canvas_wl_exec_flags_set(Eo *obj, Comp *c, Efl_Exe_Flags flags) { c->flags = flags; } EOLIAN static void -_efl_wl_allowed_pid_add(Eo *obj, Comp *c, int32_t pid) +_efl_canvas_wl_allowed_pid_add(Eo *obj, Comp *c, int32_t pid) { if (!c->exes) c->exes = eina_hash_int32_new(NULL); @@ -5586,14 +5587,14 @@ _efl_wl_allowed_pid_add(Eo *obj, Comp *c, int32_t pid) } EOLIAN static void -_efl_wl_allowed_pid_del(Eo *obj, Comp *c, int32_t pid) +_efl_canvas_wl_allowed_pid_del(Eo *obj, Comp *c, int32_t pid) { if (!c->exes) return; eina_hash_del_by_key(c->exes, &pid); } EOLIAN static Eo * -_efl_wl_surface_next(Eo *obj, Comp *c) +_efl_canvas_wl_surface_next(Eo *obj, Comp *c) { Comp_Surface *cs; @@ -5611,7 +5612,7 @@ _efl_wl_surface_next(Eo *obj, Comp *c) } EOLIAN static Eo * -_efl_wl_surface_prev(Eo *obj, Comp *c) +_efl_canvas_wl_surface_prev(Eo *obj, Comp *c) { Comp_Surface *cs; @@ -5629,7 +5630,7 @@ _efl_wl_surface_prev(Eo *obj, Comp *c) } EOLIAN static Eo * -_efl_wl_active_surface_get(const Eo *obj, Comp *c) +_efl_canvas_wl_active_surface_get(const Eo *obj, Comp *c) { if (c->active_surface && (!c->active_surface->dead)) return c->active_surface->obj; @@ -5637,9 +5638,9 @@ _efl_wl_active_surface_get(const Eo *obj, Comp *c) } EOLIAN static Eina_Bool -_efl_wl_active_surface_set(Eo *obj, Comp *c, Eo *surface) +_efl_canvas_wl_active_surface_set(Eo *obj, Comp *c, Eo *surface) { - Comp_Surface *cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS); + Comp_Surface *cs = efl_data_scope_get(surface, EFL_CANVAS_WL_SURFACE_CLASS); EINA_SAFETY_ON_NULL_RETURN_VAL(cs, EINA_FALSE); if (cs->dead) return EINA_FALSE; if (c->active_surface == cs) return EINA_TRUE; @@ -5651,14 +5652,14 @@ _efl_wl_active_surface_set(Eo *obj, Comp *c, Eo *surface) } EOLIAN static void -_efl_wl_rotation_get(const Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation *rotation, Eina_Bool *rtl) +_efl_canvas_wl_rotation_get(const Eo *obj EINA_UNUSED, Comp *c, Efl_Canvas_Wl_Rotation *rotation, Eina_Bool *rtl) { if (rotation) *rotation = c->rotation; if (rtl) *rtl = c->rtl; } EOLIAN static void -_efl_wl_rotation_set(Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation rot, Eina_Bool rtl) +_efl_canvas_wl_rotation_set(Eo *obj EINA_UNUSED, Comp *c, Efl_Canvas_Wl_Rotation rot, Eina_Bool rtl) { Eina_List *l; struct wl_resource *res; @@ -5670,13 +5671,13 @@ _efl_wl_rotation_set(Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation rot, Eina_Boo } EOLIAN static double -_efl_wl_efl_gfx_entity_scale_get(const Eo *obj EINA_UNUSED, Comp *c) +_efl_canvas_wl_efl_gfx_entity_scale_get(const Eo *obj EINA_UNUSED, Comp *c) { return c->scale; } EOLIAN static void -_efl_wl_efl_gfx_entity_scale_set(Eo *obj EINA_UNUSED, Comp *c, double scale) +_efl_canvas_wl_efl_gfx_entity_scale_set(Eo *obj EINA_UNUSED, Comp *c, double scale) { Eina_List *l; struct wl_resource *res; @@ -5689,13 +5690,13 @@ _efl_wl_efl_gfx_entity_scale_set(Eo *obj EINA_UNUSED, Comp *c, double scale) } EOLIAN static Eina_Bool -_efl_wl_aspect_get(const Eo *obj EINA_UNUSED, Comp *c) +_efl_canvas_wl_aspect_get(const Eo *obj EINA_UNUSED, Comp *c) { return c->aspect; } EOLIAN static void -_efl_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) +_efl_canvas_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) { if (c->aspect == (!!set)) return; c->aspect = !!set; @@ -5706,13 +5707,13 @@ _efl_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) } EOLIAN static Eina_Bool -_efl_wl_minmax_get(const Eo *obj EINA_UNUSED, Comp *c) +_efl_canvas_wl_minmax_get(const Eo *obj EINA_UNUSED, Comp *c) { return c->minmax; } EOLIAN static void -_efl_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) +_efl_canvas_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) { if (c->minmax == (!!set)) return; c->minmax = !!set; @@ -5725,8 +5726,8 @@ _efl_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) } } -EOLIAN static Efl_Wl_Wl_Global * -_efl_wl_global_add(Eo *obj, Comp *c, const Efl_Wl_Wl_Interface *interface, uint32_t version, Efl_Wl_Wl_Interface_Data *data, Efl_Wl_Wl_Interface_Bind_Cb *bind_cb) +EOLIAN static Efl_Canvas_Wl_Wl_Global * +_efl_canvas_wl_global_add(Eo *obj, Comp *c, const Efl_Canvas_Wl_Wl_Interface *interface, uint32_t version, Efl_Canvas_Wl_Wl_Interface_Data *data, Efl_Canvas_Wl_Wl_Interface_Bind_Cb *bind_cb) { EINA_SAFETY_ON_NULL_RETURN_VAL(interface, NULL); return (void*)wl_global_create(c->display, (void*)interface, version, (void*)data, (void*)bind_cb); @@ -5769,7 +5770,7 @@ extracted_changed(void *data, Evas *e EINA_UNUSED, Eo *obj, void *event_info EIN } static EOLIAN int32_t -_efl_wl_surface_pid_get(const Eo *surface, Comp_Surface *cs) +_efl_canvas_wl_surface_pid_get(const Eo *surface, Comp_Surface *cs) { int32_t pid; EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, -1); @@ -5778,7 +5779,7 @@ _efl_wl_surface_pid_get(const Eo *surface, Comp_Surface *cs) } static EOLIAN Eina_Bool -_efl_wl_surface_extract(Eo *surface, Comp_Surface *cs) +_efl_canvas_wl_surface_extract(Eo *surface, Comp_Surface *cs) { EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->extracted, EINA_FALSE); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, EINA_FALSE); @@ -5792,7 +5793,7 @@ _efl_wl_surface_extract(Eo *surface, Comp_Surface *cs) } Eo * -efl_wl_extracted_surface_object_find(void *surface_resource) +efl_canvas_wl_extracted_surface_object_find(void *surface_resource) { Comp_Surface *cs = wl_resource_get_user_data(surface_resource); @@ -5804,7 +5805,7 @@ efl_wl_extracted_surface_object_find(void *surface_resource) } static EOLIAN Eo * -_efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) +_efl_canvas_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) { EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL); @@ -5813,13 +5814,13 @@ _efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) } static EOLIAN void -_efl_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Wl_Xkb_State *state, const char *str, Efl_Wl_Wl_Array *key_array) +_efl_canvas_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Canvas_Wl_Xkb_State *state, const char *str, Efl_Canvas_Wl_Wl_Array *key_array) { Comp_Seat *s; EINA_INLIST_FOREACH(c->seats, s) { - if (!seat) efl_wl_seat_keymap_set(obj, s->dev, state, str, key_array); + if (!seat) efl_canvas_wl_seat_keymap_set(obj, s->dev, state, str, key_array); else if (s->dev == seat) break; } if (!seat) return; @@ -5840,13 +5841,13 @@ _efl_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Wl_Xkb_State *state, con } static EOLIAN void -_efl_wl_seat_key_repeat_set(Eo *obj, Comp *c, Eo *seat, int repeat_rate, int repeat_delay) +_efl_canvas_wl_seat_key_repeat_set(Eo *obj, Comp *c, Eo *seat, int repeat_rate, int repeat_delay) { Comp_Seat *s; EINA_INLIST_FOREACH(c->seats, s) { - if (!seat) efl_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay); + if (!seat) efl_canvas_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay); else if (s->dev == seat) break; } if (!seat) return; @@ -5856,11 +5857,11 @@ _efl_wl_seat_key_repeat_set(Eo *obj, Comp *c, Eo *seat, int repeat_rate, int rep seat_kbd_repeat_rate_send(s); } -#define EFL_WL_EXTRA_OPS \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_wl), \ +#define EFL_CANVAS_WL_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_canvas_wl), \ -#define EFL_WL_SURFACE_EXTRA_OPS \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_wl_surface), \ +#define EFL_CANVAS_WL_SURFACE_EXTRA_OPS \ + EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_canvas_wl_surface), \ -#include "efl_wl.eo.c" -#include "efl_wl_surface.eo.c" +#include "efl_canvas_wl.eo.c" +#include "efl_canvas_wl_surface.eo.c" diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_canvas_wl/efl_canvas_wl.eo similarity index 55% rename from src/lib/efl_wl/efl_wl.eo rename to src/lib/efl_canvas_wl/efl_canvas_wl.eo index f52fa1a8c6..9924ce9a1f 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.eo @@ -1,17 +1,17 @@ import efl_exe; import efl_input_device; -import efl_wl_surface; +import efl_canvas_wl_surface; -struct @beta @extern Efl.Wl_Wl_Surface; [[ struct wl_surface. @since 1.24 ]] -struct @beta @extern Efl.Wl_Wl_Global; [[ struct wl_global. @since 1.24 ]] -struct @beta @extern Efl.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]] -struct @beta @extern Efl.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]] -struct @beta @extern Efl.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]] -struct @beta @extern Efl.Wl_Xkb_State; [[ struct xkb_state. @since 1.24 ]] -struct @beta @extern Efl.Wl_Wl_Array; [[ struct wl_array. @since 1.24 ]] +struct @beta @extern Efl.Canvas.Wl_Wl_Surface; [[ struct wl_surface. @since 1.24 ]] +struct @beta @extern Efl.Canvas.Wl_Wl_Global; [[ struct wl_global. @since 1.24 ]] +struct @beta @extern Efl.Canvas.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]] +struct @beta @extern Efl.Canvas.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]] +struct @beta @extern Efl.Canvas.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]] +struct @beta @extern Efl.Canvas.Wl_Xkb_State; [[ struct xkb_state. @since 1.24 ]] +struct @beta @extern Efl.Canvas.Wl_Wl_Array; [[ struct wl_array. @since 1.24 ]] -enum @beta Efl.Wl.Rotation +enum @beta Efl.Canvas.Wl.Rotation { [[Orientation of the internal compositor object in degrees. These values are COUNTER-CLOCKWISE. ]] @@ -21,7 +21,7 @@ enum @beta Efl.Wl.Rotation rotate_270 = 3 } -class @beta Efl.Wl extends Efl.Canvas.Group +class @beta Efl.Canvas.Wl extends Efl.Canvas.Group { [[ @since 1.24 @@ -52,10 +52,10 @@ class @beta Efl.Wl extends Efl.Canvas.Group } } surface_next { - return: Efl.Wl.Surface; + return: Efl.Canvas.Wl.Surface; } surface_prev { - return: Efl.Wl.Surface; + return: Efl.Canvas.Wl.Surface; } @property active_surface { get {} @@ -63,7 +63,7 @@ class @beta Efl.Wl extends Efl.Canvas.Group return: bool; } values { - surface: Efl.Wl.Surface; + surface: Efl.Canvas.Wl.Surface; } } @property aspect { @@ -78,25 +78,25 @@ class @beta Efl.Wl extends Efl.Canvas.Group } @property rotation { values { - rotation: Efl.Wl.Rotation; + rotation: Efl.Canvas.Wl.Rotation; rtl: bool; } } global_add { params { - interface: const(Efl.Wl_Wl_Interface) @by_ref; + interface: const(Efl.Canvas.Wl_Wl_Interface) @by_ref; version: uint; - data: Efl.Wl_Wl_Interface_Data @by_ref; - bind_cb: Efl.Wl_Wl_Interface_Bind_Cb @by_ref; + data: Efl.Canvas.Wl_Wl_Interface_Data @by_ref; + bind_cb: Efl.Canvas.Wl_Wl_Interface_Bind_Cb @by_ref; } - return: Efl.Wl_Wl_Global @by_ref; + return: Efl.Canvas.Wl_Wl_Global @by_ref; } seat_keymap_set { params { seat: Efl.Input.Device; - state: Efl.Wl_Xkb_State @by_ref; + state: Efl.Canvas.Wl_Xkb_State @by_ref; keymap_str: string; - key_array: Efl.Wl_Wl_Array @by_ref; + key_array: Efl.Canvas.Wl_Wl_Array @by_ref; } } seat_key_repeat_set { @@ -115,9 +115,9 @@ class @beta Efl.Wl extends Efl.Canvas.Group Efl.Gfx.Entity.scale { get; set; } } events { - toplevel,added: Efl.Wl.Surface; [[]] - child,added: Efl.Wl.Surface; [[]] - popup,added: Efl.Wl.Surface; [[]] + toplevel,added: Efl.Canvas.Wl.Surface; [[]] + child,added: Efl.Canvas.Wl.Surface; [[]] + popup,added: Efl.Canvas.Wl.Surface; [[]] seat,added: Efl.Input.Device; [[The seat object added.]] } } diff --git a/src/lib/efl_wl/efl_wl_surface.eo b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo similarity index 81% rename from src/lib/efl_wl/efl_wl_surface.eo rename to src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo index 65c7327c95..d93e7d1ce6 100644 --- a/src/lib/efl_wl/efl_wl_surface.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo @@ -1,4 +1,4 @@ -class @beta Efl.Wl.Surface extends Efl.Canvas.Group +class @beta Efl.Canvas.Wl.Surface extends Efl.Canvas.Group { [[@since 1.24]] data: Comp_Surface; @@ -15,7 +15,7 @@ class @beta Efl.Wl.Surface extends Efl.Canvas.Group @property parent_surface { get {} values { - parent: Efl.Wl.Surface; + parent: Efl.Canvas.Wl.Surface; } } } diff --git a/src/lib/efl_wl/meson.build b/src/lib/efl_canvas_wl/meson.build similarity index 56% rename from src/lib/efl_wl/meson.build rename to src/lib/efl_canvas_wl/meson.build index ca1a082e36..d021975844 100644 --- a/src/lib/efl_wl/meson.build +++ b/src/lib/efl_canvas_wl/meson.build @@ -1,14 +1,14 @@ -efl_wl_deps = [ecore_wl2, ecore_input, ecore, ecore_evas, evas, emile, eina] -efl_wl_pub_deps = [eo, efl, evas, dependency('wayland-server', version : '>= 1.11.0'), dependency('xkbcommon', version : '>= 0.6.0')] +efl_canvas_wl_deps = [ecore_wl2, ecore_input, ecore, ecore_evas, evas, emile, eina] +efl_canvas_wl_pub_deps = [eo, efl, evas, dependency('wayland-server', version : '>= 1.11.0'), dependency('xkbcommon', version : '>= 0.6.0')] if (get_option('x11')) - efl_wl_deps += [ecore_x] - efl_wl_pub_deps += [dependency('xkbcommon-x11')] + efl_canvas_wl_deps += [ecore_x] + efl_canvas_wl_pub_deps += [dependency('xkbcommon-x11')] endif pub_eo_files = [ - 'efl_wl.eo', - 'efl_wl_surface.eo', + 'efl_canvas_wl.eo', + 'efl_canvas_wl_surface.eo', ] foreach eo_file : pub_eo_files @@ -25,36 +25,36 @@ foreach eo_file : pub_eo_files '-gchd', '@INPUT@']) endforeach -efl_wl_src = [ +efl_canvas_wl_src = [ 'dmabuf.c', - 'efl_wl.c', + 'efl_canvas_wl.c', ] -efl_wl_header_src = ['Efl_Wl.h'] +efl_canvas_wl_header_src = ['Efl_Canvas_Wl.h'] eolian_include_directories += ['-I', meson.current_source_dir()] -efl_wl_lib = library('efl_wl', - efl_wl_src, pub_eo_file_target, - dependencies: [m, dl] + efl_wl_deps + efl_wl_pub_deps, +efl_canvas_wl_lib = library('efl_canvas_wl', + efl_canvas_wl_src, pub_eo_file_target, + dependencies: [m, dl] + efl_canvas_wl_deps + efl_canvas_wl_pub_deps, include_directories : config_dir + [include_directories(join_paths('..','..'))], install: true, c_args : package_c_args, version : meson.project_version() ) -efl_wl = declare_dependency( +efl_canvas_wl = declare_dependency( include_directories: [include_directories('.')], - link_with: efl_wl_lib, + link_with: efl_canvas_wl_lib, sources: pub_eo_file_target, - dependencies: efl_wl_pub_deps, + dependencies: efl_canvas_wl_pub_deps, ) -install_headers(efl_wl_header_src, +install_headers(efl_canvas_wl_header_src, install_dir : dir_package_include, ) -eolian_efl_wl_dir = join_paths(eolian_include_dir, package_version_name) +eolian_efl_canvas_wl_dir = join_paths(eolian_include_dir, package_version_name) if get_option('install-eo-files') install_data(pub_eo_files, - install_dir: eolian_efl_wl_dir + install_dir: eolian_efl_canvas_wl_dir ) endif diff --git a/src/lib/efl_wl/x11.x b/src/lib/efl_canvas_wl/x11.x similarity index 100% rename from src/lib/efl_wl/x11.x rename to src/lib/efl_canvas_wl/x11.x From 955574c0448f15c717f906fc50cb8eb590884170 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:16:20 -0400 Subject: [PATCH 22/36] add EFL_VERSION_1_24 define Summary: this needs to go in right after every release Reviewers: stefan_schmidt, devilhorns Reviewed By: stefan_schmidt, devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11477 --- src/bin/edje/edje_cc_parse.c | 4 +++- src/lib/efl/Efl.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c index ad1a2c95ac..e6db4f5840 100644 --- a/src/bin/edje/edje_cc_parse.c +++ b/src/bin/edje/edje_cc_parse.c @@ -30,6 +30,7 @@ #define EDJE_1_21_SUPPORTED " -DEFL_VERSION_1_21=1 " #define EDJE_1_22_SUPPORTED " -DEFL_VERSION_1_22=1 " #define EDJE_1_23_SUPPORTED " -DEFL_VERSION_1_23=1 " +#define EDJE_1_24_SUPPORTED " -DEFL_VERSION_1_24=1 " #define EDJE_CC_EFL_VERSION_SUPPORTED \ EDJE_1_18_SUPPORTED \ @@ -37,7 +38,8 @@ EDJE_1_20_SUPPORTED \ EDJE_1_21_SUPPORTED \ EDJE_1_22_SUPPORTED \ - EDJE_1_23_SUPPORTED + EDJE_1_23_SUPPORTED \ + EDJE_1_24_SUPPORTED static void new_object(void); static void new_statement(void); diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index ea891223e9..81e274883b 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -52,6 +52,7 @@ extern "C" { #define EFL_VERSION_1_21 1 #define EFL_VERSION_1_22 1 #define EFL_VERSION_1_23 1 +#define EFL_VERSION_1_24 1 /* Add here all the required ifdef for any @protected method */ #ifdef EFL_BUILD From 07b8f7f0ffe003f80bc507211d9334fe6bfd97df Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:16:25 -0400 Subject: [PATCH 23/36] efl/wl: add 'extracted' property for surfaces Summary: useful to be able to know whether a surface has been extracted Depends on D11476 Reviewers: segfaultxavi, bu5hm4n Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11495 --- src/lib/efl_canvas_wl/efl_canvas_wl.c | 8 ++++++++ src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c index 801c3f3fd3..997703299f 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.c +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c @@ -5813,6 +5813,14 @@ _efl_canvas_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) return NULL; } +static EOLIAN Eina_Bool +_efl_canvas_wl_surface_extracted_get(const Eo *surface EINA_UNUSED, Comp_Surface *cs) +{ + EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, EINA_FALSE); + + return cs->extracted; +} + static EOLIAN void _efl_canvas_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Canvas_Wl_Xkb_State *state, const char *str, Efl_Canvas_Wl_Wl_Array *key_array) { diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo index d93e7d1ce6..f2a351becc 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo @@ -18,6 +18,12 @@ class @beta Efl.Canvas.Wl.Surface extends Efl.Canvas.Group parent: Efl.Canvas.Wl.Surface; } } + @property extracted { + get {} + values { + extracted: bool; + } + } } implements { Efl.Object.constructor; From 592ca5ea3b4622e971145fb9558f8d5c24f44f67 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:16:31 -0400 Subject: [PATCH 24/36] efl/wl: define opaque wl/xkb types to native types when those headers are included Summary: simplify a lot of casting when we're in a native wl env Depends on D11495 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11496 --- src/lib/efl_canvas_wl/Efl_Canvas_Wl.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h index b62f0de729..0fae48a3a9 100644 --- a/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h +++ b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h @@ -22,15 +22,26 @@ #define EWAPI EAPI EAPI_WEAK - +#ifdef WAYLAND_UTIL_H +typedef struct wl_surface Efl_Canvas_Wl_Wl_Surface; +typedef struct wl_global Efl_Canvas_Wl_Wl_Global; +typedef struct wl_interface Efl_Canvas_Wl_Wl_Interface; +typedef struct wl_array Efl_Canvas_Wl_Wl_Array; +typedef void Efl_Canvas_Wl_Wl_Interface_Data; +typedef void Efl_Canvas_Wl_Wl_Interface_Bind_Cb; +#else typedef struct Efl_Canvas_Wl_Wl_Surface Efl_Canvas_Wl_Wl_Surface; typedef struct Efl_Canvas_Wl_Wl_Global Efl_Canvas_Wl_Wl_Global; typedef struct Efl_Canvas_Wl_Wl_Interface Efl_Canvas_Wl_Wl_Interface; typedef struct Efl_Canvas_Wl_Wl_Array Efl_Canvas_Wl_Wl_Array; typedef void * Efl_Canvas_Wl_Wl_Interface_Data; typedef void * Efl_Canvas_Wl_Wl_Interface_Bind_Cb; +#endif +#ifdef _XKBCOMMON_H_ +typedef struct xkb_state Efl_Canvas_Wl_Xkb_State; +#else typedef struct Efl_Canvas_Wl_Xkb_State Efl_Canvas_Wl_Xkb_State; - +#endif #include #include /** From 65b081394dc421dd6d2283213f8cf0c7c6dd4748 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:16:37 -0400 Subject: [PATCH 25/36] efl/exe: don't err on del if exe has been killed Summary: the point of this err is to inform the user that their exe is (possibly) dangling, but if the user just wants to ignore the exit callback this isn't a problem Depends on D11496 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11497 --- src/lib/ecore/efl_exe.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index 1cb0276205..c5a2f57343 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -69,6 +69,7 @@ struct _Efl_Exe_Data } fd; #endif Eina_Bool exit_called : 1; + Eina_Bool exit_signalled : 1; Eina_Bool run : 1; }; @@ -269,10 +270,10 @@ _efl_exe_signal(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Exe_Signal sig) switch (sig) { - case EFL_EXE_SIGNAL_INT: s = SIGINT; break; - case EFL_EXE_SIGNAL_QUIT: s = SIGQUIT; break; - case EFL_EXE_SIGNAL_TERM: s = SIGTERM; break; - case EFL_EXE_SIGNAL_KILL: s = SIGKILL; break; + case EFL_EXE_SIGNAL_INT: s = SIGINT; pd->exit_signalled = EINA_TRUE; break; + case EFL_EXE_SIGNAL_QUIT: s = SIGQUIT; pd->exit_signalled = EINA_TRUE; break; + case EFL_EXE_SIGNAL_TERM: s = SIGTERM; pd->exit_signalled = EINA_TRUE; break; + case EFL_EXE_SIGNAL_KILL: s = SIGKILL; pd->exit_signalled = EINA_TRUE; break; case EFL_EXE_SIGNAL_CONT: s = SIGCONT; break; case EFL_EXE_SIGNAL_STOP: s = SIGSTOP; break; case EFL_EXE_SIGNAL_HUP: s = SIGHUP; break; @@ -581,6 +582,7 @@ _efl_exe_efl_task_end(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) #ifdef _WIN32 #else if (pd->pid == -1) return; + pd->exit_signalled = EINA_TRUE; kill(pd->pid, SIGINT); #endif } @@ -623,7 +625,7 @@ _efl_exe_efl_object_destructor(Eo *obj, Efl_Exe_Data *pd) { #ifdef _WIN32 #else - if (!pd->exit_called) + if ((!pd->exit_called) && (!pd->exit_signalled)) ERR("Exe being destroyed while child has not exited yet."); if (pd->fd.exited_read >= 0) { From 47107a45ae6ab16850e744a401f1914ba2a8cbf4 Mon Sep 17 00:00:00 2001 From: Taehyub Kim Date: Thu, 12 Mar 2020 12:16:39 -0400 Subject: [PATCH 26/36] efl_canvas_vg_shape: fix the wrong parameter order in the wrapper of evas_vg_shape_append_cubic_to() Summary: The x, y parameter order should be the end of efl_gfx_path_append_cubic_to() Reviewers: Hermet, jsuya Reviewed By: jsuya Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11491 --- src/lib/evas/canvas/efl_canvas_vg_shape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index 5ddff89350..cf220821d6 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -402,7 +402,7 @@ evas_vg_shape_append_squadratic_to(Eo *obj, double x, double y) EAPI void evas_vg_shape_append_cubic_to(Eo *obj, double x, double y, double ctrl_x0, double ctrl_y0, double ctrl_x1, double ctrl_y1) { - efl_gfx_path_append_cubic_to(obj, x, y, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1); + efl_gfx_path_append_cubic_to(obj, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1, x, y); efl_canvas_vg_node_change(obj); } From 7273229e3c31dfde4ea64d2f0cc8cda4c8c53d2a Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 12 Mar 2020 11:02:11 +0100 Subject: [PATCH 27/36] doxygen docs: Fix some more invalid commands --- src/lib/evas/canvas/evas_canvas_eo.h | 2 +- src/lib/evas/filters/evas_filter_parser.c | 42 +++++++++++------------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/lib/evas/canvas/evas_canvas_eo.h b/src/lib/evas/canvas/evas_canvas_eo.h index 938d59fcee..74cd5ef05c 100644 --- a/src/lib/evas/canvas/evas_canvas_eo.h +++ b/src/lib/evas/canvas/evas_canvas_eo.h @@ -808,7 +808,7 @@ EOAPI int evas_canvas_coord_world_x_to_screen(const Eo *obj, int x) EINA_WARN_UN * @param[in] obj The object. * * @return A newly allocated list of updated rectangles of the canvas - * (@Eina.Rect structs). Free this list with @ref evas_render_updates_free. + * (@ref Eina_Rect structs). Free this list with @ref evas_render_updates_free. * * @ingroup Evas_Canvas */ diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index 38d68224d9..43fd1d17d4 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -60,7 +60,7 @@ as possible. Note: Lua has been used since 1.10. The previous filters syntax is not - garanteed to be compatible with 1.10 and newer versions. + guaranteed to be compatible with 1.10 and newer versions. Here are the available commands:
    @@ -136,28 +136,28 @@ will be opaque (alpha = @c 0xFF), unless R=G=B=0 (invisible). These colors are not premultiplied. -
  • Hexademical values: @c '#RRGGBB', @c '#RRGGBBAA', @c '#RGB', @c '#RGBA'
  • +
  • Hexadecimal values: @c '\#RRGGBB', @c '\#RRGGBBAA', @c '\#RGB', @c '\#RGBA'
  • The following string values are also accepted:
    • -
    • 'white' == '#FFFFFF'
    • -
    • 'black' == '#000000'
    • -
    • 'red' == '#FF0000'
    • -
    • 'green' == '#008000'
    • -
    • 'blue' == '#0000FF'
    • -
    • 'darkblue' == '#0000A0'
    • -
    • 'yellow' == '#FFFF00'
    • -
    • 'magenta' == '#FF00FF'
    • -
    • 'cyan' == '#00FFFF'
    • -
    • 'orange' == '#FFA500'
    • -
    • 'purple' == '#800080'
    • -
    • 'brown' == '#A52A2A'
    • -
    • 'maroon' == '#800000'
    • -
    • 'lime' == '#00FF00'
    • -
    • 'gray' == '#808080'
    • -
    • 'grey' == '#808080'
    • -
    • 'silver' == '#C0C0C0'
    • -
    • 'olive' == '#808000'
    • -
    • 'invisible', 'transparent' == '#0000' -- (alpha is zero)
    • +
    • 'white' == '\#FFFFFF'
    • +
    • 'black' == '\#000000'
    • +
    • 'red' == '\#FF0000'
    • +
    • 'green' == '\#008000'
    • +
    • 'blue' == '\#0000FF'
    • +
    • 'darkblue' == '\#0000A0'
    • +
    • 'yellow' == '\#FFFF00'
    • +
    • 'magenta' == '\#FF00FF'
    • +
    • 'cyan' == '\#00FFFF'
    • +
    • 'orange' == '\#FFA500'
    • +
    • 'purple' == '\#800080'
    • +
    • 'brown' == '\#A52A2A'
    • +
    • 'maroon' == '\#800000'
    • +
    • 'lime' == '\#00FF00'
    • +
    • 'gray' == '\#808080'
    • +
    • 'grey' == '\#808080'
    • +
    • 'silver' == '\#C0C0C0'
    • +
    • 'olive' == '\#808000'
    • +
    • 'invisible', 'transparent' == '\#0000' -- (alpha is zero)
  • @c fillmode
  • From 883a09a3ae8dfb887812bda5577d25de92a4ec24 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 12 Mar 2020 11:12:29 +0100 Subject: [PATCH 28/36] doxygen docs: Fix some more Illegal commands Who thought that Italic Links was a good idea? Anyway, Doxygen does not like them. --- src/lib/elementary/elm_diskselector.h | 2 +- src/lib/elementary/elm_entry.h | 2 +- src/lib/elementary/elm_gengrid.h | 2 +- src/lib/elementary/elm_genlist.h | 2 +- src/lib/elementary/elm_list.h | 2 +- src/lib/elementary/elm_map.h | 2 +- src/lib/elementary/elm_photocam.h | 2 +- src/lib/elementary/elm_toolbar.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/elementary/elm_diskselector.h b/src/lib/elementary/elm_diskselector.h index a6b40fb984..c8418263e2 100644 --- a/src/lib/elementary/elm_diskselector.h +++ b/src/lib/elementary/elm_diskselector.h @@ -15,7 +15,7 @@ * It can act like a circular list with round mode and labels can be * reduced for a defined length for side items. * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base @ref * Scroller widget also work for diskselectors. * diff --git a/src/lib/elementary/elm_entry.h b/src/lib/elementary/elm_entry.h index ba41964082..3e187b93cd 100644 --- a/src/lib/elementary/elm_entry.h +++ b/src/lib/elementary/elm_entry.h @@ -30,7 +30,7 @@ * This widget inherits from the @ref Elm_Layout one, so that all the * functions acting on it also work for entry objects (since 1.8). * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base * @ref Elm_Scroller widget also work for entries (since 1.8). * diff --git a/src/lib/elementary/elm_gengrid.h b/src/lib/elementary/elm_gengrid.h index 9485b7781e..0e781fa584 100644 --- a/src/lib/elementary/elm_gengrid.h +++ b/src/lib/elementary/elm_gengrid.h @@ -19,7 +19,7 @@ * This widget inherits from the @ref Layout one, so that all the * functions acting on it also work for gengrid objects. * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base @ref * Scroller widget also work for gengrids. * diff --git a/src/lib/elementary/elm_genlist.h b/src/lib/elementary/elm_genlist.h index e060a685e7..8a1691c0d9 100644 --- a/src/lib/elementary/elm_genlist.h +++ b/src/lib/elementary/elm_genlist.h @@ -22,7 +22,7 @@ * This widget inherits from the @ref Layout one, so that all the * functions acting on it also work for genlist objects. * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base @ref * Scroller widget also work for genlists. * diff --git a/src/lib/elementary/elm_list.h b/src/lib/elementary/elm_list.h index 72f5a1084f..07147b4cf7 100644 --- a/src/lib/elementary/elm_list.h +++ b/src/lib/elementary/elm_list.h @@ -75,7 +75,7 @@ * @li @ref elm_object_item_del * @li @ref elm_object_item_signal_emit * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base @ref * Scroller widget also work for lists. * diff --git a/src/lib/elementary/elm_map.h b/src/lib/elementary/elm_map.h index bf257309ef..011e84182f 100644 --- a/src/lib/elementary/elm_map.h +++ b/src/lib/elementary/elm_map.h @@ -18,7 +18,7 @@ * @li group of markers and * @li routes. * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base @ref * Scroller widget also work for map objects. * diff --git a/src/lib/elementary/elm_photocam.h b/src/lib/elementary/elm_photocam.h index 7286366711..a1ad4fd2d0 100644 --- a/src/lib/elementary/elm_photocam.h +++ b/src/lib/elementary/elm_photocam.h @@ -42,7 +42,7 @@ * @li @c "focused" - When the photocam has received focus. (since 1.8) * @li @c "unfocused" - When the photocam has lost focus. (since 1.8) * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base @ref * Scroller widget also work for photocam objects. * diff --git a/src/lib/elementary/elm_toolbar.h b/src/lib/elementary/elm_toolbar.h index 5dcfaa838f..fc88da16ad 100644 --- a/src/lib/elementary/elm_toolbar.h +++ b/src/lib/elementary/elm_toolbar.h @@ -19,7 +19,7 @@ * * Items can have multiple states, or show menus when selected by the user. * - * This widget implements the @b @ref elm-scrollable-interface + * This widget implements the @ref elm-scrollable-interface * interface, so that all (non-deprecated) functions for the base * @ref Scroller widget also work for toolbars (since 1.8) * From 500b9f611ba17724b041771c2d028de9dfa92e23 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 12 Mar 2020 13:18:02 +0100 Subject: [PATCH 29/36] doxygen docs: Do not parse file Eo.h Doxygen is used to build Legacy documentation, which is unrelated to Eo.h This fixes quite a few "explicit link request could not be resolved" problems produced by Eo.h which was missing the rest of the Unified Efl headers. --- doc/Doxyfile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 0a62bfdec7..17f86aec5e 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -666,7 +666,8 @@ EXCLUDE_PATTERNS = *_private* \ */efl_*.eo.c \ */efl_*.eo.h \ */efl_*.eot.h \ - */Efl_* + */Efl_* \ + */Eo.h # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the From a004befea51e82899654cb583e03108c29a169a2 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 12 Mar 2020 13:52:42 +0100 Subject: [PATCH 30/36] doxygen docs: Fix illegal references Mostly typos and unescaped # signs --- doc/eo_tutorial.dox | 4 ++-- src/bin/edje/edje_cc_handlers.c | 2 +- src/lib/eina/eina_value.h | 4 ++-- src/lib/evas/filters/evas_filter_parser.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/eo_tutorial.dox b/doc/eo_tutorial.dox index d8e7d7fb8d..baeb10d857 100644 --- a/doc/eo_tutorial.dox +++ b/doc/eo_tutorial.dox @@ -120,11 +120,11 @@ * * @section create_class_h_side How to create a class - H side? * - If the object is new, establish the public APIs - * - #define \$(CLASS_NAME) \$(class_name)_class_get(): will be used to access data/inherit from this class... + * - \#define \$(CLASS_NAME) \$(class_name)_class_get(): will be used to access data/inherit from this class... * - const Eo_Class *\$(class_name)_class_get(void) EINA_CONST: declaration of the function that will create the class (not the instance), i.e virtual table... * - extern EAPI Eo_Op \$(CLASS_NAME)_BASE_ID: class id that will be essentially used to identify functions set of this class * - enum of the function ids of the class in the form \$(CLASS_NAME)_SUB_ID: used to identify the function inside the class; function id is unique per class but (class id, function id) is unique per system.. - * - #define \$(CLASS_NAME)_ID(sub_id) (\$(CLASS_NAME)_BASE_ID + sub_id): formula to calculate the system function id + * - \#define \$(CLASS_NAME)_ID(sub_id) (\$(CLASS_NAME)_BASE_ID + sub_id): formula to calculate the system function id * - define of each function consists of: * - the name of the function that will be used in eo_do * - parameters without types diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 431dea7bdb..913a749d54 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -4562,7 +4562,7 @@ st_collections_group_name(void) This property can be inherited. Defaults: 0 - @warning Your edc file should always wrap this keyword with #ifdef HAVE_SKIP_NAMESPACE_VALIDATION + @warning Your edc file should always wrap this keyword with \#ifdef HAVE_SKIP_NAMESPACE_VALIDATION @since 1.21 @endproperty */ diff --git a/src/lib/eina/eina_value.h b/src/lib/eina/eina_value.h index faca4bfde1..89793992e7 100644 --- a/src/lib/eina/eina_value.h +++ b/src/lib/eina/eina_value.h @@ -3256,7 +3256,7 @@ static inline Eina_Bool eina_value_struct_setup(Eina_Value *value, * * @param[in] value Value object * @return structure description, with all members and size. - * on failure, #NULL is returned. + * on failure, @c NULL is returned. * * @since 1.21 */ @@ -3706,7 +3706,7 @@ EAPI const char *eina_value_type_name_get(const Eina_Value_Type *type) EINA_PURE * @param[in] type Type reference. * @return #EINA_TRUE if valid, #EINA_FALSE otherwise. * - * A type is invalid if it's NULL or if version field is not the same + * A type is invalid if it's @c NULL or if version field is not the same * as runtime #EINA_VALUE_TYPE_VERSION. * * @since 1.2 diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c index 43fd1d17d4..eaf39119a8 100644 --- a/src/lib/evas/filters/evas_filter_parser.c +++ b/src/lib/evas/filters/evas_filter_parser.c @@ -1173,7 +1173,7 @@ _blur_instruction_prepare(Evas_Filter_Program *pgm, Evas_Filter_Instruction *ins @param src Source buffer. This should be an alpha buffer. @param dst Destination buffer. This should be an RGBA buffer (although alpha is supported). Must be of the same size as @a src. @param black The shadows' color. Usually this will be black (@c #000). - @param white The specular light's color. Usually this will be white (@c #FFF). + @param white The specular light's color. Usually this will be white (@c \#FFF). @param fillmode This specifies how to handle @a map when its dimensions don't match those of @a src and @a dst. Default is to @c repeat. See @ref evasfilter_fillmode "fillmodes". @note As of 2014/02/11, the ALPHA to RGBA support is of much better quality than ALPHA only, but @b very slow. RGBA sources are not supported yet. From fcb48ef4022a49b147ad4daf4bb1f958d039b07a Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Thu, 12 Mar 2020 16:52:41 +0000 Subject: [PATCH 31/36] evas_object_box: respect static clipper. Check here for a static clipper else the clipper will move. This causes problems with very large boxes where content will stop rendering due to the clipper moving. Originally this wasn't meant to move but this was missed with the API changes. It wasn't noticed as the clipper default size is very large. See: src/lib/evas/canvas/evas_object_smart.c. If we exceed the 10k range content does not render due to the move. @fix --- src/lib/evas/canvas/evas_object_box.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c index 7853ee3e10..e591bae0e5 100644 --- a/src/lib/evas/canvas/evas_object_box.c +++ b/src/lib/evas/canvas/evas_object_box.c @@ -445,7 +445,9 @@ _evas_box_efl_gfx_entity_position_set(Eo *o, Evas_Object_Box_Data *_pd EINA_UNUS if (_evas_object_intercept_call(o, EVAS_OBJECT_INTERCEPT_CB_MOVE , 0, pos.x, pos.y)) return; - efl_gfx_entity_position_set(cso->clipper, pos); + if (!evas_object_static_clip_get(cso->clipper)) + efl_gfx_entity_position_set(cso->clipper, pos); + /* this skips the call to _evas_object_smart_clipped_smart_move_internal * since box internals will automatically recalc all the child positions * at a later point From 35727d29c37a9cb4a60b83475ced265fdb92e0a9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 09:11:53 -0400 Subject: [PATCH 32/36] efl/gesture: add fallback for glayer_tap_finger_size not being found just in case Differential Revision: https://phab.enlightenment.org/D11494 --- src/lib/evas/gesture/efl_canvas_gesture_manager.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c index 48f515471c..29745843bb 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c @@ -139,6 +139,7 @@ EOLIAN static Efl_Object * _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd) { Eo *config; + int finger_size = 0; obj = efl_constructor(efl_super(obj, MY_CLASS)); pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb)); @@ -160,7 +161,12 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_FLICK_CLASS, obj)); efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ROTATE_CLASS, obj)); efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ZOOM_CLASS, obj)); - _update_finger_sizes(pd, efl_config_int_get(config, "glayer_tap_finger_size")); + /* realistically this will never fail, but the whole gesture layer breaks if this is 0 */ + finger_size = efl_config_int_get(config, "glayer_tap_finger_size"); + if (!getenv("EFL_RUN_IN_TREE")) + finger_size = efl_config_int_get(config, "glayer_tap_finger_size"); + if (finger_size < 1) finger_size = 10; + _update_finger_sizes(pd, finger_size); return obj; } From 765c5c2a0b2c28c4b8497b28ffbd64f159a446d6 Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Tue, 10 Mar 2020 08:46:18 +0000 Subject: [PATCH 33/36] efl.ui.textbox: proxy for efl.ui.scrollable interface Allow users to use scroller functinality with efl.ui.textbox Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11479 --- src/lib/elementary/efl_ui_textbox.c | 142 +++++++++++++++++++++++++++ src/lib/elementary/efl_ui_textbox.eo | 14 ++- 2 files changed, 155 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c index 11f79b23fd..17cd36fd4a 100644 --- a/src/lib/elementary/efl_ui_textbox.c +++ b/src/lib/elementary/efl_ui_textbox.c @@ -3233,6 +3233,148 @@ _efl_ui_textbox_item_factory_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data return pd->item_factory; } +/*Efl.Ui.Scrollable*/ +EOLIAN static Eina_Size2D +_efl_ui_textbox_efl_ui_scrollable_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_SIZE2D(0, 0)); + return efl_ui_scrollable_content_size_get(sd->scroller); +} + +EOLIAN static Eina_Rect +_efl_ui_textbox_efl_ui_scrollable_viewport_geometry_get(const Eo *obj EINA_UNUSED, + Efl_Ui_Textbox_Data *sd) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_RECT_EMPTY()); + return efl_ui_scrollable_viewport_geometry_get(sd->scroller); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_match_content_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool w, Eina_Bool h) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + return efl_ui_scrollable_match_content_set(sd->scroller, !!w, !!h); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_step_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Position2D step) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_step_size_set(sd->scroller, step); +} + +EOLIAN static Eina_Position2D +_efl_ui_textbox_efl_ui_scrollable_step_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_POSITION2D(0, 0)); + return efl_ui_scrollable_step_size_get(sd->scroller); +} + +EOLIAN static Eina_Position2D +_efl_ui_textbox_efl_ui_scrollable_content_pos_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_POSITION2D(0, 0)); + return efl_ui_scrollable_content_pos_get(sd->scroller); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_content_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Position2D pos) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_content_pos_set(sd->scroller, pos); +} + +EOLIAN static Eina_Bool +_efl_ui_textbox_efl_ui_scrollable_scroll_hold_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_FALSE); + return efl_ui_scrollable_scroll_hold_get(sd->scroller); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_scroll_hold_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool hold) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_scroll_hold_set(sd->scroller, !!hold); +} + +EOLIAN static Eina_Bool +_efl_ui_textbox_efl_ui_scrollable_scroll_freeze_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EINA_FALSE); + return efl_ui_scrollable_scroll_freeze_get(sd->scroller); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_scroll_freeze_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool freeze) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_scroll_freeze_set(sd->scroller, !!freeze); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_bounce_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool horiz, Eina_Bool vert) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_bounce_enabled_set(sd->scroller, !!horiz, !!vert); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_bounce_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool *horiz, Eina_Bool *vert) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_bounce_enabled_get(sd->scroller, horiz, vert); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_scroll(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Rect rect, Eina_Bool animation) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_scroll(sd->scroller, rect, animation); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_gravity_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, double *x, double *y) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_gravity_get(sd->scroller, x, y); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_gravity_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, double x, double y) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_gravity_set(sd->scroller, x, y); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_movement_block_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Efl_Ui_Layout_Orientation block) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_movement_block_set(sd->scroller, block); +} + +EOLIAN static Efl_Ui_Layout_Orientation +_efl_ui_textbox_efl_ui_scrollable_movement_block_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->scroller, EFL_UI_LAYOUT_ORIENTATION_DEFAULT); + return efl_ui_scrollable_movement_block_get(sd->scroller); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_looping_set(Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool loop_h, Eina_Bool loop_v) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_looping_set(sd->scroller, !!loop_h, !!loop_v); +} + +EOLIAN static void +_efl_ui_textbox_efl_ui_scrollable_looping_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *sd, Eina_Bool *loop_h, Eina_Bool *loop_v) +{ + EINA_SAFETY_ON_NULL_RETURN(sd->scroller); + efl_ui_scrollable_looping_get(sd->scroller, loop_h, loop_v); +} + /* Efl.Part begin */ static Eina_Bool diff --git a/src/lib/elementary/efl_ui_textbox.eo b/src/lib/elementary/efl_ui_textbox.eo index 2605c477a3..c4833f315d 100644 --- a/src/lib/elementary/efl_ui_textbox.eo +++ b/src/lib/elementary/efl_ui_textbox.eo @@ -11,7 +11,7 @@ enum @beta Efl.Ui.Textbox_Cnp_Content { } class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Clickable, - Efl.Access.Text, Efl.Access.Editable.Text + Efl.Access.Text, Efl.Access.Editable.Text, Efl.Ui.Scrollable composites Efl.Text_Interactive, Efl.Text_Markup, Efl.Input_Text { @@ -133,6 +133,18 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click Efl.Access.Editable.Text.paste; Efl.Text_Interactive.editable { set; } Efl.Part.part_get; + Efl.Ui.Scrollable.content_pos { set; get; } + Efl.Ui.Scrollable.content_size{ get; } + Efl.Ui.Scrollable.viewport_geometry{ get; } + Efl.Ui.Scrollable.bounce_enabled { set; get; } + Efl.Ui.Scrollable.scroll_freeze { get; set; } + Efl.Ui.Scrollable.scroll_hold { get; set; } + Efl.Ui.Scrollable.looping { get; set; } + Efl.Ui.Scrollable.movement_block { get; set; } + Efl.Ui.Scrollable.gravity { get; set; } + Efl.Ui.Scrollable.match_content { set; } + Efl.Ui.Scrollable.step_size { set; get; } + Efl.Ui.Scrollable.scroll; } events { selection,paste: void; [[Called when selection is pasted.]] From eaa06230ddf53a444e37e66034b0e4f8f4b2b0af Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:50:26 -0400 Subject: [PATCH 34/36] efl: check config values before passing to non-null function if these config values don't exist, we should return the inlined defaults Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11499 --- src/lib/efl/Efl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 81e274883b..ec6f168a8b 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -253,7 +253,7 @@ efl_config_bool_get(const Efl_Config *obj, const char * name) { Eina_Value *v = efl_config_get(obj, name); Eina_Bool b = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR) eina_value_get(v, &b); eina_value_free(v); return b; @@ -275,7 +275,7 @@ efl_config_int_get(const Efl_Config *obj, const char * name) { Eina_Value *v = efl_config_get(obj, name); int b = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_INT) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_INT) eina_value_get(v, &b); eina_value_free(v); return b; @@ -297,7 +297,7 @@ efl_config_double_get(const Efl_Config *obj, const char * name) { Eina_Value *v = efl_config_get(obj, name); double b = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE) eina_value_get(v, &b); eina_value_free(v); return b; @@ -319,7 +319,7 @@ efl_config_string_get(const Efl_Config *obj, const char *name) { Eina_Value *v = efl_config_get(obj, name); Eina_Stringshare *s = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_STRING) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_STRING) { const char *b = 0; eina_value_get(v, &b); From c19498fffc0a4db423d80845cf2e0d56c73907c7 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 12 Mar 2020 18:06:54 +0100 Subject: [PATCH 35/36] eina: do not free NULL ptr this is definitly NULL here, but usefull for later usage. --- src/lib/eina/eina_abstract_content.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_abstract_content.c b/src/lib/eina/eina_abstract_content.c index 65ea170ad4..a9899cecfe 100644 --- a/src/lib/eina/eina_abstract_content.c +++ b/src/lib/eina/eina_abstract_content.c @@ -140,8 +140,11 @@ eina_content_new(Eina_Slice data, const char *type) return content; err: - free(content->data.mem); - content->data.mem = NULL; + if (content->data.mem) + { + free(content->data.mem); + content->data.mem = NULL; + } free(content); return NULL; } From e8100fa8b004f6344a765c623e883ccb60bda88c Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 12 Mar 2020 18:13:50 +0100 Subject: [PATCH 36/36] docs: Efl.Ui.Textbox: Clarify when is Efl.Ui.Scrollable enabled --- src/lib/elementary/efl_ui_textbox.eo | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_textbox.eo b/src/lib/elementary/efl_ui_textbox.eo index c4833f315d..f82908a0dc 100644 --- a/src/lib/elementary/efl_ui_textbox.eo +++ b/src/lib/elementary/efl_ui_textbox.eo @@ -24,7 +24,11 @@ class @beta Efl.Ui.Textbox extends Efl.Ui.Layout_Base implements Efl.Input.Click [[Enable or disable scrolling in the widget. When scrolling is enabled scrollbars will appear if the text does - not fit the widget size.]] + not fit the widget size. + + Direct control of the scroll through the @Efl.Ui.Scrollable interface + is only possible when this property is enabled. + ]] set {} get {} values {