I surrender :)

SVN revision: 10166
This commit is contained in:
Kim Woelders 2004-05-12 00:06:26 +00:00
parent f24b13b5e9
commit 41fdbda4f4
6 changed files with 77 additions and 21 deletions

View File

@ -1,4 +1,4 @@
SUBDIRS = intl dox eesh epp src config man scripts po debian
SUBDIRS = intl dox eesh epp src config themes man scripts po debian
EXTRA_DIST = \
sample-scripts/bouncingball.pl \

View File

@ -216,6 +216,12 @@ AC_DEFINE(WITH_TARTY_WARP, 1, [Tarty Warp])
AC_SUBST(E_X_LIBS)
# The default theme
THEME=winter
THEME_FILES=winter.etheme
AC_SUBST(THEME)
AC_SUBST(THEME_FILES)
AC_OUTPUT([
Makefile
src/Makefile
@ -225,6 +231,7 @@ epp/Makefile
man/Makefile
config/Makefile
config/pix/Makefile
themes/Makefile
scripts/Makefile
scripts/enlightenment.install
po/Makefile.in

View File

@ -224,29 +224,47 @@ ListThemes(int *number)
return list;
}
static const char *
ThemeCheckPath(const char *path)
{
char s1[FILEPATH_LEN_MAX];
Esnprintf(s1, sizeof(s1), "%s/epplets/epplets.cfg", path);
if (exists(s1))
return path; /* OK */
return NULL; /* Not OK */
}
static char *
ThemeGetPath(const char *path)
{
char s1[FILEPATH_LEN_MAX], s2[FILEPATH_LEN_MAX];
const char *s;
char *ss, s1[FILEPATH_LEN_MAX], s2[FILEPATH_LEN_MAX];
int len;
Esnprintf(s1, sizeof(s1), "%s/epplets/epplets.cfg", path);
if (!exists(s1))
return NULL;
/* We only attempt to dereference a DEFAULT link */
s = strstr(path, "/DEFAULT");
if (s == NULL)
return Estrdup(path);
/* If link, dereference */
len = readlink(path, s2, sizeof(s2) - 1);
len = readlink(path, s1, sizeof(s1) - 1);
if (len < 0)
return Estrdup(path);
s2[len] = '\0';
if (isabspath(s2))
return Estrdup(s2);
Esnprintf(s1, sizeof(s1), "%s/themes/%s", path, s2);
if (isdir(s1))
s1[len] = '\0';
if (isabspath(s1))
return Estrdup(s1);
Esnprintf(s2, sizeof(s2) - strlen(s1), "%s", path);
ss = strstr(s2, "/DEFAULT");
if (ss == NULL)
return NULL;
strcpy(ss + 1, s1);
if (isdir(s2))
return Estrdup(s2);
/* We should never get here */
return NULL;
}
@ -255,10 +273,11 @@ char *
ThemeGetDefault(void)
{
static const char *const dts[] = {
"DEFAULT", "BrushedMetal-Tigert", "ShinyMetal", "winter"
"DEFAULT", "winter", "BrushedMetal-Tigert", "ShinyMetal"
};
char s[FILEPATH_LEN_MAX];
char *path, **lst;
const char *path;
char **lst;
int i, num;
/* First, try out some defaults */
@ -266,14 +285,14 @@ ThemeGetDefault(void)
for (i = 0; i < num; i++)
{
Esnprintf(s, sizeof(s), "%s/themes/%s", EDirUser(), dts[i]);
path = ThemeGetPath(s);
path = ThemeCheckPath(s);
if (path)
return path;
return ThemeGetPath(path);
Esnprintf(s, sizeof(s), "%s/themes/%s", EDirRoot(), dts[i]);
path = ThemeGetPath(s);
path = ThemeCheckPath(s);
if (path)
return path;
return ThemeGetPath(path);
}
/* Then, try out all installed themes */
@ -281,14 +300,16 @@ ThemeGetDefault(void)
lst = ListThemes(&num);
for (i = 0; i < num; i++)
{
path = ThemeGetPath(lst[i]);
path = ThemeCheckPath(lst[i]);
if (path)
break;
}
if (lst)
freestrlist(lst, num);
if (path)
return ThemeGetPath(path);
return path;
return NULL;
}
void

2
themes/.cvsignore Normal file
View File

@ -0,0 +1,2 @@
Makefile.in
Makefile

26
themes/Makefile.am Normal file
View File

@ -0,0 +1,26 @@
ethemedir = $(datadir)/themes
EXTRA_DIST = @THEME_FILES@
THEME_DIR = $(DESTDIR)$(ENLIGHTENMENT_ROOT)/themes/@THEME@
install-data-local:
$(mkinstalldirs) $(THEME_DIR)
for tf in @THEME_FILES@; do \
gzip -d -c < $(srcdir)/$$tf | (cd $(THEME_DIR); tar -xmf -); \
done
-if [ -n "$(USER)" ]; then chown -R $(USER) $(THEME_DIR); else chown -R root $(THEME_DIR); fi
uninstall-local:
-for tf in @THEME_FILES@; do \
gzip -d -c < $(srcdir)/$$tf | (cd $(THEME_DIR); \
rm -f `tar -tf -` 2>/dev/null); \
done
untar:
mkdir -p files
tar -xzvf @THEME@.etheme -C files
dotar:
tar -czvf @THEME@.etheme -C files *

BIN
themes/winter.etheme Normal file

Binary file not shown.