summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_vpath_file_core.c
blob: e0328e7fb9ee560f9cada00cb36bf7d1e6ef08b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#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"