efl_ui_layout: add API to check out the theme_version

this new API returns the theme version specified in the loaded theme.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10944
This commit is contained in:
Marcel Hollerbach 2019-12-20 16:13:58 +01:00 committed by Cedric BAIL
parent b9818f566c
commit 193ae1c14c
3 changed files with 33 additions and 0 deletions

View File

@ -645,6 +645,12 @@ _efl_ui_layout_base_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
return EFL_UI_THEME_APPLY_ERROR_NONE;
}
EOLIAN static int
_efl_ui_layout_base_theme_version_get(const Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *pd)
{
return pd->version;
}
EOLIAN static Eina_Bool
_efl_ui_layout_base_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Layout_Data *_pd EINA_UNUSED)
{

View File

@ -87,6 +87,22 @@ abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container,
orientation : int; [[The new rotation angle, in degrees.]]
}
}
@property theme_version {
[[The version a theme does offer
A theme might offer older theme versions, with this property you can detect which version is running. The theme version is bound to the efl-version, the oldest version you will get here is 123. The newest of released EFL.
This property is only valid after @Efl.Ui.Widget.theme_apply has been called.
In case there is no version specified, 0 is returned.
]]
get {
}
values {
version : int; [[Theme version of this objec, for a EFL version called 1.23, this property will return 123.]]
}
}
}
implements {
class.constructor;

View File

@ -208,6 +208,16 @@ EFL_START_TEST(efl_ui_layout_test_api_ordering)
}
EFL_END_TEST
EFL_START_TEST(efl_ui_layout_test_versioning)
{
Evas_Object *win;
win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
Eo *layout = efl_add(EFL_UI_BUTTON_CLASS, win);
ck_assert_int_eq(efl_ui_layout_theme_version_get(layout), 123);
}
EFL_END_TEST
void efl_ui_test_layout(TCase *tc)
{
tcase_add_test(tc, efl_ui_layout_test_property_bind);
@ -218,4 +228,5 @@ void efl_ui_test_layout(TCase *tc)
tcase_add_test(tc, efl_ui_layout_test_api_ordering);
tcase_add_test(tc, efl_ui_layout_test_callback);
tcase_add_test(tc, efl_ui_layout_test_property_bind_provider);
tcase_add_test(tc, efl_ui_layout_test_versioning);
}