summaryrefslogtreecommitdiff
path: root/src/lib/evas/vg/evas_vg_cache.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2019-02-27 13:17:35 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:35 -0500
commit540d3b95874e1ebdcbd6ccf9eaf1cab0af30f833 (patch)
tree34575d7a518cecc4745576be7ea3099a5087268d /src/lib/evas/vg/evas_vg_cache.c
parent4192753490a3c791cc18c57be07c230b9ca33732 (diff)
efl.file_save: rework save flags
Summary: instead of passing a string which requires reading docs to know which arbitrary string key=value sets can be passed, use an extensible struct which contains more easily referenced values ref T7672 Depends on D8035 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7672 Differential Revision: https://phab.enlightenment.org/D8039
Diffstat (limited to 'src/lib/evas/vg/evas_vg_cache.c')
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index bd5a4a4f14..e3a5d60529 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -167,7 +167,7 @@ _evas_cache_vg_entry_free_cb(void *data)
167} 167}
168 168
169static Eina_Bool 169static Eina_Bool
170_vg_file_save(Vg_File_Data *vfd, const char *file, const char *key, const char *flags) 170_vg_file_save(Vg_File_Data *vfd, const char *file, const char *key, const Efl_File_Save_Info *info)
171{ 171{
172 Evas_Module *em; 172 Evas_Module *em;
173 Evas_Vg_Save_Func *saver; 173 Evas_Vg_Save_Func *saver;
@@ -176,24 +176,7 @@ _vg_file_save(Vg_File_Data *vfd, const char *file, const char *key, const char *
176 176
177 if (!file) return EINA_FALSE; 177 if (!file) return EINA_FALSE;
178 178
179 if (flags) 179 if (info) compress = info->compression;
180 {
181 char *p, *pp;
182 char *tflags;
183
184 int len = strlen(flags) + 1;
185 tflags = alloca(len);
186 strncpy(tflags, flags, len);
187 p = tflags;
188 while (p)
189 {
190 pp = strchr(p, ' ');
191 if (pp) *pp = 0;
192 sscanf(p, "compress=%i", &compress);
193 if (pp) p = pp + 1;
194 else break;
195 }
196 }
197 180
198 em = _find_saver_module(file); 181 em = _find_saver_module(file);
199 if (em) 182 if (em)
@@ -408,20 +391,18 @@ evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry)
408} 391}
409 392
410Eina_Bool 393Eina_Bool
411evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, 394evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info)
412 const char *flags)
413{ 395{
414 Vg_File_Data *vfd = 396 Vg_File_Data *vfd =
415 evas_cache_vg_file_open(vg_entry->file, vg_entry->key); 397 evas_cache_vg_file_open(vg_entry->file, vg_entry->key);
416 398
417 if (!vfd) return EINA_FALSE; 399 if (!vfd) return EINA_FALSE;
418 400
419 return _vg_file_save(vfd, file, key, flags); 401 return _vg_file_save(vfd, file, key, info);
420} 402}
421 403
422Eina_Bool 404Eina_Bool
423evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, 405evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info)
424 const char *flags)
425{ 406{
426 Vg_File_Data vfd = {}; 407 Vg_File_Data vfd = {};
427 408
@@ -432,5 +413,5 @@ evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char
432 vfd.root = root; 413 vfd.root = root;
433 vfd.preserve_aspect = EINA_FALSE; 414 vfd.preserve_aspect = EINA_FALSE;
434 415
435 return _vg_file_save(&vfd, file, key, flags); 416 return _vg_file_save(&vfd, file, key, info);
436} 417}