]> granicus.if.org Git - neomutt/blob - mutt_window.h
Convert mutt_attach_reply() to use buffer pool
[neomutt] / mutt_window.h
1 /**
2  * @file
3  * Window management
4  *
5  * @authors
6  * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
7  *
8  * @copyright
9  * This program is free software: you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License as published by the Free Software
11  * Foundation, either version 2 of the License, or (at your option) any later
12  * version.
13  *
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License along with
20  * this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22
23 #ifndef MUTT_MUTT_WINDOW_H
24 #define MUTT_MUTT_WINDOW_H
25
26 #include "config.h"
27
28 /**
29  * struct MuttWindow - A division of the screen
30  *
31  * Windows for different parts of the screen
32  */
33 struct MuttWindow
34 {
35   int rows;
36   int cols;
37   int row_offset;
38   int col_offset;
39 };
40
41 extern struct MuttWindow *MuttHelpWindow;
42 extern struct MuttWindow *MuttIndexWindow;
43 extern struct MuttWindow *MuttMessageWindow;
44 #ifdef USE_SIDEBAR
45 extern struct MuttWindow *MuttSidebarWindow;
46 #endif
47 extern struct MuttWindow *MuttStatusWindow;
48
49 // Functions that deal with the Window
50 void               mutt_window_copy_size          (const struct MuttWindow *win_src, struct MuttWindow *win_dst);
51 void               mutt_window_free               (struct MuttWindow **ptr);
52 void               mutt_window_free_all           (void);
53 void               mutt_window_get_coords         (struct MuttWindow *win, int *col, int *row);
54 void               mutt_window_init               (void);
55 struct MuttWindow *mutt_window_new                (void);
56 void               mutt_window_reflow             (void);
57 void               mutt_window_reflow_message_rows(int mw_rows);
58 int                mutt_window_wrap_cols          (int width, short wrap);
59
60 // Functions for drawing on the Window
61 int  mutt_window_addch    (int ch);
62 int  mutt_window_addnstr  (const char *str, int num);
63 int  mutt_window_addstr   (const char *str);
64 void mutt_window_clear_screen(void);
65 void mutt_window_clearline(struct MuttWindow *win, int row);
66 void mutt_window_clrtobot (void);
67 void mutt_window_clrtoeol (struct MuttWindow *win);
68 int  mutt_window_move     (struct MuttWindow *win, int row, int col);
69 void mutt_window_move_abs (int row, int col);
70 int  mutt_window_mvaddstr (struct MuttWindow *win, int row, int col, const char *str);
71 int  mutt_window_mvprintw (struct MuttWindow *win, int row, int col, const char *fmt, ...);
72 int  mutt_window_printf   (const char *format, ...);
73
74 #endif /* MUTT_MUTT_WINDOW_H */