Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-04-29 12:50:55 +09:00
commit 51c7a0ab49
91 changed files with 1678 additions and 813 deletions

2
README
View File

@ -426,7 +426,7 @@ COMPILING AND INSTALLING
make
sudo make install
If you have doxygen, then you csan build documentation with:
If you have doxygen, then you can build documentation with:
make doc

View File

@ -693,7 +693,7 @@
* not seeing its front face.
* @until evas_object_map_enable_set
*
* And we free this map, since since we messed too much with it and for the
* And we free this map, since we messed too much with it and for the
* last object we want something cleaner.
* @until evas_map_free
*

View File

@ -33,7 +33,7 @@ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, genlist);
evas_object_show(genlist);
Elm_Genlist_Item_Class gic;
Elm_Genlist_Item_Class gic = { 0 };
Elm_Object_Item *glit, *glit_top;
gic.item_style = "default";
gic.func.text_get = _text_get;

View File

@ -33,7 +33,7 @@ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, genlist);
evas_object_show(genlist);
Elm_Genlist_Item_Class gic;
Elm_Genlist_Item_Class gic = { 0 };
gic.item_style = "double_label";
gic.func.text_get = _text_get;
gic.func.content_get = _content_get;

View File

@ -33,7 +33,7 @@ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, genlist);
evas_object_show(genlist);
Elm_Genlist_Item_Class gic;
Elm_Genlist_Item_Class gic = { 0 };
gic.item_style = "icon_top_text_bottom";
gic.func.text_get = _text_get;
gic.func.content_get = _content_get;

View File

@ -33,7 +33,7 @@ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, genlist);
evas_object_show(genlist);
Elm_Genlist_Item_Class gic;
Elm_Genlist_Item_Class gic = { 0 };
gic.item_style = "group_index";
gic.func.text_get = _text_get;
gic.func.content_get = _content_get;

View File

@ -33,7 +33,7 @@ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, genlist);
evas_object_show(genlist);
Elm_Genlist_Item_Class gic;
Elm_Genlist_Item_Class gic = { 0 };
gic.item_style = "default";
gic.func.text_get = _text_get;
gic.func.content_get = _content_get;

View File

@ -52,6 +52,7 @@ efl_eolian_files = \
lib/efl/interfaces/efl_orientation.eo \
lib/efl/interfaces/efl_container.eo \
lib/efl/interfaces/efl_content.eo \
lib/efl/interfaces/efl_gfx_arrangement.eo \
lib/efl/interfaces/efl_pack.eo \
lib/efl/interfaces/efl_pack_layout.eo \
lib/efl/interfaces/efl_pack_linear.eo \

View File

@ -125,7 +125,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
efl_ui_win_autodel_set(efl_added, 1));
table = efl_add(EFL_UI_TABLE_CLASS, win,
efl_pack_padding_set(efl_added, 5, 5, 1));
efl_gfx_arrangement_content_padding_set(efl_added, 5, 5, 1));
efl_content_set(win, table);
// Objects below the snapshot

View File

@ -387,9 +387,9 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1.0, 0.0),
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
efl_pack_padding_set(efl_added, 5, 5, 1),
efl_gfx_arrangement_content_padding_set(efl_added, 5, 5, 1),
efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5),
efl_pack_align_set(efl_added, 0, 0.5));
efl_gfx_arrangement_content_align_set(efl_added, 0, 0.5));
efl_pack(box, box2);
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(images); k++)
@ -456,7 +456,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1.0, 0.0),
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE),
efl_pack_align_set(efl_added, 0.5, 0.5));
efl_gfx_arrangement_content_align_set(efl_added, 0.5, 0.5));
efl_pack(flip, box2);
// Note: No TEXT object with EO APIs
@ -472,7 +472,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1.0, 0.0),
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE),
efl_pack_align_set(efl_added, 0.5, 0.5));
efl_gfx_arrangement_content_align_set(efl_added, 0.5, 0.5));
efl_pack(flip, box2);
const struct { const char *name, *code; } programs [] = {

View File

@ -76,7 +76,7 @@ padding_slider_cb(void *data, const Efl_Event *event)
Eo *win = data, *box;
box = efl_key_wref_get(win, "box");
efl_pack_padding_set(box, val, val, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(box, val, val, EINA_TRUE);
}
static void
@ -97,8 +97,8 @@ alignh_slider_cb(void *data, const Efl_Event *event)
box = efl_key_wref_get(win, "box");
val = elm_slider_value_get(event->object);
efl_pack_align_get(box, NULL, &av);
efl_pack_align_set(box, val, av);
efl_gfx_arrangement_content_align_get(box, NULL, &av);
efl_gfx_arrangement_content_align_set(box, val, av);
}
static void
@ -109,8 +109,8 @@ alignv_slider_cb(void *data, const Efl_Event *event)
box = efl_key_wref_get(win, "box");
val = elm_slider_value_get(event->object);
efl_pack_align_get(box, &ah, NULL);
efl_pack_align_set(box, ah, val);
efl_gfx_arrangement_content_align_get(box, &ah, NULL);
efl_gfx_arrangement_content_align_set(box, ah, val);
}
static void
@ -240,7 +240,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
elm_win_resize_object_add(win, vbox);
@ -256,7 +256,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
efl_content_set(f, hbox);
efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE);
/* weights radio group */
@ -533,7 +533,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
efl_key_wref_set(win, "box", bx);
efl_pack_padding_set(bx, 10, 10, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(bx, 10, 10, EINA_TRUE);
efl_gfx_hint_align_set(bx, 0.5, 0.5);
efl_gfx_hint_weight_set(bx, 1, 1);
efl_content_set(f, bx);

View File

@ -443,12 +443,12 @@ static void pack_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL,
efl_added, NULL));
in_box1 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1,
@ -458,7 +458,7 @@ static void pack_cb(void *data,
efl_ui_pager_current_page_get(pager)));
in_box2 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2);
@ -628,7 +628,7 @@ static void current_page_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current Page", btn, NULL,
efl_added, NULL));
@ -674,7 +674,7 @@ static void indicator_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Indicator", btn, NULL,
efl_added, NULL));

View File

@ -495,7 +495,7 @@ static void padding_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Padding Size", btn, NULL,
efl_added, NULL));
@ -522,7 +522,7 @@ static void side_page_num_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Side Page Num", btn, NULL,
efl_added, NULL));
@ -555,12 +555,12 @@ static void pack_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL,
efl_added, NULL));
in_box1 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1,
@ -570,7 +570,7 @@ static void pack_cb(void *data,
efl_ui_pager_current_page_get(pager)));
in_box2 = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2);
@ -739,7 +739,7 @@ static void current_page_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current Page", btn, NULL,
efl_added, NULL));
@ -787,7 +787,7 @@ static void scroll_block_cb(void *data,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Scroll Block", btn, NULL,
efl_added, NULL));
@ -826,7 +826,7 @@ static void loop_cb(void *data EINA_UNUSED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Loop", btn, NULL,
efl_added, NULL));
@ -875,7 +875,7 @@ static void indicator_cb(void *data EINA_UNUSED,
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Indicator", btn, NULL,
efl_added, NULL));

View File

@ -15,6 +15,21 @@ typedef enum {
BOTTOM
} Options;
static void
_btn_color_clicked_cb(void *data, const Efl_Event *event EINA_UNUSED)
{
Eo *layout = data;
static Eina_Bool changed = EINA_TRUE;
if (changed)
efl_gfx_color_set(layout, 0, 88, 204, 255);
else
efl_gfx_color_set(layout, 255, 255, 255, 255);
changed = !changed;
}
static void
_btn_clicked_to_cb(void *data, const Efl_Event *event)
{
@ -59,7 +74,6 @@ _btn_clicked_to_cb(void *data, const Efl_Event *event)
break;
}
efl_text_set(obj, ((to == layout) ? "parent" : (char *)efl_text_get(to)));
efl_pack_layout_request(layout);
}
static void
@ -87,7 +101,6 @@ _slider_changed_relative_cb(void *data, const Efl_Event *event)
efl_ui_relative_layout_relation_bottom_set(layout, btn, NULL, val);
break;
}
efl_pack_layout_request(layout);
}
static void
@ -105,8 +118,6 @@ _slider_changed_align_cb(void *data, const Efl_Event *event)
efl_gfx_hint_align_set(btn, val, y);
else if (opt == 'y')
efl_gfx_hint_align_set(btn, x, val);
efl_pack_layout_request(layout);
}
static void
@ -139,7 +150,7 @@ _setter_add(Eo *vbox, Eo *btn, Options option)
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_UI_TEXT_CLASS, hbox,
@ -181,13 +192,13 @@ _button_frame_add(Eo *box, Eo *btn)
vbox = efl_add(EFL_UI_BOX_CLASS, f,
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_gfx_hint_margin_set(efl_added, 2, 2, 2, 2),
efl_content_set(f, efl_added));
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_CANVAS_RECTANGLE_CLASS, hbox,
@ -220,7 +231,7 @@ _button_frame_add(Eo *box, Eo *btn)
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_UI_TEXT_CLASS, hbox,
@ -240,7 +251,7 @@ _button_frame_add(Eo *box, Eo *btn)
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_UI_TEXT_CLASS, hbox,
@ -271,7 +282,7 @@ test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5),
efl_content_set(win, efl_added));
@ -283,7 +294,7 @@ test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
hbox = efl_add(EFL_UI_BOX_CLASS, f,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_padding_set(efl_added, 10, 0, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 0, EINA_TRUE),
efl_content_set(f, efl_added));
/* contents */
@ -297,6 +308,7 @@ test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout,
efl_text_set(efl_added, "button1"),
efl_gfx_hint_align_set(efl_added, 0.0, 0.0),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_color_clicked_cb, layout),
efl_ui_relative_layout_relation_right_set(layout, efl_added, layout, 0.0),
efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0));

View File

@ -232,7 +232,7 @@ _current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current", btn, NULL, efl_added, NULL));
sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box,
@ -337,7 +337,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL));
/* Pack Begin */
@ -365,7 +365,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
efl_pack_end(box, efl_added));
in_box = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_end(box, efl_added));
@ -441,7 +441,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Unpack", btn, NULL, efl_added, NULL));
/* Clear */
@ -465,7 +465,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
efl_pack_end(box, efl_added));
in_box = efl_add(EFL_UI_BOX_CLASS, box,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_end(box, efl_added));
@ -536,7 +536,7 @@ _tab_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Tab", btn, NULL, efl_added, NULL));
label_check = efl_add(EFL_UI_CHECK_CLASS, box,
@ -589,7 +589,7 @@ _transition_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Transition", btn, NULL, efl_added, NULL));
btn = efl_add(EFL_UI_BUTTON_CLASS, box,

View File

@ -79,7 +79,7 @@ static void
padding_slider_cb(void *data, const Efl_Event *event)
{
int val = elm_slider_value_get(event->object);
efl_pack_padding_set(data, val, val, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(data, val, val, EINA_TRUE);
}
static void
@ -199,7 +199,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_hint_weight_set(vbox, 1, 1);
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
elm_win_resize_object_add(win, vbox);
@ -220,7 +220,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
elm_object_content_set(f, hbox);
efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE);
/* weights radio group */
@ -568,7 +568,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
elm_win_resize_object_add(win, vbox);
efl_gfx_entity_visible_set(vbox, 1);
@ -589,7 +589,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
elm_object_content_set(f, hbox);
efl_pack_padding_set(hbox, 5, 0, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(hbox, 5, 0, EINA_TRUE);
efl_gfx_entity_visible_set(hbox, 1);
ico = elm_icon_add(win);

View File

@ -56,10 +56,10 @@ elm_main(int argc, char **argv)
// TEST#1 : Create Grid
gd->grid = grid = EoGenerate(EFL_UI_GRID_CLASS, box, (horiz ? EFL_UI_DIR_HORIZONTAL : EFL_UI_DIR_VERTICAL));
efl_ui_grid_item_size_set(grid, EINA_SIZE2D(100, 120)); // 4X4
efl_pack_padding_set(grid, 5.0, 5.0, EINA_TRUE);
efl_pack_align_set(grid, 0.5, 0.5);
efl_gfx_arrangement_content_padding_set(grid, 5.0, 5.0, EINA_TRUE);
efl_gfx_arrangement_content_align_set(grid, 0.5, 0.5);
efl_pack_end(box, grid);
// TEST#2 : Set Item Default Size
Efl_Ui_Grid_Item *target = NULL;

View File

@ -121,6 +121,35 @@ examples = [
foreach example : examples
executable(example, example + '.c', dependencies: [elementary, ecore, eio])
endforeach
if get_option('bindings').contains('cxx')
cxx_examples = [
'bg_cxx_example_01',
'bg_cxx_example_02',
'box_cxx_example_02',
'button_cxx_example_00',
'button_cxx_example_01',
'calendar_cxx_example_01',
'calendar_cxx_example_02',
'calendar_cxx_example_03',
'calendar_cxx_example_04',
'calendar_cxx_example_05',
'clock_cxx_example',
'icon_cxx_example_01',
'menu_cxx_example_01',
'popup_cxx_example',
'radio_cxx_example_01',
'slider_cxx_example',
'spinner_cxx_example',
'table_cxx_example_01',
'table_cxx_example_02',
'toolbar_cxx_example_01',
]
foreach example : cxx_examples
executable(example, example + '.cc', dependencies: [elementary_cxx])
endforeach
endif
edc_files = [
'codegen_example.edc',

View File

@ -15,7 +15,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
efl::ui::Table table(instantiate, win);
win.content_set(table);
table.pack_padding_set(5, 5, true);
table.content_padding_set(5, 5, true);
// FIXME
// table.homogeneous_set(true);

View File

@ -16,7 +16,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
efl::ui::Table table(instantiate, win);
win.content_set(table);
table.pack_padding_set(5, 5, true);
table.content_padding_set(5, 5, true);
efl::canvas::Rectangle rect(instantiate, win);
rect.color_set(255, 0, 0, 255);

View File

@ -32,9 +32,13 @@ static Eina_Iterator *
_efl_boolean_model_efl_model_properties_get(const Eo *obj,
Efl_Boolean_Model_Data *pd)
{
Eina_Iterator *properties = NULL;
if (pd->parent)
properties = eina_hash_iterator_key_new(pd->parent->values);
EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(props,
obj, EFL_BOOLEAN_MODEL_CLASS,
eina_hash_iterator_key_new(pd->parent->values));
properties);
return props;
}

View File

@ -45,21 +45,18 @@ _children_indexed_key(const Efl_Composite_Model_Data *node,
return node->index - *key;
}
static void
_efl_composite_model_efl_object_destructor(Eo *obj, Efl_Composite_Model_Data *pd)
static Efl_Model *
_efl_composite_lookup(const Efl_Class *self, Eo *parent, Efl_Model *view, unsigned int index)
{
if (pd->source)
{
efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILD_ADDED, obj);
efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILD_REMOVED, obj);
efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, obj);
efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_PROPERTIES_CHANGED, obj);
EFL_COMPOSITE_LOOKUP_RETURN(remember, parent, view, "_efl.composite_model");
efl_unref(pd->source);
pd->source = NULL;
}
remember = efl_add_ref(self, parent,
efl_ui_view_model_set(efl_added, view),
efl_composite_model_index_set(efl_added, index),
efl_loop_model_volatile_make(efl_added));
if (!remember) return NULL;
efl_destructor(efl_super(obj, EFL_COMPOSITE_MODEL_CLASS));
EFL_COMPOSITE_REMEMBER_RETURN(remember, view);
}
static void
@ -155,6 +152,44 @@ _efl_composite_model_index_get(const Eo *obj, Efl_Composite_Model_Data *pd)
return r;
}
static void
_efl_composite_model_child_added(void *data, const Efl_Event *event)
{
Efl_Composite_Model_Data *pd = data;
Efl_Model_Children_Event *ev = event->info;
Efl_Model_Children_Event cev = { 0 };
cev.index = ev->index;
if (ev->child)
cev.child = _efl_composite_lookup(efl_class_get(pd->self),
pd->self, ev->child, ev->index);
efl_event_callback_call(pd->self, EFL_MODEL_EVENT_CHILD_ADDED, &cev);
efl_unref(cev.child);
}
static void
_efl_composite_model_child_removed(void *data, const Efl_Event *event)
{
Efl_Composite_Model_Data *pd = data;
Efl_Model_Children_Event *ev = event->info;
Efl_Model_Children_Event cev = { 0 };
cev.index = ev->index;
if (ev->child)
cev.child = _efl_composite_lookup(efl_class_get(pd->self),
pd->self, ev->child, ev->index);
efl_event_callback_call(pd->self, EFL_MODEL_EVENT_CHILD_REMOVED, &cev);
efl_unref(cev.child);
}
EFL_CALLBACKS_ARRAY_DEFINE(composite_callbacks,
{ EFL_MODEL_EVENT_CHILD_ADDED, _efl_composite_model_child_added },
{ EFL_MODEL_EVENT_CHILD_REMOVED, _efl_composite_model_child_removed });
static void
_efl_composite_model_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd, Efl_Model *model)
{
@ -168,8 +203,7 @@ _efl_composite_model_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Composite_Mo
}
pd->source = efl_ref(model);
efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILD_ADDED, EFL_CALLBACK_PRIORITY_BEFORE, obj);
efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILD_REMOVED, EFL_CALLBACK_PRIORITY_BEFORE, obj);
efl_event_callback_array_add(model, composite_callbacks(), pd);
efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, obj);
efl_event_callback_forwarder_priority_add(model, EFL_MODEL_EVENT_PROPERTIES_CHANGED, EFL_CALLBACK_PRIORITY_BEFORE, obj);
@ -266,13 +300,8 @@ _efl_composite_model_then(Eo *o EINA_UNUSED, void *data, const Eina_Value v)
{
Eo *composite;
// First set the Model to be used as a source so that we the newly object
// can know if it needs to retain the information regarding its index.
composite = efl_add_ref(req->self, req->parent,
efl_ui_view_model_set(efl_added, target),
efl_composite_model_index_set(efl_added, req->start + i),
efl_loop_model_volatile_make(efl_added));
// Fetch an existing composite model for this model or create a new one if none exist
composite = _efl_composite_lookup(req->self, req->parent, target, req->start + i);
eina_value_array_append(&r, composite);
// Dropping this scope reference
efl_unref(composite);
@ -392,4 +421,20 @@ _efl_composite_model_efl_model_child_del(Eo *obj EINA_UNUSED,
efl_model_child_del(pd->source, child);
}
static void
_efl_composite_model_efl_object_destructor(Eo *obj, Efl_Composite_Model_Data *pd)
{
if (pd->source)
{
efl_event_callback_array_del(pd->source, composite_callbacks(), pd);
efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, obj);
efl_event_callback_forwarder_del(pd->source, EFL_MODEL_EVENT_PROPERTIES_CHANGED, obj);
efl_unref(pd->source);
pd->source = NULL;
}
efl_destructor(efl_super(obj, EFL_COMPOSITE_MODEL_CLASS));
}
#include "efl_composite_model.eo.c"

View File

@ -40,4 +40,20 @@ _efl_composite_model_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Ei
};
}
#define EFL_COMPOSITE_LOOKUP_RETURN(Remember, Parent, View, Base) \
Efl_Model *Remember; \
char buf[1024]; \
\
snprintf(buf, sizeof (buf), Base"-%p", Parent); \
Remember = efl_key_wref_get(View, buf); \
if (Remember) \
{ \
efl_ref(Remember); \
return Remember; \
}
#define EFL_COMPOSITE_REMEMBER_RETURN(Remember, View) \
efl_key_wref_set(View, buf, Remember); \
return Remember;
#endif

View File

@ -97,6 +97,7 @@ _efl_loop_model_efl_model_property_ready_get(Eo *obj, void *pd EINA_UNUSED, cons
efl_event_callback_add(obj,
EFL_MODEL_EVENT_PROPERTIES_CHANGED,
_propagate_future, wd);
return efl_future_then(obj, eina_future_new(wd->p));
}
return eina_future_rejected(efl_loop_future_scheduler_get(obj), err);

View File

@ -350,19 +350,14 @@ _efl_view_model_parent_data(Efl_View_Model *child, Efl_View_Model_Data *ppd)
static Efl_View_Model *
_efl_view_model_child_lookup(Efl_View_Model_Data *pd, Efl_Object *parent, Efl_Model *view)
{
Efl_View_Model *co;
co = efl_key_wref_get(view, "_efl.view_model");
if (co) return co;
EFL_COMPOSITE_LOOKUP_RETURN(co, parent, view, "_efl.view_model");
co = efl_add(EFL_VIEW_MODEL_CLASS, parent,
efl_ui_view_model_set(efl_added, view),
_efl_view_model_parent_data(efl_added, pd));
if (!co) return NULL;
efl_key_wref_set(view, "_efl.view_model", co);
return co;
EFL_COMPOSITE_REMEMBER_RETURN(co, view);
}
static void

View File

@ -133,6 +133,22 @@ typedef enum _Ecore_Evas_Engine_Type
ECORE_EVAS_ENGINE_OPENGL_DRM
} Ecore_Evas_Engine_Type;
#define ECORE_EVAS_OPT_NONE 0
#define ECORE_EVAS_OPT_INDIRECT 1
#define ECORE_EVAS_OPT_VSYNC 2
#define ECORE_EVAS_OPT_SWAP_MODE 3
#define ECORE_EVAS_OPT_GL_DEPTH 4
#define ECORE_EVAS_OPT_GL_STENCIL 5
#define ECORE_EVAS_OPT_GL_MSAA 6
#define ECORE_EVAS_OPT_LAST 7
#define ECORE_EVAS_SWAP_MODE_AUTO 0
#define ECORE_EVAS_SWAP_MODE_FULL 1
#define ECORE_EVAS_SWAP_MODE_COPY 2
#define ECORE_EVAS_SWAP_MODE_DOUBLE 3
#define ECORE_EVAS_SWAP_MODE_TRIPLE 4
/**
* @enum _Ecore_Evas_Avoid_Damage_Type
* This option causes updates of the Ecore_Evas to be done on a pixmap, and
@ -1310,20 +1326,20 @@ EAPI Ecore_Evas *ecore_evas_software_x11_pixmap_new(const char *disp_name, E
*/
EAPI Ecore_X_Pixmap ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee);
#define ECORE_EVAS_GL_X11_OPT_NONE 0
#define ECORE_EVAS_GL_X11_OPT_INDIRECT 1
#define ECORE_EVAS_GL_X11_OPT_VSYNC 2
#define ECORE_EVAS_GL_X11_OPT_SWAP_MODE 3
#define ECORE_EVAS_GL_X11_OPT_GL_DEPTH 4
#define ECORE_EVAS_GL_X11_OPT_GL_STENCIL 5
#define ECORE_EVAS_GL_X11_OPT_GL_MSAA 6
#define ECORE_EVAS_GL_X11_OPT_LAST 7
#define ECORE_EVAS_GL_X11_OPT_NONE ECORE_EVAS_OPT_NONE
#define ECORE_EVAS_GL_X11_OPT_INDIRECT ECORE_EVAS_OPT_INDIRECT
#define ECORE_EVAS_GL_X11_OPT_VSYNC ECORE_EVAS_OPT_VSYNC
#define ECORE_EVAS_GL_X11_OPT_SWAP_MODE ECORE_EVAS_OPT_SWAP_MODE
#define ECORE_EVAS_GL_X11_OPT_GL_DEPTH ECORE_EVAS_OPT_GL_DEPTH
#define ECORE_EVAS_GL_X11_OPT_GL_STENCIL ECORE_EVAS_OPT_GL_STENCIL
#define ECORE_EVAS_GL_X11_OPT_GL_MSAA ECORE_EVAS_OPT_GL_MSAA
#define ECORE_EVAS_GL_X11_OPT_LAST ECORE_EVAS_OPT_LAST
#define ECORE_EVAS_GL_X11_SWAP_MODE_AUTO 0
#define ECORE_EVAS_GL_X11_SWAP_MODE_FULL 1
#define ECORE_EVAS_GL_X11_SWAP_MODE_COPY 2
#define ECORE_EVAS_GL_X11_SWAP_MODE_DOUBLE 3
#define ECORE_EVAS_GL_X11_SWAP_MODE_TRIPLE 4
#define ECORE_EVAS_GL_X11_SWAP_MODE_AUTO ECORE_EVAS_SWAP_MODE_AUTO
#define ECORE_EVAS_GL_X11_SWAP_MODE_FULL ECORE_EVAS_SWAP_MODE_FULL
#define ECORE_EVAS_GL_X11_SWAP_MODE_COPY ECORE_EVAS_SWAP_MODE_COPY
#define ECORE_EVAS_GL_X11_SWAP_MODE_DOUBLE ECORE_EVAS_SWAP_MODE_DOUBLE
#define ECORE_EVAS_GL_X11_SWAP_MODE_TRIPLE ECORE_EVAS_SWAP_MODE_TRIPLE
/**
* @brief Creates Ecore_Evas using opengl x11.

View File

@ -4462,7 +4462,7 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent,
int x, int y, int w, int h, Eina_Bool frame)
{
Ecore_Evas *ee;
Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool);
Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool, const int*);
Eina_Module *m = _ecore_evas_engine_load("wayland");
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
@ -4471,7 +4471,7 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent,
if (parent) ERR("Wayland windows with parents not supported through legacy API");
ee = new(disp_name, 0, x, y, w, h, frame);
ee = new(disp_name, 0, x, y, w, h, frame, NULL);
if (!_ecore_evas_cursors_init(ee))
{
ecore_evas_free(ee);
@ -4503,17 +4503,17 @@ _wayland_shm_new(const char *disp_name, Ecore_Window parent,
Ecore_Evas *
_wayland_egl_new(const char *disp_name, Ecore_Window parent,
int x, int y, int w, int h, Eina_Bool frame)
int x, int y, int w, int h, Eina_Bool frame, const int *opt)
{
Ecore_Evas *ee;
Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool);
Ecore_Evas *(*new)(const char *, Ecore_Window, int, int, int, int, Eina_Bool, const int *);
Eina_Module *m = _ecore_evas_engine_load("wayland");
EINA_SAFETY_ON_NULL_RETURN_VAL(m, NULL);
new = eina_module_symbol_get(m, "ecore_evas_wayland_egl_new_internal");
EINA_SAFETY_ON_NULL_RETURN_VAL(new, NULL);
ee = new(disp_name, parent, x, y, w, h, frame);
ee = new(disp_name, parent, x, y, w, h, frame, opt);
if (!_ecore_evas_cursors_init(ee))
{
ecore_evas_free(ee);

View File

@ -499,7 +499,7 @@ EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window);
#ifdef IPA_YLNO_ESU_LANRETNI_MLE
EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt);
#else
#define _wayland_shm_new DONT_USE_INTERNAL_API
#define _wayland_egl_new DONT_USE_INTERNAL_API

View File

@ -3800,7 +3800,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param1.description->rel1.id_x];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}
@ -3809,7 +3809,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param1.description->rel2.id_x];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}
@ -3822,7 +3822,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param2->description->rel1.id_x];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}
@ -3831,7 +3831,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param2->description->rel2.id_x];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}
@ -3846,7 +3846,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param1.description->rel1.id_y];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}
@ -3855,7 +3855,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param1.description->rel2.id_y];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}
@ -3867,7 +3867,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param2->description->rel1.id_y];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}
@ -3876,7 +3876,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein
rp = ed->table_parts[cep->param2->description->rel2.id_y];
if (_circular_dependency_find(ed, ep, rp, arr))
{
eina_array_push(arr, eina_stringshare_ref(rp->part->name));
eina_array_push(arr, eina_stringshare_add(rp->part->name));
return EINA_TRUE;
}
}

View File

@ -166,6 +166,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_pack_layout.eo.h"
#include "interfaces/efl_pack_linear.eo.h"
#include "interfaces/efl_pack_table.eo.h"
#include "interfaces/efl_gfx_arrangement.eo.h"
/* Input and Output */
#include "interfaces/efl_io_closer.eo.h"

View File

@ -1,8 +1,8 @@
interface Efl.Container
{
[[Common interface for objects that have multiple contents (sub objects).
[[Common interface for objects (containers) that can have multiple contents (sub-objects).
APIs in this interface deal with containers of multiple sub objects, not
APIs in this interface deal with containers of multiple sub-objects, not
with individual parts.
@since 1.22
@ -12,15 +12,15 @@ interface Efl.Container
methods {
content_iterate {
[[Begin iterating over this object's contents.]]
return: iterator<Efl.Gfx.Entity> @owned @warn_unused; [[Iterator to object content]]
return: iterator<Efl.Gfx.Entity> @owned @warn_unused; [[Iterator on object's content.]]
}
content_count {
[[Returns the number of UI elements packed in this container.]]
return: int; [[Number of packed UI elements]]
[[Returns the number of contained sub-objects.]]
return: int; [[Number of sub-objects.]]
}
}
events {
content,added: Efl.Gfx.Entity; [[Sent after a new item was added.]]
content,removed: Efl.Gfx.Entity; [[Sent after an item was removed, before unref.]]
content,added: Efl.Gfx.Entity; [[Sent after a new sub-object was added.]]
content,removed: Efl.Gfx.Entity; [[Sent after a sub-object was removed, before unref.]]
}
}

View File

@ -0,0 +1,26 @@
interface @beta Efl.Gfx.Arrangement
{
[[API common to all UI container objects.]]
methods
{
@property content_align {
[[Alignment of the container within its bounds]]
set {}
get {}
values {
align_horiz: double; [[Horizontal alignment]]
align_vert: double; [[Vertical alignment]]
}
}
@property content_padding {
[[Padding between items contained in this object.]]
set {}
get {}
values {
pad_horiz: double; [[Horizontal padding]]
pad_vert: double; [[Vertical padding]]
scalable: bool; [[$true if scalable, $false otherwise]]
}
}
}
}

View File

@ -56,7 +56,7 @@
#include "interfaces/efl_pack_layout.eo.c"
#include "interfaces/efl_pack_linear.eo.c"
#include "interfaces/efl_pack_table.eo.c"
#include "interfaces/efl_gfx_arrangement.eo.c"
#include "interfaces/efl_model.eo.c"
#include "interfaces/efl_interpolator.eo.c"
#include "interfaces/efl_orientation.eo.c"

View File

@ -1,28 +1,30 @@
interface @beta Efl.Pack extends Efl.Container
{
[[API common to all UI container objects.]]
[[Common interface for objects (containers) with multiple contents
(sub-objects) which can be added and removed at runtime.
]]
methods
{
pack_clear {
[[Removes all packed contents, and unreferences them.]]
return: bool; [[$true on success, $false otherwise]]
[[Removes all packed sub-objects and unreferences them.]]
return: bool; [[$true on success, $false otherwise.]]
}
unpack_all {
[[Removes all packed contents, without unreferencing them.
[[Removes all packed sub-objects without unreferencing them.
Use with caution.
]]
return: bool; [[$true on success, $false otherwise]]
return: bool; [[$true on success, $false otherwise.]]
}
unpack {
[[Removes an existing item from the container, without deleting it.]]
[[Removes an existing sub-object from the container without deleting it.]]
params {
subobj: Efl.Gfx.Entity; [[The unpacked object.]]
subobj: Efl.Gfx.Entity; [[The sub-object to unpack.]]
}
return: bool; [[$false if $subobj wasn't a child or can't be removed]]
return: bool; [[$false if $subobj wasn't in the container or couldn't be removed.]]
}
pack {
[[Adds an item to this container.
[[Adds a sub-object to this container.
Depending on the container this will either fill in the default
spot, replacing any already existing element or append to the end
@ -33,28 +35,9 @@ interface @beta Efl.Pack extends Efl.Container
without deleting it.
]]
params {
subobj: Efl.Gfx.Entity; [[An object to pack.]]
subobj: Efl.Gfx.Entity; [[The object to pack.]]
}
return: bool; [[$false if $subobj could not be packed.]]
}
@property pack_align {
[[Alignment of the container within its bounds]]
set {}
get {}
values {
align_horiz: double; [[Horizontal alignment]]
align_vert: double; [[Vertical alignment]]
}
}
@property pack_padding {
[[Padding between items contained in this object.]]
set {}
get {}
values {
pad_horiz: double; [[Horizontal padding]]
pad_vert: double; [[Vertical padding]]
scalable: bool; [[$true if scalable, $false otherwise]]
}
}
}
}

View File

@ -1,6 +1,10 @@
interface @beta Efl.Pack_Linear extends Efl.Pack
{
[[API for containers ]]
[[Common interface for objects (containers) with multiple contents
(sub-objects) which can be added and removed at runtime in a linear fashion.
This means the sub-objects are internally organized in an ordered list.
]]
eo_prefix: efl_pack;
methods {
pack_begin {
@ -13,12 +17,12 @@ interface @beta Efl.Pack_Linear extends Efl.Pack
container without deleting it.
]]
params {
@in subobj: Efl.Gfx.Entity; [[Item to pack at the beginning.]]
@in subobj: Efl.Gfx.Entity; [[Object to pack at the beginning.]]
}
return: bool; [[$false if $subobj could not be packed.]]
}
pack_end {
[[Append item at the end of this container.
[[Append object at the end of this container.
This is the same as @.pack_at($subobj, -1).
@ -27,45 +31,46 @@ interface @beta Efl.Pack_Linear extends Efl.Pack
container without deleting it.
]]
params {
@in subobj: Efl.Gfx.Entity; [[Item to pack at the end.]]
@in subobj: Efl.Gfx.Entity; [[Object to pack at the end.]]
}
return: bool; [[$false if $subobj could not be packed.]]
}
pack_before {
[[Prepend item before other sub object.
[[Prepend an object before an existing sub-object.
When this container is deleted, it will request deletion of the
given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
container without deleting it.
]]
params {
@in subobj: Efl.Gfx.Entity; [[Item to pack before $existing.]]
@in existing: const(Efl.Gfx.Entity); [[Item to refer to.]]
@in subobj: Efl.Gfx.Entity; [[Object to pack before $existing.]]
@in existing: const(Efl.Gfx.Entity); [[Existing reference sub-object.]]
}
return: bool; [[$false if $existing could not be found or $subobj
could not be packed.]]
}
pack_after {
[[Append item after other sub object.
[[Append an object after an existing sub-object.
When this container is deleted, it will request deletion of the
given $subobj. Use @Efl.Pack.unpack to remove $subobj from this
container without deleting it.
]]
params {
@in subobj: Efl.Gfx.Entity; [[Item to pack after $existing.]]
@in existing: const(Efl.Gfx.Entity); [[Item to refer to.]]
@in subobj: Efl.Gfx.Entity; [[Object to pack after $existing.]]
@in existing: const(Efl.Gfx.Entity); [[Existing reference sub-object.]]
}
return: bool; [[$false if $existing could not be found or $subobj
could not be packed.]]
}
pack_at {
[[Inserts $subobj BEFORE the item at position $index.
[[Inserts $subobj BEFORE the sub-object at position $index.
$index ranges from -$count to $count-1, where positive numbers go
from first item (0) to last item ($count-1), and negative numbers go
from last item (-1) to first item (-$count). Where $count is
the number of items currently in the container.
from first sub-object (0) to last ($count-1), and negative numbers go
from last sub-object (-1) to first (-$count). $count is
the number of sub-objects currently in the container as returned by
@Efl.Container.content_count.
If $index is less than -$count, it will trigger @.pack_begin($subobj)
whereas $index greater than $count-1 will trigger @.pack_end($subobj).
@ -75,59 +80,59 @@ interface @beta Efl.Pack_Linear extends Efl.Pack
container without deleting it.
]]
params {
@in subobj: Efl.Gfx.Entity; [[Item to pack.]]
@in index: int; [[Index of item to insert BEFORE.
@in subobj: Efl.Gfx.Entity; [[Object to pack.]]
@in index: int; [[Index of existing sub-object to insert BEFORE.
Valid range is -$count to ($count-1).
]]
}
return: bool; [[$false if $subobj could not be packed.]]
}
pack_content_get {
[[Content at a given $index in this container.
[[Sub-object at a given $index in this container.
$index ranges from -$count to $count-1, where positive numbers go
from first item (0) to last item ($count-1), and negative numbers go
from last item (-1) to first item (-$count). Where $count is
the number of items currently in the container.
from first sub-object (0) to last ($count-1), and negative numbers go
from last sub-object (-1) to first (-$count). $count is
the number of sub-objects currently in the container as returned by
@Efl.Container.content_count.
If $index is less than -$count, it will return the first item
whereas $index greater than $count-1 will return the last item.
If $index is less than -$count, it will return the first sub-object
whereas $index greater than $count-1 will return the last sub-object.
]]
params {
@in index: int; [[Index of the item to retrieve.
@in index: int; [[Index of the existing sub-object to retrieve.
Valid range is -$count to ($count-1).
]]
}
return: Efl.Gfx.Entity; [[The object contained at the given $index.]]
return: Efl.Gfx.Entity; [[The sub-object contained at the given $index.]]
}
pack_index_get {
[[Get the index of a child in this container.]]
[[Get the index of a sub-object in this container.]]
params {
@in subobj: const(Efl.Gfx.Entity); [[An object contained in this pack.]]
@in subobj: const(Efl.Gfx.Entity); [[An existing sub-object in this container.]]
}
return: int(-1); [[-1 in case $subobj is not a child of this object,
or the index of this item in the range 0 to ($count-1).
return: int(-1); [[-1 in case $subobj is not found,
or the index of $subobj in the range 0 to ($count-1).
]]
}
pack_unpack_at {
[[Pop out (remove) the item at the specified $index.
[[Pop out (remove) the sub-object at the specified $index.
$index ranges from -$count to $count-1, where positive numbers go
from first item (0) to last item ($count-1), and negative numbers go
from last item (-1) to first item (-$count). Where $count is
the number of items currently in the container.
from first sub-object (0) to last ($count-1), and negative numbers go
from last sub-object (-1) to first (-$count). $count is
the number of sub-objects currently in the container as returned by
@Efl.Container.content_count.
If $index is less than -$count, it will remove the first item
whereas $index greater than $count-1 will remove the last item.
Equivalent to @Efl.Pack.unpack(@.pack_content_get($index)).
If $index is less than -$count, it will remove the first sub-object
whereas $index greater than $count-1 will remove the last sub-object.
]]
params {
@in index: int; [[Index of item to remove.
@in index: int; [[Index of the sub-object to remove.
Valid range is -$count to ($count-1).
]]
}
return: Efl.Gfx.Entity; [[The child item if it could be removed.]]
return: Efl.Gfx.Entity; [[The sub-object if it could be removed.]]
}
}
}

View File

@ -72,6 +72,7 @@ pub_eo_files = [
'efl_pack_layout.eo',
'efl_pack_linear.eo',
'efl_pack_table.eo',
'efl_gfx_arrangement.eo',
'efl_ui_i18n.eo',
'efl_ui_direction.eo',
'efl_ui_direction_readonly.eo',

View File

@ -58,6 +58,7 @@ static Eina_Hash *_eina_value_inner_mps = NULL;
static Eina_Lock _eina_value_inner_mps_lock;
static char *_eina_value_mp_choice = NULL;
static int _eina_value_log_dom = -1;
static const Eina_Value _eina_value_empty = EINA_VALUE_EMPTY;
#ifdef ERR
#undef ERR
@ -3954,6 +3955,7 @@ _eina_value_type_value_vset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
{
Eina_Value *dst = mem;
Eina_Value src = va_arg(args, Eina_Value);
return eina_value_copy(&src, dst);
}
@ -3962,6 +3964,7 @@ _eina_value_type_value_pset(const Eina_Value_Type *type EINA_UNUSED, void *mem,
{
Eina_Value *dst = mem;
const Eina_Value *src = ptr;
return eina_value_copy(src, dst);
}
@ -5591,9 +5594,7 @@ eina_value_new(const Eina_Value_Type *type)
if (!value) return NULL;
if (!type)
{
const Eina_Value empty = EINA_VALUE_EMPTY;
memcpy(value, &empty, sizeof (empty));
memcpy(value, &_eina_value_empty, sizeof (_eina_value_empty));
return value;
}
if (!eina_value_setup(value, type))
@ -5622,6 +5623,13 @@ eina_value_copy(const Eina_Value *value, Eina_Value *copy)
Eina_Bool ret;
EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE);
if (!memcmp(value, &_eina_value_empty, sizeof (Eina_Value)))
{
memcpy(copy, &_eina_value_empty, sizeof (Eina_Value));
return EINA_TRUE;
}
EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_value_type_check(value->type),
EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(copy, EINA_FALSE);

View File

@ -218,37 +218,9 @@ _fetch_user_homedir(char **str, const char *name, const char *error)
#endif
}
EAPI char *
eina_vpath_resolve(const char* path)
static int
_eina_vpath_resolve(const char *path, char *str, size_t size)
{
char buf[PATH_MAX];
if (eina_vpath_resolve_snprintf(buf, sizeof(buf), path) > 0)
return strdup(buf);
return NULL;
}
EAPI int
eina_vpath_resolve_snprintf(char *str, size_t size, const char *format, ...)
{
va_list args;
char *path;
// XXX: implement parse of path then look up in hash if not just create
// object where path and result are the same and return that with
// path set and result set to resolved path - return obj handler calls
// "do" on object to get the result inside fetched or failed callback.
// if it's a url then we need a new classs that overrides the do and
// begins a fetch and on finish calls the event cb or when wait is called
/* FIXME: not working for WIndows */
// /* <- full path
path = alloca(size + 1);
va_start(args, format);
vsnprintf(path, size, format, args);
va_end(args);
if (path[0] == '~')
{
char *home = NULL;
@ -261,7 +233,8 @@ eina_vpath_resolve_snprintf(char *str, size_t size, const char *format, ...)
// ~username/ <- homedir of user "username"
else
{
char *p, *name;
const char *p;
char *name;
for (p = path + 1; *p; p++)
{
@ -279,60 +252,98 @@ eina_vpath_resolve_snprintf(char *str, size_t size, const char *format, ...)
{
return snprintf(str, size, "%s%s", home, path);
}
}
// (:xxx:)/* ... <- meta hash table
else if ((path[0] == '(') && (path[1] == ':'))
{
const char *p, *end, *meta;
char *name;
int max_len = strlen(path);
Eina_Bool found = EINA_FALSE;
}
// (:xxx:)/* ... <- meta hash table
else if ((path[0] == '(') && (path[1] == ':'))
{
const char *p, *end, *meta;
char *name;
int max_len = strlen(path);
Eina_Bool found = EINA_FALSE;
for (p = path + 2; p <= path + max_len - 2; p++)
{
if ((p[0] ==':') && (p[1] == ')'))
{
end = p;
found = EINA_TRUE;
break;
}
}
p += 2;
for (p = path + 2; p <= path + max_len - 2; p++)
{
if ((p[0] ==':') && (p[1] == ')'))
{
end = p;
found = EINA_TRUE;
break;
}
}
p += 2;
if (!found)
{
ERR("(: Needs to have a matching ':)'\nThe string was: %s", path);
return 0;
}
if (!found)
{
ERR("(: Needs to have a matching ':)'\nThe string was: %s", path);
return 0;
}
if (*p != '/')
{
ERR("A / is expected after :)\nThe string was: %s", path);
return 0;
}
if (*p != '/')
{
ERR("A / is expected after :)\nThe string was: %s", path);
return 0;
}
if (found)
{
name = alloca(end - path);
strncpy(name, path + 2, end - path - 2);
name[end - path - 2] = 0;
meta = _eina_vpath_data_get(name);
if (meta)
{
return snprintf(str, size, "%s%s", meta, end + 2);
}
else
{
ERR("Meta key '%s' was not registered!\nThe string was: %s", name, path);
return 0;
}
}
}
if (found)
{
name = alloca(end - path);
strncpy(name, path + 2, end - path - 2);
name[end - path - 2] = 0;
meta = _eina_vpath_data_get(name);
if (meta)
{
return snprintf(str, size, "%s%s", meta, end + 2);
}
else
{
ERR("Meta key '%s' was not registered!\nThe string was: %s", name, path);
return 0;
}
}
}
//just return the path, since we assume that this is a normal path
else
{
return snprintf(str, size, "%s", path);
}
{
return snprintf(str, size, "%s", path);
}
str[0] = '\0';
return 0;
}
EAPI char *
eina_vpath_resolve(const char* path)
{
char buf[PATH_MAX];
if (_eina_vpath_resolve(path, buf, sizeof(buf)) > 0)
return strdup(buf);
return NULL;
}
EAPI int
eina_vpath_resolve_snprintf(char *str, size_t size, const char *format, ...)
{
va_list args;
char *path;
int r;
// XXX: implement parse of path then look up in hash if not just create
// object where path and result are the same and return that with
// path set and result set to resolved path - return obj handler calls
// "do" on object to get the result inside fetched or failed callback.
// if it's a url then we need a new classs that overrides the do and
// begins a fetch and on finish calls the event cb or when wait is called
/* FIXME: not working for WIndows */
// /* <- full path
path = alloca(size + 1);
va_start(args, format);
vsnprintf(path, size, format, args);
va_end(args);
r = _eina_vpath_resolve(path, str, size);
if (r > 0) return r;
ERR("The path has to start with either '~/' or '(:NAME:)/' or be a normal path \nThe string was: %s", path);

View File

@ -148,7 +148,7 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
if (spd->pager.obj)
{
efl_ui_direction_set(spd->idbox, EFL_UI_DIR_HORIZONTAL);
efl_pack_padding_set(spd->idbox, 15, 15, EINA_TRUE);
efl_gfx_arrangement_content_padding_set(spd->idbox, 15, 15, EINA_TRUE);
pd->v = eina_value_float_new(0.0);

View File

@ -180,6 +180,19 @@ _efl_ui_box_efl_object_constructor(Eo *obj, Efl_Ui_Box_Data *pd)
return obj;
}
EOLIAN static void
_efl_ui_box_efl_object_invalidate(Eo *obj, Efl_Ui_Box_Data *pd)
{
Eo *child;
efl_invalidate(efl_super(obj, MY_CLASS));
EINA_LIST_FREE(pd->children, child)
{
efl_event_callback_array_del(child, efl_ui_box_callbacks(), obj);
}
}
/* CLEAN API BELOW */
EOLIAN static int
@ -382,7 +395,7 @@ _efl_ui_box_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box
}
EOLIAN static void
_efl_ui_box_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v, Eina_Bool scalable)
_efl_ui_box_efl_gfx_arrangement_content_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v, Eina_Bool scalable)
{
scalable = !!scalable;
if (h < 0) h = 0;
@ -400,7 +413,7 @@ _efl_ui_box_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, do
}
EOLIAN static void
_efl_ui_box_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v, Eina_Bool *scalable)
_efl_ui_box_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v, Eina_Bool *scalable)
{
if (scalable) *scalable = pd->pad.scalable;
if (h) *h = pd->pad.h;
@ -408,7 +421,7 @@ _efl_ui_box_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data
}
EOLIAN static void
_efl_ui_box_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v)
_efl_ui_box_efl_gfx_arrangement_content_align_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v)
{
if (h < 0) h = -1;
else if (h > 1) h = 1;
@ -425,7 +438,7 @@ _efl_ui_box_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, doub
}
EOLIAN static void
_efl_ui_box_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v)
_efl_ui_box_efl_gfx_arrangement_content_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v)
{
if (h) *h = pd->align.h;
if (v) *v = pd->align.v;

View File

@ -1,5 +1,5 @@
class @beta Efl.Ui.Box extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pack_Layout,
Efl.Ui.Direction
Efl.Ui.Direction, Efl.Gfx.Arrangement
{
[[The box widget.
@ -8,8 +8,8 @@ class @beta Efl.Ui.Box extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pac
By default, the box will use an internal function to set the layout to
a single row, either vertical or horizontal. This layout is affected
by a number of parameters. The values given by @Efl.Pack.pack_padding.set
and @Efl.Pack.pack_align.set and the hints set to each object in the box.
by a number of parameters. The values given by @Efl.Gfx.Arrangement.content_padding.set
and @Efl.Gfx.Arrangement.content_align.set and the hints set to each object in the box.
FIXME:
THIS CLASS NEEDS GOOD UP TO DATE DOCUMENTATION. LEGACY BOX AND UI BOX
@ -29,6 +29,7 @@ class @beta Efl.Ui.Box extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pac
}
implements {
Efl.Object.constructor;
Efl.Object.invalidate;
Efl.Canvas.Group.group_calculate;
Efl.Gfx.Entity.position { set; }
Efl.Gfx.Entity.size { set; }
@ -39,8 +40,8 @@ class @beta Efl.Ui.Box extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pac
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
Efl.Pack.pack_padding { get; set; }
Efl.Pack.pack_align { get; set; }
Efl.Gfx.Arrangement.content_padding { get; set; }
Efl.Gfx.Arrangement.content_align { get; set; }
Efl.Pack_Linear.pack_begin;
Efl.Pack_Linear.pack_end;
Efl.Pack_Linear.pack_before;

View File

@ -118,12 +118,12 @@ _efl_ui_container_layout_init(Eo* obj, Efl_Ui_Container_Layout_Calc *calc)
&calc[1].margin[0], &calc[1].margin[1]);
calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj);
efl_pack_padding_get(obj, &calc[0].pad, &calc[1].pad, &pad_scalable);
efl_gfx_arrangement_content_padding_get(obj, &calc[0].pad, &calc[1].pad, &pad_scalable);
calc[0].pad = pad_scalable ? (calc[0].pad * calc[0].scale) : calc[0].pad;
calc[1].pad = pad_scalable ? (calc[1].pad * calc[1].scale) : calc[1].pad;
// pack align is used if "no item has a weight"
efl_pack_align_get(obj, &calc[0].align, &calc[1].align);
efl_gfx_arrangement_content_align_get(obj, &calc[0].align, &calc[1].align);
if (calc[0].align < 0)
{
calc[0].fill = EINA_TRUE;

View File

@ -20,6 +20,29 @@
static void _grid_clear_internal(Eo *obj, Efl_Ui_Grid_Data *pd);
static void _grid_item_unpack_internal(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Grid_Item *item);
static int
clamp_index(Efl_Ui_Grid_Data *pd, int index)
{
if (index < ((int)eina_list_count(pd->items)) * -1)
return -1;
else if (index > (int)eina_list_count(pd->items) - 1)
return 1;
return 0;
}
static int
index_adjust(Efl_Ui_Grid_Data *pd, int index)
{
int c = eina_list_count(pd->items);
if (index < c * -1)
return 0;
else if (index > c - 1)
return c - 1;
else if (index < 0)
return index + c;
return index;
}
static void
_need_update(Efl_Ui_Grid_Data *pd)
{
@ -931,7 +954,20 @@ _grid_item_deleted(void *data, const Efl_Event *event)
static Eina_Bool
_grid_item_process(Eo *obj, Efl_Ui_Grid_Data *pd, EINA_UNUSED Efl_Ui_Grid_Item *it)
{
EFL_UI_GRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
if (!efl_isa(it, EFL_UI_GRID_ITEM_CLASS))
{
ERR("Item must be of type EFL_UI_GRID_ITEM_CLASS");
return EINA_FALSE;
}
if (eina_list_data_find(pd->items, it))
{
ERR("Item already added to this container!");
return EINA_FALSE;
}
if (!efl_ui_widget_sub_object_add(obj, it))
return EINA_FALSE;
//FIXME: This is tricky workaround for set select mode and parent value.
EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(it, gd, EINA_FALSE);
@ -974,6 +1010,9 @@ _grid_item_unpack_internal(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Ui_Grid_Item *it)
efl_event_callback_del(it, EFL_UI_EVENT_ITEM_SELECTED, _grid_item_selected, obj);
efl_event_callback_del(it, EFL_UI_EVENT_ITEM_UNSELECTED, _grid_item_unselected, obj);
efl_event_callback_del(it, EFL_EVENT_DEL, _grid_item_deleted, obj);
efl_canvas_group_member_remove(pd->pan, it);
_elm_widget_sub_object_redirect_to_top(obj, it);
}
@ -1024,6 +1063,12 @@ _efl_ui_grid_efl_pack_unpack(Eo *obj, Efl_Ui_Grid_Data *pd, Efl_Gfx_Entity *subo
{
Efl_Ui_Grid_Item *item = (Efl_Ui_Grid_Item *)subobj;
if (!eina_list_data_find(pd->items, item))
{
ERR("Element is not part of this container");
return EINA_FALSE;
}
_grid_item_unpack_internal(obj, pd, item);
elm_layout_sizing_eval(obj);
@ -1101,11 +1146,19 @@ _efl_ui_grid_efl_pack_linear_pack_at(Eo *obj,
Efl_Gfx_Entity *subobj,
int index)
{
int clamp = clamp_index(pd, index);
index = index_adjust(pd, index);
if (!_grid_item_process(obj, pd, subobj)) return EINA_FALSE;
Efl_Ui_Grid_Item *existing = eina_list_nth(pd->items, index);
EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(subobj, pid, EINA_FALSE);
pd->items = eina_list_prepend_relative(pd->items, subobj, existing);
if (clamp == 0)
pd->items = eina_list_prepend_relative(pd->items, subobj, existing);
else if (clamp == 1)
pd->items = eina_list_append(pd->items, subobj);
else
pd->items = eina_list_prepend(pd->items, subobj);
// Defered item's placing in group calculation
pid->update_begin = EINA_TRUE;
_need_update(pd);
@ -1115,20 +1168,16 @@ _efl_ui_grid_efl_pack_linear_pack_at(Eo *obj,
EOLIAN static Efl_Gfx_Entity *
_efl_ui_grid_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, int index)
{
return eina_list_nth(pd->items, index);
index = index_adjust(pd, index);
return eina_list_nth(pd->items, index);
}
EOLIAN static Efl_Gfx_Entity *
_efl_ui_grid_efl_pack_linear_pack_unpack_at(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, int index)
{
index = index_adjust(pd, index);
Efl_Gfx_Entity *target = eina_list_nth(pd->items, index);
pd->items = eina_list_remove(pd->items, target);
/*
if (after)
{
}
else
*/
_grid_item_unpack_internal(obj, pd, target);
_need_update(pd);
return target;
}
@ -1158,7 +1207,7 @@ _efl_ui_grid_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Grid_Data *pd)
}
EOLIAN static void
_efl_ui_grid_efl_pack_pack_padding_set(Eo *obj EINA_UNUSED,
_efl_ui_grid_efl_gfx_arrangement_content_padding_set(Eo *obj EINA_UNUSED,
Efl_Ui_Grid_Data *pd,
double h,
double v,
@ -1175,7 +1224,7 @@ _efl_ui_grid_efl_pack_pack_padding_set(Eo *obj EINA_UNUSED,
}
EOLIAN static void
_efl_ui_grid_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED,
_efl_ui_grid_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Grid_Data *pd,
double *h,
double *v,
@ -1188,7 +1237,7 @@ _efl_ui_grid_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED,
}
EOLIAN static void
_efl_ui_grid_efl_pack_pack_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double h, double v)
_efl_ui_grid_efl_gfx_arrangement_content_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double h, double v)
{
pd->item.align.w = h;
pd->item.align.h = v;
@ -1196,7 +1245,7 @@ _efl_ui_grid_efl_pack_pack_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd,
}
EOLIAN static void
_efl_ui_grid_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double *h, double *v)
_efl_ui_grid_efl_gfx_arrangement_content_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double *h, double *v)
{
*h = pd->item.align.w;
*v = pd->item.align.h;

View File

@ -7,7 +7,8 @@ class @beta Efl.Ui.Grid extends Efl.Ui.Layout_Base implements
Efl.Ui.Direction,
Efl.Ui.Clickable,
Efl.Ui.Selectable,
Efl.Ui.Multi_Selectable
Efl.Ui.Multi_Selectable,
Efl.Gfx.Arrangement
{
[[Simple grid widget with Pack interface.]]
methods {
@ -84,8 +85,8 @@ class @beta Efl.Ui.Grid extends Efl.Ui.Layout_Base implements
Efl.Pack_Linear.pack_content_get;
Efl.Pack_Layout.layout_update;
Efl.Pack_Layout.layout_request;
Efl.Pack.pack_padding { get; set; }
Efl.Pack.pack_align { get; set; }
Efl.Gfx.Arrangement.content_padding { get; set; }
Efl.Gfx.Arrangement.content_align { get; set; }
//Efl.Ui.Scrollable
Efl.Ui.Scrollable_Interactive.match_content { set; }

View File

@ -880,36 +880,36 @@ _efl_ui_list_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_List_Data *pd)
}
EOLIAN static void
_efl_ui_list_efl_pack_pack_padding_set(Eo *obj EINA_UNUSED,
_efl_ui_list_efl_gfx_arrangement_content_padding_set(Eo *obj EINA_UNUSED,
Efl_Ui_List_Data *pd,
double h,
double v,
Eina_Bool scalable)
{
efl_pack_padding_set(pd->box, h, v, scalable);
efl_gfx_arrangement_content_padding_set(pd->box, h, v, scalable);
}
EOLIAN static void
_efl_ui_list_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED,
_efl_ui_list_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED,
Efl_Ui_List_Data *pd,
double *h,
double *v,
Eina_Bool *scalable)
{
efl_pack_padding_get(pd->box, h, v, scalable);
efl_gfx_arrangement_content_padding_get(pd->box, h, v, scalable);
}
/* FIXME: align could not work properly on the list
EOLIAN static void
_efl_ui_list_efl_pack_pack_align_set(Eo *obj, Efl_Ui_List_Data *pd, double h, double v)
_efl_ui_list_efl_gfx_arrangement_content_align_set(Eo *obj, Efl_Ui_List_Data *pd, double h, double v)
{
efl_pack_align_set(pd->box, h, v);
efl_gfx_arrangement_content_align_set(pd->box, h, v);
}
EOLIAN static void
_efl_ui_list_efl_pack_pack_align_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, double *h, double *v)
_efl_ui_list_efl_gfx_arrangement_content_align_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, double *h, double *v)
{
efl_pack_align_get(pd->box, &h, &v);
efl_gfx_arrangement_content_align_get(pd->box, &h, &v);
}
*/

View File

@ -6,7 +6,8 @@ class @beta Efl.Ui.List extends Efl.Ui.Layout_Base implements
Efl.Pack_Linear, Efl.Pack_Layout,
Efl.Ui.Clickable,
Efl.Ui.Selectable,
Efl.Ui.Multi_Selectable
Efl.Ui.Multi_Selectable,
Efl.Gfx.Arrangement
{
[[Simple list widget with Pack interface.]]
methods {
@ -74,8 +75,7 @@ class @beta Efl.Ui.List extends Efl.Ui.Layout_Base implements
Efl.Pack_Linear.pack_index_get;
Efl.Pack_Layout.layout_update;
Efl.Pack_Layout.layout_request;
Efl.Pack.pack_padding { get; set; }
//Efl.Pack.pack_align { get; set; }
Efl.Gfx.Arrangement.content_padding { get; set; }
//Efl.Ui.Scrollable
Efl.Ui.Scrollable_Interactive.match_content { set; }

View File

@ -24,11 +24,48 @@ _chain_sort_cb(const void *l1, const void *l2)
return calc2->comp_factor <= calc1->comp_factor ? -1 : 1;
}
static void
_on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED)
{
Efl_Ui_Relative_Layout_Data *pd = data;
efl_pack_layout_request(pd->obj);
}
static void
_on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED)
{
Efl_Ui_Relative_Layout_Data *pd = data;
efl_pack_layout_request(pd->obj);
}
static void
_on_child_del(void *data, const Efl_Event *event)
{
Efl_Ui_Relative_Layout_Data *pd = data;
if (eina_hash_del_by_key(pd->children, &event->object))
efl_pack_layout_request(pd->obj);
else
ERR("child(%p(%s)) is not registered", event->object,
efl_class_name_get(event->object));
}
EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_relative_layout_callbacks,
{ EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_child_size_changed },
{ EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed },
{ EFL_EVENT_DEL, _on_child_del }
);
static Efl_Ui_Relative_Layout_Child *
_efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child)
{
Efl_Ui_Relative_Layout_Child *rc;
if (!efl_ui_widget_sub_object_add(pd->obj, child))
return NULL;
rc = calloc(1, sizeof(Efl_Ui_Relative_Layout_Child));
if (!rc) return NULL;
@ -43,19 +80,11 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child)
rc->rel[BOTTOM].to = rc->layout;
rc->rel[BOTTOM].relative = 1.0;
if (pd->obj == child)
{
rc->calc.state[0] = RELATIVE_CALC_DONE;
rc->calc.state[1] = RELATIVE_CALC_DONE;
rc->calc.chain_state[0] = RELATIVE_CALC_DONE;
rc->calc.chain_state[1] = RELATIVE_CALC_DONE;
}
else
{
efl_ui_widget_sub_object_add(pd->obj, child);
efl_canvas_group_member_add(pd->obj, child);
efl_canvas_group_change(pd->obj);
}
efl_key_data_set(child, "_elm_leaveme", pd->obj);
efl_canvas_object_clipper_set(child, pd->clipper);
efl_event_callback_array_add(child, efl_ui_relative_layout_callbacks(), pd);
efl_canvas_group_member_add(pd->obj, child);
efl_canvas_group_change(pd->obj);
eina_hash_add(pd->children, &child, rc);
@ -75,13 +104,19 @@ _relative_child_get(Efl_Ui_Relative_Layout_Data *pd, Eo *child)
}
static Efl_Ui_Relative_Layout_Child *
_relative_child_find(const Eina_Hash *children, Eo *target)
_relative_child_find(Efl_Ui_Relative_Layout_Data *pd, Eo *target)
{
Efl_Ui_Relative_Layout_Child *child;
child = eina_hash_find(children, &target);
if (pd->obj == target)
return pd->base;
child = eina_hash_find(pd->children, &target);
if (!child)
ERR("target(%p(%s)) is not registered", target, efl_class_name_get(target));
{
ERR("target(%p(%s)) is not registered", target, efl_class_name_get(target));
child = pd->base;
}
return child;
}
@ -90,7 +125,7 @@ static void
_child_aspect_calc(Efl_Ui_Relative_Layout_Child *child, Eina_Bool axis)
{
Efl_Ui_Relative_Layout_Calc *calc = &child->calc;
int temph;
double temph;
if ((calc->aspect[0] <= 0) || (calc->aspect[1] <= 0))
{
@ -353,9 +388,6 @@ _hash_child_calc_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key E
Efl_Ui_Relative_Layout_Child *child = data;
Eina_Rect want;
if (child->obj == child->layout)
return EINA_TRUE;
_child_calc(child, 0);
_child_calc(child, 1);
@ -370,35 +402,18 @@ _hash_child_calc_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key E
static Eina_Bool
_hash_child_init_foreach_cb(const Eina_Hash *hash, const void *key EINA_UNUSED,
void *data, void *fdata EINA_UNUSED)
_hash_child_init_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
void *data, void *fdata)
{
Eina_Size2D max, min, aspect;
Efl_Ui_Relative_Layout_Child *child = data;
Efl_Ui_Relative_Layout_Calc *calc = &(child->calc);
Efl_Ui_Relative_Layout_Data *pd = fdata;
calc->to[LEFT] = _relative_child_find(hash, child->rel[LEFT].to);
if (!calc->to[LEFT]) calc->to[LEFT] = eina_hash_find(hash, &child->layout);
calc->to[RIGHT] = _relative_child_find(hash, child->rel[RIGHT].to);
if (!calc->to[RIGHT]) calc->to[RIGHT] = eina_hash_find(hash, &child->layout);
calc->to[TOP] = _relative_child_find(hash, child->rel[TOP].to);
if (!calc->to[TOP]) calc->to[TOP] = eina_hash_find(hash, &child->layout);
calc->to[BOTTOM] = _relative_child_find(hash, child->rel[BOTTOM].to);
if (!calc->to[BOTTOM]) calc->to[BOTTOM] = eina_hash_find(hash, &child->layout);
if (child->obj == child->layout)
{
Eina_Rect want = efl_gfx_entity_geometry_get(child->obj);
calc->want[0].position = want.x;
calc->want[0].length = want.w;
calc->want[1].position = want.y;
calc->want[1].length = want.h;
calc->state[0] = RELATIVE_CALC_DONE;
calc->state[1] = RELATIVE_CALC_DONE;
calc->chain_state[0] = RELATIVE_CALC_DONE;
calc->chain_state[1] = RELATIVE_CALC_DONE;
return EINA_TRUE;
}
calc->to[LEFT] = _relative_child_find(pd, child->rel[LEFT].to);
calc->to[RIGHT] = _relative_child_find(pd, child->rel[RIGHT].to);
calc->to[TOP] = _relative_child_find(pd, child->rel[TOP].to);
calc->to[BOTTOM] = _relative_child_find(pd, child->rel[BOTTOM].to);
calc->state[0] = RELATIVE_CALC_NONE;
calc->state[1] = RELATIVE_CALC_NONE;
@ -454,7 +469,13 @@ _efl_ui_relative_layout_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event
EOLIAN static void
_efl_ui_relative_layout_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Relative_Layout_Data *pd)
{
eina_hash_foreach(pd->children, _hash_child_init_foreach_cb, NULL);
Eina_Rect want = efl_gfx_entity_geometry_get(obj);
pd->base->calc.want[0].position = want.x;
pd->base->calc.want[0].length = want.w;
pd->base->calc.want[1].position = want.y;
pd->base->calc.want[1].length = want.h;
eina_hash_foreach(pd->children, _hash_child_init_foreach_cb, pd);
eina_hash_foreach(pd->children, _hash_child_calc_foreach_cb, NULL);
efl_event_callback_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL);
@ -489,6 +510,12 @@ _efl_ui_relative_layout_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Relative_Lay
EOLIAN static void
_efl_ui_relative_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED)
{
pd->clipper = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj);
evas_object_static_clip_set(pd->clipper, EINA_TRUE);
efl_gfx_entity_geometry_set(pd->clipper, EINA_RECT(-49999, -49999, 99999, 99999));
efl_canvas_group_member_add(obj, pd->clipper);
efl_ui_widget_sub_object_add(obj, pd->clipper);
efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED,
_efl_ui_relative_layout_hints_changed_cb, NULL);
efl_canvas_group_add(efl_super(obj, MY_CLASS));
@ -506,17 +533,48 @@ _efl_ui_relative_layout_efl_object_constructor(Eo *obj, Efl_Ui_Relative_Layout_D
pd->obj = obj;
pd->children = eina_hash_pointer_new(_hash_free_cb);
_efl_ui_relative_layout_register(pd, obj);
pd->base = calloc(1, sizeof(Efl_Ui_Relative_Layout_Child));
if (!pd->base) return NULL;
pd->base->obj = obj;
pd->base->layout = obj;
pd->base->rel[LEFT].to = obj;
pd->base->rel[LEFT].relative = 0.0;
pd->base->rel[RIGHT].to = obj;
pd->base->rel[RIGHT].relative = 1.0;
pd->base->rel[TOP].to = obj;
pd->base->rel[TOP].relative = 0.0;
pd->base->rel[BOTTOM].to = obj;
pd->base->rel[BOTTOM].relative = 1.0;
pd->base->calc.state[0] = RELATIVE_CALC_DONE;
pd->base->calc.state[1] = RELATIVE_CALC_DONE;
pd->base->calc.chain_state[0] = RELATIVE_CALC_DONE;
pd->base->calc.chain_state[1] = RELATIVE_CALC_DONE;
return obj;
}
EOLIAN static void
_efl_ui_relative_layout_efl_object_invalidate(Eo *obj, Efl_Ui_Relative_Layout_Data *pd)
{
Eo *child;
efl_invalidate(efl_super(obj, MY_CLASS));
EINA_LIST_FREE(pd->children, child)
{
efl_event_callback_array_del(child, efl_ui_relative_layout_callbacks(), pd);
}
}
EOLIAN static void
_efl_ui_relative_layout_efl_object_destructor(Eo *obj, Efl_Ui_Relative_Layout_Data *pd)
{
efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED,
_efl_ui_relative_layout_hints_changed_cb, NULL);
eina_hash_free(pd->children);
if (pd->base) free(pd->base);
efl_destructor(efl_super(obj, MY_CLASS));
}
@ -524,14 +582,25 @@ EOLIAN static void
_efl_ui_relative_layout_unregister(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Efl_Object *child)
{
_elm_widget_sub_object_redirect_to_top(obj, child);
if (!eina_hash_del_by_key(pd->children, &child))
ERR("child(%p(%s)) is not registered", child, efl_class_name_get(child));
if (eina_hash_del_by_key(pd->children, &child))
{
efl_canvas_group_member_remove(obj, child);
efl_canvas_object_clipper_set(child, NULL);
efl_key_data_set(child, "_elm_leaveme", NULL);
efl_event_callback_array_del(child, efl_ui_relative_layout_callbacks(), pd);
efl_pack_layout_request(obj);
}
else
{
ERR("child(%p(%s)) is not registered", child, efl_class_name_get(child));
}
}
EOLIAN static void
_efl_ui_relative_layout_unregister_all(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd)
_efl_ui_relative_layout_unregister_all(Eo *obj, Efl_Ui_Relative_Layout_Data *pd)
{
eina_hash_foreach(pd->children, _hash_free_foreach_cb, NULL);
efl_pack_layout_request(obj);
}
EOLIAN static Eina_Iterator *

View File

@ -69,6 +69,7 @@ class @beta Efl.Ui.Relative_Layout extends Efl.Ui.Widget implements Efl.Pack_Lay
}
implements {
Efl.Object.constructor;
Efl.Object.invalidate;
Efl.Object.destructor;
Efl.Canvas.Group.group_calculate;
Efl.Gfx.Entity.position { set; }

View File

@ -49,7 +49,9 @@ struct _Efl_Ui_Relative_Layout_Calc
struct _Efl_Ui_Relative_Layout_Data
{
Eo *obj;
Eo *clipper;
Eina_Hash *children;
Efl_Ui_Relative_Layout_Child *base;
};
struct _Efl_Ui_Relative_Layout_Relation
@ -68,23 +70,35 @@ struct _Efl_Ui_Relative_Layout_Child
#define EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(direction, DIRECTION) \
EOLIAN static void \
_efl_ui_relative_layout_relation_ ## direction ## _set(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo *target, double relative) \
_efl_ui_relative_layout_relation_ ## direction ## _set(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo *target, double relative) \
{ \
Efl_Ui_Relative_Layout_Child *rc; \
if (!child) return; \
rc = _relative_child_get(pd, child); \
if (!rc) return; \
if (target) rc->rel[DIRECTION].to = target; \
if (relative < 0) relative = 0; \
else if (relative > 1) relative = 1; \
rc->rel[DIRECTION].relative = relative; \
efl_pack_layout_request(obj); \
} \
\
EOLIAN static void \
_efl_ui_relative_layout_relation_ ## direction ## _get(const Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo **target, double *relative) \
{ \
Efl_Ui_Relative_Layout_Child *rc; \
rc = _relative_child_get(pd, child); \
if (target) *target = rc->rel[DIRECTION].to; \
if (relative) *relative = rc->rel[DIRECTION].relative; \
Eo *rel_to = NULL; \
double rel_relative = 0.0; \
rc = eina_hash_find(pd->children, &child); \
if (rc) \
{ \
rel_to = rc->rel[DIRECTION].to; \
rel_relative = rc->rel[DIRECTION].relative; \
} \
else \
ERR("child(%p(%s)) is not registered", child, efl_class_name_get(child)); \
if (target) *target = rel_to; \
if (relative) *relative = rel_relative; \
}
#endif

View File

@ -162,6 +162,15 @@ _show_content_with_anim(Efl_Ui_Stack *obj, Efl_Ui_Stack_Data *pd, Content_Data *
efl_animation_player_target_set(pd->show, cd->content);
Transit_Data *td = calloc(1, sizeof(Transit_Data));
if (!td)
{
ERR("Memory allocation error!");
//show content without animation
_show_content_without_anim(obj, cd->content);
return;
}
td->cd = cd;
pd->show_td = td;
@ -185,6 +194,15 @@ _hide_content_with_anim(Efl_Ui_Stack *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Co
efl_animation_player_target_set(pd->hide, cd->content);
Transit_Data *td = calloc(1, sizeof(Transit_Data));
if (!td)
{
ERR("Memory allocation error!");
//hide content without animation
_hide_content_without_anim(obj, cd->content);
return;
}
td->cd = cd;
pd->hide_td = td;

View File

@ -235,7 +235,20 @@ _efl_ui_table_efl_object_constructor(Eo *obj, Efl_Ui_Table_Data *pd)
}
EOLIAN static void
_efl_ui_table_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v, Eina_Bool scalable)
_efl_ui_table_efl_object_invalidate(Eo *obj, Efl_Ui_Table_Data *pd)
{
Table_Item *gi;
efl_invalidate(efl_super(obj, MY_CLASS));
EINA_INLIST_FREE(EINA_INLIST_GET(pd->items), gi)
{
efl_event_callback_array_del(gi->object, efl_ui_table_callbacks(), obj);
}
}
EOLIAN static void
_efl_ui_table_efl_gfx_arrangement_content_padding_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v, Eina_Bool scalable)
{
scalable = !!scalable;
if (h < 0) h = 0;
@ -253,7 +266,7 @@ _efl_ui_table_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Table_Data *pd, double h
}
EOLIAN static void
_efl_ui_table_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v, Eina_Bool *scalable)
_efl_ui_table_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v, Eina_Bool *scalable)
{
if (scalable) *scalable = pd->pad.scalable;
if (h) *h = pd->pad.h;
@ -261,7 +274,7 @@ _efl_ui_table_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_
}
EOLIAN static void
_efl_ui_table_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v)
_efl_ui_table_efl_gfx_arrangement_content_align_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v)
{
if (h < 0) h = -1;
else if (h > 1) h = 1;
@ -278,7 +291,7 @@ _efl_ui_table_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Table_Data *pd, double h,
}
EOLIAN static void
_efl_ui_table_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v)
_efl_ui_table_efl_gfx_arrangement_content_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v)
{
if (h) *h = pd->align.h;
if (v) *v = pd->align.v;

View File

@ -1,5 +1,5 @@
class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pack_Layout,
Efl.Ui.Direction
Efl.Ui.Direction, Efl.Gfx.Arrangement
{
[[Efl UI table class]]
methods {
@ -19,6 +19,7 @@ class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pa
}
implements {
Efl.Object.constructor;
Efl.Object.invalidate;
Efl.Canvas.Group.group_calculate;
Efl.Gfx.Entity.position { set; }
Efl.Gfx.Entity.size { set; }
@ -29,8 +30,8 @@ class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pa
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
Efl.Pack.pack_padding { get; set; }
Efl.Pack.pack_align { get; set; }
Efl.Gfx.Arrangement.content_padding { get; set; }
Efl.Gfx.Arrangement.content_align { get; set; }
Efl.Pack_Table.pack_table;
Efl.Pack_Table.table_content_get;
Efl.Pack_Table.table_contents_get;

View File

@ -44,7 +44,7 @@
#define FRAME_OBJ_THEME_MIN_VERSION 119
Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt);
static const Elm_Win_Trap *trap = NULL;
@ -5409,33 +5409,34 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
if (parent) parent_id = elm_win_window_id_get(parent);
for (i = 0; i < p; i++)
{
int opt[20], opt_i = 0;
if (_elm_config->vsync)
{
opt[opt_i++] = ECORE_EVAS_OPT_VSYNC;
opt[opt_i++] = 1;
}
if (gl_depth)
{
opt[opt_i++] = ECORE_EVAS_OPT_GL_DEPTH;
opt[opt_i++] = gl_depth;
}
if (gl_stencil)
{
opt[opt_i++] = ECORE_EVAS_OPT_GL_STENCIL;
opt[opt_i++] = gl_stencil;
}
if (gl_msaa)
{
opt[opt_i++] = ECORE_EVAS_OPT_GL_MSAA;
opt[opt_i++] = gl_msaa;
}
opt[opt_i] = 0;
if (!strcmp(enginelist[i], ELM_SOFTWARE_X11))
tmp_sd.ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 0, 0);
else if (!strcmp(enginelist[i], ELM_OPENGL_X11))
{
int opt[20], opt_i = 0;
if (_elm_config->vsync)
{
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_VSYNC;
opt[opt_i++] = 1;
}
if (gl_depth)
{
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_DEPTH;
opt[opt_i++] = gl_depth;
}
if (gl_stencil)
{
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_STENCIL;
opt[opt_i++] = gl_stencil;
}
if (gl_msaa)
{
opt[opt_i++] = ECORE_EVAS_GL_X11_OPT_GL_MSAA;
opt[opt_i++] = gl_msaa;
}
opt[opt_i] = 0;
if (opt_i > 0)
tmp_sd.ee = ecore_evas_gl_x11_options_new(NULL, 0, 0, 0, 0, 0, opt);
else
@ -5444,7 +5445,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
else if (!strcmp(enginelist[i], ELM_WAYLAND_SHM))
tmp_sd.ee = _wayland_shm_new(NULL, parent_id, 0, 0, 0, 0, 0);
else if (!strcmp(enginelist[i], ELM_WAYLAND_EGL))
tmp_sd.ee = _wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0);
tmp_sd.ee = _wayland_egl_new(NULL, parent_id, 0, 0, 0, 0, 0, (opt_i > 0) ? opt : NULL);
else if (!strcmp(enginelist[i], ELM_SOFTWARE_WIN32))
tmp_sd.ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
else if (!strcmp(enginelist[i], ELM_SOFTWARE_DDRAW))

View File

@ -296,7 +296,7 @@ _sizing_eval(void *data)
if (sd->horizontal)
{
if (!strcmp(sd->last_location, "left"))
if ((sd->last_location) && (!strcmp(sd->last_location, "left")))
{
adjusted.x = parent.x;
if ((adjusted.x + adjusted.w) > base.x)
@ -314,7 +314,7 @@ _sizing_eval(void *data)
}
else
{
if (!strcmp(sd->last_location, "top"))
if ((sd->last_location) && (!strcmp(sd->last_location, "top")))
{
adjusted.y = parent.y;
if ((adjusted.y + adjusted.h) > base.y)

View File

@ -1348,7 +1348,7 @@ _elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd
if (vpadstr) v_pad = atoi(vpadstr);
scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
efl_pack_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
EINA_LIST_FOREACH(sd->items, elist, eo_item)
{
@ -1923,8 +1923,8 @@ _create_colorpalette(Evas_Object *obj)
if (vpadstr) v_pad = atoi(vpadstr);
scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
efl_pack_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
efl_pack_align_set(sd->palette_box, 0.0, 0.0);
efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
efl_gfx_arrangement_content_align_set(sd->palette_box, 0.0, 0.0);
if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box))
elm_layout_content_set(obj, "palette", sd->palette_box);
sd->palette_name = eina_stringshare_add("default");

View File

@ -533,7 +533,10 @@ elm_theme_free(Elm_Theme *th)
/* Destructs theme object and theme is deallocated in
* _elm_theme_free_internal() in theme object desctructor.
*/
efl_unref(th->eo_theme);
if (efl_ref_count(th->eo_theme) > 1)
efl_unref(th->eo_theme);
else
efl_del(th->eo_theme);
}
static void

View File

@ -198,8 +198,9 @@ _validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp)
default:
return _reset_stable(vals, was_stable, EINA_FALSE);
}
_reset_stable(vals, was_stable, EINA_TRUE);
return _validate(&tp->base);
//Unexpected case?
return EINA_FALSE;
}
static const char * const eo_complex_frees[] =

View File

@ -2192,8 +2192,6 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
break;
case KW_at_free:
{
if (is_enum)
goto postparams;
CASE_LOCK(ls, free, "@free qualifier")
if (is_enum)
eo_lexer_syntax_error(ls, "enums cannot have @free");

View File

@ -84,8 +84,12 @@ _animator_cb(void *data)
duration = efl_animation_duration_get(anim);
elapsed_time = pd->time.current - pd->time.prev;
vector = elapsed_time / duration;
if (vector <= DBL_EPSILON)
/* When animation player starts, _animator_cb() is called immediately so
* both elapsed time and progress are 0.0.
* Since it is the beginning of the animation if progress is 0.0, the
* following codes for animation should be executed. */
if ((vector <= DBL_EPSILON) && (pd->progress != 0.0))
return ECORE_CALLBACK_RENEW; // There is no update.
//TODO: check negative play_speed.

View File

@ -460,6 +460,7 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e,
Eina_Vector2 point;
int addgrab = 0;
int no_rep = 0;
int srcgrab = 0;
if (obj->delete_me || src->delete_me || e->is_frozen) return;
@ -472,31 +473,52 @@ _evas_event_source_mouse_down_events(Evas_Object *eo_obj, Evas *eo_e,
ev->source = eo_obj;
ev->tool = 0;
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_write)
EINA_LIST_FOREACH(src->proxy->src_event_in, l, eo_child)
{
if (proxy_write->src_event_in)
proxy_write->src_event_in = eina_list_free(proxy_write->src_event_in);
Evas_Object_Pointer_Data *obj_pdata;
if (src->is_smart)
child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
obj_pdata = _evas_object_pointer_data_get(pdata, child);
if (!obj_pdata)
{
proxy_write->src_event_in = _evas_event_object_list_raw_in_get
(eo_e, proxy_write->src_event_in,
evas_object_smart_members_get_direct(eo_src), NULL,
NULL, ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE);
}
else if (src->is_event_parent)
{
proxy_write->src_event_in = _evas_event_object_list_raw_in_get
(eo_e, proxy_write->src_event_in,
NULL, evas_object_event_grabber_members_list(eo_src),
NULL, ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE);
}
else
proxy_write->src_event_in = eina_list_append(proxy_write->src_event_in, eo_src);
ERR("Could not find the object pointer data for device %p",
ev->device);
continue;
}
srcgrab += obj_pdata->mouse_grabbed;
}
EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write);
if (pdata->seat->downs > 1) addgrab = pdata->seat->downs - 1;
if (srcgrab == 0)
{
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_write)
{
if (proxy_write->src_event_in)
proxy_write->src_event_in = eina_list_free(proxy_write->src_event_in);
if (src->is_smart)
{
proxy_write->src_event_in = _evas_event_object_list_raw_in_get
(eo_e, proxy_write->src_event_in,
evas_object_smart_members_get_direct(eo_src), NULL,
NULL, ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE);
}
else if (src->is_event_parent)
{
proxy_write->src_event_in = _evas_event_object_list_raw_in_get
(eo_e, proxy_write->src_event_in,
NULL, evas_object_event_grabber_members_list(eo_src),
NULL, ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE);
}
else
proxy_write->src_event_in = eina_list_append(proxy_write->src_event_in, eo_src);
}
EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write);
}
if (pdata->seat->mouse_grabbed == 0)
{
if (pdata->seat->downs > 1) addgrab = pdata->seat->downs - 1;
}
EINA_LIST_FOREACH(src->proxy->src_event_in, l, eo_child)
{
@ -960,7 +982,10 @@ _evas_event_source_multi_down_events(Evas_Object_Protected_Data *obj, Evas_Publi
ev->source = obj->object;
ev->action = EFL_POINTER_ACTION_DOWN;
if (pdata->seat->downs > 1) addgrab = pdata->seat->downs - 1;
if (pdata->seat->mouse_grabbed == 0)
{
if (pdata->seat->downs > 1) addgrab = pdata->seat->downs - 1;
}
EINA_LIST_FOREACH(src->proxy->src_event_in, l, eo_child)
{

View File

@ -111,6 +111,33 @@ _evas_device_del_cb(void *data, const Efl_Event *ev)
_evas_object_pointer_grab_del(obj, pdata);
}
static void
_evas_object_proxy_grab_del(Evas_Object_Protected_Data *obj,
Evas_Object_Pointer_Data *pdata)
{
Evas_Object *eo_src = _evas_object_image_source_get(obj->object);
Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS);
Eina_List *copy = eina_list_clone(src->proxy->src_event_in);
Eina_List *l;
Evas_Object *eo_child;
EINA_LIST_FOREACH(copy, l, eo_child)
{
Evas_Object_Protected_Data *child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
if (!child) continue;
Evas_Object_Pointer_Data *obj_pdata = _evas_object_pointer_data_get(pdata->evas_pdata, child);
if (!obj_pdata)
continue;
if (obj_pdata->mouse_grabbed > 0)
{
pdata->evas_pdata->seat->mouse_grabbed -= obj_pdata->mouse_grabbed;
obj_pdata->mouse_grabbed = 0;
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_write)
proxy_write->src_event_in = eina_list_remove(proxy_write->src_event_in, eo_child);
EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write);
}
}
}
static void
_evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj,
Evas_Object_Pointer_Data *pdata)
@ -119,7 +146,11 @@ _evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj,
pdata->evas_pdata->seat->mouse_grabbed -= pdata->mouse_grabbed;
if (((pdata->mouse_in) || (pdata->mouse_grabbed > 0)) &&
(obj->layer) && (obj->layer->evas))
pdata->evas_pdata->seat->object.in = eina_list_remove(pdata->evas_pdata->seat->object.in, obj->object);
{
pdata->evas_pdata->seat->object.in = eina_list_remove(pdata->evas_pdata->seat->object.in, obj->object);
if (obj->proxy->is_proxy && obj->proxy->src_events)
_evas_object_proxy_grab_del(obj, pdata);
}
efl_event_callback_del(pdata->evas_pdata->pointer, EFL_EVENT_DEL,
_evas_device_del_cb, obj->object);
EINA_COW_WRITE_BEGIN(evas_object_events_cow, obj->events, Evas_Object_Events_Data, events)

View File

@ -1087,173 +1087,364 @@ _line_free(Evas_Object_Textblock_Line *ln)
}
/* table of html escapes (that i can find) this should be ordered with the
* most common first as it's a linear search to match - no hash for this.
* sorted by there escape strings and values as it's a binary search to match - no hash for this.
*
* these are stored as one large string and one additional array that
* contains the offsets to the tokens for space efficiency.
* these are stored as array of struct of Escape_Value structure (no Runtime sort will happen)
*/
/**
* @internal
* @var escape_strings[]
* This string consists of NULL terminated pairs of strings, the first of
* every pair is an escape and the second is the value of the escape.
* @var escape_values_e_sorted[]
* This array consists of Escape_Value structure sorted by escape string
* And new added value must be placed sorted position, and reflected on escape_values_v_sorted
*/
static const char escape_strings[] =
/* most common escaped stuff */
"&quot;\0" "\x22\0"
"&amp;\0" "\x26\0"
"&apos;\0" "\x27\0"
"&lt;\0" "\x3c\0"
"&gt;\0" "\x3e\0"
/* all the rest */
"&nbsp;\0" "\xc2\xa0\0"
"&iexcl;\0" "\xc2\xa1\0"
"&cent;\0" "\xc2\xa2\0"
"&pound;\0" "\xc2\xa3\0"
"&curren;\0" "\xc2\xa4\0"
"&yen;\0" "\xc2\xa5\0"
"&brvbar;\0" "\xc2\xa6\0"
"&sect;\0" "\xc2\xa7\0"
"&uml;\0" "\xc2\xa8\0"
"&copy;\0" "\xc2\xa9\0"
"&ordf;\0" "\xc2\xaa\0"
"&laquo;\0" "\xc2\xab\0"
"&not;\0" "\xc2\xac\0"
"&shy;\0" "\xc2\xad\0"
"&reg;\0" "\xc2\xae\0"
"&macr;\0" "\xc2\xaf\0"
"&deg;\0" "\xc2\xb0\0"
"&plusmn;\0" "\xc2\xb1\0"
"&sup2;\0" "\xc2\xb2\0"
"&sup3;\0" "\xc2\xb3\0"
"&acute;\0" "\xc2\xb4\0"
"&micro;\0" "\xc2\xb5\0"
"&para;\0" "\xc2\xb6\0"
"&middot;\0" "\xc2\xb7\0"
"&cedil;\0" "\xc2\xb8\0"
"&sup1;\0" "\xc2\xb9\0"
"&ordm;\0" "\xc2\xba\0"
"&raquo;\0" "\xc2\xbb\0"
"&frac14;\0" "\xc2\xbc\0"
"&frac12;\0" "\xc2\xbd\0"
"&frac34;\0" "\xc2\xbe\0"
"&iquest;\0" "\xc2\xbf\0"
"&Agrave;\0" "\xc3\x80\0"
"&Aacute;\0" "\xc3\x81\0"
"&Acirc;\0" "\xc3\x82\0"
"&Atilde;\0" "\xc3\x83\0"
"&Auml;\0" "\xc3\x84\0"
"&Aring;\0" "\xc3\x85\0"
"&Aelig;\0" "\xc3\x86\0"
"&Ccedil;\0" "\xc3\x87\0"
"&Egrave;\0" "\xc3\x88\0"
"&Eacute;\0" "\xc3\x89\0"
"&Ecirc;\0" "\xc3\x8a\0"
"&Euml;\0" "\xc3\x8b\0"
"&Igrave;\0" "\xc3\x8c\0"
"&Iacute;\0" "\xc3\x8d\0"
"&Icirc;\0" "\xc3\x8e\0"
"&Iuml;\0" "\xc3\x8f\0"
"&Eth;\0" "\xc3\x90\0"
"&Ntilde;\0" "\xc3\x91\0"
"&Ograve;\0" "\xc3\x92\0"
"&Oacute;\0" "\xc3\x93\0"
"&Ocirc;\0" "\xc3\x94\0"
"&Otilde;\0" "\xc3\x95\0"
"&Ouml;\0" "\xc3\x96\0"
"&times;\0" "\xc3\x97\0"
"&Oslash;\0" "\xc3\x98\0"
"&Ugrave;\0" "\xc3\x99\0"
"&Uacute;\0" "\xc3\x9a\0"
"&Ucirc;\0" "\xc3\x9b\0"
"&Yacute;\0" "\xc3\x9d\0"
"&Thorn;\0" "\xc3\x9e\0"
"&szlig;\0" "\xc3\x9f\0"
"&agrave;\0" "\xc3\xa0\0"
"&aacute;\0" "\xc3\xa1\0"
"&acirc;\0" "\xc3\xa2\0"
"&atilde;\0" "\xc3\xa3\0"
"&auml;\0" "\xc3\xa4\0"
"&aring;\0" "\xc3\xa5\0"
"&aelig;\0" "\xc3\xa6\0"
"&ccedil;\0" "\xc3\xa7\0"
"&egrave;\0" "\xc3\xa8\0"
"&eacute;\0" "\xc3\xa9\0"
"&ecirc;\0" "\xc3\xaa\0"
"&euml;\0" "\xc3\xab\0"
"&igrave;\0" "\xc3\xac\0"
"&iacute;\0" "\xc3\xad\0"
"&icirc;\0" "\xc3\xae\0"
"&iuml;\0" "\xc3\xaf\0"
"&eth;\0" "\xc3\xb0\0"
"&ntilde;\0" "\xc3\xb1\0"
"&ograve;\0" "\xc3\xb2\0"
"&oacute;\0" "\xc3\xb3\0"
"&ocirc;\0" "\xc3\xb4\0"
"&otilde;\0" "\xc3\xb5\0"
"&ouml;\0" "\xc3\xb6\0"
"&divide;\0" "\xc3\xb7\0"
"&oslash;\0" "\xc3\xb8\0"
"&ugrave;\0" "\xc3\xb9\0"
"&uacute;\0" "\xc3\xba\0"
"&ucirc;\0" "\xc3\xbb\0"
"&uuml;\0" "\xc3\xbc\0"
"&yacute;\0" "\xc3\xbd\0"
"&thorn;\0" "\xc3\xbe\0"
"&yuml;\0" "\xc3\xbf\0"
"&alpha;\0" "\xce\x91\0"
"&beta;\0" "\xce\x92\0"
"&gamma;\0" "\xce\x93\0"
"&delta;\0" "\xce\x94\0"
"&epsilon;\0" "\xce\x95\0"
"&zeta;\0" "\xce\x96\0"
"&eta;\0" "\xce\x97\0"
"&theta;\0" "\xce\x98\0"
"&iota;\0" "\xce\x99\0"
"&kappa;\0" "\xce\x9a\0"
"&lambda;\0" "\xce\x9b\0"
"&mu;\0" "\xce\x9c\0"
"&nu;\0" "\xce\x9d\0"
"&xi;\0" "\xce\x9e\0"
"&omicron;\0" "\xce\x9f\0"
"&pi;\0" "\xce\xa0\0"
"&rho;\0" "\xce\xa1\0"
"&sigma;\0" "\xce\xa3\0"
"&tau;\0" "\xce\xa4\0"
"&upsilon;\0" "\xce\xa5\0"
"&phi;\0" "\xce\xa6\0"
"&chi;\0" "\xce\xa7\0"
"&psi;\0" "\xce\xa8\0"
"&omega;\0" "\xce\xa9\0"
"&hellip;\0" "\xe2\x80\xa6\0"
"&euro;\0" "\xe2\x82\xac\0"
"&larr;\0" "\xe2\x86\x90\0"
"&uarr;\0" "\xe2\x86\x91\0"
"&rarr;\0" "\xe2\x86\x92\0"
"&darr;\0" "\xe2\x86\x93\0"
"&harr;\0" "\xe2\x86\x94\0"
"&larr;\0" "\xe2\x87\x90\0"
"&rarr;\0" "\xe2\x87\x92\0"
"&forall;\0" "\xe2\x88\x80\0"
"&exist;\0" "\xe2\x88\x83\0"
"&nabla;\0" "\xe2\x88\x87\0"
"&prod;\0" "\xe2\x88\x8f\0"
"&sum;\0" "\xe2\x88\x91\0"
"&and;\0" "\xe2\x88\xa7\0"
"&or;\0" "\xe2\x88\xa8\0"
"&int;\0" "\xe2\x88\xab\0"
"&ne;\0" "\xe2\x89\xa0\0"
"&equiv;\0" "\xe2\x89\xa1\0"
"&oplus;\0" "\xe2\x8a\x95\0"
"&perp;\0" "\xe2\x8a\xa5\0"
"&dagger;\0" "\xe2\x80\xa0\0"
"&Dagger;\0" "\xe2\x80\xa1\0"
"&bull;\0" "\xe2\x80\xa2\0"
"&zwnj;\0" "\xe2\x80\x8c\0"
"&zwj;\0" "\xe2\x80\x8d\0"
"&lrm;\0" "\xe2\x80\x8e\0"
"&rlm;\0" "\xe2\x80\x8f\0"
;
typedef struct _Escape_Value Escape_Value;
struct _Escape_Value
{
char *escape;
char *value;
size_t escape_len;
size_t value_len;
};
#define ESCAPE_VALUE(e,v) {e,v,strlen(e),strlen(v)}
static const Escape_Value escape_values_e_sorted[] = {
ESCAPE_VALUE("&Aacute;", "\xc3\x81"),
ESCAPE_VALUE("&Acirc;", "\xc3\x82"),
ESCAPE_VALUE("&Aelig;", "\xc3\x86"),
ESCAPE_VALUE("&Agrave;", "\xc3\x80"),
ESCAPE_VALUE("&Aring;", "\xc3\x85"),
ESCAPE_VALUE("&Atilde;", "\xc3\x83"),
ESCAPE_VALUE("&Auml;", "\xc3\x84"),
ESCAPE_VALUE("&Ccedil;", "\xc3\x87"),
ESCAPE_VALUE("&Dagger;", "\xe2\x80\xa1"),
ESCAPE_VALUE("&Eacute;", "\xc3\x89"),
ESCAPE_VALUE("&Ecirc;", "\xc3\x8a"),
ESCAPE_VALUE("&Egrave;", "\xc3\x88"),
ESCAPE_VALUE("&Eth;", "\xc3\x90"),
ESCAPE_VALUE("&Euml;", "\xc3\x8b"),
ESCAPE_VALUE("&Iacute;", "\xc3\x8d"),
ESCAPE_VALUE("&Icirc;", "\xc3\x8e"),
ESCAPE_VALUE("&Igrave;", "\xc3\x8c"),
ESCAPE_VALUE("&Iuml;", "\xc3\x8f"),
ESCAPE_VALUE("&Ntilde;", "\xc3\x91"),
ESCAPE_VALUE("&Oacute;", "\xc3\x93"),
ESCAPE_VALUE("&Ocirc;", "\xc3\x94"),
ESCAPE_VALUE("&Ograve;", "\xc3\x92"),
ESCAPE_VALUE("&Oslash;", "\xc3\x98"),
ESCAPE_VALUE("&Otilde;", "\xc3\x95"),
ESCAPE_VALUE("&Ouml;", "\xc3\x96"),
ESCAPE_VALUE("&Thorn;", "\xc3\x9e"),
ESCAPE_VALUE("&Uacute;", "\xc3\x9a"),
ESCAPE_VALUE("&Ucirc;", "\xc3\x9b"),
ESCAPE_VALUE("&Ugrave;", "\xc3\x99"),
ESCAPE_VALUE("&Yacute;", "\xc3\x9d"),
ESCAPE_VALUE("&aacute;", "\xc3\xa1"),
ESCAPE_VALUE("&acirc;", "\xc3\xa2"),
ESCAPE_VALUE("&acute;", "\xc2\xb4"),
ESCAPE_VALUE("&aelig;", "\xc3\xa6"),
ESCAPE_VALUE("&agrave;", "\xc3\xa0"),
ESCAPE_VALUE("&alpha;", "\xce\x91"),
ESCAPE_VALUE("&and;", "\xe2\x88\xa7"),
ESCAPE_VALUE("&aring;", "\xc3\xa5"),
ESCAPE_VALUE("&atilde;", "\xc3\xa3"),
ESCAPE_VALUE("&auml;", "\xc3\xa4"),
ESCAPE_VALUE("&beta;", "\xce\x92"),
ESCAPE_VALUE("&brvbar;", "\xc2\xa6"),
ESCAPE_VALUE("&bull;", "\xe2\x80\xa2"),
ESCAPE_VALUE("&ccedil;", "\xc3\xa7"),
ESCAPE_VALUE("&cedil;", "\xc2\xb8"),
ESCAPE_VALUE("&cent;", "\xc2\xa2"),
ESCAPE_VALUE("&chi;", "\xce\xa7"),
ESCAPE_VALUE("&copy;", "\xc2\xa9"),
ESCAPE_VALUE("&curren;", "\xc2\xa4"),
ESCAPE_VALUE("&dagger;", "\xe2\x80\xa0"),
ESCAPE_VALUE("&darr;", "\xe2\x86\x93"),
ESCAPE_VALUE("&deg;", "\xc2\xb0"),
ESCAPE_VALUE("&delta;", "\xce\x94"),
ESCAPE_VALUE("&divide;", "\xc3\xb7"),
ESCAPE_VALUE("&eacute;", "\xc3\xa9"),
ESCAPE_VALUE("&ecirc;", "\xc3\xaa"),
ESCAPE_VALUE("&egrave;", "\xc3\xa8"),
ESCAPE_VALUE("&epsilon;", "\xce\x95"),
ESCAPE_VALUE("&equiv;", "\xe2\x89\xa1"),
ESCAPE_VALUE("&eta;", "\xce\x97"),
ESCAPE_VALUE("&eth;", "\xc3\xb0"),
ESCAPE_VALUE("&euml;", "\xc3\xab"),
ESCAPE_VALUE("&euro;", "\xe2\x82\xac"),
ESCAPE_VALUE("&exist;", "\xe2\x88\x83"),
ESCAPE_VALUE("&forall;", "\xe2\x88\x80"),
ESCAPE_VALUE("&frac12;", "\xc2\xbd"),
ESCAPE_VALUE("&frac14;", "\xc2\xbc"),
ESCAPE_VALUE("&frac34;", "\xc2\xbe"),
ESCAPE_VALUE("&gamma;", "\xce\x93"),
ESCAPE_VALUE("&harr;", "\xe2\x86\x94"),
ESCAPE_VALUE("&hellip;", "\xe2\x80\xa6"),
ESCAPE_VALUE("&iacute;", "\xc3\xad"),
ESCAPE_VALUE("&icirc;", "\xc3\xae"),
ESCAPE_VALUE("&iexcl;", "\xc2\xa1"),
ESCAPE_VALUE("&igrave;", "\xc3\xac"),
ESCAPE_VALUE("&int;", "\xe2\x88\xab"),
ESCAPE_VALUE("&iota;", "\xce\x99"),
ESCAPE_VALUE("&iquest;", "\xc2\xbf"),
ESCAPE_VALUE("&iuml;", "\xc3\xaf"),
ESCAPE_VALUE("&kappa;", "\xce\x9a"),
ESCAPE_VALUE("&lambda;", "\xce\x9b"),
ESCAPE_VALUE("&laquo;", "\xc2\xab"),
ESCAPE_VALUE("&larr;", "\xe2\x86\x90"),
ESCAPE_VALUE("&larr;", "\xe2\x87\x90"),
ESCAPE_VALUE("&lrm;", "\xe2\x80\x8e"),
ESCAPE_VALUE("&macr;", "\xc2\xaf"),
ESCAPE_VALUE("&micro;", "\xc2\xb5"),
ESCAPE_VALUE("&middot;", "\xc2\xb7"),
ESCAPE_VALUE("&mu;", "\xce\x9c"),
ESCAPE_VALUE("&nabla;", "\xe2\x88\x87"),
ESCAPE_VALUE("&nbsp;", "\xc2\xa0"),
ESCAPE_VALUE("&ne;", "\xe2\x89\xa0"),
ESCAPE_VALUE("&not;", "\xc2\xac"),
ESCAPE_VALUE("&ntilde;", "\xc3\xb1"),
ESCAPE_VALUE("&nu;", "\xce\x9d"),
ESCAPE_VALUE("&oacute;", "\xc3\xb3"),
ESCAPE_VALUE("&ocirc;", "\xc3\xb4"),
ESCAPE_VALUE("&ograve;", "\xc3\xb2"),
ESCAPE_VALUE("&omega;", "\xce\xa9"),
ESCAPE_VALUE("&omicron;", "\xce\x9f"),
ESCAPE_VALUE("&oplus;", "\xe2\x8a\x95"),
ESCAPE_VALUE("&or;", "\xe2\x88\xa8"),
ESCAPE_VALUE("&ordf;", "\xc2\xaa"),
ESCAPE_VALUE("&ordm;", "\xc2\xba"),
ESCAPE_VALUE("&oslash;", "\xc3\xb8"),
ESCAPE_VALUE("&otilde;", "\xc3\xb5"),
ESCAPE_VALUE("&ouml;", "\xc3\xb6"),
ESCAPE_VALUE("&para;", "\xc2\xb6"),
ESCAPE_VALUE("&perp;", "\xe2\x8a\xa5"),
ESCAPE_VALUE("&phi;", "\xce\xa6"),
ESCAPE_VALUE("&pi;", "\xce\xa0"),
ESCAPE_VALUE("&plusmn;", "\xc2\xb1"),
ESCAPE_VALUE("&pound;", "\xc2\xa3"),
ESCAPE_VALUE("&prod;", "\xe2\x88\x8f"),
ESCAPE_VALUE("&psi;", "\xce\xa8"),
ESCAPE_VALUE("&raquo;", "\xc2\xbb"),
ESCAPE_VALUE("&rarr;", "\xe2\x86\x92"),
ESCAPE_VALUE("&rarr;", "\xe2\x87\x92"),
ESCAPE_VALUE("&reg;", "\xc2\xae"),
ESCAPE_VALUE("&rho;", "\xce\xa1"),
ESCAPE_VALUE("&rlm;", "\xe2\x80\x8f"),
ESCAPE_VALUE("&sect;", "\xc2\xa7"),
ESCAPE_VALUE("&shy;", "\xc2\xad"),
ESCAPE_VALUE("&sigma;", "\xce\xa3"),
ESCAPE_VALUE("&sum;", "\xe2\x88\x91"),
ESCAPE_VALUE("&sup1;", "\xc2\xb9"),
ESCAPE_VALUE("&sup2;", "\xc2\xb2"),
ESCAPE_VALUE("&sup3;", "\xc2\xb3"),
ESCAPE_VALUE("&szlig;", "\xc3\x9f"),
ESCAPE_VALUE("&tau;", "\xce\xa4"),
ESCAPE_VALUE("&theta;", "\xce\x98"),
ESCAPE_VALUE("&thorn;", "\xc3\xbe"),
ESCAPE_VALUE("&times;", "\xc3\x97"),
ESCAPE_VALUE("&uacute;", "\xc3\xba"),
ESCAPE_VALUE("&uarr;", "\xe2\x86\x91"),
ESCAPE_VALUE("&ucirc;", "\xc3\xbb"),
ESCAPE_VALUE("&ugrave;", "\xc3\xb9"),
ESCAPE_VALUE("&uml;", "\xc2\xa8"),
ESCAPE_VALUE("&upsilon;", "\xce\xa5"),
ESCAPE_VALUE("&uuml;", "\xc3\xbc"),
ESCAPE_VALUE("&xi;", "\xce\x9e"),
ESCAPE_VALUE("&yacute;", "\xc3\xbd"),
ESCAPE_VALUE("&yen;", "\xc2\xa5"),
ESCAPE_VALUE("&yuml;", "\xc3\xbf"),
ESCAPE_VALUE("&zeta;", "\xce\x96"),
ESCAPE_VALUE("&zwj;", "\xe2\x80\x8d"),
ESCAPE_VALUE("&zwnj;", "\xe2\x80\x8c"),
};
/**
* @internal
* @var escape_values_e_common_sorted[]
* same as escape_values_e_sorted with small subset of common escapes
*/
static const Escape_Value escape_values_e_common_sorted[] = {
ESCAPE_VALUE("&amp;", "\x26"),
ESCAPE_VALUE("&apos;", "\x27"),
ESCAPE_VALUE("&gt;", "\x3e"),
ESCAPE_VALUE("&quot;", "\x22"),
ESCAPE_VALUE("&lt;", "\x3c"),
};
/**
* @internal
* @var escape_values_v_sorted[]
* This array consists of Escape_Value structure sorted by escape value
* And new added value must be placed sorted position, and reflected on escape_values_e_sorted
*/
static const Escape_Value escape_values_v_sorted[] = {
ESCAPE_VALUE("&nbsp;", "\xc2\xa0"),
ESCAPE_VALUE("&iexcl;", "\xc2\xa1"),
ESCAPE_VALUE("&cent;", "\xc2\xa2"),
ESCAPE_VALUE("&pound;", "\xc2\xa3"),
ESCAPE_VALUE("&curren;", "\xc2\xa4"),
ESCAPE_VALUE("&yen;", "\xc2\xa5"),
ESCAPE_VALUE("&brvbar;", "\xc2\xa6"),
ESCAPE_VALUE("&sect;", "\xc2\xa7"),
ESCAPE_VALUE("&uml;", "\xc2\xa8"),
ESCAPE_VALUE("&copy;", "\xc2\xa9"),
ESCAPE_VALUE("&ordf;", "\xc2\xaa"),
ESCAPE_VALUE("&laquo;", "\xc2\xab"),
ESCAPE_VALUE("&not;", "\xc2\xac"),
ESCAPE_VALUE("&shy;", "\xc2\xad"),
ESCAPE_VALUE("&reg;", "\xc2\xae"),
ESCAPE_VALUE("&macr;", "\xc2\xaf"),
ESCAPE_VALUE("&deg;", "\xc2\xb0"),
ESCAPE_VALUE("&plusmn;", "\xc2\xb1"),
ESCAPE_VALUE("&sup2;", "\xc2\xb2"),
ESCAPE_VALUE("&sup3;", "\xc2\xb3"),
ESCAPE_VALUE("&acute;", "\xc2\xb4"),
ESCAPE_VALUE("&micro;", "\xc2\xb5"),
ESCAPE_VALUE("&para;", "\xc2\xb6"),
ESCAPE_VALUE("&middot;", "\xc2\xb7"),
ESCAPE_VALUE("&cedil;", "\xc2\xb8"),
ESCAPE_VALUE("&sup1;", "\xc2\xb9"),
ESCAPE_VALUE("&ordm;", "\xc2\xba"),
ESCAPE_VALUE("&raquo;", "\xc2\xbb"),
ESCAPE_VALUE("&frac14;", "\xc2\xbc"),
ESCAPE_VALUE("&frac12;", "\xc2\xbd"),
ESCAPE_VALUE("&frac34;", "\xc2\xbe"),
ESCAPE_VALUE("&iquest;", "\xc2\xbf"),
ESCAPE_VALUE("&Agrave;", "\xc3\x80"),
ESCAPE_VALUE("&Aacute;", "\xc3\x81"),
ESCAPE_VALUE("&Acirc;", "\xc3\x82"),
ESCAPE_VALUE("&Atilde;", "\xc3\x83"),
ESCAPE_VALUE("&Auml;", "\xc3\x84"),
ESCAPE_VALUE("&Aring;", "\xc3\x85"),
ESCAPE_VALUE("&Aelig;", "\xc3\x86"),
ESCAPE_VALUE("&Ccedil;", "\xc3\x87"),
ESCAPE_VALUE("&Egrave;", "\xc3\x88"),
ESCAPE_VALUE("&Eacute;", "\xc3\x89"),
ESCAPE_VALUE("&Ecirc;", "\xc3\x8a"),
ESCAPE_VALUE("&Euml;", "\xc3\x8b"),
ESCAPE_VALUE("&Igrave;", "\xc3\x8c"),
ESCAPE_VALUE("&Iacute;", "\xc3\x8d"),
ESCAPE_VALUE("&Icirc;", "\xc3\x8e"),
ESCAPE_VALUE("&Iuml;", "\xc3\x8f"),
ESCAPE_VALUE("&Eth;", "\xc3\x90"),
ESCAPE_VALUE("&Ntilde;", "\xc3\x91"),
ESCAPE_VALUE("&Ograve;", "\xc3\x92"),
ESCAPE_VALUE("&Oacute;", "\xc3\x93"),
ESCAPE_VALUE("&Ocirc;", "\xc3\x94"),
ESCAPE_VALUE("&Otilde;", "\xc3\x95"),
ESCAPE_VALUE("&Ouml;", "\xc3\x96"),
ESCAPE_VALUE("&times;", "\xc3\x97"),
ESCAPE_VALUE("&Oslash;", "\xc3\x98"),
ESCAPE_VALUE("&Ugrave;", "\xc3\x99"),
ESCAPE_VALUE("&Uacute;", "\xc3\x9a"),
ESCAPE_VALUE("&Ucirc;", "\xc3\x9b"),
ESCAPE_VALUE("&Yacute;", "\xc3\x9d"),
ESCAPE_VALUE("&Thorn;", "\xc3\x9e"),
ESCAPE_VALUE("&szlig;", "\xc3\x9f"),
ESCAPE_VALUE("&agrave;", "\xc3\xa0"),
ESCAPE_VALUE("&aacute;", "\xc3\xa1"),
ESCAPE_VALUE("&acirc;", "\xc3\xa2"),
ESCAPE_VALUE("&atilde;", "\xc3\xa3"),
ESCAPE_VALUE("&auml;", "\xc3\xa4"),
ESCAPE_VALUE("&aring;", "\xc3\xa5"),
ESCAPE_VALUE("&aelig;", "\xc3\xa6"),
ESCAPE_VALUE("&ccedil;", "\xc3\xa7"),
ESCAPE_VALUE("&egrave;", "\xc3\xa8"),
ESCAPE_VALUE("&eacute;", "\xc3\xa9"),
ESCAPE_VALUE("&ecirc;", "\xc3\xaa"),
ESCAPE_VALUE("&euml;", "\xc3\xab"),
ESCAPE_VALUE("&igrave;", "\xc3\xac"),
ESCAPE_VALUE("&iacute;", "\xc3\xad"),
ESCAPE_VALUE("&icirc;", "\xc3\xae"),
ESCAPE_VALUE("&iuml;", "\xc3\xaf"),
ESCAPE_VALUE("&eth;", "\xc3\xb0"),
ESCAPE_VALUE("&ntilde;", "\xc3\xb1"),
ESCAPE_VALUE("&ograve;", "\xc3\xb2"),
ESCAPE_VALUE("&oacute;", "\xc3\xb3"),
ESCAPE_VALUE("&ocirc;", "\xc3\xb4"),
ESCAPE_VALUE("&otilde;", "\xc3\xb5"),
ESCAPE_VALUE("&ouml;", "\xc3\xb6"),
ESCAPE_VALUE("&divide;", "\xc3\xb7"),
ESCAPE_VALUE("&oslash;", "\xc3\xb8"),
ESCAPE_VALUE("&ugrave;", "\xc3\xb9"),
ESCAPE_VALUE("&uacute;", "\xc3\xba"),
ESCAPE_VALUE("&ucirc;", "\xc3\xbb"),
ESCAPE_VALUE("&uuml;", "\xc3\xbc"),
ESCAPE_VALUE("&yacute;", "\xc3\xbd"),
ESCAPE_VALUE("&thorn;", "\xc3\xbe"),
ESCAPE_VALUE("&yuml;", "\xc3\xbf"),
ESCAPE_VALUE("&alpha;", "\xce\x91"),
ESCAPE_VALUE("&beta;", "\xce\x92"),
ESCAPE_VALUE("&gamma;", "\xce\x93"),
ESCAPE_VALUE("&delta;", "\xce\x94"),
ESCAPE_VALUE("&epsilon;", "\xce\x95"),
ESCAPE_VALUE("&zeta;", "\xce\x96"),
ESCAPE_VALUE("&eta;", "\xce\x97"),
ESCAPE_VALUE("&theta;", "\xce\x98"),
ESCAPE_VALUE("&iota;", "\xce\x99"),
ESCAPE_VALUE("&kappa;", "\xce\x9a"),
ESCAPE_VALUE("&lambda;", "\xce\x9b"),
ESCAPE_VALUE("&mu;", "\xce\x9c"),
ESCAPE_VALUE("&nu;", "\xce\x9d"),
ESCAPE_VALUE("&xi;", "\xce\x9e"),
ESCAPE_VALUE("&omicron;", "\xce\x9f"),
ESCAPE_VALUE("&pi;", "\xce\xa0"),
ESCAPE_VALUE("&rho;", "\xce\xa1"),
ESCAPE_VALUE("&sigma;", "\xce\xa3"),
ESCAPE_VALUE("&tau;", "\xce\xa4"),
ESCAPE_VALUE("&upsilon;", "\xce\xa5"),
ESCAPE_VALUE("&phi;", "\xce\xa6"),
ESCAPE_VALUE("&chi;", "\xce\xa7"),
ESCAPE_VALUE("&psi;", "\xce\xa8"),
ESCAPE_VALUE("&omega;", "\xce\xa9"),
ESCAPE_VALUE("&zwnj;", "\xe2\x80\x8c"),
ESCAPE_VALUE("&zwj;", "\xe2\x80\x8d"),
ESCAPE_VALUE("&lrm;", "\xe2\x80\x8e"),
ESCAPE_VALUE("&rlm;", "\xe2\x80\x8f"),
ESCAPE_VALUE("&dagger;", "\xe2\x80\xa0"),
ESCAPE_VALUE("&Dagger;", "\xe2\x80\xa1"),
ESCAPE_VALUE("&bull;", "\xe2\x80\xa2"),
ESCAPE_VALUE("&hellip;", "\xe2\x80\xa6"),
ESCAPE_VALUE("&euro;", "\xe2\x82\xac"),
ESCAPE_VALUE("&larr;", "\xe2\x86\x90"),
ESCAPE_VALUE("&uarr;", "\xe2\x86\x91"),
ESCAPE_VALUE("&rarr;", "\xe2\x86\x92"),
ESCAPE_VALUE("&darr;", "\xe2\x86\x93"),
ESCAPE_VALUE("&harr;", "\xe2\x86\x94"),
ESCAPE_VALUE("&larr;", "\xe2\x87\x90"),
ESCAPE_VALUE("&rarr;", "\xe2\x87\x92"),
ESCAPE_VALUE("&forall;", "\xe2\x88\x80"),
ESCAPE_VALUE("&exist;", "\xe2\x88\x83"),
ESCAPE_VALUE("&nabla;", "\xe2\x88\x87"),
ESCAPE_VALUE("&prod;", "\xe2\x88\x8f"),
ESCAPE_VALUE("&sum;", "\xe2\x88\x91"),
ESCAPE_VALUE("&and;", "\xe2\x88\xa7"),
ESCAPE_VALUE("&or;", "\xe2\x88\xa8"),
ESCAPE_VALUE("&int;", "\xe2\x88\xab"),
ESCAPE_VALUE("&ne;", "\xe2\x89\xa0"),
ESCAPE_VALUE("&equiv;", "\xe2\x89\xa1"),
ESCAPE_VALUE("&oplus;", "\xe2\x8a\x95"),
ESCAPE_VALUE("&perp;", "\xe2\x8a\xa5"),
};
/**
* @internal
* @var escape_values_v_common_sorted[]
* same as escape_values_v_sorted with small subset of common escapes
*/
static const Escape_Value escape_values_v_common_sorted[] = {
ESCAPE_VALUE("&quot;", "\x22"),
ESCAPE_VALUE("&amp;", "\x26"),
ESCAPE_VALUE("&apos;", "\x27"),
ESCAPE_VALUE("&lt;", "\x3c"),
ESCAPE_VALUE("&gt;", "\x3e"),
};
/**
* @internal
@ -7521,48 +7712,93 @@ _escaped_is_eq_and_advance(const char *s, const char *s_end,
return ((s == s_end) && reached_end);
}
/**
* @internal
*
* @param s the escape string to search for its index
* @param s_len length of s string
* @param escape_values array of Escape_Value to look inside, Sorted by Escape
* @param escape_values_len is the len of Escape_Value array
*/
int _escaped_string_search(const char * s, size_t s_len, const Escape_Value escape_values[], const size_t escape_values_len)
{
int l = 0;
int r = escape_values_len - 1;
while (l <= r)
{
int m = (l + r) / 2;
int res = strncmp(s, escape_values[m].escape, MAX(escape_values[m].escape_len, s_len));
if (res == 0)
{
//Handle special case when s_len is less than escape_len
//then we will continue searching
//example ("&gt;",1,....)
if (escape_values[m].escape_len > s_len)
res = -1;
else if (escape_values[m].escape_len < s_len)
res = 1;
else return m;
}
if (res > 0)
l = m + 1;
else
r = m - 1;
}
return -1;
}
/**
* @internal
*
* @param s the value string to search for its index
* @param escape_values array of Escape_Value to look inside, Sorted by Value
* @param escape_values_len is the len of Escape_Value array
*/
int _escaped_value_search(const char * s, const Escape_Value escape_values[], const size_t escape_values_len)
{
int l = 0;
int r = escape_values_len - 1;
while (l <= r)
{
int m = (l + r) / 2;
int res = strncmp(s, escape_values[m].value, escape_values[m].value_len);
if (res == 0)
return m;
if (res > 0)
l = m + 1;
else
r = m - 1;
}
return -1;
}
/**
* @internal
*
* @param s the string to match
*/
static inline const char *
_escaped_char_match(const char *s, int *adv)
{
const char *map_itr, *map_end, *mc, *sc;
map_itr = escape_strings;
map_end = map_itr + sizeof(escape_strings);
while (map_itr < map_end)
static const size_t escape_common_size = sizeof(escape_values_v_common_sorted) / sizeof(Escape_Value);
int n_ret = _escaped_value_search(s, escape_values_v_common_sorted, escape_common_size);
if (n_ret != -1)
{
const char *escape;
int match;
escape = map_itr;
_escaped_advance_after_end_of_string(&map_itr);
if (map_itr >= map_end) break;
mc = map_itr;
sc = s;
match = 1;
while ((*mc) && (*sc))
*adv = (int) escape_values_v_common_sorted[n_ret].value_len;
return escape_values_v_common_sorted[n_ret].escape;
}
else
{
static const size_t escape_size = sizeof(escape_values_v_sorted) / sizeof(Escape_Value);
n_ret = _escaped_value_search(s, escape_values_v_sorted, escape_size);
if (n_ret != -1)
{
if ((unsigned char)*sc < (unsigned char)*mc) return NULL;
if (*sc != *mc)
{
match = 0;
break;
}
mc++;
sc++;
*adv = (int)escape_values_v_sorted[n_ret].value_len;
return escape_values_v_sorted[n_ret].escape;
}
if (match)
{
*adv = mc - map_itr;
return escape;
}
_escaped_advance_after_end_of_string(&map_itr);
}
return NULL;
}
@ -7617,17 +7853,18 @@ _escaped_char_get(const char *s, const char *s_end)
}
else
{
const char *map_itr, *map_end;
map_itr = escape_strings;
map_end = map_itr + sizeof(escape_strings);
while (map_itr < map_end)
static const size_t escape_common_size = sizeof(escape_values_e_common_sorted) / sizeof(Escape_Value);
int n_ret = _escaped_string_search(s, s_end-s, escape_values_e_common_sorted, escape_common_size);
if (n_ret != -1)
{
if (_escaped_is_eq_and_advance(s, s_end, &map_itr, map_end))
return map_itr;
if (map_itr < map_end)
_escaped_advance_after_end_of_string(&map_itr);
return escape_values_e_common_sorted[n_ret].value;
}
else
{
static const size_t escape_size = sizeof(escape_values_e_sorted) / sizeof(Escape_Value);
n_ret = _escaped_string_search(s, s_end-s, escape_values_e_sorted, escape_size);
if (n_ret != -1)
return escape_values_e_sorted[n_ret].value;
}
}

View File

@ -2467,7 +2467,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
};
Ecore_Evas *
_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name)
_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt, const char *engine_name)
{
Ecore_Wl2_Display *ewd;
Ecore_Wl2_Window *p = (Ecore_Wl2_Window *)parent;
@ -2576,6 +2576,29 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, i
wdata->sync_done = EINA_TRUE;
if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
{
if (opt)
{
int op;
for (op = 0; opt[op]; op++)
{
if (opt[op] == ECORE_EVAS_OPT_GL_DEPTH)
{
op++;
einfo->depth_bits = opt[op];
}
else if (opt[op] == ECORE_EVAS_OPT_GL_STENCIL)
{
op++;
einfo->stencil_bits = opt[op];
}
else if (opt[op] == ECORE_EVAS_OPT_GL_MSAA)
{
op++;
einfo->msaa_bits = opt[op];
}
}
}
einfo->info.destination_alpha = ee_needs_alpha(ee);
einfo->info.rotation = ee->rotation;
einfo->info.depth = 32;

View File

@ -29,13 +29,13 @@
/* external functions */
EAPI Ecore_Evas *
ecore_evas_wayland_egl_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame)
ecore_evas_wayland_egl_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return _ecore_evas_wl_common_new_internal(disp_name, parent,
x, y, w, h, frame,
"wayland_egl");
opt, "wayland_egl");
}
#endif

View File

@ -77,6 +77,7 @@ struct _Ecore_Evas_Engine_Wl_Data
* @param w Width of the Ecore_Evas window to be created.
* @param h Height of the Ecore_Evas window to be created.
* @param frame Deprecated. (Just pass EINA_FALSE.)
* @param opt engine option list
* @param engine_name Wayland engine to use for rendering.
* @return Ecore_Evas instance or @c NULL if creation failed.
*
@ -95,6 +96,6 @@ struct _Ecore_Evas_Engine_Wl_Data
* @see ecore_evas_wayland_shm_new()
* @see ecore_evas_wayland_egl_new()
*/
Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const char *engine_name);
Ecore_Evas *_ecore_evas_wl_common_new_internal(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt, const char *engine_name);
#endif /* _ECORE_EVAS_WAYLAND_PRIVATE_H_ */

View File

@ -35,6 +35,7 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, Ecore_Window parent,
return _ecore_evas_wl_common_new_internal(disp_name, parent,
x, y, w, h, frame,
NULL,
"wayland_shm");
}

View File

@ -3528,7 +3528,6 @@ _ecore_evas_x_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w,
if (!out)
{
norandr:
if (out) free(out);
if (x) *x = 0;
if (y) *y = 0;
ecore_x_window_size_get(root, w, h);

View File

@ -10,7 +10,7 @@ engine_deps = []
evas_include_directories += include_directories('.')
install_headers('Evas_Engine_Buffer.h',
install_dir : dir_package_include,
install_dir : join_paths(dir_include, 'evas-'+version_major),
)
if get_option('evas-modules') == 'shared'

View File

@ -972,16 +972,8 @@ try_again:
config_attrs[n++] = 1;
// FIXME: end n900 breakage
# endif
if (alpha)
{
config_attrs[i++] = EGL_ALPHA_SIZE;
config_attrs[i++] = 1;
}
else
{
config_attrs[i++] = EGL_ALPHA_SIZE;
config_attrs[i++] = 0;
}
config_attrs[i++] = EGL_ALPHA_SIZE;
config_attrs[i++] = (alpha ? 1 : 0);
if (depth_bits)
{

View File

@ -38,7 +38,10 @@ foreach engine_conf : engines
set_variable(var_name, engine_dep)
mod_full_name = engine
mod_install_dir = join_paths(dir_package_modules, 'engines', engine, version_name)
# root meson.build declares the root evas engines project as `evas/engines`,
# but modules must be installed in evas/modules
evas_package_modules = join_paths(dir_lib, 'evas', 'modules')
mod_install_dir = join_paths(evas_package_modules, 'engines', engine, version_name)
subdir(engine)

View File

@ -31,6 +31,11 @@ struct _Evas_Engine_Info_Wayland
int x_cursor, y_cursor;
int resizing;
uint32_t timestamp;
/* window surface should be made with these config */
int depth_bits;
int stencil_bits;
int msaa_bits;
Eina_Bool dragging : 1;
Eina_Bool drag_start : 1;
Eina_Bool drag_stop : 1;

View File

@ -69,7 +69,7 @@ struct _Outbuf
int vsync;
int frame_cnt;
struct
struct
{
Eina_Bool drew : 1;
} draw;
@ -79,6 +79,16 @@ struct _Outbuf
EGLConfig egl_config;
EGLDisplay egl_disp;
struct {
unsigned char depth_buffer_size;
unsigned char stencil_buffer_size;
unsigned char msaa;
} detected;
int depth_bits;
int stencil_bits;
int msaa_bits;
Eina_Bool lost_back : 1;
Eina_Bool surf : 1;
};

View File

@ -15,10 +15,11 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap
int context_attrs[3];
int config_attrs[40];
int major_version, minor_version;
int num_config, n = 0;
int num_config, n;
const GLubyte *vendor, *renderer, *version;
Eina_Bool blacklist = EINA_FALSE;
struct wl_display *wl_disp;
int val = 0;
/* try to allocate space for our window */
if (!(gw = calloc(1, sizeof(Outbuf))))
@ -37,31 +38,14 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap
gw->depth = einfo->info.depth;
gw->alpha = einfo->info.destination_alpha;
gw->rot = einfo->info.rotation;
gw->depth_bits = einfo->depth_bits;
gw->stencil_bits = einfo->stencil_bits;
gw->msaa_bits = einfo->msaa_bits;
context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION;
context_attrs[1] = 2;
context_attrs[2] = EGL_NONE;
config_attrs[n++] = EGL_SURFACE_TYPE;
config_attrs[n++] = EGL_WINDOW_BIT;
config_attrs[n++] = EGL_RENDERABLE_TYPE;
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
config_attrs[n++] = EGL_RED_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_GREEN_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_BLUE_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_ALPHA_SIZE;
config_attrs[n++] = 8 * !!gw->alpha;
config_attrs[n++] = EGL_DEPTH_SIZE;
config_attrs[n++] = 0;
config_attrs[n++] = EGL_STENCIL_SIZE;
config_attrs[n++] = 0;
config_attrs[n++] = EGL_NONE;
/* FIXME: Remove this line as soon as eglGetDisplay() autodetection
* gets fixed. Currently it is incorrectly detecting wl_display and
* returning _EGL_PLATFORM_X11 instead of _EGL_PLATFORM_WAYLAND.
@ -91,11 +75,65 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap
return NULL;
}
try_again:
n = 0;
config_attrs[n++] = EGL_SURFACE_TYPE;
config_attrs[n++] = EGL_WINDOW_BIT;
config_attrs[n++] = EGL_RENDERABLE_TYPE;
config_attrs[n++] = EGL_OPENGL_ES2_BIT;
config_attrs[n++] = EGL_RED_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_GREEN_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_BLUE_SIZE;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_ALPHA_SIZE;
config_attrs[n++] = 8 * !!gw->alpha;
config_attrs[n++] = EGL_DEPTH_SIZE;
config_attrs[n++] = gw->depth_bits;
config_attrs[n++] = EGL_STENCIL_SIZE;
config_attrs[n++] = gw->stencil_bits;
if (gw->msaa_bits > 0)
{
config_attrs[n++] = EGL_SAMPLE_BUFFERS;
config_attrs[n++] = 1;
config_attrs[n++] = EGL_SAMPLES;
config_attrs[n++] = gw->msaa_bits;
}
config_attrs[n++] = EGL_NONE;
num_config = 0;
if (!eglChooseConfig(gw->egl_disp, config_attrs, &gw->egl_config,
1, &num_config) || (num_config != 1))
{
ERR("eglChooseConfig() fail. code=%#x", eglGetError());
if ((gw->depth_bits > 24) || (gw->stencil_bits > 8))
{
WRN("Please note that your driver might not support 32-bit depth or "
"16-bit stencil buffers, so depth24, stencil8 are the maximum "
"recommended values.");
if (gw->depth_bits > 24) gw->depth_bits = 24;
if (gw->stencil_bits > 8) gw->stencil_bits = 8;
DBG("Trying again with depth:%d, stencil:%d", gw->depth_bits, gw->stencil_bits);
goto try_again;
}
else if (gw->msaa_bits)
{
gw->msaa_bits /= 2;
DBG("Trying again with msaa_samples: %d", gw->msaa_bits);
goto try_again;
}
else if (gw->depth_bits || gw->stencil_bits)
{
gw->depth_bits = 0;
gw->stencil_bits = 0;
DBG("Trying again without any depth or stencil buffer");
goto try_again;
}
eng_window_free(gw);
return NULL;
}
@ -149,6 +187,16 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap
return NULL;
}
eglGetConfigAttrib(gw->egl_disp, gw->egl_config, EGL_DEPTH_SIZE, &val);
gw->detected.depth_buffer_size = val;
DBG("Detected depth size %d", val);
eglGetConfigAttrib(gw->egl_disp, gw->egl_config, EGL_STENCIL_SIZE, &val);
gw->detected.stencil_buffer_size = val;
DBG("Detected stencil size %d", val);
eglGetConfigAttrib(gw->egl_disp, gw->egl_config, EGL_SAMPLES, &val);
gw->detected.msaa = val;
DBG("Detected msaa %d", val);
if (!gw->gl_context)
{
eng_gl_symbols(gw->egl_disp);
@ -164,10 +212,11 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Output_Swap
}
if (w && h)
eng_window_resurf(gw);
gw->gl_context->msaa = (Eina_Bool) gw->msaa_bits;
return gw;
}
void
void
eng_window_free(Outbuf *gw)
{
int ref = 0;

View File

@ -76,7 +76,7 @@ evas_image_load_file_head_wbmp(void *loader_data,
/* Wbmp header identifier is too weak....
Here checks size validation whether it's acutal wbmp or not. */
if ((((w * h) + 7) >> 3) + position != length)
if ((((w + 7) >> 3) * h) + position != length)
{
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
goto bail;
@ -138,7 +138,7 @@ evas_image_load_file_data_wbmp(void *loader_data,
/* Wbmp header identifier is too weak....
Here checks size validation whether it's acutal wbmp or not. */
if ((((w * h) + 7) >> 3) + position != length)
if ((((w + 7) >> 3) * h) + position != length)
{
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
goto bail;

View File

@ -94,7 +94,6 @@ _eet_for_ellipse_node(void)
return eet;
}
static inline Eet_Data_Descriptor*
_eet_for_gradient_stops(void)
{
@ -421,8 +420,6 @@ vg_common_svg_node_eet(void)
_eet_style_property_node = _eet_for_style_property();
_eet_matrix3_node = _eet_for_eina_matrix3();
EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "doc", _eet_doc_node);
EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "g", _eet_g_node);
EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "defs", _eet_defs_node);
@ -438,7 +435,6 @@ vg_common_svg_node_eet(void)
EET_DATA_DESCRIPTOR_ADD_UNION(_eet_vg_node, Svg_Node, "node", node, type, eet_union);
EET_DATA_DESCRIPTOR_ADD_LIST(_eet_vg_node, Svg_Node, "child", child, _eet_vg_node);
EET_DATA_DESCRIPTOR_ADD_BASIC(_eet_vg_node, Svg_Node, "id", id, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_SUB(_eet_vg_node, Svg_Node, "style", style, _eet_style_property_node);
@ -964,7 +960,6 @@ _create_gradient_node(Efl_VG *vg)
oom_error:
ERR("OOM: Failed calloc()");
return grad;
}
static void
@ -988,7 +983,6 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg)
if (node->type == SVG_NODE_G) return;
// apply the fill style property
style->fill.fill_rule = efl_gfx_shape_fill_rule_get(vg);
style->fill.paint.none = EINA_FALSE;
@ -1022,8 +1016,6 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg)
style->stroke.cap = efl_gfx_shape_stroke_cap_get(vg);
style->stroke.join = efl_gfx_shape_stroke_join_get(vg);
style->stroke.scale = efl_gfx_shape_stroke_scale_get(vg);
}
static void

View File

@ -67,11 +67,11 @@ efl_mono_suite = executable('efl-mono-suite',
cs_args : extra_cs_args
)
env = environment()
env.set('MONO_PATH', efl_mono_test_suite_path )
env_mono = environment()
env_mono.set('MONO_PATH', efl_mono_test_suite_path )
if (cs_is_dotnet)
env.set('LD_LIBRARY_PATH', efl_mono_test_suite_path )
env_mono.set('LD_LIBRARY_PATH', efl_mono_test_suite_path )
copy_prog = find_program(['cp', 'copy'])
configure_file(input : 'efl-mono-suite.runtimeconfig.json',
@ -108,9 +108,9 @@ foreach config : config_libs
load_lib += repaired_path+':'
endforeach
env.set('LD_LIBRARY_PATH', load_lib)
env_mono.set('LD_LIBRARY_PATH', load_lib)
test('efl-mono-suite',
efl_mono_suite,
env : env
env : env_mono
)

View File

@ -58,7 +58,8 @@ _children_got(Eo *o, void *data EINA_UNUSED, const Eina_Value v)
static Eina_Value
_children_failed(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Error err)
{
ck_abort_msg( "Failed to get the child with '%s'.\n", eina_error_msg_get(err));
if (err != ECANCELED)
ck_abort_msg( "Failed to get the child with '%s'.\n", eina_error_msg_get(err));
return eina_value_error_init(err);
}

View File

@ -252,7 +252,7 @@ EFL_START_TEST (efl_ui_box_layout_update)
{
int i, max_index = (sizeof(hints) / sizeof(Hint));
efl_pack_align_set(layout, 0.8, 0.2);
efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
@ -271,7 +271,7 @@ EFL_START_TEST (efl_ui_box_layout_update_pack)
int i, max_index2, max_index3;
Eo *btn, *btn2, *btn3;
efl_pack_align_set(layout, 0.8, 0.2);
efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2);
@ -502,34 +502,34 @@ EFL_START_TEST (efl_ui_box_properties)
Eina_Bool b;
//align test
efl_pack_align_get(layout, &h, &v);
efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.5));
ck_assert(EINA_DBL_EQ(v, 0.5));
efl_pack_align_set(layout, 0.3, 0.8234);
efl_pack_align_get(layout, &h, &v);
efl_gfx_arrangement_content_align_set(layout, 0.3, 0.8234);
efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
efl_pack_align_set(layout, -0.23, 123);
efl_pack_align_get(layout, &h, &v);
efl_gfx_arrangement_content_align_set(layout, -0.23, 123);
efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, -1));
ck_assert(EINA_DBL_EQ(v, 1));
//padding test
efl_pack_padding_get(layout, &h, &v, &b);
efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.0));
ck_assert(EINA_DBL_EQ(v, 0.0));
ck_assert_int_eq(b, 0);
efl_pack_padding_set(layout, 0.3, 0.8234, 1);
efl_pack_padding_get(layout, &h, &v, &b);
efl_gfx_arrangement_content_padding_set(layout, 0.3, 0.8234, 1);
efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
ck_assert_int_eq(b, 1);
efl_pack_padding_set(layout, -1.23, 123, 45);
efl_pack_padding_get(layout, &h, &v, &b);
efl_gfx_arrangement_content_padding_set(layout, -1.23, 123, 45);
efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0));
ck_assert(EINA_DBL_EQ(v, 123));
ck_assert_int_eq(b, 1);

View File

@ -224,7 +224,7 @@ layout_setup()
win = win_add();
layout = efl_add(EFL_UI_BOX_FLOW_CLASS, win,
efl_pack_align_set(efl_added, 0.8, 0.2),
efl_gfx_arrangement_content_align_set(efl_added, 0.8, 0.2),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
}

View File

@ -133,7 +133,7 @@ layout_setup()
win = win_add();
layout = efl_add(EFL_UI_BOX_STACK_CLASS, win,
efl_pack_align_set(efl_added, 0.8, 0.2),
efl_gfx_arrangement_content_align_set(efl_added, 0.8, 0.2),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
}

View File

@ -292,10 +292,61 @@ EFL_START_TEST (efl_ui_relative_layout_layout_update_chain)
}
EFL_END_TEST
EFL_START_TEST (efl_ui_relative_layout_relation_set)
{
Eo *btn;
Eo *target = NULL;
double relative;
btn = efl_add(EFL_UI_BUTTON_CLASS, layout);
// negative test
efl_ui_relative_layout_relation_top_get(layout, NULL, &target, &relative);
ck_assert_ptr_eq(target, NULL);
ck_assert(EINA_DBL_EQ(relative, 0.0));
efl_ui_relative_layout_relation_top_get(layout, btn, &target, &relative);
ck_assert_ptr_eq(target, NULL);
ck_assert(EINA_DBL_EQ(relative, 0.0));
efl_ui_relative_layout_relation_top_set(layout, NULL, NULL, 0.0);
ck_assert_ptr_eq(target, NULL);
ck_assert(EINA_DBL_EQ(relative, 0.0));
// default value test
efl_ui_relative_layout_relation_top_set(layout, btn, layout, 0.0);
efl_ui_relative_layout_relation_top_get(layout, btn, &target, &relative);
ck_assert_ptr_eq(target, layout);
ck_assert(EINA_DBL_EQ(relative, 0.0));
efl_ui_relative_layout_relation_bottom_get(layout, btn, &target, &relative);
ck_assert_ptr_eq(target, layout);
ck_assert(EINA_DBL_EQ(relative, 1.0));
efl_ui_relative_layout_relation_left_get(layout, btn, &target, &relative);
ck_assert_ptr_eq(target, layout);
ck_assert(EINA_DBL_EQ(relative, 0.0));
efl_ui_relative_layout_relation_right_get(layout, btn, &target, &relative);
ck_assert_ptr_eq(target, layout);
ck_assert(EINA_DBL_EQ(relative, 1.0));
// positive test
efl_ui_relative_layout_relation_top_set(layout, btn, layout, 0.123);
efl_ui_relative_layout_relation_top_get(layout, btn, &target, &relative);
ck_assert_ptr_eq(target, layout);
ck_assert(EINA_DBL_EQ(relative, 0.123));
efl_ui_relative_layout_relation_top_set(layout, btn, NULL, 0.456);
efl_ui_relative_layout_relation_top_get(layout, btn, &target, &relative);
ck_assert_ptr_eq(target, layout);
ck_assert(EINA_DBL_EQ(relative, 0.456));
}
EFL_END_TEST
void efl_ui_test_relative_layout(TCase *tc)
{
tcase_add_checked_fixture(tc, layout_setup, layout_teardown);
tcase_add_test(tc, efl_ui_relative_layout_class_check);
tcase_add_test(tc, efl_ui_relative_layout_layout_update);
tcase_add_test(tc, efl_ui_relative_layout_layout_update_chain);
tcase_add_test(tc, efl_ui_relative_layout_relation_set);
}

View File

@ -279,7 +279,7 @@ EFL_START_TEST (efl_ui_table_layout_update)
{
int i, max_index = (sizeof(hints) / sizeof(Hint));
efl_pack_align_set(layout, 0.8, 0.2);
efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
@ -298,7 +298,7 @@ EFL_START_TEST (efl_ui_table_layout_update_pack)
int i, max_index2, max_index3;
Eo *btn, *btn2, *btn3;
efl_pack_align_set(layout, 0.8, 0.2);
efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2);
@ -337,12 +337,12 @@ EFL_START_TEST (efl_ui_table_layout_update_matrix)
int i, j, max_index = (sizeof(hints_matrix) / sizeof(Hint));
Eo *btn[9];
efl_pack_align_set(layout, 0.8, 0.2);
efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
efl_gfx_hint_margin_set(layout, 10, 10, 20, 20);
efl_ui_table_homogeneous_set(layout, 0, 1);
efl_pack_padding_set(layout, 10, 5, 0);
efl_gfx_arrangement_content_padding_set(layout, 10, 5, 0);
for (i = 0; i < 3; i++)
{
@ -491,34 +491,34 @@ EFL_START_TEST (efl_ui_table_properties)
Efl_Ui_Dir dirh, dirv;
//align test
efl_pack_align_get(layout, &h, &v);
efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.5));
ck_assert(EINA_DBL_EQ(v, 0.5));
efl_pack_align_set(layout, 0.3, 0.8234);
efl_pack_align_get(layout, &h, &v);
efl_gfx_arrangement_content_align_set(layout, 0.3, 0.8234);
efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
efl_pack_align_set(layout, -0.23, 123);
efl_pack_align_get(layout, &h, &v);
efl_gfx_arrangement_content_align_set(layout, -0.23, 123);
efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, -1));
ck_assert(EINA_DBL_EQ(v, 1));
//padding test
efl_pack_padding_get(layout, &h, &v, &b);
efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.0));
ck_assert(EINA_DBL_EQ(v, 0.0));
ck_assert_int_eq(b, 0);
efl_pack_padding_set(layout, 0.3, 0.8234, 1);
efl_pack_padding_get(layout, &h, &v, &b);
efl_gfx_arrangement_content_padding_set(layout, 0.3, 0.8234, 1);
efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
ck_assert_int_eq(b, 1);
efl_pack_padding_set(layout, -1.23, 123, 45);
efl_pack_padding_get(layout, &h, &v, &b);
efl_gfx_arrangement_content_padding_set(layout, -1.23, 123, 45);
efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0));
ck_assert(EINA_DBL_EQ(v, 123));
ck_assert_int_eq(b, 1);

View File

@ -0,0 +1,29 @@
== What is this spec test suite for ? ==
The spec test suite tests code purely against interfaces. There is no specific widget code in the tests; only interface calls are tested.
This is useful for testing the same interface on different implementations.
== Test metadata ==
The test framework is driven by some metadata found at the top of every test file.
There is a C comment at the top of every test file that starts with "spec-meta-start", followed by a json snippet. For instance:
/* spec-meta-start
{"test-interface":"Efl.Pack_Linear",
"test-widgets": ["Efl.Ui.Box", "Efl.Ui.Grid"],
"custom-mapping" : {
"Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS"
}
}
spec-meta-end */
The "test-interface" key specifies the interface being tested.
The "test-widgets" key specifies the widgets where this interface will be tested.
"custom-mapping" is an optional key. Some interface methods might require that an object of a specific type is passed as parameter. With "custom-mapping" you can specify the types of these objects for each widget. The above example instructs the test framework to inject objects of type EFL_UI_GRID_DEFAULT_ITEM_CLASS when testing methods of the Efl.Ui.Grid widget that require an object.
== Adding a widget to a test ==
Just add your widget name to the "test-widgets" array and recompile. Next run of the spec test suite will check if your widget follows the spec of this interface.
== Adding a new test ==
To add a new test you need to create the .c file and include the metadata comment at the top.

View File

@ -6,9 +6,18 @@
#include "efl_ui_spec_suite.h"
#include "suite_helpers.h"
/* spec-meta-start
{"test-interface":"Efl.Content",
"test-widgets": ["Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item",
"Efl.Ui.List_Default_Item", "Efl.Ui.List_Empty_Item",
"Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar",
"Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]}
spec-meta-end */
EFL_START_TEST(content_set_get)
{
Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *w = create_test_widget();
ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE);
ck_assert_ptr_eq(efl_ui_widget_parent_get(w), widget);
@ -23,7 +32,7 @@ EFL_END_TEST
EFL_START_TEST(content_set_get2)
{
Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *w = create_test_widget();
ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE);
ck_assert_ptr_eq(efl_ui_widget_parent_get(w), widget);
@ -37,7 +46,7 @@ EFL_END_TEST
EFL_START_TEST(content_unset)
{
Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *w = create_test_widget();
ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE);
efl_content_unset(widget);
@ -47,7 +56,7 @@ EFL_END_TEST
EFL_START_TEST(content_lifetime1)
{
Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *w1 = create_test_widget();
efl_wref_add(w1, &w1);
ck_assert_int_eq(efl_content_set(widget, w1), EINA_TRUE);
@ -58,7 +67,7 @@ EFL_END_TEST
EFL_START_TEST(content_lifetime2)
{
Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win), *w2 = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *w1 = create_test_widget(), *w2 = create_test_widget();
efl_wref_add(w2, &w2);
efl_wref_add(w1, &w1);
@ -73,7 +82,7 @@ EFL_END_TEST
EFL_START_TEST(content_lifetime3)
{
Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *w1 = create_test_widget();
Eina_Bool content_changed_event = EINA_FALSE;
ck_assert_int_eq(efl_content_set(widget, w1), EINA_TRUE);
@ -86,7 +95,7 @@ EFL_END_TEST
EFL_START_TEST(content_event)
{
Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win), *w2 = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *w1 = create_test_widget(), *w2 = create_test_widget();
Eina_Bool content_changed_event;
content_changed_event = EINA_FALSE;

View File

@ -0,0 +1,61 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Efl_Ui.h>
#include "efl_ui_spec_suite.h"
#include "suite_helpers.h"
/* spec-meta-start
{"test-interface":"Efl.Gfx.Arrangement",
"test-widgets": ["Efl.Ui.Box", "Efl.Ui.Table"]}
spec-meta-end */
EFL_START_TEST(pack_align)
{
#define TUPLE_CHECK(H,V,rh,rv) \
do { \
double v, h; \
efl_gfx_arrangement_content_align_set(widget, H, V); \
efl_gfx_arrangement_content_align_get(widget, &h, &v); \
ck_assert(v == rv); \
ck_assert(h == rh); \
} while(0);
TUPLE_CHECK( 1.0, 1.0, 1.0, 1.0);
TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0);
TUPLE_CHECK(- 1.0, - 1.0, -1.0, -1.0);
TUPLE_CHECK(-42.0, -42.0, -1.0, -1.0);
TUPLE_CHECK( 42.0, 42.0, 1.0, 1.0);
TUPLE_CHECK(-42.0, 42.0, -1.0, 1.0);
TUPLE_CHECK( 42.0, -42.0, 1.0, -1.0);
#undef TUPLE_CHECK
}
EFL_END_TEST
EFL_START_TEST(pack_padding)
{
#define TUPLE_CHECK(H, V, rh, rv, S, rs) \
do { \
double v, h; \
Eina_Bool r; \
efl_gfx_arrangement_content_padding_set(widget, H, V, S); \
efl_gfx_arrangement_content_padding_get(widget, &h, &v, &r); \
ck_assert(v == rv); \
ck_assert(h == rh); \
ck_assert_int_eq(r, S); \
} while(0);
TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0, EINA_TRUE, EINA_TRUE);
TUPLE_CHECK( -1.0, -123.0, 0.0, 0.0, EINA_FALSE, EINA_FALSE);
TUPLE_CHECK( -1.0, 123.0, 0.0, 123.0, EINA_FALSE, EINA_FALSE);
#undef TUPLE_CHECK
}
EFL_END_TEST
void
efl_gfx_arrangement_behavior_test(TCase *tc)
{
tcase_add_test(tc, pack_align);
tcase_add_test(tc, pack_padding);
}

View File

@ -6,6 +6,12 @@
#include "efl_ui_spec_suite.h"
#include "suite_helpers.h"
/* spec-meta-start
{"test-interface":"Efl.Pack",
"test-widgets": ["Efl.Ui.Table"]}
spec-meta-end */
/*
In general:
- If a subobject is deleted the box simply forgets about it. Never return this element again container.
@ -25,7 +31,7 @@ _setup_std_pack(Efl_Ui_Widget *wid[3])
for (i = 0; i < 3; ++i)
{
wid[i] = efl_add(WIDGET_CLASS, widget);
wid[i] = create_test_widget();
ck_assert_int_eq(efl_pack(widget, wid[i]), EINA_TRUE);
efl_gfx_entity_visible_set(widget, EINA_TRUE);
}
@ -156,7 +162,7 @@ EFL_START_TEST(unpack3)
Efl_Ui_Widget *wid[3], *invalid;
_setup_std_pack(wid);
invalid = efl_add(WIDGET_CLASS, win);
invalid = create_test_widget();
ck_assert_int_eq(efl_pack_unpack(widget, wid[2]), EINA_TRUE);
EXPECT_ERROR_START;
ck_assert_int_eq(efl_pack_unpack(widget, wid[2]), EINA_FALSE);
@ -229,52 +235,10 @@ EFL_START_TEST(pack3)
}
EFL_END_TEST
EFL_START_TEST(pack_align)
{
#define TUPLE_CHECK(H,V,rh,rv) \
do { \
double v, h; \
efl_pack_align_set(widget, H, V); \
efl_pack_align_get(widget, &h, &v); \
ck_assert(v == rv); \
ck_assert(h == rh); \
} while(0);
TUPLE_CHECK( 1.0, 1.0, 1.0, 1.0);
TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0);
TUPLE_CHECK(- 1.0, - 1.0, -1.0, -1.0);
TUPLE_CHECK(-42.0, -42.0, -1.0, -1.0);
TUPLE_CHECK( 42.0, 42.0, 1.0, 1.0);
TUPLE_CHECK(-42.0, 42.0, -1.0, 1.0);
TUPLE_CHECK( 42.0, -42.0, 1.0, -1.0);
#undef TUPLE_CHECK
}
EFL_END_TEST
EFL_START_TEST(pack_padding)
{
#define TUPLE_CHECK(H, V, rh, rv, S, rs) \
do { \
double v, h; \
Eina_Bool r; \
efl_pack_padding_set(widget, H, V, S); \
efl_pack_padding_get(widget, &h, &v, &r); \
ck_assert(v == rv); \
ck_assert(h == rh); \
ck_assert_int_eq(r, S); \
} while(0);
TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0, EINA_TRUE, EINA_TRUE);
TUPLE_CHECK( -1.0, -123.0, 0.0, 0.0, EINA_FALSE, EINA_FALSE);
TUPLE_CHECK( -1.0, 123.0, 0.0, 123.0, EINA_FALSE, EINA_FALSE);
#undef TUPLE_CHECK
}
EFL_END_TEST
EFL_START_TEST(evt_content_added)
{
Eina_Bool called = EINA_TRUE;
Efl_Ui_Widget *wid = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *wid = create_test_widget();
efl_test_container_expect_evt_content_added(widget, EFL_CONTAINER_EVENT_CONTENT_ADDED, &called, wid);
efl_pack(widget, wid);
ck_assert_int_eq(called, EINA_TRUE);
@ -339,8 +303,6 @@ efl_pack_behavior_test(TCase *tc)
tcase_add_test(tc, pack1);
tcase_add_test(tc, pack2);
tcase_add_test(tc, pack3);
tcase_add_test(tc, pack_align);
tcase_add_test(tc, pack_padding);
tcase_add_test(tc, evt_content_added);
tcase_add_test(tc, evt_content_removed);
tcase_add_test(tc, child_killed);

View File

@ -7,12 +7,21 @@
#include "suite_helpers.h"
#include <limits.h>
/* spec-meta-start
{"test-interface":"Efl.Pack_Linear",
"test-widgets": ["Efl.Ui.Box", "Efl.Ui.Grid"],
"custom-mapping" : {
"Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS"
}
}
spec-meta-end */
static void
_fill_array(Efl_Ui_Widget *wid[3])
{
for (int i = 0; i < 3; ++i)
{
wid[i] = efl_add(WIDGET_CLASS, win);
wid[i] = create_test_widget();
}
}
@ -29,7 +38,7 @@ _ordering_equals(Efl_Ui_Widget **wid, unsigned int len)
EFL_START_TEST(pack_begin1)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
_fill_array(wid);
@ -68,7 +77,7 @@ EFL_END_TEST
EFL_START_TEST(pack_end1)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
_fill_array(wid);
@ -108,7 +117,7 @@ EFL_END_TEST
EFL_START_TEST(pack_before1)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
_fill_array(wid);
@ -131,7 +140,7 @@ EFL_END_TEST
EFL_START_TEST(pack_before2)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
_fill_array(wid);
@ -152,7 +161,7 @@ EFL_END_TEST
EFL_START_TEST(pack_after1)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
_fill_array(wid);
@ -175,7 +184,7 @@ EFL_END_TEST
EFL_START_TEST(pack_after2)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
_fill_array(wid);
@ -198,7 +207,7 @@ EFL_START_TEST(pack_at1)
for (int x = -3; x < 3; ++x)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
unsigned int i;
_fill_array(wid);
@ -229,7 +238,7 @@ EFL_START_TEST(pack_at2)
for (int x = -3; x < 3; ++x)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
unsigned int i;
_fill_array(wid);
@ -263,8 +272,8 @@ EFL_END_TEST
EFL_START_TEST(pack_at3)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv2 = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
Efl_Ui_Widget *inv2 = create_test_widget();
_fill_array(wid);
for (int i = 0; i < 3; i++)
@ -303,7 +312,7 @@ EFL_END_TEST
EFL_START_TEST(pack_index_get1)
{
Efl_Ui_Widget *wid[3];
Efl_Ui_Widget *inv = efl_add(WIDGET_CLASS, win);
Efl_Ui_Widget *inv = create_test_widget();
_fill_array(wid);
for (int i = 0; i < 3; i++)

View File

@ -10,9 +10,8 @@
Evas_Object *win = NULL;
Evas_Object *widget = NULL;
const Efl_Class *test_content_klass = NULL;
EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS);
static int tree_abort;
static int tree_abort_level;
@ -33,11 +32,12 @@ _setup(void)
}
static void
_setup_window_and_widget(const Efl_Class *klass)
_setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass)
{
ck_assert(!win);
ck_assert(!widget);
test_content_klass = content_klass;
win = win_add();
widget = efl_add(klass, win);
efl_content_set(win, widget);
@ -46,6 +46,14 @@ _setup_window_and_widget(const Efl_Class *klass)
ck_assert(widget);
}
Eo*
create_test_widget(void)
{
Eo *ret = efl_add(test_content_klass, win);
return ret;
}
#include "efl_ui_spec_suite_gen.x"
int
main(int argc, char **argv)

View File

@ -13,10 +13,13 @@ extern Evas_Object *widget;
void efl_pack_behavior_test(TCase *tc);
void efl_pack_linear_behavior_test(TCase *tc);
void efl_content_behavior_test(TCase *tc);
void efl_gfx_arrangement_behavior_test(TCase *tc);
void efl_test_container_content_equal(Efl_Ui_Widget **wid, unsigned int len);
void efl_test_container_expect_evt_content_added(Efl_Ui_Widget *widget, const Efl_Event_Description *ev, Eina_Bool *flag, void *event_data);
Eo* create_test_widget(void);
Evas_Object * win_add();
const Efl_Class* efl_ui_widget_realized_class_get(void);

View File

@ -1,19 +1,10 @@
#!/usr/bin/python
tests = [
["Efl.Pack_Linear" , "Efl.Ui.Box"],
["Efl.Pack" , "Efl.Ui.Table"],
["Efl.Content" , "Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item",
"Efl.Ui.List_Default_Item", "Efl.Ui.List_Empty_Item",
"Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar",
"Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]
]
fixture_gen_template = """
static void
_{}_fixture(void)
{{
_setup_window_and_widget({});
_setup_window_and_widget({}, {});
}}
"""
@ -37,7 +28,10 @@ file_gen_template = """
"""
import sys
import json
output_file = sys.argv[-1]
input_files = sys.argv[1:-1]
list_of_tcases = "static const Efl_Test_Case etc[] = {\n"
list_entry = " {{ \"{}-{}\", {}}},\n"
generated_api = ""
@ -51,21 +45,44 @@ def to_func_name(class_name):
def to_class_getter(class_name):
return class_name.replace('.','_').upper()+'_CLASS'
tests = []
for input_file in input_files:
with open(input_file, 'r') as content_file:
content = content_file.read()
start = content.index('spec-meta-start') + len('spec-meta-start')
end = content.index('spec-meta-end')
resulting_json = content[start:end]
tmp = json.loads(resulting_json)
if "test-interface" in tmp and "test-widgets" in tmp:
tests.append(tmp)
widgets = []
widget_hitmap = []
for test in tests:
interface_test = to_func_name(test[0])
for widget_class in test[1:]:
interface_test = to_func_name(test["test-interface"])
if "custom-mapping" in test:
custom_mapping = test["custom-mapping"]
else:
custom_mapping = {}
for widget_class in test["test-widgets"]:
if widget_class in custom_mapping:
widget_test_klass = custom_mapping[widget_class]
else:
widget_test_klass = "WIDGET_CLASS"
combo_name = "_{}_{}".format(to_func_name(interface_test), to_func_name(widget_class));
combo_klass_test_name = "{}_{}".format(to_func_name(widget_class), to_func_name(widget_test_klass))
list_of_tcases += list_entry.format(interface_test, to_func_name(widget_class), combo_name)
generated_api += tcase_gen_template.format(combo_name, to_func_name(widget_class), interface_to_api(interface_test))
if widget_class not in widgets:
widgets += [widget_class]
generated_api += tcase_gen_template.format(combo_name, combo_klass_test_name, interface_to_api(interface_test))
if combo_klass_test_name not in widget_hitmap:
widgets += [{ "widget" : widget_class, "test-class" : widget_test_klass, "combo-name" : combo_klass_test_name}]
widget_hitmap += [combo_klass_test_name]
for widget in widgets:
generated_api = fixture_gen_template.format(to_func_name(widget), to_class_getter(widget)) + generated_api
generated_api = fixture_gen_template.format(widget["combo-name"], to_class_getter(widget["widget"]), widget["test-class"]) + generated_api
list_of_tcases += " { NULL, NULL }\n};"
output = open(sys.argv[1], "w")
output = open(output_file, "w")
output.write(file_gen_template.format(list_of_tcases, generated_api))

View File

@ -1,19 +1,25 @@
efl_ui_suite_behavior_src = [
efl_ui_suite_behavior_test_files = files([
'efl_test_pack.c',
'efl_test_pack_linear.c',
'efl_test_content.c',
'efl_test_gfx_arrangement.c'
])
efl_ui_suite_behavior_src = files([
join_paths('..','suite_helpers.c'),
join_paths('..','suite_helpers.h'),
join_paths('..','elm_test_init.c'),
'efl_ui_spec_suite.c',
'efl_test_pack.c',
'efl_test_pack_linear.c',
'efl_test_container.c',
'efl_test_content.c',
]
]) + efl_ui_suite_behavior_test_files
test_generator = find_program('generator.py')
generated_test_parts = custom_target('generate_test_suite',
input: efl_ui_suite_behavior_test_files,
output: 'efl_ui_spec_suite_gen.x',
command: [test_generator, '@OUTPUT@'],
command: [test_generator, '@INPUT@', '@OUTPUT@'],
)
efl_ui_behavior_suite = executable('efl_ui_spec_suite',