#include "map_objects.h" /* for structs MapObj, Player */
#include "map.h" /* for Map struct */
#include "main.h" /* for World struct */
+#include "rexit.h" /* for err_exit() */
{
if (0 == y && offset > 0)
{
- draw_scroll_hint(&win->frame, y, offset + 1, '^');
+ exit_err(draw_scroll_hint(&win->frame, y, offset + 1, '^'),
+ world, NULL);
continue;
}
else if (win->frame.size.y == y + 1
&& 0 < world->keyswindata->max
- (win->frame.size.y + offset - 1))
{
- draw_scroll_hint(&win->frame, y,
- world->keyswindata->max
- - (offset + win->frame.size.y) + 2, 'v');
+ exit_err(draw_scroll_hint(&win->frame, y,
+ world->keyswindata->max
+ - (offset + win->frame.size.y) + 2, 'v'),
+ world, NULL);
continue;
}
attri = 0;
-extern void toggle_window(struct WinMeta * win_meta, struct Win * win)
+extern uint8_t toggle_window(struct WinMeta * win_meta, struct Win * win)
{
if (0 != win->frame.curses_win)
{
- suspend_win(win_meta, win);
+ return suspend_win(win_meta, win);
}
else
{
- append_win(win_meta, win);
+ return append_win(win_meta, win);
}
}
-extern void growshrink_active_window(struct WinMeta * win_meta, char change)
+extern uint8_t growshrink_active_window(struct WinMeta * win_meta, char change)
{
if (0 != win_meta->active)
{
{
size.x++;
}
- resize_active_win (win_meta, size);
+ return resize_active_win (win_meta, size);
}
+ return 0;
}
}
else if (key == get_action_key(world->keybindings, "toggle keys window"))
{
- toggle_window(win_meta, win_keys);
+ exit_err(toggle_window(win_meta, win_keys), world, NULL);
}
else if (key == get_action_key(world->keybindings, "toggle map window"))
{
- toggle_window(win_meta, win_map);
+ exit_err(toggle_window(win_meta, win_map), world, NULL);
}
else if (key == get_action_key(world->keybindings, "toggle info window"))
{
- toggle_window(win_meta, win_info);
+ exit_err(toggle_window(win_meta, win_info), world, NULL);
}
else if (key == get_action_key(world->keybindings, "toggle log window"))
{
- toggle_window(win_meta, win_log);
+ exit_err(toggle_window(win_meta, win_log), world, NULL);
}
else if (key == get_action_key(world->keybindings, "cycle forwards"))
{
}
else if (key == get_action_key(world->keybindings, "shift forwards"))
{
- shift_active_win(win_meta, 'f');
+ exit_err(shift_active_win(win_meta, 'f'), world, NULL);
}
else if (key == get_action_key(world->keybindings, "shift backwards"))
{
- shift_active_win(win_meta, 'b');
+ exit_err(shift_active_win(win_meta, 'b'), world, NULL);
}
else if (key == get_action_key(world->keybindings, "grow horizontally"))
{
- growshrink_active_window(win_meta, '*');
+ exit_err(growshrink_active_window(win_meta, '*'), world, NULL);
}
else if (key == get_action_key(world->keybindings, "shrink horizontally"))
{
- growshrink_active_window(win_meta, '_');
+ exit_err(growshrink_active_window(win_meta, '_'), world, NULL);
}
else if (key == get_action_key(world->keybindings, "grow vertically"))
{
- growshrink_active_window(win_meta, '+');
+ exit_err(growshrink_active_window(win_meta, '+'), world, NULL);
}
else if (key == get_action_key(world->keybindings, "shrink vertically"))
{
- growshrink_active_window(win_meta, '-');
+ exit_err(growshrink_active_window(win_meta, '-'), world, NULL);
}
else if (key == get_action_key(world->keybindings, "save keys"))
{
-/* Toggle display of a window "win". */
-extern void toggle_window(struct WinMeta * win_meta, struct Win * win);
+/* Toggle display of a window "win".
+ *
+ * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
+ */
+extern uint8_t toggle_window(struct WinMeta * win_meta, struct Win * win);
/* Try to grow or shrink the active window horizontally ("change" = "*"/"_") or
* vertically ("change = "+"/"-") by one cell size, subject to the limitations
* provided by the window manager via resize_active_win().
+ *
+ * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
*/
-extern void growshrink_active_window(struct WinMeta * win_meta, char change);
+extern uint8_t growshrink_active_window(struct WinMeta * win_meta, char change);