SCCS-vsn: usr.bin/window/wwinschar.c 3.18
SCCS-vsn: usr.bin/window/ttgeneric.c 3.40
SCCS-vsn: usr.bin/window/tth19.c 3.22
SCCS-vsn: usr.bin/window/tt.h 3.23
SCCS-vsn: usr.bin/window/wwupdate.c 3.26
SCCS-vsn: usr.bin/window/wwwrite.c 3.30
SCCS-vsn: usr.bin/window/wwinit.c 3.35
SCCS-vsn: usr.bin/window/xx.c 3.2
SCCS-vsn: usr.bin/window/xx.h 3.2
SCCS-vsn: usr.bin/window/xxflush.c 3.2
SCCS-vsn: usr.bin/window/ttzapple.c 3.5
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#)tt.h 3.22 (Berkeley) %G%
+ * @(#)tt.h 3.23 (Berkeley) %G%
int (*tt_insline)();
int (*tt_delline)();
int (*tt_inschar)();
int (*tt_insline)();
int (*tt_delline)();
int (*tt_inschar)();
int (*tt_delchar)();
int (*tt_write)(); /* write a whole block */
int (*tt_putc)(); /* write one character */
int (*tt_delchar)();
int (*tt_write)(); /* write a whole block */
int (*tt_putc)(); /* write one character */
int (*tt_scroll_down)();
int (*tt_scroll_up)();
int (*tt_setscroll)(); /* set scrolling region */
int (*tt_scroll_down)();
int (*tt_scroll_up)();
int (*tt_setscroll)(); /* set scrolling region */
- int (*tt_setinsert)(); /* set insert mode */
int (*tt_setmodes)(); /* set display modes */
int (*tt_set_token)(); /* define a token */
int (*tt_put_token)(); /* refer to a defined token */
int (*tt_setmodes)(); /* set display modes */
int (*tt_set_token)(); /* define a token */
int (*tt_put_token)(); /* refer to a defined token */
char tt_modes; /* the current display modes */
char tt_nmodes; /* the new modes for next write */
char tt_insert; /* currently in insert mode */
char tt_modes; /* the current display modes */
char tt_nmodes; /* the new modes for next write */
char tt_insert; /* currently in insert mode */
- char tt_ninsert; /* insert mode on next write */
int tt_row; /* cursor row */
int tt_col; /* cursor column */
int tt_scroll_top; /* top of scrolling region */
int tt_row; /* cursor row */
int tt_col; /* cursor column */
int tt_scroll_top; /* top of scrolling region */
-static char sccsid[] = "@(#)ttgeneric.c 3.39 (Berkeley) %G%";
+static char sccsid[] = "@(#)ttgeneric.c 3.40 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
gen_putc(c)
register char c;
{
gen_putc(c)
register char c;
{
- if (tt.tt_ninsert != tt.tt_insert)
- gen_setinsert(tt.tt_ninsert);
+ if (tt.tt_insert)
+ gen_setinsert(0);
if (tt.tt_nmodes != tt.tt_modes)
gen_setmodes(tt.tt_nmodes);
if (tt.tt_nmodes != tt.tt_modes)
gen_setmodes(tt.tt_nmodes);
- if (tt.tt_insert) {
- if (gen_IC)
- tttputs(gen_IC, gen_CO - tt.tt_col);
- ttputc(c);
- if (gen_IP)
- tttputs(gen_IP, gen_CO - tt.tt_col);
- } else
- ttputc(c);
if (++tt.tt_col == gen_CO)
if (gen_XN)
tt.tt_col = tt.tt_row = -10;
if (++tt.tt_col == gen_CO)
if (gen_XN)
tt.tt_col = tt.tt_row = -10;
register char *p;
register n;
{
register char *p;
register n;
{
- if (tt.tt_ninsert != tt.tt_insert)
- gen_setinsert(tt.tt_ninsert);
+ if (tt.tt_insert)
+ gen_setinsert(0);
if (tt.tt_nmodes != tt.tt_modes)
gen_setmodes(tt.tt_nmodes);
if (tt.tt_nmodes != tt.tt_modes)
gen_setmodes(tt.tt_nmodes);
- if (tt.tt_insert && (gen_IC || gen_IP)) {
- while (--n >= 0) {
- if (gen_IC)
- tttputs(gen_IC, gen_CO - tt.tt_col);
- ttputc(*p++);
- if (gen_IP)
- tttputs(gen_IP, gen_CO - tt.tt_col);
- tt.tt_col++;
- }
- } else {
- tt.tt_col += n;
- ttwrite(p, n);
- }
+ ttwrite(p, n);
+ tt.tt_col += n;
if (tt.tt_col == gen_CO)
if (gen_XN)
tt.tt_col = tt.tt_row = -10;
if (tt.tt_col == gen_CO)
if (gen_XN)
tt.tt_col = tt.tt_row = -10;
ttxputs(gen_TI);
ttxputs(gen_CL);
tt.tt_col = tt.tt_row = 0;
ttxputs(gen_TI);
ttxputs(gen_CL);
tt.tt_col = tt.tt_row = 0;
- tt.tt_ninsert = tt.tt_insert = 0;
tt.tt_nmodes = tt.tt_modes = 0;
}
gen_end()
{
tt.tt_nmodes = tt.tt_modes = 0;
}
gen_end()
{
+ if (tt.tt_insert)
+ gen_setinsert(0);
if (gen_TE)
ttxputs(gen_TE);
if (gen_VE)
if (gen_TE)
ttxputs(gen_TE);
if (gen_VE)
+gen_inschar(c)
+register char c;
+{
+ if (!tt.tt_insert)
+ gen_setinsert(1);
+ if (tt.tt_nmodes != tt.tt_modes)
+ gen_setmodes(tt.tt_nmodes);
+ if (gen_IC)
+ tttputs(gen_IC, gen_CO - tt.tt_col);
+ ttputc(c);
+ if (gen_IP)
+ tttputs(gen_IP, gen_CO - tt.tt_col);
+ if (++tt.tt_col == gen_CO)
+ if (gen_XN)
+ tt.tt_col = tt.tt_row = -10;
+ else if (gen_AM)
+ tt.tt_col = 0, tt.tt_row++;
+ else
+ tt.tt_col--;
+}
+
+gen_insspace(n)
{
if (gen_ICn)
ttpgoto(gen_ICn, 0, n, gen_CO - tt.tt_col);
{
if (gen_ICn)
ttpgoto(gen_ICn, 0, n, gen_CO - tt.tt_col);
- tt.tt_setinsert = gen_setinsert;
- else if (gen_IC)
tt.tt_inschar = gen_inschar;
tt.tt_inschar = gen_inschar;
+ else if (gen_IC)
+ tt.tt_insspace = gen_insspace;
if (gen_DC)
tt.tt_delchar = gen_delchar;
if (gen_AL)
if (gen_DC)
tt.tt_delchar = gen_delchar;
if (gen_AL)
-static char sccsid[] = "@(#)tth19.c 3.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)tth19.c 3.22 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
#define H19_SETINSERT(m) (esc(), (tt.tt_insert = (m)) ? pc('@') : pc('O'))
#define H19_SETINSERT(m) (esc(), (tt.tt_insert = (m)) ? pc('@') : pc('O'))
-h19_setinsert(new)
-{
- H19_SETINSERT(new);
-}
-
h19_setmodes(new)
register new;
{
h19_setmodes(new)
register new;
{
{
if (tt.tt_nmodes != tt.tt_modes)
(*tt.tt_setmodes)(tt.tt_nmodes);
{
if (tt.tt_nmodes != tt.tt_modes)
(*tt.tt_setmodes)(tt.tt_nmodes);
- if (tt.tt_ninsert != tt.tt_insert)
- H19_SETINSERT(tt.tt_ninsert);
- pc(c);
+ H19_SETINSERT(0);
+ pc(c);
if (++tt.tt_col == NCOL)
tt.tt_col = NCOL - 1;
}
if (++tt.tt_col == NCOL)
tt.tt_col = NCOL - 1;
}
{
if (tt.tt_nmodes != tt.tt_modes)
(*tt.tt_setmodes)(tt.tt_nmodes);
{
if (tt.tt_nmodes != tt.tt_modes)
(*tt.tt_setmodes)(tt.tt_nmodes);
- if (tt.tt_ninsert != tt.tt_insert)
- H19_SETINSERT(tt.tt_ninsert);
- if (tt.tt_insert) {
- while (--n >= 0) {
- pc(*p++);
- ICPAD();
- tt.tt_col++;
- }
- } else {
- tt.tt_col += n;
- ttwrite(p, n);
- }
+ if (tt.tt_insert)
+ H19_SETINSERT(0);
+ ttwrite(p, n);
+ tt.tt_col += n;
if (tt.tt_col == NCOL)
tt.tt_col = NCOL - 1;
}
if (tt.tt_col == NCOL)
tt.tt_col = NCOL - 1;
}
esc();
pc('E');
tt.tt_col = tt.tt_row = 0;
esc();
pc('E');
tt.tt_col = tt.tt_row = 0;
- tt.tt_ninsert = tt.tt_insert = 0;
tt.tt_nmodes = tt.tt_modes = 0;
}
h19_end()
{
tt.tt_nmodes = tt.tt_modes = 0;
}
h19_end()
{
+ if (tt.tt_insert)
+ H19_SETINSERT(0);
if (gen_VE)
ttxputs(gen_VE);
esc();
if (gen_VE)
ttxputs(gen_VE);
esc();
+h19_inschar(c)
+register char c;
+{
+ if (tt.tt_nmodes != tt.tt_modes)
+ (*tt.tt_setmodes)(tt.tt_nmodes);
+ if (!tt.tt_insert)
+ H19_SETINSERT(1);
+ pc(c);
+ if (tt.tt_insert)
+ ICPAD();
+ if (++tt.tt_col == NCOL)
+ tt.tt_col = NCOL - 1;
+}
+
h19_delchar(n)
{
while (--n >= 0) {
h19_delchar(n)
{
while (--n >= 0) {
tt.tt_insline = h19_insline;
tt.tt_delline = h19_delline;
tt.tt_insline = h19_insline;
tt.tt_delline = h19_delline;
+ tt.tt_inschar = h19_inschar;
tt.tt_delchar = h19_delchar;
tt.tt_clreol = h19_clreol;
tt.tt_clreos = h19_clreos;
tt.tt_delchar = h19_delchar;
tt.tt_clreol = h19_clreol;
tt.tt_clreos = h19_clreos;
tt.tt_putc = h19_putc;
tt.tt_scroll_down = h19_scroll_down;
tt.tt_scroll_up = h19_scroll_up;
tt.tt_putc = h19_putc;
tt.tt_scroll_down = h19_scroll_down;
tt.tt_scroll_up = h19_scroll_up;
- tt.tt_setinsert = h19_setinsert;
tt.tt_setmodes = h19_setmodes;
tt.tt_ncol = NCOL;
tt.tt_setmodes = h19_setmodes;
tt.tt_ncol = NCOL;
-static char sccsid[] = "@(#)ttzapple.c 3.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)ttzapple.c 3.5 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
tt.tt_col = tt.tt_row = 0;
}
tt.tt_col = tt.tt_row = 0;
}
- tt.tt_inschar = zz_inschar;
+ tt.tt_insspace = zz_insspace;
tt.tt_delchar = zz_delchar;
tt.tt_insline = zz_insline;
tt.tt_delline = zz_delline;
tt.tt_delchar = zz_delchar;
tt.tt_insline = zz_insline;
tt.tt_delline = zz_delline;
-static char sccsid[] = "@(#)wwinit.c 3.34 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwinit.c 3.35 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
wwaddcap1(WWT_USR, &kp);
if (tt.tt_insline && tt.tt_delline || tt.tt_setscroll)
wwaddcap1(WWT_ALDL, &kp);
wwaddcap1(WWT_USR, &kp);
if (tt.tt_insline && tt.tt_delline || tt.tt_setscroll)
wwaddcap1(WWT_ALDL, &kp);
- if (tt.tt_inschar || tt.tt_setinsert)
+ if (tt.tt_inschar || tt.tt_insspace)
wwaddcap1(WWT_IMEI, &kp);
if (tt.tt_delchar)
wwaddcap1(WWT_DC, &kp);
wwaddcap1(WWT_IMEI, &kp);
if (tt.tt_delchar)
wwaddcap1(WWT_DC, &kp);
-static char sccsid[] = "@(#)wwinschar.c 3.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwinschar.c 3.18 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
-static char sccsid[] = "@(#)wwupdate.c 3.25 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwupdate.c 3.26 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
}
if (wwwrap
&& i == wwnrow - 1 && q - buf + c == wwncol) {
}
if (wwwrap
&& i == wwnrow - 1 && q - buf + c == wwncol) {
if (q - buf != 1) {
xxwrite(i, c, buf + 1,
q - buf - 1, m);
if (q - buf != 1) {
xxwrite(i, c, buf + 1,
q - buf - 1, m);
- xxinschar(i, c, *buf |
- m << WWC_MSHIFT);
+ xxinschar(i, c, *buf, m);
} else {
xxwrite(i, c - 1, buf, 1, m);
xxinschar(i, c - 1,
} else {
xxwrite(i, c - 1, buf, 1, m);
xxinschar(i, c - 1,
+ ns[-2].c_c, ns[-2].c_m);
- } else if (tt.tt_inschar) {
+ } else if (tt.tt_insspace) {
if (q - buf != 1) {
xxwrite(i, c, buf + 1,
q - buf - 1, m);
if (q - buf != 1) {
xxwrite(i, c, buf + 1,
q - buf - 1, m);
- xxinschar(i, c, *buf |
- m << WWC_MSHIFT);
xxwrite(i, c, buf, 1, m);
} else {
xxwrite(i, c - 1, buf, 1, m);
xxwrite(i, c, buf, 1, m);
} else {
xxwrite(i, c - 1, buf, 1, m);
- xxinschar(i, c - 1,
- ns[-2].c_w);
xxwrite(i, c - 1, &ns[-2].c_c,
1, ns[-2].c_m);
}
xxwrite(i, c - 1, &ns[-2].c_c,
1, ns[-2].c_m);
}
-static char sccsid[] = "@(#)wwwrite.c 3.29 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwwrite.c 3.30 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
q = p + 10;
}
wwinschar(w, w->ww_cur.r, w->ww_cur.c,
q = p + 10;
}
wwinschar(w, w->ww_cur.r, w->ww_cur.c,
- *p++ | w->ww_modes << WWC_MSHIFT);
-static char sccsid[] = "@(#)xx.c 3.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)xx.c 3.2 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
if (tt.tt_scroll_top != 0 || tt.tt_scroll_bot != tt.tt_nrow - 1)
/* tt.tt_setscroll is known to be defined */
(*tt.tt_setscroll)(0, tt.tt_nrow - 1);
if (tt.tt_scroll_top != 0 || tt.tt_scroll_bot != tt.tt_nrow - 1)
/* tt.tt_setscroll is known to be defined */
(*tt.tt_setscroll)(0, tt.tt_nrow - 1);
- if (tt.tt_insert)
- (*tt.tt_setinsert)(0);
if (tt.tt_modes)
(*tt.tt_setmodes)(0);
if (tt.tt_scroll_down)
if (tt.tt_modes)
(*tt.tt_setmodes)(0);
if (tt.tt_scroll_down)
+xxinschar(row, col, c, m)
+{
+ register struct xx *xp;
+
+ xp = xxalloc();
+ xp->cmd = xc_inschar;
+ xp->arg0 = row;
+ xp->arg1 = col;
+ xp->arg2 = c;
+ xp->arg3 = m;
+}
+
+xxinsspace(row, col)
{
register struct xx *xp = xx_tail;
{
register struct xx *xp = xx_tail;
- int m = c >> WWC_MSHIFT;
- if (xxbufp >= xxbufe)
- xxflush(0);
- c &= WWC_CMASK;
- if (xp != 0 && xp->cmd == xc_inschar &&
- xp->arg0 == row && xp->arg1 + xp->arg2 == col && xp->arg3 == m) {
- xp->buf[xp->arg2++] = c;
- xxbufp++;
+ if (xp != 0 && xp->cmd == xc_insspace && xp->arg0 == row &&
+ col >= xp->arg1 && col <= xp->arg1 + xp->arg2) {
+ xp->arg2++;
return;
}
xp = xxalloc();
return;
}
xp = xxalloc();
xp->arg0 = row;
xp->arg1 = col;
xp->arg2 = 1;
xp->arg0 = row;
xp->arg1 = col;
xp->arg2 = 1;
- xp->arg3 = m;
- xp->buf = xxbufp++;
- *xp->buf = c;
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#)xx.h 3.1 (Berkeley) %G%
+ * @(#)xx.h 3.2 (Berkeley) %G%
- enum { xc_move, xc_scroll, xc_delchar, xc_inschar, xc_clear, xc_clreos,
- xc_clreol, xc_write } cmd;
+ enum { xc_move, xc_scroll, xc_inschar, xc_insspace, xc_delchar,
+ xc_clear, xc_clreos, xc_clreol, xc_write } cmd;
int arg0;
int arg1;
int arg2;
int arg0;
int arg1;
int arg2;
-static char sccsid[] = "@(#)xxflush.c 3.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)xxflush.c 3.2 (Berkeley) %G%";
#endif /* not lint */
#include "ww.h"
#endif /* not lint */
#include "ww.h"
xxflush_scroll(xp);
break;
case xc_inschar:
xxflush_scroll(xp);
break;
case xc_inschar:
- if (xp->arg1 + xp->arg2 >= tt.tt_ncol)
- break;
(*tt.tt_move)(xp->arg0, xp->arg1);
(*tt.tt_move)(xp->arg0, xp->arg1);
- if (tt.tt_setinsert) {
- tt.tt_nmodes = xp->arg3;
- tt.tt_ninsert = 1;
- (*tt.tt_write)(xp->buf, xp->arg2);
- tt.tt_ninsert = 0;
- } else
- (*tt.tt_inschar)(xp->arg2);
+ tt.tt_nmodes = xp->arg3;
+ (*tt.tt_inschar)(xp->arg2);
+ break;
+ case xc_insspace:
+ (*tt.tt_move)(xp->arg0, xp->arg1);
+ (*tt.tt_insspace)(xp->arg2);
- if (xp->arg1 + xp->arg2 >= tt.tt_ncol)
- break;
(*tt.tt_move)(xp->arg0, xp->arg1);
(*tt.tt_delchar)(xp->arg2);
break;
(*tt.tt_move)(xp->arg0, xp->arg1);
(*tt.tt_delchar)(xp->arg2);
break;