diff -rcN kterm-6.2.0.DIST/Imakefile kterm-6.2.0-wp-BGP/Imakefile *** kterm-6.2.0.DIST/Imakefile Fri Jul 12 14:01:04 1996 --- kterm-6.2.0-wp-BGP/Imakefile Fri Jul 3 22:26:55 1998 *************** *** 32,38 **** -DOSMINORVERSION=$(OSMINORVERSION) MISC_DEFINES = /* -DALLOWLOGFILEEXEC */ XKB_DEFINES = XkbClientDefines ! DEFINES = $(XKB_DEFINES) $(XPOLL_DEF) -DKTERM -DSTATUSLINE -DKEEPALIVE #ifdef KTERM_XIM XIMSRCS = xim.c --- 32,38 ---- -DOSMINORVERSION=$(OSMINORVERSION) MISC_DEFINES = /* -DALLOWLOGFILEEXEC */ XKB_DEFINES = XkbClientDefines ! DEFINES = $(XKB_DEFINES) $(XPOLL_DEF) -DKTERM -DSTATUSLINE -DKEEPALIVE -DWALLPAPER #ifdef KTERM_XIM XIMSRCS = xim.c *************** *** 57,62 **** --- 57,63 ---- SRCS = $(SRCS1) OBJS = $(OBJS1) DEPLIBS1 = XkbClientDepLibs XawClientDepLibs + XPMLIB = -lXpm PROGRAMS = kterm #ifndef TermcapLibrary *************** *** 80,88 **** SpecialCObjectRule(charproc,$(_NOOP_),$(MISC_DEFINES)) #if InstallXtermSetUID ! SetUIDProgramTarget(kterm,$(OBJS1),$(DEPLIBS1),XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(PTYLIB)) #else ! NormalProgramTarget(kterm,$(OBJS1),$(DEPLIBS1),XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(PTYLIB)) #endif #if InstallXtermSetUID && defined(SunArchitecture) && HasSharedLibraries && OSMajorVersion < 5 --- 81,89 ---- SpecialCObjectRule(charproc,$(_NOOP_),$(MISC_DEFINES)) #if InstallXtermSetUID ! SetUIDProgramTarget(kterm,$(OBJS1),$(DEPLIBS1),XkbClientLibs XawClientLibs,$(XPMLIB) $(TERMCAPLIB) $(PTYLIB)) #else ! NormalProgramTarget(kterm,$(OBJS1),$(DEPLIBS1),XkbClientLibs XawClientLibs,$(XPMLIB) $(TERMCAPLIB) $(PTYLIB)) #endif #if InstallXtermSetUID && defined(SunArchitecture) && HasSharedLibraries && OSMajorVersion < 5 *************** *** 101,107 **** install:: kterm MakeDir($(DESTDIR)$(BINDIR)) RemoveFile(kterm.inst) ! LinkRule(kterm.inst,$(CDEBUGFLAGS) $(CCOPTIONS) $(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS),$(OBJS1),$(LDOVERRIDE) XawClientLibs $(LDRESUME) $(LDLIBS) $(TERMCAPLIB) $(PTYLIB)) $(INSTALL) -c $(INSTPGMFLAGS) $(INSTUIDFLAGS) kterm.inst $(DESTDIR)$(BINDIR)/kterm RemoveFile(kterm.inst) #else --- 102,108 ---- install:: kterm MakeDir($(DESTDIR)$(BINDIR)) RemoveFile(kterm.inst) ! LinkRule(kterm.inst,$(CDEBUGFLAGS) $(CCOPTIONS) $(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS),$(OBJS1),$(LDOVERRIDE) XawClientLibs $(LDRESUME) $(LDLIBS) $(XPMLIB) $(TERMCAPLIB) $(PTYLIB)) $(INSTALL) -c $(INSTPGMFLAGS) $(INSTUIDFLAGS) kterm.inst $(DESTDIR)$(BINDIR)/kterm RemoveFile(kterm.inst) #else diff -rcN kterm-6.2.0.DIST/Tekproc.c kterm-6.2.0-wp-BGP/Tekproc.c *** kterm-6.2.0.DIST/Tekproc.c Fri Jul 12 14:01:40 1996 --- kterm-6.2.0-wp-BGP/Tekproc.c Fri Jul 3 22:28:39 1998 *************** *** 1541,1546 **** --- 1541,1550 ---- TekBackground(screen) register TScreen *screen; { + #ifdef WALLPAPER + extern int BackgroundPixmapIsOn; + if(!BackgroundPixmapIsOn) + #endif /* WALLPAPER */ if(TWindow(screen)) XSetWindowBackground(screen->display, TWindow(screen), screen->Tbackground); *************** *** 1569,1575 **** --- 1573,1583 ---- if (toggle == TOGGLE) { if (screen->select || screen->always_highlight) + #ifdef WALLPAPER + FillRectangle(screen->display, TWindow(screen), + #else /* WALLPAPER */ XFillRectangle(screen->display, TWindow(screen), + #endif /* WALLPAPER */ screen->TcursorGC, x, y, cellwidth, cellheight); else { /* fix to use different GC! */ diff -rcN kterm-6.2.0.DIST/charproc.c kterm-6.2.0-wp-BGP/charproc.c *** kterm-6.2.0.DIST/charproc.c Fri Jul 12 14:01:36 1996 --- kterm-6.2.0-wp-BGP/charproc.c Fri Jul 3 22:26:55 1998 *************** *** 2451,2457 **** --- 2451,2462 ---- FlushScroll(screen); cx = CursorX(screen, screen->cur_col); cy = CursorY(screen, screen->cur_row)+screen->fnt_norm->ascent; + #ifdef WALLPAPER + DrawImageString(screen, screen->fnt_norm->ascent, reverse, + screen->display, TextWindow(screen), currentGC, + #else /* WALLPAPER */ XDrawImageString(screen->display, TextWindow(screen), currentGC, + #endif /* WALLPAPER */ cx, cy, str, len); if((fgs & BOLD) && screen->enbolden) *************** *** 3884,3889 **** --- 3889,3897 ---- GC currentGC; #endif /* !KTERM */ Boolean in_selection; + #ifdef WALLPAPER + int reverse; + #endif /* WALLPAPER */ if (eventMode != NORMAL) return; *************** *** 3933,3938 **** --- 3941,3949 ---- if (( (flags & INVERSE) && !in_selection) || (!(flags & INVERSE) && in_selection)){ /* text is reverse video */ + #ifdef WALLPAPER + reverse = 0; + #endif /* WALLPAPER */ if (screen->cursorGC) { currentGC = screen->cursorGC; } else { *************** *** 3943,3948 **** --- 3954,3962 ---- } } } else { /* normal video */ + #ifdef WALLPAPER + reverse = 1; + #endif /* WALLPAPER */ if (screen->reversecursorGC) { currentGC = screen->reversecursorGC; } else { *************** *** 3957,3964 **** --- 3971,3984 ---- if (( (flags & INVERSE) && !in_selection) || (!(flags & INVERSE) && in_selection)) { /* text is reverse video */ + #ifdef WALLPAPER + reverse = 1; + #endif /* WALLPAPER */ currentGC = screen->reverseGC; } else { /* normal video */ + #ifdef WALLPAPER + reverse = 0; + #endif /* WALLPAPER */ currentGC = screen->normalGC; } *************** *** 3967,3973 **** --- 3987,3998 ---- x = CursorX (screen, screen->cur_col); y = CursorY(screen, screen->cur_row) + screen->fnt_norm->ascent; + #ifdef WALLPAPER + DrawImageString(screen, screen->fnt_norm->ascent, reverse, + screen->display, TextWindow(screen), currentGC, + #else /* WALLPAPER */ XDrawImageString(screen->display, TextWindow(screen), currentGC, + #endif /* WALLPAPER */ x, y, (char *) &c, 1); if((flags & BOLD) && screen->enbolden) /* no bold font */ *************** *** 4010,4015 **** --- 4035,4043 ---- char c; #endif /* !KTERM */ Boolean in_selection; + #ifdef WALLPAPER + int reverse; + #endif /* WALLPAPER */ #ifdef STATUSLINE Boolean in_status = (screen->cursor_row > screen->max_row); *************** *** 4052,4063 **** --- 4080,4097 ---- #else /* !KTERM */ if (( (flags & INVERSE) && !in_selection) || (!(flags & INVERSE) && in_selection)) { + #ifdef WALLPAPER + reverse = 1; + #endif /* WALLPAPER */ if(flags & BOLD) { currentGC = screen->reverseboldGC; } else { currentGC = screen->reverseGC; } } else { + #ifdef WALLPAPER + reverse = 0; + #endif /* WALLPAPER */ if(flags & BOLD) { currentGC = screen->normalboldGC; } else { *************** *** 4075,4081 **** --- 4109,4120 ---- screen->border; # endif /* !STATUSLINE */ y = y+screen->fnt_norm->ascent; + #ifdef WALLPAPER + DrawImageString(screen, screen->fnt_norm->ascent, reverse, + screen->display, TextWindow(screen), currentGC, + #else /* WALLPAPER */ XDrawImageString(screen->display, TextWindow(screen), currentGC, + #endif /* WALLPAPER */ x, y, &c, 1); if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), currentGC, *************** *** 4257,4263 **** --- 4296,4306 ---- j = screen->max_col + 1); bzero(screen->buf[i + 1], j) ; # endif /* !KTERM */ + #ifdef WALLPAPER + FillRectangle(screen->display, TextWindow(screen), + #else /* WALLPAPER */ XFillRectangle(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ screen->reversestatus ? screen->normalGC : screen->reverseGC, screen->border - 1 + screen->scrollbar, Height(screen) + screen->border * 2 + 1, diff -rcN kterm-6.2.0.DIST/main.c kterm-6.2.0-wp-BGP/main.c *** kterm-6.2.0.DIST/main.c Fri Jul 12 14:01:38 1996 --- kterm-6.2.0-wp-BGP/main.c Fri Jul 3 22:29:38 1998 *************** *** 610,615 **** --- 610,618 ---- #ifdef KEEPALIVE Boolean keepalive; #endif + #ifdef WALLPAPER + char *wallpaper; + #endif /* WALLPAPER */ } resource; /* used by VT (charproc.c) */ *************** *** 649,654 **** --- 652,661 ---- {"keepAlive", "KeepAlive", XtRBoolean, sizeof (Boolean), offset(keepalive), XtRString, "false"}, #endif /* KEEPALIVE */ + #ifdef WALLPAPER + {"wallPaper", "WallPaper", XtRString, sizeof (char *), + offset(wallpaper), XtRString, (caddr_t)NULL}, + #endif /* WALLPAPER */ }; #undef offset *************** *** 770,775 **** --- 777,785 ---- {"+vb", "*visualBell", XrmoptionNoArg, (caddr_t) "off"}, {"-wf", "*waitForMap", XrmoptionNoArg, (caddr_t) "on"}, {"+wf", "*waitForMap", XrmoptionNoArg, (caddr_t) "off"}, + #ifdef WALLPAPER + {"-wp", "*wallPaper", XrmoptionSepArg, (caddr_t) NULL}, + #endif /* WALLPAPER */ /* bogus old compatibility stuff for which there are standard XtAppInitialize options now */ #ifndef KTERM_NOTEK *************** *** 880,885 **** --- 890,898 ---- #endif { "-/+vb", "turn on/off visual bell" }, { "-/+wf", "turn on/off wait for map before command exec" }, + #ifdef WALLPAPER + { "-wp filename.xpm", "wallpaper image filename" }, + #endif /* WALLPAPER */ { "-e command args ...", "command to execute" }, { "%geom", "Tek window geometry" }, { "#geom", "icon window geometry" }, *************** *** 1016,1021 **** --- 1029,1037 ---- # ifdef KEEPALIVE printopt(" [KEEPALIVE]"); # endif + # ifdef WALLPAPER + printopt(" [WALLPAPER]"); + # endif fprintf (stderr, "\n"); exit (0); *************** *** 1087,1092 **** --- 1103,1187 ---- extern fd_set X_mask; extern fd_set pty_mask; + #ifdef WALLPAPER + + #include + + Pixmap BackgroundPixmap = NULL; + Pixmap BackgroundPixmap_shape = NULL; + int BackgroundPixmapIsOn = 0; + static XpmAttributes imageattr; + + void + FillRectangle(display, d, gc, x, y, width, height) + Display *display; + Drawable d; + GC gc; + int x; + int y; + unsigned int width; + unsigned int height; + { + int sx, sy, dx, dy, w, h; + + if(BackgroundPixmapIsOn){ + XClearArea(display, d, x, y, width, height, 0); + }else{ + XFillRectangle(display, d, gc, x, y, width, height); + } + } + + void + DrawImageString(screen, ascent, reverse, display, d, gc, x, y, string, length) + TScreen *screen; + int ascent; + int reverse; + Display *display; + Drawable d; + GC gc; + int x; + int y; + char *string; + int length; + { + if (!reverse && (BackgroundPixmapIsOn)){ + FillRectangle(display, d, gc, x, y - ascent, FontWidth(screen) * length, FontHeight(screen)); + XDrawString(display, d, gc, x, y, string, length); + } + else{ + XDrawImageString(display, d, gc, x, y, string, length); + } + } + + void + DrawImageString16(screen, ascent, reverse, display, d, gc, x, y, string, length) + TScreen *screen; + int ascent; + int reverse; + Display *display; + Drawable d; + GC gc; + int x; + int y; + XChar2b *string; + int length; + { + int i, len = 0; + + for (i = 0; i < length; i++){ + len += (string[i].byte1 == 0x00) ? 1 : 2; + } + if (!reverse && (BackgroundPixmapIsOn)){ + FillRectangle(display, d, gc, x, y - ascent, FontWidth(screen) * len, FontHeight(screen)); + XDrawString16(display, d, gc, x, y, string, length); + } + else{ + XDrawImageString16(display, d, gc, x, y, string, length); + } + } + + #endif /* WALLPAPER */ + main (argc, argv) int argc; char **argv; *************** *** 1651,1656 **** --- 1746,1786 ---- #endif /* DEBUG */ XSetErrorHandler(xerror); XSetIOErrorHandler(xioerror); + #ifdef WALLPAPER + if (resource.wallpaper){ + int result; + + imageattr.valuemask = XpmColormap; + imageattr.x_hotspot = 0; + imageattr.y_hotspot = 0; + imageattr.depth = DefaultDepth(XtDisplay(toplevel), 0); + imageattr.colormap = DefaultColormap(XtDisplay(toplevel), 0); + + if ((result = XpmReadFileToPixmap(XtDisplay(toplevel), + XtWindow(toplevel), + resource.wallpaper, + &BackgroundPixmap, + &BackgroundPixmap_shape, + &imageattr)) != XpmSuccess){ + fprintf(stderr, "XpmReadFileToImage(\"%s\") : %s\n", + resource.wallpaper, XpmGetErrorString(result)); + } + else{ + XSetWindowBackgroundPixmap(XtDisplay(toplevel), + XtWindow(toplevel), + BackgroundPixmap); + if(BackgroundPixmap_shape != NULL) + XFreePixmap(XtDisplay(toplevel), + BackgroundPixmap_shape); + XpmFreeAttributes(&imageattr); + XSetWindowBackgroundPixmap(XtDisplay(term), + XtWindow(term), + ParentRelative); + XFreePixmap(XtDisplay(toplevel), BackgroundPixmap); + BackgroundPixmapIsOn = 1; + } + } + #endif /* WALLPAPER */ for( ; ; ) { #ifndef KTERM_NOTEK if(screen->TekEmu) { diff -rcN kterm-6.2.0.DIST/screen.c kterm-6.2.0-wp-BGP/screen.c *** kterm-6.2.0.DIST/screen.c Sun Jun 23 17:00:26 1996 --- kterm-6.2.0-wp-BGP/screen.c Fri Jul 3 22:29:58 1998 *************** *** 556,561 **** --- 556,569 ---- int scrollamt = screen->scroll_amt; int max = screen->max_row; + #ifdef WALLPAPER + { + extern int BackgroundPixmapIsOn; + if (BackgroundPixmapIsOn){ + force = True; + } + } + #endif /* WALLPAPER */ #ifdef STATUSLINE if(screen->cursor_col >= leftcol && screen->cursor_col <= (leftcol + ncols - 1) *************** *** 587,592 **** --- 595,603 ---- GC gc; #endif /* !KTERM */ Boolean hilite; + #ifdef WALLPAPER + int reverse; + #endif /* WALLPAPER */ #ifdef STATUSLINE if (row > screen->max_row) { /* implies (row > screen->bot_marg) */ *************** *** 606,612 **** --- 617,627 ---- } if (leftcol + ncols - 1 >= screen->max_col) width += screen->border; + # ifdef WALLPAPER + FillRectangle(screen->display, TextWindow(screen), + # else /* WALLPAPER */ XFillRectangle(screen->display, TextWindow(screen), + # endif /* WALLPAPER */ screen->reversestatus ? screen->normalGC : screen->reverseGC, left, Height(screen) + screen->border * 2, width, screen->statusheight); *************** *** 691,706 **** # ifdef STATUSLINE if (((!hilite && (flags & INVERSE) != 0) || (hilite && (flags & INVERSE) == 0)) ! ^ (row > screen->max_row && screen->reversestatus)) # else /* !STATUSLINE */ if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) # endif /* !STATUSLINE */ if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! else if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; x = CursorX(screen, col); #endif /* !KTERM */ --- 706,729 ---- # ifdef STATUSLINE if (((!hilite && (flags & INVERSE) != 0) || (hilite && (flags & INVERSE) == 0)) ! ^ (row > screen->max_row && screen->reversestatus)) { # else /* !STATUSLINE */ if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) { # endif /* !STATUSLINE */ + # ifdef WALLPAPER + reverse = 1; + # endif /* WALLPAPER */ if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! } ! else { ! # ifdef WALLPAPER ! reverse = 0; ! # endif /* WALLPAPER */ if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; + } x = CursorX(screen, col); #endif /* !KTERM */ *************** *** 714,720 **** --- 737,748 ---- ScreenDraw(screen, row + topline, lastind, col, flags, False); #else /* !KTERM */ if (attrs[col] != flags) { + #ifdef WALLPAPER + DrawImageString(screen, /*0*/screen->max_ascent, reverse, + screen->display, TextWindow(screen), + #else /* WALLPAPER */ XDrawImageString(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ gc, x, y, (char *) &chars[lastind], n = col - lastind); if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), *************** *** 769,782 **** ^ (row > screen->max_row && screen->reversestatus)) # else /* !STATUSLINE */ if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) # endif /* !STATUSLINE */ if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! else if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; XDrawImageString(screen->display, TextWindow(screen), gc, x, y, (char *) &chars[lastind], n = col - lastind); if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), gc, --- 797,823 ---- ^ (row > screen->max_row && screen->reversestatus)) # else /* !STATUSLINE */ if ( (!hilite && (flags & INVERSE) != 0) || ! (hilite && (flags & INVERSE) == 0) ) { # endif /* !STATUSLINE */ + # ifdef WALLPAPER + reverse = 1; + # endif /* WALLPAPER */ if (flags & BOLD) gc = screen->reverseboldGC; else gc = screen->reverseGC; ! } ! else { ! # ifdef WALLPAPER ! reverse = 0; ! # endif /* WALLPAPER */ if (flags & BOLD) gc = screen->normalboldGC; else gc = screen->normalGC; + } + #ifdef WALLPAPER + DrawImageString(screen, /*0*/screen->max_ascent, reverse, + screen->display, TextWindow(screen), gc, + #else /* WALLPAPER */ XDrawImageString(screen->display, TextWindow(screen), gc, + #endif /* WALLPAPER */ x, y, (char *) &chars[lastind], n = col - lastind); if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), gc, *************** *** 1147,1152 **** --- 1188,1196 ---- char drawbuf[256], *dbuf = drawbuf; int n, c; int x, y; + # ifdef WALLPAPER + int reverse; + # endif /* WALLPAPER */ x = CursorX(screen, col); y = CursorY(screen, row); *************** *** 1193,1198 **** --- 1237,1245 ---- LoadOneFont(screen, True, screen->menu_font_number, fnum, True); if (flags & INVERSE) { + # ifdef WALLPAPER + reverse = 1; + # endif /* WALLPAPER */ if (hilitecursor && screen->reversecursorGC) gc = screen->reversecursorGC; else if (flags & BOLD) *************** *** 1200,1205 **** --- 1247,1255 ---- else gc = screen->reverseGC; } else { + # ifdef WALLPAPER + reverse = 0; + # endif /* WALLPAPER */ if (hilitecursor && screen->cursorGC) gc = screen->cursorGC; else if (flags & BOLD) *************** *** 1243,1249 **** --- 1293,1304 ---- #ifdef KTERM_MBCS if (gset & MBCS) { + #ifdef WALLPAPER + DrawImageString16(screen, screen->max_ascent, reverse, + screen->display, TextWindow(screen), + #else /* WALLPAPER */ XDrawImageString16(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ gc, x, Y, dbuf2, n); if (flags & BOLD && screen->normalboldGC == screen->normalGC) XDrawString16(screen->display, TextWindow(screen), *************** *** 1251,1257 **** --- 1306,1317 ---- } else #endif /* KTERM_MBCS */ { + #ifdef WALLPAPER + DrawImageString(screen, /*0*/screen->max_ascent, reverse, + screen->display, TextWindow(screen), + #else /* WALLPAPER */ XDrawImageString(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ gc, x, Y, dbuf, n); if (flags & BOLD && screen->normalboldGC == screen->normalGC) XDrawString(screen->display, TextWindow(screen), diff -rcN kterm-6.2.0.DIST/scrollbar.c kterm-6.2.0-wp-BGP/scrollbar.c *** kterm-6.2.0.DIST/scrollbar.c Fri Jul 12 14:01:39 1996 --- kterm-6.2.0-wp-BGP/scrollbar.c Fri Jul 3 22:30:20 1998 *************** *** 41,46 **** --- 41,49 ---- #include "error.h" #include "menu.h" + #ifdef WALLPAPER + extern int BackgroundPixmapIsOn; + #endif /* WALLPAPER */ /* Event handlers */ static void ScrollTextTo(); *************** *** 157,162 **** --- 160,170 ---- repHeight, NULL, NULL); } + #ifdef WALLPAPER + FullWidth(screen) = repWidth; + FullHeight(screen) = repHeight; + #endif /* WALLPAPER */ + #ifndef nothack XSetWMNormalHints(screen->display, XtWindow(XtParent(xw)), &sizehints); #endif *************** *** 298,308 **** --- 306,328 ---- refreshtop = scrollheight; } x = screen->scrollbar + screen->border; + #ifdef WALLPAPER + if (BackgroundPixmapIsOn){ + screen->topline = top; + ScrollSelection(screen, i); + } + #endif /* WALLPAPER */ scrolling_copy_area(screen, scrolltop, scrollheight, -i); + #ifdef WALLPAPER + if (!BackgroundPixmapIsOn){ + #endif /* WALLPAPER */ screen->topline = top; ScrollSelection(screen, i); + #ifdef WALLPAPER + } + #endif /* WALLPAPER */ XClearArea( screen->display, TextWindow(screen), diff -rcN kterm-6.2.0.DIST/util.c kterm-6.2.0-wp-BGP/util.c *** kterm-6.2.0.DIST/util.c Tue Jul 2 14:01:53 1996 --- kterm-6.2.0-wp-BGP/util.c Fri Jul 3 22:31:18 1998 *************** *** 42,47 **** --- 42,51 ---- static int fnum = F_ISO8859_1; /* refered by *GC in many functions */ #endif /* KTERM */ + #ifdef WALLPAPER + extern int BackgroundPixmapIsOn; + #endif /* WALLPAPER */ + /* * These routines are used for the jump scroll feature */ *************** *** 107,114 **** --- 111,125 ---- if((i = screen->top_marg + refreshheight - 1 - bot) > 0) refreshheight -= i; } + #ifdef WALLPAPER + if (BackgroundPixmapIsOn) + ScrollSelection(screen, -(screen->scroll_amt)); + #endif /* WALLPAPER */ scrolling_copy_area(screen, scrolltop+screen->scroll_amt, scrollheight, screen->scroll_amt); + #ifdef WALLPAPER + if (!BackgroundPixmapIsOn) + #endif /* WALLPAPER */ ScrollSelection(screen, -(screen->scroll_amt)); screen->scroll_amt = 0; screen->refresh_amt = 0; *************** *** 346,351 **** --- 357,365 ---- register int refreshheight; register int scrolltop; register int scrollheight; + #ifdef WALLPAPER + int vcopy = 0; + #endif /* WALLPAPER */ if (screen->cur_row < screen->top_marg || screen->cur_row > screen->bot_marg) *************** *** 376,381 **** --- 390,400 ---- scrollheight -= i; if((i = screen->cur_row + refreshheight - 1 - bot) > 0) refreshheight -= i; + #ifdef WALLPAPER + if (BackgroundPixmapIsOn) + vcopy = 1; + else + #endif /* WALLPAPER */ vertical_copy_area(screen, scrolltop-n, scrollheight, -n); if(refreshheight > 0) XClearArea ( *************** *** 390,395 **** --- 409,418 ---- /* adjust screen->buf */ ScrnInsertLine(screen->buf, screen->bot_marg, screen->cur_row, n, screen->max_col + 1); + #ifdef WALLPAPER + if (vcopy) + ScrnRefresh(screen, scrolltop, 0, scrollheight, screen->max_col + 1, True); + #endif /* WALLPAPER */ } /* *************** *** 407,412 **** --- 430,438 ---- register int refreshheight; register int scrolltop; register int scrollheight; + #ifdef WALLPAPER + int vcopy = 0; + #endif /* WALLPAPER */ if (screen->cur_row < screen->top_marg || screen->cur_row > screen->bot_marg) *************** *** 453,458 **** --- 479,489 ---- } } } + #ifdef WALLPAPER + if (BackgroundPixmapIsOn) + vcopy = 1; + else + #endif /* WALLPAPER */ vertical_copy_area(screen, scrolltop+n, scrollheight, n); if(refreshheight > 0) XClearArea ( *************** *** 471,476 **** --- 502,511 ---- else ScrnDeleteLine(screen->buf, screen->bot_marg, screen->cur_row, n, screen->max_col + 1); + #ifdef WALLPAPER + if (vcopy) + ScrnRefresh(screen, scrolltop, 0, scrollheight, screen->max_col + 1, True); + #endif /* WALLPAPER */ } /* *************** *** 481,486 **** --- 516,524 ---- register int n; { register int cx, cy; + #ifdef WALLPAPER + int hcopy = 0; + #endif /* WALLPAPER */ if(screen->cursor_state) HideCursor(); *************** *** 504,509 **** --- 542,552 ---- */ if (non_blank_line (screen->buf, screen->cur_row, screen->cur_col, screen->max_col + 1)) + #ifdef WALLPAPER + if (BackgroundPixmapIsOn) + hcopy = 1; + else + #endif /* WALLPAPER */ horizontal_copy_area(screen, screen->cur_col, screen->max_col+1 - (screen->cur_col+n), n); *************** *** 511,517 **** --- 554,564 ---- cx = CursorX (screen, screen->cur_col); cy = CursorY (screen, screen->cur_row); + #ifdef WALLPAPER + FillRectangle( + #else /* WALLPAPER */ XFillRectangle( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), #ifdef STATUSLINE *************** *** 526,531 **** --- 573,584 ---- /* adjust screen->buf */ ScrnInsertChar(screen->buf, screen->cur_row, screen->cur_col, n, screen->max_col + 1); + #ifdef WALLPAPER + if (hcopy){ + ScrnRefresh(screen, screen->cur_row, screen->cur_col, 1, + screen->max_col+1 - screen->cur_col, True); + } + #endif /* WALLPAPER */ } /* *************** *** 536,541 **** --- 589,597 ---- register int n; { register int width; + #ifdef WALLPAPER + int hcopy = 0; + #endif /* WALLPAPER */ if(screen->cursor_state) HideCursor(); *************** *** 559,569 **** --- 615,634 ---- if(screen->scroll_amt) FlushScroll(screen); + #ifdef WALLPAPER + if (BackgroundPixmapIsOn) + hcopy = 1; + else + #endif /* WALLPAPER */ horizontal_copy_area(screen, screen->cur_col+n, screen->max_col+1 - (screen->cur_col+n), -n); + #ifdef WALLPAPER + FillRectangle + #else /* WALLPAPER */ XFillRectangle + #endif /* WALLPAPER */ (screen->display, TextWindow(screen), #ifdef STATUSLINE screen->instatus && screen->reversestatus ? *************** *** 579,584 **** --- 644,655 ---- /* adjust screen->buf */ ScrnDeleteChar (screen->buf, screen->cur_row, screen->cur_col, n, screen->max_col + 1); + #ifdef WALLPAPER + if (hcopy){ + ScrnRefresh(screen, screen->cur_row, screen->cur_col, 1, + screen->max_col+1 - screen->cur_col, True); + } + #endif WALLPAPER } *************** *** 652,658 **** --- 723,733 ---- if(!AddToRefresh(screen)) { if(screen->scroll_amt) FlushScroll(screen); + #ifdef WALLPAPER + FillRectangle(screen->display, TextWindow(screen), + #else /* WALLPAPER */ XFillRectangle(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ #ifdef STATUSLINE screen->instatus && screen->reversestatus ? screen->normalGC : *************** *** 707,713 **** --- 782,792 ---- if(!AddToRefresh(screen)) { if(screen->scroll_amt) FlushScroll(screen); + #ifdef WALLPAPER + FillRectangle (screen->display, TextWindow(screen), + #else /* WALLPAPER */ XFillRectangle (screen->display, TextWindow(screen), + #endif /* WALLPAPER */ #ifdef STATUSLINE screen->instatus && screen->reversestatus ? screen->normalGC : *************** *** 758,764 **** --- 837,847 ---- if(!AddToRefresh(screen)) { if(screen->scroll_amt) FlushScroll(screen); + #ifdef WALLPAPER + FillRectangle (screen->display, TextWindow(screen), + #else /* WALLPAPER */ XFillRectangle (screen->display, TextWindow(screen), + #endif /* WALLPAPER */ #ifdef STATUSLINE screen->instatus && screen->reversestatus ? screen->normalGC : *************** *** 894,905 **** --- 977,1002 ---- int nchars; int amount; /* number of characters to move right */ { + #ifdef WALLPAPER + if (BackgroundPixmapIsOn){ + if (amount >= 0){ + ScrnRefresh(screen, screen->cur_row, firstchar, 1, nchars + amount, True); + } + else{ + ScrnRefresh(screen, screen->cur_row, firstchar + amount, 1, nchars - amount, True); + } + } + else{ + #endif /* WALLPAPER */ int src_x = CursorX(screen, firstchar); int src_y = CursorY(screen, screen->cur_row); copy_area(screen, src_x, src_y, (unsigned)nchars*FontWidth(screen), FontHeight(screen), src_x + amount*FontWidth(screen), src_y); + #ifdef WALLPAPER + } + #endif /* WALLPAPER */ } /* *************** *** 913,924 **** --- 1010,1038 ---- int amount; /* number of lines to move up (neg=down) */ { if(nlines > 0) { + #ifdef WALLPAPER + if (BackgroundPixmapIsOn){ + int amt = screen->scroll_amt; + screen->scroll_amt = 0; + if (amount >= 0){ + ScrnRefresh(screen, firstline - amount, 0, nlines, screen->max_col + 1, True); + } + else{ + ScrnRefresh(screen, firstline - amount, 0, nlines, screen->max_col + 1, True); + } + screen->scroll_amt = amt; + } + else{ + #endif /* WALLPAPER */ int src_x = screen->border + screen->scrollbar; int src_y = firstline * FontHeight(screen) + screen->border; copy_area(screen, src_x, src_y, (unsigned)Width(screen), nlines*FontHeight(screen), src_x, src_y - amount*FontHeight(screen)); + #ifdef WALLPAPER + } + #endif /* WALLPAPER */ } } *************** *** 993,999 **** { register int toprow, leftcol, nrows, ncols; extern Bool waiting_for_initial_map; ! toprow = (rect_y - screen->border) / FontHeight(screen); if(toprow < 0) toprow = 0; --- 1107,1136 ---- { register int toprow, leftcol, nrows, ncols; extern Bool waiting_for_initial_map; ! #ifdef WALLPAPER ! if (BackgroundPixmapIsOn){ ! Window tw = TextWindow (screen); ! int width = FullWidth(screen); ! int height = FullHeight(screen); ! ! XClearArea (screen->display, tw, ! screen->scrollbar, 0, /* left edge */ ! screen->border, height, /* from top to bottom */ ! False); ! XClearArea (screen->display, tw, ! 0, 0, /* top */ ! width, screen->border, /* all across the top */ ! False); ! XClearArea (screen->display, tw, ! width - screen->border, 0, /* right edge */ ! screen->border, height, /* from top to bottom */ ! False); ! XClearArea (screen->display, tw, ! 0, height - screen->border, /* bottom */ ! width, screen->border, /* all across the bottom */ ! False); ! } ! #endif /* WALLPAPER */ toprow = (rect_y - screen->border) / FontHeight(screen); if(toprow < 0) toprow = 0; *************** *** 1113,1118 **** --- 1250,1258 ---- if(screen->scrollWidget) ScrollBarReverseVideo(screen->scrollWidget); + #ifdef WALLPAPER + if(!BackgroundPixmapIsOn) + #endif /* WALLPAPER */ XSetWindowBackground(screen->display, TextWindow(screen), termw->core.background_pixel); #ifndef KTERM_NOTEK if(tek) { *************** *** 1180,1186 **** --- 1320,1330 ---- if(!AddToRefresh(screen)) { if(screen->scroll_amt) FlushScroll(screen); + #ifdef WALLPAPER + FillRectangle(screen->display, TextWindow(screen), + #else /* WALLPAPER */ XFillRectangle(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ #ifdef STATUSLINE screen->instatus && screen->reversestatus ? screen->normalGC :