#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. |
Definition at line 120 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 105 of file colors.cc.
References colors, and YAPETUI::color::no.
Referenced by YAPETUI::ListWidget< YAPET::PartDec >::showSelected().
void Colors::initColors | ( | ) | [static] |
Initializes the color pairs used by curses if the terminal supports colors.
Definition at line 48 of file colors.cc.
References YAPETUI::BUTTON_FOCUS, YAPETUI::BUTTON_NOFOCUS, colors, YAPETUI::DEFAULT, initialized, YAPETUI::INPUTWIDGET_FOCUS, YAPETUI::INPUTWIDGET_NOFOCUS, YAPETUI::LISTWIDGET, YAPETUI::MESSAGEBOX, and YAPETUI::MESSAGEBOX_TITLE.
Referenced by YAPETUI::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 94 of file colors.cc.
References colors.
Referenced by YAPETUI::ListWidget< YAPET::PartDec >::clearWin(), MainWindow::createWindow(), YAPETUI::ListWidget< YAPET::PartDec >::createWindow(), YAPETUI::InputWidget::createWindow(), YAPETUI::InputWidget::focus(), YAPETUI::Button::focus(), MainWindow::printTitle(), PasswordRecord::refresh(), PasswordDialog::refresh(), FileOpen::refresh(), YAPETUI::MessageBox::refresh(), and YAPETUI::Button::refresh().
void Colors::unsetcolor | ( | WINDOW * | w, | |
COLORS | c | |||
) | [static] |
color Colors::colors [static, private] |
Initial value:
{ {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} }
COLOR
enum.
Definition at line 135 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 128 of file colors.h.
Referenced by initColors().