View | Details | Raw Unified | Return to bug 153079
Collapse All | Expand All

(-)src/NCstyle.h-dist (-2 / +10 lines)
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
      _colors = ::COLORS;
94
      _pairs = ::COLOR_PAIRS;
95
      if ( _colors > COLOR_WHITE + 1 )
96
	_colors = COLOR_WHITE + 1;
97
      if ( _pairs > _colors * _colors )
98
	_pairs = _colors * _colors;
91
      for ( short i = 1; i < color_pairs(); ++i )
99
      for ( short i = 1; i < color_pairs(); ++i )
92
	::init_pair( i, fg_color_pair( i ), bg_color_pair( i ) );
100
	::init_pair( i, fg_color_pair( i ), bg_color_pair( i ) );
93
    }
101
    }
(-)src/NCstyle.cc-dist (+3 lines)
Lines 28-33 Link Here
28
#include "NCstyle.linux.h"
28
#include "NCstyle.linux.h"
29
#include "NCstyle.xterm.h"
29
#include "NCstyle.xterm.h"
30
30
31
int NCattribute::_colors = ::COLORS;
32
int NCattribute::_pairs = ::COLOR_PAIRS;
33
31
///////////////////////////////////////////////////////////////////
34
///////////////////////////////////////////////////////////////////
32
//
35
//
33
//	CLASS NAME : NCstyle::Style
36
//	CLASS NAME : NCstyle::Style

Return to bug 153079