summaryrefslogtreecommitdiff
path: root/filelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'filelist.c')
-rw-r--r--filelist.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/filelist.c b/filelist.c
index 62fd93c..1271f6f 100644
--- a/filelist.c
+++ b/filelist.c
@@ -76,7 +76,7 @@ extern Tcl_Interp *xcinterp;
extern Display *dpy;
extern XCWindowData *areawin;
extern ApplicationData appdata;
-extern int *appcolors;
+extern colorindex *colorlist;
extern short popups; /* total number of popup windows */
extern char _STR2[250];
extern char _STR[150];
@@ -149,7 +149,7 @@ void startfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event)
#endif
XSetFunction(dpy, areawin->gc, GXcopy);
- XSetForeground(dpy, areawin->gc, AUXCOLOR);
+ XSetForeground(dpy, areawin->gc, colorlist[AUXCOLOR].color.pixel);
XSetLineAttributes(dpy, areawin->gc, 1, LineSolid, CapRound, JoinMiter);
/* draw initial box */
@@ -158,7 +158,8 @@ void startfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event)
dragfilebox(w, NULL, (XMotionEvent *)event);
XSetFunction(dpy, areawin->gc, GXxor);
- XSetForeground(dpy, areawin->gc, AUXCOLOR ^ BACKGROUND);
+ XSetForeground(dpy, areawin->gc, colorlist[AUXCOLOR].color.pixel ^
+ colorlist[BACKGROUND].color.pixel);
}
/*-------------------------------------------------------------------------*/
@@ -182,8 +183,8 @@ void endfiletrack(xcWidget w, caddr_t clientdata, XCrossingEvent *event)
#endif
/* Restore graphics state values */
- XSetForeground(dpy, areawin->gc, areawin->gccolor);
- XSetFunction(dpy, areawin->gc, areawin->gctype);
+ XSetForeground(dpy, areawin->gc, colorlist[areawin->gccolor].color.pixel);
+ XSetFunction(dpy, areawin->gc, GXcopy);
}
#endif
@@ -232,10 +233,15 @@ void crashrecover()
if (xobjs.tempfile != NULL) {
unlink(xobjs.tempfile);
free(xobjs.tempfile);
+ xobjs.tempfile = NULL;
+ }
+ if (strlen(_STR2) == 0) {
+ Wprintf("Error: No temp file name for crash recovery!");
+ }
+ else {
+ xobjs.tempfile = strdup(_STR2);
+ startloadfile(-1);
}
- xobjs.tempfile = strdup(_STR2);
-
- startloadfile(-1);
}
/*----------------------------------------------------------------------*/
@@ -378,7 +384,7 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
filter = okaystruct->filter;
if (sgc == NULL) {
- values.foreground = FOREGROUND;
+ values.foreground = colorlist[FOREGROUND].color.pixel;
values.font = appdata.filefont->fid;
values.function = GXcopy;
values.graphics_exposures = False;
@@ -417,9 +423,9 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
/* print "Invalid Directory" to the file list window. */
if (cwd == NULL) {
- XSetForeground(dpy, sgc, BACKGROUND);
+ XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel);
XFillRectangle(dpy, lwin, sgc, 0, 0, textwidth, textheight);
- XSetForeground(dpy, sgc, AUXCOLOR);
+ XSetForeground(dpy, sgc, colorlist[AUXCOLOR].color.pixel);
XDrawString(dpy, lwin, sgc, 10, textheight / 2,
"(Invalid Directory)", 19);
return;
@@ -476,19 +482,19 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
/* Write the filenames onto the pixmap */
- XSetForeground(dpy, sgc, BACKGROUND);
+ XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel);
XFillRectangle(dpy, flistpix, sgc, 0, 0, textwidth, pixheight);
- XSetForeground(dpy, sgc, FOREGROUND);
+ XSetForeground(dpy, sgc, colorlist[FOREGROUND].color.pixel);
for (n = 0; n < flfiles; n++) {
switch (files[n].filetype) {
case DIRECTORY:
- XSetForeground(dpy, sgc, SELECTCOLOR);
+ XSetForeground(dpy, sgc, colorlist[SELECTCOLOR].color.pixel);
break;
case MATCH:
- XSetForeground(dpy, sgc, FILTERCOLOR);
+ XSetForeground(dpy, sgc, colorlist[FILTERCOLOR].color.pixel);
break;
case NONMATCH:
- XSetForeground(dpy, sgc, FOREGROUND);
+ XSetForeground(dpy, sgc, colorlist[FOREGROUND].color.pixel);
break;
}
XDrawString(dpy, flistpix, sgc, 10, 10 + FILECHARASCENT + n * FILECHARHEIGHT,
@@ -498,7 +504,7 @@ void listfiles(xcWidget w, popupstruct *okaystruct, caddr_t calldata)
/* Copy the pixmap of filenames into the file list window */
- XSetForeground(dpy, sgc, BACKGROUND);
+ XSetForeground(dpy, sgc, colorlist[BACKGROUND].color.pixel);
XFillRectangle(dpy, lwin, sgc, 0, 0, textwidth, textheight);
XCopyArea(dpy, flistpix, lwin, sgc, 0, flstart * FILECHARHEIGHT,
textwidth, textheight, 0, 0);
@@ -604,7 +610,7 @@ void fileselect(xcWidget w, popupstruct *okaystruct, XButtonEvent *event)
/* highlight the entry. . . */
- XSetForeground(dpy, sgc, AUXCOLOR);
+ XSetForeground(dpy, sgc, colorlist[AUXCOLOR].color.pixel);
XDrawString(dpy, flistpix, sgc, 10, 10 + FILECHARASCENT + filenum * FILECHARHEIGHT,
files[filenum].filename, strlen(files[filenum].filename));
XCopyArea(dpy, flistpix, lwin, sgc, 0, flstart * FILECHARHEIGHT,
@@ -709,7 +715,7 @@ void showlscroll(xcWidget w, caddr_t clientdata, caddr_t calldata)
pstart = (flstart * sheight) / flfiles;
pheight = (finscr * sheight) / flfiles;
- XSetForeground(dpy, sgc, BARCOLOR);
+ XSetForeground(dpy, sgc, colorlist[BARCOLOR].color.pixel);
XFillRectangle(dpy, swin, sgc, 0, pstart, swidth, pheight);
}
flcurrent = -1;