efl.file: move 'save' method into separate efl.file_save interface
authorMike Blumenkrantz <zmike@samsung.com>
Wed, 30 Jan 2019 14:05:05 +0000 (09:05 -0500)
committerTaehyub Kim <taehyub.kim@samsung.com>
Thu, 31 Jan 2019 03:45:33 +0000 (12:45 +0900)
the save method is implemented very rarely, and most objects which use efl.file
will not be able to use a save method

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7786

Change-Id: I169c7efc06a4ecb60afb7073b20c41a8ce0751c3

12 files changed:
src/Makefile_Efl.am
src/lib/efl/Efl.h
src/lib/efl/interfaces/efl_file.c
src/lib/efl/interfaces/efl_file.eo
src/lib/efl/interfaces/efl_file_save.eo [new file with mode: 0644]
src/lib/efl/interfaces/meson.build
src/lib/evas/canvas/efl_canvas_image_internal.eo
src/lib/evas/canvas/efl_canvas_vg_object.c
src/lib/evas/canvas/efl_canvas_vg_object.eo
src/lib/evas/canvas/evas_canvas3d_mesh.c
src/lib/evas/canvas/evas_canvas3d_mesh.eo
src/lib/evas/canvas/evas_object_image.c

index 475a5f1..20daaeb 100644 (file)
@@ -23,6 +23,7 @@ efl_eolian_files = \
       lib/efl/interfaces/efl_control.eo \
       lib/efl/interfaces/efl_duplicate.eo \
       lib/efl/interfaces/efl_file.eo \
+      lib/efl/interfaces/efl_file_save.eo \
       lib/efl/interfaces/efl_gfx_image_load_controller.eo \
       lib/efl/interfaces/efl_part.eo \
       lib/efl/interfaces/efl_playable.eo \
index 7daa52d..0971111 100644 (file)
@@ -85,6 +85,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
 #include "interfaces/efl_control.eo.h"
 #include "interfaces/efl_duplicate.eo.h"
 #include "interfaces/efl_file.eo.h"
+#include "interfaces/efl_file_save.eo.h"
 #include "interfaces/efl_gfx_image.eo.h"
 #include "interfaces/efl_gfx_frame_controller.eo.h"
 #include "interfaces/efl_gfx_image_load_controller.eo.h"
index 8edbbfb..d1c86ee 100644 (file)
@@ -60,3 +60,4 @@ _efl_file_load_error_get(const Eo *obj EINA_UNUSED, Efl_File_Data *pd)
 }
 
 #include "interfaces/efl_file.eo.c"
+#include "interfaces/efl_file_save.eo.c"
index 9260c16..c9873f0 100644 (file)
@@ -89,27 +89,5 @@ mixin Efl.File {
                                  $null, otherwise.]]
          }
       }
-      save @const @pure_virtual {
-         [[Save the given image object's contents to an (image) file.
-
-           The extension suffix on $file will determine which saver
-           module Evas is to use when saving, thus the final file's
-           format. If the file supports multiple data stored in it (Eet ones),
-           you can specify the key to be used as the index of the image in it.
-
-           You can specify some flags when saving the image.  Currently
-           acceptable flags are $quality and $compress. Eg.:
-           "quality=100 compress=9".
-         ]]
-         params {
-            @in file: string @nonull; [[The filename to be used to save the image (extension
-                                              obligatory).]]
-            @in key: string; [[The image key in the file (if an Eet one), or $null,
-                                     otherwise.]]
-            @in flags: string; [[String containing the flags to be used ($null for
-                                       none).]]
-         }
-         return: bool;  [[$true on success, $false otherwise]]
-      }
    }
 }
diff --git a/src/lib/efl/interfaces/efl_file_save.eo b/src/lib/efl/interfaces/efl_file_save.eo
new file mode 100644 (file)
index 0000000..153b74b
--- /dev/null
@@ -0,0 +1,29 @@
+import eina_types;
+
+interface Efl.File_Save {
+   [[Efl file saving interface]]
+   methods {
+      save @const {
+         [[Save the given image object's contents to an (image) file.
+
+           The extension suffix on $file will determine which saver
+           module Evas is to use when saving, thus the final file's
+           format. If the file supports multiple data stored in it (Eet ones),
+           you can specify the key to be used as the index of the image in it.
+
+           You can specify some flags when saving the image.  Currently
+           acceptable flags are $quality and $compress. Eg.:
+           "quality=100 compress=9".
+         ]]
+         params {
+            @in file: string @nonull; [[The filename to be used to save the image (extension
+                                              obligatory).]]
+            @in key: string; [[The image key in the file (if an Eet one), or $null,
+                                     otherwise.]]
+            @in flags: string; [[String containing the flags to be used ($null for
+                                       none).]]
+         }
+         return: bool;  [[$true on success, $false otherwise]]
+      }
+   }
+}
index 61d91fb..a1ef0ee 100644 (file)
@@ -49,6 +49,7 @@ pub_eo_files = [
   'efl_control.eo',
   'efl_duplicate.eo',
   'efl_file.eo',
+  'efl_file_save.eo',
   'efl_gfx_image_load_controller.eo',
   'efl_part.eo',
   'efl_player.eo',
index fc7df3c..b3b8f3b 100644 (file)
@@ -1,7 +1,7 @@
 abstract Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canvas.Filter.Internal,
                                     Efl.Gfx.Image, Efl.Gfx.Buffer,
                                     Efl.Gfx.Fill, Efl.Gfx.View,
-                                    Efl.Orientation, Efl.File
+                                    Efl.Orientation, Efl.File_Save
 {
    [[Efl canvas internal image class]]
    data: Evas_Image_Data;
@@ -10,7 +10,7 @@ abstract Efl.Canvas.Image_Internal extends Efl.Canvas.Object implements Efl.Canv
       Efl.Object.destructor;
       Efl.Object.finalize;
       Efl.Object.debug_name_override;
-      Efl.File.save;
+      Efl.File_Save.save;
       Efl.Orientation.orientation { get; set; }
       Efl.Orientation.flip { get; set; }
       Efl.Gfx.Image.smooth_scale { get; set; }
index 45c531e..685e3f9 100644 (file)
@@ -384,7 +384,7 @@ _efl_canvas_vg_object_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg
 }
 
 EOLIAN static Eina_Bool
-_efl_canvas_vg_object_efl_file_save(const Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key, const char *flags)
+_efl_canvas_vg_object_efl_file_save_save(const Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key, const char *flags)
 {
    if (pd->vg_entry)
      return evas_cache_vg_entry_file_save(pd->vg_entry, file, key, flags);
index 2ec47cf..d5b158a 100644 (file)
@@ -21,7 +21,7 @@ enum Efl.Canvas.Vg.Fill_Mode
                   dimension of the viewport.]]
 }
 
-class Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File,
+class Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File, Efl.File_Save,
                            //TIZEN_ONLY(20180831): evas json: new feature for lottie - #4
                             Efl.Gfx.Frame_Controller
                            //
@@ -87,7 +87,7 @@ class Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File,
       Efl.Object.destructor;
       Efl.File.mmap { get; set; }
       Efl.File.file { get; set; }
-      Efl.File.save;
+      Efl.File_Save.save;
       Efl.Gfx.Frame_Controller.animated { get; }
       Efl.Gfx.Frame_Controller.frame { get; set; }
       Efl.Gfx.Frame_Controller.frame_count { get; }
index eb32e63..d91feaf 100644 (file)
@@ -907,7 +907,7 @@ _evas_canvas3d_mesh_efl_file_file_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd,
 }
 
 EOLIAN static Eina_Bool
-_evas_canvas3d_mesh_efl_file_save(const Eo *obj, Evas_Canvas3D_Mesh_Data *pd,
+_evas_canvas3d_mesh_efl_file_save_save(const Eo *obj, Evas_Canvas3D_Mesh_Data *pd,
                    const char *file,
                    const char *key EINA_UNUSED,
                    const char *flags EINA_UNUSED)
index d7ffa73..0284654 100644 (file)
@@ -2,7 +2,7 @@ import evas_canvas3d_types;
 
 struct @extern Eina.Inarray; [[Eina inarray data structure]]
 
-class Evas.Canvas3D.Mesh extends Evas.Canvas3D.Object implements Efl.File
+class Evas.Canvas3D.Mesh extends Evas.Canvas3D.Object implements Efl.File, Efl.File_Save
 {
    [[Evas 3D canvas mesh class]]
    data: Evas_Canvas3D_Mesh_Data;
@@ -428,7 +428,7 @@ class Evas.Canvas3D.Mesh extends Evas.Canvas3D.Object implements Efl.File
       Evas.Canvas3D.Object.change_notify;
       Efl.File.file { get; set; }
       Efl.File.mmap { get; set; }
-      Efl.File.save;
+      Efl.File_Save.save;
    }
 
 }
index 1dbf61c..81b6bf4 100755 (executable)
@@ -868,7 +868,7 @@ _efl_canvas_image_internal_efl_gfx_image_ratio_get(const Eo *eo_obj EINA_UNUSED,
 }
 
 EOLIAN static Eina_Bool
-_efl_canvas_image_internal_efl_file_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file, const char *key, const char *flags)
+_efl_canvas_image_internal_efl_file_save_save(const Eo *eo_obj, Evas_Image_Data *o, const char *file, const char *key, const char *flags)
 {
    int quality = 80, compress = 9, ok = 0;
    char *encoding = NULL;