2 * Copyright 2013, Haiku, Inc. All rights reserved.
3 * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
7 * Ingo Weinhold, ingo_weinhold@gmx.de
8 * Siarzhuk Zharski, zharik@gmx.li
10 #ifndef TERMINAL_LINE_H
11 #define TERMINAL_LINE_H
13 #include <SupportDefs.h>
15 #include "TermConst.h"
28 bool softBreak
; // soft line break
30 TerminalCell cells
[1];
32 inline void Clear(uint32 attr
= 0, size_t count
= 0)
37 for (size_t i
= 0; i
< count
; i
++)
38 cells
[i
].attributes
= attr
;
43 struct AttributesRun
{
45 uint16 offset
; // character offset
46 uint16 length
; // length of the run in characters
51 AttributesRun
* attributesRuns
;
52 uint16 attributesRunCount
; // number of attribute runs
53 uint16 byteLength
: 15; // number of bytes in the line
54 bool softBreak
: 1; // soft line break;
57 AttributesRun
* AttributesRuns() const
59 return attributesRuns
;
64 return (char*)(attributesRuns
+ attributesRunCount
);
67 int32
BufferSize() const
69 return attributesRunCount
* sizeof(AttributesRun
) + byteLength
;
74 #endif // TERMINAL_LINE_H