summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-05-31 10:43:32 -0700
committerCedric BAIL <cedric.bail@free.fr>2019-07-12 09:54:11 -0700
commit9f35c74d9d66181ff609e325d23796efc823e95e (patch)
tree14e472a1a069d29c35fb2b59f7bc2faf282c431a
parent2020f971a4e74bde2958f5ce64be365fc95715c7 (diff)
evas: break Evas_Loader API and introduce a version numbering for Image_Loader.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Hermet Park <hermetpark@gmail.com> Differential Revision: https://phab.enlightenment.org/D9099
-rw-r--r--src/lib/evas/Evas_Loader.h5
-rw-r--r--src/lib/evas/common/evas_image_load.c2
-rw-r--r--src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c1
-rw-r--r--src/modules/evas/image_loaders/dds/evas_image_load_dds.c1
-rw-r--r--src/modules/evas/image_loaders/eet/evas_image_load_eet.c1
-rw-r--r--src/modules/evas/image_loaders/generic/evas_image_load_generic.c1
-rw-r--r--src/modules/evas/image_loaders/gif/evas_image_load_gif.c3
-rw-r--r--src/modules/evas/image_loaders/ico/evas_image_load_ico.c1
-rw-r--r--src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c1
-rw-r--r--src/modules/evas/image_loaders/jpeg/evas_image_load_jpeg.c1
-rw-r--r--src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c1
-rw-r--r--src/modules/evas/image_loaders/png/evas_image_load_png.c1
-rw-r--r--src/modules/evas/image_loaders/psd/evas_image_load_psd.c1
-rw-r--r--src/modules/evas/image_loaders/tga/evas_image_load_tga.c1
-rw-r--r--src/modules/evas/image_loaders/tgv/evas_image_load_tgv.c1
-rw-r--r--src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c1
-rw-r--r--src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c1
-rw-r--r--src/modules/evas/image_loaders/webp/evas_image_load_webp.c1
-rw-r--r--src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c1
19 files changed, 23 insertions, 3 deletions
diff --git a/src/lib/evas/Evas_Loader.h b/src/lib/evas/Evas_Loader.h
index 787df4e..e60647d 100644
--- a/src/lib/evas/Evas_Loader.h
+++ b/src/lib/evas/Evas_Loader.h
@@ -70,7 +70,7 @@ extern "C" {
70#endif 70#endif
71 71
72/* the module api version */ 72/* the module api version */
73#define EVAS_MODULE_API_VERSION 2 73#define EVAS_MODULE_API_VERSION 3
74 74
75/* the module types */ 75/* the module types */
76typedef enum _Evas_Module_Type 76typedef enum _Evas_Module_Type
@@ -186,8 +186,11 @@ typedef Emile_Colorspace Evas_Colorspace; /**< Colorspaces for pixel data suppor
186#define EVAS_COLORSPACE_RGBA_S3TC_DXT4 EMILE_COLORSPACE_RGBA_S3TC_DXT4 186#define EVAS_COLORSPACE_RGBA_S3TC_DXT4 EMILE_COLORSPACE_RGBA_S3TC_DXT4
187#define EVAS_COLORSPACE_RGBA_S3TC_DXT5 EMILE_COLORSPACE_RGBA_S3TC_DXT5 187#define EVAS_COLORSPACE_RGBA_S3TC_DXT5 EMILE_COLORSPACE_RGBA_S3TC_DXT5
188 188
189#define EVAS_IMAGE_LOAD_VERSION 1
190
189struct _Evas_Image_Load_Func 191struct _Evas_Image_Load_Func
190{ 192{
193 int version;
191 void *(*file_open) (Eina_File *f, Eina_Stringshare *key, 194 void *(*file_open) (Eina_File *f, Eina_Stringshare *key,
192 Evas_Image_Load_Opts *opts, 195 Evas_Image_Load_Opts *opts,
193 Evas_Image_Animated *animated, 196 Evas_Image_Animated *animated,
diff --git a/src/lib/evas/common/evas_image_load.c b/src/lib/evas/common/evas_image_load.c
index 7d4ca66..c012139 100644
--- a/src/lib/evas/common/evas_image_load.c
+++ b/src/lib/evas/common/evas_image_load.c
@@ -183,7 +183,7 @@ _evas_image_file_header(Evas_Module *em, Image_Entry *ie, int *error)
183 evas_image_load_func = em->functions; 183 evas_image_load_func = em->functions;
184 evas_module_use(em); 184 evas_module_use(em);
185 *error = EVAS_LOAD_ERROR_NONE; 185 *error = EVAS_LOAD_ERROR_NONE;
186 if (evas_image_load_func) 186 if (evas_image_load_func && evas_image_load_func->version == EVAS_IMAGE_LOAD_VERSION)
187 { 187 {
188 Evas_Image_Property property; 188 Evas_Image_Property property;
189 const char *file; 189 const char *file;
diff --git a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
index 43dac5b..c29c0c6 100644
--- a/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
+++ b/src/modules/evas/image_loaders/bmp/evas_image_load_bmp.c
@@ -1429,6 +1429,7 @@ evas_image_load_file_data_bmp(void *loader_data,
1429 1429
1430static Evas_Image_Load_Func evas_image_load_bmp_func = 1430static Evas_Image_Load_Func evas_image_load_bmp_func =
1431{ 1431{
1432 EVAS_IMAGE_LOAD_VERSION,
1432 evas_image_load_file_open_bmp, 1433 evas_image_load_file_open_bmp,
1433 evas_image_load_file_close_bmp, 1434 evas_image_load_file_close_bmp,
1434 evas_image_load_file_head_bmp, 1435 evas_image_load_file_head_bmp,
diff --git a/src/modules/evas/image_loaders/dds/evas_image_load_dds.c b/src/modules/evas/image_loaders/dds/evas_image_load_dds.c
index f3b133c..705ed3f 100644
--- a/src/modules/evas/image_loaders/dds/evas_image_load_dds.c
+++ b/src/modules/evas/image_loaders/dds/evas_image_load_dds.c
@@ -529,6 +529,7 @@ on_error:
529 529
530Evas_Image_Load_Func evas_image_load_dds_func = 530Evas_Image_Load_Func evas_image_load_dds_func =
531{ 531{
532 EVAS_IMAGE_LOAD_VERSION,
532 evas_image_load_file_open_dds, 533 evas_image_load_file_open_dds,
533 evas_image_load_file_close_dds, 534 evas_image_load_file_close_dds,
534 evas_image_load_file_head_dds, 535 evas_image_load_file_head_dds,
diff --git a/src/modules/evas/image_loaders/eet/evas_image_load_eet.c b/src/modules/evas/image_loaders/eet/evas_image_load_eet.c
index 9ff212f..4ff2089 100644
--- a/src/modules/evas/image_loaders/eet/evas_image_load_eet.c
+++ b/src/modules/evas/image_loaders/eet/evas_image_load_eet.c
@@ -224,6 +224,7 @@ evas_image_load_file_data_eet(void *loader_data,
224 224
225Evas_Image_Load_Func evas_image_load_eet_func = 225Evas_Image_Load_Func evas_image_load_eet_func =
226{ 226{
227 EVAS_IMAGE_LOAD_VERSION,
227 evas_image_load_file_open_eet, 228 evas_image_load_file_open_eet,
228 evas_image_load_file_close_eet, 229 evas_image_load_file_close_eet,
229 evas_image_load_file_head_eet, 230 evas_image_load_file_head_eet,
diff --git a/src/modules/evas/image_loaders/generic/evas_image_load_generic.c b/src/modules/evas/image_loaders/generic/evas_image_load_generic.c
index ec4917f..4bd8528 100644
--- a/src/modules/evas/image_loaders/generic/evas_image_load_generic.c
+++ b/src/modules/evas/image_loaders/generic/evas_image_load_generic.c
@@ -443,6 +443,7 @@ evas_image_load_file_data_generic(void *loader_data,
443 443
444Evas_Image_Load_Func evas_image_load_generic_func = 444Evas_Image_Load_Func evas_image_load_generic_func =
445{ 445{
446 EVAS_IMAGE_LOAD_VERSION,
446 evas_image_load_file_open_generic, 447 evas_image_load_file_open_generic,
447 evas_image_load_file_close_generic, 448 evas_image_load_file_close_generic,
448 evas_image_load_file_head_generic, 449 evas_image_load_file_head_generic,
diff --git a/src/modules/evas/image_loaders/gif/evas_image_load_gif.c b/src/modules/evas/image_loaders/gif/evas_image_load_gif.c
index 737e3fb..2928ff7 100644
--- a/src/modules/evas/image_loaders/gif/evas_image_load_gif.c
+++ b/src/modules/evas/image_loaders/gif/evas_image_load_gif.c
@@ -905,9 +905,10 @@ evas_image_load_file_close_gif2(void *loader_data)
905// general module delcaration stuff 905// general module delcaration stuff
906static Evas_Image_Load_Func evas_image_load_gif_func = 906static Evas_Image_Load_Func evas_image_load_gif_func =
907{ 907{
908 EVAS_IMAGE_LOAD_VERSION,
908 evas_image_load_file_open_gif2, 909 evas_image_load_file_open_gif2,
909 evas_image_load_file_close_gif2, 910 evas_image_load_file_close_gif2,
910 evas_image_load_file_head_gif2, 911 evas_image_load_file_head_gif2,
911 evas_image_load_file_data_gif2, 912 evas_image_load_file_data_gif2,
912 evas_image_load_frame_duration_gif2, 913 evas_image_load_frame_duration_gif2,
913 EINA_TRUE, 914 EINA_TRUE,
diff --git a/src/modules/evas/image_loaders/ico/evas_image_load_ico.c b/src/modules/evas/image_loaders/ico/evas_image_load_ico.c
index 520ef06..efdad46 100644
--- a/src/modules/evas/image_loaders/ico/evas_image_load_ico.c
+++ b/src/modules/evas/image_loaders/ico/evas_image_load_ico.c
@@ -792,6 +792,7 @@ evas_image_load_file_data_ico(void *loader_data,
792 792
793static Evas_Image_Load_Func evas_image_load_ico_func = 793static Evas_Image_Load_Func evas_image_load_ico_func =
794{ 794{
795 EVAS_IMAGE_LOAD_VERSION,
795 evas_image_load_file_open_ico, 796 evas_image_load_file_open_ico,
796 evas_image_load_file_close_ico, 797 evas_image_load_file_close_ico,
797 evas_image_load_file_head_ico, 798 evas_image_load_file_head_ico,
diff --git a/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c b/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c
index dd9af05..50ab355 100644
--- a/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c
+++ b/src/modules/evas/image_loaders/jp2k/evas_image_load_jp2k.c
@@ -462,6 +462,7 @@ evas_image_load_file_data_jp2k(void *loader_data,
462 462
463static Evas_Image_Load_Func evas_image_load_jp2k_func = 463static Evas_Image_Load_Func evas_image_load_jp2k_func =
464{ 464{
465 EVAS_IMAGE_LOAD_VERSION,
465 evas_image_load_file_open_jp2k, 466 evas_image_load_file_open_jp2k,
466 evas_image_load_file_close_jp2k, 467 evas_image_load_file_close_jp2k,
467 evas_image_load_file_head_jp2k, 468 evas_image_load_file_head_jp2k,
diff --git a/src/modules/evas/image_loaders/jpeg/evas_image_load_jpeg.c b/src/modules/evas/image_loaders/jpeg/evas_image_load_jpeg.c
index c80416a..ca71256 100644
--- a/src/modules/evas/image_loaders/jpeg/evas_image_load_jpeg.c
+++ b/src/modules/evas/image_loaders/jpeg/evas_image_load_jpeg.c
@@ -116,6 +116,7 @@ evas_image_load_file_data_jpeg(void *loader_data,
116 116
117Evas_Image_Load_Func evas_image_load_jpeg_func = 117Evas_Image_Load_Func evas_image_load_jpeg_func =
118{ 118{
119 EVAS_IMAGE_LOAD_VERSION,
119 evas_image_load_file_open_jpeg, 120 evas_image_load_file_open_jpeg,
120 evas_image_load_file_close_jpeg, 121 evas_image_load_file_close_jpeg,
121 evas_image_load_file_head_jpeg, 122 evas_image_load_file_head_jpeg,
diff --git a/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c b/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
index b9c383c..66deda1 100644
--- a/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
+++ b/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
@@ -551,6 +551,7 @@ pmaps_buffer_plain_bw_get(Pmaps_Buffer *b, DATA32 *val)
551 551
552/* external functions */ 552/* external functions */
553Evas_Image_Load_Func evas_image_load_pmaps_func = { 553Evas_Image_Load_Func evas_image_load_pmaps_func = {
554 EVAS_IMAGE_LOAD_VERSION,
554 evas_image_load_file_open_pmaps, 555 evas_image_load_file_open_pmaps,
555 evas_image_load_file_close_pmaps, 556 evas_image_load_file_close_pmaps,
556 evas_image_load_file_head_pmaps, 557 evas_image_load_file_head_pmaps,
diff --git a/src/modules/evas/image_loaders/png/evas_image_load_png.c b/src/modules/evas/image_loaders/png/evas_image_load_png.c
index 087c908..80f7744 100644
--- a/src/modules/evas/image_loaders/png/evas_image_load_png.c
+++ b/src/modules/evas/image_loaders/png/evas_image_load_png.c
@@ -556,6 +556,7 @@ evas_image_load_file_data_png(void *loader_data,
556 556
557static Evas_Image_Load_Func evas_image_load_png_func = 557static Evas_Image_Load_Func evas_image_load_png_func =
558{ 558{
559 EVAS_IMAGE_LOAD_VERSION,
559 evas_image_load_file_open_png, 560 evas_image_load_file_open_png,
560 evas_image_load_file_close_png, 561 evas_image_load_file_close_png,
561 evas_image_load_file_head_png, 562 evas_image_load_file_head_png,
diff --git a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
index d8f15b3..afd54b5 100644
--- a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
+++ b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
@@ -882,6 +882,7 @@ get_compressed_channels_length(PSD_Header *head,
882} 882}
883 883
884static const Evas_Image_Load_Func evas_image_load_psd_func = { 884static const Evas_Image_Load_Func evas_image_load_psd_func = {
885 EVAS_IMAGE_LOAD_VERSION,
885 evas_image_load_file_open_psd, 886 evas_image_load_file_open_psd,
886 evas_image_load_file_close_psd, 887 evas_image_load_file_close_psd,
887 evas_image_load_file_head_psd, 888 evas_image_load_file_head_psd,
diff --git a/src/modules/evas/image_loaders/tga/evas_image_load_tga.c b/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
index 344c363..4efb673 100644
--- a/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
+++ b/src/modules/evas/image_loaders/tga/evas_image_load_tga.c
@@ -563,6 +563,7 @@ evas_image_load_file_data_tga(void *loader_data,
563 563
564static Evas_Image_Load_Func evas_image_load_tga_func = 564static Evas_Image_Load_Func evas_image_load_tga_func =
565{ 565{
566 EVAS_IMAGE_LOAD_VERSION,
566 evas_image_load_file_open_tga, 567 evas_image_load_file_open_tga,
567 evas_image_load_file_close_tga, 568 evas_image_load_file_close_tga,
568 evas_image_load_file_head_tga, 569 evas_image_load_file_head_tga,
diff --git a/src/modules/evas/image_loaders/tgv/evas_image_load_tgv.c b/src/modules/evas/image_loaders/tgv/evas_image_load_tgv.c
index 72da89a..e71773d 100644
--- a/src/modules/evas/image_loaders/tgv/evas_image_load_tgv.c
+++ b/src/modules/evas/image_loaders/tgv/evas_image_load_tgv.c
@@ -105,6 +105,7 @@ evas_image_load_file_data_tgv(void *loader_data,
105 105
106Evas_Image_Load_Func evas_image_load_tgv_func = 106Evas_Image_Load_Func evas_image_load_tgv_func =
107{ 107{
108 EVAS_IMAGE_LOAD_VERSION,
108 evas_image_load_file_open_tgv, 109 evas_image_load_file_open_tgv,
109 evas_image_load_file_close_tgv, 110 evas_image_load_file_close_tgv,
110 evas_image_load_file_head_tgv, 111 evas_image_load_file_head_tgv,
diff --git a/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c b/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c
index e07206b..2603221 100644
--- a/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c
+++ b/src/modules/evas/image_loaders/tiff/evas_image_load_tiff.c
@@ -332,6 +332,7 @@ evas_image_load_file_data_tiff(void *loader_data,
332 332
333static Evas_Image_Load_Func evas_image_load_tiff_func = 333static Evas_Image_Load_Func evas_image_load_tiff_func =
334{ 334{
335 EVAS_IMAGE_LOAD_VERSION,
335 evas_image_load_file_open_tiff, 336 evas_image_load_file_open_tiff,
336 evas_image_load_file_close_tiff, 337 evas_image_load_file_close_tiff,
337 evas_image_load_file_head_tiff, 338 evas_image_load_file_head_tiff,
diff --git a/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c b/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
index af539a0..e14f5a4 100644
--- a/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
+++ b/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
@@ -181,6 +181,7 @@ evas_image_load_file_data_wbmp(void *loader_data,
181 181
182static Evas_Image_Load_Func evas_image_load_wbmp_func = 182static Evas_Image_Load_Func evas_image_load_wbmp_func =
183{ 183{
184 EVAS_IMAGE_LOAD_VERSION,
184 evas_image_load_file_open_wbmp, 185 evas_image_load_file_open_wbmp,
185 evas_image_load_file_close_wbmp, 186 evas_image_load_file_close_wbmp,
186 evas_image_load_file_head_wbmp, 187 evas_image_load_file_head_wbmp,
diff --git a/src/modules/evas/image_loaders/webp/evas_image_load_webp.c b/src/modules/evas/image_loaders/webp/evas_image_load_webp.c
index e3f97bb..9d39b22 100644
--- a/src/modules/evas/image_loaders/webp/evas_image_load_webp.c
+++ b/src/modules/evas/image_loaders/webp/evas_image_load_webp.c
@@ -112,6 +112,7 @@ evas_image_load_file_data_webp(void *loader_data,
112 112
113static Evas_Image_Load_Func evas_image_load_webp_func = 113static Evas_Image_Load_Func evas_image_load_webp_func =
114{ 114{
115 EVAS_IMAGE_LOAD_VERSION,
115 evas_image_load_file_open_webp, 116 evas_image_load_file_open_webp,
116 evas_image_load_file_close_webp, 117 evas_image_load_file_close_webp,
117 evas_image_load_file_head_webp, 118 evas_image_load_file_head_webp,
diff --git a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c
index 4bf08b5..3b5e682 100644
--- a/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c
+++ b/src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c
@@ -2214,6 +2214,7 @@ evas_image_load_file_data_xpm(void *loader_data,
2214 2214
2215static Evas_Image_Load_Func evas_image_load_xpm_func = 2215static Evas_Image_Load_Func evas_image_load_xpm_func =
2216{ 2216{
2217 EVAS_IMAGE_LOAD_VERSION,
2217 evas_image_load_file_open_xpm, 2218 evas_image_load_file_open_xpm,
2218 evas_image_load_file_close_xpm, 2219 evas_image_load_file_close_xpm,
2219 evas_image_load_file_head_xpm, 2220 evas_image_load_file_head_xpm,