summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas
diff options
context:
space:
mode:
authorBogdan Devichev <b.devichev@samsung.com>2014-12-22 16:16:19 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-12-23 21:20:21 +0100
commitc471665ac84b159d3cd4587380fae6ac78c33c3b (patch)
tree110c4eae1da7bd238b9f5c11bdabd13300d3caee /src/lib/evas/canvas
parentce36f8f5ad1e516d077ea935adf09c74c6ba403f (diff)
evas: make Evas 3d mesh is inherited from Efl.File (functions file_set and save)
Diffstat (limited to 'src/lib/evas/canvas')
-rw-r--r--src/lib/evas/canvas/evas_3d_mesh.c23
-rw-r--r--src/lib/evas/canvas/evas_3d_mesh.eo34
2 files changed, 17 insertions, 40 deletions
diff --git a/src/lib/evas/canvas/evas_3d_mesh.c b/src/lib/evas/canvas/evas_3d_mesh.c
index 1868c0da6f..ddbf61916f 100644
--- a/src/lib/evas/canvas/evas_3d_mesh.c
+++ b/src/lib/evas/canvas/evas_3d_mesh.c
@@ -813,33 +813,38 @@ _evas_3d_mesh_mmap_set(Eo *obj, Evas_3D_Mesh_Data *pd,
813 evas_common_load_model_from_eina_file(obj, file); 813 evas_common_load_model_from_eina_file(obj, file);
814} 814}
815 815
816EOLIAN static void 816EOLIAN static Eina_Bool
817_evas_3d_mesh_file_set(Eo *obj, Evas_3D_Mesh_Data *pd, 817_evas_3d_mesh_efl_file_file_set(Eo *obj, Evas_3D_Mesh_Data *pd,
818 const char *file, const char *key EINA_UNUSED) 818 const char *file,
819 const char *key EINA_UNUSED)
819{ 820{
820 _mesh_fini(pd); 821 _mesh_fini(pd);
821 _mesh_init(pd); 822 _mesh_init(pd);
822 823
823 if (file == NULL) return; 824 if (file == NULL) return EINA_FALSE;
824 825
825 evas_common_load_model_from_file(obj, file); 826 evas_common_load_model_from_file(obj, file);
827 return EINA_TRUE;
826} 828}
827 829
828EOLIAN static void 830EOLIAN static Eina_Bool
829_evas_3d_mesh_save(Eo *obj, Evas_3D_Mesh_Data *pd, 831_evas_3d_mesh_efl_file_save(Eo *obj, Evas_3D_Mesh_Data *pd,
830 const char *file, const char *key EINA_UNUSED) 832 const char *file,
833 const char *key EINA_UNUSED,
834 const char *flags EINA_UNUSED)
831{ 835{
832 if ((file == NULL) || (obj == NULL) || (pd == NULL)) return; 836 if ((file == NULL) || (obj == NULL) || (pd == NULL)) return EINA_FALSE;
833 837
834 Evas_3D_Mesh_Frame *f = evas_3d_mesh_frame_find(pd, 0); 838 Evas_3D_Mesh_Frame *f = evas_3d_mesh_frame_find(pd, 0);
835 839
836 if (f == NULL) 840 if (f == NULL)
837 { 841 {
838 ERR("Not existing mesh frame."); 842 ERR("Not existing mesh frame.");
839 return; 843 return EINA_FALSE;
840 } 844 }
841 845
842 evas_common_save_model_to_file(obj, file, f); 846 evas_common_save_model_to_file(obj, file, f);
847 return EINA_TRUE;
843} 848}
844 849
845static inline void 850static inline void
diff --git a/src/lib/evas/canvas/evas_3d_mesh.eo b/src/lib/evas/canvas/evas_3d_mesh.eo
index e958ff4206..5657b32e54 100644
--- a/src/lib/evas/canvas/evas_3d_mesh.eo
+++ b/src/lib/evas/canvas/evas_3d_mesh.eo
@@ -1,4 +1,4 @@
1class Evas_3D_Mesh (Evas_3D_Object, Evas.Common_Interface) 1class Evas_3D_Mesh (Evas_3D_Object, Evas.Common_Interface, Efl.File)
2{ 2{
3 legacy_prefix: null; 3 legacy_prefix: null;
4 data: Evas_3D_Mesh_Data; 4 data: Evas_3D_Mesh_Data;
@@ -19,36 +19,6 @@ class Evas_3D_Mesh (Evas_3D_Object, Evas.Common_Interface)
19 } 19 }
20 } 20 }
21 21
22 file_set {
23 /**
24 * Load mesh data from file.
25 *
26 * Loading a mesh from existing file is supported. Currently, only MD2, OBJ, PLY and EET file
27 * formats are supported.
28 *
29 * @ingroup Evas_3D_Mesh
30 */
31 params {
32 @in const(char)* file; /*@ Path to the mesh file. */
33 @in const(char)* key; /*@ Key in the mesh file. */
34 }
35 }
36
37 save {
38 /**
39 * Save mesh data to file.
40 *
41 * Saving a mesh to file is supported. Currently, only OBJ, PLY and EET file
42 * format are supported.
43 *
44 * @ingroup Evas_3D_Mesh
45 */
46 params {
47 @in const(char)* file; /*@ Path to the mesh file. */
48 @in const(char)* key; /*@ Key in the mesh file. */
49 }
50 }
51
52 frame_vertex_data_set { 22 frame_vertex_data_set {
53 /*@ 23 /*@
54 Set the vertex data of the key frame of the given mesh. 24 Set the vertex data of the key frame of the given mesh.
@@ -494,6 +464,8 @@ class Evas_3D_Mesh (Evas_3D_Object, Evas.Common_Interface)
494 Eo.Base.destructor; 464 Eo.Base.destructor;
495 Evas_3D_Object.update_notify; 465 Evas_3D_Object.update_notify;
496 Evas_3D_Object.change_notify; 466 Evas_3D_Object.change_notify;
467 Efl.File.file.set;
468 Efl.File.save;
497 } 469 }
498 470
499} 471}