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 <cedric@osg.samsung.com>
This commit is contained in:
Andrii Kroitor 2016-11-07 14:42:04 -08:00 committed by Cedric BAIL
parent b56e508224
commit 595ae821ba
3 changed files with 72 additions and 0 deletions

View File

@ -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)
{
@ -1905,6 +1937,18 @@ elm_layout_file_get(Eo *obj, const char **file, const char **group)
efl_file_get((Eo *) obj, file, 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)
{

View File

@ -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;

View File

@ -101,6 +101,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.
*