NeoMutt  2021-02-05-329-g9e03b7
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.h"
34 
39 void mutt_curses_set_attr(int attr)
40 {
41 #ifdef HAVE_BKGDSET
42  bkgdset(attr | ' ');
43 #else
44  attrset(attr);
45 #endif
46 }
47 
57 {
58  const int chosen = mutt_color(color);
59  const int normal = mutt_color(MT_COLOR_NORMAL);
60 #ifdef HAVE_BKGDSET
61  bkgdset((chosen ? chosen : normal) | ' ');
62 #else
63  attrset(chosen ? chosen : normal);
64 #endif
65 }
66 
72 {
73 #if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
74  static int SavedCursor = MUTT_CURSOR_VISIBLE;
75 
76  if (state == MUTT_CURSOR_RESTORE_LAST)
77  state = SavedCursor;
78  else
79  SavedCursor = state;
80 
81  if (curs_set(state) == ERR)
82  {
83  if (state == MUTT_CURSOR_VISIBLE)
84  curs_set(MUTT_CURSOR_VERY_VISIBLE);
85  }
86 #endif
87 }
MuttCursorState
Cursor states for mutt_curses_set_cursor()
Definition: mutt_curses.h:77
Define wrapper functions around Curses/Slang.
void mutt_curses_set_color(enum ColorId color)
Set the current colour for text.
Definition: mutt_curses.c:56
Display a very visible cursor.
Definition: mutt_curses.h:82
void mutt_curses_set_cursor(enum MuttCursorState state)
Set the cursor state.
Definition: mutt_curses.c:71
Display a normal cursor.
Definition: mutt_curses.h:81
ColorId
List of all colored objects.
Definition: color.h:39
Plain text.
Definition: color.h:58
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:122
int mutt_color(enum ColorId id)
Return the color of an object.
Definition: color.c:1393
Color and attribute parsing.
Restore the previous cursor state.
Definition: mutt_curses.h:79
void mutt_curses_set_attr(int attr)
Set the attributes for text.
Definition: mutt_curses.c:39