home · contact · privacy
shift_active_win() returns error code of its update_wins() call.
[plomrogue] / src / windows.c
index bcfa3364d3d477139b40204ec5e2ccdd13571e25..13dbed0e9d5f6cd8aa28e3b637456fc3b3aaf548 100644 (file)
@@ -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;
 }