home · contact · privacy
License everything (GPL).
[plomrogue] / src / client / wincontrol.h
1 /* src/client/wincontrol.h
2  *
3  * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
4  * or any later version. For details on its copyright, license, and warranties,
5  * see the file NOTICE in the root directory of the PlomRogue source package.
6  *
7  * Window manipulation functions directly called by user actions.
8  */
9
10 #ifndef WINCONTROL_H
11 #define WINCONTROL_H
12
13
14
15 /* Toggle display of a window of "id". */
16 extern void toggle_window(char id);
17
18 /* Toggle "window configuration" view for active window. Sets sensible .center
19  * values for each configuration view (for winconf_geometry: y=0, x=0; for
20  * winconf_keys: x=0 (y is set by draw_winconf_keybindings()); stores default
21  * view's .center in .target_center to return to it when toggling back.
22  */
23 extern void toggle_winconfig();
24
25 /* Toggle active window's .target_(height/width)_type ("axis" = "y": height;
26  * else: width). Don't toggle to .target_width_type of 1 (saving the width as a
27  * diff to the .t_screen's width) if window's width is larger than .t_screen's
28  * width, for such width is better saved directly with .target_width_type of 0.
29  */
30 extern void toggle_win_size_type(char axis);
31
32 /* Toggle window's line break type. (0: line breaks only at newlines; 1:
33  * linebreaks at newlines and when the text hits the right window border; 2:
34  * linebreaks only when the text hits the right window border, newlines are
35  * replaced by another string).
36  */
37 extern void toggle_linebreak_type();
38
39 /* Grow or shrink active window horizontally ("change" = "*"/"_") or vertically
40  * ("change" = "+"/"-") if the new size was at least 1x1, the height at least
41  * one cell smaller than .v_screen's vertical hight (to provide space for the
42  * title bar) and the width max. (2^16) - 1 cells. If a new window width would
43  * surpass that of .t_screen, set active window's .target_width_type to 0.
44  */
45 extern void resize_active_win(char c);
46
47 /* Move active window forwards ("dir" == "f") or backwards (any other "dir") in
48  * window chain. Wrap around in the window chain if start / end of it is met.
49  */
50 extern void shift_active_win(char dir);
51
52 /* Sroll .v_screen one cell to the left if "dir" is "-" and .v_screen_offset is
53  * more than 1, or to the right if "dir" is "+" and .v_screen's right edge would
54  * not move (further, if suspension of windows has moved it to the left already)
55  * leftwards to .t_screen's right edge.
56  */
57 extern void scroll_v_screen(char dir);
58
59 /* Cycle active window selection forwards ("dir" == "f") or backwards (any
60  * other "dir"). Wrap around in the windows chain if start / end of it is met.
61  */
62 extern void cycle_active_win(char dir);
63
64
65
66 #endif