Class for managing colors. More...
#include <colors.h>

Static Public Member Functions | |
| static short | getcolor (COLORS c) |
| Returns the number of the color pair. | |
| static void | initColors () |
| Initializes the color pairs. | |
| static void | setcolor (WINDOW *w, COLORS c) |
| Set the color of the curses window. | |
| static void | unsetcolor (WINDOW *w, COLORS c) |
Static Private Attributes | |
| static color | colors [] |
| Array holding the colors. | |
| static bool | initialized = false |
| Indicates whether or colors has been initialized. | |
This class is used for managing colors.
Definition at line 137 of file colors.h.
| short Colors::getcolor | ( | COLORS | c | ) | [static] |
Returns the number used by curses for the given color. If color support is unavailable, it always returns 0.
Definition at line 123 of file colors.cc.
References colors, and YAPET::UI::color::no.
Referenced by YAPET::UI::ListWidget< YAPET::PartDec >::showSelected().

| void Colors::initColors | ( | ) | [static] |
Initializes the color pairs used by curses if the terminal supports colors.
Definition at line 92 of file colors.cc.
References YAPET::UI::CHECKBOXGROUP_TITLE, colors, initialized, and YAPET::UI::color::no.
Referenced by YAPET::UI::BaseWindow::initCurses().

| void Colors::setcolor | ( | WINDOW * | w, | |
| COLORS | c | |||
| ) | [static] |
Sets the color of the curses window. If colors are not supported by the terminal, it returns the value of the attr field of the color struct.
Definition at line 112 of file colors.cc.
References colors.
Referenced by YAPET::UI::ListWidget< YAPET::PartDec >::clearWin(), MainWindow::createWindow(), YAPET::UI::ListWidget< YAPET::PartDec >::createWindow(), YAPET::UI::InputWidget::createWindow(), YAPET::UI::CheckBoxGroup::createWindow(), YAPET::UI::PasswordWidget::focus(), YAPET::UI::InputWidget::focus(), YAPET::UI::Button::focus(), MainWindow::printTitle(), SearchDialog::refresh(), PWGenDialog::refresh(), PasswordRecord::refresh(), PasswordDialog::refresh(), FileOpen::refresh(), YAPET::UI::MessageBox::refresh(), YAPET::UI::CheckBoxGroup::refresh(), and YAPET::UI::Button::refresh().

| void Colors::unsetcolor | ( | WINDOW * | w, | |
| COLORS | c | |||
| ) | [static] |
color Colors::colors [static, private] |
{
{1, COLOR_WHITE, COLOR_BLUE, A_NORMAL},
{2, COLOR_CYAN, COLOR_BLACK, A_NORMAL},
{3, COLOR_BLACK, COLOR_CYAN, A_NORMAL},
{4, COLOR_BLACK, COLOR_WHITE, A_REVERSE},
{5, COLOR_BLACK, COLOR_YELLOW, A_REVERSE},
{6, COLOR_WHITE, COLOR_BLACK, A_NORMAL},
{7, COLOR_BLACK, COLOR_GREEN, A_REVERSE},
{8, COLOR_WHITE, COLOR_BLUE, A_NORMAL},
{9, COLOR_BLACK, COLOR_CYAN, A_NORMAL},
{10, COLOR_CYAN, COLOR_BLACK, A_NORMAL},
{0, 0, 0, 0}
}
The color pairs for curses are access by using the names defined in the COLOR enum.
Definition at line 152 of file colors.h.
Referenced by getcolor(), initColors(), setcolor(), and unsetcolor().
bool Colors::initialized = false [static, private] |
Indicates whether or colors has been initialized by calling initColors().
Definition at line 145 of file colors.h.
Referenced by initColors().
1.7.1