fake cursor
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 20 Aug 1983 06:04:54 +0000 (22:04 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 20 Aug 1983 06:04:54 +0000 (22:04 -0800)
SCCS-vsn: usr.bin/window/main.c 3.4
SCCS-vsn: usr.bin/window/wwinit.c 3.7
SCCS-vsn: usr.bin/window/ww.h 3.9
SCCS-vsn: usr.bin/window/cmd.c 3.4
SCCS-vsn: usr.bin/window/cmd1.c 3.6
SCCS-vsn: usr.bin/window/wwwrite.c 3.6

usr/src/usr.bin/window/cmd.c
usr/src/usr.bin/window/cmd1.c
usr/src/usr.bin/window/main.c
usr/src/usr.bin/window/ww.h
usr/src/usr.bin/window/wwinit.c
usr/src/usr.bin/window/wwwrite.c

index 0dc9cd3..b747d40 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd.c       3.3 83/08/18";
+static char *sccsid = "@(#)cmd.c       3.4 83/08/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -13,10 +13,8 @@ docmd()
 
        if (!terse)
                wwadd(cmdwin, &wwhead);
 
        if (!terse)
                wwadd(cmdwin, &wwhead);
-       /*
        if (selwin != 0)
        if (selwin != 0)
-               Woncursor(selwin->ww_win, 1);
-       */
+               wwcursor(selwin, 1);
 top:
        while ((c = bgetc()) >= 0) {
                if (!terse)
 top:
        while ((c = bgetc()) >= 0) {
                if (!terse)
@@ -184,10 +182,8 @@ out:
                        reframe();
                }
        }
                        reframe();
                }
        }
-       /*
        if (selwin != 0)
        if (selwin != 0)
-               Woncursor(selwin->ww_win, 0);
-       */
+               wwcursor(selwin, 0);
 }
 
 struct ww *
 }
 
 struct ww *
@@ -228,15 +224,7 @@ register struct ww *w;
                 * or behind everbody else.
                 */
                wwadd(w, (oldselwin ? oldselwin : &wwhead)->ww_back);
                 * or behind everbody else.
                 */
                wwadd(w, (oldselwin ? oldselwin : &wwhead)->ww_back);
-               /*
-               Woncursor(w->ww_win, 1);
-               */
-       }
-       /*
-       if (oldselwin) {
-               Woncursor(oldselwin->ww_win, 0);
        }
        }
-       */
        reframe();
 }
 
        reframe();
 }
 
index 8774dca..0cad5ef 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)cmd1.c      3.5 83/08/18";
+static char *sccsid = "@(#)cmd1.c      3.6 83/08/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -155,6 +155,7 @@ int id, nrow, ncol, row, col;
        w->ww_id = id;
        window[id] = w;
        w->ww_hasframe = 1;
        w->ww_id = id;
        window[id] = w;
        w->ww_hasframe = 1;
+       wwcursor(w, 1);
        wwadd(w, (selwin ? selwin : wwhead.ww_back));
        setselwin(w);
        wwupdate();
        wwadd(w, (selwin ? selwin : wwhead.ww_back));
        setselwin(w);
        wwupdate();
index cc0fc58..fedd6b3 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)main.c      3.3 83/08/18";
+static char *sccsid = "@(#)main.c      3.4 83/08/19";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -93,9 +93,7 @@ char **argv;
                        dodefault();
                if (selwin != 0) {
                        curwin = selwin;
                        dodefault();
                if (selwin != 0) {
                        curwin = selwin;
-                       /*
-                       Woncursor(selwin->ww_win, 0);
-                       */
+                       wwcursor(selwin, 0);
                }
                if (!terse) {
                        wwdelete(cmdwin);
                }
                if (!terse) {
                        wwdelete(cmdwin);
index 8d92328..d439f46 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- *     @(#)ww.h        3.8 83/08/18    
+ *     @(#)ww.h        3.9 83/08/19    
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
@@ -28,6 +28,7 @@ struct ww {
        char ww_insert :1;      /* insert mode, for printing */
        char ww_mapnl :1;       /* map \n to \r\n */
        char ww_haspty :1;      /* has pty */
        char ww_insert :1;      /* insert mode, for printing */
        char ww_mapnl :1;       /* map \n to \r\n */
        char ww_haspty :1;      /* has pty */
+       char ww_hascursor :1;   /* has fake cursor */
        char ww_index;          /* the index, for wwindex[] */
        char ww_order;          /* the overlapping order */
        struct ww_dim ww_w;     /* window dimemsions */
        char ww_index;          /* the index, for wwindex[] */
        char ww_order;          /* the overlapping order */
        struct ww_dim ww_w;     /* window dimemsions */
@@ -116,6 +117,7 @@ char wwkeys[512];           /* termcap fields for the function keys */
 
 int wwnrow, wwncol;            /* the screen size */
 char wwavailmodes;             /* actually supported modes */
 
 int wwnrow, wwncol;            /* the screen size */
 char wwavailmodes;             /* actually supported modes */
+char wwcursormodes;            /* the modes for the fake cursor */
 char wwwrap;                   /* terminal has auto wrap around */
 int wwdtablesize;              /* result of getdtablesize() call */
 char **wwsmap;                 /* the screen map */
 char wwwrap;                   /* terminal has auto wrap around */
 int wwdtablesize;              /* result of getdtablesize() call */
 char **wwsmap;                 /* the screen map */
index 4508893..80fdb96 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwinit.c    3.6 83/08/17";
+static char *sccsid = "@(#)wwinit.c    3.7 83/08/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
@@ -45,6 +45,11 @@ wwinit()
        wwwrap = tt.tt_wrap;
        (*tt.tt_init)();
 
        wwwrap = tt.tt_wrap;
        (*tt.tt_init)();
 
+       if (wwavailmodes & WWM_REV)
+               wwcursormodes = WWM_REV | wwavailmodes & WWM_BLK;
+       else if (wwavailmodes & WWM_UL)
+               wwcursormodes = WWM_UL;
+
        if ((wwsmap = wwalloc(wwnrow, wwncol, sizeof (char))) == 0)
                goto bad;
        for (i = 0; i < wwnrow; i++)
        if ((wwsmap = wwalloc(wwnrow, wwncol, sizeof (char))) == 0)
                goto bad;
        for (i = 0; i < wwnrow; i++)
index cd7fe60..38b3da7 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)wwwrite.c   3.5 83/08/18";
+static char *sccsid = "@(#)wwwrite.c   3.6 83/08/19";
 #endif
 
 #include "ww.h"
 #endif
 
 #include "ww.h"
@@ -11,11 +11,14 @@ int n;
 {
        char c;
        int oldn = n;
 {
        char c;
        int oldn = n;
+       char hascursor = 0;
 
        if (w == 0)
                return -1;
        wwnwrite++;
        wwnwritec += n;
 
        if (w == 0)
                return -1;
        wwnwrite++;
        wwnwritec += n;
+       if (hascursor = w->ww_hascursor)
+               wwcursor(w, 0);
        while (--n >= 0) {
                c = *p++ & 0x7f;
                switch (w->ww_wstate) {
        while (--n >= 0) {
                c = *p++ & 0x7f;
                switch (w->ww_wstate) {
@@ -183,5 +186,7 @@ int n;
                        break;
                }
        }
                        break;
                }
        }
+       if (hascursor)
+               wwcursor(w, 1);
        return oldn - n;
 }
        return oldn - n;
 }