FACT++  1.0
void WindowLog::AddColor ( int  m)
private

Add color to the stream according to the attribute. If fWindow is not set this is an ANSI color code, otherwise the window's output attributes are set. It is also added to the backlog. Access to the backlog is encapsulated into its mutex.

Definition at line 332 of file WindowLog.cc.

Referenced by operator<<().

333 {
334  const int col = COLOR_PAIR(m);
335 
336  if (!fWindow)
337  // We don't have to flush here, because the attributes are simply
338  // part of the stream
339  *this << GetAnsiAttr(col);
340  else
341  {
342  // Before we change the attributes we have to flush the screen
343  // otherwise we would have to buffer them until we flush the
344  // contents
345  flush();
346  wattron(fWindow, col);
347  }
348 
349  fMuxBacklog.lock();
350  fAttributes[fBacklog.size()] |= col;
351  fMuxBacklog.unlock();
352 }
std::vector< char > fBacklog
Pointer to an ncurses Window.
Definition: WindowLog.h:65
static std::string GetAnsiAttr(int m)
Definition: WindowLog.cc:301
WINDOW * fWindow
Pointer to end of buffer.
Definition: WindowLog.h:63
std::map< int, int > fAttributes
Backlog storage.
Definition: WindowLog.h:66
std::mutex fMuxBacklog
Switch to toggle storage in the backlog on or off.
Definition: WindowLog.h:73

+ Here is the caller graph for this function: