1: #ifndef lint
   2: static char sccsid[] = "@(#)wwcursor.c	3.8 4/24/85";
   3: #endif
   4: 
   5: /*
   6:  * Copyright (c) 1983 Regents of the University of California,
   7:  * All rights reserved.  Redistribution permitted subject to
   8:  * the terms of the Berkeley Software License Agreement.
   9:  */
  10: 
  11: #include "ww.h"
  12: 
  13: wwcursor(w, on)
  14: register struct ww *w;
  15: {
  16:     register char *win;
  17: 
  18:     if (on) {
  19:         if (w->ww_hascursor)
  20:             return;
  21:         w->ww_hascursor = 1;
  22:     } else {
  23:         if (!w->ww_hascursor)
  24:             return;
  25:         w->ww_hascursor = 0;
  26:     }
  27:     if (wwcursormodes != 0) {
  28:         win = &w->ww_win[w->ww_cur.r][w->ww_cur.c];
  29:         *win ^= wwcursormodes;
  30:         if (w->ww_cur.r < w->ww_i.t || w->ww_cur.r >= w->ww_i.b
  31:             || w->ww_cur.c < w->ww_i.l || w->ww_cur.c >= w->ww_i.r)
  32:             return;
  33:         if (wwsmap[w->ww_cur.r][w->ww_cur.c] == w->ww_index) {
  34:             if (*win == 0)
  35:                 w->ww_nvis[w->ww_cur.r]++;
  36:             else if (*win == wwcursormodes)
  37:                 w->ww_nvis[w->ww_cur.r]--;
  38:             wwns[w->ww_cur.r][w->ww_cur.c].c_m ^= wwcursormodes;
  39:             wwtouched[w->ww_cur.r] |= WWU_TOUCHED;
  40:         }
  41:     }
  42: }
  43: 
  44: wwsetcursormodes(new)
  45: register new;
  46: {
  47:     register i;
  48:     register struct ww *w;
  49:     register old = wwcursormodes;
  50: 
  51:     new &= wwavailmodes;
  52:     if (new == wwcursormodes)
  53:         return;
  54:     for (i = 0; i < NWW; i++)
  55:         if (wwindex[i] != 0 && (w = wwindex[i])->ww_hascursor) {
  56:             wwcursor(w, 0);
  57:             wwcursormodes = new;
  58:             wwcursor(w, 1);
  59:             wwcursormodes = old;
  60:         }
  61:     wwcursormodes = new;
  62: }

Defined functions

wwsetcursormodes defined in line 44; used 1 times

Defined variables

sccsid defined in line 2; never used
Last modified: 1987-02-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1811
Valid CSS Valid XHTML 1.0 Strict