Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / fe-text / mainwindows.h
1 #ifndef __MAINWINDOWS_H
2 #define __MAINWINDOWS_H
3
4 #include "fe-windows.h"
5 #include "term.h"
6
7 #define WINDOW_MIN_SIZE 2
8
9 #define MAIN_WINDOW_TEXT_HEIGHT(window) \
10         ((window)->height-(window)->statusbar_lines)
11
12 typedef struct {
13         WINDOW_REC *active;
14
15         TERM_WINDOW *screen_win;
16         int sticky_windows; /* number of sticky windows */
17
18         int first_line, last_line; /* first/last line used by this window (0..x) (includes statusbars) */
19         int width, height; /* width/height of the window (includes statusbars) */
20
21         GSList *statusbars;
22         int statusbar_lines_top;
23         int statusbar_lines_bottom;
24         int statusbar_lines; /* top+bottom */
25
26         unsigned int dirty:1; /* This window needs a redraw */
27         unsigned int size_dirty:1; /* We'll need to resize the window, but haven't got around doing it just yet. */
28 } MAIN_WINDOW_REC;
29
30 extern GSList *mainwindows;
31 extern MAIN_WINDOW_REC *active_mainwin;
32 extern int screen_reserved_top, screen_reserved_bottom;
33
34 void mainwindows_init(void);
35 void mainwindows_deinit(void);
36
37 MAIN_WINDOW_REC *mainwindow_create(void);
38 void mainwindow_destroy(MAIN_WINDOW_REC *window);
39
40 void mainwindows_redraw(void);
41 void mainwindows_recreate(void);
42
43 /* Change the window height - the height includes the lines needed for
44    statusbars. If resize_lower is TRUE, the lower window is first tried
45    to be resized instead of upper window. */
46 void mainwindow_set_size(MAIN_WINDOW_REC *window, int height,
47                          int resize_lower);
48 void mainwindows_resize(int width, int height);
49
50 void mainwindow_change_active(MAIN_WINDOW_REC *mainwin,
51                               WINDOW_REC *skip_window);
52
53 int mainwindows_reserve_lines(int top, int bottom);
54 int mainwindow_set_statusbar_lines(MAIN_WINDOW_REC *window,
55                                    int top, int bottom);
56 void mainwindows_redraw_dirty(void);
57
58 GSList *mainwindows_get_sorted(int reverse);
59
60 #endif