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

Function directional_scroll

win/curses/cursmesg.c:887–918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885}
886
887static void
888directional_scroll(winid wid, int nlines)
889{
890 int wh, ww, s_top, s_bottom;
891 boolean border = curses_window_has_border(wid);
892 WINDOW *win = curses_get_nhwin(wid);
893
894 curses_set_wid_colors(wid, NULL);
895 curses_get_window_size(wid, &wh, &ww);
896 if (wh == 1) {
897 curses_clear_nhwin(wid);
898 return;
899 }
900 if (border) {
901 s_top = 1;
902 s_bottom = wh;
903 } else {
904 s_top = 0;
905 s_bottom = wh - 1;
906 }
907 scrollok(win, TRUE);
908 wsetscrreg(win, s_top, s_bottom);
909 wscrl(win, nlines);
910 scrollok(win, FALSE);
911 if (wid == MESSAGE_WIN) {
912 mx = border ? 1 : 0;
913 }
914 if (border) {
915 box(win, 0, 0);
916 }
917 wrefresh(win);
918}
919
920
921/* Add given line to message history */

Callers 2

scroll_windowFunction · 0.85
unscroll_windowFunction · 0.85

Calls 5

curses_window_has_borderFunction · 0.85
curses_get_nhwinFunction · 0.85
curses_set_wid_colorsFunction · 0.85
curses_get_window_sizeFunction · 0.85
curses_clear_nhwinFunction · 0.85

Tested by

no test coverage detected