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

Function X11_status_update_tty

win/X11/winstat.c:654–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652}
653
654DISABLE_WARNING_FORMAT_NONLITERAL
655
656/* core requests updating one status field (or is indicating that it's time
657 to flush all updated fields); tty-style handling */
658static void
659X11_status_update_tty(
660 int fld,
661 genericptr_t ptr,
662 int chg UNUSED,
663 int percent,
664 int color,
665 unsigned long *colormasks) /* bitmask of highlights for conditions */
666{
667 static int xtra_space[MAXBLSTATS];
668 static unsigned long *cond_colormasks = (unsigned long *) 0;
669
670 Arg args[6];
671 Cardinal num_args;
672 Position lbl_x;
673 Dimension lbl_wid, brd_wid;
674 Widget label;
675
676 struct status_info_t *si;
677 char goldbuf[40];
678 const char *fmt;
679 const char *text;
680 unsigned long *condptr;
681 int f, x, y, dx;
682
683 if (X11_status_fg == X11_status_bg || !X11_status_font)
684 tt_status_fixup();
685
686 if (fld == BL_RESET) {
687#ifdef STATUS_HILITES
688 for (y = 0; y < X11_NUM_STATUS_LINES; y++) {
689 for (x = 0; x < X11_NUM_STATUS_FIELD; x++) {
690 f = X11_fieldorder[y][x];
691 if (f <= BL_FLUSH)
692 continue; /* skip padding in the fieldorder[][] layout */
693 if (f != BL_CONDITION) {
694 tt_reset_color(f, 0, (unsigned long *) 0);
695 } else {
696 int c_i;
697
698 for (c_i = 0; c_i < SIZE(tt_condorder); ++c_i)
699 tt_reset_color(f, c_i, cond_colormasks);
700 }
701 }
702 }
703#endif
704 fld = BL_FLUSH;
705 }
706
707 if (fld == BL_CONDITION) {
708 condptr = (unsigned long *) ptr;
709 X11_condition_bits = *condptr;
710 cond_colormasks = colormasks; /* expected to be non-Null */
711

Callers 1

X11_status_updateFunction · 0.85

Calls 6

tt_status_fixupFunction · 0.85
tt_reset_colorFunction · 0.85
DisplayCondFunction · 0.85
decode_mixedFunction · 0.85
PrepStatusFieldFunction · 0.85
render_conditionsFunction · 0.85

Tested by

no test coverage detected