-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vtpty] ImageSize: add min()/max() functions
Signed-off-by: Christian Parpart <christian@parpart.family>
- Loading branch information
1 parent
0102d17
commit b1fedb7
Showing
19 changed files
with
1,032 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#pragma once | ||
|
||
#include <vtbackend/Charset.h> | ||
#include <vtbackend/GraphicsAttributes.h> | ||
#include <vtbackend/Hyperlink.h> | ||
#include <vtbackend/primitives.h> | ||
|
||
namespace vtbackend | ||
{ | ||
|
||
/// Terminal cursor data structure. | ||
/// | ||
/// NB: Take care what to store here, as DECSC/DECRC will save/restore this struct. | ||
struct Cursor | ||
{ | ||
CellLocation position { LineOffset(0), ColumnOffset(0) }; | ||
bool autoWrap = true; // false; | ||
bool originMode = false; | ||
bool wrapPending = false; | ||
GraphicsAttributes graphicsRendition {}; | ||
CharsetMapping charsets {}; | ||
HyperlinkId hyperlink {}; | ||
// TODO: selective erase attribute | ||
// TODO: SS2/SS3 states | ||
// TODO: CharacterSet for GL and GR | ||
}; | ||
|
||
} // namespace vtbackend | ||
|
||
// {{{ fmt format support | ||
namespace fmt | ||
{ | ||
template <> | ||
struct fmt::formatter<vtbackend::Cursor>: fmt::formatter<vtbackend::CellLocation> | ||
{ | ||
auto format(const vtbackend::Cursor cursor, format_context& ctx) -> format_context::iterator | ||
{ | ||
return formatter<vtbackend::CellLocation>::format(cursor.position, ctx); | ||
} | ||
}; | ||
} // namespace fmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.