… | |
… | |
77 | typedef uint32_t text_t; |
77 | typedef uint32_t text_t; |
78 | #else |
78 | #else |
79 | typedef uint16_t text_t; // saves lots of memory |
79 | typedef uint16_t text_t; // saves lots of memory |
80 | #endif |
80 | #endif |
81 | typedef uint32_t rend_t; |
81 | typedef uint32_t rend_t; |
82 | typedef int32_t tlen_t; // was int16_t, but this result sin smaller code and memory use |
82 | typedef int32_t tlen_t; // was int16_t, but this results in smaller code and memory use |
|
|
83 | typedef int32_t tlen_t_; // specifically for use in the line_t structure |
83 | |
84 | |
84 | #define LINE_CONT -1 |
|
|
85 | |
|
|
86 | struct line_t { |
85 | struct line_t; |
87 | text_t *t; // terminal the text |
|
|
88 | rend_t *r; // rendition, uses RS_ flags |
|
|
89 | tlen_t l; // length of each text line, LINE_CONT == continued on next line |
|
|
90 | |
|
|
91 | bool is_longer () |
|
|
92 | { |
|
|
93 | return l < 0; |
|
|
94 | } |
|
|
95 | |
|
|
96 | void set_is_longer () |
|
|
97 | { |
|
|
98 | l = LINE_CONT; |
|
|
99 | } |
|
|
100 | |
|
|
101 | void clear () |
|
|
102 | { |
|
|
103 | t = 0; |
|
|
104 | r = 0; |
|
|
105 | l = 0; |
|
|
106 | } |
|
|
107 | }; |
|
|
108 | |
86 | |
109 | /* |
87 | /* |
110 | * terminal limits: |
88 | * terminal limits: |
111 | * |
89 | * |
112 | * width : 1 <= width |
90 | * width : 1 <= width |