1 /* SCCS Id: @(#)termcap.c 3.4 2000/07/10 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
7 #if defined (TTY_GRAPHICS) && !defined(NO_TERMS)
14 #ifdef MICROPORT_286_BUG
15 #define Tgetstr(key) (tgetstr(key,tbuf))
17 #define Tgetstr(key) (tgetstr(key,&tbufptr))
18 #endif /* MICROPORT_286_BUG **/
20 static char * FDECL(s_atr2str, (int));
21 static char * FDECL(e_atr2str, (int));
23 void FDECL(cmov, (int, int));
24 void FDECL(nocmov, (int, int));
25 #if defined(TEXTCOLOR) && defined(TERMLIB)
27 # if !defined(UNIX) || !defined(TERMINFO)
29 static void FDECL(analyze_seq, (char *, int *, int *));
32 static void NDECL(init_hilite);
33 static void NDECL(kill_hilite);
38 /* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE,
40 struct tc_lcl_data tc_lcl_data = { 0, 0, 0, 0,0, 0,0, FALSE };
43 STATIC_VAR char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE;
44 STATIC_VAR char *VS, *VE;
48 STATIC_VAR char *MB, *MH;
49 STATIC_VAR char *MD; /* may already be in use below */
57 STATIC_OVL char PC = '\0';
61 STATIC_VAR char tbuf[512];
66 const char *hilites[CLR_MAX]; /* terminal escapes for the various colors */
68 char NEARDATA *hilites[CLR_MAX]; /* terminal escapes for the various colors */
73 static char *KS = (char *)0, *KE = (char *)0; /* keypad sequences */
74 static char nullstr[] = "";
77 #if defined(ASCIIGRAPH) && !defined(NO_TERMS)
78 extern boolean HE_resets_AS;
82 STATIC_VAR char tgotobuf[20];
84 #define tgoto(fmt, x, y) (Sprintf(tgotobuf, fmt, y+' ', x+' '), tgotobuf)
86 #define tgoto(fmt, x, y) (Sprintf(tgotobuf, fmt, y+1, x+1), tgotobuf)
98 register const char *term;
103 term = verify_termcap();
106 term = getenv("TERM");
108 # if defined(TOS) && defined(__GNUC__)
110 term = "builtin"; /* library has a default */
115 error("Can't get TERM.");
120 TI = VS = VE = TE = nullstr;
122 CE = "\033K"; /* the VT52 termcap */
124 nh_CM = "\033Y%c%c"; /* used with function tgoto() */
130 /* HI and HE will be updated in init_hilite if we're using color */
135 CL = "\033E"; /* last thing set */
143 if(CO < COLNO || LI < ROWNO+3)
148 /* nh_CD = "\033[J"; */
149 CE = "\033[K"; /* the ANSI termcap */
151 nh_CM = "\033[%d;%dH";
153 nh_CM = "\033[%i%d;%dH";
158 # ifdef MICRO /* backspaces are non-destructive */
163 nh_HI = SO = "\033[1m";
166 TI = nh_HE = ME = SE = nh_UE = "\033[0m";
167 /* strictly, SE should be 2, and nh_UE should be 24,
168 but we can't trust all ANSI emulators to be
169 that complete. -3. */
174 TE = VS = VE = nullstr;
176 for (i = 0; i < CLR_MAX / 2; i++)
177 if (i != CLR_BLACK) {
178 hilites[i|BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm"));
179 Sprintf(hilites[i|BRIGHT], "\033[1;3%dm", i);
182 if (i == CLR_BLUE) hilites[CLR_BLUE] = hilites[CLR_BLUE|BRIGHT];
186 hilites[i] = (char *) alloc(sizeof("\033[0;3%dm"));
187 Sprintf(hilites[i], "\033[0;3%dm", i);
193 CL = "\033[2J"; /* last thing set */
197 #endif /* ANSI_DEFAULT */
200 tptr = (char *) alloc(1024);
203 if(!strncmp(term, "5620", 4))
204 flags.null = FALSE; /* this should be a termcap flag */
205 if(tgetent(tptr, term) < 1) {
207 (void) strncpy(buf, term,
208 (BUFSZ - 1) - (sizeof("Unknown terminal type: . ")));
210 error("Unknown terminal type: %s.", term);
212 if ((pc = Tgetstr("pc")) != 0)
215 if(!(BC = Tgetstr("le"))) /* both termcap and terminfo use le */
217 error("Terminal must backspace.");
219 if(!(BC = Tgetstr("bc"))) { /* termcap also uses bc/bs */
220 # ifndef MINIMAL_TERM
222 error("Terminal must backspace.");
236 * LI and CO are set in ioctl.c via a TIOCGWINSZ if available. If
237 * the kernel has values for either we should use them rather than
238 * the values from TERMCAP ...
241 if (!CO) CO = tgetnum("co");
242 if (!LI) LI = tgetnum("li");
244 # if defined(TOS) && defined(__GNUC__)
245 if (!strcmp(term, "builtin"))
251 if (!LI || !CO) /* if we don't override it */
253 # if defined(TOS) && defined(__GNUC__)
258 if(CO < COLNO || LI < ROWNO+3)
261 nh_ND = Tgetstr("nd");
263 error("NetHack can't have OS.");
268 /* It seems that xd is no longer supported, and we should use
269 a linefeed instead; unfortunately this requires resetting
270 CRMOD, and many output routines will have to be modified
271 slightly. Let's leave that till the next release. */
273 /* not: XD = Tgetstr("do"); */
274 if(!(nh_CM = Tgetstr("cm"))) {
276 error("NetHack needs CM or UP or HO.");
277 tty_raw_print("Playing NetHack on terminals without CM is suspect.");
282 nh_US = Tgetstr("us");
283 nh_UE = Tgetstr("ue");
284 SG = tgetnum("sg"); /* -1: not fnd; else # of spaces left by so */
285 if(!SO || !SE || (SG > 0)) SO = SE = nh_US = nh_UE = nullstr;
290 VS = Tgetstr("eA"); /* enable graphics */
292 KS = Tgetstr("ks"); /* keypad start (special mode) */
293 KE = Tgetstr("ke"); /* keypad end (ordinary mode [ie, digits]) */
294 MR = Tgetstr("mr"); /* reverse */
296 MB = Tgetstr("mb"); /* blink */
297 MD = Tgetstr("md"); /* boldface */
298 MH = Tgetstr("mh"); /* dim */
300 ME = Tgetstr("me"); /* turn off all attributes */
301 if (!ME || (SE == nullstr)) ME = SE; /* default to SE value */
303 /* Get rid of padding numbers for nh_HI and nh_HE. Hope they
304 * aren't really needed!!! nh_HI and nh_HE are outputted to the
305 * pager as a string - so how can you send it NULs???
308 nh_HI = (char *) alloc((unsigned)(strlen(SO)+1));
309 nh_HE = (char *) alloc((unsigned)(strlen(ME)+1));
311 while (digit(SO[i])) i++;
312 Strcpy(nh_HI, &SO[i]);
314 while (digit(ME[i])) i++;
315 Strcpy(nh_HE, &ME[i]);
318 nh_CD = Tgetstr("cd");
323 # if defined(TOS) && defined(__GNUC__)
324 if (!strcmp(term, "builtin") || !strcmp(term, "tw52") ||
325 !strcmp(term, "st52")) {
334 if (!(CL = Tgetstr("cl"))) /* last thing set */
335 error("NetHack needs CL.");
336 if ((int)(tbufptr - tbuf) > (int)(sizeof tbuf))
337 error("TERMCAP entry too big...\n");
338 free((genericptr_t)tptr);
342 /* note: at present, this routine is not part of the formal window interface */
343 /* deallocate resources prior to final termination */
347 #if defined(TEXTCOLOR) && defined(TERMLIB)
350 /* we don't attempt to clean up individual termcap variables [yet?] */
355 tty_number_pad(state)
359 case -1: /* activate keypad mode (escape sequences) */
360 if (KS && *KS) xputs(KS);
362 case 1: /* activate numeric mode for keypad (digits) */
363 if (KE && *KE) xputs(KE);
365 case 0: /* don't need to do anything--leave terminal as-is */
372 extern void NDECL((*decgraphics_mode_callback)); /* defined in drawing.c */
373 static void NDECL(tty_decgraphics_termcap_fixup);
376 We call this routine whenever DECgraphics mode is enabled, even if it
377 has been previously set, in case the user manages to reset the fonts.
378 The actual termcap fixup only needs to be done once, but we can't
379 call xputs() from the option setting or graphics assigning routines,
380 so this is a convenient hook.
383 tty_decgraphics_termcap_fixup()
385 static char ctrlN[] = "\016";
386 static char ctrlO[] = "\017";
387 static char appMode[] = "\033=";
388 static char numMode[] = "\033>";
390 /* these values are missing from some termcaps */
391 if (!AS) AS = ctrlN; /* ^N (shift-out [graphics font]) */
392 if (!AE) AE = ctrlO; /* ^O (shift-in [regular font]) */
393 if (!KS) KS = appMode; /* ESC= (application keypad mode) */
394 if (!KE) KE = numMode; /* ESC> (numeric keypad mode) */
396 * Select the line-drawing character set as the alternate font.
397 * Do not select NA ASCII as the primary font since people may
398 * reasonably be using the UK character set.
400 if (iflags.DECgraphics) xputs("\033)0");
405 #if defined(ASCIIGRAPH) && !defined(NO_TERMS)
406 /* some termcaps suffer from the bizarre notion that resetting
407 video attributes should also reset the chosen character set */
409 const char *nh_he = nh_HE, *ae = AE;
410 int he_limit, ae_length;
412 if (digit(*ae)) { /* skip over delay prefix, if any */
413 do ++ae; while (digit(*ae));
414 if (*ae == '.') { ++ae; if (digit(*ae)) ++ae; }
415 if (*ae == '*') ++ae;
417 /* can't use nethack's case-insensitive strstri() here, and some old
418 systems don't have strstr(), so use brute force substring search */
419 ae_length = strlen(ae), he_limit = strlen(nh_he);
420 while (he_limit >= ae_length) {
421 if (strncmp(nh_he, ae, ae_length) == 0) {
432 #if defined(ASCIIGRAPH) && defined(PC9800)
433 extern void NDECL((*ibmgraphics_mode_callback)); /* defined in drawing.c */
437 extern void NDECL((*ascgraphics_mode_callback)); /* defined in drawing.c */
438 static void NDECL(tty_ascgraphics_hilite_fixup);
441 tty_ascgraphics_hilite_fixup()
445 for (c = 0; c < CLR_MAX / 2; c++)
446 if (c != CLR_BLACK) {
447 hilites[c|BRIGHT] = (char *) alloc(sizeof("\033[1;3%dm"));
448 Sprintf(hilites[c|BRIGHT], "\033[1;3%dm", c);
450 hilites[c] = (char *) alloc(sizeof("\033[0;3%dm"));
451 Sprintf(hilites[c], "\033[0;3%dm", c);
463 if (!iflags.IBMgraphics && !iflags.DECgraphics)
464 tty_ascgraphics_hilite_fixup();
465 /* set up callback in case option is not set yet but toggled later */
466 ascgraphics_mode_callback = tty_ascgraphics_hilite_fixup;
468 if (iflags.IBMgraphics) init_hilite();
469 /* set up callback in case option is not set yet but toggled later */
470 ibmgraphics_mode_callback = init_hilite;
475 if (iflags.DECgraphics) tty_decgraphics_termcap_fixup();
476 /* set up callback in case option is not set yet but toggled later */
477 decgraphics_mode_callback = tty_decgraphics_termcap_fixup;
479 if (iflags.num_pad) tty_number_pad(1); /* make keypad send digits */
490 /* Cursor movements */
495 /* Note to OVLx tinkerers. The placement of this overlay controls the location
496 of the function xputc(). This function is not currently in trampoli.[ch]
497 files for what is deemed to be performance reasons. If this define is moved
498 and or xputc() is taken out of the ROOT overlay, then action must be taken
505 if ((int) ttyDisplay->cury > y) {
507 while ((int) ttyDisplay->cury > y) { /* Go up. */
515 tty_curs(BASE_WINDOW, x+1, y);
516 } /* else impossible("..."); */
517 } else if ((int) ttyDisplay->cury < y) {
519 while((int) ttyDisplay->cury < y) {
526 while((int) ttyDisplay->cury < y) {
528 ttyDisplay->curx = 0;
533 if ((int) ttyDisplay->curx < x) { /* Go to the right. */
534 if(!nh_ND) cmov(x, y); else /* bah */
535 /* should instead print what is there already */
536 while ((int) ttyDisplay->curx < x) {
540 } else if ((int) ttyDisplay->curx > x) {
541 while ((int) ttyDisplay->curx > x) { /* Go to the left. */
552 xputs(tgoto(nh_CM, x, y));
553 ttyDisplay->cury = y;
554 ttyDisplay->curx = x;
557 /* See note at OVLx ifdef above. xputc() is a special function. */
574 (void) fputs(s, stdout);
576 # if defined(NHSTDC) || defined(ULTRIX_PROTO)
577 tputs(s, 1, (int (*)())xputc);
589 else { /* no-CE fix - free after Harold Rynes */
590 /* this looks terrible, especially on a slow terminal
591 but is better than nothing */
592 register int cx = ttyDisplay->curx+1;
598 tty_curs(BASE_WINDOW, (int)ttyDisplay->curx+1,
599 (int)ttyDisplay->cury);
609 /* note: if CL is null, then termcap initialization failed,
610 so don't attempt screen-oriented I/O during final cleanup.
627 xputs(tgoto(nh_CM, 0, 0));
629 tty_curs(BASE_WINDOW, 1, 0); /* using UP ... */
630 ttyDisplay->curx = ttyDisplay->cury = 0;
645 #if 0 /* if you need one of these, uncomment it (here and in extern.h) */
666 /* not in most termcap entries */
690 if (flags.silent) return;
691 (void) putchar('\007'); /* curx does not change */
692 (void) fflush(stdout);
715 static const short tmspc10[] = { /* from termcap */
716 0, 2000, 1333, 909, 743, 666, 333, 166, 83, 55, 50, 41, 27, 20, 13, 10,
720 static const short tmspc10[] = { /* from termcap */
721 0, 2000, 1333, 909, 743, 666, 500, 333, 166, 83, 55, 41, 20, 10, 5
735 (void) fflush(stdout);
736 msleep(50); /* sleep for 50 milliseconds */
741 /* simulate the delay with "cursor here" */
742 for (i = 0; i < 3; i++) {
743 cmov(ttyDisplay->curx, ttyDisplay->cury);
744 (void) fflush(stdout);
747 /* BUG: if the padding character is visible, as it is on the 5620
748 then this looks terrible. */
751 /* cbosgd!cbcephus!pds for SYS V R2 */
753 tputs("$<50>", 1, (int (*)())xputc);
755 tputs("$<50>", 1, xputc);
758 # if defined(NHSTDC) || defined(ULTRIX_PROTO)
759 tputs("50", 1, (int (*)())xputc);
761 tputs("50", 1, xputc);
765 else if(ospeed > 0 && ospeed < SIZE(tmspc10) && nh_CM) {
766 /* delay by sending cm(here) an appropriate number of times */
767 register int cmlen = strlen(tgoto(nh_CM, ttyDisplay->curx,
769 register int i = 500 + tmspc10[ospeed]/2;
772 cmov((int)ttyDisplay->curx, (int)ttyDisplay->cury);
773 i -= cmlen*tmspc10[ospeed];
783 cl_eos() /* free after Robert Viduya */
784 { /* must only be called with curx = 1 */
789 register int cy = ttyDisplay->cury+1;
796 tty_curs(BASE_WINDOW, (int)ttyDisplay->curx+1,
797 (int)ttyDisplay->cury);
801 #if defined(TEXTCOLOR) && defined(TERMLIB)
802 # if defined(UNIX) && defined(TERMINFO)
804 * Sets up color highlighting, using terminfo(4) escape sequences.
806 * Having never seen a terminfo system without curses, we assume this
807 * inclusion is safe. On systems with color terminfo, it should define
808 * the 8 COLOR_FOOs, and avoid us having to guess whether this particular
809 * terminfo uses BGR or RGB for its indexes.
811 * If we don't get the definitions, then guess. Original color terminfos
812 * used BGR for the original Sf (setf, Standard foreground) codes, but
813 * there was a near-total lack of user documentation, so some subsequent
814 * terminfos, such as early Linux ncurses and SCO UNIX, used RGB. Possibly
815 * as a result of the confusion, AF (setaf, ANSI Foreground) codes were
816 * introduced, but this caused yet more confusion. Later Linux ncurses
817 * have BGR Sf, RGB AF, and RGB COLOR_FOO, which appears to be the SVR4
818 * standard. We could switch the colors around when using Sf with ncurses,
819 * which would help things on later ncurses and hurt things on early ncurses.
820 * We'll try just preferring AF and hoping it always agrees with COLOR_FOO,
821 * and falling back to Sf if AF isn't defined.
823 * In any case, treat black specially so we don't try to display black
824 * characters on the assumed black background.
827 /* `curses' is aptly named; various versions don't like these
828 macros used elsewhere within nethack; fortunately they're
829 not needed beyond this point, so we don't need to worry
830 about reconstructing them after the header file inclusion. */
834 #define m_move curses_m_move /* Some curses.h decl m_move(), not used here */
839 extern char *tparm();
842 # ifdef COLOR_BLACK /* trust include file */
845 # ifndef _M_UNIX /* guess BGR */
847 #define COLOR_GREEN 2
850 #define COLOR_MAGENTA 5
851 #define COLOR_YELLOW 6
852 #define COLOR_WHITE 7
853 # else /* guess RGB */
855 #define COLOR_GREEN 2
856 #define COLOR_YELLOW 3
858 #define COLOR_MAGENTA 5
860 #define COLOR_WHITE 7
863 #define COLOR_BLACK COLOR_BLUE
865 const int ti_map[8] = {
866 COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW,
867 COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE };
873 char *setf, *scratch;
875 for (c = 0; c < SIZE(hilites); c++)
877 hilites[CLR_GRAY] = hilites[NO_COLOR] = (char *)0;
879 if (tgetnum("Co") < 8
880 || ((setf = tgetstr("AF", (char **)0)) == (char *)0
881 && (setf = tgetstr("Sf", (char **)0)) == (char *)0))
884 for (c = 0; c < CLR_MAX / 2; c++) {
885 scratch = tparm(setf, ti_map[c]);
887 hilites[c] = (char *) alloc(strlen(scratch) + 1);
888 Strcpy(hilites[c], scratch);
890 if (c != CLR_BLACK) {
891 hilites[c|BRIGHT] = (char*) alloc(strlen(scratch)+strlen(MD)+1);
892 Strcpy(hilites[c|BRIGHT], MD);
893 Strcat(hilites[c|BRIGHT], scratch);
899 # else /* UNIX && TERMINFO */
902 /* find the foreground and background colors set by nh_HI or nh_HE */
904 analyze_seq (str, fg, bg)
908 register int c, code;
912 *fg = CLR_GRAY; *bg = CLR_BLACK;
914 *fg = *bg = NO_COLOR;
917 c = (str[0] == '\233') ? 1 : 2; /* index of char beyond esc prefix */
918 len = strlen(str) - 1; /* length excluding attrib suffix */
919 if ((c != 1 && (str[0] != '\033' || str[1] != '[')) ||
920 (len - c) < 1 || str[len] != 'm')
924 if ((code = atoi(&str[c])) == 0) { /* reset */
925 /* this also catches errors */
927 *fg = CLR_GRAY; *bg = CLR_BLACK;
929 *fg = *bg = NO_COLOR;
931 } else if (code == 1) { /* bold */
934 /* I doubt we'll ever resort to using blinking characters,
935 unless we want a pulsing glow for something. But, in case
937 } else if (code == 5) { /* blinking */
939 } else if (code == 25) { /* stop blinking */
942 } else if (code == 7 || code == 27) { /* reverse */
943 code = *fg & ~BRIGHT;
944 *fg = *bg | (*fg & BRIGHT);
946 } else if (code >= 30 && code <= 37) { /* hi_foreground RGB */
948 } else if (code >= 40 && code <= 47) { /* hi_background RGB */
951 while (digit(str[++c]));
958 * Sets up highlighting sequences, using ANSI escape sequences (highlight code
959 * found in print.c). The nh_HI and nh_HE sequences (usually from SO) are
960 * scanned to find foreground and background colors.
968 extern unsigned long tos_numcolors; /* in tos.c */
969 static char NOCOL[] = "\033b0", COLHE[] = "\033q\033b0";
971 if (tos_numcolors <= 2) {
974 /* Under TOS, the "bright" and "dim" colors are reversed. Moreover,
975 * on the Falcon the dim colors are *really* dim; so we make most
976 * of the colors the bright versions, with a few exceptions where
977 * the dim ones look OK.
980 for (c = 1; c < SIZE(hilites); c++) {
982 foo = (char *) alloc(sizeof("\033b0"));
983 if (tos_numcolors > 4)
984 Sprintf(foo, "\033b%c", (c&~BRIGHT)+'0');
986 Strcpy(foo, "\033b0");
990 if (tos_numcolors == 4) {
991 TI = "\033b0\033c3\033E\033e";
992 TE = "\033b3\033c0\033J";
994 hilites[CLR_GREEN] = hilites[CLR_GREEN|BRIGHT] = "\033b2";
995 hilites[CLR_RED] = hilites[CLR_RED|BRIGHT] = "\033b1";
997 sprintf(hilites[CLR_BROWN], "\033b%c", (CLR_BROWN^BRIGHT)+'0');
998 sprintf(hilites[CLR_GREEN], "\033b%c", (CLR_GREEN^BRIGHT)+'0');
1000 TI = "\033b0\033c\017\033E\033e";
1001 TE = "\033b\017\033c0\033J";
1003 hilites[CLR_WHITE] = hilites[CLR_BLACK] = NOCOL;
1004 hilites[NO_COLOR] = hilites[CLR_GRAY];
1009 int backg, foreg, hi_backg, hi_foreg;
1011 for (c = 0; c < SIZE(hilites); c++)
1013 hilites[CLR_GRAY] = hilites[NO_COLOR] = (char *)0;
1015 analyze_seq(nh_HI, &hi_foreg, &hi_backg);
1016 analyze_seq(nh_HE, &foreg, &backg);
1018 for (c = 0; c < SIZE(hilites); c++)
1019 /* avoid invisibility */
1020 if ((backg & ~BRIGHT) != c) {
1022 if (c == CLR_BLUE) continue;
1025 hilites[c] = (char *)0;
1026 else if (c != hi_foreg || backg != hi_backg) {
1027 hilites[c] = (char *) alloc(sizeof("\033[%d;3%d;4%dm"));
1028 Sprintf(hilites[c], "\033[%d", !!(c & BRIGHT));
1029 if ((c | BRIGHT) != (foreg | BRIGHT))
1030 Sprintf(eos(hilites[c]), ";3%d", c & ~BRIGHT);
1031 if (backg != CLR_BLACK)
1032 Sprintf(eos(hilites[c]), ";4%d", backg & ~BRIGHT);
1033 Strcat(hilites[c], "m");
1038 /* brighten low-visibility colors */
1039 hilites[CLR_BLUE] = hilites[CLR_BLUE|BRIGHT];
1051 for (c = 0; c < CLR_MAX / 2; c++) {
1052 if (hilites[c|BRIGHT] == hilites[c]) hilites[c|BRIGHT] = 0;
1053 if (hilites[c] && (hilites[c] != nh_HI))
1054 free((genericptr_t) hilites[c]), hilites[c] = 0;
1055 if (hilites[c|BRIGHT] && (hilites[c|BRIGHT] != nh_HI))
1056 free((genericptr_t) hilites[c|BRIGHT]), hilites[c|BRIGHT] = 0;
1061 #endif /* TEXTCOLOR */
1064 static char nulstr[] = "";
1072 if(nh_US) return nh_US;
1075 #if defined(TERMLIB) && defined(TEXTCOLOR)
1091 if(nh_UE) return nh_UE;
1103 term_start_attr(attr)
1107 xputs(s_atr2str(attr));
1117 xputs(e_atr2str(attr));
1123 term_start_raw_bold()
1146 term_start_color(color)
1149 xputs(hilites[color]);
1158 /* XXX has_color() should be added to windowprocs */
1159 if (windowprocs.name != NULL &&
1160 !strcmpi(windowprocs.name, "X11")) return TRUE;
1163 /* XXX has_color() should be added to windowprocs */
1164 if (windowprocs.name != NULL &&
1165 !strcmpi(windowprocs.name, "Gem")) return TRUE;
1168 /* XXX has_color() should be added to windowprocs */
1169 if (windowprocs.name != NULL &&
1170 !strcmpi(windowprocs.name, "Qt")) return TRUE;
1172 #ifdef AMII_GRAPHICS
1173 /* hilites[] not used */
1174 return iflags.use_color;
1176 return hilites[color] != (char *)0;
1179 #endif /* TEXTCOLOR */
1183 #endif /* TTY_GRAPHICS */