void growshrink_active_window (struct WinMeta * win_meta, char change) {
// Grow or shrink active window horizontally or vertically by one cell size.
if (0 != win_meta->active) {
- uint16_t height = win_meta->active->frame.size.y;
- uint16_t width = win_meta->active->frame.size.x;
- if (change == '-')
- height--;
- else if (change == '+')
- height++;
- else if (change == '_')
- width--;
- else if (change == '*')
- width++;
- resize_active_win (win_meta, height, width); } }
+ 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++;
+ resize_active_win (win_meta, size); } }
unsigned char meta_keys(int key, struct World * world, struct WinMeta * win_meta, struct Win * win_keys,
struct Win * win_map, struct Win * win_info, struct Win * win_log) {
pnoutrefresh(wmeta->pad.curses_win, 0, wmeta->pad_offset, 0, 0, wmeta->pad.size.y, wmeta->pad.size.x-1); }
doupdate(); }
-extern void resize_active_win (struct WinMeta * wmeta, uint16_t height, uint16_t width) {
+extern void resize_active_win (struct WinMeta * wmeta, struct yx_uint16 size) {
// Grow or shrink currently active window. Correct its geometry and that of its followers.
- if (0 != wmeta->active && width > 0 && height > 0 && height < wmeta->pad.size.y) {
- wmeta->active->frame.size.y = height;
- wmeta->active->frame.size.x = width;
+ if (0 != wmeta->active && size.x > 0 && size.y > 0 && size.y < wmeta->pad.size.y) {
+ wmeta->active->frame.size = size;
update_wins(wmeta, wmeta->chain_start); } }
extern void cycle_active_win (struct WinMeta * wmeta, char dir) {
extern void suspend_win (struct WinMeta *, struct Win *);
extern void draw_scroll_hint (struct Frame *, uint16_t, uint32_t, char);
extern void draw_all_wins (struct WinMeta *);
-extern void resize_active_win (struct WinMeta *, uint16_t, uint16_t);
+extern void resize_active_win (struct WinMeta *, struct yx_uint16);
extern void cycle_active_win (struct WinMeta *, char);
extern void shift_active_win (struct WinMeta *, char);
extern void reset_pad_offset (struct WinMeta *, uint16_t);