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