From aaa199e2d42ee90d9dd463d6b31a6873b07c0323 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 19 Sep 2019 13:24:08 +0900 Subject: [PATCH 01/56] evas map: disable the anti_aliasing code which can't be reached. This anti-aliasing is a little buggy, should be improved. But just leaving to fix later when it's necessary. --- src/lib/evas/common/evas_map_image_internal_high.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/common/evas_map_image_internal_high.c b/src/lib/evas/common/evas_map_image_internal_high.c index dfbbfbc1c5..3d23782f63 100644 --- a/src/lib/evas/common/evas_map_image_internal_high.c +++ b/src/lib/evas/common/evas_map_image_internal_high.c @@ -33,6 +33,8 @@ static float xa, xb, ua, va, ca[4]; b = tmp /************************** ANTI-ALIASING CODE ********************************/ +#ifdef MAP_HIGH_ANTI_ALIASING + static void _map_irregular_coverage_calc(AALine* spans, int eidx, int y, int diagonal, int edge_dist, Eina_Bool reverse) @@ -332,6 +334,7 @@ _map_aa_apply(AASpans *aa_spans, DATA32 *dst, int dw) free(aa_spans->lines); free(aa_spans); } +#endif /************************** TEXTURE MAPPING CODE ******************************/ static void @@ -822,6 +825,8 @@ _evas_common_map_rgba_internal_high(RGBA_Image *src, RGBA_Image *dst, //Setup Anti-Aliasing? AASpans *aa_spans = NULL; + +#ifdef MAP_HIGH_ANTI_ALIASING if (anti_alias) { //Adjust AA Y range @@ -837,6 +842,7 @@ _evas_common_map_rgba_internal_high(RGBA_Image *src, RGBA_Image *dst, aa_spans = _map_aa_ready(dst->cache_entry.w, dst->cache_entry.h, ystart, yend); } +#endif /* 1 polygon is consisted of 2 triangles, 4 polygons constructs 1 mesh. @@ -900,7 +906,8 @@ _evas_common_map_rgba_internal_high(RGBA_Image *src, RGBA_Image *dst, &poly, mul_col, aa_spans, smooth, col_blend); } - +#ifdef MAP_HIGH_ANTI_ALIASING if (anti_alias) _map_aa_apply(aa_spans, dst->image.data, dst->cache_entry.w); +#endif } From cdfe9463589a5a2aac3344161bb6c6bba81af3a8 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 19 Sep 2019 13:39:48 +0900 Subject: [PATCH 02/56] evas gl: remove unnecessary null check. If we check reference validation, the rest of other usage should keep the reference check as well. Remove it since gl prorgram must be valid always here to shutdown the static analyzer reporting this suspicous logic. --- src/modules/evas/engines/gl_common/evas_gl_context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index c1f7d985b6..bf7e5c1524 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -3769,8 +3769,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) pipe_done++; gc->flushnum++; - GLERRV(""); - if (prog && (prog != gc->state.current.prog)) + if (prog != gc->state.current.prog) { glUseProgram(prog->prog); if (prog->reset) From 6f3841e4b4fd17485789ae142d1e9b373235d858 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 19 Sep 2019 13:59:05 +0900 Subject: [PATCH 03/56] evas mask: refactoring code. This clearly separate the condition cases clear so that the analizyer tool doesn't bother us anymore. No logical changes. --- src/lib/evas/common/evas_scale_sample.c | 35 +++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c index 136813e208..cfd59726fc 100644 --- a/src/lib/evas/common/evas_scale_sample.c +++ b/src/lib/evas/common/evas_scale_sample.c @@ -103,34 +103,35 @@ _evas_common_scale_rgba_sample_scale_nomask(int y, DATA32 *dptr, RGBA_Gfx_Func func, unsigned int mul_col, DATA32 *srcptr, int src_w) { - DATA32 *buf = NULL; int x; - - /* a scanline buffer */ - if (!srcptr) - buf = alloca(dst_clip_w * sizeof(DATA32)); - dptr = dptr + dst_w * y; - for (; y < dst_clip_h; y++) + + if (srcptr) { - if (!srcptr) + for (; y < dst_clip_h; y++) + { + /* * blend here [clip_w *] buf -> dptr * */ + func(srcptr, NULL, mul_col, dptr, dst_clip_w); + dptr += dst_w; + srcptr += src_w; + } + } + else + { + DATA32 *buf = alloca(dst_clip_w * sizeof(DATA32)); + for (; y < dst_clip_h; y++) { DATA32 *dst_ptr = buf; for (x = 0; x < dst_clip_w; x++) { - DATA32 *ptr; - - ptr = row_ptr[y] + lin_ptr[x]; + DATA32 *ptr = row_ptr[y] + lin_ptr[x]; *dst_ptr = *ptr; dst_ptr++; } + /* * blend here [clip_w *] buf -> dptr * */ + func(buf, NULL, mul_col, dptr, dst_clip_w); + dptr += dst_w; } - - /* * blend here [clip_w *] buf -> dptr * */ - func(srcptr ?: buf, NULL, mul_col, dptr, dst_clip_w); - - dptr += dst_w; - if (srcptr) srcptr += src_w; } } From 81b94b5a2000f0c9dd568b5d3836cfa14c531a87 Mon Sep 17 00:00:00 2001 From: "Myoungwoon Roy, Kim" Date: Thu, 19 Sep 2019 15:23:07 +0900 Subject: [PATCH 04/56] doc: improves single line description of gesture class. Summary: This patch improves single line descriptions described on T7717 Test Plan: NA Reviewers: segfaultxavi, woohyun, Hermet, cedric Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10002 --- src/lib/evas/gesture/efl_canvas_gesture.eo | 2 +- src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo | 5 ++++- src/lib/evas/gesture/efl_canvas_gesture_flick.eo | 6 +++++- src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo | 6 +++++- src/lib/evas/gesture/efl_canvas_gesture_manager.eo | 7 +++++-- src/lib/evas/gesture/efl_canvas_gesture_momentum.eo | 5 ++++- .../gesture/efl_canvas_gesture_recognizer_double_tap.eo | 5 ++++- .../evas/gesture/efl_canvas_gesture_recognizer_flick.eo | 5 ++++- .../evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo | 5 ++++- .../evas/gesture/efl_canvas_gesture_recognizer_momentum.eo | 5 ++++- src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo | 5 ++++- .../gesture/efl_canvas_gesture_recognizer_triple_tap.eo | 5 ++++- src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo | 5 ++++- src/lib/evas/gesture/efl_canvas_gesture_tap.eo | 6 +++++- src/lib/evas/gesture/efl_canvas_gesture_touch.eo | 6 +++++- src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo | 6 +++++- src/lib/evas/gesture/efl_canvas_gesture_zoom.eo | 6 +++++- 17 files changed, 72 insertions(+), 18 deletions(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture.eo b/src/lib/evas/gesture/efl_canvas_gesture.eo index c703237973..b76aac0936 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture.eo @@ -4,7 +4,7 @@ abstract @beta Efl.Canvas.Gesture extends Efl.Object { [[EFL Gesture abstract class - A gesture class defines a method that spcific gesture event and privides information + A gesture class defines a method that specific gesture event and privides information about the gesture's type, state, and associated pointer information. For cetain gesture types, additional methods are defined to provide meaningful gesture diff --git a/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo index 39d84b86f2..5a0b1bc57b 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Double_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Double Tap class]] + [[EFL Gesture Double Tap class + + A gesture class defines a method that double tap gesture event and provides information + about the double tap gesture's type, state and associated pointer information.]] data: null; c_prefix: efl_gesture_double_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_flick.eo b/src/lib/evas/gesture/efl_canvas_gesture_flick.eo index 7e87c55f71..b0c6f4bcd2 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_flick.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_flick.eo @@ -2,7 +2,11 @@ import eina_types; class @beta Efl.Canvas.Gesture_Flick extends Efl.Canvas.Gesture { - [[EFL Gesture Flick class]] + [[EFL Gesture Flick class + + This gesture class defines a method that flick gesture event and provides + information about the flick gesture's type, state, and associated pointer + information.]] c_prefix: efl_gesture_flick; methods { momentum_get { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo index 79c5c6d0e6..e9de7225b2 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo @@ -1,6 +1,10 @@ class @beta Efl.Canvas.Gesture_Long_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Long Tap class]] + [[EFL Gesture Long Tap class + + This gesture class defines a method that long tap gesture event and provides + information about the long tap gesture's type, state and associated pointer + information.]] data: null; c_prefix: efl_gesture_long_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo index d626ca16de..2e52f6ace8 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Manager extends Efl.Object { - [[EFL Gesture Manager class]] + [[EFL Gesture Manager class + + This gesture class defines methods that register and unregister a recognizer and + get a recognizer according to gesture event type.]] c_prefix: efl_gesture_manager; methods { recognizer_register { @@ -18,7 +21,7 @@ class @beta Efl.Canvas.Gesture_Manager extends Efl.Object recognizer_get { [[Gets event type's recognizer]] params { - @in gesture_type: Efl.Canvas.Gesture_Recognizer_Type; [[The gesture type]] + @in gesture_type: Efl.Canvas.Gesture_Recognizer_Type; [[The gesture event type]] } return: const(Efl.Canvas.Gesture_Recognizer); [[The gesture recognizer]] } diff --git a/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo b/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo index c5aebcb5d2..c4bda2fcf2 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo @@ -2,7 +2,10 @@ import eina_types; class @beta Efl.Canvas.Gesture_Momentum extends Efl.Canvas.Gesture { - [[EFL Gesture Momentum class]] + [[EFL Gesture Momentum class + + This gesture class defines a method to get momentum value of specific + gesture event such as flick.]] c_prefix: efl_gesture_momentum; methods { momentum_get { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo index 9f3ab0a93c..24e35f54dc 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Double_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Double Tap class]] + [[EFL Gesture Recognizer Double Tap class + + This gesture recognizer class grabs double tap gesture events that occur on + target object that user register.]] c_prefix: efl_gesture_recognizer_double_tap; methods { @property timeout { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo index c7103ad33f..e8d8c83aac 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Flick extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Flick Class]] + [[EFL Gesture Recognizer Flick Class + + This gesture recognizer class grabs flick gesture events that occur on + the target object that user register.]] c_prefix: efl_gesture_recognizer_flick; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo index 7c8df2cfeb..e3efea44ff 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Long_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Long Tap class]] + [[EFL Gesture Recognizer Long Tap class + + This gesture recognizer class grabs long tap gesture events that occur + on the target that user register.]] c_prefix: efl_gesture_recognizer_long_tap; methods { @property timeout { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo index 1ae250dbba..e52abdc483 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Momentum extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Momentum class]] + [[EFL Gesture Recognizer Momentum class + + This gesture recognizer class grabs monentum based gesture events such as + from flick on the target object that user register.]] c_prefix: efl_gesture_recognizer_momentum; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo index d7aabc7cdb..5eefcdcd4c 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Tap class]] + [[EFL Gesture Recognizer Tap class + + This gesture recognizer class grabs tap based gesture events that occur on + the target object that user register.]] c_prefix: efl_gesture_recognizer_tap; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo index 2ed02bb047..dbb5ca6a6b 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Triple_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Triple Tap class]] + [[EFL Gesture Recognizer Triple Tap class + + This gesture recognizer class grabs triple tap gesture events that occur on the + target object that user register.]] c_prefix: efl_gesture_recognizer_triple_tap; methods { @property timeout { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo index 350614c50c..b93a49d7e5 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo @@ -1,6 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Zoom extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Zoom class]] + [[EFL Gesture Recognizer Zoom class + + This gesture recognizer class grabs zoom gesture events that occur on the + target object that user register.]] c_prefix: efl_gesture_recognizer_zoom; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo index bd6daba234..1f108f83c2 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo @@ -1,6 +1,10 @@ class @beta Efl.Canvas.Gesture_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Tap class]] + [[EFL Gesture Tap class + + This gesture class defines a method that tap gesture event and provides + information about the tap gesture's type, state, and associated pointer + information.]] data: null; c_prefix: efl_gesture_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo index 8b78e192de..4d274eb096 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo @@ -5,7 +5,11 @@ import efl_input_types; class @beta Efl.Canvas.Gesture_Touch extends Efl.Object { - [[EFL Gesture Touch class]] + [[EFL Gesture Touch class + + This gesture class defines a method that records touch points and supports + properties - first touch point, current touch point, timestamp, multi-touch + and state information.]] c_prefix: efl_gesture_touch; methods { point_record { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo index bab59c68fa..2b58c759b8 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo @@ -1,6 +1,10 @@ class @beta Efl.Canvas.Gesture_Triple_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Triple Tap class]] + [[EFL Gesture Triple Tap class + + This gesture class defines a method that triple tap gesture event and provides + information about the triple tap gesture's type, state and associated pointer + information.]] data: null; c_prefix: efl_gesture_triple_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo b/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo index 1cb7f7d48b..f2ed454df9 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo @@ -1,6 +1,10 @@ class @beta Efl.Canvas.Gesture_Zoom extends Efl.Canvas.Gesture { - [[EFL Gesture Zoom class]] + [[EFL Gesture Zoom class + + This gesture class defines methods to get zoom center point and zoom value + and provides information about ghe zoom gesture's type, state and associated + pointer information.]] c_prefix: efl_gesture_zoom; methods { radius_get { From 8a66c2eaea1b4001d6ec3bc7967ab0e5753d0a95 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 19 Sep 2019 15:29:15 +0900 Subject: [PATCH 05/56] doc: fix typo and indentation. --- src/lib/evas/gesture/efl_canvas_gesture_momentum.eo | 2 +- src/lib/evas/gesture/efl_canvas_gesture_zoom.eo | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo b/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo index c4bda2fcf2..1cea8b1949 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo @@ -5,7 +5,7 @@ class @beta Efl.Canvas.Gesture_Momentum extends Efl.Canvas.Gesture [[EFL Gesture Momentum class This gesture class defines a method to get momentum value of specific - gesture event such as flick.]] + gesture event such as flick.]] c_prefix: efl_gesture_momentum; methods { momentum_get { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo b/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo index f2ed454df9..51b5cea1ad 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo @@ -3,18 +3,18 @@ class @beta Efl.Canvas.Gesture_Zoom extends Efl.Canvas.Gesture [[EFL Gesture Zoom class This gesture class defines methods to get zoom center point and zoom value - and provides information about ghe zoom gesture's type, state and associated + and provides information about the zoom gesture's type, state and associated pointer information.]] c_prefix: efl_gesture_zoom; methods { radius_get { [[Gets zoom center point reported to user]] return: double; [[The radius value]] - } + } zoom_get { [[Gets zoom value. (1.0 means no zoom)]] return: double; [[The zoom value]] - } + } } implements { Efl.Object.constructor; From ac531f881fe084b4683e96f6de6b8a64a2ca0c9d Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 19 Sep 2019 11:17:49 +0200 Subject: [PATCH 06/56] docs: Update documentation on Gestures We need to keep in mind that the Manager and the Recognizers are not visible to the user. The user only sees the events and the different Efl.Canvas.Gesture_* payloads. --- src/lib/evas/gesture/efl_canvas_gesture.eo | 27 +++++++----- .../gesture/efl_canvas_gesture_double_tap.eo | 8 ++-- .../evas/gesture/efl_canvas_gesture_flick.eo | 21 ++++----- .../gesture/efl_canvas_gesture_long_tap.eo | 9 ++-- .../gesture/efl_canvas_gesture_manager.eo | 26 ++++++----- .../gesture/efl_canvas_gesture_momentum.eo | 12 ++--- .../gesture/efl_canvas_gesture_recognizer.eo | 38 ++++++++-------- ...fl_canvas_gesture_recognizer_double_tap.eo | 12 ++--- .../efl_canvas_gesture_recognizer_flick.eo | 8 ++-- .../efl_canvas_gesture_recognizer_long_tap.eo | 12 ++--- .../efl_canvas_gesture_recognizer_momentum.eo | 8 ++-- .../efl_canvas_gesture_recognizer_tap.eo | 8 ++-- ...fl_canvas_gesture_recognizer_triple_tap.eo | 24 +++++----- .../efl_canvas_gesture_recognizer_zoom.eo | 8 ++-- .../evas/gesture/efl_canvas_gesture_tap.eo | 9 ++-- .../gesture/efl_canvas_gesture_triple_tap.eo | 9 ++-- .../evas/gesture/efl_canvas_gesture_zoom.eo | 20 +++++---- src/lib/evas/gesture/efl_gesture_events.eo | 44 ++++++++++++++++--- 18 files changed, 170 insertions(+), 133 deletions(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture.eo b/src/lib/evas/gesture/efl_canvas_gesture.eo index b76aac0936..eaced25ad8 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture.eo @@ -1,44 +1,49 @@ import efl_canvas_gesture_types; +parse efl_gesture_events; abstract @beta Efl.Canvas.Gesture extends Efl.Object { - [[EFL Gesture abstract class + [[Base abstract class to support gesture-specific classes. - A gesture class defines a method that specific gesture event and privides information - about the gesture's type, state, and associated pointer information. + A gesture object holds the current state of that gesture (i.e. whether the gesture has + just been started, it is in progress or it has finished) along with any gesture-specific + information it needs (like the number of taps so far, to detect triple-taps, for example). - For cetain gesture types, additional methods are defined to provide meaningful gesture - information to the user.]] + Typically this class is not used directly, instead, some sub-class of it (like + @Efl.Canvas.Gesture_Tap or @Efl.Canvas.Gesture_Zoom) is retrieved from gesture events + (like @[Efl.Gesture.Events.gesture,tap] or @[Efl.Gesture.Events.gesture,zoom]). + ]] c_prefix: efl_gesture; methods { @property state { - [[This property holds the current state of the gesture.]] + [[Current state of the gesture, from initial detection to successful recognition.]] get { } set { } values { - state: Efl.Canvas.Gesture_State; [[gesture state]] + state: Efl.Canvas.Gesture_State; [[State.]] } } @property hotspot { - [[This property holds the hotspot of the current gesture.]] + [[Hotspot of the gesture currently being analyzed. + The exact meaning depends on the gesture type.]] get { } set { } values { - hotspot: Eina.Position2D;[[hotspot co-ordinate]] + hotspot: Eina.Position2D;[[Hotspot coordinates.]] } } @property timestamp { - [[This property holds the timestamp of the current gesture.]] + [[Moment when the gesture currently being analyzed started.]] get { } set { } values { - timestamp: uint;[[The timestamp]] + timestamp: uint;[[The time-stamp.]] } } } diff --git a/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo index 5a0b1bc57b..87b93ccd9c 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_double_tap.eo @@ -1,9 +1,9 @@ class @beta Efl.Canvas.Gesture_Double_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Double Tap class - - A gesture class defines a method that double tap gesture event and provides information - about the double tap gesture's type, state and associated pointer information.]] + [[Double-tap gesture class holding state information. + See @Efl.Canvas.Gesture to see what this state is and + @[Efl.Gesture.Events.gesture,double_tap] for a description of the Double-tap gesture. + ]] data: null; c_prefix: efl_gesture_double_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_flick.eo b/src/lib/evas/gesture/efl_canvas_gesture_flick.eo index b0c6f4bcd2..afc8391550 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_flick.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_flick.eo @@ -2,20 +2,21 @@ import eina_types; class @beta Efl.Canvas.Gesture_Flick extends Efl.Canvas.Gesture { - [[EFL Gesture Flick class - - This gesture class defines a method that flick gesture event and provides - information about the flick gesture's type, state, and associated pointer - information.]] + [[Flick gesture class holding state information. + See @Efl.Canvas.Gesture to see what this state is and + @[Efl.Gesture.Events.gesture,flick] for a description of the Flick gesture. + ]] c_prefix: efl_gesture_flick; methods { momentum_get { - [[Gets flick gesture momentum value]] - return: Eina.Vector2; [[The momentum vector]] - } + [[Gets flick gesture momentum value, this is, the direction in which the + pointer was flicked.]] + return: Eina.Vector2; [[The momentum vector.]] + } angle_get { - [[Gets flick direction angle]] - return: double; [[The angle value]] + [[Gets flick gesture direction angle, this is, the angle in which the + pointer was flicked.]] + return: double; [[The angle value.]] } } implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo index e9de7225b2..6c0d0c979d 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_long_tap.eo @@ -1,10 +1,9 @@ class @beta Efl.Canvas.Gesture_Long_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Long Tap class - - This gesture class defines a method that long tap gesture event and provides - information about the long tap gesture's type, state and associated pointer - information.]] + [[Long-tap gesture class holding state information. + See @Efl.Canvas.Gesture to see what this state is and + @[Efl.Gesture.Events.gesture,long_tap] for a description of the Long-tap gesture. + ]] data: null; c_prefix: efl_gesture_long_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo index 2e52f6ace8..8e5d75dead 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo @@ -1,41 +1,43 @@ class @beta Efl.Canvas.Gesture_Manager extends Efl.Object { - [[EFL Gesture Manager class + [[This class keeps track of active @Efl.Canvas.Gesture_Recognizer objects. + For internal use only. This gesture class defines methods that register and unregister a recognizer and - get a recognizer according to gesture event type.]] + get a recognizer according to gesture event type. + ]] c_prefix: efl_gesture_manager; methods { recognizer_register { - [[This function is called to register a new Efl.Canvas.Gesture_Recognizer]] + [[Registers a new @Efl.Canvas.Gesture_Recognizer.]] params { - @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object]] + @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object.]] } } recognizer_unregister { - [[This function is called to unregister a Efl.Canvas.Gesture_Recognizer]] + [[Unregisters an existing @Efl.Canvas.Gesture_Recognizer.]] params { - @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object]] + @in recognizer: Efl.Canvas.Gesture_Recognizer; [[The gesture recognizer object.]] } } recognizer_get { - [[Gets event type's recognizer]] + [[Returns the event recognizer object associated with the given $gesture_type.]] params { - @in gesture_type: Efl.Canvas.Gesture_Recognizer_Type; [[The gesture event type]] + @in gesture_type: Efl.Canvas.Gesture_Recognizer_Type; [[The gesture event type.]] } - return: const(Efl.Canvas.Gesture_Recognizer); [[The gesture recognizer]] + return: const(Efl.Canvas.Gesture_Recognizer); [[The gesture recognizer.]] } @property config { - [[This property holds the config value for the recognizer]] + [[This property holds configuration values for the recognizer.]] set { } get { } keys { - name: string; [[propery name]] + name: string; [[Property name.]] } values { - value: any_value_ptr; [[value of the property]] + value: any_value_ptr; [[Value of the property.]] } } } diff --git a/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo b/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo index 1cea8b1949..0f78ad69aa 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_momentum.eo @@ -2,15 +2,15 @@ import eina_types; class @beta Efl.Canvas.Gesture_Momentum extends Efl.Canvas.Gesture { - [[EFL Gesture Momentum class - - This gesture class defines a method to get momentum value of specific - gesture event such as flick.]] + [[Momentum gesture class holding state information. + See @Efl.Canvas.Gesture to see what this state is and + @[Efl.Gesture.Events.gesture,momentum] for a description of the Momentum gesture. + ]] c_prefix: efl_gesture_momentum; methods { momentum_get { - [[Gets momentum value]] - return: Eina.Vector2; [[The momentum vector]] + [[Gets the momentum value, this is, the direction in which the action occurred.]] + return: Eina.Vector2; [[The momentum vector.]] } } implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo index aaee7d29b1..c12274b899 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo @@ -2,53 +2,53 @@ import efl_canvas_gesture_types; abstract @beta Efl.Canvas.Gesture_Recognizer extends Efl.Object { - [[EFL Gesture Recognizer abstract class + [[Base abstract class for Gesture Recognizers. For internal use only. - The gesture recognizer class grabs events that occur on the target - object that user register to see if a particluar gesture has occurred. + Gesture recognizers listen to events that occur on a target object + to see if a particular gesture has occurred. - Uesr can adjust the config value involved in gesture recognition - through the method provided by the gesture recognizer. - - The default config values follow the system default config value.]] + Recognizer-specific configuration values can be modified through @.config. + Default configuration values are taken from the system's configuration. + ]] c_prefix: efl_gesture_recognizer; methods { add @pure_virtual { - [[This function is called to create a new Efl.Canvas.Gesture object for the given target]] + [[This function is called to create a new @Efl.Canvas.Gesture object for the given target.]] params { - @in target: Efl.Object; [[The target widget]] + @in target: Efl.Object; [[The target canvas object.]] } - return: Efl.Canvas.Gesture; [[Returns the Efl.Canvas.Gesture event object]] + return: Efl.Canvas.Gesture; [[Returns the gesture object that will be used to track this gesture.]] } recognize @pure_virtual { - [[Handles the given event for the watched object. + [[Analyzes the given $event and the current state of the $gesture object to see if the state + has to be modified. For example, to signal a complete gesture detection. Updates the state of the gesture object as required, and returns a suitable result for the current recognition step. ]] params { - @in gesture: Efl.Canvas.Gesture; [[The gesture object]] - @in watched: Efl.Object; [[The watched object]] - @in event: Efl.Canvas.Gesture_Touch; [[The pointer event]] + @in gesture: Efl.Canvas.Gesture; [[The gesture object.]] + @in watched: Efl.Object; [[The target canvas object.]] + @in event: Efl.Canvas.Gesture_Touch; [[The pointer event being analyzed.]] } - return: Efl.Canvas.Gesture_Recognizer_Result; [[Returns the Efl.Canvas.Gesture event object]] + return: Efl.Canvas.Gesture_Recognizer_Result; [[Returns the result of the analysis.]] } /* FIXME: This function is not used? */ reset { [[This function is called by the framework to reset a given gesture.]] params { - @in gesture: Efl.Canvas.Gesture; [[The gesture object]] + @in gesture: Efl.Canvas.Gesture; [[The gesture object.]] } } @property config { - [[This property holds the config value for the recognizer]] + [[This property holds configuration values for the recognizer.]] get { } keys { - name: string; [[propery name]] + name: string; [[Property name.]] } values { - value: any_value_ptr; [[value of the property]] + value: any_value_ptr; [[Value of the property.]] } } } diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo index 24e35f54dc..de229b7147 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.eo @@ -1,19 +1,19 @@ class @beta Efl.Canvas.Gesture_Recognizer_Double_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Double Tap class - - This gesture recognizer class grabs double tap gesture events that occur on - target object that user register.]] + [[This is the recognizer for Double-Tap gestures. + See @Efl.Canvas.Gesture_Double_Tap and @Efl.Canvas.Gesture_Recognizer. + For internal use only. + ]] c_prefix: efl_gesture_recognizer_double_tap; methods { @property timeout { - [[Sets the time between taps to be recognized as a double tap]] + [[Maximum time between taps to be recognized as a double tap.]] set { } get { } values { - time: double; [[Allowed time gap value]] + time: double; [[Time in seconds.]] } } } diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo index e8d8c83aac..5f038f1a17 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_flick.eo @@ -1,9 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Flick extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Flick Class - - This gesture recognizer class grabs flick gesture events that occur on - the target object that user register.]] + [[This is the recognizer for Flick gestures. + See @Efl.Canvas.Gesture_Flick and @Efl.Canvas.Gesture_Recognizer. + For internal use only. + ]] c_prefix: efl_gesture_recognizer_flick; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo index e3efea44ff..d18d2c236f 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.eo @@ -1,19 +1,19 @@ class @beta Efl.Canvas.Gesture_Recognizer_Long_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Long Tap class - - This gesture recognizer class grabs long tap gesture events that occur - on the target that user register.]] + [[This is the recognizer for Long-tap gestures. + See @Efl.Canvas.Gesture_Long_Tap and @Efl.Canvas.Gesture_Recognizer. + For internal use only. + ]] c_prefix: efl_gesture_recognizer_long_tap; methods { @property timeout { - [[Sets the holding time to be recognized as a long tap.]] + [[Minimum holding time to be recognized as a long tap.]] set { } get { } values { - time: double; [[Allowed time gap value]] + time: double; [[Time in seconds.]] } } } diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo index e52abdc483..1713fb4f68 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_momentum.eo @@ -1,9 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Momentum extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Momentum class - - This gesture recognizer class grabs monentum based gesture events such as - from flick on the target object that user register.]] + [[This is the recognizer for Momentum gestures. + See @Efl.Canvas.Gesture_Momentum and @Efl.Canvas.Gesture_Recognizer. + For internal use only. + ]] c_prefix: efl_gesture_recognizer_momentum; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo index 5eefcdcd4c..26aeb83a4d 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.eo @@ -1,9 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Tap class - - This gesture recognizer class grabs tap based gesture events that occur on - the target object that user register.]] + [[This is the recognizer for Tap gestures. + See @Efl.Canvas.Gesture_Tap and @Efl.Canvas.Gesture_Recognizer. + For internal use only. + ]] c_prefix: efl_gesture_recognizer_tap; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo index dbb5ca6a6b..99458938fa 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.eo @@ -1,21 +1,21 @@ class @beta Efl.Canvas.Gesture_Recognizer_Triple_Tap extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Triple Tap class - - This gesture recognizer class grabs triple tap gesture events that occur on the - target object that user register.]] + [[This is the recognizer for Triple-tap gestures. + See @Efl.Canvas.Gesture_Triple_Tap and @Efl.Canvas.Gesture_Recognizer. + For internal use only. + ]] c_prefix: efl_gesture_recognizer_triple_tap; methods { @property timeout { - [[Sets the time between taps to be recognized as a double tap.]] + [[Minimum time between each consecutive tap to be recognized as a triple tap.]] set { - } - get { - } - values { - time: double; [[Time value.]] - } - } + } + get { + } + values { + time: double; [[Time in seconds.]] + } + } } implements { Efl.Object.destructor; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo index b93a49d7e5..a07e112d87 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.eo @@ -1,9 +1,9 @@ class @beta Efl.Canvas.Gesture_Recognizer_Zoom extends Efl.Canvas.Gesture_Recognizer { - [[EFL Gesture Recognizer Zoom class - - This gesture recognizer class grabs zoom gesture events that occur on the - target object that user register.]] + [[This is the recognizer for Zoom gestures. + See @Efl.Canvas.Gesture_Zoom and @Efl.Canvas.Gesture_Recognizer. + For internal use only. + ]] c_prefix: efl_gesture_recognizer_zoom; implements { Efl.Canvas.Gesture_Recognizer.add; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo index 1f108f83c2..0e940608d3 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_tap.eo @@ -1,10 +1,9 @@ class @beta Efl.Canvas.Gesture_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Tap class - - This gesture class defines a method that tap gesture event and provides - information about the tap gesture's type, state, and associated pointer - information.]] + [[Tap gesture class holding state information. + See @Efl.Canvas.Gesture to see what this state is and + @[Efl.Gesture.Events.gesture,tap] for a description of the Tap gesture. + ]] data: null; c_prefix: efl_gesture_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo b/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo index 2b58c759b8..abedc442d4 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_triple_tap.eo @@ -1,10 +1,9 @@ class @beta Efl.Canvas.Gesture_Triple_Tap extends Efl.Canvas.Gesture { - [[EFL Gesture Triple Tap class - - This gesture class defines a method that triple tap gesture event and provides - information about the triple tap gesture's type, state and associated pointer - information.]] + [[Triple-tap gesture class holding state information. + See @Efl.Canvas.Gesture to see what this state is and + @[Efl.Gesture.Events.gesture,triple_tap] for a description of the Triple-tap gesture. + ]] data: null; c_prefix: efl_gesture_triple_tap; implements { diff --git a/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo b/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo index 51b5cea1ad..7137689a7c 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_zoom.eo @@ -1,19 +1,21 @@ class @beta Efl.Canvas.Gesture_Zoom extends Efl.Canvas.Gesture { - [[EFL Gesture Zoom class - - This gesture class defines methods to get zoom center point and zoom value - and provides information about the zoom gesture's type, state and associated - pointer information.]] + [[Zoom gesture class holding state information. + See @Efl.Canvas.Gesture to see what this state is and + @[Efl.Gesture.Events.gesture,zoom] for a description of the Flick gesture. + ]] c_prefix: efl_gesture_zoom; methods { radius_get { - [[Gets zoom center point reported to user]] - return: double; [[The radius value]] + [[Gets the current radius (i.e. the distance between the two fingers) of the gesture.]] + return: double; [[The radius value in pixels.]] } zoom_get { - [[Gets zoom value. (1.0 means no zoom)]] - return: double; [[The zoom value]] + [[Gets the current zoom value of the gesture. When the gesture begins, the finger + distance is recorded. When the distance becomes greater than the initial one, a + zoom value greater than $[1.0] is reported. When it becomes smaller, a zoom value + lesser than $[1.0] is reported.]] + return: double; [[The zoom value. $[1.0] means no zoom.]] } } implements { diff --git a/src/lib/evas/gesture/efl_gesture_events.eo b/src/lib/evas/gesture/efl_gesture_events.eo index df4e874ad8..da67ccc9d2 100644 --- a/src/lib/evas/gesture/efl_gesture_events.eo +++ b/src/lib/evas/gesture/efl_gesture_events.eo @@ -2,12 +2,42 @@ interface @beta Efl.Gesture.Events { event_prefix: efl; events { - gesture,tap: Efl.Canvas.Gesture_Tap; [[Event for tap gesture]] - gesture,double_tap: Efl.Canvas.Gesture_Double_Tap; [[Event for double tap gesture]] - gesture,triple_tap: Efl.Canvas.Gesture_Triple_Tap; [[Event for triple tap gesture]] - gesture,long_tap: Efl.Canvas.Gesture_Long_Tap; [[Event for long tap gesture]] - gesture,momentum: Efl.Canvas.Gesture_Momentum; [[Event for momentum gesture]] - gesture,flick: Efl.Canvas.Gesture_Flick; [[Event for flick gesture]] - gesture,zoom: Efl.Canvas.Gesture_Zoom; [[Event for zoom gesture]] + gesture,tap: Efl.Canvas.Gesture_Tap; [[Emitted when a Tap gesture has been detected. + A Tap gesture consists of a touch of the screen (or click of the mouse) quickly followed by + a release. If the release happens too late a @[Efl.Gesture.Events.gesture,long_tap] event will be + emitted instead. + ]] + + gesture,double_tap: Efl.Canvas.Gesture_Double_Tap; [[Emitted when a Double-tap gesture has been detected. + A Double-tap gesture consists of two taps on the screen (or clicks of the mouse) in quick + succession. If the second one is delayed for too long they will be detected as two independent + @[Efl.Gesture.Events.gesture,tap] events. + ]] + + gesture,triple_tap: Efl.Canvas.Gesture_Triple_Tap; [[Emitted when a Triple-tap gesture has been detected. + A Triple-tap gesture consists of three taps on the screen (or clicks of the mouse) in quick + succession. If any of them is delayed for too long they will be detected as independent + @[Efl.Gesture.Events.gesture,tap] or @[Efl.Gesture.Events.gesture,double_tap] events. + ]] + + gesture,long_tap: Efl.Canvas.Gesture_Long_Tap; [[Emitted when a Long-tap gesture has been detected. + A Long-tap gesture consists of a touch of the screen (or click of the mouse) followed by a release + after some time. If the release happens too quickly a @[Efl.Gesture.Events.gesture,tap] event will be + emitted instead. + ]] + + gesture,momentum: Efl.Canvas.Gesture_Momentum; [[Emitted when a Momentum gesture has been detected. + A Momentum gesture consists of a quick displacement of the finger while touching the screen (or while + holding down a mouse button). + ]] + + gesture,flick: Efl.Canvas.Gesture_Flick; [[Emitted when a Flick gesture has been detected. + ]] + + gesture,zoom: Efl.Canvas.Gesture_Zoom; [[Emitted when a Zoom gesture has been detected. + A Zoom gesture consists of two fingers touching the screen and separating ("zoom in") or + getting closer ("zoom out" or "pinch"). + This gesture cannot be performed with a mouse as it requires more than one pointer. + ]] } } From 71e8dc0e7587a8f6b79bff2b1a5b3e3b1e08502e Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 19 Sep 2019 11:36:26 +0200 Subject: [PATCH 07/56] efl_model: improve docs Reviewers: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10009 --- src/lib/efl/interfaces/efl_model.eo | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/efl/interfaces/efl_model.eo b/src/lib/efl/interfaces/efl_model.eo index c256483e54..f1fa4071a1 100644 --- a/src/lib/efl/interfaces/efl_model.eo +++ b/src/lib/efl/interfaces/efl_model.eo @@ -15,7 +15,14 @@ struct @beta Efl.Model_Children_Event { interface @beta Efl.Model { - [[Efl model interface]] + [[Basic Model abstraction. + + A model in EFL can have a set of key-value properties, where key can only be a string. + The value can be anything within an Eina_Value. If a property is not yet available EAGAIN is returned. + + Additionally a model can have a list of children. The fetching of the children is asynchronous, this has the advantage of + having as few data sets as possible in the memory itself. + ]] c_prefix: efl_model; methods { @property properties { From e3bc67257fcb35bf0e7650f0e1ba6cf3f4a1d80a Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 19 Sep 2019 11:36:27 +0200 Subject: [PATCH 08/56] efl_model: fix links Summary: Depends on D10009 Reviewers: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10010 --- src/lib/efl/interfaces/efl_model.eo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/efl/interfaces/efl_model.eo b/src/lib/efl/interfaces/efl_model.eo index f1fa4071a1..9390b87b22 100644 --- a/src/lib/efl/interfaces/efl_model.eo +++ b/src/lib/efl/interfaces/efl_model.eo @@ -46,8 +46,8 @@ interface @beta Efl.Model set { [[Set a property value of a given property name. - The caller must ensure to call at least efl_model_prop_list - before being able to see/set properties. This function sets + The caller must first read @.properties to obtain the list of available properties + before being able to access them through @.property. This function sets a new property value into given property name. Once the operation is completed the concrete implementation should raise @[Efl.Model.properties,changed] event in order to @@ -136,7 +136,7 @@ interface @beta Efl.Model @property children_count { [[Number of children. - When efl_model_load is completed @.children_count.get + After @[.properties,changed] is emitted, @.children_count.get can be used to get the number of children. @.children_count.get can also be used before calling @.children_slice_get so a valid range is known. Event @[Efl.Model.children,count,changed] is From 5428f26f7d08b03ce4e7963595d6f83f70d5957a Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 19 Sep 2019 13:11:00 +0200 Subject: [PATCH 09/56] docs: Update docs for Efl.Gfx.Image_Orientable --- src/lib/efl/interfaces/efl_gfx_image_orientable.eo | 6 +++++- src/lib/efl/interfaces/efl_ui_layout_orientable.eo | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/efl/interfaces/efl_gfx_image_orientable.eo b/src/lib/efl/interfaces/efl_gfx_image_orientable.eo index 09653edd9e..9e4c90cda4 100644 --- a/src/lib/efl/interfaces/efl_gfx_image_orientable.eo +++ b/src/lib/efl/interfaces/efl_gfx_image_orientable.eo @@ -29,7 +29,11 @@ enum Efl.Gfx.Image_Orientation interface Efl.Gfx.Image_Orientable { - [[Interface for objects which can be oriented.]] + [[Interface for images which can be rotated or flipped (mirrored). + + Compare with @Efl.Ui.Layout_Orientable which works for layout objects and does + not include rotation. + ]] c_prefix: efl_gfx; methods { @property image_orientation { diff --git a/src/lib/efl/interfaces/efl_ui_layout_orientable.eo b/src/lib/efl/interfaces/efl_ui_layout_orientable.eo index 34da902e56..e1e2d667fd 100644 --- a/src/lib/efl/interfaces/efl_ui_layout_orientable.eo +++ b/src/lib/efl/interfaces/efl_ui_layout_orientable.eo @@ -30,6 +30,8 @@ interface Efl.Ui.Layout_Orientable For example, sliders, which can be horizontal or vertical, or container boxes, which can arrange their elements in a horizontal or vertical fashion. + + Compare with @Efl.Gfx.Image_Orientable that works for images and includes rotation. ]] c_prefix: efl_ui_layout; methods { From 4de4995fa27d6a8907983d2f450a5666823995b7 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 19 Sep 2019 16:04:56 +0200 Subject: [PATCH 10/56] eolian: return NULL instead of EINA_FALSE on safety checks --- src/lib/eolian/database_function_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/eolian/database_function_api.c b/src/lib/eolian/database_function_api.c index fd78164892..ca9454449b 100644 --- a/src/lib/eolian/database_function_api.c +++ b/src/lib/eolian/database_function_api.c @@ -346,9 +346,9 @@ EAPI Eina_Stringshare * eolian_function_return_c_type_get(const Eolian_Function *fid, Eolian_Function_Type ftype) { - EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, EINA_FALSE); - EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL); + EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_UNRESOLVED, NULL); + EINA_SAFETY_ON_FALSE_RETURN_VAL(ftype != EOLIAN_PROPERTY, NULL); const Eolian_Type *tp = NULL; Eina_Bool by_ref = EINA_FALSE; switch (ftype) From f8926697ff430e025d782fbdbb588db8ee154852 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 19 Sep 2019 16:51:04 +0200 Subject: [PATCH 11/56] docs: Update documentation for Efl.Gfx.Color_Class --- src/lib/efl/interfaces/efl_gfx_color_class.eo | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/efl/interfaces/efl_gfx_color_class.eo b/src/lib/efl/interfaces/efl_gfx_color_class.eo index 6acfa42f0f..7d91347dfe 100644 --- a/src/lib/efl/interfaces/efl_gfx_color_class.eo +++ b/src/lib/efl/interfaces/efl_gfx_color_class.eo @@ -2,7 +2,10 @@ import efl_gfx_types; mixin @beta Efl.Gfx.Color_Class { - [[Efl Gfx Color Class mixin class]] + [[This mixin provides an interface for objects supporting color classes + (this is, named colors) and provides a helper method to also allow hexadecimal + color codes. + ]] data: null; methods { @property color_class @pure_virtual { @@ -53,7 +56,7 @@ mixin @beta Efl.Gfx.Color_Class Setting color emits a signal "color_class,set" with source being the given color. - + When retrieving the color of an object, if no explicit object color is set, then global values will be used. From 46a6949b2e29bddacd523d96564492957faecc34 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 19 Sep 2019 16:49:31 +0200 Subject: [PATCH 12/56] eolian: auto-add composited interfaces into implements if needed The condition here is that the composited interface does not already appear in the inheritance tree of the given class. If it does, don't add. If it doesn't, add it to the class that specifies the composited block. --- src/lib/eolian/database_validate.c | 57 ++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index cdbd699293..f13e0e82b7 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -865,6 +865,22 @@ _extend_impl(Eina_Hash *fs, Eolian_Implement *impl, Eina_Bool as_iface) return !st; } +/* fills a complete set of stuff implemented or inherited on a class + * this is used to check whether to auto-add composited interfaces into + * implemented/extended list + */ +static void +_db_fill_ihash(Eolian_Class *icl, Eina_Hash *icls) +{ + if (icl->parent) + _db_fill_ihash(icl->parent, icls); + Eina_List *l; + Eolian_Class *sicl; + EINA_LIST_FOREACH(icl->extends, l, sicl) + _db_fill_ihash(sicl, icls); + eina_hash_set(icls, &icl, icl); +} + static void _db_fill_callables(Eolian_Class *cl, Eolian_Class *icl, Eina_Hash *fs, Eina_Bool parent) { @@ -1084,13 +1100,6 @@ _db_swap_inherit(Eolian_Class *cl, Eina_Bool succ, Eina_Stringshare *in_cl, succ = EINA_FALSE; _eo_parser_log(&cl->base, "non-interface class '%s' in composite list", icl->base.name); } - else if (iface_only && !_get_impl_class(cl, icl->base.name)) - { - /* TODO: optimize check using a lookup hash later */ - succ = EINA_FALSE; - _eo_parser_log(&cl->base, "interface '%s' not found within the inheritance tree of '%s'", - icl->base.name, cl->base.name); - } else *out_cl = icl; eina_stringshare_del(in_cl); @@ -1183,6 +1192,7 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash, /* replace the composite list with real instances and initial-fill the hash */ il = cl->composite; cl->composite = NULL; + int ncomp = 0; EINA_LIST_FREE(il, inn) { Eolian_Class *out_cl = NULL; @@ -1190,6 +1200,8 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash, if (!succ) continue; cl->composite = eina_list_append(cl->composite, out_cl); + succ = _db_fill_inherits(vals, out_cl, fhash, errh); + ++ncomp; eina_hash_set(ch, &out_cl, out_cl); } @@ -1216,6 +1228,37 @@ _db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash, eina_hash_add(fhash, &cl->base.name, cl); + /* there are more than zero of composites of its own */ + if (ncomp > 0) + { + /* this one stores what is already in inheritance tree */ + Eina_Hash *ih = eina_hash_pointer_new(NULL); + + /* fill a complete inheritance tree set */ + if (cl->parent) + _db_fill_ihash(cl->parent, ih); + + EINA_LIST_FOREACH(cl->extends, il, icl) + _db_fill_ihash(icl, ih); + + /* go through only the explicitly specified composite list part, as the + * rest was to be handled in parents already... add what hasn't been + * explicitly implemented so far into implements/extends + */ + EINA_LIST_FOREACH(cl->composite, il, icl) + { + /* ran out of classes */ + if (!ncomp--) + break; + /* found in inheritance tree, skip */ + if (eina_hash_find(ih, &icl)) + continue; + cl->extends = eina_list_append(cl->extends, icl); + } + + eina_hash_free(ih); + } + /* stores mappings from function to Impl_Status */ Eina_Hash *fh = eina_hash_pointer_new(NULL); From bc793753cb5c7764b5766720c16177fcd1656517 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 19 Sep 2019 17:26:48 +0200 Subject: [PATCH 13/56] eolian: allow composites keyword in place of composite Fixes T8218. --- src/lib/eolian/eo_lexer.h | 2 +- src/lib/eolian/eo_parser.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index 876f1c70bc..0746e79bae 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -27,7 +27,7 @@ enum Tokens */ #define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ \ - KW(abstract), KW(c_prefix), KW(composite), KW(constructor), KW(constructors), \ + KW(abstract), KW(c_prefix), KW(composite), KW(composites), KW(constructor), KW(constructors), \ KW(data), KW(destructor), KW(error), KW(event_prefix), KW(events), KW(extends), \ KW(free), KW(get), KW(implements), KW(import), KW(interface), \ KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \ diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 1f5a678215..c403305a2f 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -2210,8 +2210,8 @@ _composite_add(Eo_Lexer *ls, Eina_Strbuf *buf) eo_lexer_syntax_error(ls, ebuf); return; } - /* do not introduce a dependency */ - database_defer(ls->state, fnm, EINA_FALSE); + /* composite == definitely a dependency */ + database_defer(ls->state, fnm, EINA_TRUE); free(fnm); ls->klass->composite = eina_list_append(ls->klass->composite, nm); eo_lexer_context_pop(ls); @@ -2306,7 +2306,7 @@ tags_done: /* regular class can have a parent, but just one */ _inherit_dep(ls, ibuf, EINA_TRUE); /* if not followed by implements, we're done */ - if (ls->t.kw != KW_implements) + if ((ls->t.kw != KW_implements) && (ls->t.kw != KW_composites)) { eo_lexer_dtor_pop(ls); goto inherit_done; @@ -2318,10 +2318,10 @@ tags_done: while (test_next(ls, ',')); } - if (ls->t.kw == KW_composite) + if (ls->t.kw == KW_composite || ls->t.kw == KW_composites) { if (type == EOLIAN_CLASS_INTERFACE) - eo_lexer_syntax_error(ls, "composite not allowed in interfaces"); + eo_lexer_syntax_error(ls, "interfaces cannot composite"); eo_lexer_get(ls); do _composite_add(ls, ibuf); From b74f98e8b7cc3a1b680488395d257841d8d3f007 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 19 Sep 2019 17:32:56 +0200 Subject: [PATCH 14/56] efl: replace composite with composites and dedup implements Since using 'composites' now automatically implements what has not been implemented yet, remove the unnecessary duplicates. --- src/lib/elementary/efl_ui_collection.eo | 4 +--- src/lib/elementary/efl_ui_image_zoomable.eo | 6 ++---- src/lib/elementary/efl_ui_list_view.eo | 10 ++++++---- src/lib/elementary/efl_ui_panel.eo | 4 ++-- src/lib/elementary/efl_ui_radio_box.eo | 3 +-- src/lib/elementary/efl_ui_scroller.eo | 4 +--- src/lib/elementary/efl_ui_tab_bar.eo | 4 ++-- src/lib/elementary/efl_ui_tags.eo | 4 ++-- src/lib/elementary/efl_ui_text.eo | 4 ++-- src/lib/elementary/efl_ui_video.eo | 4 ++-- src/lib/elementary/efl_ui_widget_focus_manager.eo | 3 +-- src/lib/elementary/efl_ui_win.eo | 6 +++--- src/tests/eolian/data/unimpl.eo | 2 +- 13 files changed, 26 insertions(+), 32 deletions(-) diff --git a/src/lib/elementary/efl_ui_collection.eo b/src/lib/elementary/efl_ui_collection.eo index 30451214ad..43eacec9af 100644 --- a/src/lib/elementary/efl_ui_collection.eo +++ b/src/lib/elementary/efl_ui_collection.eo @@ -1,12 +1,10 @@ class @beta Efl.Ui.Collection extends Efl.Ui.Layout_Base implements - Efl.Ui.Scrollable_Interactive, - Efl.Ui.Scrollbar, Efl.Pack_Linear, Efl.Pack_Layout, Efl.Ui.Layout_Orientable, Efl.Ui.Multi_Selectable, Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget_Focus_Manager - composite + composites Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar, Efl.Ui.Focus.Manager diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo index 932c732e15..cc8ae5dac9 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.eo +++ b/src/lib/elementary/efl_ui_image_zoomable.eo @@ -2,10 +2,8 @@ struct @extern Elm.Photocam.Error; [[Photocam error information.]] struct @extern Elm.Photocam.Progress; [[Photocam progress information.]] -class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, - Efl.Ui.Scrollable_Interactive, - Efl.Ui.Scrollbar - composite Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar +class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom + composites Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar { [[Elementary Image Zoomable class]] methods { diff --git a/src/lib/elementary/efl_ui_list_view.eo b/src/lib/elementary/efl_ui_list_view.eo index 5c49394ec4..37db3fb183 100644 --- a/src/lib/elementary/efl_ui_list_view.eo +++ b/src/lib/elementary/efl_ui_list_view.eo @@ -7,10 +7,12 @@ struct @beta Efl.Ui.List_View_Item_Event child: Efl.Model; [[TBD]] index: int; [[TBD]] } -class @beta Efl.Ui.List_View extends Efl.Ui.Layout_Base implements Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar, - Efl.Access.Widget.Action, Efl.Access.Selection, Efl.Ui.Focus.Composition, Efl.Ui.Focus.Manager_Sub, - Efl.Ui.Container_Selectable, Efl.Ui.List_View_Model, Efl.Ui.Widget_Focus_Manager - composite +class @beta Efl.Ui.List_View extends Efl.Ui.Layout_Base implements + Efl.Access.Widget.Action, Efl.Access.Selection, + Efl.Ui.Focus.Composition, Efl.Ui.Focus.Manager_Sub, + Efl.Ui.Container_Selectable, Efl.Ui.List_View_Model, + Efl.Ui.Widget_Focus_Manager + composites Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar { methods { diff --git a/src/lib/elementary/efl_ui_panel.eo b/src/lib/elementary/efl_ui_panel.eo index edf688c2eb..f02845eb1c 100644 --- a/src/lib/elementary/efl_ui_panel.eo +++ b/src/lib/elementary/efl_ui_panel.eo @@ -16,9 +16,9 @@ struct @beta Efl.Ui.Panel_Scroll_Info } class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base - implements Efl.Ui.Focus.Layer, Efl.Ui.Scrollable_Interactive, Efl.Content, + implements Efl.Ui.Focus.Layer, Efl.Content, Efl.Access.Widget.Action - composite Efl.Ui.Scrollable_Interactive + composites Efl.Ui.Scrollable_Interactive { [[Elementary panel class]] methods { diff --git a/src/lib/elementary/efl_ui_radio_box.eo b/src/lib/elementary/efl_ui_radio_box.eo index 15f6b3ee13..e6b2259376 100644 --- a/src/lib/elementary/efl_ui_radio_box.eo +++ b/src/lib/elementary/efl_ui_radio_box.eo @@ -1,5 +1,4 @@ -class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box implements Efl.Ui.Radio_Group - composite Efl.Ui.Radio_Group +class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box composites Efl.Ui.Radio_Group { [[A standard @Efl.Ui.Box container which automatically handles grouping of any @Efl.Ui.Radio widget added to it in addition to regular widgets. diff --git a/src/lib/elementary/efl_ui_scroller.eo b/src/lib/elementary/efl_ui_scroller.eo index 7a2bb90306..b3cfeec9cb 100644 --- a/src/lib/elementary/efl_ui_scroller.eo +++ b/src/lib/elementary/efl_ui_scroller.eo @@ -1,10 +1,8 @@ class @beta Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements - Efl.Ui.Scrollable_Interactive, - Efl.Ui.Scrollbar, Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget_Focus_Manager, Efl.Content - composite + composites Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar { diff --git a/src/lib/elementary/efl_ui_tab_bar.eo b/src/lib/elementary/efl_ui_tab_bar.eo index 996a897b98..cf06e0de47 100644 --- a/src/lib/elementary/efl_ui_tab_bar.eo +++ b/src/lib/elementary/efl_ui_tab_bar.eo @@ -1,6 +1,6 @@ class @beta Efl.Ui.Tab_Bar extends Efl.Ui.Layout_Base - implements Efl.Ui.Single_Selectable, Efl.Pack_Linear - composite Efl.Pack_Linear, Efl.Pack + implements Efl.Ui.Single_Selectable + composites Efl.Pack_Linear, Efl.Pack { [[A selectable box of items. diff --git a/src/lib/elementary/efl_ui_tags.eo b/src/lib/elementary/efl_ui_tags.eo index 29728900eb..194c9b74e5 100644 --- a/src/lib/elementary/efl_ui_tags.eo +++ b/src/lib/elementary/efl_ui_tags.eo @@ -1,6 +1,6 @@ class @beta Efl.Ui.Tags extends Efl.Ui.Layout_Base - implements Efl.Text, Efl.Ui.Format - composite Efl.Text + implements Efl.Ui.Format + composites Efl.Text { [[A widget displaying a list of tags. The user can remove tags by clicking on each tag "close" button and add new tags by typing text in the text diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index eb74be4b1a..d05b6a14db 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -3,8 +3,8 @@ import elm_general; class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickable, Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, - Efl.Ui.Text_Selectable, Efl.Text_Interactive, Efl.Text_Markup - composite + Efl.Ui.Text_Selectable + composites Efl.Text_Interactive, Efl.Text_Markup { [[A flexible text widget which can be static (as a label) or editable by diff --git a/src/lib/elementary/efl_ui_video.eo b/src/lib/elementary/efl_ui_video.eo index 9cc1b43b42..5fc841a3b3 100644 --- a/src/lib/elementary/efl_ui_video.eo +++ b/src/lib/elementary/efl_ui_video.eo @@ -1,6 +1,6 @@ class @beta Efl.Ui.Video extends Efl.Ui.Layout_Base - implements Efl.File, Efl.Player, Efl.Access.Widget.Action - composite Efl.Player + implements Efl.File, Efl.Access.Widget.Action + composites Efl.Player { [[Efl UI video class]] methods { diff --git a/src/lib/elementary/efl_ui_widget_focus_manager.eo b/src/lib/elementary/efl_ui_widget_focus_manager.eo index d12a4a0c79..431fea71c8 100644 --- a/src/lib/elementary/efl_ui_widget_focus_manager.eo +++ b/src/lib/elementary/efl_ui_widget_focus_manager.eo @@ -1,7 +1,6 @@ mixin Efl.Ui.Widget_Focus_Manager requires Efl.Ui.Widget - extends Efl.Ui.Focus.Manager - composite Efl.Ui.Focus.Manager + composites Efl.Ui.Focus.Manager { [[Helper mixin for widgets which also can act as focus managers. diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 6fa01b8291..745e7a318b 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -137,9 +137,9 @@ enum Efl.Ui.Win_Move_Resize_Mode class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.Window, Efl.Access.Component, Efl.Access.Widget.Action, Efl.Content, Efl.Input.State, Efl.Input.Interface, Efl.Screen, - Efl.Text, Efl.Config, - Efl.Ui.Widget_Focus_Manager, Efl.Ui.Focus.Manager_Window_Root - composite Efl.Config + Efl.Text, Efl.Ui.Widget_Focus_Manager, + Efl.Ui.Focus.Manager_Window_Root + composites Efl.Config { [[Efl UI window class. diff --git a/src/tests/eolian/data/unimpl.eo b/src/tests/eolian/data/unimpl.eo index e08699a231..1e11a85e93 100644 --- a/src/tests/eolian/data/unimpl.eo +++ b/src/tests/eolian/data/unimpl.eo @@ -1,4 +1,4 @@ -class Unimpl implements Iface composite Iface { +class Unimpl composites Iface { implements { Iface.foo; } From 539dc642e9bc5e89ef0391ca0bf263bfc76c703c Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 19 Sep 2019 18:17:37 +0200 Subject: [PATCH 15/56] eolian: remove the composite keyword (replaced by composites) --- src/lib/eolian/eo_lexer.h | 2 +- src/lib/eolian/eo_parser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index 0746e79bae..e6ab8da0bd 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -27,7 +27,7 @@ enum Tokens */ #define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ \ - KW(abstract), KW(c_prefix), KW(composite), KW(composites), KW(constructor), KW(constructors), \ + KW(abstract), KW(c_prefix), KW(composites), KW(constructor), KW(constructors), \ KW(data), KW(destructor), KW(error), KW(event_prefix), KW(events), KW(extends), \ KW(free), KW(get), KW(implements), KW(import), KW(interface), \ KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \ diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index c403305a2f..879cc0af3a 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -2318,7 +2318,7 @@ tags_done: while (test_next(ls, ',')); } - if (ls->t.kw == KW_composite || ls->t.kw == KW_composites) + if (ls->t.kw == KW_composites) { if (type == EOLIAN_CLASS_INTERFACE) eo_lexer_syntax_error(ls, "interfaces cannot composite"); From aae2e49744824d8698262fca943b5c47c94ee560 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 19 Sep 2019 14:03:59 -0400 Subject: [PATCH 16/56] ecore/signal: also use nonblock for writing side of signal pipe if any efl-based process receives a bunch of signals in a short period of time, it will deadlock in the signal handler. this is unavoidable given the current signal handling architecture by setting nonblock, we can at least avoid deadlocking even if it means we'll be losing signal events @fix Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10025 --- src/lib/ecore/ecore_signal.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c index e16694b55a..c3e5b0fda9 100644 --- a/src/lib/ecore/ecore_signal.c +++ b/src/lib/ecore/ecore_signal.c @@ -168,13 +168,17 @@ _ecore_signal_callback(int sig, siginfo_t *si, void *foo EINA_UNUSED) { int err = errno; if (pipe_dead) return; - const ssize_t bytes = write(sig_pipe[1], &sdata, sizeof(sdata)); - if (EINA_UNLIKELY(bytes != sizeof(sdata))) + do { - err = errno; - ERR("write() failed: %s", strerror(err)); - } - errno = err; + const ssize_t bytes = write(sig_pipe[1], &sdata, sizeof(sdata)); + if (EINA_UNLIKELY(bytes != sizeof(sdata))) + { + err = errno; + ERR("write() failed: %d: %s", err, strerror(err)); + } + errno = err; + /* loop if we got preempted */ + } while (err == EINTR); } switch (sig) { @@ -249,6 +253,8 @@ _ecore_signal_pipe_init(void) eina_file_close_on_exec(sig_pipe[1], EINA_TRUE); if (fcntl(sig_pipe[0], F_SETFL, O_NONBLOCK) < 0) ERR("can't set pipe to NONBLOCK"); + if (fcntl(sig_pipe[1], F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); } _signalhandler_setup(); From af5abbe4bcdd3ae0a687ef77b38d942e3249377d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 19 Sep 2019 14:15:45 -0400 Subject: [PATCH 17/56] tests/ecore: add stress test for main loop signal handling this explodes after about 500 signals, so make it 1000 for a good test Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10026 --- src/tests/ecore/ecore_test_job.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/tests/ecore/ecore_test_job.c b/src/tests/ecore/ecore_test_job.c index 5a2d6f3f75..7f3e6ad7b4 100644 --- a/src/tests/ecore/ecore_test_job.c +++ b/src/tests/ecore/ecore_test_job.c @@ -28,7 +28,30 @@ EFL_START_TEST(ecore_test_job) } EFL_END_TEST +#ifndef _WIN32 +static void +_ecore_signal_job(void *data EINA_UNUSED) +{ + EXPECT_ERROR_START; + for (unsigned int i = 0; i < 1000; i++) + raise(SIGUSR2); + ecore_main_loop_quit(); + EXPECT_ERROR_END; +} + +EFL_START_TEST(ecore_test_job_signal) +{ + ecore_job_add(_ecore_signal_job, NULL); + + ecore_main_loop_begin(); +} +EFL_END_TEST +#endif + void ecore_test_ecore_job(TCase *tc) { tcase_add_test(tc, ecore_test_job); +#ifndef _WIN32 + tcase_add_test(tc, ecore_test_job_signal); +#endif } From da5fcb8ea07f69f1348f0c2c86cc408cf5184e30 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 19 Sep 2019 14:52:23 -0400 Subject: [PATCH 18/56] ecore/signal: increase maximum signal throughput this adds 4 more signal handling fds and loops over them for reading/writing signal info in order to handle more signals when the buffer of one (or more) pipes is full also update the unit test to verify that we are receiving all the events without dropping any and bump the number of signals to 2000 since we should now be able to handle that many Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10027 --- src/lib/ecore/ecore_signal.c | 280 ++++++++++++++++--------------- src/tests/ecore/ecore_test_job.c | 18 +- 2 files changed, 161 insertions(+), 137 deletions(-) diff --git a/src/lib/ecore/ecore_signal.c b/src/lib/ecore/ecore_signal.c index c3e5b0fda9..eebb692276 100644 --- a/src/lib/ecore/ecore_signal.c +++ b/src/lib/ecore/ecore_signal.c @@ -34,8 +34,10 @@ static void _ecore_signal_generic_free(void *data, void *event); typedef void (*Signal_Handler)(int sig, siginfo_t *si, void *foo); -static int sig_pipe[2] = { -1, -1 }; // [0] == read, [1] == write -static Eo *sig_pipe_handler = NULL; +#define NUM_PIPES 5 + +static int sig_pipe[NUM_PIPES][2] = {{ -1 }}; // [0] == read, [1] == write +static Eo *sig_pipe_handler[NUM_PIPES] = {NULL}; static Eina_Spinlock sig_pid_lock; static Eina_List *sig_pid_info_list = NULL; @@ -48,114 +50,111 @@ typedef struct _Signal_Data siginfo_t info; } Signal_Data; -static Eina_Bool +static void _ecore_signal_pipe_read(Eo *obj) { Signal_Data sdata; int ret; - if (pipe_dead) return EINA_TRUE; - ret = read(sig_pipe[0], &sdata, sizeof(sdata)); - if (ret != sizeof(sdata)) return EINA_FALSE; - switch (sdata.sig) + if (pipe_dead) return; + for (unsigned int i = 0; i < NUM_PIPES; i++) { - case SIGPIPE: - break; - case SIGALRM: - break; - case SIGCHLD: - _ecore_signal_waitpid(EINA_FALSE, sdata.info); - break; - case SIGUSR1: - case SIGUSR2: + while (1) { - Ecore_Event_Signal_User *e = _ecore_event_signal_user_new(); - if (e) + ret = read(sig_pipe[i][0], &sdata, sizeof(sdata)); + + /* read as many signals as we can, trying again if we get interrupted */ + if ((ret != sizeof(sdata)) && (errno != EINTR)) break; + switch (sdata.sig) { - if (sdata.sig == SIGUSR1) e->number = 1; - else e->number = 2; - e->data = sdata.info; - ecore_event_add(ECORE_EVENT_SIGNAL_USER, e, - _ecore_signal_generic_free, NULL); + case SIGPIPE: + break; + case SIGALRM: + break; + case SIGCHLD: + _ecore_signal_waitpid(EINA_FALSE, sdata.info); + break; + case SIGUSR1: + case SIGUSR2: + { + Ecore_Event_Signal_User *e = _ecore_event_signal_user_new(); + if (e) + { + if (sdata.sig == SIGUSR1) e->number = 1; + else e->number = 2; + e->data = sdata.info; + ecore_event_add(ECORE_EVENT_SIGNAL_USER, e, + _ecore_signal_generic_free, NULL); + } + Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS); + if (loop) + { + if (sdata.sig == SIGUSR1) + efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_USR1, NULL); + else + efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_USR2, NULL); + } + } + break; + case SIGHUP: + { + Ecore_Event_Signal_Hup *e = _ecore_event_signal_hup_new(); + if (e) + { + e->data = sdata.info; + ecore_event_add(ECORE_EVENT_SIGNAL_HUP, e, + _ecore_signal_generic_free, NULL); + } + Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS); + if (loop) + efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_HUP, NULL); + } + break; + case SIGQUIT: + case SIGINT: + case SIGTERM: + { + Ecore_Event_Signal_Exit *e = _ecore_event_signal_exit_new(); + if (e) + { + if (sdata.sig == SIGQUIT) e->quit = 1; + else if (sdata.sig == SIGINT) e->interrupt = 1; + else e->terminate = 1; + e->data = sdata.info; + ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, e, + _ecore_signal_generic_free, NULL); + } + Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS); + if (loop) + efl_event_callback_call(loop, EFL_LOOP_EVENT_QUIT, NULL); + } + break; + #ifdef SIGPWR + case SIGPWR: + { + Ecore_Event_Signal_Power *e = _ecore_event_signal_power_new(); + if (e) + { + e->data = sdata.info; + ecore_event_add(ECORE_EVENT_SIGNAL_POWER, e, + _ecore_signal_generic_free, NULL); + } + } + break; + #endif + default: + break; } - Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS); - if (loop) - { - if (sdata.sig == SIGUSR1) - efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_USR1, NULL); - else - efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_USR2, NULL); - } - } - break; - case SIGHUP: - { - Ecore_Event_Signal_Hup *e = _ecore_event_signal_hup_new(); - if (e) - { - e->data = sdata.info; - ecore_event_add(ECORE_EVENT_SIGNAL_HUP, e, - _ecore_signal_generic_free, NULL); - } - Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS); - if (loop) - efl_event_callback_call(loop, EFL_APP_EVENT_SIGNAL_HUP, NULL); - } - break; - case SIGQUIT: - case SIGINT: - case SIGTERM: - { - Ecore_Event_Signal_Exit *e = _ecore_event_signal_exit_new(); - if (e) - { - if (sdata.sig == SIGQUIT) e->quit = 1; - else if (sdata.sig == SIGINT) e->interrupt = 1; - else e->terminate = 1; - e->data = sdata.info; - ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, e, - _ecore_signal_generic_free, NULL); - } - Eo *loop = efl_provider_find(obj, EFL_LOOP_CLASS); - if (loop) - efl_event_callback_call(loop, EFL_LOOP_EVENT_QUIT, NULL); - } - break; -#ifdef SIGPWR - case SIGPWR: - { - Ecore_Event_Signal_Power *e = _ecore_event_signal_power_new(); - if (e) - { - e->data = sdata.info; - ecore_event_add(ECORE_EVENT_SIGNAL_POWER, e, - _ecore_signal_generic_free, NULL); - } - } - break; -#endif - default: - break; + } } - return EINA_TRUE; } static void _ecore_signal_cb_read(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { - while (_ecore_signal_pipe_read(event->object)); + _ecore_signal_pipe_read(event->object); } -static void -_ecore_signal_cb_del(void *data EINA_UNUSED, const Efl_Event *event) -{ - if (event->object == sig_pipe_handler) sig_pipe_handler = NULL; -} - -EFL_CALLBACKS_ARRAY_DEFINE(_event_watch, - { EFL_LOOP_HANDLER_EVENT_READ, _ecore_signal_cb_read }, - { EFL_EVENT_DEL, _ecore_signal_cb_del }); - static void _ecore_signal_callback(int sig, siginfo_t *si, void *foo EINA_UNUSED) { @@ -168,17 +167,25 @@ _ecore_signal_callback(int sig, siginfo_t *si, void *foo EINA_UNUSED) { int err = errno; if (pipe_dead) return; - do + for (unsigned int i = 0; i < NUM_PIPES; i++) { - const ssize_t bytes = write(sig_pipe[1], &sdata, sizeof(sdata)); - if (EINA_UNLIKELY(bytes != sizeof(sdata))) + do { - err = errno; - ERR("write() failed: %d: %s", err, strerror(err)); - } - errno = err; - /* loop if we got preempted */ - } while (err == EINTR); + err = 0; + const ssize_t bytes = write(sig_pipe[i][1], &sdata, sizeof(sdata)); + if (EINA_UNLIKELY(bytes != sizeof(sdata))) + { + err = errno; + if (err == EINTR) + DBG("signal pipe %u full", i); + else if (i == NUM_PIPES - 1) //only print errors on last pipe + ERR("write() failed: %d: %s", err, strerror(err)); + } + errno = err; + /* loop if we got preempted */ + } while (err == EINTR); + if (!err) break; + } } switch (sig) { @@ -242,45 +249,52 @@ static void _ecore_signal_pipe_init(void) { eina_spinlock_new(&sig_pid_lock); - if (sig_pipe[0] == -1) - { - if (pipe(sig_pipe) != 0) - { - sig_pipe[0] = -1; - return; - } - eina_file_close_on_exec(sig_pipe[0], EINA_TRUE); - eina_file_close_on_exec(sig_pipe[1], EINA_TRUE); - if (fcntl(sig_pipe[0], F_SETFL, O_NONBLOCK) < 0) - ERR("can't set pipe to NONBLOCK"); - if (fcntl(sig_pipe[1], F_SETFL, O_NONBLOCK) < 0) - ERR("can't set pipe to NONBLOCK"); - - } _signalhandler_setup(); - if (!sig_pipe_handler) - sig_pipe_handler = - efl_add(EFL_LOOP_HANDLER_CLASS, ML_OBJ, - efl_loop_handler_fd_set(efl_added, sig_pipe[0]), - efl_loop_handler_active_set(efl_added, EFL_LOOP_HANDLER_FLAGS_READ), - efl_event_callback_array_add(efl_added, _event_watch(), NULL)); + if (sig_pipe[0][0] == -1) + { + for (unsigned int i = 0; i < NUM_PIPES; i++) + { + if (pipe(sig_pipe[i]) != 0) + { + CRI("failed setting up signal pipes! %s", strerror(errno)); + for (unsigned int j = 0; j < i; j++) + { + close(sig_pipe[j][0]); + close(sig_pipe[j][1]); + } + memset(sig_pipe, -1, sizeof(sig_pipe)); + return; + } + eina_file_close_on_exec(sig_pipe[i][0], EINA_TRUE); + eina_file_close_on_exec(sig_pipe[i][1], EINA_TRUE); + if (fcntl(sig_pipe[i][0], F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + if (fcntl(sig_pipe[i][1], F_SETFL, O_NONBLOCK) < 0) + ERR("can't set pipe to NONBLOCK"); + efl_add(EFL_LOOP_HANDLER_CLASS, ML_OBJ, + efl_loop_handler_fd_set(efl_added, sig_pipe[i][0]), + efl_loop_handler_active_set(efl_added, EFL_LOOP_HANDLER_FLAGS_READ), + efl_event_callback_add(efl_added, EFL_LOOP_HANDLER_EVENT_READ, _ecore_signal_cb_read, NULL), + efl_wref_add(efl_added, &sig_pipe_handler[i]) + ); + + } + } } static void _ecore_signal_pipe_shutdown(void) { - if (sig_pipe_handler) + if (sig_pipe[0][0] != -1) { - efl_del(sig_pipe_handler); - sig_pipe_handler = NULL; - } - if (sig_pipe[0] != -1) - { - close(sig_pipe[0]); - close(sig_pipe[1]); - sig_pipe[0] = -1; - sig_pipe[1] = -1; + for (unsigned int i = 0; i < NUM_PIPES; i++) + { + close(sig_pipe[i][0]); + close(sig_pipe[i][1]); + efl_del(sig_pipe_handler[i]); + } } + memset(sig_pipe, -1, sizeof(sig_pipe)); eina_spinlock_free(&sig_pid_lock); } diff --git a/src/tests/ecore/ecore_test_job.c b/src/tests/ecore/ecore_test_job.c index 7f3e6ad7b4..688e8abe7e 100644 --- a/src/tests/ecore/ecore_test_job.c +++ b/src/tests/ecore/ecore_test_job.c @@ -29,21 +29,31 @@ EFL_START_TEST(ecore_test_job) EFL_END_TEST #ifndef _WIN32 +#define NUM_SIGNALS 2000 +static Eina_Bool +_signal_cb(void *data, int t EINA_UNUSED, void *ev EINA_UNUSED) +{ + int *called = data; + (*called)++; + if (*called == NUM_SIGNALS) ecore_main_loop_quit(); + return ECORE_CALLBACK_RENEW; +} + static void _ecore_signal_job(void *data EINA_UNUSED) { - EXPECT_ERROR_START; - for (unsigned int i = 0; i < 1000; i++) + for (unsigned int i = 0; i < NUM_SIGNALS; i++) raise(SIGUSR2); - ecore_main_loop_quit(); - EXPECT_ERROR_END; } EFL_START_TEST(ecore_test_job_signal) { + int called = 0; ecore_job_add(_ecore_signal_job, NULL); + ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _signal_cb, &called); ecore_main_loop_begin(); + ck_assert_int_eq(called, NUM_SIGNALS); } EFL_END_TEST #endif From 393530b770da3cb5680ff2a3de5ee166310954cf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 19 Sep 2019 10:54:47 -0400 Subject: [PATCH 19/56] efl_ui: further unbreak headers move more header includes around to fix building with Efl_Ui.h ref T8228 Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10022 --- src/lib/elementary/Efl_Ui.h | 12 +----------- src/lib/elementary/efl_ui_list_view_private.h | 1 + src/lib/elementary/elm_priv.h | 8 ++++++++ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index f9b3dee410..e5b5b6b00b 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -327,28 +327,18 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include "efl_ui_list_view_types.eot.h" # include # include -# include -# include -# include # include -# include -# include -# include -# include + # include # include # include -# include # include -# include # include # include # include -# include -# include # include # include # include diff --git a/src/lib/elementary/efl_ui_list_view_private.h b/src/lib/elementary/efl_ui_list_view_private.h index 6b1c632d60..2443cf4438 100644 --- a/src/lib/elementary/efl_ui_list_view_private.h +++ b/src/lib/elementary/efl_ui_list_view_private.h @@ -7,6 +7,7 @@ #include #include "efl_ui_list_view_relayout.eo.h" +#include "efl_ui_list_view_pan.eo.h" #include "elm_priv.h" typedef struct _Efl_Ui_List_View_Data Efl_Ui_List_View_Data; diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h index 86f4066810..b94322c004 100644 --- a/src/lib/elementary/elm_priv.h +++ b/src/lib/elementary/elm_priv.h @@ -156,7 +156,15 @@ #include "efl_ui_layout_legacy_eo.h" +# include "efl_ui_size_model.eo.h" +# include "efl_ui_homogeneous_model.eo.h" +# include "efl_ui_exact_model.eo.h" +# include "efl_ui_average_model.eo.h" +# include "efl_ui_focus_parent_provider.eo.h" +# include "efl_ui_focus_parent_provider_standard.eo.h" +# include "efl_ui_selection_manager.eo.h" +# include "efl_datetime_manager.eo.h" extern const char *_efl_model_property_itemw; extern const char *_efl_model_property_itemh; extern const char *_efl_model_property_selfw; From 21fe2bdc411cba7443d26c17fbb4c819d3edc916 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 19 Sep 2019 09:27:59 +0200 Subject: [PATCH 20/56] eo: custom created legacy events should be unfreezable a while back we have moved event submission from custom lists to eo events. We also merged together the freeze and thaw functions, however, this brought up one bug. smart_callbacks and the likes (those that used custom lists before) are not effected by the legacy freeze and thaw functions. This means, we should declare these legacy wrapper objects unfreezable in order to obtain this behaviour. Reviewed-by: Cedric BAIL Reviewed-by: SangHyeon Jade Lee Differential Revision: https://phab.enlightenment.org/D10016 --- src/lib/eo/eo_base_class.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index d9edf15a90..782a57f52e 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -1132,6 +1132,7 @@ efl_object_legacy_only_event_description_get(const char *_event_name) event_desc = calloc(1, sizeof(Efl_Event_Description)); event_desc->name = event_name; event_desc->legacy_is = EINA_TRUE; + event_desc->unfreezable = EINA_TRUE; eina_hash_add(_legacy_events_hash, event_name, event_desc); } else From e06e03f2200c1ed33a46369c01f3c6ca311f37e8 Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Tue, 17 Sep 2019 09:15:05 +0000 Subject: [PATCH 21/56] efl_ui_collection: fix null pointer dereferences This will fix Coverity issue. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9986 --- src/lib/elementary/efl_ui_collection.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c index 1763b65195..718f5b120e 100644 --- a/src/lib/elementary/efl_ui_collection.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -960,6 +960,7 @@ _efl_ui_collection_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Efl Eo *man = efl_add(EFL_UI_COLLECTION_FOCUS_MANAGER_CLASS, obj, efl_ui_focus_manager_root_set(efl_added, root)); Efl_Ui_Collection_Focus_Manager_Data *fm_pd = efl_data_scope_safe_get(man, EFL_UI_COLLECTION_FOCUS_MANAGER_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(fm_pd, NULL); fm_pd->collection = obj; return man; } From 6960751c4580af9e902cd7719c1acafab4ce7bc5 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 19 Sep 2019 14:43:31 +0200 Subject: [PATCH 22/56] elm_test_widget_focus: cleanup callbacks correctly we need to delete the callback here, otherwise the objects are deleted later on, which: - changes focus, which leads to - callbacks executed with stacked addresses from a dead function this fixes a testsuite failure on the release build. Reviewed-by: Mike Blumenkrantz Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D10020 --- src/tests/elementary/elm_test_widget_focus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/elementary/elm_test_widget_focus.c b/src/tests/elementary/elm_test_widget_focus.c index d41889b86e..fb2a5a2678 100644 --- a/src/tests/elementary/elm_test_widget_focus.c +++ b/src/tests/elementary/elm_test_widget_focus.c @@ -201,6 +201,8 @@ EFL_START_TEST(elm_test_widget_focus_simple_widget) ck_assert_int_eq(flag_unfocused, EINA_TRUE); ck_assert_int_eq(elm_object_focus_get(resettor), EINA_TRUE); ck_assert_int_eq(elm_object_focus_get(o), EINA_FALSE); + evas_object_smart_callback_del_full(o, "focused", _eventing_test, &flag_focused); + evas_object_smart_callback_del_full(o, "unfocused", _eventing_test, &flag_unfocused); } eina_hash_free(map); From 422154c0de048da021f3dd1909802b1529c98708 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 18 Sep 2019 17:42:28 +0200 Subject: [PATCH 23/56] efl_test_multi_selectable: test for the correct event EFL_UI_EVENT_ITEM_SELECTED / UNSELECTED is the wrong event here. We should check of the selection changed event. ITEM_SELECTED is the legacy event. this was not found based on the fact that we test for this event to NOT be executed. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10011 --- .../spec/efl_test_multi_selectable.c | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/src/tests/elementary/spec/efl_test_multi_selectable.c b/src/tests/elementary/spec/efl_test_multi_selectable.c index 770c10e5bb..a2606a13b8 100644 --- a/src/tests/elementary/spec/efl_test_multi_selectable.c +++ b/src/tests/elementary/spec/efl_test_multi_selectable.c @@ -17,15 +17,6 @@ spec-meta-end */ -static void -_set_pointer_quit(void *data, const Efl_Event *ev) -{ - Efl_Ui_Item **b = data; - - ck_assert_ptr_eq(*b, NULL); - *b = ev->info; -} - static void _iterator_to_array(Eina_Array **arr, Eina_Iterator *iter) { @@ -137,31 +128,26 @@ EFL_END_TEST EFL_START_TEST(test_none_select) { - Efl_Ui_Item *selected = NULL; - Efl_Ui_Item *unselected = NULL; Eina_Array *arr_selected; + int c = 0; efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_NONE); - efl_event_callback_add(widget, EFL_UI_EVENT_ITEM_SELECTED, _set_pointer_quit, &selected); - efl_event_callback_add(widget, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); + efl_event_callback_add(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); + efl_event_callback_add(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); efl_ui_selectable_selected_set(efl_pack_content_get(widget, 0), EINA_TRUE); - ck_assert_ptr_eq(selected, NULL); - ck_assert_ptr_eq(unselected, NULL); - selected = NULL; - unselected = NULL; + get_me_to_those_events(widget); + ck_assert_int_eq(c, 0); efl_ui_selectable_selected_set(efl_pack_content_get(widget, 2), EINA_TRUE); - ck_assert_ptr_eq(selected, NULL); - ck_assert_ptr_eq(unselected, NULL); - selected = NULL; - unselected = NULL; + get_me_to_those_events(widget); + ck_assert_int_eq(c, 0); ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE); ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_FALSE); ck_assert_ptr_eq(efl_ui_single_selectable_last_selected_get(widget), NULL); _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget)); ck_assert_int_eq(eina_array_count(arr_selected), 0); - efl_event_callback_del(widget, EFL_UI_EVENT_ITEM_SELECTED, _set_pointer_quit, &selected); - efl_event_callback_del(widget, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); + efl_event_callback_del(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); + efl_event_callback_del(widget, EFL_UI_SINGLE_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); } EFL_END_TEST From ccdec4ba6885bff7f5d991f3ca2122f84d6dd332 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 17 Sep 2019 15:51:54 +0200 Subject: [PATCH 24/56] efl_ui_widget_part: implement all the missing API Efl.Color and Efl.File cannot be done due to composition. Efl.Gfx.Image can, so we can solve this via composition, this also resolves all the other cases for Efl.Gfx.Image. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9991 --- src/lib/elementary/efl_ui_widget.c | 15 +++++---------- src/lib/elementary/efl_ui_widget_part_bg.eo | 4 ++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 88eae6ef78..5168dbc793 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -5759,21 +5759,16 @@ _efl_ui_widget_part_bg_efl_gfx_color_color_get(const Eo *obj, void *pd EINA_UNUS efl_gfx_color_get(bg_obj, r, g, b, a); } -EOLIAN static void -_efl_ui_widget_part_bg_efl_gfx_image_scale_method_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Image_Scale_Method scale_type) +EOLIAN static Efl_Object* +_efl_ui_widget_part_bg_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED) { Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); - efl_gfx_image_scale_method_set(bg_obj, scale_type); + efl_composite_attach(obj, bg_obj); + + return efl_finalize(efl_super(obj, EFL_UI_WIDGET_PART_BG_CLASS)); } -EOLIAN static Efl_Gfx_Image_Scale_Method -_efl_ui_widget_part_bg_efl_gfx_image_scale_method_get(const Eo *obj, void *pd EINA_UNUSED) -{ - Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj); - - return efl_gfx_image_scale_method_get(bg_obj); -} typedef struct _Efl_Ui_Property_Bound Efl_Ui_Property_Bound; struct _Efl_Ui_Property_Bound diff --git a/src/lib/elementary/efl_ui_widget_part_bg.eo b/src/lib/elementary/efl_ui_widget_part_bg.eo index 8e0612ec87..d19b8574e2 100644 --- a/src/lib/elementary/efl_ui_widget_part_bg.eo +++ b/src/lib/elementary/efl_ui_widget_part_bg.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image +class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image composite Efl.Gfx.Image { [[Elementary widget internal part background class @@ -9,12 +9,12 @@ class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File ]] data: null; implements { + Efl.Object.finalize; Efl.File.file { get; set; } Efl.File.key { get; set; } Efl.File.mmap { get; set; } Efl.File.load; Efl.File.unload; Efl.Gfx.Color.color { set; get; } - Efl.Gfx.Image.scale_method { get; set; } } } From aecb3a4bb27ec9a83e5f69aea323743bc5d57360 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 17 Sep 2019 16:25:37 +0200 Subject: [PATCH 25/56] efl_ui_layout_part_table: implement Efl.Pack.pack API this api was missing, the pack method here is behaving in the same manner as Efl.Ui.Table. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9992 --- src/lib/elementary/efl_ui_layout_pack.c | 42 +++++++++++++++++++ .../elementary/efl_ui_layout_part_table.eo | 1 + 2 files changed, 43 insertions(+) diff --git a/src/lib/elementary/efl_ui_layout_pack.c b/src/lib/elementary/efl_ui_layout_pack.c index 2c79d66266..646ef3e483 100644 --- a/src/lib/elementary/efl_ui_layout_pack.c +++ b/src/lib/elementary/efl_ui_layout_pack.c @@ -274,6 +274,48 @@ _efl_ui_layout_part_table_efl_pack_unpack(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Tab return _efl_ui_layout_table_unpack(pd->obj, pd->sd, pd->part, subobj) == subobj; } + +EOLIAN static Eina_Bool +_efl_ui_layout_part_table_efl_pack_pack(Eo *obj, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx_Entity *subobj) +{ + int last_col, last_row; + int req_cols, req_rows; + Eina_Iterator *iter; + Eo *pack, *element; + + pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part); + + + //first lookup what the most lower / right element is + iter = evas_object_table_iterator_new(pack); + EINA_ITERATOR_FOREACH(iter, element) + { + unsigned short item_col, item_row; + + evas_object_table_pack_get(pack, element, &item_col, &item_row, NULL, NULL); + if (item_row > last_row || + (item_row == last_row && item_col > last_col)) + { + last_col = item_col; + last_row = item_row; + } + } + eina_iterator_free(iter); + + //now add the new element right to it, or do a linebreak and place + //that element in the next column on the first element + evas_object_table_col_row_size_get(pack, &req_cols, &req_rows); + last_col ++; + if (last_col > req_cols) + { + last_row ++; + last_col = 0; + } + + return _efl_ui_layout_table_pack(obj, pd->sd, pd->part, subobj, last_col, last_row, 1, 1); +} + + EOLIAN static Eina_Bool _efl_ui_layout_part_table_efl_pack_table_pack_table(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx_Entity *subobj, int col, int row, int colspan, int rowspan) { diff --git a/src/lib/elementary/efl_ui_layout_part_table.eo b/src/lib/elementary/efl_ui_layout_part_table.eo index eca9fa43f9..9c9482cf1e 100644 --- a/src/lib/elementary/efl_ui_layout_part_table.eo +++ b/src/lib/elementary/efl_ui_layout_part_table.eo @@ -21,6 +21,7 @@ class @beta Efl.Ui.Layout_Part_Table extends Efl.Object implements Efl.Pack_Tabl Efl.Object.destructor; Efl.Container.content_iterate; Efl.Container.content_count; + Efl.Pack.pack; Efl.Pack.pack_clear; Efl.Pack.unpack_all; Efl.Pack.unpack; From d8053bac9607f0cd592f605d46db57c72d33b70d Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 17 Sep 2019 16:39:55 +0200 Subject: [PATCH 26/56] efl_ui_layout_part_box/table: remove real_part_set real part set was used to set the real part on the part, so the obj pointer of Layout_Part_Data points to the correct evas object. With this commit, this API is removed from the public .eo files, and is refactored into the same API which is private. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9993 --- src/lib/elementary/efl_ui_layout_pack.c | 31 +++++++------------ src/lib/elementary/efl_ui_layout_part_box.eo | 9 ------ .../elementary/efl_ui_layout_part_table.eo | 9 ------ 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout_pack.c b/src/lib/elementary/efl_ui_layout_pack.c index 646ef3e483..02ad407981 100644 --- a/src/lib/elementary/efl_ui_layout_pack.c +++ b/src/lib/elementary/efl_ui_layout_pack.c @@ -41,15 +41,24 @@ struct _Layout_Part_Data unsigned char temp; }; +static void +_efl_ui_layout_part_set_real_part(Eo *obj, struct _Layout_Part_Data *pd, Eo *layout, const char *part) +{ + pd->obj = layout; + pd->sd = efl_data_xref(pd->obj, EFL_UI_LAYOUT_BASE_CLASS, obj); + eina_stringshare_replace(&pd->part, part); + pd->temp = 1; +} + Eo * _efl_ui_layout_pack_proxy_get(Efl_Ui_Layout *obj, Edje_Part_Type type, const char *part) { if (type == EDJE_PART_TYPE_BOX) return efl_add(BOX_CLASS, obj, - efl_ui_layout_part_box_real_part_set(efl_added, obj, part)); + _efl_ui_layout_part_set_real_part(efl_added, efl_data_scope_get(efl_added, BOX_CLASS), obj, part)); else if (type == EDJE_PART_TYPE_TABLE) return efl_add(TABLE_CLASS, obj, - efl_ui_layout_part_table_real_part_set(efl_added, obj, part)); + _efl_ui_layout_part_set_real_part(efl_added, efl_data_scope_get(efl_added, TABLE_CLASS), obj, part)); else return NULL; } @@ -63,15 +72,6 @@ _efl_ui_layout_part_box_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Table_Data efl_destructor(efl_super(obj, BOX_CLASS)); } -EOLIAN static void -_efl_ui_layout_part_box_real_part_set(Eo *obj, Efl_Ui_Layout_Box_Data *pd, Eo *layout, const char *part) -{ - pd->obj = layout; - pd->sd = efl_data_xref(pd->obj, EFL_UI_LAYOUT_BASE_CLASS, obj); - eina_stringshare_replace(&pd->part, part); - pd->temp = 1; -} - EOLIAN static Eina_Iterator * _efl_ui_layout_part_box_efl_container_content_iterate(Eo *obj, Efl_Ui_Layout_Box_Data *pd) { @@ -214,15 +214,6 @@ _efl_ui_layout_part_box_efl_ui_layout_orientable_orientation_get(const Eo *obj E /* Table proxy implementation */ -EOLIAN static void -_efl_ui_layout_part_table_real_part_set(Eo *obj, Efl_Ui_Layout_Table_Data *pd, Eo *layout, const char *part) -{ - pd->obj = layout; - pd->sd = efl_data_xref(pd->obj, EFL_UI_LAYOUT_BASE_CLASS, obj); - eina_stringshare_replace(&pd->part, part); - pd->temp = 1; -} - EOLIAN static void _efl_ui_layout_part_table_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Table_Data *pd) { diff --git a/src/lib/elementary/efl_ui_layout_part_box.eo b/src/lib/elementary/efl_ui_layout_part_box.eo index 683418c7d4..6ebbc2c2b6 100644 --- a/src/lib/elementary/efl_ui_layout_part_box.eo +++ b/src/lib/elementary/efl_ui_layout_part_box.eo @@ -8,15 +8,6 @@ class @beta Efl.Ui.Layout_Part_Box extends Efl.Object implements Efl.Pack_Linear ]] data: Efl_Ui_Layout_Box_Data; methods { - /* FIXME: Remove this. */ - @property real_part @protected { - [[Real part property]] - set {} - values { - layout: Efl.Object; [[Real part object]] - part: string; [[Real part name]] - } - } } implements { Efl.Object.destructor; diff --git a/src/lib/elementary/efl_ui_layout_part_table.eo b/src/lib/elementary/efl_ui_layout_part_table.eo index 9c9482cf1e..6730927065 100644 --- a/src/lib/elementary/efl_ui_layout_part_table.eo +++ b/src/lib/elementary/efl_ui_layout_part_table.eo @@ -7,15 +7,6 @@ class @beta Efl.Ui.Layout_Part_Table extends Efl.Object implements Efl.Pack_Tabl ]] data: Efl_Ui_Layout_Table_Data; methods { - /* FIXME: Remove this. */ - @property real_part @protected { - [[Real part property]] - set {} - values { - layout: Efl.Object; [[Real part object]] - part: string; [[Real part name]] - } - } } implements { Efl.Object.destructor; From fc22a94d26abbce8f166893ec1436404190670f0 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 17 Sep 2019 15:59:07 +0200 Subject: [PATCH 27/56] efl_ui_widget_*: declare parts stable Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9994 --- src/lib/elementary/efl_ui_widget.eo | 4 ++-- src/lib/elementary/efl_ui_widget_part.eo | 2 +- src/lib/elementary/efl_ui_widget_part_bg.eo | 2 +- src/lib/elementary/efl_ui_widget_part_shadow.eo | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index fe7a032324..2848ef0db5 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -397,8 +397,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, } } parts { - shadow @beta: Efl.Ui.Widget_Part_Shadow; - background @beta: Efl.Ui.Widget_Part_Bg; + shadow : Efl.Ui.Widget_Part_Shadow; + background : Efl.Ui.Widget_Part_Bg; } implements { class.constructor; diff --git a/src/lib/elementary/efl_ui_widget_part.eo b/src/lib/elementary/efl_ui_widget_part.eo index e629fdcfa2..badf49c17b 100644 --- a/src/lib/elementary/efl_ui_widget_part.eo +++ b/src/lib/elementary/efl_ui_widget_part.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Widget_Part extends Efl.Object implements Efl.Ui.Property_Bind +class Efl.Ui.Widget_Part extends Efl.Object implements Efl.Ui.Property_Bind { [[This is the base class for all "Part" handles in Efl.Ui widgets. diff --git a/src/lib/elementary/efl_ui_widget_part_bg.eo b/src/lib/elementary/efl_ui_widget_part_bg.eo index d19b8574e2..9aec9e44a1 100644 --- a/src/lib/elementary/efl_ui_widget_part_bg.eo +++ b/src/lib/elementary/efl_ui_widget_part_bg.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image composite Efl.Gfx.Image +class Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image composites Efl.Gfx.Image { [[Elementary widget internal part background class diff --git a/src/lib/elementary/efl_ui_widget_part_shadow.eo b/src/lib/elementary/efl_ui_widget_part_shadow.eo index 77002c0b41..0dc4c7d127 100644 --- a/src/lib/elementary/efl_ui_widget_part_shadow.eo +++ b/src/lib/elementary/efl_ui_widget_part_shadow.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Widget_Part_Shadow extends Efl.Ui.Widget_Part implements Efl.Gfx.Color, +class Efl.Ui.Widget_Part_Shadow extends Efl.Ui.Widget_Part implements Efl.Gfx.Color, Efl.Gfx.Blur, Efl.Gfx.Filter { [[A drop-shadow or glow effect around any widget. From 2f48607e7c01622f0f0699efa749412b1897de5a Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 17 Sep 2019 16:41:49 +0200 Subject: [PATCH 28/56] efl_ui_layout_part_*: declare stable Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9995 --- src/lib/elementary/efl_ui_layout_part.eo | 2 +- src/lib/elementary/efl_ui_layout_part_bg.eo | 2 +- src/lib/elementary/efl_ui_layout_part_box.eo | 2 +- src/lib/elementary/efl_ui_layout_part_content.eo | 2 +- src/lib/elementary/efl_ui_layout_part_table.eo | 2 +- src/lib/elementary/efl_ui_layout_part_text.eo | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout_part.eo b/src/lib/elementary/efl_ui_layout_part.eo index 0ce9829c59..f015ca22ed 100644 --- a/src/lib/elementary/efl_ui_layout_part.eo +++ b/src/lib/elementary/efl_ui_layout_part.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Layout_Part extends Efl.Ui.Widget_Part +class Efl.Ui.Layout_Part extends Efl.Ui.Widget_Part { [[Elementary layout internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_layout_part_bg.eo b/src/lib/elementary/efl_ui_layout_part_bg.eo index f1404d2c10..dff060f9bd 100644 --- a/src/lib/elementary/efl_ui_layout_part_bg.eo +++ b/src/lib/elementary/efl_ui_layout_part_bg.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Layout_Part_Bg extends Efl.Ui.Widget_Part_Bg +class Efl.Ui.Layout_Part_Bg extends Efl.Ui.Widget_Part_Bg { [[Elementary layout internal part background class]] data: null; diff --git a/src/lib/elementary/efl_ui_layout_part_box.eo b/src/lib/elementary/efl_ui_layout_part_box.eo index 6ebbc2c2b6..7f7f815bac 100644 --- a/src/lib/elementary/efl_ui_layout_part_box.eo +++ b/src/lib/elementary/efl_ui_layout_part_box.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Layout_Part_Box extends Efl.Object implements Efl.Pack_Linear, +class Efl.Ui.Layout_Part_Box extends Efl.Object implements Efl.Pack_Linear, Efl.Ui.Layout_Orientable_Readonly { [[Represents a Box created as part of a layout. diff --git a/src/lib/elementary/efl_ui_layout_part_content.eo b/src/lib/elementary/efl_ui_layout_part_content.eo index 923033dd4e..c09d075d40 100644 --- a/src/lib/elementary/efl_ui_layout_part_content.eo +++ b/src/lib/elementary/efl_ui_layout_part_content.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Layout_Part_Content extends Efl.Ui.Layout_Part implements Efl.Content +class Efl.Ui.Layout_Part_Content extends Efl.Ui.Layout_Part implements Efl.Content { [[Elementary layout internal part class]] data: null; diff --git a/src/lib/elementary/efl_ui_layout_part_table.eo b/src/lib/elementary/efl_ui_layout_part_table.eo index 6730927065..6fe94f21b8 100644 --- a/src/lib/elementary/efl_ui_layout_part_table.eo +++ b/src/lib/elementary/efl_ui_layout_part_table.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Layout_Part_Table extends Efl.Object implements Efl.Pack_Table +class Efl.Ui.Layout_Part_Table extends Efl.Object implements Efl.Pack_Table { [[Represents a Table created as part of a layout. diff --git a/src/lib/elementary/efl_ui_layout_part_text.eo b/src/lib/elementary/efl_ui_layout_part_text.eo index a7442a7f45..0a092a251f 100644 --- a/src/lib/elementary/efl_ui_layout_part_text.eo +++ b/src/lib/elementary/efl_ui_layout_part_text.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Layout_Part_Text extends Efl.Ui.Layout_Part implements Efl.Text, Efl.Text_Markup, +class Efl.Ui.Layout_Part_Text extends Efl.Ui.Layout_Part implements Efl.Text, Efl.Text_Markup, Efl.Ui.L10n { [[Elementary layout internal part class]] From bf12fe241ec04c81129faf9ccfa7438fa9a23062 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 18 Sep 2019 14:59:44 +0200 Subject: [PATCH 29/56] efl_ui_layout_part_table: implement missing API setting of these properties does not work, as they are not available in legacy, but edje is still creating legacy objects. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10007 --- src/lib/elementary/efl_ui_layout_pack.c | 18 ++++++++++++++++++ src/lib/elementary/efl_ui_layout_part_table.eo | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout_pack.c b/src/lib/elementary/efl_ui_layout_pack.c index 02ad407981..0e2743db01 100644 --- a/src/lib/elementary/efl_ui_layout_pack.c +++ b/src/lib/elementary/efl_ui_layout_pack.c @@ -447,5 +447,23 @@ _efl_ui_layout_part_table_efl_pack_table_table_rows_get(const Eo *obj EINA_UNUSE return rows; } +EOLIAN static void +_efl_ui_layout_part_table_efl_pack_table_table_rows_set(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd EINA_UNUSED, int rows EINA_UNUSED) +{ + ERR("This API is currently not supported on table parts"); +} + +EOLIAN static void +_efl_ui_layout_part_table_efl_pack_table_table_columns_set(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd EINA_UNUSED, int cols EINA_UNUSED) +{ + ERR("This API is currently not supported on table parts"); +} + +EOLIAN static void +_efl_ui_layout_part_table_efl_pack_table_table_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd EINA_UNUSED, int cols EINA_UNUSED, int rows EINA_UNUSED) +{ + ERR("This API is currently not supported on table parts"); +} + #include "efl_ui_layout_part_box.eo.c" #include "efl_ui_layout_part_table.eo.c" diff --git a/src/lib/elementary/efl_ui_layout_part_table.eo b/src/lib/elementary/efl_ui_layout_part_table.eo index 6fe94f21b8..cecd1fc2f3 100644 --- a/src/lib/elementary/efl_ui_layout_part_table.eo +++ b/src/lib/elementary/efl_ui_layout_part_table.eo @@ -21,8 +21,8 @@ class Efl.Ui.Layout_Part_Table extends Efl.Object implements Efl.Pack_Table Efl.Pack_Table.table_contents_get; Efl.Pack_Table.table_cell_column { get; set; } Efl.Pack_Table.table_cell_row { get; set; } - Efl.Pack_Table.table_size { get; } - Efl.Pack_Table.table_columns { get; } - Efl.Pack_Table.table_rows { get; } + Efl.Pack_Table.table_size { get; set; } + Efl.Pack_Table.table_columns { get; set; } + Efl.Pack_Table.table_rows { get; set; } } } From 9382bfc0bc1c6a5fb3aafce18094016b110036c0 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Sat, 14 Sep 2019 10:54:05 -0700 Subject: [PATCH 30/56] eina: add eina_mempool_iterator_new to slowly iterate every allocated pointer in a mempool. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9941 --- src/lib/eina/eina_inline_mempool.x | 13 +++ src/lib/eina/eina_mempool.c | 1 + src/lib/eina/eina_mempool.h | 11 +++ .../mp/chained_pool/eina_chained_mempool.c | 94 +++++++++++++++++-- src/modules/eina/mp/one_big/eina_one_big.c | 82 +++++++++++++++- .../eina/mp/pass_through/eina_pass_through.c | 3 +- src/tests/eina/eina_test_mempool.c | 18 +++- 7 files changed, 209 insertions(+), 13 deletions(-) diff --git a/src/lib/eina/eina_inline_mempool.x b/src/lib/eina/eina_inline_mempool.x index d30364f097..0805c82f07 100644 --- a/src/lib/eina/eina_inline_mempool.x +++ b/src/lib/eina/eina_inline_mempool.x @@ -56,6 +56,11 @@ struct _Eina_Mempool_Backend * @see eina_mempool_from */ Eina_Bool (*from)(void *data, void *element); + /** Function to get an Eina_Iterator that will walk every allocated element + * in the pool. + * @use eina_mempool_iterator_new + */ + Eina_Iterator *(*iterator)(void *data); }; struct _Eina_Mempool_Backend_ABI1 @@ -74,6 +79,7 @@ struct _Eina_Mempool_Backend_ABI2 { void (*repack)(void *data, Eina_Mempool_Repack_Cb cb, void *cb_data); Eina_Bool (*from)(void *data, void *element); + Eina_Iterator *(*iterator)(void *data); }; struct _Eina_Mempool @@ -116,6 +122,13 @@ eina_mempool_from(Eina_Mempool *mp, void *element) return mp->backend2->from(mp->backend_data, element); } +static inline Eina_Iterator * +eina_mempool_iterator_new(Eina_Mempool *mp) +{ + if (!mp->backend2->iterator) return NULL; + return mp->backend2->iterator(mp->backend_data); +} + static inline unsigned int eina_mempool_alignof(unsigned int size) { diff --git a/src/lib/eina/eina_mempool.c b/src/lib/eina/eina_mempool.c index 56144a0f1c..51a29906f2 100644 --- a/src/lib/eina/eina_mempool.c +++ b/src/lib/eina/eina_mempool.c @@ -104,6 +104,7 @@ _new_va(const char *name, if (!mp->backend2) goto on_error; mp->backend2->repack = be->repack; mp->backend2->from = be->from; + mp->backend2->iterator = be->iterator; } mp->backend_data = mp->backend.init(context, options, args); diff --git a/src/lib/eina/eina_mempool.h b/src/lib/eina/eina_mempool.h index 606ecbaef9..d7759ce6c8 100644 --- a/src/lib/eina/eina_mempool.h +++ b/src/lib/eina/eina_mempool.h @@ -197,6 +197,17 @@ static inline Eina_Bool eina_mempool_from(Eina_Mempool *mp, void *element); */ EAPI void eina_mempool_statistics(Eina_Mempool *mp) EINA_ARG_NONNULL(1); +/** + * @brief Provide an iterator to walk all allocated elements from a specified mempool. + * + * @param[in] mp The mempool + * @return @c NULL if it is not possible to iterate over the mempool, a valid iterator otherwise. + * + * @note This call is expected to be slow and should not be used in any performance critical area. + * @since 1.23 + */ +static inline Eina_Iterator *eina_mempool_iterator_new(Eina_Mempool *mp); + /** * @brief Registers the given memory pool backend. * diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c index d44f0bf6cb..6d4facf74d 100644 --- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c +++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c @@ -79,7 +79,7 @@ struct _Chained_Pool EINA_INLIST; EINA_RBTREE; Eina_Trash *base; - int usage; + unsigned int usage; unsigned char *last; unsigned char *limit; @@ -91,11 +91,11 @@ struct _Chained_Mempool Eina_Inlist *first; Eina_Rbtree *root; const char *name; - int item_alloc; - int pool_size; - int alloc_size; - int group_size; - int usage; + unsigned int item_alloc; + unsigned int pool_size; + unsigned int alloc_size; + unsigned int group_size; + unsigned int usage; Chained_Pool* first_fill; //All allocation will happen in this chain,unless it is filled #ifdef EINA_DEBUG_MALLOC int minimal_size; @@ -453,6 +453,85 @@ eina_chained_mempool_from(void *data, void *ptr) return ret; } +typedef struct _Eina_Iterator_Chained_Mempool Eina_Iterator_Chained_Mempool; +struct _Eina_Iterator_Chained_Mempool +{ + Eina_Iterator iterator; + + Eina_Iterator *walker; + Chained_Pool *current; + Chained_Mempool *pool; + + unsigned int offset; +}; + +static Eina_Bool +eina_mempool_iterator_next(Eina_Iterator_Chained_Mempool *it, void **data) +{ + if (!it->current) + { + if (!eina_iterator_next(it->walker, (void**) &it->current)) + return EINA_FALSE; + if (!it->current) return EINA_FALSE; + } + + retry: + if (it->offset < it->pool->group_size) + { + unsigned char *ptr = (unsigned char *) (it->current + 1); + + ptr += it->offset; + it->offset += it->pool->item_alloc; + + if (!eina_chained_mempool_from(it->pool, ptr)) goto retry; + + if (data) *data = (void *) ptr; + return EINA_TRUE; + } + + if (!eina_iterator_next(it->walker, (void**) &it->current)) + return EINA_FALSE; + + it->offset = 0; + goto retry; +} + +static Chained_Mempool * +eina_mempool_iterator_get_container(Eina_Iterator_Chained_Mempool *it) +{ + return it->pool; +} + +static void +eina_mempool_iterator_free(Eina_Iterator_Chained_Mempool *it) +{ + eina_iterator_free(it->walker); + free(it); +} + +static Eina_Iterator * +eina_chained_mempool_iterator_new(void *data) +{ + Eina_Iterator_Chained_Mempool *it; + Chained_Mempool *pool = data; + + it = calloc(1, sizeof (Eina_Iterator_Chained_Mempool)); + if (!it) return NULL; + + it->walker = eina_inlist_iterator_new(pool->first); + it->pool = pool; + + it->iterator.version = EINA_ITERATOR_VERSION; + it->iterator.next = FUNC_ITERATOR_NEXT(eina_mempool_iterator_next); + it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER( + eina_mempool_iterator_get_container); + it->iterator.free = FUNC_ITERATOR_FREE(eina_mempool_iterator_free); + + EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); + + return &it->iterator; +} + static void eina_chained_mempool_repack(void *data, Eina_Mempool_Repack_Cb cb, @@ -645,7 +724,8 @@ static Eina_Mempool_Backend _eina_chained_mp_backend = { NULL, &eina_chained_mempool_shutdown, &eina_chained_mempool_repack, - &eina_chained_mempool_from + &eina_chained_mempool_from, + &eina_chained_mempool_iterator_new }; Eina_Bool chained_init(void) diff --git a/src/modules/eina/mp/one_big/eina_one_big.c b/src/modules/eina/mp/one_big/eina_one_big.c index 39fd511cf1..b909dfbc51 100644 --- a/src/modules/eina/mp/one_big/eina_one_big.c +++ b/src/modules/eina/mp/one_big/eina_one_big.c @@ -63,14 +63,14 @@ struct _One_Big { const char *name; - int item_size; + unsigned int item_size; int offset_to_item_inlist; int usage; int over; - int served; - int max; + unsigned int served; + unsigned int max; unsigned char *base; Eina_Trash *empty; @@ -263,6 +263,79 @@ eina_one_big_from(void *data, void *ptr) return r; } +typedef struct _Eina_Iterator_One_Big_Mempool Eina_Iterator_One_Big_Mempool; +struct _Eina_Iterator_One_Big_Mempool +{ + Eina_Iterator iterator; + + Eina_Iterator *walker; + One_Big *pool; + + unsigned int offset; +}; + +static Eina_Bool +eina_mempool_iterator_next(Eina_Iterator_One_Big_Mempool *it, void **data) +{ + Eina_Inlist *il = NULL; + + retry: + if (it->offset < (it->pool->max * it->pool->item_size)) + { + unsigned char *ptr = (unsigned char *) (it->pool->base); + + ptr += it->offset; + it->offset += it->pool->item_size; + + if (!eina_one_big_from(it->pool, ptr)) goto retry; + + if (data) *data = (void *) ptr; + return EINA_TRUE; + } + + if (!eina_iterator_next(it->walker, (void **) &il)) + return EINA_FALSE; + + if (data) *data = OVER_MEM_FROM_LIST(it->pool, il); + return EINA_TRUE; +} + +static One_Big * +eina_mempool_iterator_get_container(Eina_Iterator_One_Big_Mempool *it) +{ + return it->pool; +} + +static void +eina_mempool_iterator_free(Eina_Iterator_One_Big_Mempool *it) +{ + eina_iterator_free(it->walker); + free(it); +} + +static Eina_Iterator * +eina_one_big_iterator_new(void *data) +{ + Eina_Iterator_One_Big_Mempool *it; + One_Big *pool = data; + + it = calloc(1, sizeof (Eina_Iterator_One_Big_Mempool)); + if (!it) return NULL; + + it->walker = eina_inlist_iterator_new(pool->over_list); + it->pool = pool; + + it->iterator.version = EINA_ITERATOR_VERSION; + it->iterator.next = FUNC_ITERATOR_NEXT(eina_mempool_iterator_next); + it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER( + eina_mempool_iterator_get_container); + it->iterator.free = FUNC_ITERATOR_FREE(eina_mempool_iterator_free); + + EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); + + return &it->iterator; +} + static void * eina_one_big_realloc(EINA_UNUSED void *data, EINA_UNUSED void *element, @@ -378,7 +451,8 @@ static Eina_Mempool_Backend _eina_one_big_mp_backend = { NULL, &eina_one_big_shutdown, NULL, - &eina_one_big_from + &eina_one_big_from, + &eina_one_big_iterator_new }; Eina_Bool one_big_init(void) diff --git a/src/modules/eina/mp/pass_through/eina_pass_through.c b/src/modules/eina/mp/pass_through/eina_pass_through.c index 0e546f7987..2d2bc3834a 100644 --- a/src/modules/eina/mp/pass_through/eina_pass_through.c +++ b/src/modules/eina/mp/pass_through/eina_pass_through.c @@ -76,7 +76,8 @@ static Eina_Mempool_Backend _eina_pass_through_mp_backend = { NULL, &eina_pass_through_shutdown, NULL, - &eina_pass_through_from + &eina_pass_through_from, + NULL }; Eina_Bool pass_through_init(void) diff --git a/src/tests/eina/eina_test_mempool.c b/src/tests/eina/eina_test_mempool.c index 78656cea53..c36bab1717 100644 --- a/src/tests/eina/eina_test_mempool.c +++ b/src/tests/eina/eina_test_mempool.c @@ -28,10 +28,12 @@ static void _eina_mempool_test(Eina_Mempool *mp, Eina_Bool with_realloc, Eina_Bool with_gc, Eina_Bool accurate_from) { + Eina_Iterator *it; int *tbl[512]; + int *ptr; int i; - fail_if(!mp); + fail_if(!mp); for (i = 0; i < 512; ++i) { @@ -52,6 +54,20 @@ _eina_mempool_test(Eina_Mempool *mp, fail_if(eina_mempool_from(mp, tbl[i]) != EINA_FALSE); } + it = eina_mempool_iterator_new(mp); + EINA_ITERATOR_FOREACH(it, ptr) + { + ck_assert_int_gt(*ptr, 255); + *ptr = 0; + } + eina_iterator_free(it); + + if (it) // Only check if the mempool support iterator + { + for (; i < 512; ++i) + ck_assert_int_eq(*tbl[i], 0); + } + if (with_realloc) fail_if(eina_mempool_realloc(mp, tbl[500], 25) == NULL); else From 2fdad9294876f475225618e9f50d558a62c6bcf3 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Sat, 14 Sep 2019 19:12:44 -0700 Subject: [PATCH 31/56] eina: add code to help debug leaking Eina_Value. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9942 --- src/lib/eina/eina_value.c | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c index 3df0baa329..63f45b9bbe 100644 --- a/src/lib/eina/eina_value.c +++ b/src/lib/eina/eina_value.c @@ -5279,6 +5279,9 @@ typedef struct _Eina_Value_Inner_Mp Eina_Value_Inner_Mp; struct _Eina_Value_Inner_Mp { Eina_Mempool *mempool; +#ifdef DEBUG + int size; +#endif int references; }; @@ -5310,6 +5313,9 @@ _eina_value_inner_mp_get(int size) return NULL; imp->references = 0; +#ifdef DEBUG + imp->size = size; +#endif imp->mempool = eina_mempool_add(_eina_value_mp_choice, "Eina_Value_Inner_Mp", NULL, size, 16); @@ -5517,7 +5523,42 @@ eina_value_init(void) Eina_Bool eina_value_shutdown(void) { +#ifdef DEBUG + Eina_Iterator *it; + Eina_Value_Inner_Mp *imp; +#endif + eina_lock_take(&_eina_value_inner_mps_lock); + +#ifdef DEBUG + it = eina_hash_iterator_data_new(_eina_value_inner_mps); + EINA_ITERATOR_FOREACH(it, imp) + { + Eina_Iterator *mit; + Eina_Value *value; + + fprintf(stderr, "There is still %i Eina_Value in pool of size %i\n", + imp->references, imp->size); + mit = eina_mempool_iterator_new(imp->mempool); + EINA_ITERATOR_FOREACH(mit, value) + { + if (value->type) + { + char *str = eina_value_to_string(value); + fprintf(stderr, "Value %p of type '%s' containing '%s' still allocated.\n", + value, value->type->name, str); + free(str); + } + else + { + fprintf(stderr, "Unknown type found for value %p\n", value); + } + } + eina_iterator_free(mit); + } + eina_iterator_free(it); +#endif + if (eina_hash_population(_eina_value_inner_mps) != 0) ERR("Cannot free eina_value internal memory pools -- still in use!"); else From 6af8a70f37d4ddbf8629e0b6d747518620bca3f7 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Tue, 17 Sep 2019 18:42:51 -0700 Subject: [PATCH 32/56] ecore: properly initialize the event structure in Efl.Generic_Model. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10028 --- src/lib/ecore/efl_generic_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore/efl_generic_model.c b/src/lib/ecore/efl_generic_model.c index 99b6f480ec..c478e918d2 100644 --- a/src/lib/ecore/efl_generic_model.c +++ b/src/lib/ecore/efl_generic_model.c @@ -144,7 +144,7 @@ _efl_generic_model_efl_model_children_count_get(const Eo *obj EINA_UNUSED, Efl_G static Eo * _efl_generic_model_efl_model_child_add(Eo *obj, Efl_Generic_Model_Data *sd) { - Efl_Model_Children_Event cevt; + Efl_Model_Children_Event cevt = { 0 }; Efl_Model *child; child = efl_add(EFL_GENERIC_MODEL_CLASS, obj); From f402efbba31515095ac41551483e51b6e283b094 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Tue, 17 Sep 2019 19:03:48 -0700 Subject: [PATCH 33/56] ecore: properly initialize all field in event generated by Efl.Generic_Model Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10029 --- src/lib/ecore/efl_generic_model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore/efl_generic_model.c b/src/lib/ecore/efl_generic_model.c index c478e918d2..dc33428d99 100644 --- a/src/lib/ecore/efl_generic_model.c +++ b/src/lib/ecore/efl_generic_model.c @@ -175,7 +175,7 @@ _efl_generic_model_efl_model_child_del(Eo *obj, Efl_Generic_Model_Data *sd, Eo * { if (data == child) { - Efl_Model_Children_Event cevt; + Efl_Model_Children_Event cevt = { 0 }; sd->childrens = eina_list_remove_list(sd->childrens, l); From 77ab3523cdafe3e128d1fa911e93ede14fac96b6 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Wed, 18 Sep 2019 10:33:23 -0700 Subject: [PATCH 34/56] ecore: remove unused piece of code. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10030 --- src/lib/ecore/efl_model_accessor_view.c | 133 ------------------ .../ecore/efl_model_accessor_view_private.h | 5 - src/lib/ecore/meson.build | 2 - 3 files changed, 140 deletions(-) delete mode 100644 src/lib/ecore/efl_model_accessor_view.c delete mode 100644 src/lib/ecore/efl_model_accessor_view_private.h diff --git a/src/lib/ecore/efl_model_accessor_view.c b/src/lib/ecore/efl_model_accessor_view.c deleted file mode 100644 index a73e9459a5..0000000000 --- a/src/lib/ecore/efl_model_accessor_view.c +++ /dev/null @@ -1,133 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "Eina.h" -#include "Eo.h" - -#include "efl_model_accessor_view_private.h" - -typedef struct _Efl_Model_Accessor -{ - Eina_Accessor vtable; - Eina_Accessor *real_accessor; - void *pdata; - Efl_Model_Accessor_View_Constructor_Cb cb; - Eina_Array *children; -} Efl_Model_Accessor; - -static void -_efl_model_accessor_setup(Efl_Model_Accessor *acc, - Eina_Accessor* real_accessor, - Efl_Model_Accessor_View_Constructor_Cb ctor, - void* pdata); - -static Eina_Bool -_efl_model_acessor_get_at(Efl_Model_Accessor *acc, unsigned int idx, void **data) -{ - void* eo; - Eo *p; - Eo *child; - - if(eina_accessor_data_get(acc->real_accessor, idx, &eo)) - { - p = eo; - child = acc->cb(acc->pdata, p); - if(!acc->children) - { - acc->children = eina_array_new(32); - } - eina_array_push(acc->children, child); - *data = child; - return !!*data; - } - else - return EINA_FALSE; -} - -static void * -_efl_model_acessor_get_container(Efl_Model_Accessor *acc) -{ - return eina_accessor_container_get(acc->real_accessor); -} - -static void -_efl_model_acessor_free(Efl_Model_Accessor *acc) -{ - if (acc->real_accessor) - { - eina_accessor_free(acc->real_accessor); - acc->real_accessor = NULL; - } - - if(acc->children) - { - unsigned i; - Eina_Array_Iterator iterator; - Eo* item; - - EINA_ARRAY_ITER_NEXT(acc->children, i, item, iterator) - { - efl_unref(item); - } - eina_array_free(acc->children); - acc->children = NULL; - } - - free(acc); -} - -static Eina_Bool -_efl_model_acessor_lock(Efl_Model_Accessor *acc) -{ - return eina_accessor_lock(acc->real_accessor); -} - -static Eina_Bool -_efl_model_acessor_unlock(Efl_Model_Accessor *acc) -{ - return eina_accessor_unlock(acc->real_accessor); -} - -static Efl_Model_Accessor * -_efl_model_acessor_clone(Efl_Model_Accessor *acc EINA_UNUSED) -{ - Efl_Model_Accessor* accessor = calloc(1, sizeof(Efl_Model_Accessor)); - _efl_model_accessor_setup(accessor, eina_accessor_clone(acc->real_accessor), - acc->cb, acc->pdata); - return accessor; -} - -static void -_efl_model_accessor_setup(Efl_Model_Accessor *acc, - Eina_Accessor* real_accessor, - Efl_Model_Accessor_View_Constructor_Cb ctor, - void* pdata) -{ - acc->vtable.version = EINA_ACCESSOR_VERSION; - acc->vtable.get_at = FUNC_ACCESSOR_GET_AT(_efl_model_acessor_get_at); - acc->vtable.get_container = FUNC_ACCESSOR_GET_CONTAINER(_efl_model_acessor_get_container); - acc->vtable.free = FUNC_ACCESSOR_FREE(_efl_model_acessor_free); - - acc->vtable.lock = FUNC_ACCESSOR_LOCK(_efl_model_acessor_lock); - acc->vtable.unlock = FUNC_ACCESSOR_LOCK(_efl_model_acessor_unlock); - - acc->vtable.clone = FUNC_ACCESSOR_CLONE(_efl_model_acessor_clone); - - EINA_MAGIC_SET(&acc->vtable, EINA_MAGIC_ACCESSOR); - - acc->real_accessor = real_accessor; - acc->cb = ctor; - acc->pdata = pdata; -} - -Eina_Accessor* efl_model_accessor_view_new(Eina_Accessor* accessor, - Efl_Model_Accessor_View_Constructor_Cb ctor, - void* data) -{ - Efl_Model_Accessor* acc = calloc(1, sizeof(Efl_Model_Accessor)); - _efl_model_accessor_setup(acc, accessor, ctor, data); - return &acc->vtable; -} - - diff --git a/src/lib/ecore/efl_model_accessor_view_private.h b/src/lib/ecore/efl_model_accessor_view_private.h deleted file mode 100644 index c44f2ec3cb..0000000000 --- a/src/lib/ecore/efl_model_accessor_view_private.h +++ /dev/null @@ -1,5 +0,0 @@ - -typedef Eo*(*Efl_Model_Accessor_View_Constructor_Cb)(void* data, Eo* child); - -Eina_Accessor* efl_model_accessor_view_new(Eina_Accessor* accessor, - Efl_Model_Accessor_View_Constructor_Cb constructor, void* data); diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build index eb8be6c33f..5e777ae750 100644 --- a/src/lib/ecore/meson.build +++ b/src/lib/ecore/meson.build @@ -139,8 +139,6 @@ ecore_src = [ 'efl_container_model.c', 'efl_composite_model.c', 'efl_boolean_model.c', - 'efl_model_accessor_view.c', - 'efl_model_accessor_view_private.h', 'efl_filter_model.c', 'efl_linear_interpolator.c', 'efl_accelerate_interpolator.c', From 8128e3fea2af21b41ff420fc0fc2cd2045b72684 Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Wed, 18 Sep 2019 19:30:17 -0700 Subject: [PATCH 35/56] efl: improve Efl.Boolean_Model test to enforce Eina_Value type too. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10031 --- src/tests/efl/efl_test_composite_model.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/efl/efl_test_composite_model.c b/src/tests/efl/efl_test_composite_model.c index d20bc1c017..5a7d3f21ab 100644 --- a/src/tests/efl/efl_test_composite_model.c +++ b/src/tests/efl/efl_test_composite_model.c @@ -43,7 +43,7 @@ _children_slice_get_then(void *data EINA_UNUSED, Eina_Value *p_int = NULL; Eina_Value *p_true = NULL; Eina_Value *p_false = NULL; - int v_int = 0; + int v_int = -1; Eina_Bool v_true = EINA_FALSE; Eina_Bool v_false = EINA_TRUE; @@ -51,9 +51,9 @@ _children_slice_get_then(void *data EINA_UNUSED, p_true = efl_model_property_get(child, "test_p_true"); p_false = efl_model_property_get(child, "test_p_false"); - eina_value_get(p_int, &v_int); - eina_value_get(p_true, &v_true); - eina_value_get(p_false, &v_false); + eina_value_int_get(p_int, &v_int); + eina_value_bool_get(p_true, &v_true); + eina_value_bool_get(p_false, &v_false); fail_if(v_int != base_ints[i]); fail_if(v_true != EINA_TRUE); From fc935e99d936a3b1fd4a81232e493094bf5e5989 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sun, 15 Sep 2019 11:54:51 +0200 Subject: [PATCH 36/56] efl_ui_position_manager: a way to announce new entities there are situations where the entity is not ready yet when the initial placing does happen. With this API you can tell the position manager that the placing of the items can be reapplied at the entities are availble now. Differential Revision: https://phab.enlightenment.org/D9947 --- .../efl_ui_position_manager_entity.eo | 10 +++++ .../elementary/efl_ui_position_manager_grid.c | 43 +++++++++++++++++++ .../efl_ui_position_manager_grid.eo | 1 + .../elementary/efl_ui_position_manager_list.c | 30 +++++++++++++ .../efl_ui_position_manager_list.eo | 1 + 5 files changed, 85 insertions(+) diff --git a/src/lib/elementary/efl_ui_position_manager_entity.eo b/src/lib/elementary/efl_ui_position_manager_entity.eo index d61c7c62d1..865d8f3180 100644 --- a/src/lib/elementary/efl_ui_position_manager_entity.eo +++ b/src/lib/elementary/efl_ui_position_manager_entity.eo @@ -91,6 +91,16 @@ interface @beta Efl.Ui.Position_Manager.Entity extends Efl.Ui.Layout_Orientable end_id : int; [[The last item that has a new size]] } } + entities_ready { + [[The items from $start_id to $end_id now have their entities ready + + The position manager will reapply the geometry to the elements if they are visible. + ]] + params { + start_id : uint; [[The first item that is available]] + end_id : uint; [[The last item that is available]] + } + } relative_item { [[Translates the $current_id, into a new id which is oriented in the $direction of $current_id. In case that there is no item, -1 is returned]] diff --git a/src/lib/elementary/efl_ui_position_manager_grid.c b/src/lib/elementary/efl_ui_position_manager_grid.c index fee0855ec6..206bc73221 100644 --- a/src/lib/elementary/efl_ui_position_manager_grid.c +++ b/src/lib/elementary/efl_ui_position_manager_grid.c @@ -19,6 +19,7 @@ typedef struct { Eina_Vector2 scroll_position; Efl_Ui_Layout_Orientation dir; Vis_Segment prev_run; + unsigned int prev_consumed_space; Eina_Size2D max_min_size; Eina_Size2D last_viewport_size; Eina_Size2D prev_min_size; @@ -491,6 +492,7 @@ _reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd) { ev.start_id = pd->prev_run.start_id = cur.start_id; ev.end_id = pd->prev_run.end_id = cur.end_id; + pd->prev_consumed_space = consumed_space; efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_VISIBLE_RANGE_CHANGED, &ev); } } @@ -809,5 +811,46 @@ _efl_ui_position_manager_grid_efl_object_finalize(Eo *obj, Efl_Ui_Position_Manag return obj; } +EOLIAN static void +_efl_ui_position_manager_grid_efl_ui_position_manager_entity_entities_ready(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, unsigned int start_id, unsigned int end_id) +{ + Eina_Size2D space_size; + int relevant_space_size; + Item_Position_Context ctx; + + if (end_id < pd->prev_run.start_id || start_id > pd->prev_run.end_id) + return; + + space_size.w = (MAX(pd->last_viewport_size.w - pd->viewport.w, 0))*pd->scroll_position.x; + space_size.h = (MAX(pd->last_viewport_size.h - pd->viewport.h, 0))*pd->scroll_position.y; + + if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL) + { + relevant_space_size = space_size.h; + } + else + { + relevant_space_size = space_size.w; + } + + ctx.new = pd->prev_run; + ctx.consumed_space = pd->prev_consumed_space; + ctx.relevant_space_size = relevant_space_size; + ctx.floating_group = NULL; + ctx.placed_item = NULL; + + if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL) + { + _position_items_vertical(obj, pd, &ctx); + _position_group_items(obj, pd, &ctx); + } + else + { + _position_items_horizontal(obj, pd, &ctx); + _position_group_items(obj, pd, &ctx); + } +} + + #include "efl_ui_position_manager_grid.eo.c" diff --git a/src/lib/elementary/efl_ui_position_manager_grid.eo b/src/lib/elementary/efl_ui_position_manager_grid.eo index 91deee348e..35ebeb5fc1 100644 --- a/src/lib/elementary/efl_ui_position_manager_grid.eo +++ b/src/lib/elementary/efl_ui_position_manager_grid.eo @@ -15,6 +15,7 @@ class @beta Efl.Ui.Position_Manager.Grid extends Efl.Object Efl.Ui.Position_Manager.Entity.position_single_item; Efl.Ui.Position_Manager.Entity.item_size_changed; Efl.Ui.Position_Manager.Entity.relative_item; + Efl.Ui.Position_Manager.Entity.entities_ready; Efl.Ui.Layout_Orientable.orientation {set; get;} Efl.Ui.Position_Manager.Data_Access_V1.data_access {set;} Efl.Object.finalize; diff --git a/src/lib/elementary/efl_ui_position_manager_list.c b/src/lib/elementary/efl_ui_position_manager_list.c index 706fce768b..d4bedb819c 100644 --- a/src/lib/elementary/efl_ui_position_manager_list.c +++ b/src/lib/elementary/efl_ui_position_manager_list.c @@ -546,4 +546,34 @@ _efl_ui_position_manager_list_efl_ui_position_manager_data_access_v1_data_access } +EOLIAN static void +_efl_ui_position_manager_list_efl_ui_position_manager_entity_entities_ready(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, unsigned int start_id, unsigned int end_id) +{ + Eina_Size2D space_size; + int relevant_space_size; + + if (end_id < pd->prev_run.start_id || start_id > pd->prev_run.end_id) + return; + + if (!pd->size) return; + if (pd->average_item_size <= 0) return; + + cache_require(obj, pd); + + //space size contains the amount of space that is outside the viewport (either to the top or to the left) + space_size.w = (MAX(pd->abs_size.w - pd->viewport.w, 0))*pd->scroll_position.x; + space_size.h = (MAX(pd->abs_size.h - pd->viewport.h, 0))*pd->scroll_position.y; + + if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL) + { + relevant_space_size = space_size.h; + } + else + { + relevant_space_size = space_size.w; + } + _position_items(obj, pd, pd->prev_run, relevant_space_size); +} + + #include "efl_ui_position_manager_list.eo.c" diff --git a/src/lib/elementary/efl_ui_position_manager_list.eo b/src/lib/elementary/efl_ui_position_manager_list.eo index 3d80b201d4..ade5a1f3cf 100644 --- a/src/lib/elementary/efl_ui_position_manager_list.eo +++ b/src/lib/elementary/efl_ui_position_manager_list.eo @@ -17,6 +17,7 @@ class @beta Efl.Ui.Position_Manager.List extends Efl.Object Efl.Ui.Position_Manager.Entity.position_single_item; Efl.Ui.Position_Manager.Entity.item_size_changed; Efl.Ui.Position_Manager.Entity.relative_item; + Efl.Ui.Position_Manager.Entity.entities_ready; Efl.Ui.Layout_Orientable.orientation {set; get;} Efl.Ui.Position_Manager.Data_Access_V1.data_access {set;} } From cc49c8ac64a358e8aa0bf8897abc6a5e4cf2c692 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 23 Aug 2019 12:48:16 -0700 Subject: [PATCH 37/56] elementary: leverage sizing information from model if available to avoid unecessary calc. With the new Efl unified infrastructure, we do delay a lot of the computation to finalize, by filling the object information before finalize we reduce unecessary computation. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9948 --- src/lib/elementary/efl_ui_widget_factory.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_widget_factory.c b/src/lib/elementary/efl_ui_widget_factory.c index c9d5759744..c65bda5847 100644 --- a/src/lib/elementary/efl_ui_widget_factory.c +++ b/src/lib/elementary/efl_ui_widget_factory.c @@ -72,12 +72,29 @@ static void _efl_ui_widget_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui_Widget_Factory_Data *pd EINA_UNUSED, Efl_Gfx_Entity *ui_view) { const Efl_Model *model; - Eina_Value *property; + Eina_Value *property, *width, *height; char *style; if (!pd->style) return ; model = efl_ui_view_model_get(ui_view); + + // Fetch min size from model if available to avoid recalculcating it + width = efl_model_property_get(model, "self.width"); + height = efl_model_property_get(model, "self.height"); + if (eina_value_type_get(width) != EINA_VALUE_TYPE_ERROR && + eina_value_type_get(height) != EINA_VALUE_TYPE_ERROR) + { + Eina_Size2D s; + + if (!eina_value_int_convert(width, &s.w)) s.w = 0; + if (!eina_value_int_convert(height, &s.h)) s.h = 0; + + efl_gfx_hint_size_min_set(ui_view, s); + } + eina_value_free(width); + eina_value_free(height); + // As we have already waited for the property to be ready, we should get the right style now property = efl_model_property_get(model, pd->style); if (!property) return ; From 3e9f619b1d3fa3c66641292c11992e5730307b13 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 23 Aug 2019 14:29:55 -0700 Subject: [PATCH 38/56] elementary: Efl.Ui.Widget_Factory bind widget property before finalizing the widget. In the same vain as previous patch this will initialize more of the widget during its creation and reduce unecessary recalc. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9949 --- src/lib/elementary/efl_ui_widget_factory.c | 46 +++++++++++----------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget_factory.c b/src/lib/elementary/efl_ui_widget_factory.c index c65bda5847..4b1523dd01 100644 --- a/src/lib/elementary/efl_ui_widget_factory.c +++ b/src/lib/elementary/efl_ui_widget_factory.c @@ -69,16 +69,30 @@ _efl_ui_widget_factory_item_class_get(const Eo *obj EINA_UNUSED, } static void -_efl_ui_widget_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui_Widget_Factory_Data *pd EINA_UNUSED, Efl_Gfx_Entity *ui_view) +_efl_ui_widget_factory_efl_ui_factory_building(const Eo *factory EINA_UNUSED, Efl_Ui_Widget_Factory_Data *pd, Efl_Gfx_Entity *ui_view) { const Efl_Model *model; Eina_Value *property, *width, *height; + Efl_Ui_Bind_Part_Data *bpd; + Eina_Iterator *it; char *style; - if (!pd->style) return ; - model = efl_ui_view_model_get(ui_view); + // Bind all property before the object is finalize + it = eina_hash_iterator_data_new(pd->parts); + EINA_ITERATOR_FOREACH(it, bpd) + { + Efl_Ui_Property_Bind_Data *bppd; + Eina_List *l; + + EINA_LIST_FOREACH(bpd->properties, l, bppd) + efl_ui_property_bind(efl_part(ui_view, bpd->part), + bppd->part_property, + bppd->model_property); + } + eina_iterator_free(it); + // Fetch min size from model if available to avoid recalculcating it width = efl_model_property_get(model, "self.width"); height = efl_model_property_get(model, "self.height"); @@ -96,6 +110,8 @@ _efl_ui_widget_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui eina_value_free(height); // As we have already waited for the property to be ready, we should get the right style now + if (!pd->style) return ; + property = efl_model_property_get(model, pd->style); if (!property) return ; @@ -109,31 +125,13 @@ _efl_ui_widget_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui static Efl_Ui_Widget * _efl_ui_widget_create(const Efl_Ui_Factory *factory, const Efl_Class *klass, Eo *parent, - Efl_Model *model, - const Eina_Hash *parts) + Efl_Model *model) { - Efl_Ui_Bind_Part_Data *bpd; - Eina_Iterator *it; Efl_Ui_Widget *w; w = efl_add(klass, parent, efl_ui_view_model_set(efl_added, model), efl_ui_factory_building(factory, efl_added)); - if (!parts) return w; - - it = eina_hash_iterator_data_new(parts); - EINA_ITERATOR_FOREACH(it, bpd) - { - Efl_Ui_Property_Bind_Data *bppd; - Eina_List *l; - - EINA_LIST_FOREACH(bpd->properties, l, bppd) - efl_ui_property_bind(efl_part(w, bpd->part), - bppd->part_property, - bppd->model_property); - } - eina_iterator_free(it); - return w; } @@ -143,7 +141,7 @@ _efl_ui_widget_factory_create_then(Eo *model, void *data, const Eina_Value v EIN Efl_Ui_Widget_Factory_Request *r = data; Efl_Ui_Widget *w; - w = _efl_ui_widget_create(r->factory, r->pd->klass, r->parent, model, r->pd->parts); + w = _efl_ui_widget_create(r->factory, r->pd->klass, r->parent, model); if (!w) return eina_value_error_init(ENOMEM); return eina_value_object_init(w); } @@ -185,7 +183,7 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data EINA_ITERATOR_FOREACH(models, model) { - w = _efl_ui_widget_create(obj, pd->klass, parent, model, pd->parts); + w = _efl_ui_widget_create(obj, pd->klass, parent, model); if (!w) return efl_loop_future_rejected(obj, ENOMEM); eina_value_array_append(&r, w); From 1eb24301fd517952e7e2c31a19c523bd4bf2e06e Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 18 Sep 2019 11:32:08 +0200 Subject: [PATCH 39/56] efl_io_model: next try to fix this race condition what is happening is that a file gets announced through eio_model listing code, at this point of time, the monitor does not yet know about the file. If the file now gets deleted between the annoncing and the learning of the file from the monitor, then the file got an ADD event, but no DEL event. Which is a bug. With this commit there is a new API which asks the monitor if the file already has the knowledge about the files existance, or not. A few monitors like win32 inotify or cocoa do not have context about the file directly, if the OS is now having the same bug, then we are again in trouble, however, we canot do anything about that. In the case of kevent or poll, this asks the context of the monitor if the file is already there. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10006 --- src/lib/eio/Eio_Legacy.h | 18 ++++++++++++++++++ src/lib/eio/efl_io_model.c | 7 +++++++ src/lib/eio/eio_monitor.c | 14 ++++++++++++++ src/lib/eio/eio_monitor_cocoa.c | 4 ++++ src/lib/eio/eio_monitor_inotify.c | 5 +++++ src/lib/eio/eio_monitor_kevent.c | 19 ++++++++++++++++++- src/lib/eio/eio_monitor_poll.c | 15 +++++++++++++++ src/lib/eio/eio_monitor_win32.c | 5 +++++ src/lib/eio/eio_private.h | 2 ++ 9 files changed, 88 insertions(+), 1 deletion(-) diff --git a/src/lib/eio/Eio_Legacy.h b/src/lib/eio/Eio_Legacy.h index 50140edd4e..c44340cac0 100644 --- a/src/lib/eio/Eio_Legacy.h +++ b/src/lib/eio/Eio_Legacy.h @@ -1257,6 +1257,24 @@ EAPI const char *eio_monitor_path_get(Eio_Monitor *monitor); * @beta */ EAPI Eina_Bool eio_monitor_fallback_check(const Eio_Monitor *monitor); + +/** + * @brief Check if a monitor has the context about a file or not + * @param monitor The Eio_Monitor to check + * @param path The path to check + * @return EINA_TRUE if there is context, EINA_FALSE otherwise. + * + * There are Monitors that need context about a file before they can monitor the file correctly. + * As an example: If you publish a file in your API before the monitor has this file in his context, + * and the file gets deleted as a reaction to this, the monitor will not be able to emit the correct DELETE + * event even if the file is in the monitors path. + * + * In case the monitor does not yet have context, you can be sure that the monitor will bring up an FILE_ADD event about that file. + * + * @since 1.23 + * @beta + */ +EAPI Eina_Bool eio_monitor_has_context(const Eio_Monitor *monitor, const char *path); #endif /** * @} diff --git a/src/lib/eio/efl_io_model.c b/src/lib/eio/efl_io_model.c index e6b6149288..88c32b19b8 100644 --- a/src/lib/eio/efl_io_model.c +++ b/src/lib/eio/efl_io_model.c @@ -762,6 +762,12 @@ _efl_io_model_efl_model_property_set(Eo *obj, return efl_loop_future_rejected(obj, err); } +static Eina_Bool +_monitor_has_context(Efl_Io_Model_Data *pd, const char *path) +{ + return eio_monitor_has_context(pd->monitor, path); +} + static void _efl_io_model_children_list(void *data, Eina_Array *entries) { @@ -779,6 +785,7 @@ _efl_io_model_children_list(void *data, Eina_Array *entries) { Efl_Io_Model_Info *mi; + if (!_monitor_has_context(pd, info->path)) continue; if (_already_added(pd, info->path)) continue; if (pd->filter.cb) diff --git a/src/lib/eio/eio_monitor.c b/src/lib/eio/eio_monitor.c index bc1ed07db0..64eab219b2 100644 --- a/src/lib/eio/eio_monitor.c +++ b/src/lib/eio/eio_monitor.c @@ -411,3 +411,17 @@ eio_monitor_path_get(Eio_Monitor *monitor) EINA_SAFETY_ON_NULL_RETURN_VAL(monitor, NULL); return monitor->path; } + + +EAPI Eina_Bool +eio_monitor_has_context(const Eio_Monitor *monitor, const char *path) +{ + if (monitor->fallback) + { + return eio_monitor_fallback_context_check(monitor, path); + } + else + { + return eio_monitor_context_check(monitor, path); + } +} diff --git a/src/lib/eio/eio_monitor_cocoa.c b/src/lib/eio/eio_monitor_cocoa.c index d491de4194..be354964a0 100644 --- a/src/lib/eio/eio_monitor_cocoa.c +++ b/src/lib/eio/eio_monitor_cocoa.c @@ -403,6 +403,10 @@ void eio_monitor_backend_del(Eio_Monitor *monitor) eina_hash_del(_fsevent_monitors, monitor->path, backend); } +Eina_Bool eio_monitor_context_check(const Eio_Monitor *monitor, const char *path) +{ + return EINA_TRUE; +} /*============================================================================* * API * diff --git a/src/lib/eio/eio_monitor_inotify.c b/src/lib/eio/eio_monitor_inotify.c index f3a83be5b7..e266877134 100644 --- a/src/lib/eio/eio_monitor_inotify.c +++ b/src/lib/eio/eio_monitor_inotify.c @@ -290,6 +290,11 @@ void eio_monitor_backend_del(Eio_Monitor *monitor) eina_hash_del(_inotify_monitors, &backend->hwnd, backend); } +Eina_Bool eio_monitor_context_check(const Eio_Monitor *monitor EINA_UNUSED, const char *path EINA_UNUSED) +{ + return EINA_TRUE; +} + /*============================================================================* * API * diff --git a/src/lib/eio/eio_monitor_kevent.c b/src/lib/eio/eio_monitor_kevent.c index 7a54f1d52b..b0ab7f7882 100644 --- a/src/lib/eio/eio_monitor_kevent.c +++ b/src/lib/eio/eio_monitor_kevent.c @@ -299,13 +299,30 @@ error: void eio_monitor_backend_del(Eio_Monitor *monitor) { Eio_Monitor_Backend *backend; - + backend = monitor->backend; monitor->backend = NULL; eina_hash_del(_kevent_monitors, &backend->fd, backend); } +Eina_Bool eio_monitor_context_check(const Eio_Monitor *monitor, const char *path) +{ + Eio_Monitor_Backend *backend = monitor->backend; + Eina_List *l; + Eio_File_Info *file; + + EINA_LIST_FOREACH(backend->prev_list, l, file) + { + if (eina_streq(file->path, path)) + { + return EINA_TRUE; + } + } + return EINA_FALSE; +} + + /*============================================================================* * API * diff --git a/src/lib/eio/eio_monitor_poll.c b/src/lib/eio/eio_monitor_poll.c index 2a35b6f07a..aae582f825 100644 --- a/src/lib/eio/eio_monitor_poll.c +++ b/src/lib/eio/eio_monitor_poll.c @@ -315,6 +315,12 @@ void eio_monitor_backend_del(Eio_Monitor *monitor) { eio_monitor_fallback_del(monitor); } + +Eina_Bool eio_monitor_content_check(const Eio_Monitor *monitor, const char *path) +{ + return eio_monitor_fallback_content_check(monitor, path); +} + #endif void @@ -330,6 +336,15 @@ eio_monitor_fallback_shutdown(void) timer_hash = NULL; } +Eina_Bool +eio_monitor_fallback_context_check(const Eio_Monitor *monitor, const char *path) +{ + Eio_Monitor_Backend *backend; + EINA_SAFETY_ON_FALSE_RETURN_VAL(monitor->fallback, EINA_TRUE); + backend = monitor->backend; + return !!eina_hash_find(backend->children, path); +} + void eio_monitor_fallback_add(Eio_Monitor *monitor) { diff --git a/src/lib/eio/eio_monitor_win32.c b/src/lib/eio/eio_monitor_win32.c index a2c45de75c..04d853455d 100644 --- a/src/lib/eio/eio_monitor_win32.c +++ b/src/lib/eio/eio_monitor_win32.c @@ -423,6 +423,11 @@ void eio_monitor_backend_del(Eio_Monitor *monitor) monitor->backend = NULL; } +Eina_Bool eio_monitor_context_check(const Eio_Monitor *monitor, const char *path) +{ + return EINA_TRUE; +} + /** * @endcond diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h index aa75336124..e8f9c856a4 100644 --- a/src/lib/eio/eio_private.h +++ b/src/lib/eio/eio_private.h @@ -486,7 +486,9 @@ void eio_monitor_shutdown(void); void eio_monitor_backend_shutdown(void); void eio_monitor_fallback_shutdown(void); void eio_monitor_backend_add(Eio_Monitor *monitor); +Eina_Bool eio_monitor_context_check(const Eio_Monitor *monitor, const char *path); void eio_monitor_fallback_add(Eio_Monitor *monitor); +Eina_Bool eio_monitor_fallback_context_check(const Eio_Monitor *monitor, const char *path); void eio_monitor_backend_del(Eio_Monitor *monitor); void eio_monitor_fallback_del(Eio_Monitor *monitor); From bc162b1253b3dc16fb6c8989b96d26fd120384c0 Mon Sep 17 00:00:00 2001 From: WooHyun Jung Date: Fri, 20 Sep 2019 11:09:02 +0900 Subject: [PATCH 40/56] efl_ui_scroll_util: add null check after calloc --- src/lib/elementary/efl_ui_scroll_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_scroll_util.c b/src/lib/elementary/efl_ui_scroll_util.c index abf77110d6..b375c7488f 100644 --- a/src/lib/elementary/efl_ui_scroll_util.c +++ b/src/lib/elementary/efl_ui_scroll_util.c @@ -249,6 +249,7 @@ void efl_ui_scroll_connector_bind(Eo *obj, Eo *manager) { Scroll_Connector_Context *ctx = calloc(1, sizeof(Scroll_Connector_Context)); + if (!ctx) return; ctx->obj = obj; ctx->smanager = manager; efl_key_data_set(obj, "__context", ctx); From 11d98de24b4959e2328bfa763760d7cf39048252 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 20 Sep 2019 09:35:36 +0200 Subject: [PATCH 41/56] build: switch build type to release for now This should have been done with the first alpha, but there was a bug preventing this. With commit 6960751c4580af9e902cd7719c1acafab4ce7bc5 the problem is fixed and we can finally enable it. --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ebea18e0bc..1991324039 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('efl', ['c','cpp'], version: '1.23.0', - default_options : ['buildtype=plain', 'cpp_std=c++11'], + default_options : ['buildtype=release', 'cpp_std=c++11'], meson_version : '>=0.47' ) From 47ab7e1b83932c559849899901c7b51f21172020 Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Fri, 20 Sep 2019 12:42:50 +0200 Subject: [PATCH 42/56] efl.ui.scrollbar: fix event name for scrollbar Summary: Event name is applied in the past tense. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10040 --- src/lib/efl/interfaces/efl_ui_scrollbar.eo | 6 +++--- src/lib/elementary/efl_ui_image_zoomable.c | 12 ++++++------ src/lib/elementary/efl_ui_list_view.c | 12 ++++++------ src/lib/elementary/efl_ui_scroll_util.c | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/lib/efl/interfaces/efl_ui_scrollbar.eo b/src/lib/efl/interfaces/efl_ui_scrollbar.eo index 6aa71c3d03..f5bffe984f 100644 --- a/src/lib/efl/interfaces/efl_ui_scrollbar.eo +++ b/src/lib/efl/interfaces/efl_ui_scrollbar.eo @@ -58,9 +58,9 @@ interface @beta Efl.Ui.Scrollbar } } events { - bar,press: Efl.Ui.Layout_Orientation; [[Called when bar is pressed.]] - bar,unpress: Efl.Ui.Layout_Orientation; [[Called when bar is unpressed.]] - bar,drag: Efl.Ui.Layout_Orientation; [[Called when bar is dragged.]] + bar,pressed: Efl.Ui.Layout_Orientation; [[Called when bar is pressed.]] + bar,unpressed: Efl.Ui.Layout_Orientation; [[Called when bar is unpressed.]] + bar,dragged: Efl.Ui.Layout_Orientation; [[Called when bar is dragged.]] bar,size,changed: void; [[Called when bar size is changed.]] bar,pos,changed: void; [[Called when bar position is changed.]] bar,show: Efl.Ui.Layout_Orientation; [[Callend when bar is shown.]] diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 8bd4a1cc45..fc2eb60879 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -1394,7 +1394,7 @@ _efl_ui_image_zoomable_vbar_drag_cb(void *data, _efl_ui_image_zoomable_bar_read_and_update(data); Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAGGED, &type); } static void @@ -1404,7 +1404,7 @@ _efl_ui_image_zoomable_vbar_press_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESSED, &type); } static void @@ -1414,7 +1414,7 @@ _efl_ui_image_zoomable_vbar_unpress_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESSED, &type); } static void @@ -1464,7 +1464,7 @@ _efl_ui_image_zoomable_hbar_drag_cb(void *data, _efl_ui_image_zoomable_bar_read_and_update(data); Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAGGED, &type); } static void @@ -1474,7 +1474,7 @@ _efl_ui_image_zoomable_hbar_press_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESSED, &type); } static void @@ -1484,7 +1484,7 @@ _efl_ui_image_zoomable_hbar_unpress_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESSED, &type); } static void diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c index 341396c58f..e74e15c792 100644 --- a/src/lib/elementary/efl_ui_list_view.c +++ b/src/lib/elementary/efl_ui_list_view.c @@ -289,7 +289,7 @@ _efl_ui_list_view_vbar_drag_cb(void *data, _efl_ui_list_view_bar_read_and_update(data); Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAGGED, &type); } static void @@ -299,7 +299,7 @@ _efl_ui_list_view_vbar_press_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESSED, &type); } static void @@ -309,7 +309,7 @@ _efl_ui_list_view_vbar_unpress_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESSED, &type); } static void @@ -359,7 +359,7 @@ _efl_ui_list_view_hbar_drag_cb(void *data, _efl_ui_list_view_bar_read_and_update(data); Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAGGED, &type); } static void @@ -369,7 +369,7 @@ _efl_ui_list_view_hbar_press_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESSED, &type); } static void @@ -379,7 +379,7 @@ _efl_ui_list_view_hbar_unpress_cb(void *data, const char *source EINA_UNUSED) { Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type); + efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESSED, &type); } static void diff --git a/src/lib/elementary/efl_ui_scroll_util.c b/src/lib/elementary/efl_ui_scroll_util.c index b375c7488f..cf23773536 100644 --- a/src/lib/elementary/efl_ui_scroll_util.c +++ b/src/lib/elementary/efl_ui_scroll_util.c @@ -111,7 +111,7 @@ _scroll_connector_vbar_drag_cb(void *data, _scroll_connector_bar_read_and_update(ctx); type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type); + efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_DRAGGED, &type); } static void @@ -123,7 +123,7 @@ _scroll_connector_vbar_press_cb(void *data, Scroll_Connector_Context *ctx = data; Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type); + efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_PRESSED, &type); } static void @@ -135,7 +135,7 @@ _scroll_connector_vbar_unpress_cb(void *data, Scroll_Connector_Context *ctx = data; Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type); + efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESSED, &type); } static void @@ -148,7 +148,7 @@ _scroll_connector_hbar_drag_cb(void *data, Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; _scroll_connector_bar_read_and_update(ctx); - efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type); + efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_DRAGGED, &type); } static void @@ -160,7 +160,7 @@ _scroll_connector_hbar_press_cb(void *data, Scroll_Connector_Context *ctx = data; Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type); + efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_PRESSED, &type); } static void @@ -172,7 +172,7 @@ _scroll_connector_hbar_unpress_cb(void *data, Scroll_Connector_Context *ctx = data; Efl_Ui_Layout_Orientation type = EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL; - efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type); + efl_event_callback_call(ctx->obj, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESSED, &type); } static void From 4672598b032d27c1b63e4c6271de12f21f41e380 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 20 Sep 2019 15:16:25 +0200 Subject: [PATCH 43/56] efl_ui_factory: improve docs Summary: and remove TAAABS Depends on D10038 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10042 --- src/lib/efl/interfaces/efl_ui_factory.eo | 13 +++++++++---- src/lib/efl/interfaces/efl_ui_view_factory.eo | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo b/src/lib/efl/interfaces/efl_ui_factory.eo index 3a531af533..eded76f197 100644 --- a/src/lib/efl/interfaces/efl_ui_factory.eo +++ b/src/lib/efl/interfaces/efl_ui_factory.eo @@ -6,7 +6,12 @@ struct @beta Efl.Ui.Factory_Item_Created_Event { interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind { - [[Efl UI factory interface]] + [[Interface for factory-pattern object creation. + + This object represents a Factory in the factory pattern. Objects should be created via the method + @Efl.Ui.View_Factory.create_with_event, which will in turn call the necessary APIs from this interface. + Objects created this way should be removed using @.release. + ]] methods { create @protected { [[Create a UI object from the necessary properties in the specified model. @@ -16,14 +21,14 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind params { models: iterator; [[Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.]] - parent: Efl.Gfx.Entity; [[Efl canvas]] + parent: Efl.Gfx.Entity; [[Efl canvas.]] } - return: future; [[Created UI object]] + return: future; [[Created UI object.]] } release { [[Release a UI object and disconnect from models.]] params { - ui_view: Efl.Gfx.Entity; [[Efl canvas]] + ui_view: Efl.Gfx.Entity; [[Object to remove.]] } } building @const { diff --git a/src/lib/efl/interfaces/efl_ui_view_factory.eo b/src/lib/efl/interfaces/efl_ui_view_factory.eo index 94db98b53a..bb1e4a44c3 100644 --- a/src/lib/efl/interfaces/efl_ui_view_factory.eo +++ b/src/lib/efl/interfaces/efl_ui_view_factory.eo @@ -8,13 +8,13 @@ class @beta Efl.Ui.View_Factory the factory when the object is done building. This function must be use by all @Efl.Ui.View that need to create object. They should not use @Efl.Ui.Factory.create directly.]] params { - factory: Efl.Ui.Factory; [[The factory to use for requesting the new object from and generating the created + factory: Efl.Ui.Factory; [[The factory to use for requesting the new object from and generating the created event onto.]] - models: iterator; [[Efl iterator providing the model to be associated to the new item. It should + models: iterator; [[Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.]] - parent: Efl.Gfx.Entity; [[Efl canvas]] + parent: Efl.Gfx.Entity; [[Efl canvas]] } - return: future; [[Created UI object]] + return: future; [[Created UI object]] } } } From 32f92d3d869f889d729314574bf4e3b5c14a3e29 Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Fri, 20 Sep 2019 16:05:01 +0200 Subject: [PATCH 44/56] csharp: Add support for default param references in documentation Summary: This also adds the information of default values in `parameter_def`. This will help adding actual default parameter support in the C# bindings. Thanks to @segfaultxavi for improved formatting and escaping. Fixes T8224 Reviewers: segfaultxavi, felipealmeida, brunobelo Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, segfaultxavi, #committers Tags: #efl Maniphest Tasks: T8224 Differential Revision: https://phab.enlightenment.org/D10050 --- .../eolian_mono/eolian/mono/documentation.hh | 17 ++- .../eolian_mono/eolian/mono/name_helpers.hh | 24 ++++ src/lib/eolian_cxx/grammar/klass_def.hpp | 105 ++++++++++++++---- 3 files changed, 122 insertions(+), 24 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh index 201ee168a9..2b4ed87a8d 100644 --- a/src/bin/eolian_mono/eolian/mono/documentation.hh +++ b/src/bin/eolian_mono/eolian/mono/documentation.hh @@ -540,7 +540,22 @@ struct documentation_generator template bool generate_parameter(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const { - return generate_tag_param(sink, name_helpers::escape_keyword(param.param_name), param.documentation.full_text, context); + auto text = param.documentation.full_text; + if (param.default_value.is_engaged()) + { + auto value = param.default_value->serialized; + + if (param.default_value->is_name_ref) + { + value = name_helpers::full_managed_name(value); + text += "\\
The default value is \\."; + } + else + { + text += "\\
The default value is \\" + value + "\\."; + } + } + return generate_tag_param(sink, name_helpers::escape_keyword(param.param_name), text, context); } template diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index a1fd8cd6d0..b2063116e0 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -204,6 +204,30 @@ inline std::string managed_name(std::string const& name, char separator='_') return utils::to_pascal_case(tokens); } +inline std::string full_managed_name(std::string const& name) +{ + std::stringstream ss; + + auto words = utils::split(name, '.'); + std::transform(words.begin(), words.end(), words.begin(), [](std::string const& word) { + return managed_name(word); + }); + + auto b = std::begin(words), e = std::end(words); + + if (b != e) + { + std::copy(b, std::prev(e), std::ostream_iterator(ss, ".")); + b = std::prev(e); + } + + // Avoid trailing separator + if (b != e) + ss << *b; + + return ss.str(); +} + inline std::string alias_full_eolian_name(attributes::alias_def const& alias) { diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index a3f3f3d7df..b1f6c383a3 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -412,6 +412,9 @@ struct type_def << rhs.c_type << " has_own " << rhs.has_own << " is_ptr " << rhs.is_ptr << "]"; } + +private: + void set(const char* regular_name, const char* c_type); }; struct get_qualifier_visitor @@ -516,17 +519,39 @@ inline void type_def::set(Eolian_Expression_Type eolian_exp_type) switch(eolian_exp_type) { case EOLIAN_EXPR_INT: - original_type = attributes::regular_type_def{"int", {{}, {}}, {}}; - c_type = "int"; + set("int", "int"); + break; + case EOLIAN_EXPR_UINT: + set("uint", "unsigned int"); + break; + case EOLIAN_EXPR_FLOAT: + set("float", "float"); + break; + case EOLIAN_EXPR_DOUBLE: + set("double", "double"); + break; + case EOLIAN_EXPR_STRING: + set("string", "const char *"); + case EOLIAN_EXPR_BOOL: + set("bool", "Eina_Bool"); + break; + case EOLIAN_EXPR_NULL: + set("null", "void *"); break; default: // FIXME implement the remaining types - EINA_LOG_ERR("Unsupported expression type"); + EINA_LOG_ERR("Unsupported expression type : %d", eolian_exp_type); std::abort(); break; } } +inline void type_def::set(const char* regular_name, const char* c_type) +{ + original_type = attributes::regular_type_def{regular_name, {{}, {}}, {}}; + this->c_type = c_type; +} + struct alias_def { std::string eolian_name; @@ -585,12 +610,57 @@ struct add_optional_qualifier_visitor }; } +struct value_def +{ + typedef eina::variant variant_type; // FIXME support other types + variant_type value; + std::string literal; + type_def type; + + value_def() = default; + value_def(Eolian_Value value_obj) + { + type.set(value_obj.type); + value = value_obj.value.i; + literal = eolian_expression_value_to_literal(&value_obj); + } +}; + + +struct expression_def +{ + value_def value; + std::string serialized; + // We store this explicitly as evaluating the value reduces a name reference + // to a plain string value. + bool is_name_ref; + + friend inline bool operator==(expression_def const& lhs, expression_def const& rhs) + { + return lhs.serialized == rhs.serialized; + } + friend inline bool operator!=(expression_def const& lhs, expression_def const& rhs) + { + return lhs != rhs; + } + + expression_def(Eolian_Expression const* expression) : value(::eolian_expression_eval(expression, EOLIAN_MASK_ALL)) + , serialized() + , is_name_ref(::eolian_expression_type_get(expression) == EOLIAN_EXPR_NAME) + { + auto serialized_s = ::eolian_expression_serialize(expression); + serialized = serialized_s; + ::eina_stringshare_del(serialized_s); + } +}; + struct parameter_def { parameter_direction direction; type_def type; std::string param_name; documentation_def documentation; + eina::optional default_value; Eolian_Unit const* unit; friend inline bool operator==(parameter_def const& lhs, parameter_def const& rhs) @@ -598,7 +668,8 @@ struct parameter_def return lhs.direction == rhs.direction && lhs.type == rhs.type && lhs.param_name == rhs.param_name - && lhs.documentation == rhs.documentation; + && lhs.documentation == rhs.documentation + && lhs.default_value == rhs.default_value; } friend inline bool operator!=(parameter_def const& lhs, parameter_def const& rhs) { @@ -608,13 +679,17 @@ struct parameter_def parameter_def(parameter_direction direction, type_def type, std::string param_name, documentation_def documentation, Eolian_Unit const* unit) : direction(std::move(direction)), type(std::move(type)), param_name(std::move(param_name)), documentation(documentation), unit(unit) {} - parameter_def(Eolian_Function_Parameter const* param, Eolian_Unit const* unit) + parameter_def(Eolian_Function_Parameter const* param, Eolian_Unit const* _unit) : type( ::eolian_parameter_type_get(param) - , unit + , _unit , eolian_parameter_c_type_get(param, EINA_FALSE) , eolian_parameter_is_move(param) , eolian_parameter_is_by_ref(param)) - , param_name( ::eolian_parameter_name_get(param)), unit(unit) + , param_name( ::eolian_parameter_name_get(param)) + , default_value(::eolian_parameter_default_value_get(param) ? + ::eolian_parameter_default_value_get(param) : + eina::optional{}) + , unit(_unit) { Eolian_Parameter_Dir direction = ::eolian_parameter_direction_get(param); switch(direction) @@ -1530,22 +1605,6 @@ struct klass_def } }; -struct value_def -{ - typedef eina::variant variant_type; // FIXME support other types - variant_type value; - std::string literal; - type_def type; - - value_def() = default; - value_def(Eolian_Value value_obj) - { - type.set(value_obj.type); - value = value_obj.value.i; - literal = eolian_expression_value_to_literal(&value_obj); - } -}; - struct enum_value_def { value_def value; From 61ce4c79fd004948f922e928b84765b6f26657a9 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Fri, 20 Sep 2019 11:38:18 -0300 Subject: [PATCH 45/56] Use proper Eolian syntax for default values instead of docs Summary: Eolian supports reporting the defaults for parameters and return values, but in some places we have been writing this information in the documentation instead. This patch moves it to its proper place, where documentation generators can pick it up and render it in a consistent manner. Ref T8171 Reviewers: zmike, bu5hm4n, lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8171 Differential Revision: https://phab.enlightenment.org/D10051 --- src/lib/ecore/efl_task.eo | 6 +-- src/lib/efl/interfaces/efl_gfx_arrangement.eo | 14 +++---- src/lib/efl/interfaces/efl_gfx_entity.eo | 5 +-- src/lib/efl/interfaces/efl_gfx_image.eo | 41 ++++++++----------- .../efl_ui_scrollable_interactive.eo | 23 +++++------ src/lib/efl/interfaces/efl_ui_zoom.eo | 2 +- src/lib/elementary/efl_ui_animation_view.eo | 22 ++++------ .../efl_ui_spotlight_manager_scroll.eo | 8 ++-- src/lib/elementary/efl_ui_text.eo | 3 +- src/lib/evas/canvas/efl_canvas_object.eo | 11 ++--- 10 files changed, 58 insertions(+), 77 deletions(-) diff --git a/src/lib/ecore/efl_task.eo b/src/lib/ecore/efl_task.eo index caef983b3b..056ccbf632 100644 --- a/src/lib/ecore/efl_task.eo +++ b/src/lib/ecore/efl_task.eo @@ -43,13 +43,11 @@ abstract Efl.Task extends Efl.Loop_Consumer } } @property flags { - [[Flags to further customize task's behavior. The default value: - exit_with_parent - ]] + [[Flags to further customize task's behavior.]] set { } get { } values { - flags: Efl.Task_Flags; [[Desired task flags.]] + flags: Efl.Task_Flags(Efl.Task_Flags.exit_with_parent); [[Desired task flags.]] } } run @pure_virtual { diff --git a/src/lib/efl/interfaces/efl_gfx_arrangement.eo b/src/lib/efl/interfaces/efl_gfx_arrangement.eo index 7bfe70ea82..02cda25495 100644 --- a/src/lib/efl/interfaces/efl_gfx_arrangement.eo +++ b/src/lib/efl/interfaces/efl_gfx_arrangement.eo @@ -22,10 +22,10 @@ interface @beta Efl.Gfx.Arrangement set {} get {} values { - align_horiz: double; [[Double, ranging from 0.0 to 1.0, where 0.0 is at the start of the horizontal axis - and 1.0 is at the end. The default value is 0.5.]] - align_vert: double; [[Double, ranging from 0.0 to 1.0, where 0.0 is at the start of the vertical axis - and 1.0 is at the end. The default value is 0.5.]] + align_horiz: double(0.5); [[Double, ranging from 0.0 to 1.0, where 0.0 is at the start of the horizontal + axis and 1.0 is at the end.]] + align_vert: double(0.5); [[Double, ranging from 0.0 to 1.0, where 0.0 is at the start of the vertical + axis and 1.0 is at the end.]] } } @property content_padding { @@ -40,9 +40,9 @@ interface @beta Efl.Gfx.Arrangement set {} get {} values { - pad_horiz: double; [[Horizontal padding. The default value is 0.0.]] - pad_vert: double; [[Vertical padding. The default value is 0.0.]] - scalable: bool; [[$true if scalable, $false otherwise. The default value is $false.]] + pad_horiz: double(0.0); [[Horizontal padding.]] + pad_vert: double(0.0); [[Vertical padding.]] + scalable: bool(false); [[$true if scalable.]] } } } diff --git a/src/lib/efl/interfaces/efl_gfx_entity.eo b/src/lib/efl/interfaces/efl_gfx_entity.eo index 115fb2a782..b33504cca2 100644 --- a/src/lib/efl/interfaces/efl_gfx_entity.eo +++ b/src/lib/efl/interfaces/efl_gfx_entity.eo @@ -83,7 +83,7 @@ interface Efl.Gfx.Entity { This property is an individual scaling factor on the object (Edje or UI widget). This property (or Edje's global scaling factor, when applicable), will affect this object's part sizes. If scale is - not zero, than the individual scaling will override any global + not zero, then the individual scaling will override any global scaling set, for the object obj's parts. Set it back to zero to get the effects of the global scaling again. @@ -98,8 +98,7 @@ interface Efl.Gfx.Entity { [[Gets an object's scaling factor.]] } values { - scale: double(0.0); [[The scaling factor (the default value is 0.0, - meaning individual scaling is not set)]] + scale: double(0.0); [[The scaling factor.]] } } } diff --git a/src/lib/efl/interfaces/efl_gfx_image.eo b/src/lib/efl/interfaces/efl_gfx_image.eo index 3f9ee77a98..4e8c5c4c1d 100644 --- a/src/lib/efl/interfaces/efl_gfx_image.eo +++ b/src/lib/efl/interfaces/efl_gfx_image.eo @@ -79,7 +79,7 @@ interface @beta Efl.Gfx.Image set {} get {} values { - smooth_scale: bool; [[Whether to use smooth scale or not. The default value is $true.]] + smooth_scale: bool(true); [[Whether to use smooth scale or not.]] } } @property scale_method { @@ -89,8 +89,7 @@ interface @beta Efl.Gfx.Image buffer. The underlying image data will not be modified. ]] values { - scale_method: Efl.Gfx.Image_Scale_Method; [[Image scale type to use. The default value is - @Efl.Gfx.Image_Scale_Method.none.]] + scale_method: Efl.Gfx.Image_Scale_Method(Efl.Gfx.Image_Scale_Method.none); [[Image scale type to use.]] } } @property can_upscale { @@ -98,7 +97,7 @@ interface @beta Efl.Gfx.Image the image will never be resized larger than its native size. ]] values { - upscale: bool; [[Whether to allow image upscaling. The default value is $true.]] + upscale: bool(true); [[Whether to allow image upscaling.]] } } @property can_downscale { @@ -106,7 +105,7 @@ interface @beta Efl.Gfx.Image the image will never be resized smaller than its native size. ]] values { - downscale: bool; [[Whether to allow image downscaling. The default value is $true.]] + downscale: bool(true); [[Whether to allow image downscaling.]] } } @property ratio { @@ -116,7 +115,7 @@ interface @beta Efl.Gfx.Image get { } values { - ratio: double; [[The image's ratio. The default value is $[1.0].]] + ratio: double(1.0); [[The image's ratio.]] } } @property content_region { @@ -161,10 +160,10 @@ interface @beta Efl.Gfx.Image set {} get {} values { - l: int; [[The border's left width. The default value is $0.]] - r: int; [[The border's right width. The default value is $0.]] - t: int; [[The border's top height. The default value is $0.]] - b: int; [[The border's bottom height. The default value is $0.]] + l: int(0); [[The border's left width.]] + r: int(0); [[The border's right width.]] + t: int(0); [[The border's top height.]] + b: int(0); [[The border's bottom height.]] } } @property border_insets_scale { @@ -176,7 +175,7 @@ interface @beta Efl.Gfx.Image set {} get {} values { - scale: double; [[The scale factor. The default value is $[1.0].]] + scale: double(1.0); [[The scale factor.]] } } @property center_fill_mode { @@ -193,8 +192,8 @@ interface @beta Efl.Gfx.Image set {} get {} values { - fill: Efl.Gfx.Center_Fill_Mode; [[Fill mode of the center region. - The default value is @Efl.Gfx.Center_Fill_Mode.default, i.e. render + fill: Efl.Gfx.Center_Fill_Mode(Efl.Gfx.Center_Fill_Mode.default); [[Fill mode of the center region. + The default behavior is to render and scale the center area, respecting its transparency.]] } } @@ -214,12 +213,10 @@ interface @beta Efl.Gfx.Image } get {} values { - horizontal: iterator; [[Representation of areas that are stretchable in - the image horizontal space. The default value - is $NULL.]] - vertical: iterator; [[Representation of areas that are stretchable in - the image vertical space. The default value - is $NULL.]] + horizontal: iterator(null); [[Representation of areas that are + stretchable in the image horizontal space.]] + vertical: iterator(null); [[Representation of areas that are + stretchable in the image vertical space.]] } } @property image_size { @@ -251,8 +248,7 @@ interface @beta Efl.Gfx.Image get { } values { - hint: Efl.Gfx.Image_Content_Hint; [[Dynamic or static content hint. The default value is - @Efl.Gfx.Image_Content_Hint.none.]] + hint: Efl.Gfx.Image_Content_Hint(Efl.Gfx.Image_Content_Hint.none); [[Dynamic or static content hint.]] } } @property scale_hint { @@ -266,8 +262,7 @@ interface @beta Efl.Gfx.Image get { } values { - hint: Efl.Gfx.Image_Scale_Hint; [[Scalable or static size hint. The default value is - @Efl.Gfx.Image_Scale_Hint.none.]] + hint: Efl.Gfx.Image_Scale_Hint(Efl.Gfx.Image_Scale_Hint.none); [[Scalable or static size hint.]] } } @property image_load_error { diff --git a/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo b/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo index 259dc10ecd..f931632382 100644 --- a/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo +++ b/src/lib/efl/interfaces/efl_ui_scrollable_interactive.eo @@ -86,11 +86,12 @@ interface @beta Efl.Ui.Scrollable_Interactive extends Efl.Ui.Scrollable } } @property movement_block { - [[Blocking of scrolling (per axis) + [[Blocking of scrolling (per axis). This function will block scrolling movement (by input of a user) in a given direction. You can disable movements in the X axis, the Y - axis or both. The default value is $none, where movements are + axis or both. + The default value is @Efl.Ui.Layout_Orientation.default meaning that movements are allowed in both directions. ]] set { @@ -107,21 +108,19 @@ interface @beta Efl.Ui.Scrollable_Interactive extends Efl.Ui.Scrollable The gravity defines how the scroller will adjust its view when the size of the scroller contents increases. - The scroller will adjust the view to glue itself as follows. - - x=0.0, for staying where it is relative to the left edge of the content - x=1.0, for staying where it is relative to the right edge of the content - y=0.0, for staying where it is relative to the top edge of the content - y=1.0, for staying where it is relative to the bottom edge of the content - - Default values for x and y are 0.0]] + The scroller will adjust the view to glue itself as follows: + $[x=0.0] to stay where it is relative to the left edge of the content. + $[x=1.0] to stay where it is relative to the right edge of the content. + $[y=0.0] to stay where it is relative to the top edge of the content. + $[y=1.0] to stay where it is relative to the bottom edge of the content. + ]] set { } get { } values { - x: double; [[Horizontal scrolling gravity]] - y: double; [[Vertical scrolling gravity]] + x: double(0.0); [[Horizontal scrolling gravity.]] + y: double(0.0); [[Vertical scrolling gravity.]] } } @property match_content { diff --git a/src/lib/efl/interfaces/efl_ui_zoom.eo b/src/lib/efl/interfaces/efl_ui_zoom.eo index 390b9372af..ab8d1007b8 100644 --- a/src/lib/efl/interfaces/efl_ui_zoom.eo +++ b/src/lib/efl/interfaces/efl_ui_zoom.eo @@ -67,7 +67,7 @@ interface @beta Efl.Ui.Zoom get { } values { - mode: Efl.Ui.Zoom_Mode; [[The zoom mode.]] + mode: Efl.Ui.Zoom_Mode(Efl.Ui.Zoom_Mode.manual); [[The zoom mode.]] } } } diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo index e826b08a26..4cd02b9478 100644 --- a/src/lib/elementary/efl_ui_animation_view.eo +++ b/src/lib/elementary/efl_ui_animation_view.eo @@ -45,7 +45,7 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View, get { } values { - auto_play: bool; [[Auto play mode, Default value is $false]] + auto_play: bool(false); [[Auto play mode.]] } } @property auto_repeat { @@ -71,17 +71,15 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View, animation double-time faster, you can give $speed 2. If you want to play animation double-time slower, you can give $speed 0.5. - $true when it's successful. $false otherwise. - Warning: speed must be greater than zero. ]] set { - return: bool; + return: bool; [[$true when it's successful. $false otherwise.]] } get { } values { - speed: double; [[ Speed factor. Default value is 1.0]] + speed: double(1.0); [[Speed factor.]] } } @property duration_time { @@ -214,50 +212,48 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View, } @property min_progress { [[The start progress of the play. - Default value is 0. ]] set { } get { } values { - min_progress: double; [[The minimum progress. Value must be 0 ~ 1.]] + min_progress: double(0.0); [[The minimum progress. Value must be 0 ~ 1.]] } } @property max_progress { [[The last progress of the play. - Default value is 1. ]] set { } get { } values { - max_progress: double; [[The maximum progress. Value must be 0 ~ 1.]] + max_progress: double(1.0); [[The maximum progress. Value must be 0 ~ 1.]] } } @property min_frame { [[The start frame of the play. - Default value is 0. ]] set { } get { } values { - min_frame: int; [[The minimum frame for play. Value must be 0 ~ @.max_frame]] + min_frame: int(0); [[The minimum frame for play. Value must be 0 ~ @.max_frame]] } } @property max_frame { [[The last frame of the play. - Default value is @.frame_count - 1 ]] set { } get { } values { - max_frame: int; [[The maximum frame for play. Value must be @.min_frame ~ (@.frame_count - 1)]] + max_frame: int; [[The maximum frame for play. Value must be @.min_frame ~ (@.frame_count - 1). + The default value is @.frame_count - 1. + ]] } } diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo b/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo index 2ac04924c6..16ba58db2f 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo +++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo @@ -2,18 +2,16 @@ class @beta Efl.Ui.Spotlight.Manager_Scroll extends Efl.Ui.Spotlight.Manager { methods { @property scroll_block { - [[Blocking of scrolling + [[User scrolling forbidden. - This function will block scrolling movement (by input of a user). - You can disable scrolling movement. The default value is $false, - where the scrolling movement is allowed. + This property blocks scrolling movement by user input. ]] set { } get { } values { - scroll_block: bool; [[$true if block scrolling movement, $false otherwise]] + scroll_block: bool(false); [[$true if user should not be able to scroll.]] } } } diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index d05b6a14db..2118babe50 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -190,12 +190,11 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl If $enabled is $true, the return key on input panel is disabled when the entry has no text. The return key on the input panel is automatically enabled when the entry has text. - The default value is $false. ]] set { } values { - enabled: bool; [[If $true, the return key is automatically disabled when the entry has no text.]] + enabled: bool(false); [[If $true, the return key is automatically disabled when the entry has no text.]] } } @property item_factory { diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo index 509066caa9..ab51da1a51 100644 --- a/src/lib/evas/canvas/efl_canvas_object.eo +++ b/src/lib/evas/canvas/efl_canvas_object.eo @@ -47,7 +47,6 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, If the value is @Efl.Input.Object_Pointer_Mode.no_grab, then events will be emitted just when inside this object area. - The default value is @Efl.Input.Object_Pointer_Mode.auto_grab. See also: @.pointer_mode_by_device.get and @.pointer_mode_by_device.set Note: This function will only set/get the mode for the default pointer. ]] @@ -57,7 +56,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, return: bool; [[$true if pointer behaviour was set, $false otherwise]] } values { - pointer_mode: Efl.Input.Object_Pointer_Mode; [[Input pointer mode]] + pointer_mode: Efl.Input.Object_Pointer_Mode(Efl.Input.Object_Pointer_Mode.auto_grab); [[Input pointer mode]] } } @property render_op { @@ -265,8 +264,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, get { } values { - precise: bool; [[Whether to use precise point collision - detection or not. The default value is false.]] + precise: bool(false); [[Whether to use precise point collision detection.]] } } @property propagate_events { @@ -280,7 +278,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, propagated on to the smart object of which $obj is a member. If $prop is $false, events occurring on this object will not be propagated on to the smart object of which $obj is a - member. The default value is $true. + member. See also @.repeat_events.set, @.pass_events.set. ]] @@ -289,8 +287,7 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, get { } values { - propagate: bool; [[Whether to propagate events ($true) or not - ($false).]] + propagate: bool(true); [[Whether to propagate events.]] } } @property pass_events { From 718f3cd49586ec6a0448977081e16cd647b06e68 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 20 Sep 2019 17:03:58 +0200 Subject: [PATCH 46/56] eolian: make hashes beta-only for now They're not completely settled on and we don't even know if we want them at all. So let's make them beta only for now. Ref T8050. --- src/lib/eolian/database_validate.c | 5 +++++ src/tests/eolian/data/owning.eo | 2 +- src/tests/eolian_cxx/complex.eo | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index f13e0e82b7..4ad105de0f 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -293,6 +293,11 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) int kwid = eo_lexer_keyword_str_to_id(tp->base.name); if (kwid > KW_void) tp->ownable = EINA_TRUE; + if (kwid == KW_hash && vals->stable) + { + _eo_parser_log(&tp->base, "hashes not allowed in stable context"); + return EINA_FALSE; + } Eolian_Type *itp = tp->base_type; /* validate types in brackets so transitive fields get written */ while (itp) diff --git a/src/tests/eolian/data/owning.eo b/src/tests/eolian/data/owning.eo index 6c9cb10046..fe6b5bf2f0 100644 --- a/src/tests/eolian/data/owning.eo +++ b/src/tests/eolian/data/owning.eo @@ -1,4 +1,4 @@ -class Owning { +class @beta Owning { methods { test1 { params { diff --git a/src/tests/eolian_cxx/complex.eo b/src/tests/eolian_cxx/complex.eo index d3f88488a0..a87391d83b 100644 --- a/src/tests/eolian_cxx/complex.eo +++ b/src/tests/eolian_cxx/complex.eo @@ -58,12 +58,12 @@ class Complex extends Efl.Object l: array @move; } } - inhash { + inhash @beta { params { l: hash; } } - inhashown { + inhashown @beta { params { l: hash @move; } @@ -139,12 +139,12 @@ class Complex extends Efl.Object @out l: array @move; } } - outhash { + outhash @beta { params { @out l: hash; } } - outhashown { + outhashown @beta { params { @out l: hash @move; } From 7cbd08ee8c577d35699d937b56c95a65ffcbcd67 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 20 Sep 2019 17:46:56 +0200 Subject: [PATCH 47/56] eolian: string(share) is always const, allow in events out of box --- src/lib/eolian/database_validate.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 4ad105de0f..5706ace308 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -606,6 +606,7 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash) _eo_parser_log(&tp->base, "pointers not allowed in events"); return _reset_stable(vals, was_stable, EINA_FALSE); } + int kwid = eo_lexer_keyword_str_to_id(tp->base.name); /* require containers to be const for now... * * this is FIXME, and decision wasn't reached before 1.22 @@ -613,10 +614,17 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash) */ if (database_type_is_ownable(tp->base.unit, tp, EINA_FALSE)) { - if (!tp->is_const) + switch (kwid) { - _eo_parser_log(&tp->base, "event container types must be const"); - return _reset_stable(vals, was_stable, EINA_FALSE); + case KW_string: + case KW_stringshare: + break; + default: + if (!tp->is_const) + { + _eo_parser_log(&tp->base, "event container types must be const"); + return _reset_stable(vals, was_stable, EINA_FALSE); + } } } else if (tp->is_const) @@ -624,7 +632,6 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash) _eo_parser_log(&tp->base, "event value types cannot be const"); return _reset_stable(vals, was_stable, EINA_FALSE); } - int kwid = eo_lexer_keyword_str_to_id(tp->base.name); /* containers are allowed but not iterators/lists */ if (kwid == KW_iterator || kwid == KW_list) { From 53a3326ddc74634093d9bd06e3d5c23fcd783b54 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 20 Sep 2019 18:02:07 +0200 Subject: [PATCH 48/56] eolian: rename any_value_ptr -> any_value_ref for consistency --- src/bin/eolian/sources.c | 2 +- .../eolian/mono/marshall_annotation.hh | 8 ++++---- .../eolian/mono/marshall_type_impl.hh | 4 ++-- .../eolian_mono/eolian/mono/struct_definition.hh | 2 +- src/bin/eolian_mono/eolian/mono/type_impl.hh | 4 ++-- src/bindings/luajit/eolian.lua | 4 ++-- src/lib/ecore/efl_loop.eo | 2 +- src/lib/efl/interfaces/efl_config.eo | 4 ++-- src/lib/efl/interfaces/efl_model.eo | 6 +++--- src/lib/elementary/efl_ui_view_model.eo | 6 +++--- src/lib/elementary/efl_ui_win.eo | 4 ++-- src/lib/eolian/Eolian.h | 2 +- src/lib/eolian/database_validate.c | 6 +++--- src/lib/eolian/eo_lexer.h | 2 +- src/lib/eolian_cxx/grammar/type_impl.hpp | 6 +++--- .../evas/gesture/efl_canvas_gesture_manager.eo | 2 +- .../gesture/efl_canvas_gesture_recognizer.eo | 2 +- src/scripts/pyolian/eolian.py | 2 +- src/tests/efl_mono/StructHelpers.cs | 8 ++++---- src/tests/efl_mono/ValueEolian.cs | 2 +- src/tests/efl_mono/dummy_test_object.c | 6 +++--- src/tests/efl_mono/dummy_test_object.eo | 16 ++++++++-------- 22 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index dd4b1f29ef..37a8ef05c8 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -156,7 +156,7 @@ _free_func_get(const Eolian_Type *type) return "eina_stringshare_del"; case EOLIAN_TYPE_BUILTIN_ANY_VALUE: return "eina_value_flush"; - case EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR: + case EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF: return "eina_value_free"; case EOLIAN_TYPE_BUILTIN_STRBUF: return "eina_strbuf_free"; diff --git a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh index 6d56b2493c..82bbd13408 100644 --- a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh +++ b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh @@ -70,10 +70,10 @@ struct marshall_annotation_visitor_generate {"stringshare", false, [&] { return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]"; }}, - {"any_value_ptr", true, [&] { + {"any_value_ref", true, [&] { return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]"; }}, - {"any_value_ptr", false, [&] { + {"any_value_ref", false, [&] { return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]"; }}, {"strbuf", true, [&] { @@ -108,10 +108,10 @@ struct marshall_annotation_visitor_generate {"stringshare", false, [&] { return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]"; }}, - {"any_value_ptr", true, [&] { + {"any_value_ref", true, [&] { return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]"; }}, - {"any_value_ptr", false, [&] { + {"any_value_ref", false, [&] { return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]"; }}, {"strbuf", true, [&] { diff --git a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh index 588e8c2465..5ba68ab997 100644 --- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh +++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh @@ -137,14 +137,14 @@ struct marshall_type_visitor_generate r.base_type = "Eina.ValueNative"; return r; }} - , {"any_value_ptr", true, [&] + , {"any_value_ref", true, [&] { regular_type_def r = regular; r.namespaces.clear(); r.base_type = "Eina.Value"; return r; }} - , {"any_value_ptr", false, [&] + , {"any_value_ref", false, [&] { regular_type_def r = regular; r.namespaces.clear(); diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh index 93eed6086c..fe96e2d175 100644 --- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh @@ -293,7 +293,7 @@ struct struct_internal_definition_generator || (regular && (regular->base_type == "string" || regular->base_type == "mstring" || regular->base_type == "stringshare" - || regular->base_type == "any_value_ptr"))) + || regular->base_type == "any_value_ref"))) { if (!as_generator(indent << scope_tab << "/// Internal wrapper for field " << field_name << "\n" << indent << scope_tab << "public System.IntPtr " << field_name << ";\n") diff --git a/src/bin/eolian_mono/eolian/mono/type_impl.hh b/src/bin/eolian_mono/eolian/mono/type_impl.hh index 7e5159fc26..7c2e5bdf91 100644 --- a/src/bin/eolian_mono/eolian/mono/type_impl.hh +++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh @@ -228,9 +228,9 @@ struct visitor_generate , {"any_value", false, [&] { return regular_type_def{"Eina.Value", regular.base_qualifier, {}}; }} - , {"any_value_ptr", nullptr, [&] + , {"any_value_ref", nullptr, [&] { return regular_type_def{"Eina.Value", regular.base_qualifier, {}}; - }} // FIXME add proper support for any_value_ptr + }} // FIXME add proper support for any_value_ref }; std::string full_type_name = name_helpers::type_full_eolian_name(regular); if(eina::optional b = call_match diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 145f6f8ddf..7fec606c10 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -161,7 +161,7 @@ ffi.cdef [[ EOLIAN_TYPE_BUILTIN_LIST, EOLIAN_TYPE_BUILTIN_ANY_VALUE, - EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, + EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF, EOLIAN_TYPE_BUILTIN_BINBUF, EOLIAN_TYPE_BUILTIN_EVENT, EOLIAN_TYPE_BUILTIN_MSTRING, @@ -962,7 +962,7 @@ M.type_builtin_type = { LIST = 39, ANY_VALUE = 40, - ANY_VALUE_PTR = 41, + ANY_VALUE_REF = 41, BINBUF = 42, EVENT = 43, MSTRING = 44, diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo index ea263fb738..0f17c311da 100644 --- a/src/lib/ecore/efl_loop.eo +++ b/src/lib/ecore/efl_loop.eo @@ -37,7 +37,7 @@ abstract Efl.Loop extends Efl.Task } begin { [[Runs the application main loop.]] - return: any_value_ptr; [[Value set by quit()]] + return: any_value_ref; [[Value set by quit()]] } quit { [[Quits the main loop once all the events currently on the queue have diff --git a/src/lib/efl/interfaces/efl_config.eo b/src/lib/efl/interfaces/efl_config.eo index 0e482577b0..afbe38ec89 100644 --- a/src/lib/efl/interfaces/efl_config.eo +++ b/src/lib/efl/interfaces/efl_config.eo @@ -9,7 +9,7 @@ interface @beta Efl.Config name: string; [[Configuration option name.]] } values { - value: any_value_ptr @move; + value: any_value_ref @move; [[The value. It will be empty if it doesn't exist. The caller must free it after use (using $eina_value_free() in C).]] } @@ -19,7 +19,7 @@ interface @beta Efl.Config name: string; [[Configuration option name.]] } values { - value: const(any_value_ptr); + value: const(any_value_ref); [[Configuration option value. May be $null if not found.]] } return: bool; [[$false in case of error: value type was invalid, the diff --git a/src/lib/efl/interfaces/efl_model.eo b/src/lib/efl/interfaces/efl_model.eo index 9390b87b22..5713df6dc4 100644 --- a/src/lib/efl/interfaces/efl_model.eo +++ b/src/lib/efl/interfaces/efl_model.eo @@ -59,7 +59,7 @@ interface @beta Efl.Model See @.property.get, @[Efl.Model.properties,changed] ]] - return: future; [[Return an error in case the property could not be set, + return: future; [[Return an error in case the property could not be set, or the value that was set otherwise.]] } get { @@ -76,7 +76,7 @@ interface @beta Efl.Model property: string; [[Property name]] } values { - value: any_value_ptr; [[Property value]] + value: any_value_ref; [[Property value]] } } property_ready_get { @@ -94,7 +94,7 @@ interface @beta Efl.Model params { @in property: string; [[Property name.]] } - return: future; [[Future to be resolved when the property changes to anything other than + return: future; [[Future to be resolved when the property changes to anything other than error:EAGAIN]] } children_slice_get { diff --git a/src/lib/elementary/efl_ui_view_model.eo b/src/lib/elementary/efl_ui_view_model.eo index c09ae516e6..a5caaa8d1c 100644 --- a/src/lib/elementary/efl_ui_view_model.eo +++ b/src/lib/elementary/efl_ui_view_model.eo @@ -4,7 +4,7 @@ function @beta EflUiViewModelPropertyGet { @in view_model: const(Efl.Ui.View_Model); [[The ViewModel object the @.property.get is issued on.]] @in property: stringshare; [[The property name the @.property.get is issued on.]] } - return: any_value_ptr; [[The property value.]] + return: any_value_ref; [[The property value.]] }; function @beta EflUiViewModelPropertySet { @@ -12,9 +12,9 @@ function @beta EflUiViewModelPropertySet { params { @in view_model: Efl.Ui.View_Model; [[The ViewModel object the @.property.set is issued on.]] @in property: stringshare; [[The property name the @.property.set is issued on.]] - @in value: any_value_ptr @move; [[The new value to set.]] + @in value: any_value_ref @move; [[The new value to set.]] } - return: future; [[The value that was finally set.]] + return: future; [[The value that was finally set.]] }; class @beta Efl.Ui.View_Model extends Efl.Composite_Model diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 745e7a318b..30ae151ac6 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -280,7 +280,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W windows are closed. ]] values { - exit_code: const(any_value_ptr); [[The exit code to use when exiting]] + exit_code: const(any_value_ref); [[The exit code to use when exiting]] } } @property icon_object { @@ -596,7 +596,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W Note this is different from @.exit_on_close which exits when a given window is closed. ]] values { - exit_code: const(any_value_ptr); [[The exit code to use when exiting.]] + exit_code: const(any_value_ref); [[The exit code to use when exiting.]] } } activate { diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 0cb7384772..ed6444ce73 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -340,7 +340,7 @@ typedef enum EOLIAN_TYPE_BUILTIN_LIST, EOLIAN_TYPE_BUILTIN_ANY_VALUE, - EOLIAN_TYPE_BUILTIN_ANY_VALUE_PTR, + EOLIAN_TYPE_BUILTIN_ANY_VALUE_REF, EOLIAN_TYPE_BUILTIN_BINBUF, EOLIAN_TYPE_BUILTIN_EVENT, EOLIAN_TYPE_BUILTIN_MSTRING, diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 5706ace308..a24105c607 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -326,7 +326,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) case KW_mstring: case KW_stringshare: case KW_any_value: - case KW_any_value_ptr: + case KW_any_value_ref: case KW_binbuf: case KW_strbuf: tp->ownable = EINA_TRUE; @@ -645,12 +645,12 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash) return _reset_stable(vals, was_stable, EINA_FALSE); } /* any type past builtin value types and containers is not allowed, - * any_value is allowed but passed as const reference, any_value_ptr + * any_value is allowed but passed as const reference, any_value_ref * is not; string is allowed, but mutable strings or stringshares are * not and neither are string buffers, the type is never owned by the * callee, so all strings passed in are unowned and read-only */ - if (kwid >= KW_any_value_ptr && kwid != KW_string) + if (kwid >= KW_any_value_ref && kwid != KW_string) { _eo_parser_log(&tp->base, "forbidden event type"); return _reset_stable(vals, was_stable, EINA_FALSE); diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index e6ab8da0bd..3b2bf734ac 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -60,7 +60,7 @@ enum Tokens KW(void), \ \ KW(accessor), KW(array), KW(future), KW(iterator), KW(hash), KW(list), \ - KW(any_value), KW(any_value_ptr), KW(binbuf), KW(event), \ + KW(any_value), KW(any_value_ref), KW(binbuf), KW(event), \ KW(mstring), KW(string), KW(stringshare), KW(strbuf), \ \ KW(void_ptr), \ diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp index b8cb7342b6..959f654c1b 100644 --- a/src/lib/eolian_cxx/grammar/type_impl.hpp +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp @@ -164,7 +164,7 @@ struct visitor_generate else return replace_base_type(r, " Eina_Binbuf const*"); }} - /* FIXME: handle any_value_ptr */ + /* FIXME: handle any_value_ref */ , {"any_value", true, nullptr, nullptr, [&] { return regular_type_def{" ::efl::eina::value", regular.base_qualifier ^ qualifier_info::is_ref, {}}; @@ -172,11 +172,11 @@ struct visitor_generate , {"any_value", false, nullptr, nullptr, [&] { return regular_type_def{" ::efl::eina::value_view", regular.base_qualifier, {}}; }} - , {"any_value_ptr", true, nullptr, nullptr, [&] + , {"any_value_ref", true, nullptr, nullptr, [&] { return regular_type_def{" ::efl::eina::value", regular.base_qualifier ^ qualifier_info::is_ref, {}}; }} - , {"any_value_ptr", false, nullptr, nullptr, [&] + , {"any_value_ref", false, nullptr, nullptr, [&] { return regular_type_def{" ::efl::eina::value_view", regular.base_qualifier ^ qualifier_info::is_ref, {}}; }} }; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo index 8e5d75dead..762fccab57 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.eo @@ -37,7 +37,7 @@ class @beta Efl.Canvas.Gesture_Manager extends Efl.Object name: string; [[Property name.]] } values { - value: any_value_ptr; [[Value of the property.]] + value: any_value_ref; [[Value of the property.]] } } } diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo index c12274b899..e24fc7e9df 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo +++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.eo @@ -48,7 +48,7 @@ abstract @beta Efl.Canvas.Gesture_Recognizer extends Efl.Object name: string; [[Property name.]] } values { - value: any_value_ptr; [[Value of the property.]] + value: any_value_ref; [[Value of the property.]] } } } diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py index e231d2b579..c76bc49e72 100644 --- a/src/scripts/pyolian/eolian.py +++ b/src/scripts/pyolian/eolian.py @@ -130,7 +130,7 @@ class Eolian_Type_Builtin_Type(IntEnum): LIST = 39 ANY_VALUE = 40 - ANY_VALUE_PTR = 41 + ANY_VALUE_REF = 41 BINBUF = 42 EVENT = 43 diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs index aeafe9e6d7..d07c6c0487 100644 --- a/src/tests/efl_mono/StructHelpers.cs +++ b/src/tests/efl_mono/StructHelpers.cs @@ -141,8 +141,8 @@ internal class StructHelpers complex.Fany_value = new Eina.Value(Eina.ValueType.Double); complex.Fany_value.Set(-9007199254740992.0); - complex.Fany_value_ptr = new Eina.Value(Eina.ValueType.String); - complex.Fany_value_ptr.Set("abc"); + complex.Fany_value_ref = new Eina.Value(Eina.ValueType.String); + complex.Fany_value_ref.Set("abc"); complex.Fbinbuf = new Eina.Binbuf(); complex.Fbinbuf.Append(126); @@ -180,7 +180,7 @@ internal class StructHelpers Test.Assert(double_val == -9007199254740992.0); string str_val = null; - Test.Assert(complex.Fany_value_ptr.Get(out str_val)); + Test.Assert(complex.Fany_value_ref.Get(out str_val)); Test.Assert(str_val == "abc"); Test.Assert(complex.Fbinbuf.Length == 1); @@ -201,7 +201,7 @@ internal class StructHelpers Test.Assert(complex.Fhash == null); Test.Assert(complex.Fiterator == null); Test.Assert(complex.Fany_value == null); - Test.Assert(complex.Fany_value_ptr == null); + Test.Assert(complex.Fany_value_ref == null); Test.Assert(complex.Fbinbuf == null); Test.Assert(complex.Fslice.Length == 0); diff --git a/src/tests/efl_mono/ValueEolian.cs b/src/tests/efl_mono/ValueEolian.cs index 80ec70e589..97baf950bd 100644 --- a/src/tests/efl_mono/ValueEolian.cs +++ b/src/tests/efl_mono/ValueEolian.cs @@ -162,7 +162,7 @@ public static class TestEinaValueEolian { } // ValueType in eolian context is beta, so not allowed. -// Value does not have this problem as it is used as any_value/any_value_ptr +// Value does not have this problem as it is used as any_value/any_value_ref #if EFL_BETA public static void TestEolianEinaValueTypeMarshalling() { diff --git a/src/tests/efl_mono/dummy_test_object.c b/src/tests/efl_mono/dummy_test_object.c index 110af73d6d..0406dd3f53 100644 --- a/src/tests/efl_mono/dummy_test_object.c +++ b/src/tests/efl_mono/dummy_test_object.c @@ -4117,8 +4117,8 @@ void struct_complex_with_values(Dummy_StructComplex *complex) eina_value_setup(&complex->fany_value, EINA_VALUE_TYPE_DOUBLE); eina_value_set(&complex->fany_value, -9007199254740992.0); - complex->fany_value_ptr = eina_value_new(EINA_VALUE_TYPE_STRING); - eina_value_set(complex->fany_value_ptr, "abc"); + complex->fany_value_ref = eina_value_new(EINA_VALUE_TYPE_STRING); + eina_value_set(complex->fany_value_ref, "abc"); complex->fbinbuf = eina_binbuf_new(); eina_binbuf_append_char(complex->fbinbuf, 126); @@ -4152,7 +4152,7 @@ Eina_Bool check_and_modify_struct_complex(Dummy_StructComplex *complex) return EINA_FALSE; const char *str_val = NULL; - if (!eina_value_get(complex->fany_value_ptr, &str_val) || strcmp(str_val, "abc") != 0) + if (!eina_value_get(complex->fany_value_ref, &str_val) || strcmp(str_val, "abc") != 0) return EINA_FALSE; if (eina_binbuf_length_get(complex->fbinbuf) != 1 || eina_binbuf_string_get(complex->fbinbuf)[0] != 126) diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index 52eab417f1..c8f4b1ee0c 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -79,7 +79,7 @@ struct @free(free) Dummy.StructComplex { fhash: hash; fiterator: iterator; fany_value: any_value; - fany_value_ptr: any_value_ptr; + fany_value_ref: any_value_ref; fbinbuf: binbuf; fslice: slice; // fslice: ptr(Eina.Slice); // TODO @@ -1243,13 +1243,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { /* Eina Values */ set_value_ptr { params { - value: any_value_ptr; + value: any_value_ref; } } set_value_ptr_own { params { - value: any_value_ptr @move; + value: any_value_ref @move; } } @@ -1266,11 +1266,11 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } get_value_ptr_own { - return: any_value_ptr @move; + return: any_value_ref @move; } get_value_ptr { - return: any_value_ptr; + return: any_value_ref; } /* Commented out due to issues regarding eolian treatment of any_value. @@ -1287,13 +1287,13 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { out_value_ptr { params { - @out value: any_value_ptr; + @out value: any_value_ref; } } out_value_ptr_own { params { - @out value: any_value_ptr @move; + @out value: any_value_ref @move; } } @@ -1595,7 +1595,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { /* Futures */ get_future { - return: future; + return: future; } fulfill_promise { From 01875756ebacc3e4578106f638ca7e57cdcd21f0 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Fri, 20 Sep 2019 19:14:02 -0300 Subject: [PATCH 49/56] eolian_mono: add more verbs to generate C# method beginning with verb Summary: C# language binding generates C# method name beginning with verb by checking verb list in name_helpers.hh. Some verbs used in eo method are missing in the current verb list. So they are added into the verb list. In this scheme, there is a problem that some words can be used as a verb in some methods but they also can be used as a noun in other methods. (e.g. drag_start as a verb / cursor_word_start as a noun) So "start" and "scroll" are not added to verb list in this patch. To resolve the above problem, we may need a new eo syntax to rename or reverse the name in language bindings. Test Plan: Check C# method names in .eo.cs files if the name begins with verb. Reviewers: felipealmeida, SanghyeonLee, woohyun, Jaehyun_Cho, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10001 --- .../eolian_mono/eolian/mono/name_helpers.hh | 37 ++++++++++++++++++- src/bindings/mono/efl_mono/Bind.cs | 6 +-- src/tests/efl_mono/Parts.cs | 2 +- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index b2063116e0..e68de6bf66 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -123,7 +123,42 @@ static const std::vector verbs = "unpack", "emit", "call", - "append" + "append", + "apply", + "bind", + "cancel", + "copy", + "create", + "cut", + "delete", + "deselect", + "detach", + "do", + "gen", + "insert", + "iterate", + "join", + "leave", + "limit", + "paste", + "parse", + "prepend", + "process", + "query", + "refresh", + "remove", + "register", + "reject", + "release", + "reply", + "send", + "select", + "serialize", + "steal", + "sync", + "toggle", + "unbind", + "unregister" }; const std::vector not_verbs = diff --git a/src/bindings/mono/efl_mono/Bind.cs b/src/bindings/mono/efl_mono/Bind.cs index 1d29c25d42..14c45d9dd0 100644 --- a/src/bindings/mono/efl_mono/Bind.cs +++ b/src/bindings/mono/efl_mono/Bind.cs @@ -37,7 +37,7 @@ public class BindableProperty { if (this.partName == null) { - return this.binder.PropertyBind(this.propertyName, modelProperty); + return this.binder.BindProperty(this.propertyName, modelProperty); } else { @@ -59,7 +59,7 @@ public class BindableProperty var partBinder = partMethod.Invoke(partHolder, new System.Object[] { this.partName }) as Efl.Ui.IPropertyBind; if (partBinder != null) { - return partBinder.PropertyBind(this.propertyName, modelProperty); + return partBinder.BindProperty(this.propertyName, modelProperty); } else { @@ -112,7 +112,7 @@ public class BindableFactoryPart /// Binds the given factory to this part. public Eina.Error BindFactory(Efl.Ui.IFactory factory) { - this.Binder.FactoryBind(this.PartName, factory); + this.Binder.BindFactory(this.PartName, factory); return Eina.Error.NO_ERROR; } } diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs index a27c1b472e..14743ac634 100644 --- a/src/tests/efl_mono/Parts.cs +++ b/src/tests/efl_mono/Parts.cs @@ -55,7 +55,7 @@ public static class TestMVVMParts { var factory = new Efl.Ui.ItemFactory(); var iconFactory = new Efl.Ui.ImageFactory(null); - iconFactory.PropertyBind("filename", "modelProperty"); + iconFactory.BindProperty("filename", "modelProperty"); var error = factory.IconPart().BindFactory(iconFactory); Test.AssertEquals(error, Eina.Error.NO_ERROR); From 9e92b3d123b12e5637fa010eccd47785cf0f4cbe Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Fri, 20 Sep 2019 19:22:22 -0300 Subject: [PATCH 50/56] csharp: Guard hash usage behind EFL_BETA. Summary: After 718f3cd49586, hashes are currently beta-only. Reviewers: zmike, brunobelo Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10060 --- src/tests/efl_mono/Eina.cs | 3 + src/tests/efl_mono/Events.cs | 2 + src/tests/efl_mono/StructHelpers.cs | 3 + src/tests/efl_mono/Structs.cs | 5 +- src/tests/efl_mono/dummy_test_object.eo | 102 ++++++++++++------------ 5 files changed, 63 insertions(+), 52 deletions(-) diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs index 0f6d9774bc..c432033e52 100644 --- a/src/tests/efl_mono/Eina.cs +++ b/src/tests/efl_mono/Eina.cs @@ -2442,6 +2442,7 @@ class TestEinaInlist } // < TestEinaInlist +#if EFL_BETA class TestEinaHash { @@ -3038,6 +3039,8 @@ class TestEinaHash } } +#endif // EFL_BETA + class TestEinaIterator { diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs index 77a6dbfd60..6cf9efcbfa 100644 --- a/src/tests/efl_mono/Events.cs +++ b/src/tests/efl_mono/Events.cs @@ -178,6 +178,7 @@ class TestEoEvents Test.AssertEquals(sent_struct.Fstring, received_struct.Fstring); } +#if EFL_BETA public static void event_with_struct_complex_payload() { var obj = new Dummy.TestObject(); @@ -193,6 +194,7 @@ class TestEoEvents Test.AssertEquals(sent_struct.Fobj, received_struct.Fobj); } +#endif public static void event_with_array_payload() { diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs index d07c6c0487..34d1024022 100644 --- a/src/tests/efl_mono/StructHelpers.cs +++ b/src/tests/efl_mono/StructHelpers.cs @@ -117,6 +117,7 @@ internal class StructHelpers Test.Assert(simple.Fstringshare == null); } +#if EFL_BETA internal static Dummy.StructComplex structComplexWithValues() { var complex = new Dummy.StructComplex(); @@ -210,6 +211,8 @@ internal class StructHelpers Test.Assert(complex.Fobj == null); } +#endif + } } diff --git a/src/tests/efl_mono/Structs.cs b/src/tests/efl_mono/Structs.cs index 970fc97696..e5640abd65 100644 --- a/src/tests/efl_mono/Structs.cs +++ b/src/tests/efl_mono/Structs.cs @@ -20,11 +20,13 @@ internal class TestStructs checkZeroedStructSimple(simple); } +#if EFL_BETA private static void complex_default_instantiation() { var complex = new Dummy.StructComplex(); checkZeroedStructComplex(complex); } +#endif public static void parameter_initialization() { @@ -300,6 +302,7 @@ internal class TestStructs } */ +#if EFL_BETA // Complex Structs public static void complex_in() { @@ -340,7 +343,7 @@ internal class TestStructs var complex = t.StructComplexReturn(); checkStructComplex(complex); } - +#endif // public static void complex_ptr_return() // { // } diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index c8f4b1ee0c..a63c822375 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -73,7 +73,7 @@ struct @free(free) Dummy.StructSimple fmyint: Dummy.MyInt; } -struct @free(free) Dummy.StructComplex { +struct @beta @free(free) Dummy.StructComplex { farray: array; flist: list; fhash: hash; @@ -764,7 +764,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { // Eina Hash // // Integer // - eina_hash_int_in { + eina_hash_int_in @beta { params { @in hsh: hash; } @@ -772,7 +772,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } /* - eina_hash_int_in_own { + eina_hash_int_in_own @beta { params { @in hsh: hash @move; // <, int @move> } @@ -783,150 +783,150 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } */ - eina_hash_int_out { + eina_hash_int_out @beta { params { @out hsh: hash; } return: bool; } - check_eina_hash_int_out { + check_eina_hash_int_out @beta { return: bool; } /* - eina_hash_int_out_own { + eina_hash_int_out_own @beta { params { @out hsh: hash @move; // <, int @move> } return: bool; } - check_eina_hash_int_out_own { + check_eina_hash_int_out_own @beta { return: bool; } */ - eina_hash_int_return { + eina_hash_int_return @beta { return: hash; } - check_eina_hash_int_return { + check_eina_hash_int_return @beta { return: bool; } /* - eina_hash_int_return_own { + eina_hash_int_return_own @beta { return: hash @move; // <, int @move> } - check_eina_hash_int_return_own { + check_eina_hash_int_return_own @beta { return: bool; } */ // String // - eina_hash_str_in { + eina_hash_str_in @beta { params { @in hsh: hash; } return: bool; } - eina_hash_str_in_own { + eina_hash_str_in_own @beta { params { @in hsh: hash @move; } return: bool; } - check_eina_hash_str_in_own { + check_eina_hash_str_in_own @beta { return: bool; } - eina_hash_str_out { + eina_hash_str_out @beta { params { @out hsh: hash; } return: bool; } - check_eina_hash_str_out { + check_eina_hash_str_out @beta { return: bool; } - eina_hash_str_out_own { + eina_hash_str_out_own @beta { params { @out hsh: hash @move; } return: bool; } - check_eina_hash_str_out_own { + check_eina_hash_str_out_own @beta { return: bool; } - eina_hash_str_return { + eina_hash_str_return @beta { return: hash; } - check_eina_hash_str_return { + check_eina_hash_str_return @beta { return: bool; } - eina_hash_str_return_own { + eina_hash_str_return_own @beta { return: hash @move; } - check_eina_hash_str_return_own { + check_eina_hash_str_return_own @beta { return: bool; } // Eina_Stringshare // - eina_hash_strshare_in { + eina_hash_strshare_in @beta { params { @in hsh: hash; } return: bool; } - eina_hash_strshare_in_own { + eina_hash_strshare_in_own @beta { params { @in hsh: hash @move; } return: bool; } - check_eina_hash_strshare_in_own { + check_eina_hash_strshare_in_own @beta { return: bool; } - eina_hash_strshare_out { + eina_hash_strshare_out @beta { params { @out hsh: hash; } return: bool; } - check_eina_hash_strshare_out { + check_eina_hash_strshare_out @beta { return: bool; } - eina_hash_strshare_out_own { + eina_hash_strshare_out_own @beta { params { @out hsh: hash @move; } return: bool; } - check_eina_hash_strshare_out_own { + check_eina_hash_strshare_out_own @beta { return: bool; } - eina_hash_strshare_return { + eina_hash_strshare_return @beta { return: hash; } - check_eina_hash_strshare_return { + check_eina_hash_strshare_return @beta { return: bool; } - eina_hash_strshare_return_own { + eina_hash_strshare_return_own @beta { return: hash @move; } - check_eina_hash_strshare_return_own { + check_eina_hash_strshare_return_own @beta { return: bool; } // Object // - eina_hash_obj_in { + eina_hash_obj_in @beta { params { @in hsh: hash; @in nwk1: Dummy.Numberwrapper; @@ -937,7 +937,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } - eina_hash_obj_in_own { + eina_hash_obj_in_own @beta { params { @in hsh: hash @move; @in nwk1: Dummy.Numberwrapper; @@ -947,7 +947,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } return: bool; } - check_eina_hash_obj_in_own { + check_eina_hash_obj_in_own @beta { params { @in nwk1: Dummy.Numberwrapper; @in nwv1: Dummy.Numberwrapper; @@ -957,7 +957,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } - eina_hash_obj_out { + eina_hash_obj_out @beta { params { @out hsh: hash; @out nwk: Dummy.Numberwrapper; @@ -965,7 +965,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } return: bool; } - check_eina_hash_obj_out { + check_eina_hash_obj_out @beta { params { @in nwk1: Dummy.Numberwrapper; @in nwv1: Dummy.Numberwrapper; @@ -975,7 +975,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } - eina_hash_obj_out_own { + eina_hash_obj_out_own @beta { params { @out hsh: hash @move; @out nwk: Dummy.Numberwrapper; @@ -983,18 +983,18 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } return: bool; } - check_eina_hash_obj_out_own { + check_eina_hash_obj_out_own @beta { return: bool; } - eina_hash_obj_return { + eina_hash_obj_return @beta { params { @out nwk: Dummy.Numberwrapper; @out nwv: Dummy.Numberwrapper; } return: hash; } - check_eina_hash_obj_return { + check_eina_hash_obj_return @beta { params { @in nwk1: Dummy.Numberwrapper; @in nwv1: Dummy.Numberwrapper; @@ -1004,14 +1004,14 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } - eina_hash_obj_return_own { + eina_hash_obj_return_own @beta { params { @out nwk: Dummy.Numberwrapper; @out nwv: Dummy.Numberwrapper; } return: hash @move; } - check_eina_hash_obj_return_own { + check_eina_hash_obj_return_own @beta { return: bool; } @@ -1419,7 +1419,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } */ - struct_complex_in { + struct_complex_in @beta { params { @in complex: Dummy.StructComplex; } @@ -1427,14 +1427,14 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } /* - struct_complex_ptr_in { + struct_complex_ptr_in @beta { params { @in complex: ptr(Dummy.StructComplex); } return: bool; } - struct_complex_ptr_in_own { + struct_complex_ptr_in_own @beta { params { @in complex: ptr(Dummy.StructComplex) @move; } @@ -1442,7 +1442,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } */ - struct_complex_out { + struct_complex_out @beta { params { @out complex: Dummy.StructComplex; } @@ -1463,7 +1463,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { // return: bool; // } - struct_complex_return { + struct_complex_return @beta { return: Dummy.StructComplex; } @@ -1523,7 +1523,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } } - emit_event_with_struct_complex { + emit_event_with_struct_complex @beta { params { @in data: Dummy.StructComplex; } @@ -1669,7 +1669,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { evt,with,obj @hot: Dummy.Test_Object; evt,with,error @hot: Eina.Error; evt,with,struct @hot: Dummy.StructSimple; - evt,with,struct,complex @hot: Dummy.StructComplex; + evt,with,struct,complex @beta @hot: Dummy.StructComplex; evt,with,array @hot: const(array); evt_with,under @hot: void; From 73219114682f64fdbfe0809be3f2d991016dd3f1 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sat, 21 Sep 2019 10:26:46 +0100 Subject: [PATCH 51/56] efl ui widget - call parent constructor before doing more init the object is not properly set up yet for child classes -0 parent like the main evas object or smart obj havent been constructed yet so call this really early, not in the middle of construction of an efl ui widget... this fixes a segv in elementary_test -to filp where it segv's on object construction where evas object ->cur/prev are NULL (not set up yet). --- src/lib/elementary/efl_ui_widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 5168dbc793..1091a98e37 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -4788,6 +4788,8 @@ elm_widget_tree_dot_dump(const Evas_Object *top, EOLIAN static Eo * _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) { + efl_canvas_group_clipped_set(obj, EINA_FALSE); + obj = efl_constructor(efl_super(obj, MY_CLASS)); sd->on_create = EINA_TRUE; sd->window = efl_provider_find(efl_parent_get(obj), EFL_UI_WIN_CLASS); @@ -4813,8 +4815,6 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN } _efl_ui_focus_event_redirector(obj, obj); - efl_canvas_group_clipped_set(obj, EINA_FALSE); - obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); From 0d7535071c9d94036a71c36a0704dac933dd5a67 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 21 Sep 2019 13:10:53 +0200 Subject: [PATCH 52/56] elementary: make our tests work again 73219114682f64fdbfe0809be3f2d991016dd3f1 moved the constructor to to top, which leads to the fact that a few widgets cannot fetch the shared data of the window. Which made the test suite fail. With this commit we are just moving the sub_object_add after the constructor, which fixes the flip crash. This fixes the test suite --- src/lib/elementary/efl_ui_widget.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 1091a98e37..6d5c780b95 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -4788,14 +4788,12 @@ elm_widget_tree_dot_dump(const Evas_Object *top, EOLIAN static Eo * _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) { - efl_canvas_group_clipped_set(obj, EINA_FALSE); - obj = efl_constructor(efl_super(obj, MY_CLASS)); + Eo *parent = efl_parent_get(obj); sd->on_create = EINA_TRUE; sd->window = efl_provider_find(efl_parent_get(obj), EFL_UI_WIN_CLASS); if (!efl_isa(obj, EFL_UI_WIN_CLASS)) { - Eo *parent = efl_parent_get(obj); if (!efl_isa(parent, EFL_UI_WIDGET_CLASS)) { ERR("You passed a wrong parent parameter (%p %s). " @@ -4806,7 +4804,6 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN { ELM_WIDGET_DATA_GET(parent, parent_sd); sd->shared_win_data = parent_sd->shared_win_data; - efl_ui_widget_sub_object_add(parent, obj); } } else @@ -4815,9 +4812,14 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN } _efl_ui_focus_event_redirector(obj, obj); + efl_canvas_group_clipped_set(obj, EINA_FALSE); + obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); + if (!efl_isa(obj, EFL_UI_WIN_CLASS) && efl_isa(parent, EFL_UI_WIDGET_CLASS)) + efl_ui_widget_sub_object_add(parent, obj); + sd->on_create = EINA_FALSE; efl_access_object_role_set(obj, EFL_ACCESS_ROLE_UNKNOWN); From b051cb52fac823ae15e5a6aa727b201fd088e0e4 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 21 Sep 2019 17:37:07 +0200 Subject: [PATCH 53/56] efl_ui_image: implement Efl.Gfx.Image and Efl.Gfx.Image_Load_Controller at first i tried to implement that with composition, however, this does not work, caused by the fact that the edje_object does not implement efl.gfx.image nor load controller. which would mean i would have to differentiate based on the type what kind of composition i would attach, additionally, i would have to write an additional object which would implement the correct behaviour. To shortcut this overdone approach, this commit simply implements the APIs in the image object. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10068 --- src/lib/elementary/efl_ui_image.c | 235 +++++++++++++++++++++++++++++ src/lib/elementary/efl_ui_image.eo | 17 +++ 2 files changed, 252 insertions(+) diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index e2365857c8..9cde2f803b 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -1388,6 +1388,143 @@ _efl_ui_image_efl_gfx_image_image_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Ima return efl_gfx_image_size_get(sd->img); } +EOLIAN static double +_efl_ui_image_efl_gfx_image_ratio_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return 1.0; //documented value for the case that ratio cannot be calculated + return efl_gfx_image_ratio_get(pd->img); +} + +EOLIAN static Eina_Rect +_efl_ui_image_efl_gfx_image_content_region_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) + { + Eina_Size2D size = efl_gfx_entity_size_get(pd->img); + return EINA_RECT(0, 0, size.w, size.h); + } + + return efl_gfx_image_content_region_get(pd->img); +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_border_insets_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, int l, int r, int t, int b) +{ + if (pd->edje) return; + efl_gfx_image_border_insets_set(pd->img, l, r, t, b); +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_border_insets_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, int *l, int *r, int *t, int *b) +{ + if (pd->edje) + { + if (l) *l = 0; + if (r) *r = 0; + if (t) *t = 0; + if (b) *b = 0; + } + else + { + efl_gfx_image_border_insets_get(pd->img, l, r, t, b); + } +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_border_insets_scale_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, double scale) +{ + if (pd->edje) return; + efl_gfx_image_border_insets_scale_set(pd->img, scale); +} + +EOLIAN static double +_efl_ui_image_efl_gfx_image_border_insets_scale_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return 0.0; + return efl_gfx_image_border_insets_scale_get(pd->img); +} + + +EOLIAN static void +_efl_ui_image_efl_gfx_image_center_fill_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Efl_Gfx_Center_Fill_Mode fill) +{ + if (pd->edje) return; + efl_gfx_image_center_fill_mode_set(pd->img, fill); +} + + +EOLIAN static Efl_Gfx_Center_Fill_Mode +_efl_ui_image_efl_gfx_image_center_fill_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EFL_GFX_CENTER_FILL_MODE_DEFAULT; + return efl_gfx_image_center_fill_mode_get(pd->img); +} + +EOLIAN static Eina_Error +_efl_ui_image_efl_gfx_image_stretch_region_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Eina_Iterator *horizontal, Eina_Iterator *vertical) +{ + if (pd->edje) + { + eina_iterator_free(horizontal); + eina_iterator_free(vertical); + return EINA_ERROR_NO_ERROR; + } + else + { + return efl_gfx_image_stretch_region_set(pd->img, horizontal, vertical); + } +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_stretch_region_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Eina_Iterator **horizontal, Eina_Iterator **vertical) +{ + if (pd->edje) + { + *horizontal = NULL; + *vertical = NULL; + } + else + { + efl_gfx_image_stretch_region_get(pd->img, horizontal, vertical); + } +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_scale_hint_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Efl_Gfx_Image_Scale_Hint hint) +{ + if (pd->edje) return; + return efl_gfx_image_scale_hint_set(pd->img, hint); +} + +EOLIAN static Efl_Gfx_Image_Scale_Hint +_efl_ui_image_efl_gfx_image_scale_hint_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EFL_GFX_IMAGE_SCALE_HINT_NONE; + return efl_gfx_image_scale_hint_get(pd->img); +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_content_hint_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Efl_Gfx_Image_Content_Hint hint) +{ + if (pd->edje) return; + return efl_gfx_image_content_hint_set(pd->img, hint); +} + +EOLIAN static Efl_Gfx_Image_Content_Hint +_efl_ui_image_efl_gfx_image_content_hint_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EFL_GFX_IMAGE_CONTENT_HINT_NONE; + return efl_gfx_image_content_hint_get(pd->img); +} + +EOLIAN static Eina_Error +_efl_ui_image_efl_gfx_image_image_load_error_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EINA_ERROR_NO_ERROR; + + return efl_gfx_image_load_error_get(pd->img); +} + EAPI void elm_image_prescale_set(Evas_Object *obj, int size) @@ -1405,6 +1542,104 @@ _efl_ui_image_efl_gfx_image_load_controller_load_size_set(Eo *obj, Efl_Ui_Image_ _efl_ui_image_load_size_set_internal(obj, sd); } +EOLIAN static void +_efl_ui_image_efl_gfx_image_load_controller_load_async_start(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return; + efl_gfx_image_load_controller_load_async_start(pd->img); +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_load_controller_load_async_cancel(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return; + efl_gfx_image_load_controller_load_async_cancel(pd->img); +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_load_controller_load_dpi_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, double dpi) +{ + if (pd->edje) return; + efl_gfx_image_load_controller_load_dpi_set(pd->img, dpi); +} + + +EOLIAN static double +_efl_ui_image_efl_gfx_image_load_controller_load_dpi_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return 0.0; + return efl_gfx_image_load_controller_load_dpi_get(pd->img); +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_load_controller_load_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Eina_Bool enable) +{ + if (pd->edje) return; + efl_gfx_image_load_controller_load_orientation_set(pd->img, enable); +} + + +EOLIAN static Eina_Bool +_efl_ui_image_efl_gfx_image_load_controller_load_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EINA_FALSE; + return efl_gfx_image_load_controller_load_orientation_get(pd->img); +} + + +EOLIAN static void +_efl_ui_image_efl_gfx_image_load_controller_load_scale_down_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, int div) +{ + if (pd->edje) return; + efl_gfx_image_load_controller_load_scale_down_set(pd->img, div); +} + +EOLIAN static int +_efl_ui_image_efl_gfx_image_load_controller_load_scale_down_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EINA_FALSE; + return efl_gfx_image_load_controller_load_scale_down_get(pd->img); +} + +EOLIAN static void +_efl_ui_image_efl_gfx_image_load_controller_load_skip_header_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Eina_Bool skip) +{ + if (pd->edje) return; + return efl_gfx_image_load_controller_load_skip_header_set(pd->img, skip); +} + +EOLIAN static Eina_Bool +_efl_ui_image_efl_gfx_image_load_controller_load_skip_header_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EINA_FALSE; + return efl_gfx_image_load_controller_load_skip_header_get(pd->img); +} + + +EOLIAN static void +_efl_ui_image_efl_gfx_image_load_controller_load_region_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd, Eina_Rect region) +{ + if (pd->edje) return; + return efl_gfx_image_load_controller_load_region_set(pd->img, region); +} + + +EOLIAN static Eina_Rect +_efl_ui_image_efl_gfx_image_load_controller_load_region_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + + if (pd->edje) return EINA_RECT(0, 0, 0, 0); + return efl_gfx_image_load_controller_load_region_get(pd->img); +} + + +EOLIAN static Eina_Bool +_efl_ui_image_efl_gfx_image_load_controller_load_region_support_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *pd) +{ + if (pd->edje) return EINA_FALSE; + return EINA_TRUE; +} + EAPI int elm_image_prescale_get(const Evas_Object *obj) { diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo index 0d3eeffa5a..80bb886f6d 100644 --- a/src/lib/elementary/efl_ui_image.eo +++ b/src/lib/elementary/efl_ui_image.eo @@ -76,10 +76,27 @@ class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Input.Clickable, E Efl.Gfx.Image.can_upscale { get; set; } Efl.Gfx.Image.can_downscale { get; set; } Efl.Gfx.Image.image_size { get; } + Efl.Gfx.Image_Load_Controller.load_async_start; + Efl.Gfx.Image_Load_Controller.load_async_cancel; + Efl.Gfx.Image_Load_Controller.load_dpi { get; set; } Efl.Gfx.Image_Load_Controller.load_size { get; set; } + Efl.Gfx.Image_Load_Controller.load_orientation { get; set; } + Efl.Gfx.Image_Load_Controller.load_scale_down { get; set; } + Efl.Gfx.Image_Load_Controller.load_skip_header { get; set; } + Efl.Gfx.Image_Load_Controller.load_region { get; set; } + Efl.Gfx.Image_Load_Controller.load_region_support { get; } Efl.Gfx.Image.smooth_scale { get; set; } Efl.Gfx.Image.scale_method { get; set; } Efl.Gfx.Image_Orientable.image_orientation { get; set; } + Efl.Gfx.Image.ratio { get; } + Efl.Gfx.Image.content_region { get; } + Efl.Gfx.Image.border_insets { get; set; } + Efl.Gfx.Image.border_insets_scale { get; set; } + Efl.Gfx.Image.center_fill_mode { get; set; } + Efl.Gfx.Image.stretch_region { get; set; } + Efl.Gfx.Image.scale_hint { get; set; } + Efl.Gfx.Image.content_hint { get; set; } + Efl.Gfx.Image.image_load_error { get; } Efl.Player.playable { get; } Efl.Player.play { get; set; } Efl.Layout.Signal.signal_emit; From 625189d2487bf205dfa8b63e200b6d00975742a3 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 21 Sep 2019 17:53:53 +0200 Subject: [PATCH 54/56] efl_gfx_image: remove ptr() this is not needed here, and not permitted in a none beta context. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10069 --- src/lib/efl/interfaces/efl_gfx_image.eo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/efl/interfaces/efl_gfx_image.eo b/src/lib/efl/interfaces/efl_gfx_image.eo index 4e8c5c4c1d..b9ccac41ea 100644 --- a/src/lib/efl/interfaces/efl_gfx_image.eo +++ b/src/lib/efl/interfaces/efl_gfx_image.eo @@ -213,9 +213,9 @@ interface @beta Efl.Gfx.Image } get {} values { - horizontal: iterator(null); [[Representation of areas that are + horizontal: iterator(null); [[Representation of areas that are stretchable in the image horizontal space.]] - vertical: iterator(null); [[Representation of areas that are + vertical: iterator(null); [[Representation of areas that are stretchable in the image vertical space.]] } } From 64be497e42e2e86f100eb177b2b80200fc8e1da0 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 21 Sep 2019 10:15:18 +0200 Subject: [PATCH 55/56] efl_ui_bg: implement load_controller and efl.gfx.image via composition With this commit the API of load controller and efl.gfx.image is implemented via composition, which makes eolians API checker happy ref T7880 Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10064 --- src/lib/elementary/efl_ui_bg.c | 26 ++------------------------ src/lib/elementary/efl_ui_bg.eo | 5 ++--- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c index 8759bf4db7..d5932d331f 100644 --- a/src/lib/elementary/efl_ui_bg.c +++ b/src/lib/elementary/efl_ui_bg.c @@ -64,6 +64,8 @@ _efl_ui_bg_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Data *pd) efl_ui_widget_focus_allow_set(obj, EINA_FALSE); + efl_composite_attach(obj, pd->img); + return obj; } @@ -132,18 +134,6 @@ elm_bg_option_get(const Evas_Object *obj) return option; } -EOLIAN static void -_efl_ui_bg_efl_gfx_image_scale_method_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, Efl_Gfx_Image_Scale_Method scale_type) -{ - efl_gfx_image_scale_method_set(sd->img, scale_type); -} - -EOLIAN static Efl_Gfx_Image_Scale_Method -_efl_ui_bg_efl_gfx_image_scale_method_get(const Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd) -{ - return efl_gfx_image_scale_method_get(sd->img); -} - EAPI void elm_bg_color_set(Evas_Object *obj, int r, @@ -194,18 +184,6 @@ elm_bg_load_size_set(Evas_Object *obj, int w, int h) efl_gfx_image_load_controller_load_size_set(sd->img, EINA_SIZE2D(w, h)); } -EOLIAN static void -_efl_ui_bg_efl_gfx_image_load_controller_load_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd, Eina_Size2D sz) -{ - efl_gfx_image_load_controller_load_size_set(sd->img, sz); -} - -EOLIAN static Eina_Size2D -_efl_ui_bg_efl_gfx_image_load_controller_load_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Bg_Data *sd) -{ - return efl_gfx_image_load_controller_load_size_get(sd->img); -} - EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group) { diff --git a/src/lib/elementary/efl_ui_bg.eo b/src/lib/elementary/efl_ui_bg.eo index 5de72abd37..6ce62e92e7 100644 --- a/src/lib/elementary/efl_ui_bg.eo +++ b/src/lib/elementary/efl_ui_bg.eo @@ -1,5 +1,6 @@ class @beta Efl.Ui.Bg extends Efl.Ui.Layout_Base - implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller + implements Efl.File, Efl.Gfx.Color + composites Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller { [[The bg (background) widget is used for setting (solid) background decorations for a window (unless it has transparency enabled) or for any container object. It @@ -16,7 +17,5 @@ class @beta Efl.Ui.Bg extends Efl.Ui.Layout_Base Efl.File.key { get; set; } Efl.File.mmap { get; set; } Efl.Gfx.Color.color { get; set; } - Efl.Gfx.Image.scale_method { get; set; } - Efl.Gfx.Image_Load_Controller.load_size { get; set; } } } From 18e9a224beed7407b46c82f6d0bf282aa4376bf0 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 21 Sep 2019 11:08:46 +0200 Subject: [PATCH 56/56] efl_ui_collection: protect against invalid access i am not sure why this should ever happen. However, a error here is better than a access out of the bounds of the array. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D10066 --- src/lib/elementary/efl_ui_collection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c index 718f5b120e..82e21d3dc1 100644 --- a/src/lib/elementary/efl_ui_collection.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -1152,8 +1152,9 @@ _efl_ui_collection_efl_ui_single_selectable_fallback_selection_get(const Eo *obj #define ITEM_IS_OUTSIDE_VISIBLE(id) id < collection_pd->start_id || id > collection_pd->end_id static inline void -_assert_item_available(Eo *item, int new_id, Efl_Ui_Collection_Data *pd) +_assert_item_available(Eo *item, unsigned int new_id, Efl_Ui_Collection_Data *pd) { + EINA_SAFETY_ON_FALSE_RETURN(new_id < eina_list_count(pd->items)); efl_gfx_entity_visible_set(item, EINA_TRUE); efl_gfx_entity_geometry_set(item, efl_ui_position_manager_entity_position_single_item(pd->pos_man, new_id)); }