35 // The order of these colors appears to differ between curses distributions (PDCurses and its |
35 // The order of these colors appears to differ between curses distributions (PDCurses and its |
36 // win32a for instance have blue and red swapped). So we need to explicitly define the values |
36 // win32a for instance have blue and red swapped). So we need to explicitly define the values |
37 // of the enumerators based on their curses values. |
37 // of the enumerators based on their curses values. |
38 enum Color |
38 enum Color |
39 { |
39 { |
40 BLACK = COLOR_BLACK, |
40 BLACK = COLOR_BLACK, |
41 RED = COLOR_RED, |
41 RED = COLOR_RED, |
42 GREEN = COLOR_GREEN, |
42 GREEN = COLOR_GREEN, |
43 YELLOW = COLOR_YELLOW, |
43 YELLOW = COLOR_YELLOW, |
44 BLUE = COLOR_BLUE, |
44 BLUE = COLOR_BLUE, |
45 MAGENTA = COLOR_MAGENTA, |
45 MAGENTA = COLOR_MAGENTA, |
46 CYAN = COLOR_CYAN, |
46 CYAN = COLOR_CYAN, |
47 WHITE = COLOR_WHITE, |
47 WHITE = COLOR_WHITE, |
48 DEFAULT = 8, |
48 DEFAULT = 8, |
49 NUM_COLORS |
49 NUM_COLORS |
50 }; |
50 }; |
51 |
51 |
52 // ------------------------------------------------------------------------------------------------- |
52 // ------------------------------------------------------------------------------------------------- |
53 // |
53 // |
54 enum |
54 enum |
55 { |
55 { |
56 RLINE_ON_BLACK = 256, |
56 RLINE_ON_COLOR = 256, |
57 RLINE_ON_RED, |
57 RLINE_OFF_COLOR = 264, |
58 RLINE_ON_GREEN, |
58 RLINE_ON_BOLD = 272, |
59 RLINE_ON_YELLOW, |
59 RLINE_OFF_BOLD |
60 RLINE_ON_BLUE, |
|
61 RLINE_ON_MAGENTA, |
|
62 RLINE_ON_CYAN, |
|
63 RLINE_ON_WHITE, |
|
64 RLINE_ON_BOLD, |
|
65 RLINE_OFF_BLACK, |
|
66 RLINE_OFF_RED, |
|
67 RLINE_OFF_GREEN, |
|
68 RLINE_OFF_YELLOW, |
|
69 RLINE_OFF_BLUE, |
|
70 RLINE_OFF_MAGENTA, |
|
71 RLINE_OFF_CYAN, |
|
72 RLINE_OFF_WHITE, |
|
73 RLINE_OFF_BOLD, |
|
74 }; |
60 }; |
75 |
61 |
76 // ------------------------------------------------------------------------------------------------- |
62 // ------------------------------------------------------------------------------------------------- |
77 // |
63 // |
78 class ColoredLine |
64 class ColoredLine |