From: Marcel Hollerbach Date: Sun, 18 Feb 2018 20:58:57 +0000 (+0100) Subject: lets delete efl_vpath X-Git-Tag: upstream/1.21.0~1869 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ff404351d88480f9bab516b5f49775c916ffcc2;p=platform%2Fupstream%2Fefl.git lets delete efl_vpath Its not used anymore. ref T5314 --- diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index 72f8416..03b75b2 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -55,11 +55,6 @@ efl_eolian_files = \ lib/efl/interfaces/efl_pack_layout.eo \ lib/efl/interfaces/efl_pack_linear.eo \ lib/efl/interfaces/efl_pack_table.eo \ - lib/efl/interfaces/efl_vpath.eo \ - lib/efl/interfaces/efl_vpath_manager.eo \ - lib/efl/interfaces/efl_vpath_file.eo \ - lib/efl/interfaces/efl_vpath_core.eo \ - lib/efl/interfaces/efl_vpath_file_core.eo \ lib/efl/interfaces/efl_ui_base.eo \ lib/efl/interfaces/efl_ui_direction.eo \ lib/efl/interfaces/efl_ui_drag.eo \ @@ -123,10 +118,6 @@ lib/efl/interfaces/efl_interfaces_main.c \ lib/efl/interfaces/efl_model_common.c \ lib/efl/interfaces/efl_gfx_path.c \ lib/efl/interfaces/efl_gfx_shape.c \ -lib/efl/interfaces/efl_vpath_file.c \ -lib/efl/interfaces/efl_vpath_manager.c \ -lib/efl/interfaces/efl_vpath_core.c \ -lib/efl/interfaces/efl_vpath_file_core.c \ lib/efl/interfaces/efl_input_device.c \ lib/efl/interfaces/efl_ecore_input_device.c \ lib/efl/interfaces/efl_io_closer.c \ diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index dbe8198..f2c0301 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -62,12 +62,6 @@ typedef struct _Efl_Text_Annotate_Annotation Efl_Text_Annotate_Annotation; #include -#include "interfaces/efl_vpath_file.eo.h" -#include "interfaces/efl_vpath.eo.h" -#include "interfaces/efl_vpath_core.eo.h" -#include "interfaces/efl_vpath_manager.eo.h" -#include "interfaces/efl_vpath_file_core.eo.h" - /* Data types */ #include "interfaces/efl_gfx_types.eot.h" #include "interfaces/efl_ui_types.eot.h" diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index d9b8763..cb1738e 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -46,8 +46,6 @@ #include "interfaces/efl_canvas.eo.c" #include "interfaces/efl_canvas_pointer.eo.c" -#include "interfaces/efl_vpath.eo.c" - #include "interfaces/efl_screen.eo.c" /* Packing & containers */ diff --git a/src/lib/efl/interfaces/efl_vpath.eo b/src/lib/efl/interfaces/efl_vpath.eo deleted file mode 100644 index ca97f1b..0000000 --- a/src/lib/efl/interfaces/efl_vpath.eo +++ /dev/null @@ -1,31 +0,0 @@ -interface Efl.Vpath -{ - [[ VPath is the EFL "Virtual Path" system that maps paths and downloads - - You can provide virtual paths common in unix shells like: - "~/file.jpg" - "~username/file.png" - And also other extended paths like: - "(:cache:)/file.png" - "(:videos:)/file.mp4" - ... - And in future: - "file:///blah.jpg" - "http://blah.com/file.jpg" - "https://blahblah.com/file.jpg" - "ssh://blahblah.com:~/file.jpg" - ... - - @since 1.18 - ]] - eo_prefix: efl_vpath; - methods { - fetch { - [[ Fetch a new Vpath File object from the Vpath system ]] - params { - path: string; [[ The input virtual file path to fetch ]] - } - return: Efl.Vpath.File @owned; [[ An object representing the file ]] - } - } -} diff --git a/src/lib/efl/interfaces/efl_vpath_core.eo b/src/lib/efl/interfaces/efl_vpath_core.eo deleted file mode 100644 index 0e238a0..0000000 --- a/src/lib/efl/interfaces/efl_vpath_core.eo +++ /dev/null @@ -1,33 +0,0 @@ -class Efl.Vpath.Core (Efl.Object, Efl.Vpath) -{ - [[ Core EFL implementation of a Vpath system - - @since 1.18 - ]] - eo_prefix: efl_vpath_core; - methods { - core_get @class { - [[ This gets the global EFL Core Vpath class - only 1 - singleton ]] - return: Efl.Vpath.Core; [[ Get the singleton core vpath ]] - } - meta_set { - [[ A Meta key is a mapping from a virtual path to a real one ]] - params { - key: string; [[ The magic path key being looked up ]] - path: string; [[ The real path the key maps to ]] - } - } - meta_get { - [[ This returns the real path set for a Meta key, or NULL if not ]] - params { - key: string; [[ The magic path key being looked up ]] - } - return: string; [[Real file path]] - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Vpath.fetch; - } -} diff --git a/src/lib/efl/interfaces/efl_vpath_file.c b/src/lib/efl/interfaces/efl_vpath_file.c deleted file mode 100644 index 3e09882..0000000 --- a/src/lib/efl/interfaces/efl_vpath_file.c +++ /dev/null @@ -1,74 +0,0 @@ -#include "config.h" -#include "Efl.h" - -#define MY_CLASS EFL_VPATH_FILE_CLASS - -typedef struct _Efl_Vpath_File_Data Efl_Vpath_File_Data; - -struct _Efl_Vpath_File_Data -{ - const char *path; - const char *result; - Eina_Bool called : 1; - Eina_Bool keep : 1; -}; - -EOLIAN static void -_efl_vpath_file_path_set(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd, const char *path) -{ - eina_stringshare_replace(&(pd->path), path); -} - -EOLIAN static const char * -_efl_vpath_file_path_get(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd) -{ - return pd->path; -} - -EOLIAN static void -_efl_vpath_file_result_set(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd, const char *path) -{ - eina_stringshare_replace(&(pd->result), path); -} - -EOLIAN static const char * -_efl_vpath_file_result_get(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd) -{ - return pd->result; -} - -EOLIAN static void -_efl_vpath_file_keep_set(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd, Eina_Bool keep) -{ - pd->keep = keep; -} - -EOLIAN static Eina_Bool -_efl_vpath_file_keep_get(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd) -{ - return pd->keep; -} - -EOLIAN static Eina_Bool -_efl_vpath_file_do(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd) -{ - if (pd->called) return EINA_FALSE; - pd->called = EINA_TRUE; - efl_event_callback_call(obj, EFL_VPATH_FILE_EVENT_FETCHED, NULL); - return EINA_TRUE; -} - -EOLIAN static void -_efl_vpath_file_wait(Eo *obj EINA_UNUSED, Efl_Vpath_File_Data *pd EINA_UNUSED) -{ - if (!pd->called) - { - pd->called = EINA_TRUE; - if (pd->result) - efl_event_callback_call(obj, EFL_VPATH_FILE_EVENT_FETCHED, NULL); - else - efl_event_callback_call(obj, EFL_VPATH_FILE_EVENT_FAILED, NULL); - } -} - -#include "interfaces/efl_vpath_file.eo.c" diff --git a/src/lib/efl/interfaces/efl_vpath_file.eo b/src/lib/efl/interfaces/efl_vpath_file.eo deleted file mode 100644 index 1568a3e..0000000 --- a/src/lib/efl/interfaces/efl_vpath_file.eo +++ /dev/null @@ -1,55 +0,0 @@ -class Efl.Vpath.File (Efl.Object) -{ - [[ VPath File is an actual representation of a downloaded/mapped vpath file - - Keep this object around for as long as you need to use the file as it - may have been downloaded and kept as a local temporary file and - deletion may remove it. - - When you have a Vpath File object for the first time, call the do() - method on it to actually begin/do the mapping. From here the - fetched or failed event callbacks will be called, inside of which or - afterwards you can fetch the resulting local file path by getting the - result property. - - @since 1.18 - ]] - eo_prefix: efl_vpath_file; - methods { - @property path { - [[ The original source path provided to lookup/fetch from ]] - set {} - get {} - values { - path: string; [[ The input virtual path to a file ]] - } - } - @property result { - [[ The resulting real local file path to open/read ]] - set {} - get {} - values { - path: string; [[ The resulting destination file ]] - } - } - @property keep { - [[ If this object has to be kept for the usage of the result ]] - set {} - get {} - values { - keep: bool; [[ If the object neerds tobe kept around ]] - } - } - do { - [[ Actually begin the resolving here - emit event now or do later ]] - return: bool; [[ Result callback already called ]] - } - wait { - [[ If not fetched yet, wait until it is and call result cb ]] - } - } - events { - fetched; [[ File successfully mapped/fetched ]] - failed; [[ File fetch or mapping failed ]] - } -} diff --git a/src/lib/efl/interfaces/efl_vpath_file_core.c b/src/lib/efl/interfaces/efl_vpath_file_core.c deleted file mode 100644 index e0328e7..0000000 --- a/src/lib/efl/interfaces/efl_vpath_file_core.c +++ /dev/null @@ -1,66 +0,0 @@ -#include "config.h" -#include "Efl.h" - -#define MY_CLASS EFL_VPATH_FILE_CORE_CLASS - -typedef struct _Efl_Vpath_File_Core_Data Efl_Vpath_File_Core_Data; - -struct _Efl_Vpath_File_Core_Data -{ - int dummy; -}; - -EOLIAN static Efl_Object * -_efl_vpath_file_core_efl_object_constructor(Eo *obj, Efl_Vpath_File_Core_Data *pd) -{ - obj = efl_constructor(efl_super(obj, MY_CLASS)); - pd->dummy = 0; - return obj; -} - -EOLIAN static void -_efl_vpath_file_core_efl_object_destructor(Eo *obj, Efl_Vpath_File_Core_Data *pd) -{ - pd->dummy = 0; - efl_destructor(efl_super(obj, MY_CLASS)); -} - -EOLIAN static Eina_Bool -_efl_vpath_file_core_efl_vpath_file_do(Eo *obj, Efl_Vpath_File_Core_Data *pd) -{ - const char *path; - - if (efl_vpath_file_result_get(obj)) - return efl_vpath_file_do(efl_super(obj, MY_CLASS)); - // vpath core didn't find a match, so it'ss likely a protocol like - // http:// etc. etc. so deal with that here - path = efl_vpath_file_path_get(obj); - if (path) - { - if ((!strncasecmp(path, "http://", 7)) || - (!strncasecmp(path, "https://", 8))) - { - // XXX: handle urls --- need a loop object - } - } - // ... - pd->dummy = 0; - - // not a magic path - just set result to path - efl_vpath_file_result_set(obj, efl_vpath_file_path_get(obj)); - return efl_vpath_file_do(efl_super(obj, MY_CLASS)); -} - -EOLIAN static void -_efl_vpath_file_core_efl_vpath_file_wait(Eo *obj, Efl_Vpath_File_Core_Data *pd) -{ - if (efl_vpath_file_result_get(obj)) - { - efl_vpath_file_do(efl_super(obj, MY_CLASS)); - return; - } - pd->dummy = 0; - // XXX: not found yet, so do what is necessary -} - -#include "interfaces/efl_vpath_file_core.eo.c" diff --git a/src/lib/efl/interfaces/efl_vpath_file_core.eo b/src/lib/efl/interfaces/efl_vpath_file_core.eo deleted file mode 100644 index 6a627f0..0000000 --- a/src/lib/efl/interfaces/efl_vpath_file_core.eo +++ /dev/null @@ -1,14 +0,0 @@ -class Efl.Vpath.File.Core (Efl.Vpath.File) -{ - [[ Core EFL implementation of a Vpath File - - @since 1.18 - ]] - eo_prefix: efl_vpath_file_core; - implements { - Efl.Object.constructor; - Efl.Object.destructor; - Efl.Vpath.File.do; - Efl.Vpath.File.wait; - } -} diff --git a/src/lib/efl/interfaces/efl_vpath_manager.c b/src/lib/efl/interfaces/efl_vpath_manager.c deleted file mode 100644 index cae265c..0000000 --- a/src/lib/efl/interfaces/efl_vpath_manager.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "config.h" -#include "Efl.h" - -#define MY_CLASS EFL_VPATH_MANAGER_CLASS - -typedef struct _Efl_Vpath_Manager_Data Efl_Vpath_Manager_Data; -typedef struct _Efl_Vpath_Manager_Entry Efl_Vpath_Manager_Entry; - -struct _Efl_Vpath_Manager_Data -{ - Eina_List *list; -}; - -struct _Efl_Vpath_Manager_Entry -{ - Efl_Vpath *vpath; - int priority; -}; - -static Efl_Vpath_Manager_Data vpath_manager = -{ - NULL -}; - -EOLIAN static Efl_Vpath_File * -_efl_vpath_manager_fetch(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *path) -{ - Efl_Vpath_Manager_Entry *entry; - Eina_List *l; - Efl_Vpath_File *file; - - EINA_LIST_FOREACH(vpath_manager.list, l, entry) - { - file = efl_vpath_fetch(entry->vpath, path); - if (file) return file; - } - file = efl_add(EFL_VPATH_FILE_CLASS, NULL); - if (file) - { - efl_vpath_file_path_set(file, path); - efl_vpath_file_result_set(file, path); - } - return file; -} - -static int -_register_sort_cb(Efl_Vpath_Manager_Entry *e1, Efl_Vpath_Manager_Entry *e2) -{ - // sort higher numbers first in list - return (e2->priority - e1->priority); -} - -static void -_cb_vpath_del(void *data, const Efl_Event *event) -{ - efl_vpath_manager_unregister(EFL_VPATH_MANAGER_CLASS, event->object); - efl_event_callback_del(event->object, EFL_EVENT_DEL, _cb_vpath_del, data); -} - -EOLIAN static void -_efl_vpath_manager_register(Eo *obj, void *pd EINA_UNUSED, int priority, Efl_Vpath *vpath) -{ - Efl_Vpath_Manager_Entry *entry = malloc(sizeof(Efl_Vpath_Manager_Entry)); - entry->vpath = vpath; - entry->priority = priority; - efl_event_callback_add(vpath, EFL_EVENT_DEL, _cb_vpath_del, obj); - vpath_manager.list = eina_list_sorted_insert - (vpath_manager.list, EINA_COMPARE_CB(_register_sort_cb), entry); -} - -EOLIAN static void -_efl_vpath_manager_unregister(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Vpath *vpath) -{ - Efl_Vpath_Manager_Entry *entry; - Eina_List *l; - - EINA_LIST_FOREACH(vpath_manager.list, l, entry) - { - if (entry->vpath == vpath) - { - vpath_manager.list = eina_list_remove_list(vpath_manager.list, l); - free(entry); - return; - } - } -} - -#include "interfaces/efl_vpath_manager.eo.c" diff --git a/src/lib/efl/interfaces/efl_vpath_manager.eo b/src/lib/efl/interfaces/efl_vpath_manager.eo deleted file mode 100644 index e2d3016..0000000 --- a/src/lib/efl/interfaces/efl_vpath_manager.eo +++ /dev/null @@ -1,30 +0,0 @@ -class Efl.Vpath.Manager (Efl.Object) -{ - [[ Vpath Manager manages multiple VPath objects that remap/download - - @since 1.18 - ]] - eo_prefix: efl_vpath_manager; - methods { - fetch @class { - [[ This class function fetches a Vpath File given an input path ]] - params { - path: string; [[ The input virtual file path to fetch ]] - } - return: Efl.Vpath.File @owned; [[ An object representing the file ]] - } - register @class { - [[Register a vpath with the manager ]] - params { - priority: int; [[ Search order - higher values tried first ]] - vpath: Efl.Vpath @nonull; [[ A Vpath implementation object ]] - } - } - unregister @class { - [[ Unregister a vpath from the manager ]] - params { - vpath: Efl.Vpath @nonull; [[ A Vpath implementation object ]] - } - } - } -}