#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#include <wchar.h>
#include "mutt/lib.h"
#include "msgwin.h"
#include "color/lib.h"
#include "msgcont.h"
#include "msgwin_wdata.h"
#include "mutt_curses.h"
#include "mutt_window.h"
Go to the source code of this file.
Functions | |
void | measure (struct MwCharArray *chars, const char *str, const struct AttrColor *ac_color) |
Measure a string in bytes and cells. | |
static int | msgwin_recalc (struct MuttWindow *win) |
Recalculate the display of the Message Window - Implements MuttWindow::recalc() -. | |
int | msgwin_calc_rows (struct MsgWinWindowData *wdata, int cols, const char *str) |
How many rows will a string need? | |
static int | msgwin_repaint (struct MuttWindow *win) |
Redraw the Message Window - Implements MuttWindow::repaint() -. | |
static bool | msgwin_recursor (struct MuttWindow *win) |
Recursor the Message Window - Implements MuttWindow::recursor() -. | |
void | msgwin_set_rows (struct MuttWindow *win, short rows) |
Resize the Message Window. | |
static int | msgwin_window_observer (struct NotifyCallback *nc) |
Notification that a Window has changed - Implements observer_t -. | |
struct MuttWindow * | msgwin_new (bool interactive) |
Create the Message Window. | |
const char * | msgwin_get_text (struct MuttWindow *win) |
Get the text from the Message Window. | |
void | msgwin_add_text (struct MuttWindow *win, const char *text, const struct AttrColor *ac_color) |
Add text to the Message Window. | |
void | msgwin_add_text_n (struct MuttWindow *win, const char *text, int bytes, const struct AttrColor *ac_color) |
Add some text to the Message Window. | |
void | msgwin_set_text (struct MuttWindow *win, const char *text, enum ColorId color) |
Set the text for the Message Window. | |
void | msgwin_clear_text (struct MuttWindow *win) |
Clear the text in the Message Window. | |
struct MuttWindow * | msgwin_get_window (void) |
Get the Message Window pointer. | |
Message Window.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file msgwin.c.
void measure | ( | struct MwCharArray * | chars, |
const char * | str, | ||
const struct AttrColor * | ac_color | ||
) |
Measure a string in bytes and cells.
chars | Results |
str | String to measure |
ac_color | Colour to associate |
Calculate the size of each character in a string in bytes and screen cells.
Definition at line 106 of file msgwin.c.
int msgwin_calc_rows | ( | struct MsgWinWindowData * | wdata, |
int | cols, | ||
const char * | str | ||
) |
How many rows will a string need?
wdata | Window data |
cols | Columns to wrap at |
str | Text to measure |
num | Number of rows required |
0 | Error |
Divide the width of a string by the width of the Message Window.
< Screen width used
< Offset into str
< Current row
Definition at line 178 of file msgwin.c.
void msgwin_set_rows | ( | struct MuttWindow * | win, |
short | rows | ||
) |
Resize the Message Window.
win | Message Window |
rows | Number of rows required |
Resize the other Windows to allow a multi-line message to be displayed.
Definition at line 303 of file msgwin.c.
struct MuttWindow * msgwin_new | ( | bool | interactive | ) |
Create the Message Window.
ptr | New Window |
Definition at line 371 of file msgwin.c.
const char * msgwin_get_text | ( | struct MuttWindow * | win | ) |
Get the text from the Message Window.
win | Message Window |
ptr | Window text |
Definition at line 401 of file msgwin.c.
void msgwin_add_text | ( | struct MuttWindow * | win, |
const char * | text, | ||
const struct AttrColor * | ac_color | ||
) |
Add text to the Message Window.
win | Message Window |
text | Text to add |
ac_color | Colour for text |
Definition at line 419 of file msgwin.c.
void msgwin_add_text_n | ( | struct MuttWindow * | win, |
const char * | text, | ||
int | bytes, | ||
const struct AttrColor * | ac_color | ||
) |
Add some text to the Message Window.
win | Message Window |
text | Text to add |
bytes | Number of bytes of text to add |
ac_color | Colour for text |
Definition at line 450 of file msgwin.c.
void msgwin_set_text | ( | struct MuttWindow * | win, |
const char * | text, | ||
enum ColorId | color | ||
) |
Set the text for the Message Window.
win | Message Window |
text | Text to set |
color | Colour for text |
Definition at line 484 of file msgwin.c.
void msgwin_clear_text | ( | struct MuttWindow * | win | ) |
Clear the text in the Message Window.
win | Message Window |
Definition at line 519 of file msgwin.c.
struct MuttWindow * msgwin_get_window | ( | void | ) |