diff -cP kterm-6.2.0/Imakefile kterm-6.2.0-wp/Imakefile *** kterm-6.2.0/Imakefile Fri Jul 12 05:01:04 1996 --- kterm-6.2.0-wp/Imakefile Wed Feb 19 05:48:07 1997 *************** *** 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 -cP kterm-6.2.0/README.wallpaper kterm-6.2.0-wp/README.wallpaper *** kterm-6.2.0/README.wallpaper Thu Jan 1 00:00:00 1970 --- kterm-6.2.0-wp/README.wallpaper Sat Feb 22 04:21:56 1997 *************** *** 0 **** --- 1,45 ---- + ======================================================================== + kterm-6.2.0 + 壁紙パッチ + ======================================================================== + + この壁紙パッチがあたった kterm では、背景に画像を表示することが + できます。ただし、文字を表示するたびにいちいち画像の一部を描画して + その上に文字を描画するので、快適に使うにはそれなりのマシンパワーを + 必要とします。 + + 壁紙機能を利用するには、Imakefile の DEFINES に -DWALLPAPER を追加して + ソースをコンパイルする必要があります。このパッチをあてると Imakefile も + そのように書き換えられますので、ただ単に + + % xmkmf; make + + とするだけでおしまいです。 + なお、FreeBSD で misc.c の SysErrorMsg() の sys_errlist のところで + エラーが出る場合は、その行をコメントアウトして下さい。 + + 背景に画像を表示するには、画像ファイルを + + % kterm -wp filename.xpm + + のように -wp オプションで指定するか、X のリソースで + + KTerm*wallPaper: /path/filename.xpm + + のように指定します。 + これらの指定がない場合は普通の kterm と同じ動作をします。 + + 画像はあらかじめ xpm 形式に直しておいて下さい。 + その際、画面モードに合った色数にすることと、文字が見やすいように + 輝度を落しておくことを忘れないようにして下さい。 + + ではでは、お楽しみ下さい。 + + 高木 淳司 (takagi@an.ip.titech.ac.jp) + + ------------------------------------------------------------------------ + + 履歴 + + 1997/02/22 kterm-6.2.0-wpr1 : 公式 Release 1 + + ======================================================================== diff -cP kterm-6.2.0/Tekproc.c kterm-6.2.0-wp/Tekproc.c *** kterm-6.2.0/Tekproc.c Fri Jul 12 05:01:40 1996 --- kterm-6.2.0-wp/Tekproc.c Wed Feb 19 05:44:27 1997 *************** *** 801,807 **** --- 801,811 ---- register int border = 2 * screen->border; register double d; + #ifdef WALLPAPER + if (TWindow(screen)) ClearWindow(screen->display, TWindow(screen)); + #else /* WALLPAPER */ if (TWindow(screen)) XClearWindow(screen->display, TWindow(screen)); + #endif /* WALLPAPER */ TWidth(screen) = w->core.width - border; THeight(screen) = w->core.height - border; TekScale(screen) = (double)TWidth(screen) / TEKWIDTH; *************** *** 868,874 **** --- 872,882 ---- register TScreen *screen = &term->screen; register TekLink *tek; + #ifdef WALLPAPER + ClearWindow(screen->display, TWindow(screen)); + #else /* WALLPAPER */ XClearWindow(screen->display, TWindow(screen)); + #endif /* WALLPAPER */ screen->cur_X = 0; screen->cur_Y = TEKHOME; screen->margin = MARGIN1; *************** *** 1569,1575 **** --- 1577,1587 ---- 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! */ *************** *** 1584,1590 **** --- 1596,1606 ---- * event and is easier than trying to figure out exactly * which part of the cursor needs to be erased. */ + #ifdef WALLPAPER + ClearArea(screen->display, TWindow(screen), x, y, + #else /* WALLPAPER */ XClearArea(screen->display, TWindow(screen), x, y, + #endif /* WALLPAPER */ cellwidth, cellheight, FALSE); } } diff -cP kterm-6.2.0/charproc.c kterm-6.2.0-wp/charproc.c *** kterm-6.2.0/charproc.c Fri Jul 12 05:01:36 1996 --- kterm-6.2.0-wp/charproc.c Wed Feb 19 06:01:30 1997 *************** *** 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) *************** *** 3028,3036 **** --- 3033,3049 ---- #else /* !STATUSLINE */ if(top == 0) #endif /* !STATUSLINE */ + #ifdef WALLPAPER + ClearWindow(screen->display, TextWindow(screen)); + #else /* WALLPAPER */ XClearWindow(screen->display, TextWindow(screen)); + #endif /* WALLPAPER */ else + #ifdef WALLPAPER + ClearArea( + #else /* WALLPAPER */ XClearArea( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), (int) screen->border + screen->scrollbar, *************** *** 3884,3889 **** --- 3897,3905 ---- GC currentGC; #endif /* !KTERM */ Boolean in_selection; + #ifdef WALLPAPER + int reverse; + #endif /* WALLPAPER */ if (eventMode != NORMAL) return; *************** *** 3933,3938 **** --- 3949,3957 ---- 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 **** --- 3962,3970 ---- } } } else { /* normal video */ + #ifdef WALLPAPER + reverse = 1; + #endif /* WALLPAPER */ if (screen->reversecursorGC) { currentGC = screen->reversecursorGC; } else { *************** *** 3957,3964 **** --- 3979,3992 ---- 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 **** --- 3995,4006 ---- 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 **** --- 4043,4051 ---- 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 **** --- 4088,4105 ---- #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 **** --- 4117,4128 ---- 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 **** --- 4304,4314 ---- 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, *************** *** 5082,5088 **** --- 5133,5143 ---- if (doresize) { if (VWindow(screen)) { + #ifdef WALLPAPER + ClearWindow (screen->display, VWindow(screen)); + #else /* WALLPAPER */ XClearWindow (screen->display, VWindow(screen)); + #endif /* WALLPAPER */ } DoResizeScreen (term); /* set to the new natural size */ if (screen->scrollWidget) diff -cP kterm-6.2.0/main.c kterm-6.2.0-wp/main.c *** kterm-6.2.0/main.c Fri Jul 12 05:01:38 1996 --- kterm-6.2.0-wp/main.c Wed Feb 19 06:50:12 1997 *************** *** 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,1248 ---- extern fd_set X_mask; extern fd_set pty_mask; + #ifdef WALLPAPER + + #include + + XImage *image = NULL; + static XImage *imageshape = NULL; + static XpmAttributes imageattr; + static GC imageGC; + + void + ClearArea(display, win, x, y, width, height, exposures) + Display *display; + Window win; + int x; + int y; + unsigned int width; + unsigned int height; + Bool exposures; + { + int sx, sy, dx, dy, xx, yy, w, h; + + if (image){ + dx = x + width; + dy = y + height; + yy = y; + do { + sy = yy % imageattr.height; + h = imageattr.height - sy; if (yy + h > dy) h = dy - yy; + xx = x; + do { + sx = xx % imageattr.width; + w = imageattr.width - sx; if (xx + w > dx) w = dx - xx; + XPutImage(display, win, imageGC, image, sx, sy, xx, yy, w, h); + } while ((xx += w) < dx); + } while ((yy += h) < dy); + } + else{ + XClearArea(display, win, x, y, width, height, exposures); + } + } + + void + ClearWindow(display, win) + Display *display; + Window win; + { + int x, y, width, height; + int sx, sy, dx, dy, xx, yy, w, h; + + if (image){ + XWindowAttributes attr; + XGetWindowAttributes(display, win, &attr); + ClearArea(display, win, attr.x, attr.y, attr.width, attr.height, True); + } + else{ + XClearWindow(display, win); + } + } + + 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 (image){ + for (dy = y; dy < y + height; dy += h){ + sy = dy % imageattr.height; + h = imageattr.height - sy; + if (dy + h > y + height) h = y + height - dy; + for (dx = x; dx < x + width; dx += w){ + sx = dx % imageattr.width; + w = imageattr.width - sx; + if (dx + w > x + width) w = x + width - dx; + XPutImage(display, d, imageGC, image, sx, sy, dx, dy, w, h); + } + } + } + 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 && image){ + 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 && image){ + 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 **** --- 1807,1828 ---- #endif /* DEBUG */ XSetErrorHandler(xerror); XSetIOErrorHandler(xioerror); + #ifdef WALLPAPER + if (resource.wallpaper){ + int result; + if ((result = XpmReadFileToImage(XtDisplay(toplevel), + resource.wallpaper, + &image, &imageshape, + &imageattr)) < 0){ + fprintf(stderr, "XpmReadFileToImage(\"%s\") : %s\n", + resource.wallpaper, XpmGetErrorString(result)); + } + else{ + imageGC = XCreateGC(XtDisplay(toplevel), XtWindow(toplevel), + 0, NULL); + } + } + #endif /* WALLPAPER */ for( ; ; ) { #ifndef KTERM_NOTEK if(screen->TekEmu) { diff -cP kterm-6.2.0/misc.c kterm-6.2.0-wp/misc.c *** kterm-6.2.0/misc.c Fri Jul 12 05:01:43 1996 --- kterm-6.2.0-wp/misc.c Wed Feb 19 05:50:02 1997 *************** *** 449,455 **** --- 449,459 ---- visualGC = XtGetGC((Widget)term, GCFunction+GCForeground, &gcval); #ifndef KTERM_NOTEK if(screen->TekEmu) { + #ifdef WALLPAPER + FillRectangle( + #else /* WALLPAPER */ XFillRectangle( + #endif /* WALLPAPER */ screen->display, TWindow(screen), visualGC, *************** *** 457,463 **** --- 461,471 ---- (unsigned) TFullWidth(screen), (unsigned) TFullHeight(screen)); XFlush(screen->display); + #ifdef WALLPAPER + FillRectangle( + #else /* WALLPAPER */ XFillRectangle( + #endif /* WALLPAPER */ screen->display, TWindow(screen), visualGC, *************** *** 466,472 **** --- 474,484 ---- (unsigned) TFullHeight(screen)); } else { #endif /* !KTERM_NOTEK */ + #ifdef WALLPAPER + FillRectangle( + #else /* WALLPAPER */ XFillRectangle( + #endif /* WALLPAPER */ screen->display, VWindow(screen), visualGC, *************** *** 474,480 **** --- 486,496 ---- (unsigned) FullWidth(screen), (unsigned) FullHeight(screen)); XFlush(screen->display); + #ifdef WALLPAPER + FillRectangle( + #else /* WALLPAPER */ XFillRectangle( + #endif /* WALLPAPER */ screen->display, VWindow(screen), visualGC, diff -cP kterm-6.2.0/screen.c kterm-6.2.0-wp/screen.c *** kterm-6.2.0/screen.c Sun Jun 23 08:00:26 1996 --- kterm-6.2.0-wp/screen.c Wed Feb 19 06:48:36 1997 *************** *** 556,561 **** --- 556,569 ---- int scrollamt = screen->scroll_amt; int max = screen->max_row; + #ifdef WALLPAPER + { + extern XImage *image; + if (image){ + 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, *************** *** 844,850 **** --- 885,895 ---- /* clear the right and bottom internal border because of NorthWest gravity might have left junk on the right and bottom edges */ + #ifdef WALLPAPER + ClearArea (screen->display, tw, + #else /* WALLPAPER */ XClearArea (screen->display, tw, + #endif /* WALLPAPER */ width - screen->border, 0, /* right edge */ #ifdef STATUSLINE screen->border, height - screen->statusheight, *************** *** 852,858 **** --- 897,907 ---- screen->border, height, /* from top to bottom */ #endif /* !STATUSLINE */ False); + #ifdef WALLPAPER + ClearArea (screen->display, tw, + #else /* WALLPAPER */ XClearArea (screen->display, tw, + #endif /* WALLPAPER */ #ifdef STATUSLINE 0, height - screen->border - screen->statusheight, #else /* !STATUSLINE */ *************** *** 878,884 **** --- 927,937 ---- && term->misc.resizeGravity == NorthWestGravity) { /* bit_gravity != ForgetGravity */ if (rows > screen->max_row + 1) { + #ifdef WALLPAPER + ClearArea (screen->display, tw, + #else /* WALLPAPER */ XClearArea (screen->display, tw, + #endif /* WALLPAPER */ screen->scrollbar, (screen->max_row + 1) * FontHeight(screen) + screen->border * 2, *************** *** 887,893 **** --- 940,950 ---- screen->statusheight, True); } else if (rows < screen->max_row + 1) { + #ifdef WALLPAPER + ClearArea (screen->display, tw, + #else /* WALLPAPER */ XClearArea (screen->display, tw, + #endif /* WALLPAPER */ screen->scrollbar, rows * FontHeight(screen) + screen->border * 2, *************** *** 1147,1152 **** --- 1204,1212 ---- 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 **** --- 1253,1261 ---- 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 **** --- 1263,1271 ---- else gc = screen->reverseGC; } else { + # ifdef WALLPAPER + reverse = 0; + # endif /* WALLPAPER */ if (hilitecursor && screen->cursorGC) gc = screen->cursorGC; else if (flags & BOLD) *************** *** 1243,1249 **** --- 1309,1320 ---- #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 **** --- 1322,1333 ---- } 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 -cP kterm-6.2.0/scrollbar.c kterm-6.2.0-wp/scrollbar.c *** kterm-6.2.0/scrollbar.c Fri Jul 12 05:01:39 1996 --- kterm-6.2.0-wp/scrollbar.c Wed Feb 19 05:44:32 1997 *************** *** 157,162 **** --- 157,167 ---- repHeight, NULL, NULL); } + #ifdef WALLPAPER + FullWidth(screen) = repWidth; + FullHeight(screen) = repHeight; + #endif /* WALLPAPER */ + #ifndef nothack XSetWMNormalHints(screen->display, XtWindow(XtParent(xw)), &sizehints); #endif *************** *** 303,309 **** --- 308,318 ---- ScrollSelection(screen, i); + #ifdef WALLPAPER + ClearArea( + #else /* WALLPAPER */ XClearArea( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), (int) x, *************** *** 399,405 **** --- 408,418 ---- XtMapWidget(screen->scrollWidget); update_scrollbar (); if (screen->buf) { + #ifdef WALLPAPER + ClearWindow (screen->display, XtWindow (term)); + #else /* WALLPAPER */ XClearWindow (screen->display, XtWindow (term)); + #endif /* WALLPAPER */ Redraw (); } } *************** *** 414,420 **** --- 427,437 ---- DoResizeScreen (term); update_scrollbar (); if (screen->buf) { + #ifdef WALLPAPER + ClearWindow (screen->display, XtWindow (term)); + #else /* WALLPAPER */ XClearWindow (screen->display, XtWindow (term)); + #endif /* WALLPAPER */ Redraw (); } } diff -cP kterm-6.2.0/util.c kterm-6.2.0-wp/util.c *** kterm-6.2.0/util.c Tue Jul 2 05:01:53 1996 --- kterm-6.2.0-wp/util.c Wed Feb 19 07:38:01 1997 *************** *** 42,47 **** --- 42,51 ---- static int fnum = F_ISO8859_1; /* refered by *GC in many functions */ #endif /* KTERM */ + #ifdef WALLPAPER + extern XImage *image; + #endif /* WALLPAPER */ + /* * These routines are used for the jump scroll feature */ *************** *** 107,119 **** --- 111,134 ---- if((i = screen->top_marg + refreshheight - 1 - bot) > 0) refreshheight -= i; } + #ifdef WALLPAPER + if (image) + ScrollSelection(screen, -(screen->scroll_amt)); + #endif /* WALLPAPER */ scrolling_copy_area(screen, scrolltop+screen->scroll_amt, scrollheight, screen->scroll_amt); + #ifdef WALLPAPER + if (!image) + #endif /* WALLPAPER */ ScrollSelection(screen, -(screen->scroll_amt)); screen->scroll_amt = 0; screen->refresh_amt = 0; if(refreshheight > 0) { + #ifdef WALLPAPER + ClearArea ( + #else /* WALLPAPER */ XClearArea ( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), (int) screen->border + screen->scrollbar, *************** *** 237,243 **** --- 252,262 ---- } scrolling_copy_area(screen, scrolltop+amount, scrollheight, amount); if(refreshheight > 0) { + #ifdef WALLPAPER + ClearArea ( + #else /* WALLPAPER */ XClearArea ( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), (int) screen->border + screen->scrollbar, *************** *** 317,323 **** --- 336,346 ---- } scrolling_copy_area(screen, scrolltop-amount, scrollheight, -amount); if(refreshheight > 0) + #ifdef WALLPAPER + ClearArea ( + #else /* WALLPAPER */ XClearArea ( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), (int) screen->border + screen->scrollbar, *************** *** 346,351 **** --- 369,377 ---- 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,384 **** --- 402,419 ---- scrollheight -= i; if((i = screen->cur_row + refreshheight - 1 - bot) > 0) refreshheight -= i; + #ifdef WALLPAPER + if (image) + vcopy = 1; + else + #endif /* WALLPAPER */ vertical_copy_area(screen, scrolltop-n, scrollheight, -n); if(refreshheight > 0) + #ifdef WALLPAPER + ClearArea ( + #else /* WALLPAPER */ XClearArea ( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), (int) screen->border + screen->scrollbar, *************** *** 390,395 **** --- 425,434 ---- /* 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 **** --- 446,454 ---- 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,461 **** --- 495,512 ---- } } } + #ifdef WALLPAPER + if (image) + vcopy = 1; + else + #endif /* WALLPAPER */ vertical_copy_area(screen, scrolltop+n, scrollheight, n); if(refreshheight > 0) + #ifdef WALLPAPER + ClearArea ( + #else /* WALLPAPER */ XClearArea ( + #endif /* WALLPAPER */ screen->display, TextWindow(screen), (int) screen->border + screen->scrollbar, *************** *** 471,476 **** --- 522,531 ---- 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 **** --- 536,544 ---- register int n; { register int cx, cy; + #ifdef WALLPAPER + int hcopy = 0; + #endif /* WALLPAPER */ if(screen->cursor_state) HideCursor(); *************** *** 504,509 **** --- 562,572 ---- */ if (non_blank_line (screen->buf, screen->cur_row, screen->cur_col, screen->max_col + 1)) + #ifdef WALLPAPER + if (image) + hcopy = 1; + else + #endif /* WALLPAPER */ horizontal_copy_area(screen, screen->cur_col, screen->max_col+1 - (screen->cur_col+n), n); *************** *** 511,517 **** --- 574,584 ---- 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 **** --- 593,604 ---- /* 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 **** --- 609,617 ---- register int n; { register int width; + #ifdef WALLPAPER + int hcopy = 0; + #endif /* WALLPAPER */ if(screen->cursor_state) HideCursor(); *************** *** 559,569 **** --- 635,654 ---- if(screen->scroll_amt) FlushScroll(screen); + #ifdef WALLPAPER + if (image) + 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 **** --- 664,675 ---- /* 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 } *************** *** 598,604 **** --- 689,699 ---- if((height = screen->cur_row + top) > screen->max_row) height = screen->max_row; if((height -= top) > 0) + #ifdef WALLPAPER + ClearArea(screen->display, TextWindow(screen), + #else /* WALLPAPER */ XClearArea(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ screen->border + screen->scrollbar, top * FontHeight(screen) + screen->border, Width(screen), height * FontHeight(screen), FALSE); *************** *** 622,628 **** --- 717,727 ---- if(screen->scroll_amt) FlushScroll(screen); if(++top <= screen->max_row) + #ifdef WALLPAPER + ClearArea(screen->display, TextWindow(screen), + #else /* WALLPAPER */ XClearArea(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ screen->border + screen->scrollbar, top * FontHeight(screen) + screen->border, Width(screen), (screen->max_row - top + 1) * *************** *** 652,658 **** --- 751,761 ---- 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 **** --- 810,820 ---- 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 **** --- 865,875 ---- 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 : *************** *** 793,801 **** --- 904,920 ---- #else /* !STATUSLINE */ if(top == 0) #endif /* !STATUSLINE */ + #ifdef WALLPAPER + ClearWindow(screen->display, TextWindow(screen)); + #else /* WALLPAPER */ XClearWindow(screen->display, TextWindow(screen)); + #endif /* WALLPAPER */ else + #ifdef WALLPAPER + ClearArea(screen->display, TextWindow(screen), + #else /* WALLPAPER */ XClearArea(screen->display, TextWindow(screen), + #endif /* WALLPAPER */ screen->border + screen->scrollbar, top * FontHeight(screen) + screen->border, Width(screen), (screen->max_row - top + 1) * *************** *** 894,905 **** --- 1013,1038 ---- int nchars; int amount; /* number of characters to move right */ { + #ifdef WALLPAPER + if (image){ + 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 **** --- 1046,1074 ---- int amount; /* number of lines to move up (neg=down) */ { if(nlines > 0) { + #ifdef WALLPAPER + if (image){ + 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; --- 1143,1172 ---- { register int toprow, leftcol, nrows, ncols; extern Bool waiting_for_initial_map; ! #ifdef WALLPAPER ! if (image){ ! Window tw = TextWindow (screen); ! int width = FullWidth(screen); ! int height = FullHeight(screen); ! ! ClearArea (screen->display, tw, ! screen->scrollbar, 0, /* left edge */ ! screen->border, height, /* from top to bottom */ ! False); ! ClearArea (screen->display, tw, ! 0, 0, /* top */ ! width, screen->border, /* all across the top */ ! False); ! ClearArea (screen->display, tw, ! width - screen->border, 0, /* right edge */ ! screen->border, height, /* from top to bottom */ ! False); ! ClearArea (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; *************** *** 1119,1125 **** --- 1292,1302 ---- TekReverseVideo(screen); } #endif /* !KTERM_NOTEK */ + #ifdef WALLPAPER + ClearWindow(screen->display, TextWindow(screen)); + #else /* WALLPAPER */ XClearWindow(screen->display, TextWindow(screen)); + #endif /* WALLPAPER */ #ifdef STATUSLINE ScrnRefresh (screen, 0, 0, screen->max_row + 1 + !!screen->statusheight, /* !!statusheight == (statusheight ? 1 : 0) */ *************** *** 1129,1135 **** --- 1306,1316 ---- screen->max_col + 1, False); #ifndef KTERM_NOTEK if(screen->Tshow) { + #ifdef WALLPAPER + ClearWindow(screen->display, tek); + #else /* WALLPAPER */ XClearWindow(screen->display, tek); + #endif /* WALLPAPER */ TekExpose((Widget)NULL, (XEvent *)NULL, (Region)NULL); } #endif /* !KTERM_NOTEK */ *************** *** 1180,1186 **** --- 1361,1371 ---- 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 :