11
static Eet_Data_Descriptor *_srcfile_edd = NULL;
12
static Eet_Data_Descriptor *_srcfile_list_edd = NULL;
14
static Eet_Data_Descriptor *_external_edd = NULL;
15
static Eet_Data_Descriptor *_external_list_edd = NULL;
17
static Eet_Data_Descriptor *_font_edd = NULL;
18
static Eet_Data_Descriptor *_font_list_edd = NULL;
20
static SrcFile_List srcfiles = {NULL};
25
Eet_Data_Descriptor_Class eddc;
27
eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), "srcfile", sizeof (SrcFile));
28
_srcfile_edd = eet_data_descriptor_stream_new(&eddc);
29
EET_DATA_DESCRIPTOR_ADD_BASIC(_srcfile_edd, SrcFile, "name", name, EET_T_INLINED_STRING);
30
EET_DATA_DESCRIPTOR_ADD_BASIC(_srcfile_edd, SrcFile, "file", file, EET_T_INLINED_STRING);
32
eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), "srcfile_list", sizeof (SrcFile_List));
33
_srcfile_list_edd = eet_data_descriptor_stream_new(&eddc);
34
EET_DATA_DESCRIPTOR_ADD_LIST(_srcfile_list_edd, SrcFile_List, "list", list, _srcfile_edd);
36
eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), "external", sizeof (External));
37
_external_edd = eet_data_descriptor_stream_new(&eddc);
38
EET_DATA_DESCRIPTOR_ADD_BASIC(_external_edd, External, "name", name, EET_T_INLINED_STRING);
40
eet_eina_stream_data_descriptor_class_set(&eddc, sizeof (eddc), "external_list", sizeof (External_List));
41
_external_list_edd = eet_data_descriptor_stream_new(&eddc);
42
EET_DATA_DESCRIPTOR_ADD_LIST(_external_list_edd, External_List, "list", list, _external_edd);
44
_edje_data_font_list_desc_make(&_font_list_edd, &_font_edd);
47
static void source_fetch_file(const char *fil, const char *filname);
50
source_fetch_file(const char *fil, const char *filname)
53
char buf[16 * 1024], *dir = NULL;
62
ERR("Cannot open file '%s'", fil);
66
if (fseek(f, 0, SEEK_END) < 0)
69
if (fseek(f, 0, SEEK_SET) < 0)
71
sf = mem_alloc(SZ(SrcFile));
72
sf->name = mem_strdup(filname);
73
sf->file = mem_alloc(sz + 1);
76
tmp = fread(sf->file, sz, 1, f);
79
ERR("file length for (%s) doesn't match!", filname);
85
if (fseek(f, 0, SEEK_SET) < 0)
87
srcfiles.list = eina_list_append(srcfiles.list, sf);
89
while (fgets(buf, sizeof(buf), f))
94
char *file = NULL, *fname = NULL;
97
while ((!forgetit) && (*p))
110
if (!strncmp(p, "include", 7))
122
else if (!strncmp(p, "#include", 8))
137
if (*p == '"') end = '"';
143
pp = strchr(p + 1, end);
155
dir = ecore_file_dir_get(fil);
156
if (dir) dir_len = strlen(dir);
159
l = pp - p + dir_len + 1;
164
snprintf(file, l - 1, "%s", p + 1);
169
snprintf(file, l, "%s/%s", dir, p + 1);
173
fname = strdup(p + 1);
174
pp = strrchr(fname, end);
186
if ((file) && (fname))
187
source_fetch_file(file, fname);
189
if (file) free(file);
190
if (fname) free(fname);
199
source_fetch_file(file_in, ecore_file_file_get(file_in));
203
source_append(Eet_File *ef)
205
return eet_data_write(ef, _srcfile_list_edd, "edje_sources", &srcfiles,
210
source_load(Eet_File *ef)
214
s = eet_data_read(ef, _srcfile_list_edd, "edje_sources");
219
source_fontmap_save(Eet_File *ef, Eina_List *font_list)
224
return eet_data_write(ef, _font_list_edd, "edje_source_fontmap", &fl,
229
source_fontmap_load(Eet_File *ef)
233
fl = eet_data_read(ef, _font_list_edd, "edje_source_fontmap");