From: Mike Blumenkrantz Date: Wed, 30 Jan 2019 14:05:05 +0000 (-0500) Subject: efl.file: move 'save' method into separate efl.file_save interface X-Git-Tag: accepted/tizen/unified/20190201.061426~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7d83cd6151dff779cd913cedc79853b287b3553;p=platform%2Fupstream%2Fefl.git efl.file: move 'save' method into separate efl.file_save interface 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 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D7786 Change-Id: I169c7efc06a4ecb60afb7073b20c41a8ce0751c3 --- diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 475a5f1eb..20daaeb 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -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 \ diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 7daa52d..0971111 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -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" diff --git a/src/lib/efl/interfaces/efl_file.c b/src/lib/efl/interfaces/efl_file.c index 8edbbfb..d1c86ee 100644 --- a/src/lib/efl/interfaces/efl_file.c +++ b/src/lib/efl/interfaces/efl_file.c @@ -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" diff --git a/src/lib/efl/interfaces/efl_file.eo b/src/lib/efl/interfaces/efl_file.eo index 9260c16..c9873f0 100644 --- a/src/lib/efl/interfaces/efl_file.eo +++ b/src/lib/efl/interfaces/efl_file.eo @@ -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 index 0000000..153b74b --- /dev/null +++ b/src/lib/efl/interfaces/efl_file_save.eo @@ -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]] + } + } +} diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build index 61d91fb..a1ef0ee 100644 --- a/src/lib/efl/interfaces/meson.build +++ b/src/lib/efl/interfaces/meson.build @@ -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', diff --git a/src/lib/evas/canvas/efl_canvas_image_internal.eo b/src/lib/evas/canvas/efl_canvas_image_internal.eo index fc7df3c..b3b8f3b 100644 --- a/src/lib/evas/canvas/efl_canvas_image_internal.eo +++ b/src/lib/evas/canvas/efl_canvas_image_internal.eo @@ -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; } diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 45c531e..685e3f9 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -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); diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.eo b/src/lib/evas/canvas/efl_canvas_vg_object.eo index 2ec47cf..d5b158a 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.eo +++ b/src/lib/evas/canvas/efl_canvas_vg_object.eo @@ -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; } diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.c b/src/lib/evas/canvas/evas_canvas3d_mesh.c index eb32e63..d91feaf 100644 --- a/src/lib/evas/canvas/evas_canvas3d_mesh.c +++ b/src/lib/evas/canvas/evas_canvas3d_mesh.c @@ -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) diff --git a/src/lib/evas/canvas/evas_canvas3d_mesh.eo b/src/lib/evas/canvas/evas_canvas3d_mesh.eo index d7ffa73..0284654 100644 --- a/src/lib/evas/canvas/evas_canvas3d_mesh.eo +++ b/src/lib/evas/canvas/evas_canvas3d_mesh.eo @@ -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; } } diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 1dbf61c..81b6bf4 100755 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -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;