summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_vpath_manager.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2018-02-18 21:58:57 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-02-22 09:35:02 +0100
commit8c7ba8c3a31ec671ccd6d7d30682dbd631d69a62 (patch)
tree44a0765c48d0ba37df1c1b7be4a006dbccfa9948 /src/lib/efl/interfaces/efl_vpath_manager.c
parentc4f33c67a8d75888b21a0f464b0b1c82bd55bd0b (diff)
lets delete efl_vpath
Its not used anymore. ref T5314
Diffstat (limited to 'src/lib/efl/interfaces/efl_vpath_manager.c')
-rw-r--r--src/lib/efl/interfaces/efl_vpath_manager.c88
1 files changed, 0 insertions, 88 deletions
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 @@
1#include "config.h"
2#include "Efl.h"
3
4#define MY_CLASS EFL_VPATH_MANAGER_CLASS
5
6typedef struct _Efl_Vpath_Manager_Data Efl_Vpath_Manager_Data;
7typedef struct _Efl_Vpath_Manager_Entry Efl_Vpath_Manager_Entry;
8
9struct _Efl_Vpath_Manager_Data
10{
11 Eina_List *list;
12};
13
14struct _Efl_Vpath_Manager_Entry
15{
16 Efl_Vpath *vpath;
17 int priority;
18};
19
20static Efl_Vpath_Manager_Data vpath_manager =
21{
22 NULL
23};
24
25EOLIAN static Efl_Vpath_File *
26_efl_vpath_manager_fetch(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *path)
27{
28 Efl_Vpath_Manager_Entry *entry;
29 Eina_List *l;
30 Efl_Vpath_File *file;
31
32 EINA_LIST_FOREACH(vpath_manager.list, l, entry)
33 {
34 file = efl_vpath_fetch(entry->vpath, path);
35 if (file) return file;
36 }
37 file = efl_add(EFL_VPATH_FILE_CLASS, NULL);
38 if (file)
39 {
40 efl_vpath_file_path_set(file, path);
41 efl_vpath_file_result_set(file, path);
42 }
43 return file;
44}
45
46static int
47_register_sort_cb(Efl_Vpath_Manager_Entry *e1, Efl_Vpath_Manager_Entry *e2)
48{
49 // sort higher numbers first in list
50 return (e2->priority - e1->priority);
51}
52
53static void
54_cb_vpath_del(void *data, const Efl_Event *event)
55{
56 efl_vpath_manager_unregister(EFL_VPATH_MANAGER_CLASS, event->object);
57 efl_event_callback_del(event->object, EFL_EVENT_DEL, _cb_vpath_del, data);
58}
59
60EOLIAN static void
61_efl_vpath_manager_register(Eo *obj, void *pd EINA_UNUSED, int priority, Efl_Vpath *vpath)
62{
63 Efl_Vpath_Manager_Entry *entry = malloc(sizeof(Efl_Vpath_Manager_Entry));
64 entry->vpath = vpath;
65 entry->priority = priority;
66 efl_event_callback_add(vpath, EFL_EVENT_DEL, _cb_vpath_del, obj);
67 vpath_manager.list = eina_list_sorted_insert
68 (vpath_manager.list, EINA_COMPARE_CB(_register_sort_cb), entry);
69}
70
71EOLIAN static void
72_efl_vpath_manager_unregister(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Vpath *vpath)
73{
74 Efl_Vpath_Manager_Entry *entry;
75 Eina_List *l;
76
77 EINA_LIST_FOREACH(vpath_manager.list, l, entry)
78 {
79 if (entry->vpath == vpath)
80 {
81 vpath_manager.list = eina_list_remove_list(vpath_manager.list, l);
82 free(entry);
83 return;
84 }
85 }
86}
87
88#include "interfaces/efl_vpath_manager.eo.c"