Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/edje
Dir : e17/libs/edje/src/lib
Modified Files:
edje_cache.c edje_calc.c edje_load.c edje_private.h
edje_text.c edje_textblock_styles.c
Log Message:
revert cedrics patch for font stuff - it breaks textblocks
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_cache.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- edje_cache.c 2 Jul 2006 06:18:18 -0000 1.7
+++ edje_cache.c 3 Jul 2006 06:15:05 -0000 1.8
@@ -63,32 +63,6 @@
return edc;
}
-static int
-_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))
- {
- Edje_Font_Directory_Entry *fnt = l->data;
- int length = strlen (fnt->entry) + 7;
- char *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);
-
- count++;
- }
- }
- return count;
-}
-
static Edje_File *
_edje_file_open(const char *file, const char *coll, int *error_ret,
Edje_Part_Collection **edc_ret)
{
@@ -129,19 +103,18 @@
_edje_textblock_style_parse_and_fix(edf);
- if (coll)
+ if (!coll)
{
- edc = _edje_file_coll_open(edf, ef, coll);
- if (!edc)
- {
- *error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION;
- }
- if (edc_ret) *edc_ret = edc;
+ eet_close(ef);
+ return edf;
}
-
- edf->font_hash = NULL;
- _edje_font_hash (edf);
+ edc = _edje_file_coll_open(edf, ef, coll);
+ if (!edc)
+ {
+ *error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION;
+ }
+ if (edc_ret) *edc_ret = edc;
eet_close(ef);
return edf;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_calc.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- edje_calc.c 2 Jul 2006 06:18:18 -0000 1.79
+++ edje_calc.c 3 Jul 2006 06:15:05 -0000 1.80
@@ -592,14 +592,24 @@
if (!text) text = "";
/* check if the font is embedded in the .eet */
- if (ed->file->font_hash)
+ /* FIXME: we should cache this result */
+ if (ed->file->font_dir)
{
- Edje_Font_Directory_Entry *fnt = evas_hash_find
(ed->file->font_hash, font);
-
- if (fnt)
+ Evas_List *l;
+
+ for (l = ed->file->font_dir->entries; l; l = l->next)
{
- font = fnt->path;
- inlined_font = 1;
+ Edje_Font_Directory_Entry *fnt = l->data;
+
+ if ((fnt->entry) && (!strcmp(fnt->entry, font)))
+ {
+ strcpy(buf, "fonts/");
+ strncpy(buf + 6, font, sizeof(buf) - 7);
+ buf[sizeof(buf) - 1] = 0;
+ font = buf;
+ inlined_font = 1;
+ break;
+ }
}
}
if (inlined_font) evas_object_text_font_source_set(ep->object,
ed->path);
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_load.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -3 -r1.85 -r1.86
--- edje_load.c 2 Jul 2006 06:18:18 -0000 1.85
+++ edje_load.c 3 Jul 2006 06:15:05 -0000 1.86
@@ -612,8 +612,7 @@
fe = edf->font_dir->entries->data;
edf->font_dir->entries =
evas_list_remove(edf->font_dir->entries, fe);
- edf->font_hash = evas_hash_del (edf->font_hash, fe->entry, NULL);
- if (fe->path) evas_stringshare_del(fe->path);
+ if (fe->entry) evas_stringshare_del(fe->entry);
free(fe);
}
free(edf->font_dir);
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -3 -r1.109 -r1.110
--- edje_private.h 2 Jul 2006 06:18:18 -0000 1.109
+++ edje_private.h 3 Jul 2006 06:15:05 -0000 1.110
@@ -222,7 +222,6 @@
int feature_ver;
Evas_Hash *collection_hash;
- Evas_Hash *font_hash;
Evas_List *collection_cache;
};
@@ -260,7 +259,6 @@
struct _Edje_Font_Directory_Entry
{
char *entry; /* the name of the font */
- char *path;
};
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_text.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- edje_text.c 2 Jul 2006 06:18:18 -0000 1.55
+++ edje_text.c 3 Jul 2006 06:15:05 -0000 1.56
@@ -284,14 +284,24 @@
if (!font) font = "";
/* check if the font is embedded in the .eet */
- if (ed->file->font_hash)
+ /* FIXME: we should cache this result */
+ if (ed->file->font_dir)
{
- Edje_Font_Directory_Entry *fnt = evas_hash_find (ed->file->font_hash,
font);
-
- if (fnt)
+ Evas_List *l;
+
+ for (l = ed->file->font_dir->entries; l; l = l->next)
{
- font = fnt->path;
- inlined_font = 1;
+ Edje_Font_Directory_Entry *fnt = l->data;
+
+ if ((fnt->entry) && (!strcmp(fnt->entry, font)))
+ {
+ strcpy(font_buf, "fonts/");
+ strncpy(font_buf + 6, font, sizeof(font_buf) - 7);
+ font_buf[sizeof(font_buf) - 1] = 0;
+ font = font_buf;
+ inlined_font = 1;
+ break;
+ }
}
}
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_textblock_styles.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- edje_textblock_styles.c 2 Jul 2006 06:18:18 -0000 1.8
+++ edje_textblock_styles.c 3 Jul 2006 06:15:05 -0000 1.9
@@ -8,14 +8,17 @@
static int
_edje_font_is_embedded(Edje_File *edf, char *font)
{
- if (!edf->font_hash) return 0;
-
- Edje_Font_Directory_Entry *fnt = evas_hash_find (edf->font_hash, font);
+ Evas_List *l;
- if (fnt)
- return 1;
-
- return 0;
+ if (!edf->font_dir) return 0;
+ for (l = edf->font_dir->entries; l; l = l->next)
+ {
+ Edje_Font_Directory_Entry *fnt = l->data;
+
+ if ((fnt->entry) && (!strcmp(fnt->entry, font)))
+ return 1;
+ }
+ return 1;
}
#if 0
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs