X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fwindows.c;h=13dbed0e9d5f6cd8aa28e3b637456fc3b3aaf548;hb=f21d01eb14c3b3ac09463de3e573dd99e002fe3d;hp=bcfa3364d3d477139b40204ec5e2ccdd13571e25;hpb=ad35bfb15825033c8482e859aa2b7c4cee8544e9;p=plomrogue diff --git a/src/windows.c b/src/windows.c index bcfa336..13dbed0 100644 --- a/src/windows.c +++ b/src/windows.c @@ -533,13 +533,13 @@ extern void cycle_active_win(struct WinMeta * wmeta, char dir) -extern void shift_active_win(struct WinMeta * wmeta, char dir) +extern uint8_t shift_active_win(struct WinMeta * wmeta, char dir) { if ( 0 == wmeta->active /* No shifting with less */ || wmeta->chain_start == wmeta->chain_end /* than two windows visible */ || (dir != 'f' && dir != 'b')) /* or wrong direction char. */ { - return; + return 0; } if ('f' == dir) { @@ -549,12 +549,12 @@ extern void shift_active_win(struct WinMeta * wmeta, char dir) { shift_win_backward(wmeta); } - update_wins(wmeta, wmeta->chain_start); + return update_wins(wmeta, wmeta->chain_start); } -extern void draw_all_wins(struct WinMeta * wmeta) +extern uint8_t draw_all_wins(struct WinMeta * wmeta) { /* Empty everything before filling it a-new. */ erase(); @@ -572,17 +572,23 @@ extern void draw_all_wins(struct WinMeta * wmeta) /* Draw virtual screen scroll hints. */ if (wmeta->pad_offset > 0) { - draw_scroll_hint(&wmeta->padframe, - wmeta->pad_offset, wmeta->pad_offset + 1, '<'); + if (draw_scroll_hint(&wmeta->padframe, + wmeta->pad_offset, wmeta->pad_offset + 1, '<')) + { + return 1; + } } if (wmeta->pad_offset + wmeta->padframe.size.x < getmaxx(wmeta->padframe.curses_win) - 1) { - draw_scroll_hint(&wmeta->padframe, - wmeta->pad_offset + wmeta->padframe.size.x - 1, - getmaxx(wmeta->padframe.curses_win) - - (wmeta->pad_offset + wmeta->padframe.size.x), - '>'); + if (draw_scroll_hint(&wmeta->padframe, + wmeta->pad_offset + wmeta->padframe.size.x - 1, + getmaxx(wmeta->padframe.curses_win) + - (wmeta->pad_offset + wmeta->padframe.size.x), + '>')) + { + return 1; + } } /* Write virtual screen segment to be shown on physical screen into */ @@ -593,6 +599,7 @@ extern void draw_all_wins(struct WinMeta * wmeta) /* Only at the end write accumulated changes to the physical screen. */ doupdate(); + return 0; }