23 #include <ncursesw/curses.h> 25 #include <cwidget/curses++.h> 31 #include <cwidget/generic/util/eassert.h> 74 style():fg(-1), bg(-2), set_attrs(0), clear_attrs(0), flip_attrs(0)
81 void set_fg(
short _fg) {
if(_fg >= 0) fg=_fg;}
86 void set_bg(
short _bg) {
if(_bg >= -1) bg = _bg;}
139 bool operator==(
const style &other)
const 141 return fg == other.fg && bg == other.bg &&
142 set_attrs == other.set_attrs && clear_attrs == other.clear_attrs &&
143 flip_attrs == other.flip_attrs;
146 bool operator!=(
const style &other)
const 148 return fg != other.fg || bg != other.bg ||
149 set_attrs != other.set_attrs || clear_attrs != other.clear_attrs ||
150 flip_attrs != other.flip_attrs;
162 rval &= ~clear_attrs;
176 return (ch & A_CHARTEXT) |
178 ((((ch & ~ (A_CHARTEXT | A_COLOR)) | set_attrs) & ~clear_attrs) ^ flip_attrs);
189 ((((ch.
attrs & ~ A_COLOR) | set_attrs) & ~clear_attrs) ^ flip_attrs));
Routines to support independently changing foreground and background colors.