summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_canvas3d_mesh.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:10 -0500
commit6326e18b3fb2a4757f8ffa22be5d55a75da23049 (patch)
tree31d586b52638aa0d0b1c759869a8e3368c9daf5d /src/lib/evas/canvas/evas_canvas3d_mesh.c
parent7924660d54500285d3844bfa384394c683825cd9 (diff)
efl.file: improve api a bit
Summary: the previous implementation/api had a number of issues: * "file" property contained both "file" and "key" values - also performed file loading operation * "load_error" property which was specific to image objects * no methods for controlling file loading/unloading this patch attempts the following changes: * split "file" property into "file" and "key" properties - also remove "key" from existing "mmap" property * remove "load_error" * directly return error codes from operations * add "load" and "unload" methods for directly controlling load state * add implicit file loading if file/mmap is set during construction * rewrite all efl.file implementations to move file loading into load() method * rewrite all usage of efl.file api based on these changes * add C extension functions to mimic previous behavior ref T7577 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: vitor.sousa, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7577 Differential Revision: https://phab.enlightenment.org/D8018
Diffstat (limited to 'src/lib/evas/canvas/evas_canvas3d_mesh.c')
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_mesh.c47
1 files changed, 12 insertions, 35 deletions
diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.c b/src/lib/evas/canvas/evas_canvas3d_mesh.c
index d91feaf..ccac776 100644
--- a/src/lib/evas/canvas/evas_canvas3d_mesh.c
+++ b/src/lib/evas/canvas/evas_canvas3d_mesh.c
@@ -861,49 +861,26 @@ _evas_canvas3d_mesh_alpha_test_enable_get(const Eo *obj EINA_UNUSED, Evas_Canvas
861 return pd->alpha_test_enabled; 861 return pd->alpha_test_enabled;
862} 862}
863 863
864EOLIAN static Eina_Bool 864EOLIAN static Eina_Error
865_evas_canvas3d_mesh_efl_file_mmap_set(Eo *obj, 865_evas_canvas3d_mesh_efl_file_load(Eo *obj, Evas_Canvas3D_Mesh_Data *pd)
866 Evas_Canvas3D_Mesh_Data *pd,
867 const Eina_File *f, const char *key EINA_UNUSED)
868{ 866{
869 _mesh_fini(pd); 867 const Eina_File *f;
870 _mesh_init(pd); 868 Eina_Error err;
871
872 if (f == NULL) return EINA_FALSE;
873
874 evas_common_load_model_from_eina_file(obj, f);
875
876 return EINA_TRUE;
877}
878 869
879EOLIAN void 870 if (efl_file_loaded_get(obj)) return 0;
880_evas_canvas3d_mesh_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *sd EINA_UNUSED, const Eina_File **file, const char **group)
881{
882 ERR("this function is not available for this object");
883 if (file) *file = NULL;
884 if (group) *group = NULL;
885}
886 871
887EOLIAN void 872 err = efl_file_load(efl_super(obj, MY_CLASS));
888_evas_canvas3d_mesh_efl_file_file_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh_Data *sd EINA_UNUSED, const char **file, const char **key) 873 if (err) return err;
889{
890 ERR("this function is not available for this object");
891 if (file) *file = NULL;
892 if (key) *key = NULL;
893}
894 874
895EOLIAN static Eina_Bool
896_evas_canvas3d_mesh_efl_file_file_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd,
897 const char *file,
898 const char *key EINA_UNUSED)
899{
900 _mesh_fini(pd); 875 _mesh_fini(pd);
901 _mesh_init(pd); 876 _mesh_init(pd);
902 877
903 if (file == NULL) return EINA_FALSE; 878 f = efl_file_mmap_get(obj);
879 if (f == NULL) return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
904 880
905 evas_common_load_model_from_file(obj, file); 881 evas_common_load_model_from_eina_file(obj, f);
906 return EINA_TRUE; 882
883 return 0;
907} 884}
908 885
909EOLIAN static Eina_Bool 886EOLIAN static Eina_Bool