From 35f188239aef0c770551c532b04c724509a63170 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 6 Sep 2019 11:08:59 +0900 Subject: [PATCH 01/23] edje_edit: Prevent dangling pointer. --- src/lib/edje/edje_edit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index eeb043ab33..ef58e91511 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -454,7 +454,11 @@ _edje_real_part_free(Edje *ed, Edje_Real_Part *rp) rp->custom = NULL; } - free(rp->drag); + if (rp->drag) + { + free(rp->drag); + rp->drag = NULL; + } if (rp->param2) free(rp->param2->set); eina_mempool_free(_edje_real_part_state_mp, rp->param2); From 65be14db240218494930da39da4bcfe916b77aa2 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 6 Sep 2019 11:25:22 +0900 Subject: [PATCH 02/23] eldbus_proxy: Prevent dangling pointer. --- src/lib/eldbus/eldbus_proxy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/eldbus/eldbus_proxy.c b/src/lib/eldbus/eldbus_proxy.c index a28fe9f0e4..955182f4c2 100644 --- a/src/lib/eldbus/eldbus_proxy.c +++ b/src/lib/eldbus/eldbus_proxy.c @@ -148,7 +148,10 @@ _eldbus_proxy_clear(Eldbus_Proxy *proxy) eldbus_cbs_free_dispatch(&(proxy->cbs_free), proxy); if (proxy->props) - eina_hash_free(proxy->props); + { + eina_hash_free(proxy->props); + proxy->props = NULL; + } proxy->refcount = 0; } From 0c801b0d120a5ee8e01c5c323a56a9e07503bf51 Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Fri, 6 Sep 2019 09:20:13 +0200 Subject: [PATCH 03/23] efl_ui_table: update recalc boolean in child delete callback Test Plan: 1. elementary_test -to 'efl.ui.table (linear api)' 2. Click `Append` button 3 times. 3. Click `appended 6` button to delete 4. Click `Append` button. 5. Check that `appended 7` button position (1,1). Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9856 --- src/lib/elementary/efl_ui_table.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 7ed1635db4..2c24c73fb1 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -58,6 +58,14 @@ _on_child_del(void *data, const Efl_Event *event) gi = _efl_ui_table_item_date_get(table, pd, event->object); if (!gi) return; + if ((gi->col == pd->last_col) && (gi->row == pd->last_row)) + pd->linear_recalc = EINA_TRUE; + + if (gi->col + gi->col_span >= pd->cols) + pd->cols_recalc = EINA_TRUE; + if (gi->row + gi->row_span >= pd->rows) + pd->rows_recalc = EINA_TRUE; + pd->items = (Table_Item *) eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi)); free(gi); From ae29408b86eaf8f6f324baff0312b336d56b1efc Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Fri, 6 Sep 2019 09:29:09 +0200 Subject: [PATCH 04/23] efl_ui_table: respect col,row span in last_position calculation Summary: col,row spen is needed to get correct last_position. Thanks to segfaultxavi for refporting. ref T8182 Test Plan: https://git.enlightenment.org/tools/examples.git/tree/reference/c/ui/src/ui_container.c Check that long button and small button are not overlapped. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8182 Differential Revision: https://phab.enlightenment.org/D9854 --- src/lib/elementary/efl_ui_table.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 2c24c73fb1..865fc76577 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -88,6 +88,7 @@ _efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col, Table_Item *gi; int col = -1, row = -1; int req_cols, req_rows; + int item_row, item_col; if (!pd->linear_recalc) { @@ -102,17 +103,20 @@ _efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col, { EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi) { - if ((gi->row < row) || (req_cols < gi->col) || (req_rows < gi->row)) + item_row = gi->row + gi->row_span - 1; + item_col = gi->col + gi->col_span - 1; + if ((item_row < row) || (req_cols < item_col) || + (req_rows < item_row)) continue; - if (gi->row > row) + if (item_row > row) { - row = gi->row; - col = gi->col; + row = item_row; + col = item_col; } - else if (gi->col > col) + else if (item_col > col) { - col = gi->col; + col = item_col; } } } @@ -120,17 +124,20 @@ _efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col, { EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi) { - if ((gi->col < col) || (req_cols < gi->col) || (req_rows < gi->row)) + item_row = gi->row + gi->row_span - 1; + item_col = gi->col + gi->col_span - 1; + if ((item_col < col) || (req_cols < item_col) || + (req_rows < item_row)) continue; - if (gi->col > col) + if (item_col > col) { - col = gi->col; - row = gi->row; + col = item_col; + row = item_row; } - else if (gi->row > row) + else if (item_row > row) { - row = gi->row; + row = item_row; } } } From 690dd5d33a39aec8537dbab3321a75e506b306de Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 6 Sep 2019 17:41:52 +0900 Subject: [PATCH 05/23] ector: code refactoring. Current vector drawing requires several methods for compositing, it's shouldnt have only masking but other blending functions such as matte in lottie, porter&duff in android, etc. Previously we didn't specify this method name, just reserved the options and now we started to define the methods with ector_renderer_composite_method() with Efl.Gfx.VG_Composite_Method instead of mask_set(). --- src/lib/ector/ector_renderer.c | 8 +- src/lib/ector/ector_renderer.eo | 8 +- .../software/ector_renderer_software_image.c | 28 +-- .../software/ector_renderer_software_image.eo | 2 +- .../software/ector_renderer_software_shape.c | 32 +-- .../software/ector_renderer_software_shape.eo | 2 +- .../ector/software/ector_software_private.h | 8 +- .../software/ector_software_rasterizer.c | 137 ++++++------- src/lib/efl/interfaces/efl_gfx_types.eot | 11 + src/lib/evas/canvas/efl_canvas_vg_container.c | 192 ++++++++---------- .../evas/canvas/efl_canvas_vg_container.eo | 2 +- .../canvas/efl_canvas_vg_gradient_linear.c | 6 +- .../canvas/efl_canvas_vg_gradient_radial.c | 6 +- src/lib/evas/canvas/efl_canvas_vg_image.c | 6 +- src/lib/evas/canvas/efl_canvas_vg_node.c | 8 +- src/lib/evas/canvas/efl_canvas_vg_node.eo | 8 +- .../canvas/efl_canvas_vg_node_eo.legacy.c | 4 +- src/lib/evas/canvas/efl_canvas_vg_object.c | 4 +- src/lib/evas/canvas/efl_canvas_vg_shape.c | 12 +- src/lib/evas/canvas/evas_vg_private.h | 28 +-- src/static_libs/vg_common/vg_common_json.c | 39 ++-- 21 files changed, 258 insertions(+), 293 deletions(-) diff --git a/src/lib/ector/ector_renderer.c b/src/lib/ector/ector_renderer.c index d0efab6a6c..15bd96e627 100644 --- a/src/lib/ector/ector_renderer.c +++ b/src/lib/ector/ector_renderer.c @@ -146,10 +146,10 @@ _ector_renderer_crc_get(const Eo *obj EINA_UNUSED, } static void -_ector_renderer_mask_set(Eo *obj EINA_UNUSED, - Ector_Renderer_Data *pd EINA_UNUSED, - Ector_Buffer *mask EINA_UNUSED, - int op EINA_UNUSED) +_ector_renderer_comp_method_set(Eo *obj EINA_UNUSED, + Ector_Renderer_Data *pd EINA_UNUSED, + Ector_Buffer *comp EINA_UNUSED, + Efl_Gfx_Vg_Composite_Method method EINA_UNUSED) { } diff --git a/src/lib/ector/ector_renderer.eo b/src/lib/ector/ector_renderer.eo index 4d7279aebd..74d0f8bd43 100644 --- a/src/lib/ector/ector_renderer.eo +++ b/src/lib/ector/ector_renderer.eo @@ -78,13 +78,13 @@ abstract @beta Ector.Renderer extends Efl.Object return: uint; [[CRC value]] } } - @property mask { - [[Set Mask Image to this Renderer]] + @property comp_method { + [[Set Composite Buffer to this Renderer]] set { } values { - mask: Ector.Buffer; [[Mask Image Buffer]] - op: int; [[Masking option]] + comp: Ector.Buffer; [[Composite Buffer]] + method: Efl.Gfx.Vg_Composite_Method; [[Composite method]] } } draw @pure_virtual { diff --git a/src/lib/ector/software/ector_renderer_software_image.c b/src/lib/ector/software/ector_renderer_software_image.c index cb8d93ad6c..e06e79d574 100644 --- a/src/lib/ector/software/ector_renderer_software_image.c +++ b/src/lib/ector/software/ector_renderer_software_image.c @@ -21,10 +21,10 @@ struct _Ector_Renderer_Software_Image_Data Ector_Software_Surface_Data *surface; Ector_Renderer_Image_Data *image; Ector_Renderer_Data *base; - Ector_Buffer *mask; - int mask_op; - int opacity; - Eina_Matrix3 inv_m; + Ector_Buffer *comp; + Efl_Gfx_Vg_Composite_Method comp_method; + int opacity; + Eina_Matrix3 inv_m; struct { int x1, y1, x2, y2; } boundary; @@ -101,7 +101,7 @@ _ector_renderer_software_image_ector_renderer_draw(Eo *obj EINA_UNUSED, return EINA_TRUE; const int pix_stride = pd->surface->rasterizer->fill_data.raster_buffer->stride / 4; - Ector_Software_Buffer_Base_Data *mask = pd->mask ? efl_data_scope_get(pd->mask, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL; + Ector_Software_Buffer_Base_Data *comp = pd->comp ? efl_data_scope_get(pd->comp, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL; Ector_Software_Buffer_Base_Data *bpd = efl_data_scope_get(pd->image->buffer, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN); double im11, im12, im21, im22, im31, im32; uint32_t *dst_buf, *src_buf; @@ -128,10 +128,10 @@ _ector_renderer_software_image_ector_renderer_draw(Eo *obj EINA_UNUSED, continue; uint32_t *src = src_buf + (rx + (ry * image_w)); //FIXME: use to stride uint32_t temp = 0x0; - if (mask) + if (comp) { - uint32_t *m = mask->pixels.u32 + ((int)local_x + ((int)local_y * mask->generic->w)); - //FIXME : This masking can work only matte case. + uint32_t *m = comp->pixels.u32 + ((int)local_x + ((int)local_y * comp->generic->w)); + //FIXME : This comping can work only matte case. // We need consider to inverse matte case. temp = draw_mul_256((((*m)>>24) * pd->opacity)>>8, *src); } @@ -182,13 +182,13 @@ _ector_renderer_software_image_ector_renderer_crc_get(const Eo *obj, } static void -_ector_renderer_software_image_ector_renderer_mask_set(Eo *obj EINA_UNUSED, - Ector_Renderer_Software_Image_Data *pd, - Ector_Buffer *mask, - int op) +_ector_renderer_software_image_ector_renderer_comp_method_set(Eo *obj EINA_UNUSED, + Ector_Renderer_Software_Image_Data *pd, + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method method) { - pd->mask = mask; - pd->mask_op = op; + pd->comp = comp; + pd->comp_method = method; } #include "ector_renderer_software_image.eo.c" diff --git a/src/lib/ector/software/ector_renderer_software_image.eo b/src/lib/ector/software/ector_renderer_software_image.eo index 8a3f9c51e7..477170242b 100644 --- a/src/lib/ector/software/ector_renderer_software_image.eo +++ b/src/lib/ector/software/ector_renderer_software_image.eo @@ -5,7 +5,7 @@ class @beta Ector.Renderer.Software.Image extends Ector.Renderer.Software implem implements { Ector.Renderer.prepare; Ector.Renderer.draw; - Ector.Renderer.mask { set; } + Ector.Renderer.comp_method { set; } Ector.Renderer.crc { get; } Efl.Object.constructor; Efl.Object.destructor; diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c index 6210179b03..601d03cf9f 100644 --- a/src/lib/ector/software/ector_renderer_software_shape.c +++ b/src/lib/ector/software/ector_renderer_software_shape.c @@ -38,8 +38,8 @@ struct _Ector_Renderer_Software_Shape_Data Shape_Rle_Data *shape_data; Shape_Rle_Data *outline_data; - Ector_Buffer *mask; - int mask_op; + Ector_Buffer *comp; + Efl_Gfx_Vg_Composite_Method comp_method; Ector_Software_Shape_Task *task; @@ -675,8 +675,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj, ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, x, y, mul_col, op, pd->shape_data, - pd->mask, - pd->mask_op); + pd->comp, + pd->comp_method); } else { @@ -690,8 +690,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj, ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, x, y, mul_col, op, pd->shape_data, - pd->mask, - pd->mask_op); + pd->comp, + pd->comp_method); } } @@ -703,8 +703,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj, ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, x, y, mul_col, op, pd->outline_data, - pd->mask, - pd->mask_op); + pd->comp, + pd->comp_method); } else { @@ -718,8 +718,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj, ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, x, y, mul_col, op, pd->outline_data, - pd->mask, - pd->mask_op); + pd->comp, + pd->comp_method); } } @@ -829,14 +829,14 @@ _ector_renderer_software_shape_ector_renderer_crc_get(const Eo *obj, } static void -_ector_renderer_software_shape_ector_renderer_mask_set(Eo *obj EINA_UNUSED, - Ector_Renderer_Software_Shape_Data *pd, - Ector_Buffer *mask, - int op) +_ector_renderer_software_shape_ector_renderer_comp_method_set(Eo *obj EINA_UNUSED, + Ector_Renderer_Software_Shape_Data *pd, + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method method) { //Use ref/unref. - pd->mask = mask; - pd->mask_op = op; + pd->comp = comp; + pd->comp_method = method; } #include "ector_renderer_software_shape.eo.c" diff --git a/src/lib/ector/software/ector_renderer_software_shape.eo b/src/lib/ector/software/ector_renderer_software_shape.eo index 4ea56f9260..83b87c0121 100644 --- a/src/lib/ector/software/ector_renderer_software_shape.eo +++ b/src/lib/ector/software/ector_renderer_software_shape.eo @@ -6,7 +6,7 @@ class @beta Ector.Renderer.Software.Shape extends Ector.Renderer.Software implem Ector.Renderer.prepare; Ector.Renderer.draw; Ector.Renderer.Software.op_fill; - Ector.Renderer.mask { set; } + Ector.Renderer.comp_method { set; } Ector.Renderer.crc { get; } Efl.Gfx.Path.commit; Efl.Object.constructor; diff --git a/src/lib/ector/software/ector_software_private.h b/src/lib/ector/software/ector_software_private.h index f7e47fed22..24fe240f58 100644 --- a/src/lib/ector/software/ector_software_private.h +++ b/src/lib/ector/software/ector_software_private.h @@ -83,8 +83,8 @@ typedef struct _Span_Data int offx, offy; Clip_Data clip; - Ector_Software_Buffer_Base_Data *mask; - int mask_op; + Ector_Software_Buffer_Base_Data *comp; + Efl_Gfx_Vg_Composite_Method comp_method; Eina_Matrix3 inv; Span_Data_Type type; Eina_Bool fast_matrix; @@ -136,8 +136,8 @@ void ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer, int x, int y, uint32_t mul_col, Efl_Gfx_Render_Op op, Shape_Rle_Data* rle, - Ector_Buffer *mask, - int mask_op); + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method); void ector_software_rasterizer_destroy_rle_data(Shape_Rle_Data *rle); diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index ad4aa25e70..8cd085432a 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -11,21 +11,6 @@ #include "draw.h" -//FIXME: This enum add temporarily to help understanding of additional code -//related to masking in prepare_mask. -//This needs to be formally declared through the eo class. -typedef enum _EFL_CANVAS_VG_NODE_BLEND_TYPE -{ - EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE = 0, - EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA, - EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE -}EFL_CANVAS_VG_NODE_BLEND_TYPE; -// - static void _blend_argb(int count, const SW_FT_Span *spans, void *user_data) { @@ -49,12 +34,12 @@ _blend_argb(int count, const SW_FT_Span *spans, void *user_data) } static void -_blend_alpha(int count, const SW_FT_Span *spans, void *user_data) +_comp_matte_alpha(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - if (!mask || !mask->pixels.u32) return; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + if (!comp || !comp->pixels.u32) return; // multiply the color with mul_col if any uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); @@ -63,7 +48,7 @@ _blend_alpha(int count, const SW_FT_Span *spans, void *user_data) // move to the offset location uint32_t *buffer = sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx); - uint32_t *mbuffer = mask->pixels.u32; + uint32_t *mbuffer = comp->pixels.u32; //Temp buffer for intermediate processing int tsize = sd->raster_buffer->generic->w; @@ -73,12 +58,12 @@ _blend_alpha(int count, const SW_FT_Span *spans, void *user_data) { uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x); uint32_t *mtarget = - mbuffer + ((mask->generic->w * spans->y) + spans->x); + mbuffer + ((comp->generic->w * spans->y) + spans->x); uint32_t *temp = tbuffer; memset(temp, 0x00, sizeof(uint32_t) * spans->len); comp_func(temp, spans->len, color, spans->coverage); - //masking + //composite for (int i = 0; i < spans->len; i++) { *temp = draw_mul_256(((*mtarget)>>24), *temp); @@ -93,12 +78,12 @@ _blend_alpha(int count, const SW_FT_Span *spans, void *user_data) } static void -_blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) +_comp_matte_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - if (!mask || !mask->pixels.u32) return; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + if (!comp || !comp->pixels.u32) return; // multiply the color with mul_col if any uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); @@ -107,7 +92,7 @@ _blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) // move to the offset location uint32_t *buffer = sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx); - uint32_t *mbuffer = mask->pixels.u32; + uint32_t *mbuffer = comp->pixels.u32; //Temp buffer for intermediate processing int tsize = sd->raster_buffer->generic->w; @@ -117,12 +102,12 @@ _blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) { uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x); uint32_t *mtarget = - mbuffer + ((mask->generic->w * spans->y) + spans->x); + mbuffer + ((comp->generic->w * spans->y) + spans->x); uint32_t *temp = tbuffer; memset(temp, 0x00, sizeof(uint32_t) * spans->len); comp_func(temp, spans->len, color, spans->coverage); - //masking + //composite for (int i = 0; i < spans->len; i++) { if (*mtarget) @@ -138,22 +123,22 @@ _blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) } static void -_blend_mask_add(int count, const SW_FT_Span *spans, void *user_data) +_comp_mask_add(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - if (!mask || !mask->pixels.u32) return; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + if (!comp || !comp->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); - uint32_t *mbuffer = mask->pixels.u32; + uint32_t *mbuffer = comp->pixels.u32; int tsize = sd->raster_buffer->generic->w; uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); while (count--) { - uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); comp_func(ttarget, spans->len, color, spans->coverage); for (int i = 0; i < spans->len; i++) @@ -163,22 +148,22 @@ _blend_mask_add(int count, const SW_FT_Span *spans, void *user_data) } static void -_blend_mask_sub(int count, const SW_FT_Span *spans, void *user_data) +_comp_mask_sub(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - if (!mask || !mask->pixels.u32) return; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + if (!comp || !comp->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); - uint32_t *mbuffer = mask->pixels.u32; + uint32_t *mbuffer = comp->pixels.u32; int tsize = sd->raster_buffer->generic->w; uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); while (count--) { - uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); comp_func(ttarget, spans->len, color, spans->coverage); for (int i = 0; i < spans->len; i++) @@ -189,28 +174,28 @@ _blend_mask_sub(int count, const SW_FT_Span *spans, void *user_data) static void -_blend_mask_ins(int count, const SW_FT_Span *spans, void *user_data) +_comp_mask_ins(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - if (!mask || !mask->pixels.u32) return; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + if (!comp || !comp->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); - uint32_t *mbuffer = mask->pixels.u32; + uint32_t *mbuffer = comp->pixels.u32; int tsize = sd->raster_buffer->generic->w; uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); - for(unsigned int y = 0; y < mask->generic->h; y++) + for(unsigned int y = 0; y < comp->generic->h; y++) { - for(unsigned int x = 0; x < mask->generic->w; x++) + for(unsigned int x = 0; x < comp->generic->w; x++) { - if (x == (unsigned int)spans->x && x + spans->len <= mask->generic->w && + if (x == (unsigned int)spans->x && x + spans->len <= comp->generic->w && y == (unsigned int)spans->y && count > 0) { memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); - uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); comp_func(ttarget, spans->len, color, spans->coverage); for (int c = 0; c < spans->len; c++) mtarget[c] = draw_mul_256(ttarget[c]>>24, mtarget[c]); @@ -220,7 +205,7 @@ _blend_mask_ins(int count, const SW_FT_Span *spans, void *user_data) } else { - mbuffer[x + (mask->generic->w * y)] = (0x00FFFFFF & mbuffer[x + (mask->generic->w * y)]); + mbuffer[x + (comp->generic->w * y)] = (0x00FFFFFF & mbuffer[x + (comp->generic->w * y)]); } } } @@ -228,15 +213,15 @@ _blend_mask_ins(int count, const SW_FT_Span *spans, void *user_data) static void -_blend_mask_diff(int count, const SW_FT_Span *spans, void *user_data) +_comp_mask_diff(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - if (!mask || !mask->pixels.u32) return; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + if (!comp || !comp->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); - uint32_t *mbuffer = mask->pixels.u32; + uint32_t *mbuffer = comp->pixels.u32; int tsize = sd->raster_buffer->generic->w; uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); @@ -244,7 +229,7 @@ _blend_mask_diff(int count, const SW_FT_Span *spans, void *user_data) while (count--) { memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); - uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); comp_func(ttarget, spans->len, color, spans->coverage); for (int i = 0; i < spans->len; i++) mtarget[i] = draw_mul_256(0xFF - (mtarget[i]>>24), ttarget[i]) + draw_mul_256(0xFF - (ttarget[i]>>24), mtarget[i]); @@ -309,8 +294,8 @@ _blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data) if (!fetchfunc) return; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - uint32_t *mbuffer = mask->pixels.u32; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + uint32_t *mbuffer = comp->pixels.u32; // move to the offset location buffer = sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx); @@ -318,7 +303,7 @@ _blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data) while (count--) { uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x); - uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); int length = spans->len; while (length) @@ -358,8 +343,8 @@ _blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) if (!fetchfunc) return; - Ector_Software_Buffer_Base_Data *mask = sd->mask; - uint32_t *mbuffer = mask->pixels.u32; + Ector_Software_Buffer_Base_Data *comp = sd->comp; + uint32_t *mbuffer = comp->pixels.u32; // move to the offset location buffer = sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx); @@ -367,7 +352,7 @@ _blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) while (count--) { uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x); - uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); + uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); int length = spans->len; while (length) @@ -584,38 +569,38 @@ static void _adjust_span_fill_methods(Span_Data *spdata) { //Blending Function - if (spdata->mask) + if (spdata->comp) { - switch (spdata->mask_op) + switch (spdata->comp_method) { default: - case EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA: + case EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA: if (spdata->type == Solid) - spdata->unclipped_blend = &_blend_alpha; + spdata->unclipped_blend = &_comp_matte_alpha; else if (spdata->type == LinearGradient || spdata->type == RadialGradient) spdata->unclipped_blend = &_blend_gradient_alpha; else //None spdata->unclipped_blend = NULL; break; - case EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV: + case EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA_INVERSE: if (spdata->type == Solid) - spdata->unclipped_blend = &_blend_alpha_inv; + spdata->unclipped_blend = &_comp_matte_alpha_inv; else if (spdata->type == LinearGradient || spdata->type == RadialGradient) spdata->unclipped_blend = &_blend_gradient_alpha_inv; else //None spdata->unclipped_blend = NULL; break; - case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD: - spdata->unclipped_blend = &_blend_mask_add; + case EFL_GFX_VG_COMPOSITE_METHOD_MASK_ADD: + spdata->unclipped_blend = &_comp_mask_add; break; - case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT: - spdata->unclipped_blend = &_blend_mask_sub; + case EFL_GFX_VG_COMPOSITE_METHOD_MASK_SUBSTRACT: + spdata->unclipped_blend = &_comp_mask_sub; break; - case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT: - spdata->unclipped_blend = &_blend_mask_ins; + case EFL_GFX_VG_COMPOSITE_METHOD_MASK_INTERSECT: + spdata->unclipped_blend = &_comp_mask_ins; break; - case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE: - spdata->unclipped_blend = &_blend_mask_diff; + case EFL_GFX_VG_COMPOSITE_METHOD_MASK_DIFFERENCE: + spdata->unclipped_blend = &_comp_mask_diff; break; } } @@ -895,8 +880,8 @@ void ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer, int x, int y, uint32_t mul_col, Efl_Gfx_Render_Op op, Shape_Rle_Data* rle, - Ector_Buffer *mask, - int mask_op) + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method) { if (!rle) return; if (!rasterizer->fill_data.raster_buffer->pixels.u32) return; @@ -905,9 +890,9 @@ ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer, rasterizer->fill_data.offy = y; rasterizer->fill_data.mul_col = mul_col; rasterizer->fill_data.op = op; - rasterizer->fill_data.mask = - mask ? efl_data_scope_get(mask, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL; - rasterizer->fill_data.mask_op = mask_op; + rasterizer->fill_data.comp = + comp ? efl_data_scope_get(comp, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL; + rasterizer->fill_data.comp_method = comp_method; _setup_span_fill_matrix(rasterizer); _adjust_span_fill_methods(&rasterizer->fill_data); diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot index 0f2954b954..ecc0588b1d 100644 --- a/src/lib/efl/interfaces/efl_gfx_types.eot +++ b/src/lib/efl/interfaces/efl_gfx_types.eot @@ -141,6 +141,17 @@ struct @beta Efl.Gfx.Shape_Public stroke: Efl.Gfx.Stroke; [[Internal representation as stroke]] } +enum @beta Efl.Gfx.Vg_Composite_Method +{ + none, + matte_alpha, + matte_alpha_inverse, + mask_add, + mask_substract, + mask_intersect, + mask_difference +} + enum @beta Efl.Gfx.Border_Fill_Mode { [[How an image's center region (the complement to the border region) should be rendered by EFL]] diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.c b/src/lib/evas/canvas/efl_canvas_vg_container.c index 2daa65fb80..e265e33e11 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.c +++ b/src/lib/evas/canvas/efl_canvas_vg_container.c @@ -5,23 +5,6 @@ #define MY_CLASS EFL_CANVAS_VG_CONTAINER_CLASS - -//FIXME: This enum add temporarily to help understanding of additional code -//related to masking in prepare_mask. -//This needs to be formally declared through the eo class. -//This is a list of blending supported via efl_canvas_vg_node_mask_set(). -typedef enum _EFL_CANVAS_VG_NODE_BLEND_TYPE -{ - EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE = 0, - EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA, - EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE -}EFL_CANVAS_VG_NODE_BLEND_TYPE; -// - static void _invalidate_cb(void *data EINA_UNUSED, const Efl_Event *event) { @@ -40,7 +23,7 @@ _invalidate_cb(void *data EINA_UNUSED, const Efl_Event *event) } static void -_draw_mask(Evas_Object_Protected_Data *obj, Efl_VG *node, +_draw_comp(Evas_Object_Protected_Data *obj, Efl_VG *node, Ector_Surface *ector, void *engine, void *output, void *context) { @@ -51,11 +34,11 @@ _draw_mask(Evas_Object_Protected_Data *obj, Efl_VG *node, Efl_Canvas_Vg_Container_Data *cd = efl_data_scope_get(node, EFL_CANVAS_VG_CONTAINER_CLASS); - //Draw Mask Image. + //Draw Composite Image. Efl_VG *child; Eina_List *l; EINA_LIST_FOREACH(cd->children, l, child) - _draw_mask(obj, child, ector, engine, output, context); + _draw_comp(obj, child, ector, engine, output, context); } else { @@ -65,93 +48,94 @@ _draw_mask(Evas_Object_Protected_Data *obj, Efl_VG *node, } static Ector_Buffer * -_prepare_mask(Evas_Object_Protected_Data *obj, //vector object - Efl_Canvas_Vg_Node* mask_obj, +_prepare_comp(Evas_Object_Protected_Data *obj, //vector object + Efl_Canvas_Vg_Node* comp_target, void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *ptransform, Eina_Matrix3 *ctransform, - Ector_Buffer *mask, - int mask_op) + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method) { - Efl_Canvas_Vg_Container_Data *pd = efl_data_scope_get(mask_obj, MY_CLASS); + Efl_Canvas_Vg_Container_Data *pd = efl_data_scope_get(comp_target, MY_CLASS); Efl_Canvas_Vg_Node_Data *nd = - efl_data_scope_get(mask_obj, EFL_CANVAS_VG_NODE_CLASS); - if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return pd->mask.buffer; + efl_data_scope_get(comp_target, EFL_CANVAS_VG_NODE_CLASS); + if (nd->flags == EFL_GFX_CHANGE_FLAG_NONE) return pd->comp.buffer; uint32_t init_buffer = 0x0; - //1. Mask Size + //1. Composite Size Eina_Rect mbound; mbound.x = 0; mbound.y = 0; mbound.w = obj->cur->geometry.w; mbound.h = obj->cur->geometry.h; - //FIXME: If mask typs is SUBSTRACT or INTERSECT, buffer fills in white color(Full alpha color). - if (pd->mask.option == EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT || pd->mask.option == EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT) + //FIXME: If composite method is SUBSTRACT or INTERSECT, buffer fills in white color(Full alpha color). + if (pd->comp.method == EFL_GFX_VG_COMPOSITE_METHOD_MASK_SUBSTRACT || + pd->comp.method == EFL_GFX_VG_COMPOSITE_METHOD_MASK_INTERSECT) init_buffer = 0xFFFFFFFF; //2. Reusable ector buffer? - if (!pd->mask.buffer || (pd->mask.bound.w != mbound.w) || - (pd->mask.bound.h != mbound.h)) + if (!pd->comp.buffer || (pd->comp.bound.w != mbound.w) || + (pd->comp.bound.h != mbound.h)) { - if (pd->mask.pixels) free(pd->mask.pixels); - if (pd->mask.buffer) efl_unref(pd->mask.buffer); - pd->mask.pixels = malloc(sizeof(uint32_t) * (mbound.w * mbound.h)); - memset(pd->mask.pixels, init_buffer, sizeof(uint32_t) * (mbound.w * mbound.h)); - pd->mask.buffer = ENFN->ector_buffer_new(ENC, obj->layer->evas->evas, + if (pd->comp.pixels) free(pd->comp.pixels); + if (pd->comp.buffer) efl_unref(pd->comp.buffer); + pd->comp.pixels = malloc(sizeof(uint32_t) * (mbound.w * mbound.h)); + memset(pd->comp.pixels, init_buffer, sizeof(uint32_t) * (mbound.w * mbound.h)); + pd->comp.buffer = ENFN->ector_buffer_new(ENC, obj->layer->evas->evas, mbound.w, mbound.h, EFL_GFX_COLORSPACE_ARGB8888, ECTOR_BUFFER_FLAG_DRAWABLE | ECTOR_BUFFER_FLAG_CPU_READABLE | ECTOR_BUFFER_FLAG_CPU_WRITABLE); - ector_buffer_pixels_set(pd->mask.buffer, pd->mask.pixels, + ector_buffer_pixels_set(pd->comp.buffer, pd->comp.pixels, mbound.w, mbound.h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); - pd->mask.bound.w = mbound.w; - pd->mask.bound.h = mbound.h; - pd->mask.vg_pd = obj; + pd->comp.bound.w = mbound.w; + pd->comp.bound.h = mbound.h; + pd->comp.vg_pd = obj; } else { - if (pd->mask.pixels) - memset(pd->mask.pixels, init_buffer, sizeof(uint32_t) * mbound.w * mbound.h); + if (pd->comp.pixels) + memset(pd->comp.pixels, init_buffer, sizeof(uint32_t) * mbound.w * mbound.h); } - pd->mask.bound.x = mbound.x; - pd->mask.bound.y = mbound.y; + pd->comp.bound.x = mbound.x; + pd->comp.bound.y = mbound.y; - if (!pd->mask.buffer) ERR("Mask Buffer is invalid"); + if (!pd->comp.buffer) ERR("Composite Buffer is invalid"); - //FIXME: This code means that there is another masking container. - if (pd->mask.option >= EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD) + //FIXME: This code means that there is another composite container. + if (pd->comp.method >= EFL_GFX_VG_COMPOSITE_METHOD_MASK_ADD) { - Efl_Canvas_Vg_Container_Data *src_pd = pd; - mask = pd->mask.buffer; - for (Efl_VG *mask_src = pd->mask_src; mask_src; mask_src = src_pd->mask_src) + Efl_Canvas_Vg_Container_Data *target_pd = pd; + comp = pd->comp.buffer; + for (Efl_VG *comp_target = pd->comp_target; comp_target; comp_target = target_pd->comp_target) { - Efl_Canvas_Vg_Container_Data *target_pd = NULL; - src_pd = efl_data_scope_get(mask_src, MY_CLASS); - target_pd = efl_data_scope_get(eina_list_nth(src_pd->mask.target, 0), MY_CLASS); - _evas_vg_render_pre(obj, mask_src, + Efl_Canvas_Vg_Container_Data *src_pd = NULL; + target_pd = efl_data_scope_get(comp_target, MY_CLASS); + src_pd = efl_data_scope_get(eina_list_nth(target_pd->comp.src, 0), MY_CLASS); + _evas_vg_render_pre(obj, comp_target, engine, output, context, surface, - ctransform, mask, target_pd->mask.option); + ctransform, comp, src_pd->comp.method); } } //3. Prepare Drawing shapes. - _evas_vg_render_pre(obj, mask_obj, + _evas_vg_render_pre(obj, comp_target, engine, output, context, surface, - ptransform, mask, mask_op); + ptransform, comp, comp_method); - //4. Generating Mask Image. - ector_buffer_pixels_set(surface, pd->mask.pixels, mbound.w, mbound.h, 0, + //4. Generating Composite Image. + ector_buffer_pixels_set(surface, pd->comp.pixels, mbound.w, mbound.h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); ector_surface_reference_point_set(surface, -mbound.x, -mbound.y); - _draw_mask(obj, mask_obj, surface, engine, output, context); + _draw_comp(obj, comp_target, surface, engine, output, context); - return pd->mask.buffer; + return pd->comp.buffer; } static void @@ -161,8 +145,8 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *ptransform, - Ector_Buffer *mask, - int mask_op, + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method, void *data) { Efl_Canvas_Vg_Container_Data *pd = data; @@ -177,27 +161,27 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, EFL_CANVAS_VG_COMPUTE_MATRIX(ctransform, ptransform, nd); - //Container may have mask source. - //FIXME : _prepare_mask() should only work in cases with matte or main mask. - // This condition is valid because the main mask use same type as matte alpha. - if (pd->mask_src && - (pd->mask.option == EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA || - pd->mask.option == EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV)) + //Container may have composite target. + //FIXME : _prepare_comp() should only work in cases with matte or masking. + // This condition is valid because the masking use same type as matte. + if (pd->comp_target && + (pd->comp.method == EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA || + pd->comp.method == EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA_INVERSE)) { - mask_op = pd->mask.option; - mask = _prepare_mask(vg_pd, pd->mask_src, + comp_method = pd->comp.method; + comp = _prepare_comp(vg_pd, pd->comp_target, engine, output, context, surface, - ptransform, ctransform, mask, mask_op); + ptransform, ctransform, comp, comp_method); } EINA_LIST_FOREACH(pd->children, l, child) { - //Don't need to update mask nodes. + //Don't need to update composite nodes. if (efl_isa(child, MY_CLASS)) { Efl_Canvas_Vg_Container_Data *child_cd = efl_data_scope_get(child, MY_CLASS); - if (child_cd->mask.target) continue; + if (child_cd->comp.src) continue; } //Skip Gradients. they will be updated by Shape. @@ -212,7 +196,7 @@ _efl_canvas_vg_container_render_pre(Evas_Object_Protected_Data *vg_pd, _evas_vg_render_pre(vg_pd, child, engine, output, context, surface, - ctransform, mask, mask_op); + ctransform, comp, comp_method); } } @@ -243,12 +227,12 @@ _efl_canvas_vg_container_efl_object_destructor(Eo *obj, if (pd->blend_pixels) free(pd->blend_pixels); if (pd->blend_buffer) efl_unref(pd->blend_buffer); - //Destroy mask surface - if (pd->mask.buffer) efl_unref(pd->mask.buffer); - if (pd->mask.pixels) free(pd->mask.pixels); + //Destroy comp surface + if (pd->comp.buffer) efl_unref(pd->comp.buffer); + if (pd->comp.pixels) free(pd->comp.pixels); - efl_unref(pd->mask_src); - eina_list_free(pd->mask.target); + efl_unref(pd->comp_target); + eina_list_free(pd->comp.src); eina_hash_free(pd->names); efl_destructor(efl_super(obj, MY_CLASS)); @@ -333,14 +317,14 @@ _efl_canvas_vg_container_efl_gfx_path_interpolate(Eo *obj, Efl_Canvas_Vg_Contain if (!r) break; } - //Interpolates Mask + //Interpolates Composite Efl_Canvas_Vg_Container_Data *fromd = efl_data_scope_get(from, MY_CLASS); Efl_Canvas_Vg_Container_Data *tod = efl_data_scope_get(to, MY_CLASS); - if (fromd->mask_src && tod->mask_src && pd->mask_src) + if (fromd->comp_target && tod->comp_target && pd->comp_target) { - if (!efl_gfx_path_interpolate(pd->mask_src, - fromd->mask_src, tod->mask_src, pos_map)) + if (!efl_gfx_path_interpolate(pd->comp_target, + fromd->comp_target, tod->comp_target, pos_map)) return EINA_FALSE; } @@ -351,30 +335,30 @@ _efl_canvas_vg_container_efl_gfx_path_interpolate(Eo *obj, Efl_Canvas_Vg_Contain } static void -_efl_canvas_vg_container_efl_canvas_vg_node_mask_set(Eo *obj, - Efl_Canvas_Vg_Container_Data *pd, - Efl_Canvas_Vg_Node *mask, - int op) +_efl_canvas_vg_container_efl_canvas_vg_node_comp_method_set(Eo *obj, + Efl_Canvas_Vg_Container_Data *pd, + Efl_Canvas_Vg_Node *target, + Efl_Gfx_Vg_Composite_Method method) { - if (pd->mask_src == mask) return; + if (pd->comp_target == target) return; - EINA_SAFETY_ON_FALSE_RETURN(efl_isa(mask, MY_CLASS)); + EINA_SAFETY_ON_FALSE_RETURN(efl_isa(target, MY_CLASS)); - if (pd->mask_src) + if (pd->comp_target) { Efl_Canvas_Vg_Container_Data *pd2 = - efl_data_scope_get(pd->mask_src, MY_CLASS); - pd2->mask.target = eina_list_remove(pd2->mask.target, obj); + efl_data_scope_get(pd->comp_target, MY_CLASS); + pd2->comp.src = eina_list_remove(pd2->comp.src, obj); } - if (mask) + if (target) { - Efl_Canvas_Vg_Container_Data *pd2 = efl_data_scope_get(mask, MY_CLASS); - pd2->mask.target = eina_list_append(pd2->mask.target, obj); + Efl_Canvas_Vg_Container_Data *pd2 = efl_data_scope_get(target, MY_CLASS); + pd2->comp.src = eina_list_append(pd2->comp.src, obj); } - pd->mask.option = op; - efl_replace(&pd->mask_src, mask); + pd->comp.method = method; + efl_replace(&pd->comp_target, target); efl_canvas_vg_node_change(obj); } @@ -400,12 +384,12 @@ _efl_canvas_vg_container_efl_duplicate_duplicate(const Eo *obj, container = efl_duplicate(efl_super(obj, MY_CLASS)); efl_event_callback_add(container, EFL_EVENT_INVALIDATE, _invalidate_cb, NULL); - //Copy Mask - if (pd->mask_src) + //Copy Composite + if (pd->comp_target) { - Eo * mask_src = efl_duplicate(pd->mask_src); - efl_parent_set(mask_src, container); - efl_canvas_vg_node_mask_set(container, mask_src, pd->mask.option); + Eo * comp_target = efl_duplicate(pd->comp_target); + efl_parent_set(comp_target, container); + efl_canvas_vg_node_comp_method_set(container, comp_target, pd->comp.method); } //Copy Children diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.eo b/src/lib/evas/canvas/efl_canvas_vg_container.eo index a987246531..7b1397d447 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_container.eo @@ -21,6 +21,6 @@ class @beta Efl.Canvas.Vg.Container extends Efl.Canvas.Vg.Node Efl.Gfx.Path.bounds_get; Efl.Gfx.Path.interpolate; Efl.Duplicate.duplicate; - Efl.Canvas.Vg.Node.mask { set; } + Efl.Canvas.Vg.Node.comp_method { set; } } } diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c index 0b1435202b..1d4eb6a154 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_linear.c @@ -64,8 +64,8 @@ _efl_canvas_vg_gradient_linear_render_pre(Evas_Object_Protected_Data *vg_pd EINA void *context EINA_UNUSED, Ector_Surface *surface, Eina_Matrix3 *ptransform, - Ector_Buffer *mask, - int mask_op, + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method, void *data) { Efl_Canvas_Vg_Gradient_Linear_Data *pd = data; @@ -94,7 +94,7 @@ _efl_canvas_vg_gradient_linear_render_pre(Evas_Object_Protected_Data *vg_pd EINA efl_gfx_gradient_linear_start_set(nd->renderer, pd->start.x, pd->start.y); efl_gfx_gradient_linear_end_set(nd->renderer, pd->end.x, pd->end.y); ector_renderer_prepare(nd->renderer); - ector_renderer_mask_set(nd->renderer, mask, mask_op); + ector_renderer_comp_method_set(nd->renderer, comp, comp_method); } static Eo * diff --git a/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c index 691dc5dec8..e54df094ba 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c +++ b/src/lib/evas/canvas/efl_canvas_vg_gradient_radial.c @@ -80,8 +80,8 @@ _efl_canvas_vg_gradient_radial_render_pre(Evas_Object_Protected_Data *vg_pd EINA void *context EINA_UNUSED, Ector_Surface *surface, Eina_Matrix3 *ptransform, - Ector_Buffer *mask, - int mask_op, + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method, void *data) { Efl_Canvas_Vg_Gradient_Radial_Data *pd = data; @@ -111,7 +111,7 @@ _efl_canvas_vg_gradient_radial_render_pre(Evas_Object_Protected_Data *vg_pd EINA efl_gfx_gradient_radial_focal_set(nd->renderer, pd->focal.x, pd->focal.y); efl_gfx_gradient_radial_radius_set(nd->renderer, pd->radius); ector_renderer_prepare(nd->renderer); - ector_renderer_mask_set(nd->renderer, mask, mask_op); + ector_renderer_comp_method_set(nd->renderer, comp, comp_method); } static Eo * diff --git a/src/lib/evas/canvas/efl_canvas_vg_image.c b/src/lib/evas/canvas/efl_canvas_vg_image.c index d008fd74f9..2b99efbaef 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_image.c +++ b/src/lib/evas/canvas/efl_canvas_vg_image.c @@ -21,8 +21,8 @@ _efl_canvas_vg_image_render_pre(Evas_Object_Protected_Data *vg_pd, void *engine EINA_UNUSED, void *output EINA_UNUSED, void *context EINA_UNUSED, Ector_Surface *surface, Eina_Matrix3 *ptransform, - Ector_Buffer *mask, - int mask_op, + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method, void *data) { Efl_Canvas_Vg_Image_Data *pd = data; @@ -63,7 +63,7 @@ _efl_canvas_vg_image_render_pre(Evas_Object_Protected_Data *vg_pd, ector_renderer_color_set(nd->renderer, nd->r, nd->g, nd->b, nd->a); ector_renderer_visibility_set(nd->renderer, nd->visibility); - ector_renderer_mask_set(nd->renderer, mask, mask_op); + ector_renderer_comp_method_set(nd->renderer, comp, comp_method); ector_renderer_prepare(nd->renderer); } diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.c b/src/lib/evas/canvas/efl_canvas_vg_node.c index 95dcdc5152..5064407f03 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node.c +++ b/src/lib/evas/canvas/efl_canvas_vg_node.c @@ -73,10 +73,10 @@ _efl_canvas_vg_node_transformation_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg_ } static void -_efl_canvas_vg_node_mask_set(Eo *obj EINA_UNUSED, - Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED, - Efl_Canvas_Vg_Node *mask EINA_UNUSED, - int op EINA_UNUSED) +_efl_canvas_vg_node_comp_method_set(Eo *obj EINA_UNUSED, + Efl_Canvas_Vg_Node_Data *pd EINA_UNUSED, + Efl_Canvas_Vg_Node *target EINA_UNUSED, + Efl_Gfx_Vg_Composite_Method method EINA_UNUSED) { } diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.eo b/src/lib/evas/canvas/efl_canvas_vg_node.eo index e8846fb0c3..a0cbb5d85d 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_node.eo @@ -36,13 +36,13 @@ abstract @beta Efl.Canvas.Vg.Node extends Efl.Object y: double; [[$origin y position.]] } } - @property mask { - [[Set Mask Node to this renderer]] + @property comp_method { + [[Set a composite target node to this node object.]] set { } values { - mask: Efl.Canvas.Vg.Node; [[Mask object]] - op: int; [[Masking Option. Reserved]] + target: Efl.Canvas.Vg.Node; [[Composite target node]] + method: Efl.Gfx.Vg_Composite_Method; [[Composite Method.]] } } } diff --git a/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c b/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c index eda76165cb..559434b294 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c +++ b/src/lib/evas/canvas/efl_canvas_vg_node_eo.legacy.c @@ -24,7 +24,7 @@ evas_vg_node_origin_get(const Efl_Canvas_Vg_Node *obj, double *x, double *y) } EAPI void -evas_vg_node_mask_set(Efl_Canvas_Vg_Node *obj, Efl_Canvas_Vg_Node *mask, int op) +evas_vg_node_mask_set(Efl_Canvas_Vg_Node *obj, Efl_Canvas_Vg_Node *mask, int op EINA_UNUSED) { - efl_canvas_vg_node_mask_set(obj, mask, op); + efl_canvas_vg_node_comp_method_set(obj, mask, 0); } diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index a0bcc1ec8f..1617bc1025 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -396,7 +396,7 @@ _evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd, Eina_List *l; Efl_Canvas_Vg_Container_Data *cd = efl_data_scope_get(node, EFL_CANVAS_VG_CONTAINER_CLASS); - if (cd->mask.target) return; //Don't draw mask itself. + if (cd->comp.src) return; //Don't draw composite target itself. int alpha = 255; efl_gfx_color_get(node, NULL, NULL, NULL, &alpha); @@ -508,7 +508,7 @@ _render_to_buffer(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd evas_common_draw_context_set_render_op(context, _EVAS_RENDER_COPY); evas_common_draw_context_set_color(context, 255, 255, 255, 255); - //ector begin - end for drawing mask images. + //ector begin - end for drawing composite images. //ENFN->ector_begin(engine, buffer, context, ector, 0, 0, EINA_FALSE, EINA_FALSE); _evas_vg_render_pre(obj, root, engine, buffer, context, ector, NULL, NULL, 0); //ENFN->ector_end(engine, buffer, context, ector, EINA_FALSE); diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index fa22b6a3e7..4abdb13af8 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -78,8 +78,8 @@ _efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data *vg_pd, void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *ptransform, - Ector_Buffer *mask, - int mask_op, + Ector_Buffer *comp, + Efl_Gfx_Vg_Composite_Method comp_method, void *data) { Efl_Canvas_Vg_Shape_Data *pd = data; @@ -93,13 +93,13 @@ _efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data *vg_pd, fill = _evas_vg_render_pre(vg_pd, pd->fill, engine, output, context, - surface, ctransform, mask, mask_op); + surface, ctransform, comp, comp_method); stroke_fill = _evas_vg_render_pre(vg_pd, pd->stroke.fill, engine, output, context, - surface, ctransform, mask, mask_op); + surface, ctransform, comp, comp_method); stroke_marker = _evas_vg_render_pre(vg_pd, pd->stroke.marker, engine, output, context, - surface, ctransform, mask, mask_op); + surface, ctransform, comp, comp_method); if (!nd->renderer) { @@ -117,7 +117,7 @@ _efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data *vg_pd, efl_gfx_path_copy_from(nd->renderer, obj); efl_gfx_path_commit(nd->renderer); ector_renderer_prepare(nd->renderer); - ector_renderer_mask_set(nd->renderer, mask, mask_op); + ector_renderer_comp_method_set(nd->renderer, comp, comp_method); } static Eo * diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index 0fad40d15c..d8a07b24f1 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -67,7 +67,7 @@ struct _Efl_Canvas_Vg_Node_Data void (*render_pre)(Evas_Object_Protected_Data *vg_pd, Efl_VG *node, Efl_Canvas_Vg_Node_Data *nd, void *engine, void *output, void *contenxt, Ector_Surface *surface, - Eina_Matrix3 *ptransform, Ector_Buffer *mask, int mask_op, void *data); + Eina_Matrix3 *ptransform, Ector_Buffer *comp, Efl_Gfx_Vg_Composite_Method comp_method, void *data); void *data; double x, y; @@ -78,24 +78,24 @@ struct _Efl_Canvas_Vg_Node_Data Eina_Bool changed : 1; }; -typedef struct _Vg_Mask +typedef struct _Vg_Composite { - Evas_Object_Protected_Data *vg_pd; //Vector Object (for accessing backend engine) - Ector_Buffer *buffer; //Mask Ector Buffer - void *pixels; //Mask pixel buffer (actual data) - Eina_Rect bound; //Mask boundary - Eina_List *target; //Mask target - int option; //Mask option -} Vg_Mask; + Evas_Object_Protected_Data *vg_pd; //Vector Object (for accessing backend engine) + Ector_Buffer *buffer; //Composite Ector Buffer + void *pixels; //Composite pixel buffer (actual data) + Eina_Rect bound; //Composite boundary + Eina_List *src; //Composite Sources + Efl_Gfx_Vg_Composite_Method method; //Composite Method +} Vg_Comp; struct _Efl_Canvas_Vg_Container_Data { Eina_List *children; Eina_Hash *names; - //Masking feature. - Efl_Canvas_Vg_Node *mask_src; //Mask Source - Vg_Mask mask; //Mask source data + //Composite feature. + Efl_Canvas_Vg_Node *comp_target; //Composite target + Vg_Comp comp; //Composite target data //Layer transparency feature. This buffer is only valid when the layer has transparency. Ector_Buffer *blend_buffer; @@ -150,13 +150,13 @@ _evas_vg_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *child, void *engine, void *output, void *context, Ector_Surface *surface, Eina_Matrix3 *transform, - Ector_Buffer *mask, int mask_op) + Ector_Buffer *comp, Efl_Gfx_Vg_Composite_Method comp_method) { if (!child) return NULL; Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS); if (nd) nd->render_pre(vg_pd, child, nd, engine, output, context, surface, - transform, mask, mask_op, nd->data); + transform, comp, comp_method, nd->data); return nd; } diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index 27fc86e7e6..910a4055e1 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -9,21 +9,6 @@ #include -//FIXME: This enum add temporarily to help understanding of additional code -//related to masking in prepare_mask. -//This needs to be formally declared through the eo class. -typedef enum _EFL_CANVAS_VG_NODE_BLEND_TYPE -{ - EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE = 0, - EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA, - EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT, - EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE -}EFL_CANVAS_VG_NODE_BLEND_TYPE; -// - static char* _get_key_val(void *key) { @@ -311,10 +296,10 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int efl_key_data_set(mtarget, key, msource); } - //FIXME : EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA option is temporary - //Currently matte alpha implemtnes is same the mask intersect impletment. + //FIXME : EFL_GFX_VG_COMPOSITE_METHOD_ALPHA option is temporary + //Currently matte alpha implements is same the mask intersect implement. //It has been implemented as a multiplication calculation. - efl_canvas_vg_node_mask_set(mtarget, msource, EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA); + efl_canvas_vg_node_comp_method_set(mtarget, msource, EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA); mtarget = msource; @@ -332,24 +317,24 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int } _construct_mask_nodes(msource, mask, depth + 1); - EFL_CANVAS_VG_NODE_BLEND_TYPE mask_mode; + Efl_Gfx_Vg_Composite_Method mask_mode; switch (mask->mMode) { case MaskSubstract: - mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT; + mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_SUBSTRACT; break; case MaskIntersect: - mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT; + mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_INTERSECT; break; case MaskDifference: - mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE; + mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_DIFFERENCE; break; case MaskAdd: default: - mask_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD; + mask_mode = EFL_GFX_VG_COMPOSITE_METHOD_MASK_ADD; break; } - efl_canvas_vg_node_mask_set(mtarget, msource, mask_mode); + efl_canvas_vg_node_comp_method_set(mtarget, msource, mask_mode); mtarget = msource; } } @@ -397,7 +382,7 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de if (matte_mode != 0) { - efl_canvas_vg_node_mask_set(ptree, ctree, matte_mode); + efl_canvas_vg_node_comp_method_set(ptree, ctree, matte_mode); mtarget = ctree; } matte_mode = (int) clayer->mMatte; @@ -417,10 +402,10 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de matte_mode = 0; break; case MatteAlpha: - matte_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA; + matte_mode = EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA; break; case MatteAlphaInv: - matte_mode = EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV; + matte_mode = EFL_GFX_VG_COMPOSITE_METHOD_MATTE_ALPHA_INVERSE; break; case MatteLuma: matte_mode = 0; From eb25e92770f9524e2921a512a326aea202e4b032 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 6 Sep 2019 15:08:27 +0200 Subject: [PATCH 06/23] eolian: change composite syntax from block to inheritance section This makes more sense as these are related to inheritance tree. Therefore, change while we still can. Fixes T8183 --- src/lib/elementary/efl_ui_collection.eo | 9 +-- src/lib/elementary/efl_ui_image_zoomable.eo | 5 +- src/lib/elementary/efl_ui_list_view.eo | 6 +- src/lib/elementary/efl_ui_panel.eo | 4 +- src/lib/elementary/efl_ui_radio_box.eo | 4 +- src/lib/elementary/efl_ui_scroller.eo | 7 +- src/lib/elementary/efl_ui_tab_bar.eo | 9 +-- src/lib/elementary/efl_ui_tags.eo | 7 +- src/lib/elementary/efl_ui_text.eo | 6 +- src/lib/elementary/efl_ui_video.eo | 7 +- .../elementary/efl_ui_widget_focus_manager.eo | 8 +- src/lib/elementary/efl_ui_win.eo | 4 +- src/lib/eolian/eo_parser.c | 79 +++++++++---------- src/tests/eolian/data/unimpl.eo | 5 +- 14 files changed, 66 insertions(+), 94 deletions(-) diff --git a/src/lib/elementary/efl_ui_collection.eo b/src/lib/elementary/efl_ui_collection.eo index ecd0eb1e94..9fad710f65 100644 --- a/src/lib/elementary/efl_ui_collection.eo +++ b/src/lib/elementary/efl_ui_collection.eo @@ -6,6 +6,10 @@ class @beta Efl.Ui.Collection extends Efl.Ui.Layout_Base implements Efl.Ui.Multi_Selectable, Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget_Focus_Manager + composite + Efl.Ui.Scrollable_Interactive, + Efl.Ui.Scrollbar, + Efl.Ui.Focus.Manager { [[This widget displays a list of items in an arrangement controlled by an external @.position_manager object. By using different @.position_manager objects this widget can show unidimensional lists or @@ -95,10 +99,5 @@ class @beta Efl.Ui.Collection extends Efl.Ui.Layout_Base implements item,clicked : Efl.Ui.Item; [[A $clicked event occurred over an item.]] item,clicked,any : Efl.Ui.Item; [[A $clicked,any event occurred over an item.]] } - composite { - 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 4669a4f4a4..62ae9bc591 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.eo +++ b/src/lib/elementary/efl_ui_image_zoomable.eo @@ -5,6 +5,7 @@ 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 { [[Elementary Image Zoomable class]] methods { @@ -84,8 +85,4 @@ class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, download,done: void; [[Called when photocam download finished]] download,error: Elm.Photocam.Error; [[Called when photocam download failed]] } - composite { - Efl.Ui.Scrollable_Interactive; - Efl.Ui.Scrollbar; - } } diff --git a/src/lib/elementary/efl_ui_list_view.eo b/src/lib/elementary/efl_ui_list_view.eo index f1490b3b26..5c49394ec4 100644 --- a/src/lib/elementary/efl_ui_list_view.eo +++ b/src/lib/elementary/efl_ui_list_view.eo @@ -10,6 +10,8 @@ struct @beta Efl.Ui.List_View_Item_Event 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 + Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar { methods { @property homogeneous { @@ -90,8 +92,4 @@ class @beta Efl.Ui.List_View extends Efl.Ui.Layout_Base implements Efl.Ui.Scroll Efl.Access.Selection.all_children_select; Efl.Access.Selection.access_selection_clear; } - composite { - Efl.Ui.Scrollable_Interactive; - Efl.Ui.Scrollbar; - } } diff --git a/src/lib/elementary/efl_ui_panel.eo b/src/lib/elementary/efl_ui_panel.eo index 0cde869b3e..24182af750 100644 --- a/src/lib/elementary/efl_ui_panel.eo +++ b/src/lib/elementary/efl_ui_panel.eo @@ -18,6 +18,7 @@ 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, Efl.Access.Widget.Action + composite Efl.Ui.Scrollable_Interactive { [[Elementary panel class]] methods { @@ -93,7 +94,4 @@ class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base events { toggled: void; [[Called when the hidden state was toggled]] } - composite { - Efl.Ui.Scrollable_Interactive; - } } diff --git a/src/lib/elementary/efl_ui_radio_box.eo b/src/lib/elementary/efl_ui_radio_box.eo index aa2d91c835..54bd92e3df 100644 --- a/src/lib/elementary/efl_ui_radio_box.eo +++ b/src/lib/elementary/efl_ui_radio_box.eo @@ -1,4 +1,5 @@ class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box implements Efl.Ui.Radio_Group + composite Efl.Ui.Radio_Group { [[A standard @Efl.Ui.Box container which automatically handles grouping of any @Efl.Ui.Radio widget added to it. @@ -19,7 +20,4 @@ class @beta Efl.Ui.Radio_Box extends Efl.Ui.Box implements Efl.Ui.Radio_Group Efl.Pack_Linear.pack_unpack_at; Efl.Object.constructor; } - composite { - Efl.Ui.Radio_Group; - } } diff --git a/src/lib/elementary/efl_ui_scroller.eo b/src/lib/elementary/efl_ui_scroller.eo index 36f42c16b0..7a2bb90306 100644 --- a/src/lib/elementary/efl_ui_scroller.eo +++ b/src/lib/elementary/efl_ui_scroller.eo @@ -4,6 +4,9 @@ class @beta Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Manager_Sub, Efl.Ui.Widget_Focus_Manager, Efl.Content + composite + Efl.Ui.Scrollable_Interactive, + Efl.Ui.Scrollbar { [[Efl ui scroller class]] implements { @@ -19,8 +22,4 @@ class @beta Efl.Ui.Scroller extends Efl.Ui.Layout_Base implements Efl.Ui.Widget_Focus_Manager.focus_manager_create; Efl.Ui.Scrollable_Interactive.match_content { set; } } - composite { - 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 1d27afe62e..b4aabe1197 100644 --- a/src/lib/elementary/efl_ui_tab_bar.eo +++ b/src/lib/elementary/efl_ui_tab_bar.eo @@ -1,4 +1,6 @@ -class @beta Efl.Ui.Tab_Bar extends Efl.Ui.Layout_Base implements Efl.Ui.Single_Selectable, Efl.Pack_Linear +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 { [[Tab Bar class]] methods { @@ -23,9 +25,4 @@ class @beta Efl.Ui.Tab_Bar extends Efl.Ui.Layout_Base implements Efl.Ui.Single_S Efl.Container.content_count; Efl.Container.content_iterate; } - composite { - Efl.Pack_Linear; - Efl.Pack; - Efl.Pack_Linear; - } } diff --git a/src/lib/elementary/efl_ui_tags.eo b/src/lib/elementary/efl_ui_tags.eo index 6f8c739f06..96f1fb0eb8 100644 --- a/src/lib/elementary/efl_ui_tags.eo +++ b/src/lib/elementary/efl_ui_tags.eo @@ -1,4 +1,6 @@ -class @beta Efl.Ui.Tags extends Efl.Ui.Layout_Base implements Efl.Text, Efl.Ui.Format +class @beta Efl.Ui.Tags extends Efl.Ui.Layout_Base + implements Efl.Text, Efl.Ui.Format + composite 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 @@ -61,7 +63,4 @@ class @beta Efl.Ui.Tags extends Efl.Ui.Layout_Base implements Efl.Text, Efl.Ui.F /* FIXME: Not future-proof */ expand,state,changed: int; [[Called when expanded state changed]] } - composite { - Efl.Text; - } } diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index a8cee69e40..691c0271bd 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -4,6 +4,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.Text_Interactive, Efl.Text_Markup { [[A flexible text widget which can be static (as a label) or editable by the user (as a text entry). It provides all sorts of editing facilities @@ -374,8 +376,4 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickabl anchor,up: Elm.Entry_Anchor_Info; [[called on anchor up]] cursor,changed,manual: void; [[Called on manual cursor change]] } - composite { - Efl.Text_Interactive; - Efl.Text_Markup; - } } diff --git a/src/lib/elementary/efl_ui_video.eo b/src/lib/elementary/efl_ui_video.eo index d6b42f9abb..c00326ef30 100644 --- a/src/lib/elementary/efl_ui_video.eo +++ b/src/lib/elementary/efl_ui_video.eo @@ -1,4 +1,6 @@ -class @beta Efl.Ui.Video extends Efl.Ui.Layout_Base implements Efl.File, Efl.Player, Efl.Access.Widget.Action +class @beta Efl.Ui.Video extends Efl.Ui.Layout_Base + implements Efl.File, Efl.Player, Efl.Access.Widget.Action + composite Efl.Player { [[Efl UI video class]] methods { @@ -50,7 +52,4 @@ class @beta Efl.Ui.Video extends Efl.Ui.Layout_Base implements Efl.File, Efl.Pla Efl.Player.stop; Efl.Player.play { get; set; } } - composite { - Efl.Player; - } } diff --git a/src/lib/elementary/efl_ui_widget_focus_manager.eo b/src/lib/elementary/efl_ui_widget_focus_manager.eo index e5cc1a2691..d12a4a0c79 100644 --- a/src/lib/elementary/efl_ui_widget_focus_manager.eo +++ b/src/lib/elementary/efl_ui_widget_focus_manager.eo @@ -1,4 +1,7 @@ -mixin Efl.Ui.Widget_Focus_Manager requires Efl.Ui.Widget extends Efl.Ui.Focus.Manager +mixin Efl.Ui.Widget_Focus_Manager + requires Efl.Ui.Widget + extends Efl.Ui.Focus.Manager + composite Efl.Ui.Focus.Manager { [[Helper mixin for widgets which also can act as focus managers. @@ -23,7 +26,4 @@ mixin Efl.Ui.Widget_Focus_Manager requires Efl.Ui.Widget extends Efl.Ui.Focus.Ma Efl.Object.destructor; Efl.Ui.Widget.focus_state_apply; } - composite { - Efl.Ui.Focus.Manager; - } } diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 42c309dfb6..94859d9277 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -139,6 +139,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W 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 UI window class. @@ -895,7 +896,4 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W pause: void; [[Called when the window is not going be displayed for some time]] resume: void; [[Called before a window is rendered after a pause event]] } - composite { - Efl.Config; - } } diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 04a16c2502..975c2a880b 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1958,43 +1958,6 @@ parse_parts(Eo_Lexer *ls) check_match(ls, '}', '{', line, col); } -static void -parse_composite(Eo_Lexer *ls) -{ - int line, col; - if (ls->klass->type == EOLIAN_CLASS_INTERFACE) - eo_lexer_syntax_error(ls, "composite section not allowed in interfaces"); - eo_lexer_get(ls); - line = ls->line_number, col = ls->column; - check_next(ls, '{'); - while (ls->t.token != '}') - { - Eina_Strbuf *buf = eina_strbuf_new(); - eo_lexer_dtor_push(ls, EINA_FREE_CB(eina_strbuf_free), buf); - eo_lexer_context_push(ls); - parse_name(ls, buf); - const char *nm = eina_strbuf_string_get(buf); - char *fnm = database_class_to_filename(nm); - if (!eina_hash_find(ls->state->filenames_eo, fnm)) - { - free(fnm); - char ebuf[PATH_MAX]; - eo_lexer_context_restore(ls); - snprintf(ebuf, sizeof(ebuf), "unknown interface '%s'", nm); - eo_lexer_syntax_error(ls, ebuf); - return; - } - /* do not introduce a dependency */ - database_defer(ls->state, fnm, EINA_FALSE); - free(fnm); - ls->klass->composite = eina_list_append(ls->klass->composite, - eina_stringshare_add(nm)); - eo_lexer_dtor_pop(ls); - check_next(ls, ';'); - } - check_match(ls, '}', '{', line, col); -} - static void parse_implements(Eo_Lexer *ls, Eina_Bool iface) { @@ -2065,7 +2028,6 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type) has_data = EINA_FALSE, has_methods = EINA_FALSE, has_parts = EINA_FALSE, - has_composite = EINA_FALSE, has_implements = EINA_FALSE, has_constructors = EINA_FALSE, has_events = EINA_FALSE; @@ -2112,10 +2074,6 @@ parse_class_body(Eo_Lexer *ls, Eolian_Class_Type type) CASE_LOCK(ls, parts, "parts definition") parse_parts(ls); break; - case KW_composite: - CASE_LOCK(ls, composite, "composite definition") - parse_composite(ls); - break; case KW_implements: CASE_LOCK(ls, implements, "implements definition") parse_implements(ls, type == EOLIAN_CLASS_INTERFACE); @@ -2200,6 +2158,7 @@ _requires_add(Eo_Lexer *ls, Eina_Strbuf *buf) const char *required; char *fnm; + eina_strbuf_reset(buf); eo_lexer_context_push(ls); parse_name(ls, buf); required = eina_strbuf_string_get(buf); @@ -2212,6 +2171,31 @@ _requires_add(Eo_Lexer *ls, Eina_Strbuf *buf) free(fnm); } +static void +_composite_add(Eo_Lexer *ls, Eina_Strbuf *buf) +{ + eina_strbuf_reset(buf); + eo_lexer_context_push(ls); + parse_name(ls, buf); + const char *nm = eina_strbuf_string_get(buf); + char *fnm = database_class_to_filename(nm); + if (!eina_hash_find(ls->state->filenames_eo, fnm)) + { + free(fnm); + char ebuf[PATH_MAX]; + eo_lexer_context_restore(ls); + snprintf(ebuf, sizeof(ebuf), "unknown interface '%s'", nm); + eo_lexer_syntax_error(ls, ebuf); + return; + } + /* do not introduce a dependency */ + database_defer(ls->state, fnm, EINA_FALSE); + free(fnm); + ls->klass->composite = eina_list_append(ls->klass->composite, + eina_stringshare_add(nm)); + eo_lexer_context_pop(ls); +} + static void parse_class(Eo_Lexer *ls, Eolian_Class_Type type) { @@ -2312,6 +2296,17 @@ tags_done: _inherit_dep(ls, ibuf, EINA_FALSE); while (test_next(ls, ',')); } + + if (ls->t.kw == KW_composite) + { + if (type == EOLIAN_CLASS_INTERFACE) + eo_lexer_syntax_error(ls, "composite not allowed in interfaces"); + eo_lexer_get(ls); + do + _composite_add(ls, ibuf); + while (test_next(ls, ',')); + } + eo_lexer_dtor_pop(ls); } inherit_done: diff --git a/src/tests/eolian/data/unimpl.eo b/src/tests/eolian/data/unimpl.eo index a1420e07c6..e08699a231 100644 --- a/src/tests/eolian/data/unimpl.eo +++ b/src/tests/eolian/data/unimpl.eo @@ -1,7 +1,4 @@ -class Unimpl implements Iface { - composite { - Iface; - } +class Unimpl implements Iface composite Iface { implements { Iface.foo; } From 5e1f2cd68cb1563c0a5b03fa4093e6972d46c2e3 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 6 Sep 2019 14:17:10 +0100 Subject: [PATCH 07/23] fix xpm loader to be threadable - fixes so much stuff... fixes ylee's xpm loading issue... it really is just that xpm's didn't load if you preload/load from a thread... because it wass the only loader that claimed it couldnt be threaded... which it can be. @fix --- src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c index d7aa25ded3..af36c3c49a 100644 --- a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c +++ b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c @@ -2222,7 +2222,7 @@ static Evas_Image_Load_Func evas_image_load_xpm_func = (void*) evas_image_load_file_data_xpm, NULL, EINA_FALSE, - EINA_FALSE + EINA_TRUE }; static int From 353524e1b89deb48b64c6125a92c1627a05deb75 Mon Sep 17 00:00:00 2001 From: Bruno da Silva Belo Date: Fri, 6 Sep 2019 15:45:18 +0200 Subject: [PATCH 08/23] eolian-mono: Renaming suffix for event and event args Summary: suffix _Args to Args, Evt to Event Reviewers: lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: Jaehyun_Cho, woohyun, segfaultxavi, cedric, felipealmeida, #reviewers, lauromoura, #committers Tags: #refactoring, PHID-PROJ-uhnmnvlvunw6jgoqdnd4, #efl_language_bindings Maniphest Tasks: T8164, T8163 Differential Revision: https://phab.enlightenment.org/D9692 --- .../eolian_mono/eolian/mono/name_helpers.hh | 6 +-- src/bindings/mono/efl_mono/GenericModel.cs | 24 +++++------ .../mono/efl_mono/efl_csharp_application.cs | 8 ++-- .../elementary/efl_ui_unit_converter.cs | 6 +-- src/tests/efl_mono/Errors.cs | 2 +- src/tests/efl_mono/Events.cs | 40 +++++++++---------- src/tests/efl_mono/Model.cs | 2 +- 7 files changed, 43 insertions(+), 45 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index d6064b2d56..8104a78af6 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -420,14 +420,12 @@ inline std::string klass_get_full_name(T const& clsname) // Events inline std::string managed_event_name(std::string const& name) { - return utils::to_pascal_case(utils::split(name, "_,"), "") + "Evt"; + return utils::to_pascal_case(utils::split(name, "_,"), "") + "Event"; } inline std::string managed_event_args_short_name(attributes::event_def const& evt) { - std::string ret; - ret = klass_concrete_or_interface_name(evt.klass); - return ret + name_helpers::managed_event_name(evt.name) + "_Args"; + return klass_concrete_or_interface_name(evt.klass) + name_helpers::managed_event_name(evt.name) + "Args"; } inline std::string managed_event_args_name(attributes::event_def evt) diff --git a/src/bindings/mono/efl_mono/GenericModel.cs b/src/bindings/mono/efl_mono/GenericModel.cs index 1bfa91e53d..95389f8ddb 100644 --- a/src/bindings/mono/efl_mono/GenericModel.cs +++ b/src/bindings/mono/efl_mono/GenericModel.cs @@ -125,46 +125,46 @@ public class GenericModel : Efl.Object, Efl.IModel, IDisposable } /// Event triggered when properties on the wrapped model changes. - public event EventHandler PropertiesChangedEvt + public event EventHandler PropertiesChangedEvent { add { - model.PropertiesChangedEvt += value; + model.PropertiesChangedEvent += value; } remove { - model.PropertiesChangedEvt -= value; + model.PropertiesChangedEvent -= value; } } /// Event triggered when a child is added from the wrapped model. - public event EventHandler ChildAddedEvt + public event EventHandler ChildAddedEvent { add { - model.ChildAddedEvt += value; + model.ChildAddedEvent += value; } remove { - model.ChildAddedEvt -= value; + model.ChildAddedEvent -= value; } } /// Event triggered when a child is removed from the wrapped model. - public event EventHandler ChildRemovedEvt + public event EventHandler ChildRemovedEvent { add { - model.ChildRemovedEvt += value; + model.ChildRemovedEvent += value; } remove { - model.ChildRemovedEvt -= value; + model.ChildRemovedEvent -= value; } } /// Event triggered when the number of children changes. - public event EventHandler ChildrenCountChangedEvt + public event EventHandler ChildrenCountChangedEvent { add { - model.ChildrenCountChangedEvt += value; + model.ChildrenCountChangedEvent += value; } remove { - model.ChildrenCountChangedEvt -= value; + model.ChildrenCountChangedEvent -= value; } } } diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs index 4e3a2522cc..93df6e7a3b 100644 --- a/src/bindings/mono/efl_mono/efl_csharp_application.cs +++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs @@ -135,7 +135,7 @@ public abstract class Application #if EFL_BETA app.SetCommandArray(command_line); #endif - app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => + app.ArgumentsEvent += (object sender, LoopArgumentsEventArgs evt) => { if (evt.arg.Initialization) { @@ -152,15 +152,15 @@ public abstract class Application OnArguments(evt.arg); }; - app.PauseEvt += (object sender, EventArgs e) => + app.PauseEvent += (object sender, EventArgs e) => { OnPause(); }; - app.ResumeEvt += (object sender, EventArgs e) => + app.ResumeEvent += (object sender, EventArgs e) => { OnResume(); }; - app.TerminateEvt += (object sender, EventArgs e) => + app.TerminateEvent += (object sender, EventArgs e) => { OnTerminate(); }; diff --git a/src/examples/elementary/efl_ui_unit_converter.cs b/src/examples/elementary/efl_ui_unit_converter.cs index 3460af3f5f..93a5f89949 100644 --- a/src/examples/elementary/efl_ui_unit_converter.cs +++ b/src/examples/elementary/efl_ui_unit_converter.cs @@ -23,7 +23,7 @@ public class Example popup.SetVisible(true); popup.SetButton(Efl.Ui.AlertPopupButton.Positive, "Ok", null); popup.SetSize(new Eina.Size2D(150, 30)); - popup.ButtonClickedEvt += (object sender, Efl.Ui.AlertPopupButtonClickedEvt_Args e) => { + popup.ButtonClickedEvent += (object sender, Efl.Ui.AlertPopupButtonClickedEventArgs e) => { popup.SetParent(null); popup.Invalidate(); }; @@ -99,7 +99,7 @@ public class Example kms_box.DoPack(kms_input); kms_box.DoPack(kms_button); - ((Efl.Ui.Clickable)kms_button).ClickedEvt += (object sender, EventArgs e) => { + ((Efl.Ui.Clickable)kms_button).ClickedEvent += (object sender, EventArgs e) => { try { string text = kms_input.GetText(); @@ -115,7 +115,7 @@ public class Example } }; - ((Efl.Ui.Clickable)miles_button).ClickedEvt += (object sender, EventArgs e) => { + ((Efl.Ui.Clickable)miles_button).ClickedEvent += (object sender, EventArgs e) => { try { string text = miles_input.GetText(); diff --git a/src/tests/efl_mono/Errors.cs b/src/tests/efl_mono/Errors.cs index 802ac337c0..9229ad0a60 100644 --- a/src/tests/efl_mono/Errors.cs +++ b/src/tests/efl_mono/Errors.cs @@ -99,7 +99,7 @@ class TestEolianError // the managed code var obj = new Dummy.TestObject(); Listener listener = new Listener(); - obj.EvtWithIntEvt += listener.callback; + obj.EvtWithIntEvent += listener.callback; Test.AssertRaises(() => { obj.EmitEventWithInt(2); }); } diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs index b664e2bbbd..d7da6f6c98 100644 --- a/src/tests/efl_mono/Events.cs +++ b/src/tests/efl_mono/Events.cs @@ -30,7 +30,7 @@ class TestEoEvents loop.SetName("loop"); TestEoEvents listener = new TestEoEvents(); listener.loop = loop; - loop.IdleEvt += listener.callback; + loop.IdleEvent += listener.callback; Test.Assert(!listener.called); Test.Assert(!listener.correct_sender); @@ -46,7 +46,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); string received_string = null; - obj.EvtWithStringEvt += (object sender, Dummy.TestObjectEvtWithStringEvt_Args e) => { + obj.EvtWithStringEvent += (object sender, Dummy.TestObjectEvtWithStringEventArgs e) => { received_string = e.arg; }; @@ -60,7 +60,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); int received_int= 0; - obj.EvtWithIntEvt += (object sender, Dummy.TestObjectEvtWithIntEvt_Args e) => { + obj.EvtWithIntEvent += (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => { received_int = e.arg; }; @@ -74,7 +74,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); bool received_bool = false; - obj.EvtWithBoolEvt += (object sender, Dummy.TestObjectEvtWithBoolEvt_Args e) => { + obj.EvtWithBoolEvent += (object sender, Dummy.TestObjectEvtWithBoolEventArgs e) => { received_bool = e.arg; }; @@ -91,7 +91,7 @@ class TestEoEvents { var obj = new Dummy.TestObject(); uint received_uint = 0; - obj.EvtWithUintEvt += (object sender, Dummy.TestObjectEvtWithUintEvt_Args e) => { + obj.EvtWithUintEvent += (object sender, Dummy.TestObjectEvtWithUintEventArgs e) => { received_uint = e.arg; }; @@ -104,7 +104,7 @@ class TestEoEvents { var obj = new Dummy.TestObject(); float received_float = 0; - obj.EvtWithFloatEvt += (object sender, Dummy.TestObjectEvtWithFloatEvt_Args e) => { + obj.EvtWithFloatEvent += (object sender, Dummy.TestObjectEvtWithFloatEventArgs e) => { received_float = e.arg; }; @@ -118,7 +118,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); double received_double = 0; double reference = float.MaxValue + 42; - obj.EvtWithDoubleEvt += (object sender, Dummy.TestObjectEvtWithDoubleEvt_Args e) => { + obj.EvtWithDoubleEvent += (object sender, Dummy.TestObjectEvtWithDoubleEventArgs e) => { received_double = e.arg; }; @@ -132,7 +132,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); Dummy.TestObject received_obj = null; - obj.EvtWithObjEvt += (object sender, Dummy.TestObjectEvtWithObjEvt_Args e) => { + obj.EvtWithObjEvent += (object sender, Dummy.TestObjectEvtWithObjEventArgs e) => { received_obj = e.arg; }; @@ -148,7 +148,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); Eina.Error received_error = 0; - obj.EvtWithErrorEvt += (object sender, Dummy.TestObjectEvtWithErrorEvt_Args e) => { + obj.EvtWithErrorEvent += (object sender, Dummy.TestObjectEvtWithErrorEventArgs e) => { received_error = e.arg; }; @@ -164,7 +164,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); Dummy.StructSimple received_struct = default(Dummy.StructSimple); - obj.EvtWithStructEvt += (object sender, Dummy.TestObjectEvtWithStructEvt_Args e) => { + obj.EvtWithStructEvent += (object sender, Dummy.TestObjectEvtWithStructEventArgs e) => { received_struct = e.arg; }; @@ -181,7 +181,7 @@ class TestEoEvents var obj = new Dummy.TestObject(); Dummy.StructComplex received_struct = default(Dummy.StructComplex); - obj.EvtWithStructComplexEvt += (object sender, Dummy.TestObjectEvtWithStructComplexEvt_Args e) => { + obj.EvtWithStructComplexEvent += (object sender, Dummy.TestObjectEvtWithStructComplexEventArgs e) => { received_struct = e.arg; }; @@ -202,7 +202,7 @@ class TestEoEvents sent.Append("Def"); sent.Append("Ghi"); - obj.EvtWithArrayEvt += (object sender, Dummy.TestObjectEvtWithArrayEvt_Args e) => { + obj.EvtWithArrayEvent += (object sender, Dummy.TestObjectEvtWithArrayEventArgs e) => { received = e.arg; }; @@ -222,16 +222,16 @@ class TestEventAddRemove var obj = new Dummy.TestObject(); bool called = true; - EventHandler evtCb = (object sender, Dummy.TestObjectEvtWithIntEvt_Args e) => { + EventHandler evtCb = (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => { called = true; }; - obj.EvtWithIntEvt += evtCb; + obj.EvtWithIntEvent += evtCb; obj.EmitEventWithInt(42); Test.Assert(called); called = false; - obj.EvtWithIntEvt -= evtCb; + obj.EvtWithIntEvent -= evtCb; obj.EmitEventWithInt(42); Test.Assert(!called); } @@ -248,7 +248,7 @@ class TestInterfaceEvents called = true; }; - obj.NonconflictedEvt += cb; + obj.NonconflictedEvent += cb; obj.EmitNonconflicted(); Test.Assert(called); } @@ -266,7 +266,7 @@ class TestEventNaming test_called = true; }; - obj.EvtWithUnderEvt += cb; + obj.EvtWithUnderEvent += cb; obj.EmitEventWithUnder(); @@ -279,12 +279,12 @@ class TestEventWithDeadWrappers { private static WeakReference AttachToManager(Dummy.EventManager manager, - EventHandler cb) + EventHandler cb) { var obj = new Dummy.TestObject(); manager.Emitter = obj; - obj.EvtWithIntEvt += cb; + obj.EvtWithIntEvent += cb; return new WeakReference(obj); } @@ -298,7 +298,7 @@ class TestEventWithDeadWrappers int received = -1; // attach to evt with int - EventHandler cb = (object sender, Dummy.TestObjectEvtWithIntEvt_Args args) => { + EventHandler cb = (object sender, Dummy.TestObjectEvtWithIntEventArgs args) => { callbackCalled = true; received = args.arg; Test.Assert(Object.ReferenceEquals(sender, wref.Target)); diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs index a43d9da51c..829accfb5c 100644 --- a/src/tests/efl_mono/Model.cs +++ b/src/tests/efl_mono/Model.cs @@ -66,7 +66,7 @@ public class TestModel { string propertyBound = null; bool callbackCalled = false; var factory = new Efl.Ui.ItemFactory(); - factory.PropertyBoundEvt += (object sender, Efl.Ui.IPropertyBindPropertyBoundEvt_Args args) => { + factory.PropertyBoundEvent += (object sender, Efl.Ui.IPropertyBindPropertyBoundEventArgs args) => { propertyBound = args.arg; callbackCalled = true; }; From b36e159d313bae4a6dd4e0c60deae0aef2309b50 Mon Sep 17 00:00:00 2001 From: Bruno da Silva Belo Date: Fri, 6 Sep 2019 16:03:23 +0200 Subject: [PATCH 09/23] eolian-mono: Removing I prefix from classes. Reviewers: lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: cedric, brunobelo, felipealmeida, #reviewers, lauromoura, #committers Tags: #efl Maniphest Tasks: T8166 Differential Revision: https://phab.enlightenment.org/D9816 --- src/bin/eolian_mono/eolian/mono/name_helpers.hh | 17 +++++++---------- src/bindings/mono/efl_mono/GenericModel.cs | 6 +++--- src/tests/efl_mono/Model.cs | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index 8104a78af6..a1fd8cd6d0 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -293,11 +293,9 @@ struct klass_interface_name_generator template std::string operator()(T const& klass) const { - std::string name = utils::remove_all(klass.eolian_name, '_'); - if (klass.type == attributes::class_type::mixin || klass.type == attributes::class_type::interface_) - return "I" + name; - else - return name; + return ((klass.type == attributes::class_type::mixin + || klass.type == attributes::class_type::interface_) ? "I" : "") + + utils::remove_all(klass.eolian_name, '_'); } template @@ -325,10 +323,9 @@ struct klass_full_interface_name_generator template inline std::string klass_concrete_name(T const& klass) { - if (klass.type == attributes::class_type::mixin || klass.type == attributes::class_type::interface_) - return klass_interface_name(klass) + "Concrete"; - - return utils::remove_all(klass.eolian_name, '_'); + return utils::remove_all(klass.eolian_name, '_') + ((klass.type == attributes::class_type::mixin + || klass.type == attributes::class_type::interface_) + ? "Concrete" : ""); } template @@ -425,7 +422,7 @@ inline std::string managed_event_name(std::string const& name) inline std::string managed_event_args_short_name(attributes::event_def const& evt) { - return klass_concrete_or_interface_name(evt.klass) + name_helpers::managed_event_name(evt.name) + "Args"; + return utils::remove_all(evt.klass.eolian_name, '_') + name_helpers::managed_event_name(evt.name) + "Args"; } inline std::string managed_event_args_name(attributes::event_def evt) diff --git a/src/bindings/mono/efl_mono/GenericModel.cs b/src/bindings/mono/efl_mono/GenericModel.cs index 95389f8ddb..25d9c79955 100644 --- a/src/bindings/mono/efl_mono/GenericModel.cs +++ b/src/bindings/mono/efl_mono/GenericModel.cs @@ -125,7 +125,7 @@ public class GenericModel : Efl.Object, Efl.IModel, IDisposable } /// Event triggered when properties on the wrapped model changes. - public event EventHandler PropertiesChangedEvent + public event EventHandler PropertiesChangedEvent { add { model.PropertiesChangedEvent += value; @@ -136,7 +136,7 @@ public class GenericModel : Efl.Object, Efl.IModel, IDisposable } /// Event triggered when a child is added from the wrapped model. - public event EventHandler ChildAddedEvent + public event EventHandler ChildAddedEvent { add { model.ChildAddedEvent += value; @@ -147,7 +147,7 @@ public class GenericModel : Efl.Object, Efl.IModel, IDisposable } /// Event triggered when a child is removed from the wrapped model. - public event EventHandler ChildRemovedEvent + public event EventHandler ChildRemovedEvent { add { model.ChildRemovedEvent += value; diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs index 829accfb5c..4ec6ef3f0b 100644 --- a/src/tests/efl_mono/Model.cs +++ b/src/tests/efl_mono/Model.cs @@ -66,7 +66,7 @@ public class TestModel { string propertyBound = null; bool callbackCalled = false; var factory = new Efl.Ui.ItemFactory(); - factory.PropertyBoundEvent += (object sender, Efl.Ui.IPropertyBindPropertyBoundEventArgs args) => { + factory.PropertyBoundEvent += (object sender, Efl.Ui.PropertyBindPropertyBoundEventArgs args) => { propertyBound = args.arg; callbackCalled = true; }; From 588745e9956ba622aadc9fe6f11988a372687d39 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 2 Sep 2019 10:26:40 +0200 Subject: [PATCH 10/23] efl_ui_spotlight: migrate from active_index to active_element after playing arround with the widget, we found out that it feels quite weird to have a index, where most of the time you work with widgets. We might want to add syntax suger in the future to make it easier to just jump to the next element, or to the previous, but that still is to be decided. The event and the communication to the spotlight manager are still left to be used with the index, reason for this is, that we might need to fill there an invalid pointer, if a deletion is triggering an animation, which seems quite weird. That needs further discussing. Docx have been updated, the sitemarks about the shifting of the active_index can be removed, as the element is not subject of change during content adds/deletes. ref T7991 Reviewed-by: Jaehyun Cho Differential Revision: https://phab.enlightenment.org/D9813 --- src/bin/elementary/test_ui_spotlight.c | 29 ++-- src/bin/elementary/test_ui_tab_pager.c | 30 ++--- .../elementary/efl_ui_slideshow_example.c | 4 +- .../elementary/efl_ui_spotlight_container.c | 126 ++++++++++-------- .../elementary/efl_ui_spotlight_container.eo | 12 +- .../elementary/efl_ui_spotlight_indicator.eo | 17 +-- .../elementary/efl_ui_spotlight_manager.eo | 16 +-- .../efl_ui_spotlight_manager_plain.c | 36 ++--- .../efl_ui_spotlight_manager_scroll.c | 7 +- .../efl_ui_spotlight_manager_stack.c | 4 +- src/lib/elementary/efl_ui_tab_pager.c | 19 ++- src/lib/elementary/efl_ui_tab_pager.eo | 2 +- src/tests/elementary/efl_ui_test_spotlight.c | 77 ++++++----- 13 files changed, 189 insertions(+), 190 deletions(-) diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c index cdcaf65b1e..c2bc6b436c 100644 --- a/src/bin/elementary/test_ui_spotlight.c +++ b/src/bin/elementary/test_ui_spotlight.c @@ -124,20 +124,20 @@ static void prev_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Eo *spotlight = data; - int active_index = efl_ui_spotlight_active_index_get(spotlight); + int active_index = efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight)); if (active_index - 1 > -1) - efl_ui_spotlight_active_index_set(spotlight, active_index - 1); + efl_ui_spotlight_active_element_set(spotlight, efl_pack_content_get(spotlight, active_index - 1)); } static void next_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Eo *spotlight = data; - int active_index = efl_ui_spotlight_active_index_get(spotlight); + int active_index = efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight)); if (active_index + 1 < efl_content_count(spotlight)) - efl_ui_spotlight_active_index_set(spotlight, active_index + 1); + efl_ui_spotlight_active_element_set(spotlight, efl_pack_content_get(spotlight, active_index + 1)); } static Eina_Value @@ -280,7 +280,7 @@ pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Pack_Params *param = data; Eo *spotlight = param->spotlight; - Eo *page = NULL, *curr_page; + Eo *page = NULL; int index, cnt; if ((param->type != UNPACK_AT) && (param->type != CLEAR)) @@ -318,15 +318,11 @@ pack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) break; case PACK_BEFORE: - index = efl_ui_spotlight_active_index_get(spotlight); - curr_page = efl_pack_content_get(spotlight, index); - efl_pack_before(spotlight, page, curr_page); + efl_pack_before(spotlight, page, efl_ui_spotlight_active_element_get(spotlight)); break; case PACK_AFTER: - index = efl_ui_spotlight_active_index_get(spotlight); - curr_page = efl_pack_content_get(spotlight, index); - efl_pack_after(spotlight, page, curr_page); + efl_pack_after(spotlight, page, efl_ui_spotlight_active_element_get(spotlight)); break; case PACK_AT: @@ -383,8 +379,9 @@ page_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Page_Set_Params *psp = data; - efl_ui_spotlight_active_index_set(psp->spotlight, - efl_ui_range_value_get(psp->spinner)); + efl_ui_spotlight_active_element_set(psp->spotlight, + efl_pack_content_get(psp->spotlight, + efl_ui_range_value_get(psp->spinner))); } static void @@ -609,7 +606,7 @@ pack_cb(void *data, num = efl_content_count(spotlight); if (num) efl_ui_range_limits_set(sp1, 0, num); - num = efl_ui_spotlight_active_index_get(spotlight); + num = efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight)); if (num >= 0) efl_ui_range_value_set(sp1, num); @@ -735,7 +732,7 @@ pack_cb(void *data, efl_ui_range_limits_set(sp2, 0, (efl_content_count(spotlight) - 1)); efl_ui_range_value_set(sp2, - efl_ui_spotlight_active_index_get(spotlight)); + efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight))); } else { @@ -801,7 +798,7 @@ active_index_cb(void *data, efl_ui_range_limits_set(sp, 0, (efl_content_count(spotlight) - 1)); efl_ui_range_value_set(sp, - efl_ui_spotlight_active_index_get(spotlight)); + efl_pack_index_get(spotlight, efl_ui_spotlight_active_element_get(spotlight))); } else { diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c index 93aaa12948..01ca807a2e 100644 --- a/src/bin/elementary/test_ui_tab_pager.c +++ b/src/bin/elementary/test_ui_tab_pager.c @@ -139,10 +139,10 @@ test_ui_tab_pager(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev { page = tab_page_add(tp); efl_pack_end(tp, page); + if (i == 0) + efl_ui_spotlight_active_element_set(tp, page); } - efl_ui_spotlight_active_index_set(tp, 0); - ad = (App_Data*)calloc(1, sizeof(App_Data)); ad->navi = navi; ad->tab_pager = tp; @@ -175,7 +175,7 @@ static void _tab_set_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Tab_Set_Data *tsd = data; - efl_ui_spotlight_active_index_set(tsd->tab_pager, elm_spinner_value_get(tsd->spinner)); + efl_ui_spotlight_active_element_set(tsd->tab_pager, efl_pack_content_get(tsd->tab_pager, elm_spinner_value_get(tsd->spinner))); } static void @@ -206,7 +206,7 @@ _current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box, efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1), - efl_ui_range_value_set(efl_added, efl_ui_spotlight_active_index_get(tab_pager)), + efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)), efl_pack_end(box, efl_added)); tsd->tab_pager = tab_pager; @@ -246,10 +246,8 @@ _pack_before_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Eo *tab_pager = data; Eo *tab_page, *cur_tab_page; - int index; - index = efl_ui_spotlight_active_index_get(tab_pager); - cur_tab_page = efl_pack_content_get(tab_pager, index); + cur_tab_page = efl_ui_spotlight_active_element_get(tab_pager); tab_page = tab_page_add(tab_pager); @@ -261,10 +259,8 @@ _pack_after_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Eo *tab_pager = data; Eo *tab_page, *cur_tab_page; - int index; - index = efl_ui_spotlight_active_index_get(tab_pager); - cur_tab_page = efl_pack_content_get(tab_pager, index); + cur_tab_page = efl_ui_spotlight_active_element_get(tab_pager); tab_page = tab_page_add(tab_pager); @@ -340,7 +336,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box, efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1), - efl_ui_range_value_set(efl_added, efl_ui_spotlight_active_index_get(tab_pager)), + efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)), efl_pack_end(in_box, efl_added)); tsd->tab_pager = tab_pager; @@ -365,8 +361,9 @@ static void _unpack_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Eo *tab_pager = data; - int index = efl_ui_spotlight_active_index_get(tab_pager); - Eo *tab_page = efl_pack_content_get(tab_pager, index); + + Eo *tab_page = efl_ui_spotlight_active_element_get(tab_pager); + efl_pack_unpack(tab_pager, tab_page); efl_del(tab_page); } @@ -440,7 +437,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box, efl_ui_range_limits_set(efl_added, 0, efl_content_count(tab_pager) - 1), - efl_ui_range_value_set(efl_added, efl_ui_spotlight_active_index_get(tab_pager)), + efl_ui_range_value_set(efl_added, efl_content_count(tab_pager)), efl_pack_end(in_box, efl_added)); tsd->tab_pager = tab_pager; @@ -463,9 +460,8 @@ _change_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eo *tab_page, *content; char *label = NULL; char *icon = NULL; - int cur; - cur = efl_ui_spotlight_active_index_get(tcd->tab_pager); - tab_page = efl_pack_content_get(tcd->tab_pager, cur); + + tab_page = efl_ui_spotlight_active_element_get(tcd->tab_pager); if (efl_ui_selectable_selected_get(tcd->label_check)) { diff --git a/src/examples/elementary/efl_ui_slideshow_example.c b/src/examples/elementary/efl_ui_slideshow_example.c index 55c1b66fab..6292f4390f 100644 --- a/src/examples/elementary/efl_ui_slideshow_example.c +++ b/src/examples/elementary/efl_ui_slideshow_example.c @@ -25,9 +25,9 @@ _show_next(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl_del(show_timer); show_timer = NULL; - int current_index = efl_ui_spotlight_active_index_get(container); + int current_index = efl_pack_index_get(container, efl_ui_spotlight_active_element_get(container)); int new_index = (current_index + 1) % efl_content_count(container); - efl_ui_spotlight_active_index_set(container, new_index); + efl_ui_spotlight_active_element_set(container, efl_pack_content_get(container, new_index)); } static void diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c index 10c8125709..9b7737415f 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.c +++ b/src/lib/elementary/efl_ui_spotlight_container.c @@ -14,7 +14,7 @@ typedef struct _Efl_Ui_Spotlight_Container_Data Eina_Size2D sz; } page_spec; struct { - int page; + Efl_Ui_Widget *page; double pos; } curr; struct { @@ -37,6 +37,14 @@ typedef struct _Efl_Ui_Spotlight_Container_Data #define MY_CLASS EFL_UI_SPOTLIGHT_CONTAINER_CLASS +static void +_fetch_partners(Eina_List *list, Eo *subobj, Eo **next, Eo **prev) +{ + Eina_List *node = eina_list_data_find_list(list, subobj); + *next = eina_list_data_get(eina_list_next(node)); + *prev = eina_list_data_get(eina_list_prev(node)); +} + static void _unpack(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gfx_Entity *subobj, int index); static void _unpack_all(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Eina_Bool clear); @@ -73,10 +81,13 @@ _transition_end(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd) if (pd->transition_done.content) { Eina_Value v = eina_value_object_init(pd->transition_done.content); - efl_pack_unpack(obj, pd->transition_done.content); - eina_promise_resolve(pd->transition_done.transition_done, v); + //first store the fields, then NULL them, then resolve the situation, otherwise we might get trapped in a endless recursion + Eina_Promise *p = pd->transition_done.transition_done; + Eo *content = pd->transition_done.content; pd->transition_done.transition_done = NULL; pd->transition_done.content = NULL; + efl_pack_unpack(obj, content); + eina_promise_resolve(p , v); } ev.from = pd->show_request.from; @@ -176,7 +187,7 @@ _efl_ui_spotlight_container_efl_object_constructor(Eo *obj, CRI("Failed to set layout!"); pd->position = -1; - pd->curr.page = -1; + pd->curr.page = NULL; pd->curr.pos = 0.0; pd->transition = NULL; @@ -267,24 +278,14 @@ _register_child(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gf static void _update_internals(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Efl_Gfx_Entity *subobj EINA_UNUSED, int index) { - Eina_Bool curr_page_update = EINA_FALSE; - - if (pd->curr.page >= index) - { - pd->curr.page++; - curr_page_update = EINA_TRUE; - } - pd->prevent_transition_interaction = EINA_TRUE; if (pd->transition) efl_ui_spotlight_manager_content_add(pd->transition, subobj, index); if (pd->indicator) efl_ui_spotlight_indicator_content_add(pd->indicator, subobj, index); - if (curr_page_update && !pd->transition && eina_list_count(pd->content_list) != 1) - _position_set(obj, pd, pd->curr.page); pd->prevent_transition_interaction = EINA_FALSE; if (eina_list_count(pd->content_list) == 1) - efl_ui_spotlight_active_index_set(obj, 0); + efl_ui_spotlight_active_element_set(obj, subobj); } EOLIAN static Eina_Bool @@ -386,21 +387,21 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, } EOLIAN static void -_efl_ui_spotlight_container_active_index_set(Eo *obj EINA_UNUSED, +_efl_ui_spotlight_container_active_element_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, - int index) + Efl_Ui_Widget *new_page) { - int before; + int before = -1; + int index; - if ((index < 0) || (index > ((int)eina_list_count(pd->content_list) - 1))) - { - ERR("index %d out of range", index); - return; - } + if (pd->curr.page) + before = efl_pack_index_get(obj, pd->curr.page); + index = efl_pack_index_get(obj, new_page); - before = pd->curr.page; - pd->show_request.last_pos = pd->curr.page; - pd->show_request.from = pd->curr.page; + EINA_SAFETY_ON_FALSE_RETURN(index != -1); + + pd->show_request.last_pos = efl_pack_index_get(obj, pd->curr.page); + pd->show_request.from = efl_pack_index_get(obj, pd->curr.page); pd->show_request.to = index; if (pd->show_request.active && pd->show_request.from == -1 && pd->show_request.to) @@ -410,13 +411,12 @@ _efl_ui_spotlight_container_active_index_set(Eo *obj EINA_UNUSED, _transition_start(obj, pd, before, index, before); } - int old_curr_page = pd->curr.page; - pd->curr.page = index; - efl_ui_spotlight_manager_switch_to(pd->transition, old_curr_page, pd->curr.page); + pd->curr.page = new_page; + efl_ui_spotlight_manager_switch_to(pd->transition, before, index); } -EOLIAN static int -_efl_ui_spotlight_container_active_index_get(const Eo *obj EINA_UNUSED, +EOLIAN static Efl_Ui_Widget* +_efl_ui_spotlight_container_active_element_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd) { return pd->curr.page; @@ -456,7 +456,7 @@ _unpack_all(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Container_Data *pd, Eina_Bool clear) { - pd->curr.page = -1; + pd->curr.page = NULL; while(pd->content_list) { @@ -493,15 +493,15 @@ _unpack(Eo *obj, Efl_Gfx_Entity *subobj, int index) { - int early_curr_page = pd->curr.page; - Eina_Bool deletion_of_active = (index == pd->curr.page); + int early_curr_page = efl_pack_index_get(obj, pd->curr.page); + Eina_Bool deletion_of_active = (subobj == pd->curr.page); + Efl_Ui_Widget *next, *prev; + _fetch_partners(pd->content_list, subobj, &next, &prev); pd->content_list = eina_list_remove(pd->content_list, subobj); _elm_widget_sub_object_redirect_to_top(obj, subobj); if (!efl_alive_get(obj)) return; - if (index < pd->curr.page) - pd->curr.page--; if (pd->transition) efl_ui_spotlight_manager_content_del(pd->transition, subobj, index); @@ -509,23 +509,30 @@ _unpack(Eo *obj, efl_ui_spotlight_indicator_content_del(pd->indicator, subobj, index); //we deleted the current index - if (early_curr_page == index) + if (deletion_of_active) { - int new_curr_page = MIN(MAX(early_curr_page, 0), (int)eina_list_count(pd->content_list) - 1); - //when we delete the active index and we are not updating the index, - // then force a update, so the same sort of animation is triggered from the right direction - if (deletion_of_active && new_curr_page == pd->curr.page) - pd->curr.page = index -1; - if (eina_list_count(pd->content_list) > 0 && efl_alive_get(obj)) - efl_ui_spotlight_active_index_set(obj, new_curr_page); + if (eina_list_count(pd->content_list) == 0) + { + pd->curr.page = NULL; + } else - pd->curr.page = -1; + { + //when we delete the active index and we are not updating the index, + // then force a update, so the same sort of animation is triggered from the right direction + if (early_curr_page == efl_pack_index_get(obj, prev)) + pd->curr.page = eina_list_nth(pd->content_list, early_curr_page - 1); + + if (prev) + efl_ui_spotlight_active_element_set(obj, prev); + else + efl_ui_spotlight_active_element_set(obj, next); + } } //position has updated - if (early_curr_page != pd->curr.page && early_curr_page != index && + if (deletion_of_active && pd->indicator && !pd->transition) - efl_ui_spotlight_indicator_position_update(pd->indicator, pd->curr.page); + efl_ui_spotlight_indicator_position_update(pd->indicator, efl_pack_index_get(obj, pd->curr.page)); efl_event_callback_del(subobj, EFL_EVENT_INVALIDATE, _child_inv, obj); } @@ -656,13 +663,18 @@ _efl_ui_spotlight_container_indicator_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spot EOLIAN static void _efl_ui_spotlight_container_push(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd EINA_UNUSED, Efl_Gfx_Entity *view) { - int old_active_index = efl_ui_spotlight_active_index_get(obj); + if (efl_ui_spotlight_active_element_get(obj)) + { + if (!efl_pack_before(obj, view, efl_ui_spotlight_active_element_get(obj))) + return; + } + else + { + if (!efl_pack_begin(obj, view)) + return; + } - if (old_active_index == -1) - old_active_index = 0; - - efl_pack_at(obj, view, old_active_index); - efl_ui_spotlight_active_index_set(obj, old_active_index); + efl_ui_spotlight_active_element_set(obj, view); } static Eina_Value @@ -686,13 +698,13 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei if (count == 0) return NULL; - content = efl_pack_content_get(obj, efl_ui_spotlight_active_index_get(obj)); + content = efl_ui_spotlight_active_element_get(obj); //pop() unpacks content without transition if there is one content. if (count == 1) { efl_pack_unpack(obj, content); - pd->curr.page = -1; + pd->curr.page = NULL; if (del) { @@ -706,7 +718,7 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei return efl_loop_future_resolved(obj, v); } - new_index = efl_ui_spotlight_active_index_get(obj) + 1; + new_index = efl_pack_index_get(obj, efl_ui_spotlight_active_element_get(obj)) + 1; if (new_index >= count) new_index -= 2; @@ -717,7 +729,7 @@ _efl_ui_spotlight_container_pop(Eo *obj, Efl_Ui_Spotlight_Container_Data *pd, Ei if (del) transition_done = eina_future_then(transition_done, _delete_obj, NULL); - efl_ui_spotlight_active_index_set(obj, new_index); + efl_ui_spotlight_active_element_set(obj, efl_pack_content_get(obj, new_index)); return transition_done; } diff --git a/src/lib/elementary/efl_ui_spotlight_container.eo b/src/lib/elementary/efl_ui_spotlight_container.eo index 31d39ef373..dc08b624ee 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.eo +++ b/src/lib/elementary/efl_ui_spotlight_container.eo @@ -9,7 +9,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl [[The Spotlight widget is a container for other sub-widgets, where only one sub-widget is active at any given time. Sub-widgets are added using the @Efl.Pack_Linear interface and the active one (the one in the "spotlight") is - selected using @.active_index. + selected using @.active_element. The way the different sub-widgets are rendered can be customized through the @.spotlight_manager object. For example, only the active sub-widget might be shown, or it might be shown in a central position whereas the @@ -46,14 +46,14 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl indicator : Efl.Ui.Spotlight.Indicator @owned; [[The Indicator object or $NULL.]] } } - @property active_index { + @property active_element { [[Currently active sub-widget (the one with the spotlight) among all the sub-widgets added to this widget Changing this value might trigger an animation. ]] values { - index: int; [[Index of the sub-widget that has the spotlight, from 0 to the number of sub-widgets - 1 - (@Efl.Container.content_count - 1).]] + element : Efl.Ui.Widget; [[Sub-widget that has the spotlight. + The element has to be added prior to this call via the @Efl.Pack_Linear interface.]] } } @property spotlight_size { @@ -66,7 +66,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl } } push @beta { - [[Packs a new sub-widget at the position indicated by @.active_index (0 by default). + [[Packs a new sub-widget before @.active_element, and move the spotlight there. This is the same behavior as a push operation on a stack. @@ -81,7 +81,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl The sub-widgets behind it naturally flow down so the next one gets the spotlight. This is the same behavior as a pop operation on a stack. - When combined with @.push you don't have to worry about @.active_index since only the first sub-widget is + When combined with @.push you don't have to worry about @.active_element since only the first sub-widget is manipulated. An animation might be triggered to give the new sub-widget the spotlight, come into position and the old diff --git a/src/lib/elementary/efl_ui_spotlight_indicator.eo b/src/lib/elementary/efl_ui_spotlight_indicator.eo index c846048203..a680a0e726 100644 --- a/src/lib/elementary/efl_ui_spotlight_indicator.eo +++ b/src/lib/elementary/efl_ui_spotlight_indicator.eo @@ -1,7 +1,7 @@ abstract @beta Efl.Ui.Spotlight.Indicator extends Efl.Object { [[Object used by @Efl.Ui.Spotlight.Container to render an indication of the active widgets' position among the rest of the container's widgets. - + An example would be Android's little dots in the home screen. ]] methods { @@ -19,31 +19,22 @@ abstract @beta Efl.Ui.Spotlight.Indicator extends Efl.Object { } } content_add @pure_virtual { - [[A $subobj has been added at position $index in the bound container. - - The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have - shifted due to the insertion of the new object. - ]] + [[A $subobj has been added at position $index in the bound container.]] params { subobj : Efl.Gfx.Entity; [[The new object that has been added to the container.]] index : int; [[The index of the new object in the container's list.]] } } content_del @pure_virtual { - [[The $subobj at position $index in the bound container has been removed. - - The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have - shifted due to the removal of the object. - ]] + [[The $subobj at position $index in the bound container has been removed.]] params { subobj : Efl.Gfx.Entity; [[The object being removed from the container.]] index : int; [[The index this object had in the container's list.]] } } position_update @pure_virtual { - [[This method tells the indicator that @Efl.Ui.Spotlight.Container.active_index has changed in the bound + [[This method tells the indicator that @Efl.Ui.Spotlight.Container.active_element has changed in the bound container. - $position ranges from -1 to the number of views in the bound container (@Efl.Container.content_count). Notice this allows moving to a position before the first view or past the last view, which might happen if the view is thumb-scrolled out-of-bounds. Indicators can choose to render these out-of-bounds positions or not. diff --git a/src/lib/elementary/efl_ui_spotlight_manager.eo b/src/lib/elementary/efl_ui_spotlight_manager.eo index 2257dfeefd..03f0e4fc35 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager.eo +++ b/src/lib/elementary/efl_ui_spotlight_manager.eo @@ -2,11 +2,11 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object { [[Manager object used by @Efl.Ui.Spotlight.Container to handle rendering and animation of its sub-widgets, and user interaction. - For instance, changes to the current sub-widget in the spotlight (@Efl.Ui.Spotlight.Container.active_index) can be + For instance, changes to the current sub-widget in the spotlight (@Efl.Ui.Spotlight.Container.active_element) can be animated with a transition. This object can also handle user interaction. For example, dragging the sub-widget to one side to get to a different sub-widget (like an smartphone home screen). - Such user interactions should end up setting a new @Efl.Ui.Spotlight.Container.active_index. + Such user interactions should end up setting a new @Efl.Ui.Spotlight.Container.active_element. During a transition, the evolution of the current position should be exposed by emitting $pos_update events. ]] methods { @@ -24,22 +24,14 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object { } } content_add @pure_virtual { - [[A $subobj has been added at position $index in the bound container. - - The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have - shifted due to the insertion of the new object. - ]] + [[A $subobj has been added at position $index in the bound container.]] params { subobj : Efl.Gfx.Entity; [[The new object that has been added to the container.]] index : int; [[The index of the new object in the container's list.]] } } content_del @pure_virtual { - [[The $subobj at position $index in the bound container has been removed. - - The manager should check the container's @Efl.Ui.Spotlight.Container.active_index since indices might have - shifted due to the removal of the object. - ]] + [[The $subobj at position $index in the bound container has been removed.]] params { subobj : Efl.Gfx.Entity; [[The object being removed from the container.]] index : int; [[The index this object had in the container's list.]] diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.c b/src/lib/elementary/efl_ui_spotlight_manager_plain.c index 5bbb5238f4..ec7c3a2782 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_plain.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_plain.c @@ -10,8 +10,9 @@ typedef struct { Efl_Ui_Spotlight_Container * container; Efl_Gfx_Entity *group; Eina_Size2D page_size; - int current_content; + Efl_Ui_Widget *current_content; Eina_Bool animation; + double last_pos; } Efl_Ui_Spotlight_Manager_Plain_Data; #define MY_CLASS EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS @@ -19,14 +20,17 @@ typedef struct { static void _emit_position(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) { - double absolut_position = pd->current_content; - efl_event_callback_call(obj, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &absolut_position); + double absolut_position = efl_pack_index_get(pd->container, pd->current_content); + if (pd->last_pos != absolut_position) + efl_event_callback_call(obj, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &absolut_position); + + pd->last_pos = absolut_position; } static void _geom_sync(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) { - Efl_Gfx_Entity *entity = efl_pack_content_get(pd->container, pd->current_content); + Efl_Gfx_Entity *entity = pd->current_content; Eina_Rect group_pos = efl_gfx_entity_geometry_get(pd->group); Eina_Rect goal = EINA_RECT_EMPTY(); @@ -58,7 +62,7 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp { if (spotlight && group) { - int index; + Efl_Ui_Widget *index; pd->container = spotlight; pd->group = group; @@ -70,11 +74,11 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp efl_canvas_group_member_add(pd->group, elem); efl_gfx_entity_visible_set(elem, EINA_FALSE); } - index = efl_ui_spotlight_active_index_get(spotlight); - if (index != -1) + index = efl_ui_spotlight_active_element_get(spotlight); + if (index) { pd->current_content = index; - efl_gfx_entity_visible_set(efl_pack_content_get(pd->container, pd->current_content), EINA_TRUE); + efl_gfx_entity_visible_set(pd->current_content, EINA_TRUE); _geom_sync(obj, pd); _emit_position(obj, pd); } @@ -84,15 +88,15 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp static void _content_changed(Eo *obj, Efl_Ui_Spotlight_Manager_Plain_Data *pd) { - if (efl_ui_spotlight_active_index_get(pd->container) != pd->current_content) + if (efl_ui_spotlight_active_element_get(pd->container) != pd->current_content) { - int old_current_content = pd->current_content; - pd->current_content = efl_ui_spotlight_active_index_get(pd->container); - efl_gfx_entity_visible_set(efl_pack_content_get(pd->container, old_current_content), EINA_FALSE); - efl_gfx_entity_visible_set(efl_pack_content_get(pd->container, pd->current_content), EINA_TRUE); + Efl_Ui_Widget *old_current_content = pd->current_content; + pd->current_content = efl_ui_spotlight_active_element_get(pd->container); + efl_gfx_entity_visible_set(old_current_content, EINA_FALSE); + efl_gfx_entity_visible_set(pd->current_content, EINA_TRUE); _geom_sync(obj, pd); - _emit_position(obj, pd); } + _emit_position(obj, pd); } EOLIAN static void @@ -118,13 +122,13 @@ _efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_switch_to(Eo *obj, Efl_ if (from_obj) { efl_gfx_entity_visible_set(from_obj, EINA_FALSE); - pd->current_content = -1; + pd->current_content = NULL; } if (to_obj) { efl_gfx_entity_visible_set(to_obj, EINA_TRUE); - pd->current_content = to; + pd->current_content = efl_pack_content_get(pd->container, to); } _emit_position(obj, pd); diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c index bd0000faa8..e75c3f955f 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c @@ -45,7 +45,7 @@ _apply_box_properties(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd) if (pd->transition.active) current_pos = pd->transition.from + ((double)pd->transition.to - pd->transition.from)*pd->transition.progress; else - current_pos = efl_ui_spotlight_active_index_get(pd->container); + current_pos = efl_pack_index_get(pd->container, efl_ui_spotlight_active_element_get(pd->container)); efl_gfx_entity_geometry_set(pd->foreclip, group_pos); //first calculate the size @@ -106,7 +106,7 @@ _mouse_down_cb(void *data, efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj); pd->mouse_move.active = EINA_TRUE; - pd->mouse_move.from = efl_ui_spotlight_active_index_get(pd->container); + pd->mouse_move.from = efl_pack_index_get(pd->container, efl_ui_spotlight_active_element_get(pd->container)); pd->mouse_move.mouse_start = efl_input_pointer_position_get(ev); pd->transition.from = pd->mouse_move.from; @@ -158,7 +158,8 @@ _mouse_up_cb(void *data, double absolut_current_position = (double)pd->transition.from + pd->transition.progress; int result = round(absolut_current_position); - efl_ui_spotlight_active_index_set(pd->container, MIN(MAX(result, 0), efl_content_count(pd->container) - 1)); + Efl_Ui_Widget *new_content = efl_pack_content_get(pd->container, MIN(MAX(result, 0), efl_content_count(pd->container) - 1)); + efl_ui_spotlight_active_element_set(pd->container, new_content); } EFL_CALLBACKS_ARRAY_DEFINE(mouse_listeners, diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_manager_stack.c index dbef2c200d..18756c0d5f 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.c @@ -151,9 +151,9 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_bind(Eo *obj, Efl_Ui_Sp efl_canvas_group_member_add(pd->group, elem); efl_gfx_entity_visible_set(elem, EINA_FALSE); } - if (efl_ui_spotlight_active_index_get(spotlight) != -1) + if (efl_ui_spotlight_active_element_get(spotlight)) { - pd->content = efl_pack_content_get(pd->container, efl_ui_spotlight_active_index_get(spotlight)); + pd->content = efl_ui_spotlight_active_element_get(spotlight); efl_gfx_entity_visible_set(pd->content, EINA_TRUE); _geom_sync(obj, pd); } diff --git a/src/lib/elementary/efl_ui_tab_pager.c b/src/lib/elementary/efl_ui_tab_pager.c index f1a3dc4059..745a1dcb72 100644 --- a/src/lib/elementary/efl_ui_tab_pager.c +++ b/src/lib/elementary/efl_ui_tab_pager.c @@ -12,24 +12,21 @@ #define MY_CLASS EFL_UI_TAB_PAGER_CLASS static void -_select(Eo *obj, int index) +_select(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Page *page) { - Efl_Ui_Tab_Page *page = efl_pack_content_get(obj, index); - efl_ui_selectable_selected_set(efl_ui_tab_page_tab_bar_item_get(page), EINA_TRUE); } static void _tab_select_cb(void *data, const Efl_Event *event) { - EFL_UI_TAB_PAGER_DATA_GET(data, sd); Efl_Ui_Tab_Bar_Default_Item *selected; - int i = 0; + Efl_Ui_Tab_Page *page; selected = efl_ui_single_selectable_last_selected_get(event->object); - i = efl_pack_index_get(sd->tab_bar, selected); - if (efl_ui_spotlight_active_index_get(data) != i) - efl_ui_spotlight_active_index_set(data, i); + page = efl_parent_get(selected); + if (efl_ui_spotlight_active_element_get(data)) + efl_ui_spotlight_active_element_set(data, page); } EOLIAN static Efl_Canvas_Object * @@ -39,10 +36,10 @@ _efl_ui_tab_pager_tab_bar_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tab_Pager_Data * } EOLIAN static void -_efl_ui_tab_pager_efl_ui_spotlight_container_active_index_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd EINA_UNUSED, int index) +_efl_ui_tab_pager_efl_ui_spotlight_container_active_element_set(Eo *obj, Efl_Ui_Tab_Pager_Data *sd EINA_UNUSED, Efl_Ui_Widget *element) { - efl_ui_spotlight_active_index_set(efl_super(obj, MY_CLASS), index); - _select(obj, index); + efl_ui_spotlight_active_element_set(efl_super(obj, MY_CLASS), element); + _select(obj, element); } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_tab_pager.eo b/src/lib/elementary/efl_ui_tab_pager.eo index e6b10757e6..9efb40c753 100644 --- a/src/lib/elementary/efl_ui_tab_pager.eo +++ b/src/lib/elementary/efl_ui_tab_pager.eo @@ -24,6 +24,6 @@ class @beta Efl.Ui.Tab_Pager extends Efl.Ui.Spotlight.Container Efl.Pack_Linear.pack_after; Efl.Pack_Linear.pack_at; Efl.Pack_Linear.pack_unpack_at; - Efl.Ui.Spotlight.Container.active_index { set; } + Efl.Ui.Spotlight.Container.active_element { set; } } } diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c index 0bad5c362f..9749258273 100644 --- a/src/tests/elementary/efl_ui_test_spotlight.c +++ b/src/tests/elementary/efl_ui_test_spotlight.c @@ -21,13 +21,13 @@ typedef struct { int called; Efl_Gfx_Entity *subobj; int index; - int current_page_at_call; + Efl_Ui_Widget *current_page_at_call; } content_del; struct { int called; Efl_Gfx_Entity *subobj; int index; - int current_page_at_call; + Efl_Ui_Widget *current_page_at_call; } content_add; struct { int called; @@ -43,7 +43,7 @@ _indicator_content_del(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entity indicator_calls.content_del.called ++; indicator_calls.content_del.subobj = subobj; indicator_calls.content_del.index = index; - indicator_calls.content_del.current_page_at_call = efl_ui_spotlight_active_index_get(container); + indicator_calls.content_del.current_page_at_call = efl_ui_spotlight_active_element_get(container); } static void @@ -52,7 +52,7 @@ _indicator_content_add(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entity indicator_calls.content_add.called ++; indicator_calls.content_add.subobj = subobj; indicator_calls.content_add.index = index; - indicator_calls.content_add.current_page_at_call = efl_ui_spotlight_active_index_get(container); + indicator_calls.content_add.current_page_at_call = efl_ui_spotlight_active_element_get(container); } static void @@ -92,13 +92,13 @@ typedef struct { int called; Efl_Gfx_Entity *subobj; int index; - int current_page_at_call; + Efl_Ui_Widget *current_page_at_call; } content_del; struct { int called; Efl_Gfx_Entity *subobj; int index; - int current_page_at_call; + Efl_Ui_Widget *current_page_at_call; } content_add; struct { int called; @@ -125,7 +125,9 @@ Transition_Calls transition_calls = { 0 }; static void _emit_pos(Eo *obj, double d) { + printf("EMITTING %f %f\n", d, transition_calls.last_position); if (d == transition_calls.last_position) return; + efl_event_callback_call(obj, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &d); transition_calls.last_position = d; } @@ -136,9 +138,9 @@ _transition_content_add(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entit transition_calls.content_add.called ++; transition_calls.content_add.subobj = subobj; transition_calls.content_add.index = index; - transition_calls.content_add.current_page_at_call = efl_ui_spotlight_active_index_get(container); + transition_calls.content_add.current_page_at_call = efl_ui_spotlight_active_element_get(container); - int i = efl_ui_spotlight_active_index_get(container); + int i = efl_pack_index_get(container, efl_ui_spotlight_active_element_get(container)); if (i != -1) _emit_pos(obj, i); } @@ -149,9 +151,9 @@ _transition_content_del(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Gfx_Entit transition_calls.content_del.called ++; transition_calls.content_del.subobj = subobj; transition_calls.content_del.index = index; - transition_calls.content_del.current_page_at_call = efl_ui_spotlight_active_index_get(container); + transition_calls.content_del.current_page_at_call = efl_ui_spotlight_active_element_get(container); - int i = efl_ui_spotlight_active_index_get(container); + int i = efl_pack_index_get(container, efl_ui_spotlight_active_element_get(container)); if (i != -1) _emit_pos(obj, i); } @@ -224,7 +226,7 @@ EFL_START_TEST (efl_ui_spotlight_init) Eina_Size2D s = efl_ui_spotlight_size_get(container); ck_assert_int_eq(s.w, 0); //FIXME ck_assert_int_eq(s.h, 0); //FIXME - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), -1); + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), NULL); } EFL_END_TEST @@ -232,17 +234,23 @@ EFL_START_TEST (efl_ui_spotlight_active_index) { Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); efl_pack(container, w); - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 0); - for (int i = -20; i < 20; ++i) - { - if (i == 0) continue; - EXPECT_ERROR_START; - efl_ui_spotlight_active_index_set(container, i); - EXPECT_ERROR_END; - } + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); + EXPECT_ERROR_START; + efl_ui_spotlight_active_element_set(container, 0x0); + EXPECT_ERROR_END; + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); + EXPECT_ERROR_START; + efl_ui_spotlight_active_element_set(container, (void*)0xAFFE); + EXPECT_ERROR_END; + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); + EXPECT_ERROR_START; + efl_ui_spotlight_active_element_set(container, efl_main_loop_get()); + EXPECT_ERROR_END; + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); + efl_del(w); - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), -1); + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), NULL); } EFL_END_TEST @@ -280,7 +288,7 @@ EFL_START_TEST (efl_ui_smart_transition_calls) ck_assert_int_eq(transition_calls.content_add.called, 1); ck_assert_int_eq(transition_calls.content_add.index, 0); ck_assert_ptr_eq(transition_calls.content_add.subobj, w); - ck_assert_int_eq(transition_calls.content_add.current_page_at_call, -1); + ck_assert_ptr_eq(transition_calls.content_add.current_page_at_call, NULL); ck_assert_int_eq(transition_calls.content_del.called, 0); transition_calls.content_add.called = 0; transition_calls.request_switch.called = 0; @@ -293,11 +301,11 @@ EFL_START_TEST (efl_ui_smart_transition_calls) ck_assert_int_eq(transition_calls.content_add.called, 1); ck_assert_int_eq(transition_calls.content_add.index, 0); ck_assert_ptr_eq(transition_calls.content_add.subobj, w1); - ck_assert_int_eq(transition_calls.content_add.current_page_at_call, 1); + ck_assert_ptr_eq(transition_calls.content_add.current_page_at_call, w); ck_assert_int_eq(transition_calls.content_del.called, 0); transition_calls.content_add.called = 0; transition_calls.request_switch.called = 0; - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 1); + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); //new object, must update the content and a not update current page efl_pack_end(container, w2); @@ -307,13 +315,13 @@ EFL_START_TEST (efl_ui_smart_transition_calls) ck_assert_int_eq(transition_calls.content_add.called, 1); ck_assert_int_eq(transition_calls.content_add.index, 2); ck_assert_ptr_eq(transition_calls.content_add.subobj, w2); - ck_assert_int_eq(transition_calls.content_add.current_page_at_call, 1); + ck_assert_ptr_eq(transition_calls.content_add.current_page_at_call, w); ck_assert_int_eq(transition_calls.content_del.called, 0); transition_calls.content_add.called = 0; - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 1); + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); //page change must result in a call to request a switch - efl_ui_spotlight_active_index_set(container, 2); + efl_ui_spotlight_active_element_set(container, w2); ck_assert_int_eq(transition_calls.spotlight.called, 0); ck_assert_int_eq(transition_calls.page_size.called, 0); ck_assert_int_eq(transition_calls.request_switch.called, 1); @@ -332,7 +340,7 @@ EFL_START_TEST (efl_ui_smart_transition_calls) ck_assert_int_eq(transition_calls.content_del.called, 1); ck_assert_int_eq(transition_calls.content_del.index, 1); ck_assert_ptr_eq(transition_calls.content_del.subobj, w); - ck_assert_int_eq(transition_calls.content_del.current_page_at_call, 1); + ck_assert_ptr_eq(transition_calls.content_del.current_page_at_call, w2); transition_calls.content_del.called = 0; } EFL_END_TEST @@ -486,7 +494,7 @@ _verify_transition_start_end_events(void) ck_assert_int_eq(end.from, -8); EV_RESET - efl_ui_spotlight_active_index_set(container, 2); + efl_ui_spotlight_active_element_set(container, w2); ck_assert_int_eq(start.to, 2); ck_assert_int_eq(end.to, 2); ck_assert_int_eq(start.from, 1); @@ -511,7 +519,7 @@ EFL_START_TEST (efl_ui_spotlight_test_push1) Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); efl_ui_spotlight_push(container, w); ck_assert_int_eq(efl_pack_index_get(container, w), 0); - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 0); + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 0)); } EFL_END_TEST @@ -521,13 +529,13 @@ EFL_START_TEST (efl_ui_spotlight_test_push2) { Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); efl_pack_end(container, w); + if (i == 3) + efl_ui_spotlight_active_element_set(container, w); } - efl_ui_spotlight_active_index_set(container, 3); - Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); efl_ui_spotlight_push(container, w); ck_assert_int_eq(efl_pack_index_get(container, w), 3); - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 3); + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), w); } EFL_END_TEST @@ -590,16 +598,17 @@ EFL_START_TEST (efl_ui_spotlight_test_pop3) { Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); efl_pack_end(container, w); + if (i == 3) + efl_ui_spotlight_active_element_set(container, w); } Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win); - efl_ui_spotlight_active_index_set(container, 3); efl_ui_spotlight_push(container, w); Eina_Future *f = efl_ui_spotlight_pop(container, EINA_TRUE); for (int i = 0; i < 10; ++i) { efl_loop_iterate(efl_provider_find(container, EFL_LOOP_CLASS)); } - ck_assert_int_eq(efl_ui_spotlight_active_index_get(container), 3); + ck_assert_ptr_eq(efl_ui_spotlight_active_element_get(container), efl_pack_content_get(container, 3)); ck_assert_int_eq(efl_ref_count(w), 0); ck_assert_int_eq(efl_content_count(container), 5); ck_assert_ptr_ne(f, NULL); From 9284418bea8debf33024cce88c971c02c518b4b6 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 6 Sep 2019 13:55:28 +0200 Subject: [PATCH 11/23] efl_ui_box: do not perform insertion if existing is not added this was brought up recently and it is true that this should be fixed. If existing is not registered in the container, then we should not perform the operation at all. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9860 --- src/lib/elementary/efl_ui_box.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index 58b77f1d40..04533f997e 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -282,6 +282,8 @@ _efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Ent EOLIAN static Eina_Bool _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { + EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE); + if (!_efl_ui_box_child_register(obj, pd, subobj)) return EINA_FALSE; @@ -293,6 +295,8 @@ _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_En EOLIAN static Eina_Bool _efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { + EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE); + if (!_efl_ui_box_child_register(obj, pd, subobj)) return EINA_FALSE; From fcd3d82c101e3e10c4f2dd816b1db645e7b919d6 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 6 Sep 2019 13:58:19 +0200 Subject: [PATCH 12/23] efl_ui_spotlight: do not perform insertion if existing is not added same as the previous commit, just for spotlight. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9861 --- src/lib/elementary/efl_ui_spotlight_container.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c index 9b7737415f..50a8e9a014 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.c +++ b/src/lib/elementary/efl_ui_spotlight_container.c @@ -316,9 +316,10 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_before(Eo *obj EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { - if (!_register_child(obj, pd, subobj)) return EINA_FALSE; int index = eina_list_data_idx(pd->content_list, (void *)existing); - if (index == -1) return EINA_FALSE; + EINA_SAFETY_ON_FALSE_RETURN_VAL(index >= 0, EINA_FALSE); + + if (!_register_child(obj, pd, subobj)) return EINA_FALSE; pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing); _update_internals(obj, pd, subobj, index); return EINA_TRUE; @@ -330,9 +331,10 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { - if (!_register_child(obj, pd, subobj)) return EINA_FALSE; int index = eina_list_data_idx(pd->content_list, (void *)existing); - if (index == -1) return EINA_FALSE; + EINA_SAFETY_ON_FALSE_RETURN_VAL(index >= 0, EINA_FALSE); + + if (!_register_child(obj, pd, subobj)) return EINA_FALSE; pd->content_list = eina_list_append_relative(pd->content_list, subobj, existing); _update_internals(obj, pd, subobj, index + 1); return EINA_TRUE; From c9632390864adcb3b107c7d4a5d129d3ae0d3597 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 6 Sep 2019 14:00:32 +0200 Subject: [PATCH 13/23] efl_ui_tab_bar: do not perform insertion if existing is not added same as the previous commit, just for efl_ui_tab_bar. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9862 --- src/lib/elementary/efl_ui_tab_bar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/elementary/efl_ui_tab_bar.c b/src/lib/elementary/efl_ui_tab_bar.c index a988a56b21..05e32cadd1 100644 --- a/src/lib/elementary/efl_ui_tab_bar.c +++ b/src/lib/elementary/efl_ui_tab_bar.c @@ -186,6 +186,7 @@ _efl_ui_tab_bar_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_G EOLIAN static Eina_Bool _efl_ui_tab_bar_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { + EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_pack_index_get(pd->bx, existing) >= 0, EINA_FALSE); EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE); return efl_pack_before(pd->bx, subobj, existing); } @@ -193,6 +194,7 @@ _efl_ui_tab_bar_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Ef EOLIAN static Eina_Bool _efl_ui_tab_bar_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Tab_Bar_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { + EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_pack_index_get(pd->bx, existing) >= 0, EINA_FALSE); EINA_SAFETY_ON_FALSE_RETURN_VAL(_register_item(obj, pd, subobj), EINA_FALSE); return efl_pack_after(pd->bx, subobj, existing); } From 2d2e01bdecc59f87649940645dc0ee48a49caf3b Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 6 Sep 2019 14:00:58 +0200 Subject: [PATCH 14/23] efl_ui_spec: add tests for the previous fixes we should check that if existing is not added before, that we do not perform reparenting, and that we return false. Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D9863 --- .../elementary/spec/efl_test_pack_linear.c | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/tests/elementary/spec/efl_test_pack_linear.c b/src/tests/elementary/spec/efl_test_pack_linear.c index 4747ec82b3..b66f449b8d 100644 --- a/src/tests/elementary/spec/efl_test_pack_linear.c +++ b/src/tests/elementary/spec/efl_test_pack_linear.c @@ -161,6 +161,27 @@ EFL_START_TEST(pack_before2) } EFL_END_TEST +EFL_START_TEST(pack_before3) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = create_test_widget(); + Efl_Ui_Widget *inv2 = create_test_widget(); + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_before(widget, inv, inv2), EINA_FALSE); + EXPECT_ERROR_END; + ck_assert_ptr_ne(efl_test_parent_get(inv), widget); + + ck_assert_int_eq(efl_pack_before(widget, inv, wid[0]), EINA_TRUE); + ck_assert_ptr_eq(efl_test_parent_get(inv), widget); +} +EFL_END_TEST + EFL_START_TEST(pack_after1) { Efl_Ui_Widget *wid[3]; @@ -205,6 +226,27 @@ EFL_START_TEST(pack_after2) } EFL_END_TEST +EFL_START_TEST(pack_after3) +{ + Efl_Ui_Widget *wid[3]; + Efl_Ui_Widget *inv = create_test_widget(); + Efl_Ui_Widget *inv2 = create_test_widget(); + + _fill_array(wid); + + for (int i = 0; i < 3; i++) + efl_pack_end(widget, wid[i]); + + EXPECT_ERROR_START; + ck_assert_int_eq(efl_pack_after(widget, inv, inv2), EINA_FALSE); + EXPECT_ERROR_END; + ck_assert_ptr_ne(efl_test_parent_get(inv), widget); + + ck_assert_int_eq(efl_pack_after(widget, inv, wid[0]), EINA_TRUE); + ck_assert_ptr_eq(efl_test_parent_get(inv), widget); +} +EFL_END_TEST + EFL_START_TEST(pack_at1) { for (int x = -3; x < 3; ++x) @@ -406,8 +448,10 @@ efl_pack_linear_behavior_test(TCase *tc) tcase_add_test(tc, pack_end2); tcase_add_test(tc, pack_before1); tcase_add_test(tc, pack_before2); + tcase_add_test(tc, pack_before3); tcase_add_test(tc, pack_after1); tcase_add_test(tc, pack_after2); + tcase_add_test(tc, pack_after3); tcase_add_test(tc, pack_at1); tcase_add_test(tc, pack_at2); tcase_add_test(tc, pack_at3); From a0bd73f2e0c62a198c1e36b9bfe410b22d0d6c85 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 6 Sep 2019 16:25:57 +0200 Subject: [PATCH 15/23] efl_ui_tab_*: enhance documentation Summary: just a commit bringing more information. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9864 --- src/lib/elementary/efl_ui_tab_bar.eo | 5 ++++- src/lib/elementary/efl_ui_tab_bar_default_item.eo | 5 ++++- src/lib/elementary/efl_ui_tab_page.eo | 6 +++++- src/lib/elementary/efl_ui_tab_pager.eo | 9 +++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/lib/elementary/efl_ui_tab_bar.eo b/src/lib/elementary/efl_ui_tab_bar.eo index b4aabe1197..996a897b98 100644 --- a/src/lib/elementary/efl_ui_tab_bar.eo +++ b/src/lib/elementary/efl_ui_tab_bar.eo @@ -2,7 +2,10 @@ 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 { - [[Tab Bar class]] + [[A selectable box of items. + + Within one object only one @Efl.Ui.Tab_Bar_Default_Item can be selected at the same time. + ]] methods { } diff --git a/src/lib/elementary/efl_ui_tab_bar_default_item.eo b/src/lib/elementary/efl_ui_tab_bar_default_item.eo index 22034d8957..7feb31d981 100644 --- a/src/lib/elementary/efl_ui_tab_bar_default_item.eo +++ b/src/lib/elementary/efl_ui_tab_bar_default_item.eo @@ -1,6 +1,9 @@ class @beta Efl.Ui.Tab_Bar_Default_Item extends Efl.Ui.Default_Item { - [[ A icon that represents the default parts in the appearance of the tab bar. ]] + [[ A icon that represents the default parts in the appearance of the tab bar. + + Setting the icon again after there was a previous one, will trigger an animation. + ]] methods { @property icon { [[Set the content of the default item as a image. diff --git a/src/lib/elementary/efl_ui_tab_page.eo b/src/lib/elementary/efl_ui_tab_page.eo index d13dde7ac6..4b21dc6241 100644 --- a/src/lib/elementary/efl_ui_tab_page.eo +++ b/src/lib/elementary/efl_ui_tab_page.eo @@ -1,6 +1,10 @@ class @beta Efl.Ui.Tab_Page extends Efl.Ui.Layout_Base implements Efl.Content { - [[Tab Page class]] + [[A holder class for setting up a page in the pager. + + The item assosiated with this page can be used to setup a item which will later be displayed in the @Efl.Ui.Tab_Bar + of the @Efl.Ui.Tab_Pager where this page was added to. + ]] methods { @property tab_bar_item { [[Get this page represented as a @Efl.Ui.Tab_Bar_Default_Item diff --git a/src/lib/elementary/efl_ui_tab_pager.eo b/src/lib/elementary/efl_ui_tab_pager.eo index 9efb40c753..9f4bb42d4f 100644 --- a/src/lib/elementary/efl_ui_tab_pager.eo +++ b/src/lib/elementary/efl_ui_tab_pager.eo @@ -1,13 +1,18 @@ class @beta Efl.Ui.Tab_Pager extends Efl.Ui.Spotlight.Container { - [[Tab Pager class]] + [[Container for @Efl.Ui.Tab_Page + + This container consists out of a Efl.Ui.Tab_Bar and a place to display the content of the pages. + The items that are generated out of the pages will be displayed in the tab bar of this pager. + ]] methods { @property tab_bar { + [[Tab bar where to add items of the @Efl.Ui.Tab_Page into.]] get { } values { - tab_bar: Efl.Canvas.Object; + tab_bar: Efl.Ui.Tab_Bar; [[Tab bar for the items of the @Efl.Ui.Tab_Page]] } } } From d1c5e201be98875ce9a7a574719591bc7e7200f0 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 6 Sep 2019 15:39:10 +0100 Subject: [PATCH 16/23] fix xpm again - to be threaded not region decode capable --- src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c index af36c3c49a..5ac8c87c55 100644 --- a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c +++ b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c @@ -2221,8 +2221,8 @@ static Evas_Image_Load_Func evas_image_load_xpm_func = NULL, (void*) evas_image_load_file_data_xpm, NULL, - EINA_FALSE, - EINA_TRUE + EINA_TRUE, + EINA_FALSE }; static int From 67c2a4f5f10595d4e47484d887298b87ab26a506 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 6 Sep 2019 16:58:08 +0200 Subject: [PATCH 17/23] eolian: disallow duplicate entries in requires/composite sections --- src/lib/eolian/eo_parser.c | 40 ++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 975c2a880b..e010a3fc30 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -2157,14 +2157,28 @@ _requires_add(Eo_Lexer *ls, Eina_Strbuf *buf) { const char *required; char *fnm; + Eina_List *l; + const char *oname; + char ebuf[PATH_MAX]; eina_strbuf_reset(buf); eo_lexer_context_push(ls); parse_name(ls, buf); - required = eina_strbuf_string_get(buf); + required = eina_stringshare_add(eina_strbuf_string_get(buf)); + + EINA_LIST_FOREACH(ls->klass->requires, l, oname) + if (required == oname) + { + eo_lexer_context_restore(ls); + eina_stringshare_del(required); + snprintf(ebuf, sizeof(ebuf), "duplicate entry '%s'", oname); + eo_lexer_syntax_error(ls, ebuf); + return; + } + fnm = database_class_to_filename(required); - ls->klass->requires = eina_list_append(ls->klass->requires, eina_stringshare_add(required)); + ls->klass->requires = eina_list_append(ls->klass->requires, required); database_defer(ls->state, fnm, EINA_TRUE); eo_lexer_context_pop(ls); @@ -2174,25 +2188,39 @@ _requires_add(Eo_Lexer *ls, Eina_Strbuf *buf) static void _composite_add(Eo_Lexer *ls, Eina_Strbuf *buf) { + const char *oname; + char ebuf[PATH_MAX]; + Eina_List *l; + eina_strbuf_reset(buf); eo_lexer_context_push(ls); parse_name(ls, buf); - const char *nm = eina_strbuf_string_get(buf); + const char *nm = eina_stringshare_add(eina_strbuf_string_get(buf)); + + EINA_LIST_FOREACH(ls->klass->composite, l, oname) + if (nm == oname) + { + eo_lexer_context_restore(ls); + snprintf(ebuf, sizeof(ebuf), "duplicate entry '%s'", nm); + eina_stringshare_del(nm); + eo_lexer_syntax_error(ls, ebuf); + return; + } + char *fnm = database_class_to_filename(nm); if (!eina_hash_find(ls->state->filenames_eo, fnm)) { free(fnm); - char ebuf[PATH_MAX]; eo_lexer_context_restore(ls); snprintf(ebuf, sizeof(ebuf), "unknown interface '%s'", nm); + eina_stringshare_del(nm); eo_lexer_syntax_error(ls, ebuf); return; } /* do not introduce a dependency */ database_defer(ls->state, fnm, EINA_FALSE); free(fnm); - ls->klass->composite = eina_list_append(ls->klass->composite, - eina_stringshare_add(nm)); + ls->klass->composite = eina_list_append(ls->klass->composite, nm); eo_lexer_context_pop(ls); } From 4f4b58bf4c6c7638c4073ae092b0a870b95a199e Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 6 Sep 2019 17:01:05 +0200 Subject: [PATCH 18/23] efl: change all occurences of @owned to @move --- src/lib/ecore/efl_container_model.eo | 2 +- src/lib/ecore/efl_core_command_line.eo | 2 +- src/lib/ecore/efl_io_copier.eo | 2 +- src/lib/ecore/efl_loop.eo | 6 ++--- src/lib/ecore/efl_loop_consumer.eo | 2 +- src/lib/ecore/efl_task.eo | 2 +- .../ecore_con/efl_net_control_access_point.eo | 22 +++++++++---------- src/lib/ecore_con/efl_net_control_manager.eo | 4 ++-- .../ecore_con/efl_net_control_technology.eo | 2 +- src/lib/ecore_con/efl_net_dialer_http.eo | 8 +++---- src/lib/ecore_con/efl_net_dialer_websocket.eo | 6 ++--- src/lib/ecore_con/efl_net_ip_address.eo | 6 ++--- src/lib/ecore_con/efl_net_server_udp.eo | 2 +- src/lib/ecore_con/efl_net_socket_udp.eo | 2 +- src/lib/ecore_con/efl_net_ssl_context.eo | 8 +++---- src/lib/edje/efl_canvas_layout.eo | 2 +- src/lib/efl/interfaces/efl_canvas_scene.eo | 6 ++--- src/lib/efl/interfaces/efl_config.eo | 2 +- src/lib/efl/interfaces/efl_container.eo | 2 +- src/lib/efl/interfaces/efl_duplicate.eo | 2 +- src/lib/efl/interfaces/efl_input_device.eo | 2 +- src/lib/efl/interfaces/efl_io_buffer.eo | 2 +- src/lib/efl/interfaces/efl_model.eo | 2 +- src/lib/efl/interfaces/efl_observable.eo | 6 ++--- src/lib/efl/interfaces/efl_pack_table.eo | 2 +- src/lib/efl/interfaces/efl_text_annotate.eo | 2 +- .../interfaces/efl_text_markup_interactive.eo | 2 +- .../efl/interfaces/efl_text_markup_util.eo | 4 ++-- src/lib/efl/interfaces/efl_ui_menu.eo | 2 +- src/lib/eio/efl_io_manager.eo | 16 +++++++------- src/lib/elementary/efl_access_action.eo | 2 +- src/lib/elementary/efl_access_object.eo | 4 ++-- src/lib/elementary/efl_access_text.eo | 12 +++++----- src/lib/elementary/efl_config_global.eo | 4 ++-- src/lib/elementary/efl_ui_collection.eo | 2 +- .../elementary/efl_ui_focus_composition.eo | 2 +- src/lib/elementary/efl_ui_focus_manager.eo | 10 ++++----- .../elementary/efl_ui_focus_manager_calc.eo | 4 ++-- src/lib/elementary/efl_ui_multi_selectable.eo | 2 +- .../elementary/efl_ui_spotlight_container.eo | 4 ++-- src/lib/elementary/efl_ui_view_model.eo | 2 +- src/lib/eo/efl_object.eo | 2 +- src/lib/evas/canvas/efl_canvas_group.eo | 2 +- src/lib/evas/canvas/efl_canvas_text.eo | 8 +++---- .../evas/canvas/efl_canvas_text_factory.eo | 2 +- .../evas/canvas/efl_canvas_vg_container.eo | 2 +- src/tests/eolian_cxx/complex.eo | 4 ++-- .../eolian_js/constructor_method_class.eo | 4 ++-- src/tests/eolian_js/test_object.eo | 4 ++-- 49 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/lib/ecore/efl_container_model.eo b/src/lib/ecore/efl_container_model.eo index 3b3ab00ad1..1acdd8543f 100644 --- a/src/lib/ecore/efl_container_model.eo +++ b/src/lib/ecore/efl_container_model.eo @@ -33,7 +33,7 @@ class @beta Efl.Container_Model extends Efl.Composite_Model params { name: string; [[Property name]] @in type: ptr(const(Eina.Value_Type)); [[Property type]] - values: iterator @owned; [[Values to be added]] + values: iterator @move; [[Values to be added]] } return: bool; [[$true on success, $false otherwise]] } diff --git a/src/lib/ecore/efl_core_command_line.eo b/src/lib/ecore/efl_core_command_line.eo index fff7157d12..6a7511d9ad 100644 --- a/src/lib/ecore/efl_core_command_line.eo +++ b/src/lib/ecore/efl_core_command_line.eo @@ -61,7 +61,7 @@ mixin @beta Efl.Core.Command_Line { return : bool; [[On success $true, $false otherwise]] } values { - array : array @owned; [[An array where every array field is an argument]] + array : array @move; [[An array where every array field is an argument]] } } @property command_string { diff --git a/src/lib/ecore/efl_io_copier.eo b/src/lib/ecore/efl_io_copier.eo index 8b7301b14b..2e9506d394 100644 --- a/src/lib/ecore/efl_io_copier.eo +++ b/src/lib/ecore/efl_io_copier.eo @@ -313,7 +313,7 @@ class @beta Efl.Io.Copier extends Efl.Loop_Consumer implements Efl.Io.Closer { which case you should wait for "done", "data" or "line" events and then call it to retrieve and own the data. ]] - return: ptr(Eina.Binbuf) @owned @no_unused; [[Binbuf]] + return: ptr(Eina.Binbuf) @move @no_unused; [[Binbuf]] } @property pending_size { diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo index 20f0389f57..ea263fb738 100644 --- a/src/lib/ecore/efl_loop.eo +++ b/src/lib/ecore/efl_loop.eo @@ -53,7 +53,7 @@ abstract Efl.Loop extends Efl.Task This has higher priority, for low priority use @.idle ]] - return: future @owned; [[The future handle.]] + return: future @move; [[The future handle.]] } @property throttle { [[Slow down the loop execution by forcing sleep for a small @@ -95,7 +95,7 @@ abstract Efl.Loop extends Efl.Task This is a low priority version of @.job ]] - return: future @owned; [[The future handle.]] + return: future @move; [[The future handle.]] } timeout { [[A future promise that will be resolved from a clean main @@ -103,7 +103,7 @@ abstract Efl.Loop extends Efl.Task params { @in time: double; [[The time from now in second that the main loop will wait before triggering it.]] } - return: future @owned; [[The future handle.]] + return: future @move; [[The future handle.]] } } events { diff --git a/src/lib/ecore/efl_loop_consumer.eo b/src/lib/ecore/efl_loop_consumer.eo index c391d29f03..56045787ee 100644 --- a/src/lib/ecore/efl_loop_consumer.eo +++ b/src/lib/ecore/efl_loop_consumer.eo @@ -52,7 +52,7 @@ abstract Efl.Loop_Consumer extends Efl.Object [[Create a new promise with the scheduler coming from the loop provided by this object. Note: You should not use eina_promise_data_set as this function rely on controlling the promise data.]] - return: ptr(Eina.Promise) @owned; [[The new promise.]] + return: ptr(Eina.Promise) @move; [[The new promise.]] } } implements { diff --git a/src/lib/ecore/efl_task.eo b/src/lib/ecore/efl_task.eo index 9fe006a34c..baf8ce80b5 100644 --- a/src/lib/ecore/efl_task.eo +++ b/src/lib/ecore/efl_task.eo @@ -54,7 +54,7 @@ abstract Efl.Task extends Efl.Loop_Consumer } run @pure_virtual { [[Actually run the task.]] - return: future @owned; [[A future triggered when task exits and is passed int exit code.]] + return: future @move; [[A future triggered when task exits and is passed int exit code.]] } end @pure_virtual { [[Request the task end (may send a signal or interrupt diff --git a/src/lib/ecore_con/efl_net_control_access_point.eo b/src/lib/ecore_con/efl_net_control_access_point.eo index 3acf2a2f17..1093f0f5ed 100644 --- a/src/lib/ecore_con/efl_net_control_access_point.eo +++ b/src/lib/ecore_con/efl_net_control_access_point.eo @@ -94,7 +94,7 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { EINPROGRESS (the connection was already ongoing) and EALREADY (the connection was already established). ]] - return: future @owned; [[Future for asynchronous connect]] + return: future @move; [[Future for asynchronous connect]] } disconnect { @@ -252,7 +252,7 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { ]] get { } values { - name_servers: iterator @owned; [[Iterator to DNS server]] + name_servers: iterator @move; [[Iterator to DNS server]] } } @@ -266,7 +266,7 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { ]] get { } values { - time_servers: iterator @owned; [[Iterator to time server]] + time_servers: iterator @move; [[Iterator to time server]] } } @@ -280,7 +280,7 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { ]] get { } values { - domains: iterator @owned; [[Iterator to search domains]] + domains: iterator @move; [[Iterator to search domains]] } } @@ -331,8 +331,8 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { values { method: Efl.Net.Control.Access_Point_Proxy_Method; [[Proxy method]] url: string; [[If @Efl.Net.Control.Access_Point_Proxy_Method.auto, then states the URL to use for proxy auto-configuration]] - servers: iterator @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]] - excludes: iterator @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]] + servers: iterator @move; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]] + excludes: iterator @move; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]] } } @@ -348,7 +348,7 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { set { } get { } values { - name_servers: iterator @owned; [[Iterator to user DNS server]] + name_servers: iterator @move; [[Iterator to user DNS server]] } } @@ -364,7 +364,7 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { set { } get { } values { - time_servers: iterator @owned; [[Iterator to user time server]] + time_servers: iterator @move; [[Iterator to user time server]] } } @@ -380,7 +380,7 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { set { } get { } values { - domains: iterator @owned; [[Iterator to user search domains]] + domains: iterator @move; [[Iterator to user search domains]] } } @@ -437,8 +437,8 @@ class @beta Efl.Net.Control.Access_Point extends Efl.Loop_Consumer { values { method: Efl.Net.Control.Access_Point_Proxy_Method; [[Proxy method]] url: string; [[If @Efl.Net.Control.Access_Point_Proxy_Method.auto, then states the URL to use for proxy auto-configuration]] - servers: iterator @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]] - excludes: iterator @owned; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]] + servers: iterator @move; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]] + excludes: iterator @move; [[If @Efl.Net.Control.Access_Point_Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]] } } } diff --git a/src/lib/ecore_con/efl_net_control_manager.eo b/src/lib/ecore_con/efl_net_control_manager.eo index 137d7feaaa..4d7d232c7e 100644 --- a/src/lib/ecore_con/efl_net_control_manager.eo +++ b/src/lib/ecore_con/efl_net_control_manager.eo @@ -148,7 +148,7 @@ class @beta Efl.Net.Control.Manager extends Efl.Loop_Consumer { ]] get { } values { - access_points: iterator @owned; [[Iterator of current access points]] + access_points: iterator @move; [[Iterator of current access points]] } } @@ -162,7 +162,7 @@ class @beta Efl.Net.Control.Manager extends Efl.Loop_Consumer { ]] get { } values { - technologies: iterator @owned; [[Iterator of current technologies]] + technologies: iterator @move; [[Iterator of current technologies]] } } diff --git a/src/lib/ecore_con/efl_net_control_technology.eo b/src/lib/ecore_con/efl_net_control_technology.eo index 01daedd7d3..b44e988cd5 100644 --- a/src/lib/ecore_con/efl_net_control_technology.eo +++ b/src/lib/ecore_con/efl_net_control_technology.eo @@ -86,7 +86,7 @@ class @beta Efl.Net.Control.Technology extends Efl.Loop_Consumer { state. Otherwise allow the system to perform passive scans in a timely manner. ]] - return: future @owned; [[Future return for finished background scan]] + return: future @move; [[Future return for finished background scan]] } } diff --git a/src/lib/ecore_con/efl_net_dialer_http.eo b/src/lib/ecore_con/efl_net_dialer_http.eo index a44b50a251..ceca602c26 100644 --- a/src/lib/ecore_con/efl_net_dialer_http.eo +++ b/src/lib/ecore_con/efl_net_dialer_http.eo @@ -187,7 +187,7 @@ class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dia request_headers_get { [[Returns an iterator to the key-value pairs for request headers]] - return: iterator @owned @no_unused; [[Iterator for request headers]] + return: iterator @move @no_unused; [[Iterator for request headers]] } @property request_content_length { @@ -250,7 +250,7 @@ class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dia This will be usable after the "headers,done" event is dispatched. ]] - return: iterator @owned @no_unused; [[Iterator for response headers]] + return: iterator @move @no_unused; [[Iterator for response headers]] } response_headers_all_get { @@ -275,7 +275,7 @@ class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dia This will be usable after the "headers,done" event is dispatched. ]] - return: iterator @owned @no_unused; [[Iterator for all response headers]] + return: iterator @move @no_unused; [[Iterator for all response headers]] } response_headers_clear { @@ -381,7 +381,7 @@ class @beta Efl.Net.Dialer_Http extends Efl.Loop_Consumer implements Efl.Net.Dia params { epochtime: int64; [[UNIX Epoch time - seconds since 1/1/1970]] } - return: mstring @owned @no_unused; [[Newly allocated null-terminated string on success or NULL on errors]] + return: mstring @move @no_unused; [[Newly allocated null-terminated string on success or NULL on errors]] } } diff --git a/src/lib/ecore_con/efl_net_dialer_websocket.eo b/src/lib/ecore_con/efl_net_dialer_websocket.eo index 904eacf283..5224030101 100644 --- a/src/lib/ecore_con/efl_net_dialer_websocket.eo +++ b/src/lib/ecore_con/efl_net_dialer_websocket.eo @@ -144,7 +144,7 @@ class @beta Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Ne request_protocols_get { [[Returns an iterator to the requested WebSocket protocols]] - return: iterator @owned @no_unused; [[Iterator to protocols]] + return: iterator @move @no_unused; [[Iterator to protocols]] } request_protocols_clear { @@ -153,7 +153,7 @@ class @beta Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Ne response_protocols_get { [[Returns an iterator to the server-replied (response) WebSocket protocols it supports]] - return: iterator @owned @no_unused; [[Iterator to server protocols]] + return: iterator @move @no_unused; [[Iterator to server protocols]] } @property streaming_mode { @@ -260,7 +260,7 @@ class @beta Efl.Net.Dialer_Websocket extends Efl.Loop_Consumer implements Efl.Ne request_headers_get { [[Returns an iterator to the key-value pairs for request headers]] - return: iterator @owned @no_unused; [[Iterator to key value pairs]] + return: iterator @move @no_unused; [[Iterator to key value pairs]] } @property cookie_jar { diff --git a/src/lib/ecore_con/efl_net_ip_address.eo b/src/lib/ecore_con/efl_net_ip_address.eo index 3d6eaba13b..d1be8b7d5c 100644 --- a/src/lib/ecore_con/efl_net_ip_address.eo +++ b/src/lib/ecore_con/efl_net_ip_address.eo @@ -48,7 +48,7 @@ class @beta Efl.Net.Ip_Address extends Efl.Object { port: uint16; [[Port number in Host/Native endianess]] address: const(Eina.Slice); [[Address bytes. If 4 bytes, AF_INET will be used. If 16 bytes, AF_INET6 will be used. All other sizes will result in failure.]] } - return: Efl.Net.Ip_Address @owned; [[Newly created object or $NULL if parameters were invalid.]] + return: Efl.Net.Ip_Address @move; [[Newly created object or $NULL if parameters were invalid.]] } create_sockaddr @static { @@ -61,7 +61,7 @@ class @beta Efl.Net.Ip_Address extends Efl.Object { params { sockaddr: const(void_ptr); [[The pointer to struct sockaddr-compatible handle as per .]] } - return: Efl.Net.Ip_Address @owned; [[Newly created object or $NULL if parameter was invalid.]] + return: Efl.Net.Ip_Address @move; [[Newly created object or $NULL if parameter was invalid.]] } parse @static { @@ -85,7 +85,7 @@ class @beta Efl.Net.Ip_Address extends Efl.Object { params { numeric_address: string; [[The numeric address to parse, such as '127.0.0.1:1234' or '[::1]:1234']] } - return: Efl.Net.Ip_Address @owned; [[The new IP address object or NULL if it failed to parse]] + return: Efl.Net.Ip_Address @move; [[The new IP address object or NULL if it failed to parse]] } resolve @static { diff --git a/src/lib/ecore_con/efl_net_server_udp.eo b/src/lib/ecore_con/efl_net_server_udp.eo index edb9471696..3a45be9b73 100644 --- a/src/lib/ecore_con/efl_net_server_udp.eo +++ b/src/lib/ecore_con/efl_net_server_udp.eo @@ -58,7 +58,7 @@ class @beta Efl.Net.Server_Udp extends Efl.Net.Server_Ip { The iterator is only valid until a new group is joined or left using @.multicast_join or @.multicast_leave. ]] - return: iterator @owned; [[List of multicast groups]] + return: iterator @move; [[List of multicast groups]] } @property multicast_time_to_live { diff --git a/src/lib/ecore_con/efl_net_socket_udp.eo b/src/lib/ecore_con/efl_net_socket_udp.eo index 561473b478..3a3849014d 100644 --- a/src/lib/ecore_con/efl_net_socket_udp.eo +++ b/src/lib/ecore_con/efl_net_socket_udp.eo @@ -109,7 +109,7 @@ class @beta Efl.Net.Socket_Udp extends Efl.Net.Socket_Fd { The iterator is only valid until a new group is joined or left using @.multicast_join or @.multicast_leave. ]] - return: iterator @owned; [[Iterator to multicast groups]] + return: iterator @move; [[Iterator to multicast groups]] } @property multicast_time_to_live { diff --git a/src/lib/ecore_con/efl_net_ssl_context.eo b/src/lib/ecore_con/efl_net_ssl_context.eo index fb40620dfc..cddbafdcdd 100644 --- a/src/lib/ecore_con/efl_net_ssl_context.eo +++ b/src/lib/ecore_con/efl_net_ssl_context.eo @@ -46,7 +46,7 @@ class @beta Efl.Net.Ssl.Context extends Efl.Object { Can only be set during object construction! ]] values { - paths: iterator @owned; [[Path list for certificates]] + paths: iterator @move; [[Path list for certificates]] } } @@ -56,7 +56,7 @@ class @beta Efl.Net.Ssl.Context extends Efl.Object { Can only be set during object construction! ]] values { - paths: iterator @owned; [[Path list for private keys]] + paths: iterator @move; [[Path list for private keys]] } } @@ -66,7 +66,7 @@ class @beta Efl.Net.Ssl.Context extends Efl.Object { Can only be set during object construction! ]] values { - paths: iterator @owned; [[Path list for CRL's]] + paths: iterator @move; [[Path list for CRL's]] } } @@ -76,7 +76,7 @@ class @beta Efl.Net.Ssl.Context extends Efl.Object { Can only be set during object construction! ]] values { - paths: iterator @owned; [[Path list for CA's]] + paths: iterator @move; [[Path list for CA's]] } } diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo index f5c1a2ccb1..0644fddc56 100644 --- a/src/lib/edje/efl_canvas_layout.eo +++ b/src/lib/edje/efl_canvas_layout.eo @@ -34,7 +34,7 @@ class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl. access_part_iterate @beta { [[Iterates over all accessibility-enabled part names.]] - return: iterator @owned; [[Part name iterator]] + return: iterator @move; [[Part name iterator]] } @property seat { get { diff --git a/src/lib/efl/interfaces/efl_canvas_scene.eo b/src/lib/efl/interfaces/efl_canvas_scene.eo index 43dafdd04d..22d97d4630 100644 --- a/src/lib/efl/interfaces/efl_canvas_scene.eo +++ b/src/lib/efl/interfaces/efl_canvas_scene.eo @@ -51,7 +51,7 @@ interface Efl.Canvas.Scene Warning: This function will only evaluate top-level objects; child or "sub" objects will be skipped. ]] - return: iterator @owned @no_unused; [[ + return: iterator @move @no_unused; [[ The list of objects that are over the given position in $e. ]] params { @@ -103,7 +103,7 @@ interface Efl.Canvas.Scene Warning: This function will only evaluate top-level objects; child or "sub" objects will be skipped. ]] - return: iterator @owned @no_unused; [[Iterator to objects]] + return: iterator @move @no_unused; [[Iterator to objects]] params { @in rect: Eina.Rect; [[The rectangular region.]] @in include_pass_events_objects: bool; [[ @@ -153,7 +153,7 @@ interface Efl.Canvas.Scene a pointer and a keyboard. A seat object is the parent of the individual input devices. ]] - return: iterator @owned; + return: iterator @move; [[An iterator over the attached seats.]] } /* FIXME Efl.Input.Device is not stable yet*/ diff --git a/src/lib/efl/interfaces/efl_config.eo b/src/lib/efl/interfaces/efl_config.eo index e6605d4282..0e482577b0 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 @owned; + value: any_value_ptr @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).]] } diff --git a/src/lib/efl/interfaces/efl_container.eo b/src/lib/efl/interfaces/efl_container.eo index afafe451cf..992e9f98d8 100644 --- a/src/lib/efl/interfaces/efl_container.eo +++ b/src/lib/efl/interfaces/efl_container.eo @@ -12,7 +12,7 @@ interface Efl.Container methods { content_iterate { [[Begin iterating over this object's contents.]] - return: iterator @owned @no_unused; [[Iterator on object's content.]] + return: iterator @move @no_unused; [[Iterator on object's content.]] } content_count { [[Returns the number of contained sub-objects.]] diff --git a/src/lib/efl/interfaces/efl_duplicate.eo b/src/lib/efl/interfaces/efl_duplicate.eo index 6419f35280..0a8a712cd5 100644 --- a/src/lib/efl/interfaces/efl_duplicate.eo +++ b/src/lib/efl/interfaces/efl_duplicate.eo @@ -11,7 +11,7 @@ interface @beta Efl.Duplicate The newly created object will have no event handlers or anything of the sort. ]] - return: Efl.Duplicate @owned; [[Returned carbon copy]] + return: Efl.Duplicate @move; [[Returned carbon copy]] } } } diff --git a/src/lib/efl/interfaces/efl_input_device.eo b/src/lib/efl/interfaces/efl_input_device.eo index a015cf83f4..783b261c95 100644 --- a/src/lib/efl/interfaces/efl_input_device.eo +++ b/src/lib/efl/interfaces/efl_input_device.eo @@ -65,7 +65,7 @@ class Efl.Input.Device extends Efl.Object This is only meaningful with seat devices, as they are groups of real input devices. ]] - return: iterator @owned; [[List of device children]] + return: iterator @move; [[List of device children]] } @property pointer_device_count { [[The number of pointer devices in this seat. diff --git a/src/lib/efl/interfaces/efl_io_buffer.eo b/src/lib/efl/interfaces/efl_io_buffer.eo index f54bba953a..eefdf8e507 100644 --- a/src/lib/efl/interfaces/efl_io_buffer.eo +++ b/src/lib/efl/interfaces/efl_io_buffer.eo @@ -133,7 +133,7 @@ class @beta Efl.Io.Buffer extends Efl.Object On failure, for example a read-only backing store was adopted with @.adopt_readonly, NULL is returned. ]] - return: ptr(Eina.Binbuf) @owned @no_unused; [[Binbuf]] + return: ptr(Eina.Binbuf) @move @no_unused; [[Binbuf]] } } diff --git a/src/lib/efl/interfaces/efl_model.eo b/src/lib/efl/interfaces/efl_model.eo index 8e58c24926..a425487822 100644 --- a/src/lib/efl/interfaces/efl_model.eo +++ b/src/lib/efl/interfaces/efl_model.eo @@ -31,7 +31,7 @@ interface @beta Efl.Model ]] } values { - properties: iterator @owned; [[Array of current properties]] + properties: iterator @move; [[Array of current properties]] } } @property property { diff --git a/src/lib/efl/interfaces/efl_observable.eo b/src/lib/efl/interfaces/efl_observable.eo index babfe21c59..40deba9e8b 100644 --- a/src/lib/efl/interfaces/efl_observable.eo +++ b/src/lib/efl/interfaces/efl_observable.eo @@ -4,7 +4,7 @@ struct @beta @free(efl_observable_tuple_free) Efl.Observable_Tuple { [[This type describes an observable touple]] key: string; [[Touple key]] - data: iterator @owned; [[Touple data]] + data: iterator @move; [[Touple data]] } class @beta Efl.Observable extends Efl.Object { @@ -41,7 +41,7 @@ class @beta Efl.Observable extends Efl.Object { observers_iterator_new { [[Return a new iterator associated with a group of observers. ]] - return: iterator @owned; [[Iterator for observers group]] + return: iterator @move; [[Iterator for observers group]] params { @in key: string; [[A key to classify observer groups]] } @@ -57,7 +57,7 @@ class @beta Efl.Observable extends Efl.Object { iterator_tuple_new { [[Return a new iterator associated to this observable. ]] - return: iterator @owned; [[Iterator for observer]] + return: iterator @move; [[Iterator for observer]] } } implements { diff --git a/src/lib/efl/interfaces/efl_pack_table.eo b/src/lib/efl/interfaces/efl_pack_table.eo index b2d4b31f1b..18adfb8225 100644 --- a/src/lib/efl/interfaces/efl_pack_table.eo +++ b/src/lib/efl/interfaces/efl_pack_table.eo @@ -25,7 +25,7 @@ interface @beta Efl.Pack_Table extends Efl.Pack } table_contents_get { [[Returns all objects at a given position in this table.]] - return: iterator @owned; [[Iterator to table contents]] + return: iterator @move; [[Iterator to table contents]] params { @in col: int; [[Column number]] @in row: int; [[Row number]] diff --git a/src/lib/efl/interfaces/efl_text_annotate.eo b/src/lib/efl/interfaces/efl_text_annotate.eo index 724faeb0a3..1226628683 100644 --- a/src/lib/efl/interfaces/efl_text_annotate.eo +++ b/src/lib/efl/interfaces/efl_text_annotate.eo @@ -33,7 +33,7 @@ interface @beta Efl.Text_Annotate { @in start: ptr(const(Efl.Text_Cursor_Cursor)); [[Start of range]] @in end: ptr(const(Efl.Text_Cursor_Cursor)); [[End of range]] } - return: iterator @owned; [[Handle of the Annotation]] + return: iterator @move; [[Handle of the Annotation]] } annotation_insert { [[Inserts an annotation format in a specified range [$start, $end - 1]. diff --git a/src/lib/efl/interfaces/efl_text_markup_interactive.eo b/src/lib/efl/interfaces/efl_text_markup_interactive.eo index cbb4906ac2..7b2da3a2fe 100644 --- a/src/lib/efl/interfaces/efl_text_markup_interactive.eo +++ b/src/lib/efl/interfaces/efl_text_markup_interactive.eo @@ -5,7 +5,7 @@ interface @beta Efl.Text_Markup_Interactive extends Efl.Text_Cursor { @property markup_range { [[Markup of a given range in the text]] values { - markup: mstring @owned; [[The markup-text representation set to + markup: mstring @move; [[The markup-text representation set to this text of a given range]] } keys { diff --git a/src/lib/efl/interfaces/efl_text_markup_util.eo b/src/lib/efl/interfaces/efl_text_markup_util.eo index 5b2bd589ee..90d63e10d4 100644 --- a/src/lib/efl/interfaces/efl_text_markup_util.eo +++ b/src/lib/efl/interfaces/efl_text_markup_util.eo @@ -11,7 +11,7 @@ class @beta Efl.Text_Markup_Util { params { @in text: string; [[The text (UTF-8) to convert to markup]] } - return: mstring @owned; [[The markup representation of given text]] + return: mstring @move; [[The markup representation of given text]] } markup_to_text @static { [[Converts a given (UTF-8) text to a markup-compatible string. @@ -21,7 +21,7 @@ class @beta Efl.Text_Markup_Util { params { @in text: string; [[The markup-text to convert to text (UTF-8)]] } - return: mstring @owned; [[The text representation of given format]] + return: mstring @move; [[The text representation of given format]] } } } diff --git a/src/lib/efl/interfaces/efl_ui_menu.eo b/src/lib/efl/interfaces/efl_ui_menu.eo index 260b1cfd41..ca76bf2639 100644 --- a/src/lib/efl/interfaces/efl_ui_menu.eo +++ b/src/lib/efl/interfaces/efl_ui_menu.eo @@ -28,7 +28,7 @@ interface @beta Efl.Ui.Menu { @property items { get { [[Returns a list of the widget item.]] - return: iterator @owned @no_unused; [[Iterator to widget items]] + return: iterator @move @no_unused; [[Iterator to widget items]] } } } diff --git a/src/lib/eio/efl_io_manager.eo b/src/lib/eio/efl_io_manager.eo index b81ba4cc29..b88d7f8155 100644 --- a/src/lib/eio/efl_io_manager.eo +++ b/src/lib/eio/efl_io_manager.eo @@ -34,7 +34,7 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer @in path: string; [[Path we want to list entries for]] paths: EflIoPath; [[Callback called for each packet of files found]] } - return: future @owned; [[Amount of files found during the listing of the directory]] + return: future @move; [[Amount of files found during the listing of the directory]] } direct_ls @const { @@ -44,7 +44,7 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer @in recursive: bool; [[If $true, list entries recursively, $false otherwise]] info: EflIoDirectInfo; [[Callback called for each packet of @Eina.File_Direct_Info]] } - return: future @owned; [[Amount of files found during the listing of the directory]] + return: future @move; [[Amount of files found during the listing of the directory]] } stat_ls @const { @@ -54,7 +54,7 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer @in recursive: bool; [[If $true, list entries recursively, $false otherwise]] info: EflIoDirectInfo; [[Callback called for each packet of @Eina.File_Direct_Info]] } - return: future @owned; [[Amount of files found during the listing of the directory]] + return: future @move; [[Amount of files found during the listing of the directory]] } // Extended attributes @@ -64,7 +64,7 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer @in path: string; [[Path we want to list entries for]] paths: EflIoPath; [[Callback called for each packet of extended attributes found.]] } - return: future @owned; [[Amount of extended attributes found]] + return: future @move; [[Amount of extended attributes found]] } stat @const { @@ -83,10 +83,10 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer data: ptr(Eina.Binbuf); [[Data to set as information]] flags: Eina.Xattr.Flags; [[Extended attributes flags]] } - return: future @owned; [[Future for asynchronous set operation]] + return: future @move; [[Future for asynchronous set operation]] } get { - return: future @owned; [[Information]] + return: future @move; [[Information]] } keys { path: string; [[File path]] @@ -103,7 +103,7 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer @in path: string; [[Path to file]] @in shared: bool; [[$true if the file can be accessed by others, $false otherwise]] } - return: future @owned; [[Eina file handle]] + return: future @move; [[Eina file handle]] } close @const { [[Closes an open Eina.File.]] @@ -111,7 +111,7 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer @in file: ptr(Eina.File); [[Eina file handle]] // Here we're just interested whether the promise was fulfilled or not. No value needed. } - return: future @owned; [[Close return code]] + return: future @move; [[Close return code]] } } } diff --git a/src/lib/elementary/efl_access_action.eo b/src/lib/elementary/efl_access_action.eo index 587cc63056..acaad80188 100644 --- a/src/lib/elementary/efl_access_action.eo +++ b/src/lib/elementary/efl_access_action.eo @@ -63,7 +63,7 @@ mixin @beta Efl.Access.Action params { @in id: int; [[ID for widget]] } - return: mstring @owned @no_unused; [[Should be freed by the user.]] + return: mstring @move @no_unused; [[Should be freed by the user.]] } } } diff --git a/src/lib/elementary/efl_access_object.eo b/src/lib/elementary/efl_access_object.eo index 5689638efe..d08434a16a 100644 --- a/src/lib/elementary/efl_access_object.eo +++ b/src/lib/elementary/efl_access_object.eo @@ -280,7 +280,7 @@ mixin @beta Efl.Access.Object requires Efl.Object get { } values { - children: list @owned; [[List of widget's children]] + children: list @move; [[List of widget's children]] } } @property role_name @protected @beta { @@ -296,7 +296,7 @@ mixin @beta Efl.Access.Object requires Efl.Object get { } values { - attributes: list @owned; [[List of object attributes. + attributes: list @move; [[List of object attributes. Must be freed by the user]] } } diff --git a/src/lib/elementary/efl_access_text.eo b/src/lib/elementary/efl_access_text.eo index b1acc3e93e..4deb7ecb14 100644 --- a/src/lib/elementary/efl_access_text.eo +++ b/src/lib/elementary/efl_access_text.eo @@ -72,7 +72,7 @@ interface @beta Efl.Access.Text -1 in case of error.]] } values { - string: mstring @owned; [[Newly allocated UTF-8 encoded string. Must be free by a user.]] + string: mstring @move; [[Newly allocated UTF-8 encoded string. Must be free by a user.]] } } @property access_text @protected @beta { @@ -84,7 +84,7 @@ interface @beta Efl.Access.Text end_offset: int; [[End offset of text.]] } values { - text: mstring @owned; [[UTF-8 encoded text.]] + text: mstring @move; [[UTF-8 encoded text.]] } } @property caret_offset @protected @beta { @@ -110,7 +110,7 @@ interface @beta Efl.Access.Text end_offset: ptr(int); [[Position in text to which given attribute is set.]] } values { - value: mstring @owned; [[Value of text attribute. Should be free()]] + value: mstring @move; [[Value of text attribute. Should be free()]] } } @property text_attributes @protected @beta { @@ -122,7 +122,7 @@ interface @beta Efl.Access.Text end_offset: ptr(int); [[End offset]] } values { - attributes: list @owned; [[List of text attributes]] + attributes: list @move; [[List of text attributes]] } } @property default_attributes @protected @beta { @@ -130,7 +130,7 @@ interface @beta Efl.Access.Text get { } values { - attributes: list @owned; [[List of default attributes]] + attributes: list @move; [[List of default attributes]] } } @property character_extents @protected @beta { @@ -181,7 +181,7 @@ interface @beta Efl.Access.Text yclip: Efl.Access.Text_Clip_Type; [[yclip]] } values { - ranges: list @owned; [[List of ranges]] + ranges: list @move; [[List of ranges]] } } @property range_extents @protected @beta { diff --git a/src/lib/elementary/efl_config_global.eo b/src/lib/elementary/efl_config_global.eo index db437901e7..5c19e7072d 100644 --- a/src/lib/elementary/efl_config_global.eo +++ b/src/lib/elementary/efl_config_global.eo @@ -50,7 +50,7 @@ class @beta Efl.Config_Global extends Efl.Object implements Efl.Config hidden: bool @optional; [[If $true, gets the full list of profiles, including those stored in hidden files.]] } - return: iterator @owned; [[Iterator to profiles]] + return: iterator @move; [[Iterator to profiles]] } profile_exists { [[Returns whether a profile exists or not.]] @@ -66,7 +66,7 @@ class @beta Efl.Config_Global extends Efl.Object implements Efl.Config is_user: bool; [[$true to lookup for a user profile or $false for a system one.]] } - return: stringshare @owned; [[Directory of the profile, free after use.]] + return: stringshare @move; [[Directory of the profile, free after use.]] } profile_derived_add @protected { [[Add a new profile of the given name to be derived from the current diff --git a/src/lib/elementary/efl_ui_collection.eo b/src/lib/elementary/efl_ui_collection.eo index 9fad710f65..30451214ad 100644 --- a/src/lib/elementary/efl_ui_collection.eo +++ b/src/lib/elementary/efl_ui_collection.eo @@ -54,7 +54,7 @@ class @beta Efl.Ui.Collection extends Efl.Ui.Layout_Base implements @property position_manager { [[Position manager object that handles placement of items.]] values { - position_manager : Efl.Ui.Position_Manager.Entity @owned; [[Ownership is passed to the item container.]] + position_manager : Efl.Ui.Position_Manager.Entity @move; [[Ownership is passed to the item container.]] } } } diff --git a/src/lib/elementary/efl_ui_focus_composition.eo b/src/lib/elementary/efl_ui_focus_composition.eo index 92062976ed..a82901575d 100644 --- a/src/lib/elementary/efl_ui_focus_composition.eo +++ b/src/lib/elementary/efl_ui_focus_composition.eo @@ -18,7 +18,7 @@ mixin @beta Efl.Ui.Focus.Composition requires Efl.Ui.Widget { the focus property is redirected to the evas focus property. The mixin will take care of registration. ]] values { - logical_order : list @owned; [[The order to use]] + logical_order : list @move; [[The order to use]] } } dirty @protected { diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo index 1b9798c77e..1b0256f663 100644 --- a/src/lib/elementary/efl_ui_focus_manager.eo +++ b/src/lib/elementary/efl_ui_focus_manager.eo @@ -4,10 +4,10 @@ import eina_types; struct @beta @free(efl_ui_focus_relation_free) Efl.Ui.Focus.Relations { [[Structure holding the graph of relations between focusable objects. ]] - right : list @owned; [[List of objects to the right.]] - left : list @owned; [[List of objects to the left.]] - top : list @owned; [[List of objects above.]] - down : list @owned; [[List of objects below.]] + right : list @move; [[List of objects to the right.]] + left : list @move; [[List of objects to the left.]] + top : list @move; [[List of objects above.]] + down : list @move; [[List of objects below.]] next : Efl.Ui.Focus.Object; [[Next object.]] prev : Efl.Ui.Focus.Object; [[Previous object.]] parent : Efl.Ui.Focus.Object; [[Parent object.]] @@ -144,7 +144,7 @@ interface Efl.Ui.Focus.Manager { params { child : Efl.Ui.Focus.Object; [[The child object to inspect.]] } - return : ptr(Efl.Ui.Focus.Relations) @owned; [[The list of relations + return : ptr(Efl.Ui.Focus.Relations) @move; [[The list of relations starting from $child.]] } logical_end { diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.eo b/src/lib/elementary/efl_ui_focus_manager_calc.eo index 279f6da106..cd9ad90fa5 100644 --- a/src/lib/elementary/efl_ui_focus_manager_calc.eo +++ b/src/lib/elementary/efl_ui_focus_manager_calc.eo @@ -59,7 +59,7 @@ class @beta Efl.Ui.Focus.Manager_Calc extends Efl.Object implements Efl.Ui.Focus [[Sets the list of children to a different order.]] params { parent : Efl.Ui.Focus.Object; [[The parent to update.]] - children : list @owned; [[The list of children with the new order.]] + children : list @move; [[The list of children with the new order.]] } return : bool; [[$true if successful, $false otherwise.]] } @@ -71,7 +71,7 @@ class @beta Efl.Ui.Focus.Manager_Calc extends Efl.Object implements Efl.Ui.Focus ]] params { parent : Efl.Ui.Focus.Object; [[The parent to update.]] - children : list @owned; [[The list of objects with the new order.]] + children : list @move; [[The list of objects with the new order.]] } } unregister { diff --git a/src/lib/elementary/efl_ui_multi_selectable.eo b/src/lib/elementary/efl_ui_multi_selectable.eo index 87f155d36c..a13070842a 100644 --- a/src/lib/elementary/efl_ui_multi_selectable.eo +++ b/src/lib/elementary/efl_ui_multi_selectable.eo @@ -27,7 +27,7 @@ interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable } selected_items_get { [[Get the selected items in a iterator. The iterator sequence will be decided by selection.]] - return: iterator @owned @no_unused; [[User has to free the iterator after usage.]] + return: iterator @move @no_unused; [[User has to free the iterator after usage.]] } select_range { [[Select a range of @Efl.Ui.Selectable. diff --git a/src/lib/elementary/efl_ui_spotlight_container.eo b/src/lib/elementary/efl_ui_spotlight_container.eo index dc08b624ee..bb39fd2fc6 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.eo +++ b/src/lib/elementary/efl_ui_spotlight_container.eo @@ -33,7 +33,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl If it is not set, only the active sub-widget is shown and transitions are instantaneous (not animated). ]] values { - spotlight_manager : Efl.Ui.Spotlight.Manager @owned; [[The Spotlight Manager object or $NULL.]] + spotlight_manager : Efl.Ui.Spotlight.Manager @move; [[The Spotlight Manager object or $NULL.]] } } @property indicator { @@ -43,7 +43,7 @@ class @beta Efl.Ui.Spotlight.Container extends Efl.Ui.Layout_Base implements Efl Its location inside the container is controlled by the @.spotlight_manager. ]] values { - indicator : Efl.Ui.Spotlight.Indicator @owned; [[The Indicator object or $NULL.]] + indicator : Efl.Ui.Spotlight.Indicator @move; [[The Indicator object or $NULL.]] } } @property active_element { diff --git a/src/lib/elementary/efl_ui_view_model.eo b/src/lib/elementary/efl_ui_view_model.eo index 83a3e781b0..c09ae516e6 100644 --- a/src/lib/elementary/efl_ui_view_model.eo +++ b/src/lib/elementary/efl_ui_view_model.eo @@ -12,7 +12,7 @@ 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 @owned; [[The new value to set.]] + @in value: any_value_ptr @move; [[The new value to set.]] } return: future; [[The value that was finally set.]] }; diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index 5ec9d5c2af..7a024bf01f 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -348,7 +348,7 @@ abstract Efl.Object } children_iterator_new { [[Get an iterator on all childrens]] - return: iterator @owned @no_unused; [[Children iterator]] + return: iterator @move @no_unused; [[Children iterator]] } composite_attach @beta { [[Make an object a composite object of another. diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo index 858277e164..f129ce056d 100644 --- a/src/lib/evas/canvas/efl_canvas_group.eo +++ b/src/lib/evas/canvas/efl_canvas_group.eo @@ -57,7 +57,7 @@ class Efl.Canvas.Group extends Efl.Canvas.Object from both the @Efl.Object children list as well as the @Efl.Container content list. ]] - return: iterator @owned; + return: iterator @move; [[Iterator to object children]] } group_member_add { diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo index bc206cffc0..511dec2587 100644 --- a/src/lib/evas/canvas/efl_canvas_text.eo +++ b/src/lib/evas/canvas/efl_canvas_text.eo @@ -136,7 +136,7 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, range_text_get @const { [[Returns the text in the range between $cur1 and $cur2. ]] - return: mstring @owned; [[The text in the given range]] + return: mstring @move; [[The text in the given range]] params { @in cur1: ptr(const(Efl.Text_Cursor_Cursor)); [[Start of range]] @in cur2: ptr(const(Efl.Text_Cursor_Cursor)); [[End of range]] @@ -152,7 +152,7 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, @in cur1: ptr(const(Efl.Text_Cursor_Cursor)); [[Start of range]] @in cur2: ptr(const(Efl.Text_Cursor_Cursor)); [[End of range]] } - return: iterator @owned; [[ + return: iterator @move; [[ Iterator on all geoemtries of the given range ]] } @@ -167,7 +167,7 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, @in cur1: ptr(const(Efl.Text_Cursor_Cursor)); [[Start of range]] @in cur2: ptr(const(Efl.Text_Cursor_Cursor)); [[End of range]] } - return: iterator @owned; [[ + return: iterator @move; [[ Iterator on all simple geometries of the given range ]] } @@ -222,7 +222,7 @@ class @beta Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text, Once layout is complete, the result is returned as @Eina.Rect, with w, h fields set. ]] - return: future @owned; [[Future for layout result]] + return: future @move; [[Future for layout result]] } } implements { diff --git a/src/lib/evas/canvas/efl_canvas_text_factory.eo b/src/lib/evas/canvas/efl_canvas_text_factory.eo index 51ca68b92b..13d593ea0e 100644 --- a/src/lib/evas/canvas/efl_canvas_text_factory.eo +++ b/src/lib/evas/canvas/efl_canvas_text_factory.eo @@ -17,7 +17,7 @@ interface @beta Efl.Canvas.Text_Factory object: Efl.Canvas.Object; [[The parent of the created object]] key: string; [[Key that is associated to an item object]] } - return: Efl.Canvas.Object @owned; + return: Efl.Canvas.Object @move; } } } diff --git a/src/lib/evas/canvas/efl_canvas_vg_container.eo b/src/lib/evas/canvas/efl_canvas_vg_container.eo index 7b1397d447..0290cf4848 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_container.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_container.eo @@ -11,7 +11,7 @@ class @beta Efl.Canvas.Vg.Container extends Efl.Canvas.Vg.Node } children_get { [[Get all children of container]] - return: iterator @owned @no_unused; [[Iterator to children]] + return: iterator @move @no_unused; [[Iterator to children]] } } implements { diff --git a/src/tests/eolian_cxx/complex.eo b/src/tests/eolian_cxx/complex.eo index f874ad9846..d3f88488a0 100644 --- a/src/tests/eolian_cxx/complex.eo +++ b/src/tests/eolian_cxx/complex.eo @@ -25,7 +25,7 @@ class Complex extends Efl.Object } incontowncontown { params { - l: list @move> @owned; + l: list @move> @move; } } incontowncont { @@ -106,7 +106,7 @@ class Complex extends Efl.Object } outcontowncontown { params { - @out l: list @move> @owned; + @out l: list @move> @move; } } outcontowncont { diff --git a/src/tests/eolian_js/constructor_method_class.eo b/src/tests/eolian_js/constructor_method_class.eo index ec2cc5698a..1bcfd375eb 100644 --- a/src/tests/eolian_js/constructor_method_class.eo +++ b/src/tests/eolian_js/constructor_method_class.eo @@ -41,10 +41,10 @@ class Constructor_Method_Class extends Efl.Object } classoutmethod1 { params { @in one: int; @in two: double; } - return: free(Constructor_Method_Class, eo_unref) @owned @no_unused; + return: free(Constructor_Method_Class, eo_unref) @move @no_unused; } classoutmethod2 { - params { @in one: int; @in two: double; @out out_class: Constructor_Method_Class @owned; } + params { @in one: int; @in two: double; @out out_class: Constructor_Method_Class @move; } } } implements { diff --git a/src/tests/eolian_js/test_object.eo b/src/tests/eolian_js/test_object.eo index 8802fddfdb..1fc462398c 100644 --- a/src/tests/eolian_js/test_object.eo +++ b/src/tests/eolian_js/test_object.eo @@ -104,7 +104,7 @@ class Test.Object extends Efl.Object { } method_array_with_42_check { [[ tests parameters ]] - return: array @owned @no_unused; + return: array @move @no_unused; } method_array_in_array_out_check { [[ tests parameters ]] @@ -157,7 +157,7 @@ class Test.Object extends Efl.Object { } method_list_with_42_check { [[ tests parameters ]] - return: list @owned @no_unused; + return: list @move @no_unused; } method_list_in_list_out_check { [[ tests parameters ]] From 3b540fc9f93e63cd2d1d687ee1108542627628fd Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 6 Sep 2019 17:07:01 +0200 Subject: [PATCH 19/23] eolian: remove @owned keyword --- src/lib/eolian/eo_lexer.h | 2 +- src/lib/eolian/eo_parser.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index 96e385952f..e95258d420 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -36,7 +36,7 @@ enum Tokens KWAT(auto), KWAT(beta), KWAT(by_ref), KWAT(c_name), KWAT(const), \ KWAT(empty), KWAT(extern), KWAT(free), KWAT(hot), KWAT(in), KWAT(inout), \ KWAT(move), KWAT(no_unused), KWAT(nullable), KWAT(optional), KWAT(out), \ - KWAT(owned), KWAT(private), KWAT(property), KWAT(protected), KWAT(restart), \ + KWAT(private), KWAT(property), KWAT(protected), KWAT(restart), \ KWAT(pure_virtual), KWAT(static), \ \ KWH(version), \ diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index e010a3fc30..3786dcc198 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -525,7 +525,6 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern, fdef->by_ref = EINA_TRUE; eo_lexer_get(ls); break; - case KW_at_owned: case KW_at_move: CASE_LOCK(ls, owned, "owned qualifier"); fdef->type->owned = fdef->move = EINA_TRUE; @@ -774,14 +773,14 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr) def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); /* view-only types are not allowed to own the contents */ if (tpid == KW_array || tpid == KW_hash || tpid == KW_list || tpid == KW_future) - if ((def->base_type->owned = def->base_type->move = (ls->t.kw == KW_at_owned || ls->t.kw == KW_at_move))) + if ((def->base_type->owned = def->base_type->move = ls->t.kw == KW_at_move)) eo_lexer_get(ls); if (tpid == KW_hash) { check_next(ls, ','); def->base_type->next_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); - if ((def->base_type->next_type->owned = def->base_type->next_type->move = (ls->t.kw == KW_at_owned || ls->t.kw == KW_at_move))) + if ((def->base_type->next_type->owned = def->base_type->next_type->move = ls->t.kw == KW_at_move)) eo_lexer_get(ls); } check_match(ls, '>', '<', bline, bcol); @@ -1058,7 +1057,6 @@ parse_return(Eo_Lexer *ls, Eo_Ret_Def *ret, Eina_Bool allow_void, ret->no_unused = EINA_TRUE; eo_lexer_get(ls); break; - case KW_at_owned: case KW_at_move: CASE_LOCK(ls, owned, "owned qualifier"); ret->owned = EINA_TRUE; @@ -1130,7 +1128,6 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, par->optional = EINA_TRUE; eo_lexer_get(ls); break; - case KW_at_owned: case KW_at_move: CASE_LOCK(ls, owned, "owned qualifier"); par->type->owned = par->move = EINA_TRUE; From cb2b6d666cf21ae575d09339a5aedf1dc180ca6e Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 6 Sep 2019 18:02:50 +0200 Subject: [PATCH 20/23] eolian_gen: make errors compile/work This is not thread safe, but I don't see any better way out for now. We'd probably need a different error API for that. Ref T6890 --- src/bin/eolian/types.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c index e79b73b20c..7fe1a85b44 100644 --- a/src/bin/eolian/types.c +++ b/src/bin/eolian/types.c @@ -234,7 +234,7 @@ _err_generate(const Eolian_State *state, const Eolian_Error *err) if (!buf) buf = eina_strbuf_new(); else eina_strbuf_append_char(buf, '\n'); - eina_strbuf_prepend_printf(buf, "EWAPI extern Eina_Error %s_get(void);\n\n", fn); + eina_strbuf_prepend_printf(buf, "EWAPI Eina_Error %s_get(void);\n\n", fn); char *ufn = strdup(fn); eina_str_toupper(&ufn); @@ -332,11 +332,13 @@ _source_gen_error(Eina_Strbuf *buf, const Eolian_Error *err) *p = '_'; eina_str_tolower(&fn); - eina_strbuf_append_printf(buf, "EWAPI %s_get(void)\n{\n", fn); + eina_strbuf_append_printf(buf, "EWAPI Eina_Error %s_get(void)\n{\n", fn); free(fn); const char *msg = eolian_error_message_get(err); - eina_strbuf_append(buf, " static Eina_Error err = eina_error_msg_static_register(\""); + eina_strbuf_append(buf, " static Eina_Error err = EINA_ERROR_NO_ERROR;\n"); + eina_strbuf_append(buf, " if (err == EINA_ERROR_NO_ERROR)\n"); + eina_strbuf_append(buf, " err = eina_error_msg_static_register(\""); for (const char *p = msg; *p; ++p) switch (*p) { From acd9eb2466782661a17750c95507b698b39d9cfe Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 6 Sep 2019 12:43:32 -0400 Subject: [PATCH 21/23] efl_ui/box: restore previous behavior for passing null reference objects Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9865 --- src/lib/elementary/efl_ui_box.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index 04533f997e..3cee95ccab 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -282,7 +282,7 @@ _efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Ent EOLIAN static Eina_Bool _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { - EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE); + if (existing) EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE); if (!_efl_ui_box_child_register(obj, pd, subobj)) return EINA_FALSE; @@ -295,7 +295,7 @@ _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_En EOLIAN static Eina_Bool _efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { - EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE); + if (existing) EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE); if (!_efl_ui_box_child_register(obj, pd, subobj)) return EINA_FALSE; From f6747d68225aa066e1cb088eb75ed851cdc44e91 Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Sat, 7 Sep 2019 00:57:05 +0200 Subject: [PATCH 22/23] eolian_cxx: Remove last usage of type_is_owned Reviewers: q66, felipealmeida Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9866 --- src/lib/eolian_cxx/grammar/klass_def.hpp | 8 ++++---- src/lib/eolian_cxx/grammar/qualifier_def.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index 47afbfedb8..fbd8779e0f 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -452,7 +452,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni switch( ::eolian_type_type_get(eolian_type)) { case EOLIAN_TYPE_VOID: - original_type = attributes::regular_type_def{"void", {qualifiers(eolian_type), {}}, {}}; + original_type = attributes::regular_type_def{"void", {qualifiers(eolian_type, is_moved), {}}, {}}; break; case EOLIAN_TYPE_REGULAR: if (!stp) @@ -474,12 +474,12 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni for(efl::eina::iterator namespace_iterator( ::eolian_type_namespaces_get(eolian_type)) , namespace_last; namespace_iterator != namespace_last; ++namespace_iterator) namespaces.push_back(&*namespace_iterator); - original_type = {regular_type_def{ ::eolian_type_short_name_get(eolian_type), {qualifiers(eolian_type), {}}, namespaces, type_type, is_undefined}}; + original_type = {regular_type_def{ ::eolian_type_short_name_get(eolian_type), {qualifiers(eolian_type, is_moved), {}}, namespaces, type_type, is_undefined}}; } else { complex_type_def complex - {{::eolian_type_short_name_get(eolian_type), {qualifiers(eolian_type), {}}, {}}, {}}; + {{::eolian_type_short_name_get(eolian_type), {qualifiers(eolian_type, is_moved), {}}, {}}, {}}; while (stp) { complex.subtypes.push_back({stp, unit, EOLIAN_C_TYPE_DEFAULT, eolian_type_is_move(stp)}); @@ -491,7 +491,7 @@ inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* uni case EOLIAN_TYPE_CLASS: { Eolian_Class const* klass = eolian_type_class_get(eolian_type); - original_type = klass_name(klass, {qualifiers(eolian_type), {}}); + original_type = klass_name(klass, {qualifiers(eolian_type, is_moved), {}}); } break; default: diff --git a/src/lib/eolian_cxx/grammar/qualifier_def.hpp b/src/lib/eolian_cxx/grammar/qualifier_def.hpp index 33e3ed5125..cab3ca8667 100644 --- a/src/lib/eolian_cxx/grammar/qualifier_def.hpp +++ b/src/lib/eolian_cxx/grammar/qualifier_def.hpp @@ -72,9 +72,9 @@ inline qualifier_bool operator^(qualifier_bool lhs, qualifier_info rhs) return lhs; } -inline qualifier_info qualifiers(Eolian_Type const* type) +inline qualifier_info qualifiers(Eolian_Type const* type, bool is_moved) { - qualifier_info is_own = ::eolian_type_is_owned(type) ? qualifier_info::is_own : qualifier_info::is_none; + qualifier_info is_own = is_moved ? qualifier_info::is_own : qualifier_info::is_none; qualifier_info is_const = ::eolian_type_is_const(type) ? qualifier_info::is_const : qualifier_info::is_none; qualifier_info is_ref = ::eolian_type_is_ptr(type) ? qualifier_info::is_ref : qualifier_info::is_none; return is_own | is_const | is_ref; From f4d9188ca75b1961d1936abf47fb2685c35d5ee2 Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Sun, 8 Sep 2019 22:13:40 -0300 Subject: [PATCH 23/23] eolian_mono: remove redundant code in NativeMethods Summary: Duplicated interface's NativeMethods code will be removed. they are called in `GetInterfaces`. Size of efl_mono.dll 6,587,392 bytes(6.6MB) -> 4,112,384 bytes (4.1MB) Test Plan: ninja test Reviewers: felipealmeida, lauromoura, vitor.sousa Reviewed By: lauromoura Subscribers: cedric, #reviewers, woohyun, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9752 --- src/bin/eolian_mono/eolian/mono/klass.hh | 20 +++++++++++++++++--- src/bindings/mono/eo_mono/EoWrapper.cs | 2 +- src/bindings/mono/eo_mono/iwrapper.cs | 24 +++--------------------- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index f1b89abc71..c10bfb3fda 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -398,7 +398,7 @@ struct klass context); auto native_inherit_name = name_helpers::klass_native_inherit_name(cls); auto inherit_name = name_helpers::klass_inherit_name(cls); - auto implementable_methods = helpers::get_all_implementable_methods(cls, context); + auto implementable_methods = cls.functions; bool root = !helpers::has_regular_ancestor(cls); auto const& indent = current_indentation(inative_cxt); @@ -430,7 +430,7 @@ struct klass if(!as_generator( indent << scope_tab << "/// Gets the list of Eo operations to override.\n" << indent << scope_tab << "/// The list of Eo operations to be overload.\n" - << indent << scope_tab << "public override System.Collections.Generic.List GetEoOps(System.Type type)\n" + << indent << scope_tab << "public override System.Collections.Generic.List GetEoOps(System.Type type, bool includeInherited)\n" << indent << scope_tab << "{\n" << indent << scope_tab << scope_tab << "var descs = new System.Collections.Generic.List();\n" ) @@ -452,8 +452,22 @@ struct klass ).generate(sink, attributes::unused, inative_cxt)) return false; + if(!as_generator( + indent << scope_tab << scope_tab << "if (includeInherited)\n" + << indent << scope_tab(2) << "{\n" + << indent << scope_tab(3) << "var all_interfaces = type.GetInterfaces();\n" + << indent << scope_tab(3) << "foreach (var iface in all_interfaces)\n" + << indent << scope_tab(3) << "{\n" + << indent << scope_tab(4) << "var moredescs = ((Efl.Eo.NativeClass)iface.GetCustomAttributes(false)?.FirstOrDefault(attr => attr is Efl.Eo.NativeClass))?.GetEoOps(type, false);\n" + << indent << scope_tab(4) << "if (moredescs != null)\n" + << indent << scope_tab(5) << "descs.AddRange(moredescs);\n" + << indent << scope_tab(3) << "}\n" + << indent << scope_tab(2) << "}\n" + ).generate(sink, attributes::unused, inative_cxt)) + return false; + if (!root || context_find_tag(context).current_wrapper_kind != class_context::concrete) - if(!as_generator(indent << scope_tab << scope_tab << "descs.AddRange(base.GetEoOps(type));\n").generate(sink, attributes::unused, inative_cxt)) + if(!as_generator(indent << scope_tab << scope_tab << "descs.AddRange(base.GetEoOps(type, false));\n").generate(sink, attributes::unused, inative_cxt)) return false; if(!as_generator( diff --git a/src/bindings/mono/eo_mono/EoWrapper.cs b/src/bindings/mono/eo_mono/EoWrapper.cs index 688de85cae..1805071175 100644 --- a/src/bindings/mono/eo_mono/EoWrapper.cs +++ b/src/bindings/mono/eo_mono/EoWrapper.cs @@ -357,7 +357,7 @@ public abstract class EoWrapper : IWrapper, IDisposable /// Gets the list of Eo operations to override. /// The list of Eo operations to be overload. - public override System.Collections.Generic.List GetEoOps(Type type) + public override System.Collections.Generic.List GetEoOps(Type type, bool includeInherited) { var descs = new System.Collections.Generic.List(); diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index 6b7719e61f..a03e48a326 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -351,26 +351,8 @@ public class Globals if (nativeClass != null) { Eina.Log.Debug("nativeClass != null"); - var descs = nativeClass.GetEoOps(type); + var descs = nativeClass.GetEoOps(type, true); var count = descs.Count; - - var all_interfaces = type.GetInterfaces(); - var base_interfaces = type.BaseType.GetInterfaces(); - foreach (var iface in all_interfaces) - { - if (!System.Array.Exists(base_interfaces, element => element == iface)) - { - var nc = GetNativeClass(iface); - if (nc != null) - { - var moredescs = nc.GetEoOps(type); - Eina.Log.Debug($"adding {moredescs.Count} more descs to registration"); - descs.AddRange(moredescs); - count = descs.Count; - } - } - } - IntPtr descs_ptr = IntPtr.Zero; if (count > 0) @@ -753,7 +735,7 @@ public static class Config public abstract class NativeClass : System.Attribute { public abstract IntPtr GetEflClass(); - public abstract System.Collections.Generic.List GetEoOps(System.Type type); + public abstract System.Collections.Generic.List GetEoOps(System.Type type, bool includeInherited); } /// Attribute for private native classes. @@ -766,7 +748,7 @@ public class PrivateNativeClass : NativeClass return IntPtr.Zero; } - public override System.Collections.Generic.List GetEoOps(System.Type type) + public override System.Collections.Generic.List GetEoOps(System.Type type, bool includeInherited) { return null; }