+/* wincontrol.c */
+
+#include "wincontrol.h"
+#include <stdint.h> /* for uint8_t */
+#include "windows.h" /* for suspend_win(), append_win(), reset_pad_offset(),
+ * resize_active_win(), struct Win, struct WinMeta
+ */
+#include "yx_uint16.h" /* for yx_uint16 struct */
+
+
+extern uint8_t toggle_window(struct WinMeta * win_meta, struct Win * win)
+{
+ if (0 != win->frame.curses_win)
+ {
+ return suspend_win(win_meta, win);
+ }
+ else
+ {
+ return append_win(win_meta, win);
+ }
+}
+
+
+
+extern void scroll_pad(struct WinMeta * win_meta, char dir)
+{
+ if ('+' == dir)
+ {
+ reset_pad_offset(win_meta, win_meta->pad_offset + 1);
+ }
+ else if ('-' == dir)
+ {
+ reset_pad_offset(win_meta, win_meta->pad_offset - 1);
+ }
+}
+
+
+
+extern uint8_t growshrink_active_window(struct WinMeta * win_meta, char change)
+{
+ if (0 != win_meta->active)
+ {
+ struct yx_uint16 size = win_meta->active->frame.size;
+ if (change == '-')
+ {
+ size.y--;
+ }
+ else if (change == '+')
+ {
+ size.y++;
+ }
+ else if (change == '_')
+ {
+ size.x--;
+ }
+ else if (change == '*')
+ {
+ size.x++;
+ }
+ return resize_active_win (win_meta, size);
+ }
+ return 0;
+}
+