- Formatting.

- Remove old code.


SVN revision: 29380
This commit is contained in:
Sebastian Dransfeld 2007-04-05 15:54:16 +00:00
parent d8988d3200
commit 2bc0592a68
5 changed files with 21 additions and 39 deletions

View File

@ -64,24 +64,28 @@ _edje_file_coll_open(Edje_File *edf, Eet_File *ef, const char *coll)
}
static int
_edje_font_hash (Edje_File *edf)
_edje_font_hash(Edje_File *edf)
{
int count = 0;
if (edf->font_dir)
{
Evas_List *l;
for (l = edf->font_dir->entries; l; l = evas_list_next (l))
for (l = edf->font_dir->entries; l; l = evas_list_next(l))
{
Edje_Font_Directory_Entry *fnt = l->data;
int length = strlen (fnt->entry) + 7;
char *tmp = alloca (length);
Edje_Font_Directory_Entry *fnt;
int length;
char *tmp;
snprintf (tmp, length, "fonts/%s", fnt->entry);
fnt->path = evas_stringshare_add (tmp);
evas_stringshare_del (fnt->entry);
fnt = l->data;
length = strlen(fnt->entry) + 7;
tmp = alloca(length);
snprintf(tmp, length, "fonts/%s", fnt->entry);
fnt->path = evas_stringshare_add(tmp);
evas_stringshare_del(fnt->entry);
fnt->entry = fnt->path + 6;
edf->font_hash = evas_hash_direct_add (edf->font_hash, fnt->entry, fnt);
edf->font_hash = evas_hash_direct_add(edf->font_hash, fnt->entry, fnt);
count++;
}
@ -150,7 +154,7 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co
edf->font_hash = NULL;
_edje_font_hash (edf);
_edje_font_hash(edf);
eet_close(ef);

View File

@ -682,9 +682,11 @@ _edje_part_recalc_single(Edje *ed,
if (!text) text = "";
/* check if the font is embedded in the .eet */
if (ed->file->font_hash)
if (ed->file->font_hash)
{
Edje_Font_Directory_Entry *fnt = evas_hash_find (ed->file->font_hash, font);
Edje_Font_Directory_Entry *fnt;
fnt = evas_hash_find(ed->file->font_hash, font);
if (fnt)
{

View File

@ -353,7 +353,7 @@ _edje_embryo_fn_count(Embryo_Program *ep, Embryo_Cell *params)
CHKPARAM(1);
return (Embryo_Cell) _edje_var_list_count_get(ed, (int) params[1]);
return (Embryo_Cell)_edje_var_list_count_get(ed, (int) params[1]);
}
/* remove(id, n) */

View File

@ -267,7 +267,7 @@ struct _Edje_Font_Directory
struct _Edje_Font_Directory_Entry
{
const char *entry; /* the name of the font */
char *path;
const char *path;
};

View File

@ -8,34 +8,10 @@
static int
_edje_font_is_embedded(Edje_File *edf, char *font)
{
Edje_Font_Directory_Entry *fnt = NULL;
if (!edf->font_dir) return 0;
/* fnt = evas_hash_find (edf->font_hash, font); */
/* if (fnt) */
/* if (fnt->entry && (!strcmp(fnt->entry, font))) */
/* return 1; */
return 1;
return 1;
}
#if 0
static char *
_edje_str_deescape(char *str)
{
char *s2, *s, *d;
s2 = malloc(strlen(str) + 1);
if (!s2) return NULL;
for (s = str, d = s2; *s != 0; s++, d++)
{
if ((*s == '\\') && (s[1] != 0)) s++;
*d = *s;
}
*d = 0;
return s2;
}
#endif
/* Put a \ before and Space( ), \ or ' in a string.
* A newly allocated string is returned.
*/