-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();
/* 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 */
/* Only at the end write accumulated changes to the physical screen. */
doupdate();
+ return 0;
}
-/* Draw virtual screen including all windows. Also add scroll hints (a line
- * stating that there is more to see on scrolling further into a certain
- * direction) for where the edges of the terminal screen hit non-edges of and
- * inside the virtual screen. Then update the terminal screen.
+/* Draw virtual screen including all windows. Also add scroll hints (see comment
+ * on draw_scroll_hint()) for where the edges of the terminal screen hit
+ * non-edges of and inside the virtual screen. Then update the terminal screen.
+ *
+ * Returns 0 on success, 1 on error (of scroll hint text memory allocation).
*/
-extern void draw_all_wins(struct WinMeta * wmeta);
+extern uint8_t draw_all_wins(struct WinMeta * wmeta);