make sure unavailable mode bits are not set,
[unix-history] / usr / src / usr.bin / window / ww.h
index 99ea7b1..a7c8f61 100644 (file)
@@ -1,5 +1,11 @@
 /*
 /*
- *     @(#)ww.h        3.29 84/04/08   
+ * @(#)ww.h    3.37 %G%        
+ */
+
+/*
+ * Copyright (c) 1983 Regents of the University of California,
+ * All rights reserved.  Redistribution permitted subject to
+ * the terms of the Berkeley Software License Agreement.
  */
 
 #include <sgtty.h>
  */
 
 #include <sgtty.h>
@@ -23,10 +29,13 @@ struct ww_pos {
 
        /* 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 */
 
@@ -51,7 +60,6 @@ struct ww {
        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 */
@@ -66,10 +74,11 @@ struct ww {
        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 */
 };
 
        /* state of a tty */
 };
 
        /* state of a tty */
@@ -85,7 +94,7 @@ struct ww_tty {
 union ww_char {
        short c_w;              /* as a word */
        struct {
 union ww_char {
        short c_w;              /* as a word */
        struct {
-#ifndef O_SUN
+#ifndef mc68000
                char C_c;       /* the character part */
                char C_m;       /* the mode part */
 #else
                char C_c;       /* the character part */
                char C_m;       /* the mode part */
 #else
@@ -107,7 +116,9 @@ union ww_char {
 #define WWM_BLK                0x02    /* blinking */
 #define WWM_UL         0x04    /* underlined */
 #define WWM_GRP                0x08    /* graphics */
 #define WWM_BLK                0x02    /* blinking */
 #define WWM_UL         0x04    /* underlined */
 #define WWM_GRP                0x08    /* graphics */
-#define WWM_GLS                0x10    /* window only, glass, i.e. transparent */
+#define WWM_DIM                0x10    /* half intensity */
+#define WWM_USR                0x20    /* user specified mode */
+#define WWM_GLS                0x40    /* window only, glass, i.e., transparent */
 
        /* ww_state values */
 #define WWS_INITIAL    0       /* just opened */
 
        /* ww_state values */
 #define WWS_INITIAL    0       /* just opened */
@@ -185,7 +196,6 @@ int wwnwread, wwnwreade, wwnwreadz, wwnwreadd, wwnwreadc, wwnwreadp;
 int wwnselect, wwnselecte, wwnselectz;
 
        /* quicky macros */
 int wwnselect, wwnselecte, wwnselectz;
 
        /* quicky macros */
-#define wwbell()       write(1, "\7", 1)
 #define wwsetcursor(r,c) (wwcursorrow = (r), wwcursorcol = (c))
 #define wwcurtowin(w)  wwsetcursor((w)->ww_cur.r, (w)->ww_cur.c)
 #define wwunbox(w)     wwunframe(w)
 #define wwsetcursor(r,c) (wwcursorrow = (r), wwcursorcol = (c))
 #define wwcurtowin(w)  wwsetcursor((w)->ww_cur.r, (w)->ww_cur.c)
 #define wwunbox(w)     wwunframe(w)
@@ -209,14 +219,17 @@ char *wwibq;              /* current write position in buffer */
 
        /* the window virtual terminal */
 #define WWT_TERM       "TERM=window"
 
        /* the window virtual terminal */
 #define WWT_TERM       "TERM=window"
-#define WWT_TERMCAP    "WW|window|window package:\
+#define WWT_TERMCAP    "WW|window|window program:\
        :cr=^M:nl=^J:bl=^G:\
        :al=\\EL:am:le=^H:bs:cd=\\EJ:ce=\\EK:cl=\\EE:cm=\\EY%+ %+ :\
        :da:db:dc=\\EN:dl=\\EM:do=\\EB:ei=\\EO:ho=\\EH:im=\\E@:mi:\
        :cr=^M:nl=^J:bl=^G:\
        :al=\\EL:am:le=^H:bs:cd=\\EJ:ce=\\EK:cl=\\EE:cm=\\EY%+ %+ :\
        :da:db:dc=\\EN:dl=\\EM:do=\\EB:ei=\\EO:ho=\\EH:im=\\E@:mi:\
-       :nd=\\EC:ta=^I:pt:up=\\EA:"
-#define WWT_REV                "se=\\Eq:so=\\Ep:"
-#define WWT_UL         "ue=\\Es:us=\\Er:"
-#define WWT_GRP                "ae=\\EG:as=\\EF:"
+       :nd=\\EC:ta=^I:pt:up=\\EA:me=\\Er^?:"
+#define WWT_REV                "se=\\ErA:so=\\EsA:mr=\\EsA:"
+#define WWT_BLK                "BE=\\ErB:BS=\\EsB:mb=\\EsB:"
+#define WWT_UL         "ue=\\ErD:us=\\EsD:"
+#define WWT_GRP                "ae=\\ErH:as=\\EsH:"
+#define WWT_DIM                "HE=\\ErP:HS=\\EsP:mh=\\EsP:"
+#define WWT_USR                "XE=\\Er`:XS=\\Es`:"
 
        /* our functions */
 struct ww *wwopen();
 
        /* our functions */
 struct ww *wwopen();
@@ -239,12 +252,3 @@ char *sprintf();
 #undef MAX
 #define MIN(x, y)      ((x) > (y) ? (y) : (x))
 #define MAX(x, y)      ((x) > (y) ? (x) : (y))
 #undef MAX
 #define MIN(x, y)      ((x) > (y) ? (y) : (x))
 #define MAX(x, y)      ((x) > (y) ? (x) : (y))
-
-#if defined(O_4_1A)||defined(O_4_1C)
-int (*sigset)();
-#define signal(s, v)   sigset((s), (v))
-#else
-#define sigmask(s)     (1 << (s) - 1)
-#define sighold(s)     sigblock(sigmask(s))
-#define sigrelse(s)    sigsetmask(sigblock(0) & ~sigmask(s))
-#endif