summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_table_layout.c
diff options
context:
space:
mode:
authorYeongjong Lee <cleanlyj@naver.com>2019-04-18 08:22:44 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-21 12:13:13 +0200
commit3e495010431e75afa12452d27c649bbf8b2b9bf9 (patch)
treef021a488d881d14f63c9d73f28fa321618167c96 /src/lib/elementary/efl_ui_table_layout.c
parentef3281c924533e083fab9f71e3d459e7087a7da1 (diff)
ui.table: remove leagcy evas_table from Efl.Ui.Table
Remove evas_table. This expect to improve performance by removing internal function call related evas_table. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8615
Diffstat (limited to 'src/lib/elementary/efl_ui_table_layout.c')
-rw-r--r--src/lib/elementary/efl_ui_table_layout.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_ui_table_layout.c b/src/lib/elementary/efl_ui_table_layout.c
index 3d29551..ac90b63 100644
--- a/src/lib/elementary/efl_ui_table_layout.c
+++ b/src/lib/elementary/efl_ui_table_layout.c
@@ -224,13 +224,14 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd)
224 Table_Item *ti; 224 Table_Item *ti;
225 Item_Calc *items, *item; 225 Item_Calc *items, *item;
226 Efl_Ui_Container_Item_Hints *hints; 226 Efl_Ui_Container_Item_Hints *hints;
227 int id = 0, i = 0, rows, cols; 227 int id = 0, i = 0, count, rows, cols;
228 int (*_efl_ui_table_item_pos_get[2])(Table_Calc *, Item_Calc *, Eina_Bool); 228 int (*_efl_ui_table_item_pos_get[2])(Table_Calc *, Item_Calc *, Eina_Bool);
229 int (*_efl_ui_table_item_size_get[2])(Table_Calc *, Item_Calc *, Eina_Bool); 229 int (*_efl_ui_table_item_size_get[2])(Table_Calc *, Item_Calc *, Eina_Bool);
230
231 Table_Calc table_calc; 230 Table_Calc table_calc;
232 231
233 if (!pd->count) 232 count = pd->count;
233
234 if (!count)
234 { 235 {
235 efl_gfx_hint_size_restricted_min_set(ui_table, EINA_SIZE2D(0, 0)); 236 efl_gfx_hint_size_restricted_min_set(ui_table, EINA_SIZE2D(0, 0));
236 return; 237 return;
@@ -249,20 +250,21 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd)
249 memset(table_calc.cell_calc[0], 0, cols * sizeof(Cell_Calc)); 250 memset(table_calc.cell_calc[0], 0, cols * sizeof(Cell_Calc));
250 memset(table_calc.cell_calc[1], 0, rows * sizeof(Cell_Calc)); 251 memset(table_calc.cell_calc[1], 0, rows * sizeof(Cell_Calc));
251 252
252 items = alloca(pd->count * sizeof(*items)); 253 items = alloca(count * sizeof(*items));
253#ifdef DEBUG 254#ifdef DEBUG
254 memset(items, 0, pd->count * sizeof(*items)); 255 memset(items, 0, count * sizeof(*items));
255#endif 256#endif
256 257
257 table_calc.cols = cols; 258 table_calc.cols = cols;
258 table_calc.rows = rows; 259 table_calc.rows = rows;
259 // scan all items, get their properties, calculate total weight & min size 260 // scan all items, get their properties, calculate total weight & min size
260 EINA_INLIST_FOREACH(pd->items, ti) 261 EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), ti)
261 { 262 {
262 if (((ti->col + ti->col_span) > cols) || 263 if (((ti->col + ti->col_span) > cols) ||
263 ((ti->row + ti->row_span) > rows)) 264 ((ti->row + ti->row_span) > rows))
264 { 265 {
265 efl_gfx_entity_visible_set(ti->object, EINA_FALSE); 266 efl_gfx_entity_geometry_set(ti->object, EINA_RECT(9999, 9999, 0, 0));
267 count--;
266 continue; 268 continue;
267 } 269 }
268 270
@@ -343,7 +345,7 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd)
343 _efl_ui_table_item_size_get[1] = _efl_ui_table_regular_item_size_get; 345 _efl_ui_table_item_size_get[1] = _efl_ui_table_regular_item_size_get;
344 } 346 }
345 347
346 for (i = 0; i < pd->count; i++) 348 for (i = 0; i < count; i++)
347 { 349 {
348 Eina_Rect space, item_geom; 350 Eina_Rect space, item_geom;
349 item = &items[i]; 351 item = &items[i];