NeoMutt  2021-10-29-225-gb9986f
Teaching an old dog new tricks
DOXYGEN
mutt_curses.c
Go to the documentation of this file.
1 
31 #include "config.h"
32 #include "mutt_curses.h"
33 #include "color/lib.h"
34 
39 void mutt_curses_set_attr(int attr)
40 {
41  bkgdset(attr | ' ');
42 }
43 
53 {
54  const int chosen = simple_color_get(cid);
55  const int normal = simple_color_get(MT_COLOR_NORMAL);
56  bkgdset((chosen ? chosen : normal) | ' ');
57 }
58 
64 {
65  static int SavedCursor = MUTT_CURSOR_VISIBLE;
66 
67  if (state == MUTT_CURSOR_RESTORE_LAST)
68  state = SavedCursor;
69  else
70  SavedCursor = state;
71 
72  if (curs_set(state) == ERR)
73  {
74  if (state == MUTT_CURSOR_VISIBLE)
75  curs_set(MUTT_CURSOR_VERY_VISIBLE);
76  }
77 }
Color and attribute parsing.
int simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Definition: simple.c:68
ColorId
List of all colored objects.
Definition: color.h:35
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:53
void mutt_curses_set_attr(int attr)
Set the attributes for text.
Definition: mutt_curses.c:39
void mutt_curses_set_color_by_id(enum ColorId cid)
Set the current colour for text.
Definition: mutt_curses.c:52
void mutt_curses_set_cursor(enum MuttCursorState state)
Set the cursor state.
Definition: mutt_curses.c:63
Define wrapper functions around Curses.
MuttCursorState
Cursor states for mutt_curses_set_cursor()
Definition: mutt_curses.h:52
@ MUTT_CURSOR_RESTORE_LAST
Restore the previous cursor state.
Definition: mutt_curses.h:53
@ MUTT_CURSOR_VISIBLE
Display a normal cursor.
Definition: mutt_curses.h:55
@ MUTT_CURSOR_VERY_VISIBLE
Display a very visible cursor.
Definition: mutt_curses.h:56