Tue Mar 14 22:23:27 GMT 2000

(gilbertt)

Patches from Bob Arendt <rdarendt@cwcom.net> to enable a user-configurable
cache-dir. Solves some preformance problems on NFS-mounted home directories.
Also fixes a couple of bugs with the current -econfdir option.

I've tested this fairly well, as has Bob, but let me know if there are any
problems.


SVN revision: 2232
This commit is contained in:
Tom Gilbert 2000-03-14 22:29:04 +00:00
parent f250c01e99
commit 10f1ff3ae7
22 changed files with 1266 additions and 1191 deletions

View File

@ -4304,3 +4304,16 @@ Tue Mar 14 20:23:53 CET 2000
Added patch from Masahiko Mori <masa@cthulhu.engr.sgi.com>
to improve localization support (I modified the patch somewhat).
-------------------------------------------------------------------------------
Tue Mar 14 22:23:27 GMT 2000
(gilbertt)
Patches from Bob Arendt <rdarendt@cwcom.net> to enable a user-configurable
cache-dir. Solves some preformance problems on NFS-mounted home directories.
Also fixes a couple of bugs with the current -econfdir option.
I've tested this fairly well, as has Bob, but let me know if there are any
problems.

1948
src/E.h

File diff suppressed because it is too large Load Diff

View File

@ -1181,11 +1181,11 @@ doMoveEnd(void *params)
if (gwins[i]->floating)
MoveEwinToDesktopAt(gwins[i], d,
gwins[i]->x - (desks.desk[d].x -
desks.desk[gwins[i]->
desktop].x),
desks.
desk[gwins[i]->desktop].x),
gwins[i]->y - (desks.desk[d].y -
desks.desk[gwins[i]->
desktop].y));
desks.
desk[gwins[i]->desktop].y));
else
MoveEwinToDesktopAt(gwins[i], d, gwins[i]->x, gwins[i]->y);
gwins[i]->floating = 0;

View File

@ -337,13 +337,13 @@ SetCurrentArea(int ax, int ay)
lst[i]->x -
(root.w *
(ax -
desks.desk[desks.current].
current_area_x)),
desks.desk[desks.
current].current_area_x)),
lst[i]->y -
(root.h *
(ay -
desks.desk[desks.current].
current_area_y)));
desks.desk[desks.
current].current_area_y)));
if (setflip)
mode.flipp = 0;
lst[i]->area_x = a1;
@ -374,13 +374,13 @@ SetCurrentArea(int ax, int ay)
x -
(root.w *
(ax -
desks.desk[desks.current].
current_area_x)),
desks.desk[desks.
current].current_area_x)),
y -
(root.h *
(ay -
desks.desk[desks.current].
current_area_y)));
desks.desk[desks.
current].current_area_y)));
}
}
/* if we're not moving it... move it across */
@ -399,13 +399,13 @@ SetCurrentArea(int ax, int ay)
lst[i]->x -
(root.w *
(ax -
desks.desk[desks.current].
current_area_x)),
desks.desk[desks.
current].current_area_x)),
lst[i]->y -
(root.h *
(ay -
desks.desk[desks.current].
current_area_y)));
desks.desk[desks.
current].current_area_y)));
if (setflip)
mode.flipp = 0;
lst[i]->area_x = a1;

View File

@ -1163,8 +1163,7 @@ CalcEwinWinpart(EWin * ewin, int i)
ewin->border->part[i].geom.topleft.x.absolute +
ewin->bits[topleft].x;
y =
((ewin->
border->part[i].geom.topleft.y.percent *
((ewin->border->part[i].geom.topleft.y.percent *
ewin->bits[topleft].h) >> 10) +
ewin->border->part[i].geom.topleft.y.absolute +
ewin->bits[topleft].y;
@ -1173,12 +1172,12 @@ CalcEwinWinpart(EWin * ewin, int i)
if (bottomright == -1)
{
ox =
((ewin->
border->part[i].geom.bottomright.x.percent * ewin->w) >> 10) +
((ewin->border->
part[i].geom.bottomright.x.percent * ewin->w) >> 10) +
ewin->border->part[i].geom.bottomright.x.absolute;
oy =
((ewin->
border->part[i].geom.bottomright.y.percent * ewin->h) >> 10) +
((ewin->border->
part[i].geom.bottomright.y.percent * ewin->h) >> 10) +
ewin->border->part[i].geom.bottomright.y.absolute;
}
else if (bottomright >= 0)
@ -2592,9 +2591,8 @@ MinShadeSize(EWin * ewin, int *mw, int *mh)
(ewin->w - ewin->border->border.right) > rightborderwidth)
rightborderwidth =
(ewin->bits[i].x + ewin->bits[i].w) - (ewin->w -
ewin->
border->border.
right);
ewin->border->
border.right);
}
}
ewin->w = rightborderwidth + leftborderwidth;
@ -2620,9 +2618,8 @@ MinShadeSize(EWin * ewin, int *mw, int *mh)
bottomborderwidth)
bottomborderwidth =
(ewin->bits[i].y + ewin->bits[i].h) - (ewin->h -
ewin->
border->border.
bottom);
ewin->border->
border.bottom);
}
}
ewin->h = bottomborderwidth + topborderwidth;

View File

@ -1168,7 +1168,7 @@ BorderPartLoad(FILE * ConfigFile, char type, Border * b)
int flags = FLAG_BUTTON;
char isregion = 0, keepshade = 1;
int wmin = 0, wmax = 0, hmin = 0, hmax = 0, torigin = 0,
txp = 0, txa = 0, typ = 0, tya = 0, borigin = 0;
txp = 0, txa = 0, typ = 0, tya = 0, borigin = 0;
int bxp = 0, bxa = 0, byp = 0, bya = 0;
int fields;
@ -1438,7 +1438,7 @@ Config_Button(FILE * ConfigFile)
{
bt = CreateButton(name, ic, ac, tc, label, ontop, flags,
minw, maxw, minh, maxh, xo, yo, xa, xr, ya,
yr, xsr, xsa, ysr, ysa, simg, desk, sticky);
yr, xsr, xsa, ysr, ysa, simg, desk, sticky);
bt->default_show = show;
bt->internal = internal;
AddItem(bt, bt->name, 0, LIST_TYPE_BUTTON);
@ -2234,7 +2234,7 @@ Config_ActionClass(FILE * ConfigFile)
{
action_tooltipstring = Erealloc(action_tooltipstring,
(strlen(action_tooltipstring)
+ strlen(atword(s, 2)) + 2));
+ strlen(atword(s, 2)) + 2));
action_tooltipstring = strcat(action_tooltipstring, "\n");
action_tooltipstring =
strcat(action_tooltipstring, atword(s, 2));
@ -2272,7 +2272,7 @@ Config_ActionClass(FILE * ConfigFile)
RecoverUserConfig();
Alert(_
("Warning: Configuration appears to have ended before we were\n"
"Done loading an Action Class block. Outcome is likely not good.\n"));
"Done loading an Action Class block. Outcome is likely not good.\n"));
}
void
@ -3134,7 +3134,7 @@ Config_WindowMatch(FILE * ConfigFile)
}
}
Alert(_("Warning: Configuration appears to have ended before we were\n"
"Done loading an WindowMatch block. Outcome is likely not good.\n"));
"Done loading an WindowMatch block. Outcome is likely not good.\n"));
}
int
@ -3186,7 +3186,7 @@ OpenConfigFileForReading(char *path, char preprocess)
"Enlightenment is looking for epp here:\n"
"%s\n"
"This is a FATAL ERROR.\n"
"This is probably due to either the program not existing or\n"
"This is probably due to either the program not existing or\n"
"it not being able to be executed by you.\n"), epp_path);
doExit(_("error"));
}
@ -3224,6 +3224,8 @@ OpenConfigFileForReading(char *path, char preprocess)
"-D ENLIGHTENMENT_BIN=%s%s " "-D X11ROOT=%s "
#endif
"-D ENLIGHTENMENT_THEME=%s "
"-D ECONFDIR=%s "
"-D ECACHEDIR=%s "
"-D SCREEN_RESOLUTION_%ix%i=1 "
"-D SCREEN_WIDTH_%i=1 "
"-D SCREEN_HEIGHT_%i=1 "
@ -3244,12 +3246,12 @@ OpenConfigFileForReading(char *path, char preprocess)
x11root, ENLIGHTENMENT_ROOT,
x11root, ENLIGHTENMENT_BIN, x11root,
#endif
themepath,
themepath, UserEDir(), UserCacheDir(),
root.w, root.h, root.w, root.h, root.depth,
def_user, def_home, def_shell, path, UserEDir(), s);
def_user, def_home, def_shell, path, UserCacheDir(), s);
system(execline);
Esnprintf(execline, sizeof(execline),
"%s/cached/cfg/%s.preparsed", UserEDir(), s);
"%s/cached/cfg/%s.preparsed", UserCacheDir(), s);
#ifndef __EMX__
fpin = fopen(execline, "r");
#else
@ -3307,7 +3309,7 @@ LoadConfigFile(char *f)
i++;
}
Esnprintf(s, sizeof(s), "cached/cfg/%s.preparsed", s2);
Esnprintf(s, sizeof(s), "%s/cached/cfg/%s.preparsed", UserCacheDir(), s2);
if (strstr(f, "control.cfg"))
notheme = 1;
@ -3412,7 +3414,7 @@ LoadOpenConfigFile(FILE * ConfigFile)
"Enlightenment's\n"
"it may be that you haven't upgraded "
"Enlightenment for\n"
"a while and this theme takes advantages of new\n"
"a while and this theme takes advantages of new\n"
"features in Enlightenment in new versions.\n"),
e_cfg_ver, min_e_cfg_ver);
RESET_ALERT;
@ -3434,8 +3436,8 @@ LoadOpenConfigFile(FILE * ConfigFile)
"be compatible.\n"
"\n"
"If you just upgraded to a new version of E\n"
"Restarting with Defaults will remove your current\n"
"user preferences and start cleanly with system\n"
"Restarting with Defaults will remove your current\n"
"user preferences and start cleanly with system\n"
"defaults. You can then modify your "
"configuration to\n"
"your liking again safely.\n"),
@ -3678,7 +3680,7 @@ LoadEConfig(char *themelocation)
"permissions or lack of disk space. It also could be that the\n"
"config directory has been inadvertently deleted since\n"
"installation.\n"
"This is a serious problem and should be rectified immediately\n"
"This is a serious problem and should be rectified immediately\n"
"Please contact your system administrator or package "
"maintainer.\n"
"If you are the administrator of your own system please\n"
@ -3692,8 +3694,7 @@ LoadEConfig(char *themelocation)
{
Progressbar *p = NULL;
int i;
char *config_files[] =
{
char *config_files[] = {
"init.cfg",
"control.cfg",
"textclasses.cfg",
@ -4160,12 +4161,12 @@ RecoverUserConfig(void)
_("Yes, Attempt recovery"),
_("Restart and try again"), _("Quit and give up"));
Alert(_
("Enlightenment has encountered parsing errors in your autosaved\n"
"configuration.\n" "\n"
"This may be due to filing system errors, Minor bugs or"
" unforeseen\n" "system shutdowns.\n" "\n"
"Do you wish Enlightenment to recover its original system\n"
"configuration and try again?\n"));
("Enlightenment has encountered parsing errors in your autosaved\n"
"configuration.\n" "\n"
"This may be due to filing system errors, Minor bugs or"
" unforeseen\n" "system shutdowns.\n" "\n"
"Do you wish Enlightenment to recover its original system\n"
"configuration and try again?\n"));
RESET_ALERT;
mode.autosave = 0;
MapUnmap(1);

View File

@ -1081,8 +1081,8 @@ DialogRealizeItem(Dialog * d, DItem * di)
ImlibImage *im;
im =
ELoadImage(di->item.slider.ic_border->norm.normal->
im_file);
ELoadImage(di->item.slider.ic_border->norm.
normal->im_file);
if (im)
{
di->item.slider.border_orig_w = im->rgb_width;
@ -1356,25 +1356,23 @@ DialogRealizeItem(Dialog * d, DItem * di)
dii->item.check_button.check_win,
dii->x, dii->y +
((dii->h -
dii->item.
check_button.check_orig_h) /
2),
dii->item.check_button.
check_orig_w,
dii->item.check_button.
check_orig_h);
dii->item.check_button.
check_orig_h) / 2),
dii->item.
check_button.check_orig_w,
dii->item.
check_button.check_orig_h);
if (dii->type == DITEM_RADIOBUTTON)
EMoveResizeWindow(disp,
dii->item.radio_button.radio_win,
dii->x, dii->y +
((dii->h -
dii->item.
radio_button.radio_orig_h) /
2),
dii->item.radio_button.
radio_orig_w,
dii->item.radio_button.
radio_orig_h);
dii->item.radio_button.
radio_orig_h) / 2),
dii->item.
radio_button.radio_orig_w,
dii->item.
radio_button.radio_orig_h);
if (dii->type == DITEM_AREA)
{
dii->item.area.w = dii->w -
@ -1884,7 +1882,8 @@ DialogItemAreaSetSize(DItem * di, int w, int h)
di->item.area.h = h;
}
Window DialogItemAreaGetWindow(DItem * di)
Window
DialogItemAreaGetWindow(DItem * di)
{
return di->item.area.area_win;
}

View File

@ -494,7 +494,8 @@ HandleMotion(XEvent * ev)
(gwins
[i]->reqx,
gwins[i]->x,
mode.edge_snap_dist)))))))
mode.
edge_snap_dist)))))))
{
jumpx = 1;
ndx = gwins[i]->reqx - gwins[i]->x + dx;
@ -517,7 +518,8 @@ HandleMotion(XEvent * ev)
(gwins
[i]->reqy,
gwins[i]->y,
mode.edge_snap_dist)))))))
mode.
edge_snap_dist)))))))
{
jumpy = 1;
ndy = gwins[i]->reqy - gwins[i]->y + dy;
@ -980,8 +982,8 @@ HandleMotion(XEvent * ev)
{
di->item.slider.wanted_val += dy;
di->item.slider.val = di->item.slider.lower +
((((di->
item.slider.base_h - di->item.slider.knob_h -
((((di->item.
slider.base_h - di->item.slider.knob_h -
di->item.slider.wanted_val) *
(di->item.slider.upper -
di->item.slider.lower)) /
@ -2507,13 +2509,13 @@ HandleMouseUp(XEvent * ev)
HideEwin(gwins[i]);
MoveEwin(gwins[i], gwin_px[i] +
((desks.desk
[gwins[i]->desktop].
current_area_x) -
[gwins[i]->
desktop].current_area_x) -
p->hi_ewin->area_x) * root.w,
gwin_py[i] +
((desks.
desk[gwins[i]->desktop].
current_area_y) -
((desks.desk
[gwins[i]->
desktop].current_area_y) -
p->hi_ewin->area_y) * root.h);
if (was_shaded != gwins[i]->shaded)
InstantShadeEwin(gwins[i]);

View File

@ -263,8 +263,7 @@ cp(char *s, char *ss)
EDBUG_RETURN_;
}
time_t
moddate(char *s)
time_t moddate(char *s)
{
struct stat st;

View File

@ -1699,8 +1699,8 @@ IPC_ImageClass(char *params, Client * c)
if (iclass->norm.normal->real_file)
im =
Imlib_load_image(id,
iclass->norm.normal->
real_file);
iclass->norm.
normal->real_file);
if (im)
{
Esnprintf(buf, sizeof(buf),

View File

@ -105,10 +105,6 @@ main(int argc, char **argv)
{
int j = 0;
/* Set a default location for the "previous session" data when
* we do not actually have a previous session. */
SetSMFile(NULL);
/* Now we're going to interpret any of the commandline parameters
* that are passed to it -- Well, at least the ones that we
* understand.
@ -124,6 +120,10 @@ main(int argc, char **argv)
{
SetEDir(argv[++j]);
}
else if ((!strcmp("-ecachedir", argv[j])) && (argc - j > 1))
{
SetCacheDir(argv[++j]);
}
else if ((!strcmp("-display", argv[j])) && (argc - j > 1))
{
dstr = argv[++j];
@ -163,6 +163,7 @@ main(int argc, char **argv)
printf("enlightenment options: \n"
"\t-theme /path/to/theme \n"
"\t-econfdir /path/to/.enlightenment/conf/dir\n"
"\t-ecachedir /path/to/cached/dir \n"
"\t[-smid | -clientId | --sm-client-id] id \n"
"\t-smfile file \n"
"\t-ext_init_win window_id \n"
@ -181,6 +182,10 @@ main(int argc, char **argv)
exit(0);
}
}
/* Set a default location for the "previous session" data when
* we do not actually have a previous session. */
SetSMFile(NULL);
}
if (themepath[0] == 0)

View File

@ -684,7 +684,7 @@ RealizeMenu(Menu * m)
{
int i, maxh = 0, maxw =
0, maxx1, maxx2, w, h, x, y, r, mmw, mmh;
0, maxx1, maxx2, w, h, x, y, r, mmw, mmh;
unsigned int iw, ih;
ImlibImage *im;
XSetWindowAttributes att;
@ -1016,10 +1016,10 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
struct stat st;
const char *chmap =
#ifndef __EMX__
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
#else
"0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>“”•˜<EFBFBD>-_";
"0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>“”•˜<EFBFBD>-_";
#endif
FILE *f;
@ -1047,7 +1047,7 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
cc = st.st_ctime;
Esnprintf(cs, sizeof(cs),
"%s/cached/img/.%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
UserEDir(),
UserCacheDir(),
chmap[(aa >> 0) & 0x3f],
chmap[(aa >> 6) & 0x3f],
chmap[(aa >> 12) & 0x3f],
@ -1100,14 +1100,13 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ImlibColor icl;
char tile = 1, keep_asp = 0;
int width, height, scalex =
0, scaley = 0;
int scr_asp, im_asp, w2,
h2;
0, scaley = 0;
int scr_asp, im_asp, w2, h2;
int maxw = 48, maxh = 48;
int justx = 512, justy = 512;
Esnprintf(s2, sizeof(s2), "%s/cached/img/%s",
UserEDir(), s3);
UserCacheDir(), s3);
width = im->rgb_width;
height = im->rgb_height;
h2 = maxh;
@ -1193,7 +1192,8 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ic = CreateIclass();
ic->name = duplicate("`");
ic->norm.normal = CreateImageState();
Esnprintf(stmp, sizeof(stmp), "cached/img/%s", s3);
Esnprintf(stmp, sizeof(stmp), "%s/cached/img/%s",
UserCacheDir(), s3);
ic->norm.normal->im_file = duplicate(stmp);
ic->norm.normal->unloadable = 1;
IclassPopulate(ic);
@ -1319,7 +1319,7 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
chmap[(cc >> 6) & 0x3f],
chmap[(cc >> 12) & 0x3f],
chmap[(cc >> 18) & 0x3f],
chmap[(cc >> 24) & 0x3f], chmap[(cc >> 28) & 0x3f]);
chmap[(cc >> 24) & 0x3f], chmap[(cc >> 28) & 0x3f]);
bg =
(Background *) FindItem(s3, 0, LIST_FINDBY_NAME,
LIST_TYPE_BACKGROUND);
@ -1334,12 +1334,12 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ImlibColor icl;
char tile = 1, keep_asp = 0;
int width, height, scalex =
0, scaley = 0;
0, scaley = 0;
int scr_asp, im_asp, w2, h2;
int maxw = 48, maxh = 48;
Esnprintf(s2, sizeof(s2), "%s/cached/img/%s",
UserEDir(), s3);
UserCacheDir(), s3);
width = im->rgb_width;
height = im->rgb_height;
h2 = maxh;
@ -1412,7 +1412,8 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ic = CreateIclass();
ic->name = duplicate("`");
ic->norm.normal = CreateImageState();
Esnprintf(stmp, sizeof(stmp), "cached/img/%s", s3);
Esnprintf(stmp, sizeof(stmp), "%s/cached/img/%s",
UserCacheDir(), s3);
ic->norm.normal->im_file = duplicate(stmp);
ic->norm.normal->unloadable = 1;
IclassPopulate(ic);
@ -1702,7 +1703,7 @@ CreateMenuFromGnome(char *name, MenuStyle * ms, char *dir)
if (f)
{
char *iname = NULL, *exec = NULL, *texec =
NULL, *tmp;
NULL, *tmp;
char *en_name = NULL;
while (fgets(s, sizeof(s), f))
@ -1714,7 +1715,8 @@ CreateMenuFromGnome(char *name, MenuStyle * ms, char *dir)
else if (name_buf[0] &&
!strncmp(s, name_buf, strlen(name_buf)))
iname = duplicate(&(s[strlen(name_buf)]));
else if (!strncmp(s, "TryExec=", strlen("TryExec=")))
else
if (!strncmp(s, "TryExec=", strlen("TryExec=")))
texec = duplicate(&(s[strlen("TryExec=")]));
else if (!strncmp(s, "Exec=", strlen("Exec=")))
exec = duplicate(&(s[strlen("Exec=")]));

View File

@ -29,6 +29,7 @@ extern char *__XOS2RedirRoot(const char *);
void EdgeTimeout(int val, void *data);
static char *dir = NULL;
static char *cacheDir = NULL;
void
BlumFlimFrub(void)
@ -157,6 +158,20 @@ UserEDir(void)
return dir;
}
void
SetCacheDir(char *d)
{
cacheDir = duplicate(d);
}
char *
UserCacheDir(void)
{
if (!cacheDir)
cacheDir = duplicate(UserEDir());
return cacheDir;
}
int
EExit(void *code)
{

View File

@ -126,7 +126,8 @@ GetNetText(char *URL)
}
time_t GetNetFileDate(char *URL)
time_t
GetNetFileDate(char *URL)
{
#ifdef AUTOUPGRADE

View File

@ -1008,8 +1008,9 @@ PagerRedraw(Pager * p, char newbg)
uniq = GetUniqueBGString(desks.desk[p->desktop].bg);
Esnprintf(s, sizeof(s),
"%s/cached/pager/%s.%i.%i.%s",
UserEDir(), desks.desk[p->desktop].bg->name,
(p->w / ax), (p->h / ay), uniq);
UserCacheDir(),
desks.desk[p->desktop].bg->name, (p->w / ax),
(p->h / ay), uniq);
Efree(uniq);
im = Imlib_load_image(id, s);

View File

@ -37,7 +37,8 @@ static Window sc_window = 0;
static Atom sc_atom = 0;
static ImlibData *imd = NULL;
Window SC_GetDestWin(void)
Window
SC_GetDestWin(void)
{
return 0;
}

View File

@ -558,15 +558,18 @@ doSMExit(void *params)
if (themepath[0] != 0)
{
Esnprintf(sss, sizeof(sss),
"exec %s -single -ext_init_win %i -theme %s -display %s",
command, w, themename, dstr);
"exec %s -single -ext_init_win %i -theme %s "
"-econfdir %s -ecachedir %s -display %s",
command, w, themename,
UserEDir(), UserCacheDir(), dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
}
else
{
Esnprintf(sss, sizeof(sss),
"exec %s -single -ext_init_win %i -display %s",
command, w, dstr);
"exec %s -single -ext_init_win %i "
"-econfdir %s -ecachedir %s -display %s",
command, w, UserEDir(), UserCacheDir(), dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
}
}
@ -580,8 +583,9 @@ doSMExit(void *params)
disp = NULL;
sscanf(params, "%*s %1000s", s);
Esnprintf(sss, sizeof(sss),
"exec %s -single -ext_init_win %i -theme %s -display %s",
command, w, s, dstr);
"exec %s -single -ext_init_win %i -theme %s "
"-econfdir %s -ecachedir %s -display %s",
command, w, s, UserEDir(), UserCacheDir(), dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
}
else if (!strcmp(s, "restart_wm"))
@ -597,7 +601,9 @@ doSMExit(void *params)
if (atword(params, 2))
strncpy(s, atword(params, 2), 1000);
real_exec = (char *)Emalloc(strlen(s) + 6);
sprintf(real_exec, "exec %s -display %s", s, dstr);
sprintf(real_exec, "exec %s "
"-econfdir %s -ecachedir %s -display %s",
s, UserEDir(), UserCacheDir(), dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", "exec",
real_exec, NULL);
}
@ -675,6 +681,10 @@ set_save_props(SmcConn smc_conn, int master_flag)
char *smid = "-smid";
char *single = "-single";
char *smfile = "-smfile";
char *econfdir = "-econfdir";
char *e_conf_dir;
char *ecachedir = "-ecachedir";
char *e_cache_dir;
char *extinitwin = "-ext_init_win";
char *sh = "sh";
char *c = "-c";
@ -761,6 +771,8 @@ set_save_props(SmcConn smc_conn, int master_flag)
style = SmRestartNever;
user = username(getuid());
e_conf_dir = UserEDir();
e_cache_dir = UserCacheDir();
/* The SM specs state that the SmProgram should be the argument passed
* to execve. Passing argv[0] is close enough. */
program = command;
@ -808,6 +820,14 @@ set_save_props(SmcConn smc_conn, int master_flag)
restartVal[n++].value = smid;
restartVal[n].length = strlen(sm_client_id);
restartVal[n++].value = sm_client_id;
restartVal[n].length = strlen(econfdir);
restartVal[n++].value = econfdir;
restartVal[n].length = strlen(e_conf_dir);
restartVal[n++].value = e_conf_dir;
restartVal[n].length = strlen(ecachedir);
restartVal[n++].value = ecachedir;
restartVal[n].length = strlen(e_cache_dir);
restartVal[n++].value = e_cache_dir;
restartProp.num_vals = n;
@ -1203,14 +1223,18 @@ doSMExit(void *params)
if (sm_client_id)
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i -theme %s "
"-econfdir %s -ecachedir %s "
"-smfile %s -smid %s -display %s",
command, init_win_ext, themename,
UserEDir(), UserCacheDir(),
sm_file, sm_client_id, dstr);
else
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i -theme %s "
"-econfdir %s -ecachedir %s "
"-smfile %s -display %s",
command, init_win_ext, themename, sm_file, dstr);
command, init_win_ext, themename,
UserEDir(), UserCacheDir(), sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
}
else
@ -1218,13 +1242,18 @@ doSMExit(void *params)
if (sm_client_id)
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i "
"-econfdir %s -ecachedir %s "
"-smfile %s -smid %s -display %s",
command, init_win_ext, sm_file, sm_client_id, dstr);
command, init_win_ext,
UserEDir(), UserCacheDir(),
sm_file, sm_client_id, dstr);
else
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i"
"-econfdir %s -ecachedir %s "
"-smfile %s -display %s",
command, init_win_ext, sm_file, dstr);
command, init_win_ext,
UserEDir(), UserCacheDir(), sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
}
}
@ -1245,14 +1274,17 @@ doSMExit(void *params)
if (sm_client_id)
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i -theme %s "
"-econfdir %s -ecachedir %s "
"-smfile %s -smid %s -display %s",
command, init_win_ext, userthemepath,
sm_file, sm_client_id, dstr);
UserEDir(), UserCacheDir(), sm_file, sm_client_id, dstr);
else
Esnprintf(s, sizeof(s),
"exec %s -ext_init_win %i -theme %s "
"-econfdir %s -ecachedir %s "
"-smfile %s -single -display %s",
command, init_win_ext, userthemepath, sm_file, dstr);
command, init_win_ext, userthemepath,
UserEDir(), UserCacheDir(), sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
}
else if (!strcmp((char *)s, "error"))

View File

@ -2044,7 +2044,7 @@ CB_ConfigureBG(int val, void *data)
ImlibImage *im;
Pixmap p2;
Esnprintf(s, sizeof(s), "%s/cached/bgsel/%s", UserEDir(),
Esnprintf(s, sizeof(s), "%s/cached/bgsel/%s", UserCacheDir(),
tmp_bg->name);
p2 = ECreatePixmap(disp, root.win, 64, 48, root.depth);
SetBackgroundTo(id, p2, tmp_bg, 0);
@ -2487,13 +2487,13 @@ BG_RedrawView(char nuke_old)
}
else
{
Esnprintf(s, sizeof(s), "cached/bgsel/%s",
bglist[i]->name);
Esnprintf(s, sizeof(s), "%s/cached/bgsel/%s",
UserCacheDir(), bglist[i]->name);
im = ELoadImage(s);
if (!im)
{
Esnprintf(s, sizeof(s), "%s/cached/bgsel/%s",
UserEDir(), bglist[i]->name);
UserCacheDir(), bglist[i]->name);
p2 = ECreatePixmap(disp, pmap, 64, 48, id->x.depth);
SetBackgroundTo(id, p2, bglist[i], 0);
XCopyArea(disp, p2, pmap, gc, 0, 0, 64, 48, x + 4,

View File

@ -684,27 +684,27 @@ SetupDirs()
md(s);
else
ChkDir(s);
Esnprintf(s, sizeof(s), "%s/cached", UserEDir());
Esnprintf(s, sizeof(s), "%s/cached", UserCacheDir());
if (!exists(s))
md(s);
else
ChkDir(s);
Esnprintf(s, sizeof(s), "%s/cached/img", UserEDir());
Esnprintf(s, sizeof(s), "%s/cached/img", UserCacheDir());
if (!exists(s))
md(s);
else
ChkDir(s);
Esnprintf(s, sizeof(s), "%s/cached/cfg", UserEDir());
Esnprintf(s, sizeof(s), "%s/cached/cfg", UserCacheDir());
if (!exists(s))
md(s);
else
ChkDir(s);
Esnprintf(s, sizeof(s), "%s/cached/bgsel", UserEDir());
Esnprintf(s, sizeof(s), "%s/cached/bgsel", UserCacheDir());
if (!exists(s))
md(s);
else
ChkDir(s);
Esnprintf(s, sizeof(s), "%s/cached/pager", UserEDir());
Esnprintf(s, sizeof(s), "%s/cached/pager", UserCacheDir());
if (!exists(s))
md(s);
else
@ -730,6 +730,8 @@ SetupEnv()
Esnprintf(s, sizeof(s), "%i", getpid());
Esetenv("EPID", s, 1);
Esetenv("ETHEME", themepath, 1);
Esetenv("ECONFDIR", UserEDir(), 1);
Esetenv("ECACHEDIR", UserCacheDir(), 1);
#ifdef __EMX__
Esetenv("EMXSHELL", "sh.exe", 1);
@ -737,7 +739,8 @@ SetupEnv()
return;
}
Window MakeExtInitWin(void)
Window
MakeExtInitWin(void)
{
Display *d2;
Window win;

View File

@ -2,7 +2,7 @@
__E_CFG_VERSION 0
BEGIN_NEW_FILE_MENU("APPS_SUBMENU", "ROOT", HOME_DIR"/.enlightenment/file.menu")
BEGIN_NEW_FILE_MENU("APPS_SUBMENU", "ROOT", ECONFDIR"/file.menu")
END_MENU
/*
BEGIN_NEW_MENU("APPS_SUBMENU", "ROOT")
@ -41,7 +41,7 @@ END_MENU
/* recursively scan $HOME/.enlightenment.backgrounds and build menu if images
* are there */
BEGIN_NEW_DIRSCAN_MENU("BACKGROUNDS_MENU", "ROOT_IMAGE", HOME_DIR"/.enlightenment/backgrounds")
BEGIN_NEW_DIRSCAN_MENU("BACKGROUNDS_MENU", "ROOT_IMAGE", ECONFDIR"/backgrounds")
ADD_MENU_TITLE("Backgrounds")
END_MENU

View File

@ -679,8 +679,8 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.normal->im),
x, y);
@ -702,11 +702,12 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -722,11 +723,12 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -742,11 +744,12 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -762,11 +765,12 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -782,11 +786,12 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
break;
@ -806,17 +811,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -830,17 +834,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -854,17 +857,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -878,17 +880,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -902,17 +903,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -926,17 +926,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -950,17 +949,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}
@ -974,17 +972,16 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
rgb_height);
ic->norm.normal->
im->rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->
norm.normal->
im),
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->
norm.normal->
im), x, y);
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width;
}
}

15
src/x.c
View File

@ -40,7 +40,8 @@ EFreePixmap(Display * display, Pixmap pixmap)
XFreePixmap(display, pixmap);
}
Window ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
Window
ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
{
EXID *xid;
Window win;
@ -586,7 +587,8 @@ DelXID(Window win)
}
}
Window ECreateEventWindow(Window parent, int x, int y, int w, int h)
Window
ECreateEventWindow(Window parent, int x, int y, int w, int h)
{
Window win;
XSetWindowAttributes attr;
@ -602,7 +604,8 @@ Window ECreateEventWindow(Window parent, int x, int y, int w, int h)
* create a window which will accept the keyboard focus when no other
* windows have it
*/
Window ECreateFocusWindow(Window parent, int x, int y, int w, int h)
Window
ECreateFocusWindow(Window parent, int x, int y, int w, int h)
{
Window win;
XSetWindowAttributes attr;
@ -736,7 +739,8 @@ WinExists(Window win)
EDBUG_RETURN(0);
}
Window WindowAtXY_0(Window base, int bx, int by, int x, int y)
Window
WindowAtXY_0(Window base, int bx, int by, int x, int y)
{
Window *list = NULL;
XWindowAttributes att;
@ -783,7 +787,8 @@ Window WindowAtXY_0(Window base, int bx, int by, int x, int y)
EDBUG_RETURN(base);
}
Window WindowAtXY(int x, int y)
Window
WindowAtXY(int x, int y)
{
Window *list = NULL;
Window child = 0, parent_win = 0, root_win = 0;