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 /* Puts an identifier on each window, interfaces to its config file data. */
27 void (* draw) (struct Win *);
32 /* Create/initialize (from config files)/free Winconf / Win structs. */
33 extern void create_winconfs(struct World * world);
34 extern void init_winconfs(struct World * world);
35 extern void free_winconfs(struct World * world);
36 extern void init_wins(struct World * world);
37 extern void free_wins(struct World * world);
41 /* Reload windows in order and sizes defined in win config. */
42 extern void reload_win_config(struct World * world);
46 /* Get WinConf identified by winconf->id == "id", or that winconf's ->win. */
47 extern struct WinConf * get_winconf_by_id(struct World * world, char id);
48 extern struct Win * get_win_by_id(struct World * world, char id);
52 /* Toggle windows in world->wins in the order desribed by the first line of
53 * config/windows/toggled_win_order, wherein each character may correspond to
54 * one hardcoded window.
56 extern void sorted_wintoggle(struct World * world);
60 /* Toggle display of a window "win".
62 * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
64 extern uint8_t toggle_window(struct WinMeta * win_meta, struct Win * win);
68 /* Try to scroll virtual screen left ("dir" = "-") or right ("dir" = "+"),
69 * subject to the limitations provided by the window manager via
72 extern void scroll_pad(struct WinMeta * win_meta, char dir);
76 /* Try to grow or shrink the active window horizontally ("change" = "*"/"_") or
77 * vertically ("change = "+"/"-") by one cell size, subject to the limitations
78 * provided by the window manager via resize_active_win().
80 * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
82 extern uint8_t growshrink_active_window(struct WinMeta * win_meta, char change);