#include #define NCURSES_CPP_FLAGS_MASK_TYPE_AS_PUBLIC #include #include #include #include using namespace ncurses; template <> struct ncurses::is_applyable : std::true_type {}; using full_attrs = ncurses::multiflags; int main(int argc, char *argv[]) { { full_attrs attr; assert(attr.value_ == 0); attr = attr::blink; assert(attr.value_ == A_BLINK); attr = color_pair(22); assert(attr.value_ == COLOR_PAIR(22)); attr = attr::bold | attr::italic | attr::top; assert(attr.value_ == (A_TOP | A_ITALIC | A_BOLD)); } { full_attrs attr = attr::color | color_pair(10); assert(attr.value_ == (A_COLOR | COLOR_PAIR(10))); } { full_attrs attr = color_pair(10) | attr::color; assert(attr.value_ == (A_COLOR | COLOR_PAIR(10))); } { full_attrs attr = color_pair(11) | attr::altcharset | attr::dim; assert(attr.value_ == (A_ALTCHARSET | A_DIM | COLOR_PAIR(11))); } { full_attrs attr = attr::top | color_pair(30); assert(attr != color_pair(1)); assert(attr != attr::chartext); assert(attr != (attr::bold | attr::dim)); assert(attr != (attr::bold | attr::dim | color_pair(1))); assert(attr == (full_attrs(attr::top) | color_pair(30))); } { full_attrs attr; // attr_flags to full_attrs attr = attr_flags(attr::top | attr::dim | attr::bold); // color + attr to full_attrs + attr to full_attrs attr = color_pair(1) | attr::top | attr::bold; // color + attr_flags to full_attrs attr = color_pair(2) | (attr::top & attr::bold); // attr_flags + color to full_attrs attr = (attr::top & attr::bold) | color_pair(2); } return 0; }