… | |
… | |
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 |
… | |
… | |
244 | #define Opt_transparent (1UL<<13) |
222 | #define Opt_transparent (1UL<<13) |
245 | #define Opt_tripleclickwords (1UL<<14) |
223 | #define Opt_tripleclickwords (1UL<<14) |
246 | #define Opt_scrollWithBuffer (1UL<<15) |
224 | #define Opt_scrollWithBuffer (1UL<<15) |
247 | #define Opt_jumpScroll (1UL<<16) |
225 | #define Opt_jumpScroll (1UL<<16) |
248 | #define Opt_mouseWheelScrollPage (1UL<<17) |
226 | #define Opt_mouseWheelScrollPage (1UL<<17) |
|
|
227 | #if POINTER_BLANK |
249 | #define Opt_pointerBlank (1UL<<18) |
228 | # define Opt_pointerBlank (1UL<<18) |
|
|
229 | #else |
|
|
230 | # define Opt_pointerBlank 0 |
|
|
231 | #endif |
250 | #define Opt_cursorBlink (1UL<<19) |
232 | #define Opt_cursorBlink (1UL<<19) |
251 | #define Opt_secondaryScreen (1UL<<20) |
233 | #define Opt_secondaryScreen (1UL<<20) |
252 | #define Opt_secondaryScroll (1UL<<21) |
234 | #define Opt_secondaryScroll (1UL<<21) |
253 | #define Opt_pastableTabs (1UL<<22) |
235 | #define Opt_pastableTabs (1UL<<22) |
254 | #define Opt_cursorUnderline (1UL<<23) |
236 | #define Opt_cursorUnderline (1UL<<23) |
255 | #if ENABLE_FRILLS |
237 | #if ENABLE_FRILLS |
256 | # define Opt_insecure (1UL<<24) // insecure esc sequences |
238 | # define Opt_insecure (1UL<<24) // insecure esc sequences |
257 | # define Opt_borderLess (1UL<<25) // mem borderless hints |
239 | # define Opt_borderLess (1UL<<25) // mwm borderless hints |
|
|
240 | # define Opt_hold (1UL<<26) // hold window open after exit |
|
|
241 | # define Opt_skipBuiltinGlyphs (1UL<<27) // do not use internal glyphs |
258 | #else |
242 | #else |
259 | # define Opt_insecure 0 |
243 | # define Opt_insecure 0 |
260 | # define Opt_borderLess 0 |
244 | # define Opt_borderLess 0 |
|
|
245 | # define Opt_hold 0 |
|
|
246 | # define Opt_skipBuiltinGlyphs 0 |
261 | #endif |
247 | #endif |
262 | /* place holder used for parsing command-line options */ |
248 | #if ENABLE_STYLES |
263 | #define Opt_Reverse (1UL<<30) |
249 | # define Opt_intensityStyles (1UL<<28) // font styles imply intensity |
264 | #define Opt_Boolean (1UL<<31) |
250 | #else |
|
|
251 | # define Opt_intensityStyles 0 |
|
|
252 | #endif |
265 | |
253 | |
|
|
254 | #define SET_OPTION(opt) (options |= (opt)) |
|
|
255 | #define CLR_OPTION(opt) (options &= ~(opt)) |
|
|
256 | #define OPTION(opt) (options & (opt)) |
|
|
257 | #define OPTION_R(opt) (r->options & (opt)) |
266 | #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ |
258 | #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ |
267 | | Opt_jumpScroll | Opt_secondaryScreen \ |
259 | | Opt_jumpScroll | Opt_secondaryScreen \ |
268 | | Opt_pastableTabs) |
260 | | Opt_pastableTabs | Opt_intensityStyles) |
269 | |
261 | |
270 | /* ------------------------------------------------------------------------- */ |
262 | /* ------------------------------------------------------------------------- */ |
271 | |
263 | |
272 | typedef struct { |
264 | typedef struct { |
273 | short state; |
265 | short state; |