This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efl.

View the commit online.

commit 2869411a5661490e48b298ddc62a25e86d857200
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 15 12:31:39 2026 -0600

    elementary: a layout's table part finds its table
    
    The edje table part of a layout looked up its evas table on the layout
    widget rather than on its edje, which is the widget's resize object, so
    the content count and iterator, the pack, and every table getter of the
    part found nothing. They now ask the edje. Adds a table_layout group to
    the test theme.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 data/elementary/objects/test.edc          |  8 +++++
 src/lib/elementary/efl_ui_layout_pack.c   | 60 ++++++++++++++-----------------
 src/tests/elementary/efl_ui_test_layout.c | 27 ++++++++++++++
 3 files changed, 61 insertions(+), 34 deletions(-)

diff --git a/data/elementary/objects/test.edc b/data/elementary/objects/test.edc
index 5cfd70f071..90058e0578 100644
--- a/data/elementary/objects/test.edc
+++ b/data/elementary/objects/test.edc
@@ -833,6 +833,14 @@ collections {
          }
       }
    }
+   group { "table_layout";
+      parts {
+         table { "table";
+            desc { "default";
+            }
+         }
+      }
+   }
    group { name: "bind_parts_layout";
       parts {
          part { name: "t1";
diff --git a/src/lib/elementary/efl_ui_layout_pack.c b/src/lib/elementary/efl_ui_layout_pack.c
index b043ffa112..9d64fd94eb 100644
--- a/src/lib/elementary/efl_ui_layout_pack.c
+++ b/src/lib/elementary/efl_ui_layout_pack.c
@@ -214,6 +214,20 @@ _efl_ui_layout_part_box_efl_ui_layout_orientable_orientation_get(const Eo *obj E
 
 /* Table proxy implementation */
 
+// The evas table behind a table part. The layout widget is not the edje: the
+// edje is its resize object, and asking the widget gives nothing.
+static Eo *
+_table_real(Efl_Ui_Layout_Table_Data *pd)
+{
+   Eo *pack;
+
+   ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd, NULL);
+   edje_object_freeze(wd->resize_obj);
+   pack = (Eo *) edje_object_part_object_get(wd->resize_obj, pd->part);
+   edje_object_thaw(wd->resize_obj);
+   return pack;
+}
+
 EOLIAN static void
 _efl_ui_layout_part_table_efl_object_destructor(Eo *obj, Efl_Ui_Layout_Table_Data *pd)
 {
@@ -228,9 +242,7 @@ _efl_ui_layout_part_table_efl_container_content_iterate(Eo *obj, Efl_Ui_Layout_T
 {
    Eina_Iterator *it;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
 
    it = evas_object_table_iterator_new(pack);
 
@@ -240,9 +252,7 @@ _efl_ui_layout_part_table_efl_container_content_iterate(Eo *obj, Efl_Ui_Layout_T
 EOLIAN static int
 _efl_ui_layout_part_table_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
 {
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
    return evas_obj_table_count(pack);
 }
 
@@ -274,7 +284,7 @@ _efl_ui_layout_part_table_efl_pack_pack(Eo *obj, Efl_Ui_Layout_Table_Data *pd, E
    Eina_Iterator *iter;
    Eo *pack, *element;
 
-   pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
+   pack = _table_real(pd);
 
 
    //first lookup what the most lower / right element is
@@ -316,9 +326,7 @@ _efl_ui_layout_part_table_efl_pack_table_pack_table(Eo *obj EINA_UNUSED, Efl_Ui_
 EOLIAN static Efl_Gfx_Entity *
 _efl_ui_layout_part_table_efl_pack_table_table_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int col, int row)
 {
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
    return evas_object_table_child_get(pack, col, row);
 }
 
@@ -332,9 +340,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_contents_get(Eo *obj EINA_UNUSED,
    Evas_Object *sobj;
    unsigned short c, r, cs, rs;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
 
    list = evas_object_table_children_get(pack);
    EINA_LIST_FREE(list, sobj)
@@ -360,9 +366,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_cell_column_get(const Eo *obj EIN
    unsigned short c, cs;
    Eina_Bool ret;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
 
    ret = evas_object_table_pack_get(pack, subobj, &c, NULL, &cs, NULL);
    if (col) *col = c;
@@ -376,9 +380,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_cell_column_set(Eo *obj EINA_UNUS
 {
    unsigned short r, rs;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
 
    evas_object_table_pack_get(pack, subobj, NULL, &r, NULL, &rs);
    evas_object_table_pack(pack, subobj, col, r, colspan, rs);
@@ -390,9 +392,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_cell_row_get(const Eo *obj EINA_U
    unsigned short r, rs;
    Eina_Bool ret;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
 
    ret = evas_object_table_pack_get(pack, subobj, NULL, &r, NULL, &rs);
    if (row) *row = r;
@@ -406,9 +406,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_cell_row_set(Eo *obj EINA_UNUSED,
 {
    unsigned short c, cs;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
 
    evas_object_table_pack_get(pack, subobj, &c, NULL, &cs, NULL);
    evas_object_table_pack(pack, subobj, c, row, cs, rowspan);
@@ -417,9 +415,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_cell_row_set(Eo *obj EINA_UNUSED,
 EOLIAN static void
 _efl_ui_layout_part_table_efl_pack_table_table_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int *cols, int *rows)
 {
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
    evas_object_table_col_row_size_get(pack, cols, rows);
 }
 
@@ -428,9 +424,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_columns_get(const Eo *obj EINA_UN
 {
    int cols, rows;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
    evas_object_table_col_row_size_get(pack, &cols, &rows);
    return cols;
 }
@@ -440,9 +434,7 @@ _efl_ui_layout_part_table_efl_pack_table_table_rows_get(const Eo *obj EINA_UNUSE
 {
    int cols, rows;
 
-   edje_object_freeze(pd->obj);
-   Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-   edje_object_thaw(pd->obj);
+   Eo *pack = _table_real(pd);
    evas_object_table_col_row_size_get(pack, &cols, &rows);
    return rows;
 }
diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c
index 3126bdb917..f25d8994da 100644
--- a/src/tests/elementary/efl_ui_test_layout.c
+++ b/src/tests/elementary/efl_ui_test_layout.c
@@ -574,6 +574,32 @@ EFL_START_TEST(efl_ui_layout_test_factory_bind_same_factory)
 }
 EFL_END_TEST
 
+/* The table part of a layout answers for the children packed in it. */
+EFL_START_TEST(efl_ui_layout_test_table_part_getters)
+{
+   char buf[PATH_MAX];
+   Eo *win, *ly, *a;
+   int c, cs, r, rs;
+
+   win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
+   ly = efl_add(EFL_UI_LAYOUT_CLASS, win);
+   snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
+   ck_assert(efl_file_simple_load(ly, buf, "table_layout"));
+
+   a = efl_add(EFL_UI_BUTTON_CLASS, win);
+   ck_assert(efl_pack_table(efl_part(ly, "table"), a, 3, 2, 2, 1));
+
+   ck_assert_int_eq(efl_content_count(efl_part(ly, "table")), 1);
+   ck_assert_ptr_eq(efl_pack_table_content_get(efl_part(ly, "table"), 3, 2), a);
+   ck_assert(efl_pack_table_cell_column_get(efl_part(ly, "table"), a, &c, &cs));
+   ck_assert(efl_pack_table_cell_row_get(efl_part(ly, "table"), a, &r, &rs));
+   ck_assert_int_eq(c, 3);
+   ck_assert_int_eq(cs, 2);
+   ck_assert_int_eq(r, 2);
+   ck_assert_int_eq(rs, 1);
+}
+EFL_END_TEST
+
 void efl_ui_test_layout(TCase *tc)
 {
    tcase_add_test(tc, efl_ui_layout_calc_subobjs_without_calc);
@@ -595,4 +621,5 @@ void efl_ui_test_layout(TCase *tc)
    tcase_add_test(tc, efl_ui_layout_test_versioning);
    tcase_add_test(tc, efl_ui_layout_test_freeze);
    tcase_add_test(tc, efl_ui_layout_test_factory_bind_same_factory);
+   tcase_add_test(tc, efl_ui_layout_test_table_part_getters);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to