NeoMutt  2020-11-20
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 #include "mutt_globals.h"
35 
40 void mutt_curses_set_attr(int attr)
41 {
42 #ifdef HAVE_BKGDSET
43  bkgdset(attr | ' ');
44 #else
45  attrset(attr);
46 #endif
47 }
48 
58 {
59  if (!Colors)
60  return;
61 #ifdef HAVE_BKGDSET
62  if (Colors->defs[color] != 0)
63  bkgdset(Colors->defs[color] | ' ');
64  else
65  bkgdset(Colors->defs[MT_COLOR_NORMAL] | ' ');
66 #else
67  if (Colors->defs[color] != 0)
68  attrset(Colors->defs[color]);
69  else
70  attrset(Colors->defs[MT_COLOR_NORMAL]);
71 #endif
72 }
73 
79 {
80 #if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
81  static int SavedCursor = MUTT_CURSOR_VISIBLE;
82 
83  if (state == MUTT_CURSOR_RESTORE_LAST)
84  state = SavedCursor;
85  else
86  SavedCursor = state;
87 
88  if (curs_set(state) == ERR)
89  {
90  if (state == MUTT_CURSOR_VISIBLE)
91  curs_set(MUTT_CURSOR_VERY_VISIBLE);
92  }
93 #endif
94 }
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:57
int * defs
Array of all fixed colours, see enum ColorId.
Definition: color.h:131
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:78
Display a normal cursor.
Definition: mutt_curses.h:81
ColorId
List of all colored objects.
Definition: color.h:58
Plain text.
Definition: color.h:77
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:120
Definition: color.h:129
Color and attribute parsing.
Restore the previous cursor state.
Definition: mutt_curses.h:79
Hundreds of global variables to back the user variables.
void mutt_curses_set_attr(int attr)
Set the attributes for text.
Definition: mutt_curses.c:40