elm_layout: add mmap support 77/95977/2 accepted/tizen/3.0/common/20161114.081808 accepted/tizen/3.0/ivi/20161110.020056 accepted/tizen/3.0/mobile/20161110.015850 accepted/tizen/3.0/tv/20161110.020005 accepted/tizen/3.0/wearable/20161110.020032 submit/tizen_3.0/20161108.053850 submit/tizen_3.0_common/20161110.084657
authorAndrii Kroitor <an.kroitor@samsung.com>
Fri, 4 Nov 2016 11:42:41 +0000 (13:42 +0200)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 8 Nov 2016 01:46:30 +0000 (10:46 +0900)
Reviewers: cedric, Hermet, NikaWhite, raster

Subscribers: jpeg, reutskiy.v.v

Differential Revision: https://phab.enlightenment.org/D4379

Change-Id: I4eae5fb8bb7bedc6a44fe2b396719d3360aa9e16
Signed-off-by: Mykyta Biliavskyi <m.biliavskyi@samsung.com>
src/lib/elm_layout.c
src/lib/elm_layout.eo
src/lib/elm_layout_legacy.h

index 8743ebd..ba722b1 100644 (file)
@@ -881,6 +881,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);
+   eo_do((Eo *) wd->resize_obj, efl_file_mmap_get(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)
 {
@@ -1804,4 +1836,16 @@ elm_layout_file_get(Eo *obj, const char **file, const char **group)
    eo_do((Eo *) obj, efl_file_get(file, group));
 }
 
+EAPI Eina_Bool
+elm_layout_mmap_set(Eo *obj, const Eina_File *file, const char *group)
+{
+   Eina_Bool ret;
+   return eo_do_ret((Eo *) obj, ret, efl_file_mmap_set(file, group));
+}
+
+EAPI void
+elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group)
+{
+   eo_do((Eo *) obj, efl_file_mmap_get(file, group));
+}
 #include "elm_layout.eo.c"
index b3034a2..ea10e53 100644 (file)
@@ -586,6 +586,8 @@ class Elm.Layout (Elm.Container, Efl.File)
       Eo.Base.dbg_info_get;
       Efl.File.file.set;
       Efl.File.file.get;
+      Efl.File.mmap.set;
+      Efl.File.mmap.get;
       Evas.Object_Smart.del;
       Evas.Object_Smart.add;
       Evas.Object_Smart.calculate;
index 1f01724..357faf4 100644 (file)
@@ -129,4 +129,34 @@ 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
+ *
+ * @if MOBILE @since_tizen 3.0
+ * @elseif WEARABLE @since_tizen 3.0
+ * @endif
+ */
+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
+ *
+ * @if MOBILE @since_tizen 3.0
+ * @elseif WEARABLE @since_tizen 3.0
+ * @endif
+ */
+EAPI void elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group);
+
 #include "elm_layout.eo.legacy.h"