elm_conform: fix backward compatibility issue.
authorHosang Kim <hosang12.kim@samsung.com>
Tue, 26 May 2020 11:13:49 +0000 (20:13 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 1 Jun 2020 04:46:28 +0000 (13:46 +0900)
In Tizen 4.0, elm_conformant inheritted elm_layout, but elm_conformant
inheritted efl_ui_layout_base now. So elm_layout_file_set is not working
for elm_conformant.
elm_conformant inherits efl_file to fix backward compatibility.

Change-Id: If503eb709577902f13ab71e6e1dfb2c1f0507984

src/lib/elementary/elm_conform.c
src/lib/elementary/elm_conformant_eo.c

index aa034fa..bf4067d 100644 (file)
@@ -1765,6 +1765,68 @@ _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd)
    return obj;
 }
 
+EOLIAN static Eina_Error
+_elm_conformant_efl_file_file_set(Eo *obj, Elm_Conformant_Data *pd EINA_UNUSED, const char *file)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC);
+   return efl_file_set(wd->resize_obj, file);
+}
+
+EOLIAN static const char *
+_elm_conformant_efl_file_file_get(const Eo *obj, Elm_Conformant_Data *pd EINA_UNUSED)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+   return efl_file_get(wd->resize_obj);
+}
+
+EOLIAN static void
+_elm_conformant_efl_file_key_set(Eo *obj, Elm_Conformant_Data *pd EINA_UNUSED, const char *key)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+   return efl_file_key_set(wd->resize_obj, key);
+}
+
+EOLIAN static const char *
+_elm_conformant_efl_file_key_get(const Eo *obj, Elm_Conformant_Data *pd EINA_UNUSED)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+   return efl_file_key_get(wd->resize_obj);
+}
+
+EOLIAN static Eina_Error
+_elm_conformant_efl_file_mmap_set(Eo *obj, Elm_Conformant_Data *pd EINA_UNUSED, const Eina_File *file)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+   return efl_file_mmap_set(wd->resize_obj, file);
+}
+
+EOLIAN static const Eina_File *
+_elm_conformant_efl_file_mmap_get(const Eo *obj, Elm_Conformant_Data *pd EINA_UNUSED)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+   return efl_file_mmap_get(wd->resize_obj);
+}
+
+EOLIAN static Eina_Error
+_elm_conformant_efl_file_load(Eo *obj, Elm_Conformant_Data *sd)
+{
+   Eina_Error err;
+
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+   if (efl_file_loaded_get(obj)) return 0;
+   err = efl_file_load(wd->resize_obj);
+
+   return err;
+}
+
+EOLIAN static void
+_elm_conformant_efl_file_unload(Eo *obj, Elm_Conformant_Data *pd EINA_UNUSED)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+   efl_file_unload(wd->resize_obj);
+}
+
 static void
 _elm_conformant_class_constructor(Efl_Class *klass)
 {
index 63820d9..bce9672 100644 (file)
@@ -15,6 +15,30 @@ Eina_Error _elm_conformant_efl_ui_widget_theme_apply(Eo *obj, Elm_Conformant_Dat
 void _elm_conformant_efl_ui_widget_screen_reader(Eo *obj, Elm_Conformant_Data *pd, Eina_Bool is_screen_reader);
 
 
+Eina_Error _elm_conformant_efl_file_file_set(Eo *obj, Elm_Conformant_Data *pd, const char *file);
+
+
+const char *_elm_conformant_efl_file_file_get(const Eo *obj, Elm_Conformant_Data *pd);
+
+
+void _elm_conformant_efl_file_key_set(Eo *obj, Elm_Conformant_Data *pd, const char *key);
+
+
+const char *_elm_conformant_efl_file_key_get(const Eo *obj, Elm_Conformant_Data *pd);
+
+
+Eina_Error _elm_conformant_efl_file_mmap_set(Eo *obj, Elm_Conformant_Data *pd, const Eina_File *f);
+
+
+const Eina_File *_elm_conformant_efl_file_mmap_get(const Eo *obj, Elm_Conformant_Data *pd);
+
+
+Eina_Error _elm_conformant_efl_file_load(Eo *obj, Elm_Conformant_Data *pd);
+
+
+void _elm_conformant_efl_file_unload(Eo *obj, Elm_Conformant_Data *pd);
+
+
 static Eina_Bool
 _elm_conformant_class_initializer(Efl_Class *klass)
 {
@@ -30,6 +54,14 @@ _elm_conformant_class_initializer(Efl_Class *klass)
       EFL_OBJECT_OP_FUNC(efl_constructor, _elm_conformant_efl_object_constructor),
       EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_conformant_efl_ui_widget_theme_apply),
       EFL_OBJECT_OP_FUNC(efl_ui_widget_screen_reader, _elm_conformant_efl_ui_widget_screen_reader),
+      EFL_OBJECT_OP_FUNC(efl_file_set, _elm_conformant_efl_file_file_set),
+      EFL_OBJECT_OP_FUNC(efl_file_get, _elm_conformant_efl_file_file_get),
+      EFL_OBJECT_OP_FUNC(efl_file_key_set, _elm_conformant_efl_file_key_set),
+      EFL_OBJECT_OP_FUNC(efl_file_key_get, _elm_conformant_efl_file_key_get),
+      EFL_OBJECT_OP_FUNC(efl_file_mmap_set, _elm_conformant_efl_file_mmap_set),
+      EFL_OBJECT_OP_FUNC(efl_file_mmap_get, _elm_conformant_efl_file_mmap_get),
+      EFL_OBJECT_OP_FUNC(efl_file_load, _elm_conformant_efl_file_load),
+      EFL_OBJECT_OP_FUNC(efl_file_unload, _elm_conformant_efl_file_unload),
       ELM_CONFORMANT_EXTRA_OPS
    );
    opsp = &ops;