| 28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ |
29 */ |
| 30 |
30 |
| 31 #pragma once |
31 #pragma once |
| 32 #include "main.h" |
32 #include "main.h" |
| |
33 BEGIN_ZFC_NAMESPACE |
| |
34 |
| |
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 |
| |
37 // of the enumerators based on their curses values. |
| |
38 enum Color |
| |
39 { |
| |
40 BLACK = COLOR_BLACK, |
| |
41 RED = COLOR_RED, |
| |
42 GREEN = COLOR_GREEN, |
| |
43 YELLOW = COLOR_YELLOW, |
| |
44 BLUE = COLOR_BLUE, |
| |
45 MAGENTA = COLOR_MAGENTA, |
| |
46 CYAN = COLOR_CYAN, |
| |
47 WHITE = COLOR_WHITE, |
| |
48 DEFAULT = 8, |
| |
49 NUM_COLORS |
| |
50 }; |
| 33 |
51 |
| 34 // ------------------------------------------------------------------------------------------------- |
52 // ------------------------------------------------------------------------------------------------- |
| 35 // |
53 // |
| 36 enum |
54 enum |
| 37 { |
55 { |
| 38 RLINE_ON_BLACK = 256, |
56 RLINE_ON_COLOR = 256, |
| 39 RLINE_ON_RED, |
57 RLINE_OFF_COLOR = 264, |
| 40 RLINE_ON_GREEN, |
58 RLINE_ON_BOLD = 272, |
| 41 RLINE_ON_YELLOW, |
59 RLINE_OFF_BOLD |
| 42 RLINE_ON_BLUE, |
|
| 43 RLINE_ON_MAGENTA, |
|
| 44 RLINE_ON_CYAN, |
|
| 45 RLINE_ON_WHITE, |
|
| 46 RLINE_ON_BOLD, |
|
| 47 RLINE_OFF_BLACK, |
|
| 48 RLINE_OFF_RED, |
|
| 49 RLINE_OFF_GREEN, |
|
| 50 RLINE_OFF_YELLOW, |
|
| 51 RLINE_OFF_BLUE, |
|
| 52 RLINE_OFF_MAGENTA, |
|
| 53 RLINE_OFF_CYAN, |
|
| 54 RLINE_OFF_WHITE, |
|
| 55 RLINE_OFF_BOLD, |
|
| 56 }; |
60 }; |
| 57 |
61 |
| 58 // ------------------------------------------------------------------------------------------------- |
62 // ------------------------------------------------------------------------------------------------- |
| 59 // |
63 // |
| 60 class ColoredLine |
64 class ColoredLine |
| 61 { |
65 { |
| 62 public: |
66 public: |
| 63 ColoredLine() {} |
67 ColoredLine(); |
| 64 |
68 |
| 65 const Vector<int>& data() const { return m_data; } |
69 const Vector<int>& data() const { return m_data; } |
| 66 int length() const { return m_length; } |
70 int length() const { return m_length; } |
| 67 void add_char (char ch); |
71 void add_char (char ch); |
| 68 void add_string (const String& msg); |
72 void add_string (const String& msg); |