Added ecore_config_evas_font_path_apply to control the font path locations in all edje apps

SVN revision: 9497
This commit is contained in:
handyande 2004-03-27 14:57:23 +00:00 committed by handyande
parent f745104f97
commit 4a9e1528df
5 changed files with 49 additions and 3 deletions

View File

@ -7,6 +7,7 @@ ipc_main.lo
ipc_ecore.lo
util.lo
edb.lo
convenience.lo
libecore_config.la
ecore_config_ipc_ecore.la
system.db

View File

@ -32,6 +32,8 @@
#endif
#include <Ecore_Ipc.h>
/* this should only be included if evas is present */
#include <Evas.h>
/* debug */
#define DEBUG 1
@ -185,3 +187,7 @@ int ecore_config_save_file(char *file);
# define ECORE_CONFIG_ERR_SUCC (0)
#endif
/* convenience mathods in convenience.c */
int ecore_config_evas_font_path_apply(Evas *evas);

View File

@ -3,7 +3,7 @@
INCLUDES = \
-I$(top_srcdir)/src/lib/ecore \
-I$(top_srcdir)/src/lib/ecore_ipc \
-I$(top_srcdir)/
-I$(top_srcdir)/ @evas_cflags@
DB = system.db
CLEANFILES = $(DB)
@ -27,10 +27,11 @@ libecore_config_la_SOURCES = \
ecore_config.c \
ipc_main.c \
util.c \
edb.c
edb.c \
convenience.c
libecore_config_la_LIBADD = \
$(top_builddir)/src/lib/ecore/libecore.la -ldl
$(top_builddir)/src/lib/ecore/libecore.la -ldl @evas_libs@
libecore_config_la_DEPENDENCIES = \
$(top_builddir)/src/lib/ecore/libecore.la

View File

@ -1,6 +1,9 @@
#!/bin/sh
DB=system.db
edb_ed $DB add /e/theme/name str "winter"
EDJE_BIN=`which edje`
EDJE_DIR=`dirname $EDJE_BIN`
edb_ed $DB add /e/font/path str "$EDJE_DIR/../share/edje/data/test/fonts"
if [ $BROWSER ]; then
edb_ed $DB add /apps/web/browser str "$BROWSER"
else

View File

@ -0,0 +1,35 @@
#include "Ecore_Config.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* this should only be built if evas is present */
int
ecore_config_evas_font_path_apply (Evas * evas)
{
char *font_path, *font_path_tmp, *ptr, *end;
font_path = ecore_config_get_string ("/e/font/path");
if (!font_path)
return ECORE_CONFIG_ERR_NODATA;
ptr = font_path;
end = font_path + strlen (font_path);
font_path_tmp = font_path;
while (ptr && ptr < end)
{
while (*ptr != '|' && ptr < end)
ptr++;
if (ptr < end)
*ptr = '\0';
printf("appending font %s\n", font_path_tmp);
evas_font_path_append (evas, font_path_tmp);
ptr++;
font_path_tmp = ptr;
}
free (font_path);
}