3 * Routines that build on top of the windows library to provide a simple window
4 * management API to the game.
12 #include <stdint.h> /* for uint8_t */
19 /* Free allocated memory for an initialized Win struct. */
20 extern void free_win(struct Win * win);
25 /* Wrapper around init_win() that reads the desired window size and title from a
26 * file at the path prefixing the provided win name "w_name" with
27 * "config/windows/". "f"() is the window drawing function (Win._draw()).
29 extern struct Win * init_win_from_file(struct World * world, char * w_name,
30 void (* f) (struct Win *));
35 /* Toggle windows in world->wins in the order desribed by the first line of
36 * config/windows/toggled_win_order, wherein each character may correspond to
37 * one hardcoded window.
39 extern void sorted_wintoggle(struct World * world);
43 /* Toggle display of a window "win".
45 * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
47 extern uint8_t toggle_window(struct WinMeta * win_meta, struct Win * win);
51 /* Try to scroll virtual screen left ("dir" = "-") or right ("dir" = "+"),
52 * subject to the limitations provided by the window manager via
55 extern void scroll_pad(struct WinMeta * win_meta, char dir);
59 /* Try to grow or shrink the active window horizontally ("change" = "*"/"_") or
60 * vertically ("change = "+"/"-") by one cell size, subject to the limitations
61 * provided by the window manager via resize_active_win().
63 * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
65 extern uint8_t growshrink_active_window(struct WinMeta * win_meta, char change);