diff options
author | SangHyeon Lee <sh10233.lee@samsung.com> | 2017-12-19 14:13:58 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-12-19 14:25:08 +0900 |
commit | 0f16a0671008a324d8e1b523fb16ce7b5c1acd6c (patch) | |
tree | d5dabf48cdae006c2d9ec2edcb845803acdcef1f /src/bin | |
parent | 85b2a8669a321495967d5d45737fcb94f137d979 (diff) | |
download | efl-0f16a0671008a324d8e1b523fb16ce7b5c1acd6c.tar.gz |
interface : change efl_pack_grid and efl_ui_grid to efl_pack_table and efl_ui_table
Summary:
Change name of 'grid' to 'table' for matching on common ui naming
and avoiding confusion with 'gengrid' and 'grid view'.
grid will be introduced as grid image view after.
Test Plan:
checked make & make install
checked make check - there are errors but not related with these changes.
checked make examples - there are errors in cxx but not related with these changes.
checked make discheck - failed
test in elementary_test with Efl.Ui.Table and Table_static.
Reviewers: raster, cedric, jpeg, felipealmeida
Differential Revision: https://phab.enlightenment.org/D5668
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/elementary/test.c | 12 | ||||
-rw-r--r-- | src/bin/elementary/test_evas_snapshot.c | 34 | ||||
-rw-r--r-- | src/bin/elementary/test_ui_popup.c | 20 | ||||
-rw-r--r-- | src/bin/elementary/test_ui_scroller.c | 10 | ||||
-rw-r--r-- | src/bin/elementary/test_ui_table.c (renamed from src/bin/elementary/test_ui_grid.c) | 124 | ||||
-rw-r--r-- | src/bin/elementary/test_ui_table_static.c (renamed from src/bin/elementary/test_grid_static.c) | 82 |
6 files changed, 141 insertions, 141 deletions
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index eb5591300f..eeb8275db2 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -151,8 +151,8 @@ void test_table5(void *data, Evas_Object *obj, void *event_info); 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); @@ -264,7 +264,7 @@ void test_win_socket(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); @@ -803,9 +803,9 @@ add_tests: //------------------------------// 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); diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c index a6d41eb59e..48cd8a38ea 100644 --- a/src/bin/elementary/test_evas_snapshot.c +++ b/src/bin/elementary/test_evas_snapshot.c @@ -3,7 +3,7 @@ #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", @@ -38,10 +38,10 @@ _anim_toggle(void *data, const Efl_Event *ev EINA_UNUSED) { 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)) @@ -115,27 +115,27 @@ _toggle_map(void *data, const Efl_Event *ev EINA_UNUSED) 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); @@ -143,14 +143,14 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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 @@ -161,7 +161,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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, @@ -170,13 +170,13 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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"), @@ -203,6 +203,6 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e 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)); } diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c index 5f57e79179..9839c175c1 100644 --- a/src/bin/elementary/test_ui_popup.c +++ b/src/bin/elementary/test_ui_popup.c @@ -1047,50 +1047,50 @@ test_ui_popup_anchor(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 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); } diff --git a/src/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c index 460ba41d05..275e9ee045 100644 --- a/src/bin/elementary/test_ui_scroller.c +++ b/src/bin/elementary/test_ui_scroller.c @@ -83,7 +83,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 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)); @@ -91,14 +91,14 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 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++) @@ -108,7 +108,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 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)); } } diff --git a/src/bin/elementary/test_ui_grid.c b/src/bin/elementary/test_ui_table.c index eba4eadb6c..d16047577a 100644 --- a/src/bin/elementary/test_ui_grid.c +++ b/src/bin/elementary/test_ui_table.c @@ -25,43 +25,43 @@ weights_cb(void *data, const Efl_Event *event) 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; } } @@ -103,7 +103,7 @@ layout_updated_cb(void *data, const Efl_Event *event) 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); @@ -117,7 +117,7 @@ child_evt_cb(void *data, const Efl_Event *event) 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 @@ -128,7 +128,7 @@ child_evt_cb(void *data, const Efl_Event *event) 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, ...) @@ -141,13 +141,13 @@ _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED) 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; @@ -167,12 +167,12 @@ end: } 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)); @@ -185,7 +185,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i // create here to pass in cb - grid = efl_add(EFL_UI_GRID_CLASS, win); + table = efl_add(EFL_UI_TABLE_CLASS, win); /* controls */ @@ -210,15 +210,15 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -227,7 +227,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -236,7 +236,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -245,7 +245,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -254,7 +254,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -308,7 +308,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -334,7 +334,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -360,7 +360,7 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -381,13 +381,13 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -402,55 +402,55 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i 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); @@ -474,29 +474,29 @@ remove_cb(void *data EINA_UNUSED, const Efl_Event *ev) 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)); @@ -509,7 +509,7 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, // create here to pass in cb - grid = efl_add(EFL_UI_GRID_CLASS, win); + table = efl_add(EFL_UI_TABLE_CLASS, win); /* controls */ @@ -531,7 +531,7 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 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); @@ -540,7 +540,7 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 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); @@ -559,13 +559,13 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 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); @@ -580,28 +580,28 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 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); diff --git a/src/bin/elementary/test_grid_static.c b/src/bin/elementary/test_ui_table_static.c index 108d7d7831..8681e7ae93 100644 --- a/src/bin/elementary/test_grid_static.c +++ b/src/bin/elementary/test_ui_table_static.c @@ -6,7 +6,7 @@ struct _Api_Data { - Eo *grid; + Eo *table; Eo *child; }; typedef struct _Api_Data Api_Data; @@ -20,10 +20,10 @@ 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; @@ -36,27 +36,27 @@ set_api_state(api_data *api) 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: @@ -80,16 +80,16 @@ _api_bt_clicked(void *data, const Efl_Event *ev) } 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 @@ -99,20 +99,20 @@ _win_del(void *data, const Efl_Event *ev EINA_UNUSED) } 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! */ @@ -120,69 +120,69 @@ test_grid_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve 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)); } |