SCCS-vsn: usr.bin/window/ttinit.c 3.11
SCCS-vsn: usr.bin/window/win.c 3.11
SCCS-vsn: usr.bin/window/cmd5.c 3.13
SCCS-vsn: usr.bin/window/ww.h 3.35
SCCS-vsn: usr.bin/window/wwopen.c 3.19
-static char sccsid[] = "@(#)cmd5.c 3.12 %G%";
+static char sccsid[] = "@(#)cmd5.c 3.13 %G%";
int maxcol, maxrow;
int curcol, currow;
int maxcol, maxrow;
int curcol, currow;
+ if (!terse)
+ wwputs("New window position: ", cmdwin);
col = w->ww_w.l;
row = w->ww_w.t;
wwadd(boxwin, framewin->ww_back);
col = w->ww_w.l;
row = w->ww_w.t;
wwadd(boxwin, framewin->ww_back);
{
struct ww *back = w->ww_back;
{
struct ww *back = w->ww_back;
- w->ww_altpos.r = w->ww_w.t;
- w->ww_altpos.c = w->ww_w.l;
+ w->ww_alt.t = w->ww_w.t;
+ w->ww_alt.l = w->ww_w.l;
wwdelete(w);
wwmove(w, row, col);
wwadd(w, back);
wwdelete(w);
wwmove(w, row, col);
wwadd(w, back);
-static char sccsid[] = "@(#)ttinit.c 3.10 %G%";
+static char sccsid[] = "@(#)ttinit.c 3.11 %G%";
#endif
#include "ww.h"
#include "tt.h"
#endif
#include "ww.h"
#include "tt.h"
+int tt_h19();
+int tt_h29();
+int tt_f100();
+int tt_generic();
+struct tt_tab tt_tab[] = {
+ { "h19", 3, tt_h19 },
+ { "h29", 3, tt_h29 },
+ { "f100", 4, tt_f100 },
+ { "generic", 0, tt_generic },
+ 0
+};
+
ttinit()
{
register struct tt_tab *tp;
register char *p, *q;
register char *t;
ttinit()
{
register struct tt_tab *tp;
register char *p, *q;
register char *t;
+ struct winsize winsize;
wwerrno = WWE_CANTDO;
return -1;
}
wwerrno = WWE_CANTDO;
return -1;
}
+ if (ioctl(0, TIOCGWINSZ, (char *)&winsize) >= 0 && winsize.ws_row != 0
+ && winsize.ws_col != 0) {
+ tt.tt_nrow = winsize.ws_row;
+ tt.tt_ncol = winsize.ws_col;
+ }
w->ww_id = id;
window[id] = w;
w->ww_hasframe = hasframe;
w->ww_id = id;
window[id] = w;
w->ww_hasframe = hasframe;
- w->ww_altpos.r = 1;
- w->ww_altpos.c = 0;
if (label != 0 && setlabel(w, label) < 0)
error("No memory for label.");
wwcursor(w, 1);
if (label != 0 && setlabel(w, label) < 0)
error("No memory for label.");
wwcursor(w, 1);
/* the window structure */
struct ww {
/* the window structure */
struct ww {
+ /* general flags and states */
+ char ww_state; /* state of window */
+ char ww_oflags; /* wwopen flags */
+
/* information for overlap */
struct ww *ww_forw; /* doubly linked list, for overlapping info */
struct ww *ww_back;
/* information for overlap */
struct ww *ww_forw; /* doubly linked list, for overlapping info */
struct ww *ww_back;
- char ww_state; /* state of window */
char ww_index; /* the window index, for wwindex[] */
char ww_order; /* the overlapping order */
char ww_index; /* the window index, for wwindex[] */
char ww_order; /* the overlapping order */
char ww_unctrl; /* expand control characters */
char ww_nointr; /* wwwrite() not interruptable */
char ww_hascursor; /* has fake cursor */
char ww_unctrl; /* expand control characters */
char ww_nointr; /* wwwrite() not interruptable */
char ww_hascursor; /* has fake cursor */
- char ww_hasframe; /* frame it */
/* things for the window process and io */
char ww_ispty; /* ww_pty is really a pty, not socket pair */
/* things for the window process and io */
char ww_ispty; /* ww_pty is really a pty, not socket pair */
char *ww_obq; /* current write position in ww_ob */
/* things for the user, they really don't belong here */
char *ww_obq; /* current write position in ww_ob */
/* things for the user, they really don't belong here */
- char ww_center; /* center the label */
char ww_id; /* the user window id */
char ww_id; /* the user window id */
+ char ww_center; /* center the label */
+ char ww_hasframe; /* frame it */
char *ww_label; /* the user supplied label */
char *ww_label; /* the user supplied label */
- struct ww_pos ww_altpos;/* alternate position */
+ struct ww_dim ww_alt; /* alternate position and size */
-static char sccsid[] = "@(#)wwopen.c 3.18 %G%";
+static char sccsid[] = "@(#)wwopen.c 3.19 %G%";
w->ww_cur.c = w->ww_w.l;
if (flags & WWO_PTY) {
w->ww_cur.c = w->ww_w.l;
if (flags & WWO_PTY) {
+ struct winsize winsize;
+
if (wwgetpty(w) < 0)
goto bad;
if (wwsettty(w->ww_pty, &wwwintty, (struct ww_tty *)0) < 0)
goto bad;
if (wwgetpty(w) < 0)
goto bad;
if (wwsettty(w->ww_pty, &wwwintty, (struct ww_tty *)0) < 0)
goto bad;
+ winsize.ws_row = nrow;
+ winsize.ws_col = ncol;
+ winsize.ws_xpixel = winsize.ws_ypixel = 0;
+ if (ioctl(w->ww_pty, TIOCSWINSZ, (char *)&winsize) < 0) {
+ wwerrno = WWE_SYS;
+ goto bad;
+ }
w->ww_ispty = 1;
} else if (flags & WWO_SOCKET) {
int d[2];
w->ww_ispty = 1;
} else if (flags & WWO_SOCKET) {
int d[2];
w->ww_fmap = wwalloc(w->ww_w.t, w->ww_w.l,
w->ww_w.nr, w->ww_w.nc, sizeof (char));
if (w->ww_fmap == 0)
w->ww_fmap = wwalloc(w->ww_w.t, w->ww_w.l,
w->ww_w.nr, w->ww_w.nc, sizeof (char));
if (w->ww_fmap == 0)
for (i = w->ww_w.t; i < w->ww_w.b; i++)
for (j = w->ww_w.l; j < w->ww_w.r; j++)
w->ww_fmap[i][j] = 0;
}
for (i = w->ww_w.t; i < w->ww_w.b; i++)
for (j = w->ww_w.l; j < w->ww_w.r; j++)
w->ww_fmap[i][j] = 0;
}
w->ww_buf = (union ww_char **)
wwalloc(w->ww_b.t, w->ww_b.l,
w->ww_b.nr, w->ww_b.nc, sizeof (union ww_char));
w->ww_buf = (union ww_char **)
wwalloc(w->ww_b.t, w->ww_b.l,
w->ww_b.nr, w->ww_b.nc, sizeof (union ww_char));
w->ww_nvis[i] = nvis;
w->ww_state = WWS_INITIAL;
w->ww_nvis[i] = nvis;
w->ww_state = WWS_INITIAL;
return wwindex[w->ww_index] = w;
bad:
if (w != 0) {
return wwindex[w->ww_index] = w;
bad:
if (w != 0) {