Commit | Line | Data |
---|---|---|
0b5c625e GM |
1 | /* |
2 | * @(#)screen.h 3.1 10/29/86 | |
3 | */ | |
4 | ||
5 | #define INCLUDED_TERMINAL | |
6 | ||
7 | #if defined(SLOWSCREEN) | |
8 | ||
9 | /* | |
10 | * In the situation where we have a copy of the terminal screen in front | |
11 | * of us, here are some macros to deal with them. | |
12 | */ | |
13 | ||
f3fad2d3 GM |
14 | #define TermAttributes(x) (TermIsStartField(x)? GetTerminal(x)&0xff : \ |
15 | GetTerminal(WhereTermAttrByte(x))&0xff) | |
16 | #define TermIsStartField(x) (GetTerminal(x)&ATTR_MASK) | |
17 | #define TermNewField(p,a) SetTerminal(p, (a)|ATTR_MASK) | |
18 | #define TermDeleteField(p) SetTerminal(p, 0) | |
0b5c625e GM |
19 | #define TermIsNonDisplay(x) \ |
20 | ((TermAttributes(x)&ATTR_DSPD_MASK) == ATTR_DSPD_NONDISPLAY) | |
21 | #define TermIsHighlighted(x) \ | |
22 | (((TermAttributes(x)&ATTR_DSPD_MASK) == ATTR_DSPD_HIGH) \ | |
23 | && !TermIsStartField(x)) | |
24 | ||
25 | #define TerminalCharacterAttr(c,p,a) (IsNonDisplayAttr(a) ? ' ':c) | |
26 | #define TerminalCharacter(c,p) TerminalCharacterAttr(c,p,FieldAttributes(p)) | |
27 | ||
28 | #define NeedToRedisplayFields(p) ((TermIsNonDisplay(p) != IsNonDisplay(p)) || \ | |
29 | (TermIsHighlighted(p) != IsHighlighted(p))) | |
30 | #define NeedToRedisplayFieldsAttr(p,c) ( \ | |
31 | (TermIsNonDisplay(p) != IsNonDisplayAttr(c)) || \ | |
32 | (TermIsHighlighted(p) != IsHighlightedAttr(c))) | |
33 | ||
34 | #define NotVisuallyCompatibleAttributes(p,c,d) ( \ | |
35 | (IsNonDisplayAttr(c) != IsNonDisplayAttr(d)) || \ | |
36 | (IsHighlightedAttr(c) != IsHighlightedAttr(d))) | |
37 | ||
38 | #define NeedToRedisplayAttr(c,p,a) \ | |
39 | ((c != GetTerminal(p)) || NeedToRedisplayFieldsAttr(p,a)) | |
40 | #define NeedToRedisplay(c,p) NeedToRedisplayAttr(c,p,FieldAttributes(p)) | |
41 | ||
0b5c625e | 42 | #endif /* defined(SLOWSCREEN) */ |
f3fad2d3 GM |
43 | |
44 | #define GetTerminal(i) GetGeneric(i, Terminal) | |
45 | #define GetTerminalPointer(p) GetGenericPointer(p) | |
46 | #define SetTerminal(i,c) SetGeneric(i,c,Terminal) |