Commit | Line | Data |
---|---|---|
120c3815 | 1 | #ifndef lint |
f2a77fe1 | 2 | static char *sccsid = "@(#)wwcursor.c 3.3 83/09/15"; |
120c3815 EW |
3 | #endif |
4 | ||
5 | #include "ww.h" | |
6 | ||
7 | wwcursor(w, on) | |
8 | register struct ww *w; | |
9 | { | |
10 | register char *win; | |
120c3815 EW |
11 | |
12 | if (on) { | |
13 | if (w->ww_hascursor) | |
14 | return; | |
15 | w->ww_hascursor = 1; | |
16 | } else { | |
17 | if (!w->ww_hascursor) | |
18 | return; | |
19 | w->ww_hascursor = 0; | |
20 | } | |
21 | if (wwcursormodes != 0) { | |
22 | win = &w->ww_win[w->ww_cur.r][w->ww_cur.c]; | |
23 | if (*win == 0) | |
24 | w->ww_nvis[w->ww_cur.r]--; | |
25 | else if (*win == wwcursormodes) | |
26 | w->ww_nvis[w->ww_cur.r]++; | |
27 | *win ^= wwcursormodes; | |
f2a77fe1 EW |
28 | if (w->ww_cur.r < w->ww_i.t || w->ww_cur.r >= w->ww_i.b |
29 | || w->ww_cur.c < w->ww_i.l || w->ww_cur.c >= w->ww_i.r) | |
19f9784c | 30 | return; |
f2a77fe1 EW |
31 | if (wwsmap[w->ww_cur.r][w->ww_cur.c] == w->ww_index) { |
32 | wwns[w->ww_cur.r][w->ww_cur.c].c_m ^= wwcursormodes; | |
33 | wwtouched[w->ww_cur.r] = 1; | |
19f9784c | 34 | } |
120c3815 EW |
35 | } |
36 | } |