|
|
1.1 root 1: /*
2: * Copyright (c) 1983 Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that the above copyright notice and this paragraph are
7: * duplicated in all such forms and that any documentation,
8: * advertising materials, and other materials related to such
9: * distribution and use acknowledge that the software was developed
10: * by the University of California, Berkeley. The name of the
11: * University may not be used to endorse or promote products derived
12: * from this software without specific prior written permission.
13: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16: */
17:
18: #ifndef lint
19: static char sccsid[] = "@(#)wwcursor.c 3.10 (Berkeley) 6/29/88";
20: #endif /* not lint */
21:
22: #include "ww.h"
23:
24: wwcursor(w, on)
25: register struct ww *w;
26: {
27: register char *win;
28:
29: if (on) {
30: if (w->ww_hascursor)
31: return;
32: w->ww_hascursor = 1;
33: } else {
34: if (!w->ww_hascursor)
35: return;
36: w->ww_hascursor = 0;
37: }
38: if (wwcursormodes != 0) {
39: win = &w->ww_win[w->ww_cur.r][w->ww_cur.c];
40: *win ^= wwcursormodes;
41: if (w->ww_cur.r < w->ww_i.t || w->ww_cur.r >= w->ww_i.b
42: || w->ww_cur.c < w->ww_i.l || w->ww_cur.c >= w->ww_i.r)
43: return;
44: if (wwsmap[w->ww_cur.r][w->ww_cur.c] == w->ww_index) {
45: if (*win == 0)
46: w->ww_nvis[w->ww_cur.r]++;
47: else if (*win == wwcursormodes)
48: w->ww_nvis[w->ww_cur.r]--;
49: wwns[w->ww_cur.r][w->ww_cur.c].c_m ^= wwcursormodes;
50: wwtouched[w->ww_cur.r] |= WWU_TOUCHED;
51: }
52: }
53: }
54:
55: wwsetcursormodes(new)
56: register new;
57: {
58: register i;
59: register struct ww *w;
60: register old = wwcursormodes;
61:
62: new &= wwavailmodes;
63: if (new == wwcursormodes)
64: return;
65: for (i = 0; i < NWW; i++)
66: if (wwindex[i] != 0 && (w = wwindex[i])->ww_hascursor) {
67: wwcursor(w, 0);
68: wwcursormodes = new;
69: wwcursor(w, 1);
70: wwcursormodes = old;
71: }
72: wwcursormodes = new;
73: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.