lib/efl/interfaces/efl_pack.eo \
lib/efl/interfaces/efl_pack_layout.eo \
lib/efl/interfaces/efl_pack_linear.eo \
- lib/efl/interfaces/efl_pack_grid.eo \
+ lib/efl/interfaces/efl_pack_table.eo \
lib/efl/interfaces/efl_vpath.eo \
lib/efl/interfaces/efl_vpath_manager.eo \
lib/efl/interfaces/efl_vpath_file.eo \
lib/elementary/efl_ui_box.eo \
lib/elementary/efl_ui_box_flow.eo \
lib/elementary/efl_ui_box_stack.eo \
- lib/elementary/efl_ui_grid.eo \
- lib/elementary/efl_ui_grid_static.eo \
+ lib/elementary/efl_ui_table.eo \
+ lib/elementary/efl_ui_table_static.eo \
lib/elementary/efl_ui_text_interactive.eo \
lib/elementary/efl_ui_text.eo \
lib/elementary/efl_ui_popup.eo \
lib/elementary/efl_ui_popup_alert_scroll.c \
lib/elementary/efl_ui_popup_alert_text.c \
lib/elementary/efl_ui_popup_anchor.c \
- lib/elementary/efl_ui_grid.c \
- lib/elementary/efl_ui_grid_static.c \
- lib/elementary/efl_ui_grid_private.h \
+ lib/elementary/efl_ui_table.c \
+ lib/elementary/efl_ui_table_static.c \
+ lib/elementary/efl_ui_table_private.h \
lib/elementary/efl_ui_text.c \
lib/elementary/efl_ui_clock.c \
lib/elementary/efl_ui_clock_private.h \
bin/elementary/test_glview.c \
bin/elementary/test_glview_manygears.c \
bin/elementary/test_grid.c \
-bin/elementary/test_grid_static.c \
+bin/elementary/test_ui_table_static.c \
bin/elementary/test_hover.c \
bin/elementary/test_hoversel.c \
bin/elementary/test_icon.c \
bin/elementary/test_transit_bezier.c \
bin/elementary/test_ui_box.c \
bin/elementary/test_ui_clock.c \
-bin/elementary/test_ui_grid.c \
+bin/elementary/test_ui_table.c \
bin/elementary/test_ui_popup.c \
bin/elementary/test_ui_textpath.c \
bin/elementary/test_video.c \
void test_table6(void *data, Evas_Object *obj, void *event_info);
void test_table7(void *data, Evas_Object *obj, void *event_info);
void test_table8(void *data, Evas_Object *obj, void *event_info);
-void test_ui_grid(void *data, Evas_Object *obj, void *event_info);
-void test_ui_grid_linear(void *data, Evas_Object *obj, void *event_info);
+void test_ui_table(void *data, Evas_Object *obj, void *event_info);
+void test_ui_table_linear(void *data, Evas_Object *obj, void *event_info);
void test_gengrid(void *data, Evas_Object *obj, void *event_info);
void test_gengrid2(void *data, Evas_Object *obj, void *event_info);
void test_gengrid3(void *data, Evas_Object *obj, void *event_info);
void test_win_plug(void *data, Evas_Object *obj, void *event_info);
void test_win_wm_rotation(void *data, Evas_Object *obj, void *event_info);
void test_grid(void *data, Evas_Object *obj, void *event_info);
-void test_grid_static(void *data, Evas_Object *obj, void *event_info);
+void test_ui_table_static(void *data, Evas_Object *obj, void *event_info);
void test_glview_simple(void *data, Evas_Object *obj, void *event_info);
void test_glview(void *data, Evas_Object *obj, void *event_info);
void test_glview_manygears(void *data, Evas_Object *obj, void *event_info);
//------------------------------//
ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Box", test_ui_box);
- ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Grid", test_ui_grid);
- ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Grid (Linear API)", test_ui_grid_linear);
- ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Grid_Static", test_grid_static);
+ ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table", test_ui_table);
+ ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table (Linear API)", test_ui_table_linear);
+ ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table_Static", test_ui_table_static);
//------------------------------//
ADD_TEST_EO(NULL, "Events", "Event Refeed", test_events);
#endif
#include <Elementary.h>
-#define GRID_SIZE 10
+#define TABLE_SIZE 10
static const char *images[] = { "plant_01.jpg", "rock_01.jpg",
"rock_02.jpg", "sky_01.jpg", "sky_04.jpg",
{
Eina_Iterator *it;
Eo *win = data;
- Eo *grid, *o;
+ Eo *table, *o;
- grid = efl_key_wref_get(win, "grid");
- it = efl_content_iterate(grid);
+ table = efl_key_wref_get(win, "table");
+ it = efl_content_iterate(table);
EINA_ITERATOR_FOREACH(it, o)
{
if (efl_isa(o, EFL_PLAYER_INTERFACE) && efl_player_playable_get(o))
void
test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Eo *win, *grid, *o, *snap, *box;
+ Eo *win, *table, *o, *snap, *box;
const char *path;
win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_text_set(efl_added, "Evas Snapshot"),
efl_ui_win_autodel_set(efl_added, 1));
- grid = efl_add(EFL_UI_GRID_CLASS, win,
+ table = efl_add(EFL_UI_TABLE_CLASS, win,
efl_pack_padding_set(efl_added, 5, 5, 1));
- efl_content_set(win, grid);
+ efl_content_set(win, table);
// Objects below the snapshot
- for (int c = 0; c < GRID_SIZE; c++)
- for (int r = 0; r < GRID_SIZE; r++)
+ for (int c = 0; c < TABLE_SIZE; c++)
+ for (int r = 0; r < TABLE_SIZE; r++)
{
- int id = rnd[((r * GRID_SIZE) + c) % EINA_C_ARRAY_LENGTH(rnd)]
+ int id = rnd[((r * TABLE_SIZE) + c) % EINA_C_ARRAY_LENGTH(rnd)]
% EINA_C_ARRAY_LENGTH(images);
path = eina_slstr_printf("%s/images/%s", elm_app_data_dir_get(), images[id]);
o = _image_create(win, path);
- efl_pack_grid(grid, o, r, c, 1, 1);
+ efl_pack_table(table, o, r, c, 1, 1);
}
_anim_toggle(win, NULL);
snap = efl_add(EFL_CANVAS_SNAPSHOT_CLASS, win,
efl_gfx_filter_program_set(efl_added, filter, "filter"),
efl_gfx_filter_data_set(efl_added, "radius", "tonumber(5)", EINA_TRUE),
- efl_pack_grid(grid, efl_added, 1, 1, GRID_SIZE - 2, GRID_SIZE - 2));
+ efl_pack_table(table, efl_added, 1, 1, TABLE_SIZE - 2, TABLE_SIZE - 2));
// Objects above snapshot
// 1. Opaque rect, not changing
o = evas_object_rectangle_add(win);
evas_object_color_set(o, 32, 32, 96, 255);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_pack_grid(grid, o, 2, GRID_SIZE / 2, GRID_SIZE - 4, GRID_SIZE / 2 - 2);
+ efl_pack_table(table, o, 2, TABLE_SIZE / 2, TABLE_SIZE - 4, TABLE_SIZE / 2 - 2);
evas_object_show(o);
// 2. Non-opaque animated object
elm_progressbar_pulse_set(o, EINA_TRUE);
elm_progressbar_pulse(o, EINA_TRUE);
evas_object_show(o);
- efl_pack_grid(grid, o, 0, 0, GRID_SIZE, GRID_SIZE);
+ efl_pack_table(table, o, 0, 0, TABLE_SIZE, TABLE_SIZE);
// Controls
efl_add(EFL_UI_SLIDER_CLASS, win,
elm_slider_value_set(efl_added, 5),
elm_slider_unit_format_set(efl_added, "%.0f px"),
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
- efl_pack_grid(grid, efl_added, 0, GRID_SIZE, GRID_SIZE, 1),
+ efl_pack_table(table, efl_added, 0, TABLE_SIZE, TABLE_SIZE, 1),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _radius_set, win));
box = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
- efl_pack_grid(grid, efl_added, 0, GRID_SIZE + 1, GRID_SIZE, 1));
+ efl_pack_table(table, efl_added, 0, TABLE_SIZE + 1, TABLE_SIZE, 1));
efl_add(EFL_UI_BUTTON_CLASS, win,
efl_text_set(efl_added, "Toggle animation"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _close_do, win));
efl_key_wref_set(win, "snap", snap);
- efl_key_wref_set(win, "grid", grid);
+ efl_key_wref_set(win, "table", table);
efl_gfx_size_set(win, EINA_SIZE2D(400, 400));
}
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _anchor_unset_cb, efl_ui_popup);
efl_content_set(efl_part(layout, "anchor_none"), btn);
- Eo *grid = efl_add(EFL_UI_GRID_CLASS, efl_ui_popup);
- efl_gfx_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ Eo *table = efl_add(EFL_UI_TABLE_CLASS, efl_ui_popup);
+ efl_gfx_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
efl_text_set(btn, "Center Align");
efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _center_align_cb, p_data);
- efl_pack_grid(grid, btn, 0, 0, 2, 1);
+ efl_pack_table(table, btn, 0, 0, 2, 1);
btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
efl_text_set(btn, "Top Align");
efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _top_align_cb, p_data);
- efl_pack_grid(grid, btn, 2, 0, 2, 1);
+ efl_pack_table(table, btn, 2, 0, 2, 1);
btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
efl_text_set(btn, "Bottom Align");
efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(70, 35));
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _bottom_align_cb, p_data);
- efl_pack_grid(grid, btn, 4, 0, 2, 1);
+ efl_pack_table(table, btn, 4, 0, 2, 1);
btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
efl_text_set(btn, "Left Align");
efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _left_align_cb, p_data);
- efl_pack_grid(grid, btn, 0, 1, 3, 1);
+ efl_pack_table(table, btn, 0, 1, 3, 1);
btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
efl_text_set(btn, "Right Align");
efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _right_align_cb, p_data);
- efl_pack_grid(grid, btn, 3, 1, 3, 1);
+ efl_pack_table(table, btn, 3, 1, 3, 1);
btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
efl_text_set(btn, "Position Set");
efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _position_set_cb, p_data);
- efl_pack_grid(grid, btn, 0, 2, 3, 1);
+ efl_pack_table(table, btn, 0, 2, 3, 1);
btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup);
efl_text_set(btn, "Resize");
efl_gfx_size_hint_min_set(btn, EINA_SIZE2D(100, 35));
efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _popup_resize_cb, p_data);
- efl_pack_grid(grid, btn, 3, 2, 3, 1);
+ efl_pack_table(table, btn, 3, 2, 3, 1);
- efl_content_set(efl_ui_popup, grid);
+ efl_content_set(efl_ui_popup, table);
}
efl_pack(bx, efl_added));
}
- gd = efl_add(EFL_UI_GRID_CLASS, bx,
+ gd = efl_add(EFL_UI_TABLE_CLASS, bx,
efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_size_hint_align_set(efl_added, 0.5, 0),
efl_pack(bx, efl_added));
efl_add(EFL_CANVAS_RECTANGLE_CLASS, win,
efl_gfx_color_set(efl_added, 0, 0, 0, 0),
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(200, 120)),
- efl_pack_grid(gd, efl_added, 0, 0, 1, 1));
+ efl_pack_table(gd, efl_added, 0, 0, 1, 1));
sc3 = efl_add(EFL_UI_SCROLLER_CLASS, win,
efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
- efl_pack_grid(gd, efl_added, 0, 0, 1, 1));
+ efl_pack_table(gd, efl_added, 0, 0, 1, 1));
- gd2 = efl_add(EFL_UI_GRID_CLASS, sc3,
+ gd2 = efl_add(EFL_UI_TABLE_CLASS, sc3,
efl_content_set(sc3, efl_added));
for (j = 0; j < 16; j++)
efl_add(EFL_UI_BUTTON_CLASS, win,
efl_text_set(efl_added, "Both"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL),
- efl_pack_grid(gd2, efl_added, i, j, 1, 1));
+ efl_pack_table(gd2, efl_added, i, j, 1, 1));
}
}
EFL_OBJECT_OP_FUNC(efl_pack_layout_update, _custom_layout_update));
Weight_Mode mode = elm_radio_state_value_get(event->object);
- Eo *grid = data;
+ Eo *table = data;
if (mode != CUSTOM)
- efl_object_override(grid, NULL);
+ efl_object_override(table, NULL);
switch (mode)
{
case NONE:
- efl_gfx_size_hint_align_set(grid, 0.5, 0.5);
+ efl_gfx_size_hint_align_set(table, 0.5, 0.5);
for (int i = 0; i < 7; i++)
efl_gfx_size_hint_weight_set(objects[i], 0, 0);
break;
case NONE_BUT_FILL:
- efl_gfx_size_hint_align_set(grid, -1, -1);
+ efl_gfx_size_hint_align_set(table, -1, -1);
for (int i = 0; i < 7; i++)
efl_gfx_size_hint_weight_set(objects[i], 0, 0);
break;
case EQUAL:
- efl_gfx_size_hint_align_set(grid, 0.5, 0.5);
+ efl_gfx_size_hint_align_set(table, 0.5, 0.5);
for (int i = 0; i < 7; i++)
efl_gfx_size_hint_weight_set(objects[i], 1, 1);
break;
case ONE:
- efl_gfx_size_hint_align_set(grid, 0.5, 0.5);
+ efl_gfx_size_hint_align_set(table, 0.5, 0.5);
for (int i = 0; i < 6; i++)
efl_gfx_size_hint_weight_set(objects[i], 0, 0);
efl_gfx_size_hint_weight_set(objects[6], 1, 1);
break;
case TWO:
- efl_gfx_size_hint_align_set(grid, 0.5, 0.5);
+ efl_gfx_size_hint_align_set(table, 0.5, 0.5);
for (int i = 0; i < 5; i++)
efl_gfx_size_hint_weight_set(objects[i], 0, 0);
efl_gfx_size_hint_weight_set(objects[5], 1, 1);
efl_gfx_size_hint_weight_set(objects[6], 1, 1);
break;
case CUSTOM:
- efl_object_override(grid, &custom_layout_ops);
+ efl_object_override(table, &custom_layout_ops);
break;
}
}
char buf[64];
int rows, cols, count;
- efl_pack_grid_size_get(event->object, &cols, &rows);
+ efl_pack_table_size_get(event->object, &cols, &rows);
count = efl_content_count(event->object);
sprintf(buf, "%d items (%dx%d)", count, cols, rows);
elm_object_text_set(o, buf);
int col, row, colspan, rowspan;
char buf[64];
- efl_pack_grid_position_get(event->object, it, &col, &row, &colspan, &rowspan);
+ efl_pack_table_position_get(event->object, it, &col, &row, &colspan, &rowspan);
if (event->desc == EFL_CONTAINER_EVENT_CONTENT_ADDED)
sprintf(buf, "pack %d,%d %dx%d", col, row, colspan, rowspan);
else
static void
_custom_layout_update(Eo *pack, void *_pd EINA_UNUSED)
{
- /* Example custom layout for grid:
+ /* Example custom layout for table:
* divide space into regions of same size, place objects in center of their
* cells using their min size
* Note: This is a TERRIBLE layout function (disregards align, weig.ht, ...)
g = efl_gfx_geometry_get(pack);
- efl_pack_grid_size_get(pack, &cols, &rows);
+ efl_pack_table_size_get(pack, &cols, &rows);
if (!cols || !rows) goto end;
it = efl_content_iterate(pack);
EINA_ITERATOR_FOREACH(it, item)
{
- if (efl_pack_grid_position_get(pack, item, &c, &r, &cs, &rs))
+ if (efl_pack_table_position_get(pack, item, &c, &r, &cs, &rs))
{
Eina_Rect m;
}
void
-test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win, *bx, *o, *vbox, *f, *hbox, *chk, *grid;
+ Evas_Object *win, *bx, *o, *vbox, *f, *hbox, *chk, *table;
int i = 0;
- win = elm_win_util_standard_add("ui-grid", "Efl.Ui.Grid");
+ win = elm_win_util_standard_add("ui-table", "Efl.Ui.Table");
elm_win_autodel_set(win, EINA_TRUE);
efl_gfx_size_set(win, EINA_SIZE2D(600, 400));
// create here to pass in cb
- grid = efl_add(EFL_UI_GRID_CLASS, win);
+ table = efl_add(EFL_UI_TABLE_CLASS, win);
/* controls */
chk = o = elm_radio_add(win);
elm_object_text_set(o, "No weight");
- efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, grid);
+ efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table);
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, NONE);
efl_pack(bx, o);
efl_gfx_visible_set(o, 1);
o = elm_radio_add(win);
- elm_object_text_set(o, "No weight + grid fill");
- efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, grid);
+ elm_object_text_set(o, "No weight + table fill");
+ efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table);
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, NONE_BUT_FILL);
elm_radio_group_add(o, chk);
o = elm_radio_add(win);
elm_object_text_set(o, "Equal weights");
- efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, grid);
+ efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table);
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, EQUAL);
elm_radio_group_add(o, chk);
o = elm_radio_add(win);
elm_object_text_set(o, "One weight only");
- efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, grid);
+ efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table);
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, ONE);
elm_radio_group_add(o, chk);
o = elm_radio_add(win);
elm_object_text_set(o, "Two weights");
- efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, grid);
+ efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table);
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, TWO);
elm_radio_group_add(o, chk);
o = elm_radio_add(win);
elm_object_text_set(o, "Custom layout");
- efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, grid);
+ efl_event_callback_add(o, EFL_UI_RADIO_EVENT_CHANGED, weights_cb, table);
efl_gfx_size_hint_align_set(o, 0, 0.5);
elm_radio_state_value_set(o, CUSTOM);
elm_radio_group_add(o, chk);
elm_slider_horizontal_set(o, 0);
efl_gfx_size_hint_align_set(o, 0.5, -1);
efl_gfx_size_hint_weight_set(o, 1, 1);
- efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, padding_slider_cb, grid);
+ efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, padding_slider_cb, table);
elm_slider_min_max_set(o, 0, 40);
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
elm_slider_horizontal_set(o, 0);
efl_gfx_size_hint_align_set(o, 0.5, -1);
efl_gfx_size_hint_weight_set(o, 1, 1);
- efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, margin_slider_cb, grid);
+ efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, margin_slider_cb, table);
elm_slider_min_max_set(o, 0, 40);
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
elm_slider_horizontal_set(o, 0);
efl_gfx_size_hint_align_set(o, 0.5, -1);
efl_gfx_size_hint_weight_set(o, 1, 1);
- efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, btnmargins_slider_cb, grid);
+ efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, btnmargins_slider_cb, table);
elm_slider_min_max_set(o, 0, 40);
elm_slider_inverted_set(o, 1);
elm_slider_value_set(o, 10);
efl_gfx_visible_set(o, 1);
o = elm_label_add(win);
- efl_event_callback_add(grid, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
+ efl_event_callback_add(table, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
efl_pack(bx, o);
efl_gfx_visible_set(o, 1);
o = elm_label_add(win);
- efl_event_callback_add(grid, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
- efl_event_callback_add(grid, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o);
+ efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
+ efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o);
efl_gfx_size_hint_align_set(o, 0.5, 0);
efl_gfx_size_hint_weight_set(o, 1, 1);
efl_pack(bx, o);
efl_pack(vbox, f);
efl_gfx_visible_set(f, 1);
- efl_gfx_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(f, grid);
- efl_gfx_visible_set(grid, 1);
+ efl_gfx_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_content_set(f, table);
+ efl_gfx_visible_set(table, 1);
objects[i++] = o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_size_hint_min_set(o, EINA_SIZE2D(10, 10));
efl_gfx_color_set(o, 64, 96, 128, 255);
- efl_pack_grid(grid, o, 0, 0, 3, 1);
+ efl_pack_table(table, o, 0, 0, 3, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 1");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_pack_grid(grid, o, 0, 0, 1, 1);
+ efl_pack_table(table, o, 0, 0, 1, 1);
efl_gfx_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 2");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_pack_grid(grid, o, 1, 0, 1, 1);
+ efl_pack_table(table, o, 1, 0, 1, 1);
efl_gfx_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 3");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_pack_grid(grid, o, 2, 0, 1, 1);
+ efl_pack_table(table, o, 2, 0, 1, 1);
efl_gfx_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 4");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_pack_grid(grid, o, 0, 1, 2, 1);
+ efl_pack_table(table, o, 0, 1, 2, 1);
efl_gfx_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 5");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_pack_grid(grid, o, 2, 1, 1, 2);
+ efl_pack_table(table, o, 2, 1, 1, 2);
efl_gfx_visible_set(o, 1);
objects[i++] = o = elm_button_add(win);
elm_object_text_set(o, "Button 6");
efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
- efl_pack_grid(grid, o, 0, 2, 2, 1);
+ efl_pack_table(table, o, 0, 2, 2, 1);
efl_gfx_visible_set(o, 1);
efl_gfx_visible_set(win, 1);
static void
append_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
- Eo *grid = data;
- Eo *o = elm_button_add(grid);
+ Eo *table = data;
+ Eo *o = elm_button_add(table);
elm_object_text_set(o, btn_text("appended"));
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
elm_object_tooltip_text_set(o, "Click to unpack");
- efl_pack_end(grid, o);
+ efl_pack_end(table, o);
efl_gfx_visible_set(o, 1);
}
static void
clear_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
- Eo *grid = data;
- efl_pack_clear(grid);
+ Eo *table = data;
+ efl_pack_clear(table);
}
void
-test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
+test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- Evas_Object *win, *o, *vbox, *f, *hbox, *grid, *ico, *bx;
+ Evas_Object *win, *o, *vbox, *f, *hbox, *table, *ico, *bx;
- win = elm_win_util_standard_add("ui-grid-linear", "Efl.Ui.Grid Linear APIs");
+ win = elm_win_util_standard_add("ui-table-linear", "Efl.Ui.Table Linear APIs");
elm_win_autodel_set(win, EINA_TRUE);
efl_gfx_size_set(win, EINA_SIZE2D(600, 400));
// create here to pass in cb
- grid = efl_add(EFL_UI_GRID_CLASS, win);
+ table = efl_add(EFL_UI_TABLE_CLASS, win);
/* controls */
o = elm_button_add(win);
elm_object_content_set(o, ico);
elm_object_text_set(o, "Append");
- efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, append_cb, grid);
+ efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, append_cb, table);
efl_pack(hbox, o);
efl_gfx_visible_set(o, 1);
o = elm_button_add(win);
elm_object_content_set(o, ico);
elm_object_text_set(o, "Clear");
- efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, clear_cb, grid);
+ efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, clear_cb, table);
efl_pack(hbox, o);
efl_gfx_visible_set(o, 1);
efl_gfx_visible_set(o, 1);
o = elm_label_add(win);
- efl_event_callback_add(grid, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
+ efl_event_callback_add(table, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
efl_pack(bx, o);
efl_gfx_visible_set(o, 1);
o = elm_label_add(win);
- efl_event_callback_add(grid, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
- efl_event_callback_add(grid, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o);
+ efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
+ efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o);
efl_gfx_size_hint_align_set(o, 0.5, 0);
efl_gfx_size_hint_weight_set(o, 1, 1);
efl_pack(bx, o);
efl_pack(vbox, f);
efl_gfx_visible_set(f, 1);
- efl_pack_grid_columns_set(grid, 4);
- efl_pack_grid_direction_set(grid, EFL_UI_DIR_RIGHT, EFL_UI_DIR_DOWN);
- efl_gfx_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(f, grid);
- efl_gfx_visible_set(grid, 1);
+ efl_pack_table_columns_set(table, 4);
+ efl_pack_table_direction_set(table, EFL_UI_DIR_RIGHT, EFL_UI_DIR_DOWN);
+ efl_gfx_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_content_set(f, table);
+ efl_gfx_visible_set(table, 1);
o = elm_button_add(win);
elm_object_text_set(o, btn_text(NULL));
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
- efl_pack(grid, o);
+ efl_pack(table, o);
efl_gfx_visible_set(o, 1);
o = elm_button_add(win);
elm_object_text_set(o, btn_text(NULL));
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
- efl_pack(grid, o);
+ efl_pack(table, o);
efl_gfx_visible_set(o, 1);
o = elm_button_add(win);
elm_object_text_set(o, btn_text(NULL));
efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL);
- efl_pack(grid, o);
+ efl_pack(table, o);
efl_gfx_visible_set(o, 1);
efl_gfx_visible_set(win, 1);
struct _Api_Data
{
- Eo *grid;
+ Eo *table;
Eo *child;
};
typedef struct _Api_Data Api_Data;
enum _api_state
{
- GRID_PACK_SET,
- GRID_UNPACK,
- GRID_SIZE,
- GRID_CLEAR,
+ TABLE_PACK_SET,
+ TABLE_UNPACK,
+ TABLE_SIZE,
+ TABLE_CLEAR,
API_STATE_LAST
};
typedef enum _api_state api_state;
switch(api->state)
{ /* Put all api-changes under switch */
- case GRID_PACK_SET: /* 0 */
- efl_pack_grid(dt->grid, dt->child, 5, 15, 60, 40);
+ case TABLE_PACK_SET: /* 0 */
+ efl_pack_table(dt->table, dt->child, 5, 15, 60, 40);
break;
- case GRID_UNPACK: /* 1 */
- efl_pack_unpack(dt->grid, dt->child);
+ case TABLE_UNPACK: /* 1 */
+ efl_pack_unpack(dt->table, dt->child);
efl_del(dt->child);
break;
- case GRID_SIZE: /* 2 */
- efl_pack_grid_size_get(dt->grid, &w, &h);
+ case TABLE_SIZE: /* 2 */
+ efl_pack_table_size_get(dt->table, &w, &h);
printf("size w=<%d> h=<%d>\n", w, h);
- w = h = 100; /* grid size returns wrong values */
+ w = h = 100; /* table size returns wrong values */
w += 30;
h += 10;
- efl_pack_grid_size_set(dt->grid, w, h);
+ efl_pack_table_size_set(dt->table, w, h);
break;
- case GRID_CLEAR: /* 3 */
- efl_pack_clear(dt->grid);
+ case TABLE_CLEAR: /* 3 */
+ efl_pack_clear(dt->table);
break;
default:
}
static void
-_ch_grid(void *data, const Efl_Event *ev)
+_ch_table(void *data, const Efl_Event *ev)
{
- Eo *gd = data;
+ Eo *table = data;
int x, y, w, h;
- // FIXME: old elm_grid API doesn't need grid object
+ // FIXME: old elm_table API doesn't need table object
//elm_grid_pack_get(obj, &x, &y, &w, &h);
//elm_grid_pack_set(obj, x - 1, y - 1, w + 2, h + 2);
- efl_pack_grid_position_get(gd, ev->object, &x, &y, &w, &h);
- efl_pack_grid(gd, ev->object, x - 1, y - 1, w + 2, h + 2);
+ efl_pack_table_position_get(table, ev->object, &x, &y, &w, &h);
+ efl_pack_table(table, ev->object, x - 1, y - 1, w + 2, h + 2);
}
static void
}
void
-test_grid_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+test_ui_table_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Eo *win, *gd, *bt, *rc, *en;
+ Eo *win, *table, *bt, *rc, *en;
api_data *api = calloc(1, sizeof(*api));
win = efl_add(EFL_UI_WIN_CLASS, NULL,
- efl_ui_win_name_set(efl_added, "grid"),
- efl_text_set(efl_added, "Grid"),
+ efl_ui_win_name_set(efl_added, "table"),
+ efl_text_set(efl_added, "Table"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE),
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _win_del, api));
- gd = efl_add(EFL_UI_GRID_STATIC_CLASS, win);
- efl_content_set(win, gd);
- api->data.grid = gd;
+ table = efl_add(EFL_UI_TABLE_STATIC_CLASS, win);
+ efl_content_set(win, table);
+ api->data.table = table;
/* FIXME: EO-ify entry & button & test_set! */
elm_entry_scrollable_set(en, EINA_TRUE);
elm_object_text_set(en, "Entry text");
elm_entry_single_line_set(en, EINA_TRUE);
- efl_pack_grid(gd, en, 50, 10, 40, 10);
+ efl_pack_table(table, en, 50, 10, 40, 10);
efl_gfx_visible_set(en, 1);
en = elm_entry_add(win);
elm_entry_scrollable_set(en, EINA_TRUE);
elm_object_text_set(en, "Entry text 2");
elm_entry_single_line_set(en, EINA_TRUE);
- efl_pack_grid(gd, en, 60, 20, 30, 10);
+ efl_pack_table(table, en, 60, 20, 30, 10);
efl_gfx_visible_set(en, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Next API function");
efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _api_bt_clicked, api);
- efl_pack_grid(gd, bt, 30, 0, 40, 10);
+ efl_pack_table(table, bt, 30, 0, 40, 10);
elm_object_disabled_set(bt, api->state == API_STATE_LAST);
efl_gfx_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
- efl_pack_grid(gd, bt, 0, 0, 20, 20);
+ efl_pack_table(table, bt, 0, 0, 20, 20);
efl_gfx_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
- efl_pack_grid(gd, bt, 10, 10, 40, 20);
+ efl_pack_table(table, bt, 10, 10, 40, 20);
api->data.child = bt;
efl_gfx_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
- efl_pack_grid(gd, bt, 10, 30, 20, 50);
+ efl_pack_table(table, bt, 10, 30, 20, 50);
efl_gfx_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button");
- efl_pack_grid(gd, bt, 80, 80, 20, 20);
+ efl_pack_table(table, bt, 80, 80, 20, 20);
efl_gfx_visible_set(bt, 1);
bt = elm_button_add(win);
elm_object_text_set(bt, "Change");
- efl_pack_grid(gd, bt, 40, 40, 20, 20);
- efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _ch_grid, gd);
+ efl_pack_table(table, bt, 40, 40, 20, 20);
+ efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _ch_table, table);
efl_gfx_visible_set(bt, 1);
rc = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_color_set(rc, 128, 0, 0, 128);
- efl_pack_grid(gd, rc, 40, 70, 20, 10);
+ efl_pack_table(table, rc, 40, 70, 20, 10);
rc = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_color_set(rc, 0, 128, 0, 128);
- efl_pack_grid(gd, rc, 60, 70, 10, 10);
+ efl_pack_table(table, rc, 60, 70, 10, 10);
rc = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_color_set(rc, 0, 0, 128, 128);
- efl_pack_grid(gd, rc, 40, 80, 10, 10);
+ efl_pack_table(table, rc, 40, 80, 10, 10);
rc = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_color_set(rc, 128, 0, 128, 128);
- efl_pack_grid(gd, rc, 50, 80, 10, 10);
+ efl_pack_table(table, rc, 50, 80, 10, 10);
rc = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
efl_gfx_color_set(rc, 128, 64, 0, 128);
- efl_pack_grid(gd, rc, 60, 80, 10, 10);
+ efl_pack_table(table, rc, 60, 80, 10, 10);
efl_gfx_size_set(win, EINA_SIZE2D(480, 480));
}
efl::ui::Text label(instantiate, win);
label.text_set("label 0");
- table.pack_grid(label, 0, 0, 1, 1);
+ table.pack_table(label, 0, 0, 1, 1);
efl::ui::Text label1(instantiate, win);
label1.text_set("label 1");
- table.pack_grid(label1, 1, 0, 1, 1);
+ table.pack_table(label1, 1, 0, 1, 1);
efl::ui::Text label2(instantiate, win);
label2.text_set("label 2");
- table.pack_grid(label2, 0, 1, 1, 1);
+ table.pack_table(label2, 0, 1, 1, 1);
efl::ui::Text label3(instantiate, win);
label3.text_set("label 3");
- table.pack_grid(label3, 1, 1, 1, 1);
+ table.pack_table(label3, 1, 1, 1, 1);
}
EFL_MAIN()
efl::canvas::Rectangle rect(instantiate, win);
rect.color_set(255, 0, 0, 255);
rect.hint_min_set({100, 50});
- table.pack_grid(rect, 0, 0, 2, 1);
+ table.pack_table(rect, 0, 0, 2, 1);
efl::canvas::Rectangle rect2(instantiate, win);
rect2.color_set(0, 255, 0, 255);
rect2.hint_min_set({50, 100});
- table.pack_grid(rect2, 0, 1, 1, 2);
+ table.pack_table(rect2, 0, 1, 1, 2);
efl::canvas::Rectangle rect3(instantiate, win);
rect3.color_set(0, 0, 255, 255);
rect3.hint_min_set({50, 50});
- table.pack_grid(rect3, 1, 1, 1, 1);
+ table.pack_table(rect3, 1, 1, 1, 1);
efl::canvas::Rectangle rect4(instantiate, win);
rect4.color_set(255, 255, 0, 255);
rect4.hint_min_set({50, 50});
- table.pack_grid(rect4, 1, 2, 1, 1);
+ table.pack_table(rect4, 1, 2, 1, 1);
}
EFL_MAIN()
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_table_efl_pack_grid_pack_grid(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
+_efl_canvas_layout_part_table_efl_pack_table_pack_table(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_table_pack(pd->ed, pd->part, subobj, col, row, colspan, rowspan);
}
EOLIAN static Efl_Gfx *
-_efl_canvas_layout_part_table_efl_pack_grid_grid_content_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row)
+_efl_canvas_layout_part_table_efl_pack_table_table_content_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row)
{
PROXY_DATA_GET(obj, pd);
return _edje_part_table_child_get(pd->ed, pd->part, col, row);
}
EOLIAN static void
-_efl_canvas_layout_part_table_efl_pack_grid_grid_size_get(Eo *obj, void *_pd EINA_UNUSED, int *cols, int *rows)
+_efl_canvas_layout_part_table_efl_pack_table_table_size_get(Eo *obj, void *_pd EINA_UNUSED, int *cols, int *rows)
{
PROXY_DATA_GET(obj, pd);
_edje_part_table_col_row_size_get(pd->ed, pd->part, cols, rows);
}
EOLIAN static int
-_efl_canvas_layout_part_table_efl_pack_grid_grid_columns_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_canvas_layout_part_table_efl_pack_table_table_columns_get(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
int cols = 0, rows = 0;
}
EOLIAN static int
-_efl_canvas_layout_part_table_efl_pack_grid_grid_rows_get(Eo *obj, void *_pd EINA_UNUSED)
+_efl_canvas_layout_part_table_efl_pack_table_table_rows_get(Eo *obj, void *_pd EINA_UNUSED)
{
PROXY_DATA_GET(obj, pd);
int cols = 0, rows = 0;
}
EOLIAN static Eina_Iterator *
-_efl_canvas_layout_part_table_efl_pack_grid_grid_contents_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row, Eina_Bool below)
+_efl_canvas_layout_part_table_efl_pack_table_table_contents_get(Eo *obj, void *_pd EINA_UNUSED, int col, int row, Eina_Bool below)
{
Evas_Object *sobj;
Eina_Iterator *it;
}
EOLIAN static Eina_Bool
-_efl_canvas_layout_part_table_efl_pack_grid_grid_position_get(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan)
+_efl_canvas_layout_part_table_efl_pack_table_table_position_get(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan)
{
unsigned short c, r, cs, rs;
Eina_Bool ret;
edje_object_part_table_pack(Edje_Object *obj, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
{
Eo *table = PART_TABLE_GET(obj, part, EINA_FALSE);
- return efl_pack_grid(table, child_obj, col, row, colspan, rowspan);
+ return efl_pack_table(table, child_obj, col, row, colspan, rowspan);
}
EAPI Eina_Bool
edje_object_part_table_col_row_size_get(const Edje_Object *obj, const char *part, int *cols, int *rows)
{
Eo *table = PART_TABLE_GET(obj, part, EINA_FALSE);
- efl_pack_grid_size_get(table, cols, rows);
+ efl_pack_table_size_get(table, cols, rows);
return EINA_TRUE;
}
edje_object_part_table_child_get(const Edje_Object *obj, const char *part, unsigned int col, unsigned int row)
{
Eo *table = PART_TABLE_GET(obj, part, NULL);
- return efl_pack_grid_content_get(table, col, row);
+ return efl_pack_table_content_get(table, col, row);
}
EAPI Eina_Bool
-class Efl.Canvas.Layout.Part_Table (Efl.Canvas.Layout.Part, Efl.Pack.Grid)
+class Efl.Canvas.Layout.Part_Table (Efl.Canvas.Layout.Part, Efl.Pack.Table)
{
[[Represents a Table created as part of a layout.
Efl.Pack.pack_clear;
Efl.Pack.unpack_all;
Efl.Pack.unpack;
- Efl.Pack.Grid.pack_grid;
- Efl.Pack.Grid.grid_content_get;
- Efl.Pack.Grid.grid_contents_get;
- Efl.Pack.Grid.grid_position { get; }
- Efl.Pack.Grid.grid_size { get; }
- Efl.Pack.Grid.grid_columns { get; }
- Efl.Pack.Grid.grid_rows { get; }
+ Efl.Pack.Table.pack_table;
+ Efl.Pack.Table.table_content_get;
+ Efl.Pack.Table.table_contents_get;
+ Efl.Pack.Table.table_position { get; }
+ Efl.Pack.Table.table_size { get; }
+ Efl.Pack.Table.table_columns { get; }
+ Efl.Pack.Table.table_rows { get; }
}
}
interfaces/efl_observer.eo
interfaces/efl_orientation.eo
interfaces/efl_pack.eo
- interfaces/efl_pack_grid.eo
+ interfaces/efl_pack_table.eo
interfaces/efl_pack_layout.eo
interfaces/efl_pack_linear.eo
interfaces/efl_part.eo
#include "interfaces/efl_pack.eo.h"
#include "interfaces/efl_pack_layout.eo.h"
#include "interfaces/efl_pack_linear.eo.h"
-#include "interfaces/efl_pack_grid.eo.h"
+#include "interfaces/efl_pack_table.eo.h"
/* Input and Output */
#include "interfaces/efl_io_closer.eo.h"
#include "interfaces/efl_pack.eo.c"
#include "interfaces/efl_pack_layout.eo.c"
#include "interfaces/efl_pack_linear.eo.c"
-#include "interfaces/efl_pack_grid.eo.c"
+#include "interfaces/efl_pack_table.eo.c"
#include "interfaces/efl_model.eo.c"
#include "interfaces/efl_animator.eo.c"
import efl_gfx_types;
-interface Efl.Pack.Grid (Efl.Pack.Linear)
+interface Efl.Pack.Table (Efl.Pack.Linear)
{
- [[2D containers aligned on a grid with rows and columns]]
+ [[2D containers aligned on a table with rows and columns]]
eo_prefix: efl_pack;
methods {
- pack_grid {
- [[Pack object at a given location in the grid.
+ pack_table {
+ [[Pack object at a given location in the table.
When this container is deleted, it will request deletion on the
given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
container without deleting it.
]]
params {
- subobj: Efl.Gfx; [[A child object to pack in this grid.]]
+ subobj: Efl.Gfx; [[A child object to pack in this table.]]
col: int; [[Column number]]
row: int; [[Row number]]
- colspan: int @optional; [[0 means 1, -1 means @.grid_columns]]
- rowspan: int @optional; [[0 means 1, -1 means @.grid_rows]]
+ colspan: int @optional; [[0 means 1, -1 means @.table_columns]]
+ rowspan: int @optional; [[0 means 1, -1 means @.table_rows]]
}
return: bool; [[$true on success, $false otherwise]]
}
- grid_contents_get {
- [[Returns all objects at a given position in this grid.]]
- return: iterator<Efl.Gfx> @owned; [[Iterator to grid contents]]
+ table_contents_get {
+ [[Returns all objects at a given position in this table.]]
+ return: iterator<Efl.Gfx> @owned; [[Iterator to table contents]]
params {
@in col: int; [[Column number]]
@in row: int; [[Row number]]
@in below: bool @optional; [[If $true get objects spanning over this cell.]]
}
}
- grid_content_get {
- [[Returns a child at a given position, see @.grid_contents_get.]]
+ table_content_get {
+ [[Returns a child at a given position, see @.table_contents_get.]]
return: Efl.Gfx; [[Child object]]
params {
@in col: int; [[Column number]]
@in row: int; [[Row number]]
}
}
- @property grid_position {
+ @property table_position {
[[Position and span of the $subobj in this container, may be modified to move the $subobj]]
get { return: bool; [[Returns false if item is not a child]] }
keys {
rowspan: int; [[Row span]]
}
}
- @property grid_size {
- [[Combines @.grid_columns and @.grid_rows]]
+ @property table_size {
+ [[Combines @.table_columns and @.table_rows]]
set {}
get {}
values {
rows: int; [[Number of rows]]
}
}
- @property grid_columns {
+ @property table_columns {
[[Gird columns property]]
set { [[Specifies limit for linear adds - if direction is horizontal]] }
get {}
cols: int; [[Number of columns]]
}
}
- @property grid_rows {
- [[Grid rows property]]
+ @property table_rows {
+ [[Table rows property]]
set { [[Specifies limit for linear adds - if direction is vertical]] }
get {}
values {
rows: int; [[Number of rows]]
}
}
- @property grid_direction {
+ @property table_direction {
[[Primary and secondary up/left/right/down directions for linear apis.
Default is horizontal and vertical.
# include <efl_ui_box.eo.h>
# include <efl_ui_box_flow.eo.h>
# include <efl_ui_box_stack.eo.h>
-# include <efl_ui_grid.eo.h>
-# include <efl_ui_grid_static.eo.h>
+# include <efl_ui_table.eo.h>
+# include <efl_ui_table_static.eo.h>
# include <efl_ui_image.eo.h>
# include <efl_ui_win.eo.h>
# include <efl_ui_win_inlined.eo.h>
# include <efl_ui_box.eo.h>
# include <efl_ui_box_flow.eo.h>
# include <efl_ui_box_stack.eo.h>
-# include <efl_ui_grid.eo.h>
-# include <efl_ui_grid_static.eo.h>
+# include <efl_ui_table.eo.h>
+# include <efl_ui_table_static.eo.h>
# include <efl_ui_image.eo.h>
# include <efl_ui_win.eo.h>
# include <efl_ui_win_inlined.eo.h>
EAPI Eina_Bool
elm_layout_table_pack(Eo *obj, const char *part, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
{
- return efl_pack_grid(efl_part(obj, part), child, col, row, colspan, rowspan);
+ return efl_pack_table(efl_part(obj, part), child, col, row, colspan, rowspan);
}
EAPI Evas_Object *
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_table_efl_pack_grid_pack_grid(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
+_efl_ui_layout_part_table_efl_pack_table_pack_table(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx *subobj, int col, int row, int colspan, int rowspan)
{
return _efl_ui_layout_table_pack(pd->obj, pd->sd, pd->part, subobj, col, row, colspan, rowspan);
}
EOLIAN static Efl_Gfx *
-_efl_ui_layout_part_table_efl_pack_grid_grid_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int col, int row)
+_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)
{
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
return evas_object_table_child_get(pack, col, row);
}
EOLIAN static Eina_Iterator *
-_efl_ui_layout_part_table_efl_pack_grid_grid_contents_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int col, int row, Eina_Bool below)
+_efl_ui_layout_part_table_efl_pack_table_table_contents_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int col, int row, Eina_Bool below)
{
- // contents at col,row - see also Efl.Ui.Grid or edje_containers.c
+ // contents at col,row - see also Efl.Ui.Table or edje_containers.c
// not reusing edje's iterator because the container would be wrong
Eina_List *list, *l = NULL;
}
EOLIAN static Eina_Bool
-_efl_ui_layout_part_table_efl_pack_grid_grid_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan)
+_efl_ui_layout_part_table_efl_pack_table_table_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, Efl_Gfx * subobj, int *col, int *row, int *colspan, int *rowspan)
{
unsigned short c, r, cs, rs;
Eina_Bool ret;
}
EOLIAN static void
-_efl_ui_layout_part_table_efl_pack_grid_grid_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int *cols, int *rows)
+_efl_ui_layout_part_table_efl_pack_table_table_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd, int *cols, int *rows)
{
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
evas_object_table_col_row_size_get(pack, cols, rows);
}
EOLIAN static int
-_efl_ui_layout_part_table_efl_pack_grid_grid_columns_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
+_efl_ui_layout_part_table_efl_pack_table_table_columns_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
{
int cols, rows;
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
}
EOLIAN static int
-_efl_ui_layout_part_table_efl_pack_grid_grid_rows_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
+_efl_ui_layout_part_table_efl_pack_table_table_rows_get(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Table_Data *pd)
{
int cols, rows;
Eo *pack = (Eo *) edje_object_part_object_get(pd->obj, pd->part);
-class Efl.Ui.Layout.Part.Table (Efl.Object, Efl.Pack.Grid)
+class Efl.Ui.Layout.Part.Table (Efl.Object, Efl.Pack.Table)
{
[[Represents a Table created as part of a layout.
Efl.Pack.pack_clear;
Efl.Pack.unpack_all;
Efl.Pack.unpack;
- Efl.Pack.Grid.pack_grid;
- Efl.Pack.Grid.grid_content_get;
- Efl.Pack.Grid.grid_contents_get;
- Efl.Pack.Grid.grid_position { get; }
- Efl.Pack.Grid.grid_size { get; }
- Efl.Pack.Grid.grid_columns { get; }
- Efl.Pack.Grid.grid_rows { get; }
+ Efl.Pack.Table.pack_table;
+ Efl.Pack.Table.table_content_get;
+ Efl.Pack.Table.table_contents_get;
+ Efl.Pack.Table.table_position { get; }
+ Efl.Pack.Table.table_size { get; }
+ Efl.Pack.Table.table_columns { get; }
+ Efl.Pack.Table.table_rows { get; }
}
}
-#include "efl_ui_grid_private.h"
+#include "efl_ui_table_private.h"
#include "../evas/canvas/evas_table.eo.h"
-#define MY_CLASS EFL_UI_GRID_CLASS
-#define MY_CLASS_NAME "Efl.Ui.Grid"
+#define MY_CLASS EFL_UI_TABLE_CLASS
+#define MY_CLASS_NAME "Efl.Ui.Table"
#define MY_CLASS_NAME_LEGACY "elm_grid"
typedef struct _Custom_Table_Data Custom_Table_Data;
static void _subobj_del_cb(void *data, const Efl_Event *event);
-static void _item_remove(Efl_Ui_Grid *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx *subobj);
+static void _item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj);
struct _Custom_Table_Data
{
- Efl_Ui_Grid *parent;
- Efl_Ui_Grid_Data *gd;
+ Efl_Ui_Table *parent;
+ Efl_Ui_Table_Data *gd;
};
EFL_CALLBACKS_ARRAY_DEFINE(subobj_callbacks,
}
EOLIAN static Efl_Ui_Theme_Apply
-_efl_ui_grid_elm_widget_theme_apply(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_efl_ui_table_elm_widget_theme_apply(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
}
static void
-_layout_updated_emit(Efl_Ui_Grid *obj)
+_layout_updated_emit(Efl_Ui_Table *obj)
{
efl_event_callback_legacy_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL);
}
static void
-_sizing_eval(Evas_Object *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_sizing_eval(Evas_Object *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
Evas_Coord minw = 0, minh = 0, maxw = -1, maxh = -1;
Evas_Coord w, h;
Evas_Object *table EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- Efl_Ui_Grid_Data *pd = efl_data_scope_get(data, MY_CLASS);
+ Efl_Ui_Table_Data *pd = efl_data_scope_get(data, MY_CLASS);
_sizing_eval(data, pd);
}
};
static const Efl_Class_Description custom_table_class_desc = {
- EO_VERSION, "Efl.Ui.Grid.Internal", EFL_CLASS_TYPE_REGULAR,
+ EO_VERSION, "Efl.Ui.Table.Internal", EFL_CLASS_TYPE_REGULAR,
sizeof(Custom_Table_Data), _custom_table_initializer, NULL, NULL
};
-EFL_DEFINE_CLASS(_efl_ui_grid_custom_table_class_get, &custom_table_class_desc,
+EFL_DEFINE_CLASS(_efl_ui_table_custom_table_class_get, &custom_table_class_desc,
EVAS_TABLE_CLASS, NULL)
-#define CUSTOM_TABLE_CLASS _efl_ui_grid_custom_table_class_get()
+#define CUSTOM_TABLE_CLASS _efl_ui_table_custom_table_class_get()
static void
_custom_table_calc(Eo *obj, Custom_Table_Data *pd)
/* End of custom table class */
EOLIAN static void
-_efl_ui_grid_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Grid_Data *pd)
+_efl_ui_table_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Table_Data *pd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
}
EOLIAN void
-_efl_ui_grid_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
}
EOLIAN static void
-_efl_ui_grid_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Grid_Data *pd)
+_efl_ui_table_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Table_Data *pd)
{
Custom_Table_Data *custom;
Evas_Object *table;
}
EOLIAN static void
-_efl_ui_grid_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
Eina_List *l;
Evas_Object *child;
}
EOLIAN static Eo *
-_efl_ui_grid_efl_object_constructor(Eo *obj, Efl_Ui_Grid_Data *pd)
+_efl_ui_table_efl_object_constructor(Eo *obj, Efl_Ui_Table_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
EOLIAN static void
-_efl_ui_grid_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED, double h, double v, Eina_Bool scalable)
+_efl_ui_table_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, double h, double v, Eina_Bool scalable)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
}
EOLIAN static void
-_efl_ui_grid_efl_pack_pack_padding_get(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED, double *h, double *v, Eina_Bool *scalable)
+_efl_ui_table_efl_pack_pack_padding_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, double *h, double *v, Eina_Bool *scalable)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
static void
_subobj_del_cb(void *data, const Efl_Event *event)
{
- Efl_Ui_Grid *obj = data;
- Efl_Ui_Grid_Data *pd = efl_data_scope_get(obj, EFL_UI_GRID_CLASS);
+ Efl_Ui_Table *obj = data;
+ Efl_Ui_Table_Data *pd = efl_data_scope_get(obj, EFL_UI_TABLE_CLASS);
efl_event_callback_array_del(event->object, subobj_callbacks(), data);
_item_remove(obj, pd, event->object);
}
static Eina_Bool
-_pack_at(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx *subobj,
+_pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj,
int col, int row, int colspan, int rowspan, Eina_Bool linear)
{
- Grid_Item *gi = NULL;
+ Table_Item *gi = NULL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
if ((pd->req_cols && ((col + colspan) > pd->req_cols)) ||
(pd->req_rows && ((row + rowspan) > pd->req_rows)))
{
- ERR("grid requested size exceeded! packing in extra cell at "
- "%d,%d %dx%d (grid: %dx%d)",
+ ERR("table requested size exceeded! packing in extra cell at "
+ "%d,%d %dx%d (table: %dx%d)",
col, row, colspan, rowspan, pd->req_cols, pd->req_rows);
}
if (obj == elm_widget_parent_widget_get(subobj))
{
- gi = efl_key_data_get(subobj, GRID_ITEM_KEY);
+ gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
if (gi)
{
gi->col = col;
gi->linear = !!linear;
gi->object = subobj; // xref(, obj);
pd->count++;
- pd->items = (Grid_Item *)
+ pd->items = (Table_Item *)
eina_inlist_append(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
- efl_key_data_set(subobj, GRID_ITEM_KEY, gi);
+ efl_key_data_set(subobj, TABLE_ITEM_KEY, gi);
elm_widget_sub_object_add(obj, subobj);
efl_event_callback_legacy_call(obj, EFL_CONTAINER_EVENT_CONTENT_ADDED, subobj);
efl_event_callback_array_add(subobj, subobj_callbacks(), obj);
}
EOLIAN static Eina_Bool
-_efl_ui_grid_efl_pack_grid_pack_grid(Eo *obj, Efl_Ui_Grid_Data *pd,
+_efl_ui_table_efl_pack_table_pack_table(Eo *obj, Efl_Ui_Table_Data *pd,
Efl_Gfx *subobj,
int col, int row, int colspan, int rowspan)
{
}
EOLIAN static Eina_Bool
-_efl_ui_grid_efl_pack_grid_grid_position_get(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED, Evas_Object *subobj, int *col, int *row, int *colspan, int *rowspan)
+_efl_ui_table_efl_pack_table_table_position_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Evas_Object *subobj, int *col, int *row, int *colspan, int *rowspan)
{
int c = -1, r = -1, cs = 0, rs = 0;
- Grid_Item *gi;
+ Table_Item *gi;
Eina_Bool ret = EINA_FALSE;
if (obj != elm_widget_parent_widget_get(subobj))
goto end;
}
- gi = efl_key_data_get(subobj, GRID_ITEM_KEY);
+ gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
if (gi)
{
c = gi->col;
}
EOLIAN static Efl_Gfx *
-_efl_ui_grid_efl_pack_grid_grid_content_get(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED, int col, int row)
+_efl_ui_table_efl_pack_table_table_content_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, int col, int row)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
}
static void
-_item_remove(Efl_Ui_Grid *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx *subobj)
+_item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj)
{
- Grid_Item *gi = efl_key_data_get(subobj, GRID_ITEM_KEY);
- Grid_Item *gi2, *last = NULL;
+ Table_Item *gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
+ Table_Item *gi2, *last = NULL;
if (!gi)
{
- WRN("item %p has no grid internal data", subobj);
+ WRN("item %p has no table internal data", subobj);
EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), gi)
if (gi->object == subobj)
break;
if (!gi)
{
- ERR("item %p was not found in this grid", subobj);
+ ERR("item %p was not found in this table", subobj);
return;
}
}
end:
efl_event_callback_legacy_call(obj, EFL_CONTAINER_EVENT_CONTENT_REMOVED, subobj);
- pd->items = (Grid_Item *)
+ pd->items = (Table_Item *)
eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
pd->count--;
- efl_key_data_set(subobj, GRID_ITEM_KEY, NULL);
+ efl_key_data_set(subobj, TABLE_ITEM_KEY, NULL);
free(gi);
}
EOLIAN static Eina_Bool
-_efl_ui_grid_efl_pack_unpack(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx *subobj)
+_efl_ui_table_efl_pack_unpack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
}
EOLIAN static Eina_Bool
-_efl_ui_grid_efl_pack_pack_clear(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_pack_pack_clear(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
}
EOLIAN static Eina_Bool
-_efl_ui_grid_efl_pack_unpack_all(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_pack_unpack_all(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
}
EOLIAN static void
-_efl_ui_grid_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
}
static Eina_Bool
-_grid_item_iterator_next(Grid_Item_Iterator *it, void **data)
+_table_item_iterator_next(Table_Item_Iterator *it, void **data)
{
Efl_Gfx *sub;
}
static Eo *
-_grid_item_iterator_get_container(Grid_Item_Iterator *it)
+_table_item_iterator_get_container(Table_Item_Iterator *it)
{
return it->object;
}
static void
-_grid_item_iterator_free(Grid_Item_Iterator *it)
+_table_item_iterator_free(Table_Item_Iterator *it)
{
eina_iterator_free(it->real_iterator);
eina_list_free(it->list);
}
static inline Eina_Iterator *
-_grid_item_iterator_create(Eo *obj, Eina_List *list)
+_table_item_iterator_create(Eo *obj, Eina_List *list)
{
- Grid_Item_Iterator *it;
+ Table_Item_Iterator *it;
if (!list) return NULL;
it = calloc(1, sizeof(*it));
it->list = list;
it->real_iterator = eina_list_iterator_new(it->list);
it->iterator.version = EINA_ITERATOR_VERSION;
- it->iterator.next = FUNC_ITERATOR_NEXT(_grid_item_iterator_next);
- it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_grid_item_iterator_get_container);
- it->iterator.free = FUNC_ITERATOR_FREE(_grid_item_iterator_free);
+ it->iterator.next = FUNC_ITERATOR_NEXT(_table_item_iterator_next);
+ it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_table_item_iterator_get_container);
+ it->iterator.free = FUNC_ITERATOR_FREE(_table_item_iterator_free);
it->object = obj;
return &it->iterator;
}
EOLIAN static Eina_Iterator *
-_efl_ui_grid_efl_container_content_iterate(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_container_content_iterate(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
Eina_List *list;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
list = evas_object_table_children_get(wd->resize_obj);
- return _grid_item_iterator_create(obj, list);
+ return _table_item_iterator_create(obj, list);
}
EOLIAN static int
-_efl_ui_grid_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd)
+_efl_ui_table_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
return pd->count;
}
EOLIAN static Eina_Iterator *
-_efl_ui_grid_efl_pack_grid_grid_contents_get(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED,
+_efl_ui_table_efl_pack_table_table_contents_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED,
int col, int row, Eina_Bool below)
{
Eina_List *list, *atlist = NULL;
list = evas_object_table_children_get(wd->resize_obj);
EINA_LIST_FREE(list, sobj)
{
- Grid_Item *gi = efl_key_data_get(sobj, GRID_ITEM_KEY);
+ Table_Item *gi = efl_key_data_get(sobj, TABLE_ITEM_KEY);
if (!gi) continue;
if ((gi->col == col) && (gi->row == row))
}
}
- return _grid_item_iterator_create(obj, atlist);
+ return _table_item_iterator_create(obj, atlist);
}
EOLIAN static void
-_efl_ui_grid_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Dir dir)
+_efl_ui_table_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Ui_Dir dir)
{
pd->dir1 = dir;
}
EOLIAN static Efl_Ui_Dir
-_efl_ui_grid_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd)
+_efl_ui_table_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
return pd->dir1;
}
EOLIAN static void
-_efl_ui_grid_efl_pack_grid_grid_direction_set(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Dir primary, Efl_Ui_Dir secondary)
+_efl_ui_table_efl_pack_table_table_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Ui_Dir primary, Efl_Ui_Dir secondary)
{
pd->dir1 = primary;
pd->dir2 = secondary;
}
EOLIAN static void
-_efl_ui_grid_efl_pack_grid_grid_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, Efl_Ui_Dir *primary, Efl_Ui_Dir *secondary)
+_efl_ui_table_efl_pack_table_table_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, Efl_Ui_Dir *primary, Efl_Ui_Dir *secondary)
{
if (primary) *primary = pd->dir1;
if (secondary) *secondary = pd->dir2;
}
EOLIAN static void
-_efl_ui_grid_efl_pack_grid_grid_size_set(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED, int cols, int rows)
+_efl_ui_table_efl_pack_table_table_size_set(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, int cols, int rows)
{
if (cols < 0) cols = 0;
if (rows < 0) rows = 0;
}
EOLIAN static void
-_efl_ui_grid_efl_pack_grid_grid_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd EINA_UNUSED, int *cols, int *rows)
+_efl_ui_table_efl_pack_table_table_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd EINA_UNUSED, int *cols, int *rows)
{
- if (cols) *cols = efl_pack_grid_columns_get(obj);
- if (rows) *rows = efl_pack_grid_rows_get(obj);
+ if (cols) *cols = efl_pack_table_columns_get(obj);
+ if (rows) *rows = efl_pack_table_rows_get(obj);
}
EOLIAN static void
-_efl_ui_grid_efl_pack_grid_grid_columns_set(Eo *obj, Efl_Ui_Grid_Data *pd, int columns)
+_efl_ui_table_efl_pack_table_table_columns_set(Eo *obj, Efl_Ui_Table_Data *pd, int columns)
{
pd->req_cols = columns;
}
EOLIAN static int
-_efl_ui_grid_efl_pack_grid_grid_columns_get(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd)
+_efl_ui_table_efl_pack_table_table_columns_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
if (!pd->req_cols)
{
}
EOLIAN static void
-_efl_ui_grid_efl_pack_grid_grid_rows_set(Eo *obj, Efl_Ui_Grid_Data *pd, int rows)
+_efl_ui_table_efl_pack_table_table_rows_set(Eo *obj, Efl_Ui_Table_Data *pd, int rows)
{
pd->req_rows = rows;
}
EOLIAN static int
-_efl_ui_grid_efl_pack_grid_grid_rows_get(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd)
+_efl_ui_table_efl_pack_table_table_rows_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
if (!pd->req_rows)
{
}
EOLIAN static Eina_Bool
-_efl_ui_grid_efl_pack_pack(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED, Efl_Gfx *subobj)
+_efl_ui_table_efl_pack_pack(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Efl_Gfx *subobj)
{
/* this is just an alias */
return efl_pack_end(obj, subobj);
}
EOLIAN static Eina_Bool
-_efl_ui_grid_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx *subobj)
+_efl_ui_table_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx *subobj)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(subobj, EINA_FALSE);
/* Internal EO APIs and hidden overrides */
-#define EFL_UI_GRID_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_grid)
+#define EFL_UI_TABLE_EXTRA_OPS \
+ EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_table)
-#include "efl_ui_grid.eo.c"
+#include "efl_ui_table.eo.c"
-class Efl.Ui.Grid (Elm.Widget, Efl.Pack.Grid, Efl.Pack.Layout,
+class Efl.Ui.Table (Elm.Widget, Efl.Pack.Table, Efl.Pack.Layout,
Efl.Ui.Direction)
{
- [[Efl UI grid class]]
+ [[Efl UI table class]]
implements {
Efl.Object.constructor;
Efl.Canvas.Group.group_calculate;
Efl.Pack.unpack;
Efl.Pack.pack;
Efl.Pack.pack_padding { get; set; }
- Efl.Pack.Grid.pack_grid;
- Efl.Pack.Grid.grid_content_get;
- Efl.Pack.Grid.grid_contents_get;
- Efl.Pack.Grid.grid_position { get; }
- Efl.Pack.Grid.grid_size { get; set; }
- Efl.Pack.Grid.grid_columns { get; set; }
- Efl.Pack.Grid.grid_rows { get; set; }
- Efl.Pack.Grid.grid_direction { get; set; }
+ Efl.Pack.Table.pack_table;
+ Efl.Pack.Table.table_content_get;
+ Efl.Pack.Table.table_contents_get;
+ Efl.Pack.Table.table_position { get; }
+ Efl.Pack.Table.table_size { get; set; }
+ Efl.Pack.Table.table_columns { get; set; }
+ Efl.Pack.Table.table_rows { get; set; }
+ Efl.Pack.Table.table_direction { get; set; }
Efl.Pack.Linear.pack_end;
Efl.Pack.Layout.layout_update;
Efl.Pack.Layout.layout_request;
-#ifndef EFL_UI_GRID_PRIVATE_H
-#define EFL_UI_GRID_PRIVATE_H
+#ifndef EFL_UI_TABLE_PRIVATE_H
+#define EFL_UI_TABLE_PRIVATE_H
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#include <Elementary.h>
#include "elm_priv.h"
-typedef struct _Efl_Ui_Grid_Data Efl_Ui_Grid_Data;
-typedef struct _Grid_Item_Iterator Grid_Item_Iterator;
-typedef struct _Grid_Item Grid_Item;
+typedef struct _Efl_Ui_Table_Data Efl_Ui_Table_Data;
+typedef struct _Table_Item_Iterator Table_Item_Iterator;
+typedef struct _Table_Item Table_Item;
-#define GRID_ITEM_KEY "__grid_item"
+#define TABLE_ITEM_KEY "__table_item"
-struct _Grid_Item
+struct _Table_Item
{
EINA_INLIST;
Eina_Bool linear : 1;
};
-struct _Efl_Ui_Grid_Data
+struct _Efl_Ui_Table_Data
{
- Grid_Item *items;
+ Table_Item *items;
int count;
int req_cols, req_rows; // requested - 0 means infinite
Eina_Bool linear_recalc : 1;
};
-struct _Grid_Item_Iterator
+struct _Table_Item_Iterator
{
Eina_Iterator iterator;
Eina_Iterator *real_iterator;
Eina_List *list;
- Efl_Ui_Grid *object;
+ Efl_Ui_Table *object;
};
#endif
-#include "efl_ui_grid_private.h"
+#include "efl_ui_table_private.h"
-#define MY_CLASS EFL_UI_GRID_STATIC_CLASS
-#define MY_CLASS_NAME "Efl.Ui.Grid_Static"
+#define MY_CLASS EFL_UI_TABLE_STATIC_CLASS
+#define MY_CLASS_NAME "Efl.Ui.Table_Static"
#define MY_CLASS_NAME_LEGACY "elm_grid"
EOLIAN static Eo *
-_efl_ui_grid_static_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+_efl_ui_table_static_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
{
- Efl_Ui_Grid_Data *gd;
+ Efl_Ui_Table_Data *gd;
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
efl_access_role_set(obj, EFL_ACCESS_ROLE_FILLER);
- gd = efl_data_scope_get(obj, EFL_UI_GRID_CLASS);
+ gd = efl_data_scope_get(obj, EFL_UI_TABLE_CLASS);
gd->req_cols = 100;
gd->req_rows = 100;
}
EOLIAN static void
-_efl_ui_grid_static_efl_pack_layout_layout_update(Eo *obj, void *_pd EINA_UNUSED)
+_efl_ui_table_static_efl_pack_layout_layout_update(Eo *obj, void *_pd EINA_UNUSED)
{
- Efl_Ui_Grid_Data *gd;
- Grid_Item *gi;
+ Efl_Ui_Table_Data *gd;
+ Table_Item *gi;
Evas *e;
long long xl, yl, wl, hl, vwl, vhl;
Eina_Bool mirror;
Eina_Rect r;
- gd = efl_data_scope_get(obj, EFL_UI_GRID_CLASS);
+ gd = efl_data_scope_get(obj, EFL_UI_TABLE_CLASS);
if (!gd->items) return;
e = evas_object_evas_get(obj);
if (!gd->req_cols || !gd->req_rows)
{
- WRN("Grid_Static size must be set before using! Default to 100x100.");
- efl_pack_grid_size_set(obj, 100, 100);
+ WRN("Table_Static size must be set before using! Default to 100x100.");
+ efl_pack_table_size_set(obj, 100, 100);
if (!gd->req_cols || !gd->req_rows) goto err;
}
vwl = gd->req_cols;
efl_event_thaw(e);
}
-#include "efl_ui_grid_static.eo.c"
+#include "efl_ui_table_static.eo.c"
-class Efl.Ui.Grid_Static (Efl.Ui.Grid)
+class Efl.Ui.Table_Static (Efl.Ui.Table)
{
- [[Efl UI grid static class]]
+ [[Efl UI table static class]]
data: null;
implements {
Efl.Object.constructor;
/* items have a text part "text" containing their position */
sprintf(buf, "%d,%d", k, l);
- sobj = efl_pack_grid_content_get(efl_part(obj, "table"), k, l);
+ sobj = efl_pack_table_content_get(efl_part(obj, "table"), k, l);
fail_if(!sobj);
//txt = efl_part_text_get(sobj, "text");
txt = edje_object_part_text_get(sobj, "text");
i = l*2 + k;
sobjs[i] = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas);
fail_if(!sobjs[i]);
- efl_pack_grid(efl_part(obj, "table"), sobjs[i], k, l + 2, 1, 1);
+ efl_pack_table(efl_part(obj, "table"), sobjs[i], k, l + 2, 1, 1);
}
fail_if(efl_content_count(efl_part(obj, "table")) != 8);
it = efl_content_iterate(efl_part(obj, "table"));
EINA_ITERATOR_FOREACH(it, sobj)
{
- efl_pack_grid_position_get(efl_part(obj, "table"), sobj, &k, &l, &cs, &rs);
+ efl_pack_table_position_get(efl_part(obj, "table"), sobj, &k, &l, &cs, &rs);
fail_if(cs != 1);
fail_if(rs != 1);
if (l >= 2)
fail_if(i != 8);
/* table size and clear */
- efl_pack_grid_size_get(efl_part(obj, "table"), &cols, &rows);
+ efl_pack_table_size_get(efl_part(obj, "table"), &cols, &rows);
fail_if(cols != 2);
fail_if(rows != 4);
efl_pack_clear(efl_part(obj, "table"));
fail_if(efl_content_count(efl_part(obj, "table")) != 4);
- efl_pack_grid_size_get(efl_part(obj, "table"), &cols, &rows);
+ efl_pack_table_size_get(efl_part(obj, "table"), &cols, &rows);
fail_if(cols != 2);
fail_if(rows != 2);