Static Public Member Functions | Static Private Attributes

YAPET::UI::Colors Class Reference

Class for managing colors. More...

#include <colors.h>

Collaboration diagram for YAPET::UI::Colors:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

This class is used for managing colors.

Definition at line 137 of file colors.h.


Member Function Documentation

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.

Returns:
the number of the color pair, or zero if color support is not available.

Definition at line 123 of file colors.cc.

References colors, and YAPET::UI::color::no.

Referenced by YAPET::UI::ListWidget< YAPET::PartDec >::showSelected().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void Colors::setcolor ( WINDOW *  w,
COLORS  c 
) [static]
void Colors::unsetcolor ( WINDOW *  w,
COLORS  c 
) [static]

Definition at line 132 of file colors.cc.

References colors.


Member Data Documentation

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},
    
    {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().


The documentation for this class was generated from the following files: