home · contact · privacy
New command: type Z to reload default window configuration from window config files.
[plomrogue] / src / wincontrol.h
1 /* wincontrol.h
2  *
3  * Routines that build on top of the windows library to provide a simple window
4  * management API to the game.
5  */
6
7 #ifndef WINCONTROL_H
8 #define WINCONTROL_H
9
10
11
12 #include <stdint.h> /* for uint8_t */
13 struct Win;
14 struct WinMeta;
15 struct World;
16
17
18
19 /* Reload windows in order and sizes defined in win config. */
20 extern void reload_win_config(struct World * world);
21
22
23
24 /* Wrapper around init_win() that reads the desired window size and title from a
25  * file at the path prefixing the provided win name "w_name" with
26  * "config/windows/". "f"() is the window drawing function (Win._draw()).
27  */
28 extern struct Win * init_win_from_file(struct World * world, char * w_name,
29                                        void (* f) (struct Win *));
30
31
32
33
34 /* Toggle windows in world->wins in the order desribed by the first line of
35  * config/windows/toggled_win_order, wherein each character may correspond to
36  * one hardcoded window.
37  */
38 extern void sorted_wintoggle(struct World * world);
39
40
41
42 /* Toggle display of a window "win".
43  *
44  * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
45  */
46 extern uint8_t toggle_window(struct WinMeta * win_meta, struct Win * win);
47
48
49
50 /* Try to scroll virtual screen left ("dir" = "-") or right ("dir" = "+"),
51  * subject to the limitations provided by the window manager via
52  * reset_pad_offset().
53  */
54 extern void scroll_pad(struct WinMeta * win_meta, char dir);
55
56
57
58 /* Try to grow or shrink the active window horizontally ("change" = "*"/"_") or
59  * vertically ("change = "+"/"-") by one cell size, subject to the limitations
60  * provided by the window manager via resize_active_win().
61  *
62  * Return 0 on success, 1 on (ncurses pad/window memory allocation) error.
63  */
64 extern uint8_t growshrink_active_window(struct WinMeta * win_meta, char change);
65
66
67
68 #endif