|
Lines 36-46
extern "C" {
Link Here
|
| 36 |
// DESCRIPTION : |
36 |
// DESCRIPTION : |
| 37 |
// |
37 |
// |
| 38 |
struct NCattribute { |
38 |
struct NCattribute { |
|
|
39 |
static int _colors; |
| 40 |
static int _pairs; |
| 39 |
// |
41 |
// |
| 40 |
// available colors and color pairs |
42 |
// available colors and color pairs |
| 41 |
// |
43 |
// |
| 42 |
inline static int colors() { return ::COLORS; } |
44 |
inline static int colors() { return _colors; } |
| 43 |
inline static int color_pairs() { return ::COLOR_PAIRS; } |
45 |
inline static int color_pairs() { return _pairs; } |
| 44 |
// |
46 |
// |
| 45 |
// color pair to chtype |
47 |
// color pair to chtype |
| 46 |
// |
48 |
// |
|
Lines 88-93
struct NCattribute {
Link Here
|
| 88 |
friend class NCurses; |
90 |
friend class NCurses; |
| 89 |
|
91 |
|
| 90 |
static void init_colors() { |
92 |
static void init_colors() { |
|
|
93 |
if ( _colors > COLOR_WHITE + 1 ) |
| 94 |
_colors = COLOR_WHITE + 1; |
| 95 |
if ( _pairs > _colors * _colors ) |
| 96 |
_pairs = _colors * _colors; |
| 91 |
for ( short i = 1; i < color_pairs(); ++i ) |
97 |
for ( short i = 1; i < color_pairs(); ++i ) |
| 92 |
::init_pair( i, fg_color_pair( i ), bg_color_pair( i ) ); |
98 |
::init_pair( i, fg_color_pair( i ), bg_color_pair( i ) ); |
| 93 |
} |
99 |
} |