cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=595ae821babb0dee8975987849e64de06b1fee40
commit 595ae821babb0dee8975987849e64de06b1fee40 Author: Andrii Kroitor <an.kroi...@samsung.com> Date: Mon Nov 7 14:42:04 2016 -0800 elm_layout: add mmap support Reviewers: cedric, Hermet, raster, NikaWhite Subscribers: jpeg, reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D4379 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/lib/elementary/elm_layout.c | 44 ++++++++++++++++++++++++++++++++++ src/lib/elementary/elm_layout.eo | 2 ++ src/lib/elementary/elm_layout_legacy.h | 26 ++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c index 729563c..b5d2f56 100644 --- a/src/lib/elementary/elm_layout.c +++ b/src/lib/elementary/elm_layout.c @@ -875,6 +875,38 @@ _elm_layout_efl_file_file_get(Eo *obj, Elm_Layout_Smart_Data *sd EINA_UNUSED, co edje_object_file_get(wd->resize_obj, file, group); } + +EOLIAN static Eina_Bool +_elm_layout_efl_file_mmap_set(Eo *obj, Elm_Layout_Smart_Data *sd, const Eina_File *file, const char *group) +{ + Eina_Bool int_ret = EINA_FALSE; + + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); + + int_ret = + edje_object_mmap_set(wd->resize_obj, file, group); + + if (int_ret) + { + sd->file_set = EINA_TRUE; + _visuals_refresh(obj, sd); + } + else + ERR("failed to set edje mmap file %p, group '%s': %s", + file, group, + edje_load_error_str + (edje_object_load_error_get(wd->resize_obj))); + + return int_ret; +} + +EOLIAN static void +_elm_layout_efl_file_mmap_get(Eo *obj, Elm_Layout_Smart_Data *sd EINA_UNUSED, const Eina_File **file, const char **group) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + efl_file_mmap_get(wd->resize_obj, file, group); +} + EOLIAN static Eina_Bool _elm_layout_theme_set(Eo *obj, Elm_Layout_Smart_Data *sd, const char *klass, const char *group, const char *style) { @@ -1906,6 +1938,18 @@ elm_layout_file_get(Eo *obj, const char **file, const char **group) } EAPI Eina_Bool +elm_layout_mmap_set(Eo *obj, const Eina_File *file, const char *group) +{ + return efl_file_mmap_set((Eo *) obj, file, group); +} + +EAPI void +elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group) +{ + efl_file_mmap_get((Eo *) obj, file, group); +} + +EAPI Eina_Bool elm_layout_box_append(Elm_Layout *obj, const char *part, Evas_Object *child) { return efl_pack(efl_part(obj, part), child); diff --git a/src/lib/elementary/elm_layout.eo b/src/lib/elementary/elm_layout.eo index 3901ec3..c95d84f 100644 --- a/src/lib/elementary/elm_layout.eo +++ b/src/lib/elementary/elm_layout.eo @@ -331,6 +331,8 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File) Efl.Object.dbg_info_get; Efl.File.file.set; Efl.File.file.get; + Efl.File.mmap.set; + Efl.File.mmap.get; Efl.Canvas.Group.group_del; Efl.Canvas.Group.group_add; Efl.Canvas.Group.group_calculate; diff --git a/src/lib/elementary/elm_layout_legacy.h b/src/lib/elementary/elm_layout_legacy.h index ade2fc6..c9654d2 100644 --- a/src/lib/elementary/elm_layout_legacy.h +++ b/src/lib/elementary/elm_layout_legacy.h @@ -102,6 +102,32 @@ EAPI Eina_Bool elm_layout_file_set(Eo *obj, const char *file, const char *group) EAPI void elm_layout_file_get(Eo *obj, const char **file, const char **group); /** + * Set the mmap file that will be used as layout + * + * @return (1 = success, 0 = error) + * + * @ingroup Elm_Layout + * + * @param[in] file Eina_File (edj) that will be used as layout + * @param[in] group The group that the layout belongs in edje file + * + * @since 1.19 + */ +EAPI Eina_Bool elm_layout_mmap_set(Eo *obj, const Eina_File *file, const char *group); + +/** + * Get the loaded mmap file + * + * @ingroup Elm_Layout + * + * @param file Eina_File (edj) used as layout + * @param group The group that the layout belongs in edje file + * + * @since 1.19 + */ +EAPI void elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group); + +/** * @brief Append child to layout box part. * * Once the object is appended, it will become child of the layout. Its --