YAPETUI::Colors Class Reference

Class for managing colors. More...

#include <colors.h>

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 120 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 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]

Definition at line 113 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} 
}
The color pairs for curses are access by using the names defined in the 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().


The documentation for this class was generated from the following files:
Generated on Wed Feb 27 16:15:42 2008 for YAPET by  doxygen 1.5.4