MCPcopy Create free account
hub / github.com/NetHack/NetHack / curses_convert_attr

Function curses_convert_attr

win/curses/cursmisc.c:739–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737 understands, and return that format mask. */
738
739attr_t
740curses_convert_attr(int attr)
741{
742 attr_t curses_attr;
743
744 /* first, strip off control flags masked onto the display attributes
745 (caller should have already done this...) */
746 attr &= ~(ATR_URGENT | ATR_NOHISTORY);
747
748 switch (attr) {
749 case ATR_NONE:
750 curses_attr = A_NORMAL;
751 break;
752 case ATR_ULINE:
753 curses_attr = A_UNDERLINE;
754 break;
755 case ATR_BOLD:
756 curses_attr = A_BOLD;
757 break;
758 case ATR_DIM:
759 curses_attr = A_DIM;
760 break;
761 case ATR_BLINK:
762 curses_attr = A_BLINK;
763 break;
764 case ATR_INVERSE:
765 curses_attr = A_REVERSE;
766 break;
767 case ATR_ITALIC:
768 curses_attr = A_ITALIC;
769 break;
770 default:
771 curses_attr = A_NORMAL;
772 }
773
774 return curses_attr;
775}
776
777/* Convert special keys into values that NetHack can understand.
778Currently this is limited to arrow keys, but this may be expanded. */

Callers 4

curses_putstrFunction · 0.85
curses_add_menuFunction · 0.85
curses_ctrl_nhwindowFunction · 0.85
curses_print_glyphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected