struct NewWindow
{
int StartAt;
char *aka;
char **args;
char *dir;
char *term;
int aflag;
int flowflag;
int lflag;
int histheight;
int monitor;
int wlock;
int silence;
int wrap;
int Lflag;
int slow;
int gr;
int c1;
int bce;
int encoding;
char *hstatus;
char *charset;
};
#ifdef PSEUDOS
struct pseudowin
{
int p_fdpat;
int p_pid;
int p_ptyfd;
struct event p_readev;
struct event p_writeev;
char p_cmd[MAXSTR];
char p_tty[MAXSTR];
char p_inbuf[IOSIZE];
int p_inlen;
};
#define F_PMASK 0x0003
#define F_PSHIFT 2
#define F_PFRONT 0x0001
#define F_PBACK 0x0002
#define F_PBOTH (F_PFRONT | F_PBACK)
#define F_UWP 0x1000
#define W_WP(w) ((w)->w_pwin && ((w)->w_pwin->p_fdpat & F_PFRONT))
#define W_WW(w) (!((w)->w_pwin) || \
(((w)->w_pwin->p_fdpat & F_PMASK) == F_PBACK) || \
((((w)->w_pwin->p_fdpat >> F_PSHIFT) & F_PMASK) == F_PBOTH) || \
((((w)->w_pwin->p_fdpat >> (F_PSHIFT * 2)) & F_PMASK) == F_PBOTH))
#define W_RP(w) ((w)->w_pwin && ((w)->w_pwin->p_fdpat & \
((F_PFRONT << (F_PSHIFT * 2)) | (F_PFRONT << F_PSHIFT)) ))
#define W_RW(w) (!((w)->w_pwin) || ((w)->w_pwin->p_fdpat & F_PFRONT))
#define W_UWP(w) ((w)->w_pwin && ((w)->w_pwin->p_fdpat & F_UWP))
#define W_PTOW(w) (\
((w)->w_pwin->p_fdpat & F_PMASK << F_PSHIFT) == F_PBOTH << F_PSHIFT || \
((w)->w_pwin->p_fdpat & F_PMASK << F_PSHIFT * 2) == F_PBOTH << F_PSHIFT * 2 )
#define W_WTOP(w) (((w)->w_pwin->p_fdpat & F_PMASK) == F_PBOTH)
#endif
#define WLOCK_OFF 0
#define WLOCK_AUTO 1
#define WLOCK_ON 2
#ifdef COPY_PASTE
struct paster
{
char *pa_pastebuf;
char *pa_pasteptr;
int pa_pastelen;
struct layer *pa_pastelayer;
struct event pa_slowev;
};
#else
struct paster;
#endif
struct win
{
struct win *w_next;
int w_type;
void *w_data;
struct layer w_layer;
struct layer *w_savelayer;
int w_blocked;
#ifdef PSEUDOS
struct pseudowin *w_pwin;
#endif
struct display *w_pdisplay;
struct display *w_lastdisp;
int w_number;
struct event w_readev;
struct event w_writeev;
struct event w_silenceev;
int w_ptyfd;
char w_inbuf[IOSIZE];
int w_inlen;
char w_outbuf[IOSIZE];
int w_outlen;
int w_aflag;
char *w_title;
char *w_akachange;
char w_akabuf[MAXSTR];
int w_autoaka;
int w_intermediate;
int w_args[MAXARGS];
int w_NumArgs;
#ifdef MULTIUSER
int w_wlock;
struct acluser *w_wlockuser;
AclBits w_userbits[ACL_BITS_PER_WIN];
AclBits w_lio_notify;
AclBits w_mon_notify;
#endif
enum state_t w_state;
enum string_t w_StringType;
struct mline *w_mlines;
struct mchar w_rend;
#ifdef FONT
char w_FontL;
char w_FontR;
# ifdef ENCODINGS
char w_FontE;
# endif
int w_Charset;
int w_CharsetR;
int w_charsets[4];
#endif
int w_ss;
int w_saved;
int w_Saved_x, w_Saved_y;
struct mchar w_SavedRend;
#ifdef FONT
int w_SavedCharset;
int w_SavedCharsetR;
int w_SavedCharsets[4];
#endif
int w_top, w_bot;
int w_wrap;
int w_origin;
int w_insert;
int w_keypad;
int w_cursorkeys;
int w_revvid;
int w_curinv;
int w_curvvis;
int w_autolf;
char *w_hstatus;
int w_gr;
int w_c1;
int w_bce;
#if 0
int w_encoding;
#endif
int w_decodestate;
#ifdef DW_CHARS
int w_mbcs;
#endif
char w_string[MAXSTR];
char *w_stringp;
char *w_tabs;
int w_bell;
int w_flow;
struct logfile *w_log;
int w_logsilence;
int w_monitor;
int w_silencewait;
int w_silence;
char w_vbwait;
char w_norefresh;
#ifdef RXVT_OSC
char w_xtermosc[4][MAXSTR];
#endif
int w_mouse;
#ifdef HAVE_BRAILLE
int w_bd_x, w_bd_y;
#endif
#ifdef COPY_PASTE
int w_slowpaste;
int w_histheight;
int w_histidx;
struct mline *w_hlines;
struct paster w_paster;
#else
int w_histheight;
#endif
int w_pid;
char *w_cmdargs[MAXARGS];
char *w_dir;
char *w_term;
int w_lflag;
slot_t w_slot;
#if defined (UTMPOK)
struct utmp w_savut;
#endif
char w_tty[MAXSTR];
int w_zauto;
#ifdef ZMODEM
struct display *w_zdisplay;
#endif
#ifdef BUILTIN_TELNET
struct sockaddr_in w_telsa;
char w_telbuf[IOSIZE];
int w_telbufl;
char w_telmopts[256];
char w_telropts[256];
int w_telstate;
char w_telsubbuf[128];
int w_telsubidx;
struct event w_telconnev;
#endif
struct mline *w_alt_mlines;
int w_alt_width;
int w_alt_height;
int w_alt_histheight;
int w_alt_x, w_alt_y;
#ifdef COPY_PASTE
struct mline *w_alt_hlines;
int w_alt_histidx;
#endif
};
#define w_encoding w_layer.l_encoding
#define w_width w_layer.l_width
#define w_height w_layer.l_height
#define w_x w_layer.l_x
#define w_y w_layer.l_y
#define W_TYPE_PTY 0
#define W_TYPE_PLAIN 1
#define W_TYPE_TELNET 2
#define FLOW_NOW (1<<0)
#define FLOW_AUTO (1<<1)
#define FLOW_AUTOFLAG (1<<2)
#define WIN(y) ((y < fore->w_histheight) ? \
&fore->w_hlines[(fore->w_histidx + y) % fore->w_histheight] \
: &fore->w_mlines[y - fore->w_histheight])
#define Layer2Window(l) ((struct win *)(l)->l_bottom->l_data)