16 using namespace std::literals;
20 "-text"sv,
"-font"sv,
"-size"sv,
21 "-wrap"sv,
"-wrapw"sv,
"-wraprelw"sv,
28 [[nodiscard]] std::span<const std::string_view>
getProperties()
const override {
32 std::string_view name,
const TclObject& value)
override;
34 [[nodiscard]] std::string_view
getType()
const override;
37 void invalidateLocal()
override;
39 [[nodiscard]] uint8_t getFadedAlpha()
const override;
40 [[nodiscard]] std::unique_ptr<GLImage> create(
OutputSurface& output)
override;
42 template<
typename FindSplitPo
intFunc,
typename CantSplitFunc>
43 [[nodiscard]]
size_t split(
const std::string& line,
unsigned maxWidth,
44 FindSplitPointFunc findSplitPoint, CantSplitFunc cantSplit,
45 bool removeTrailingSpaces)
const;
46 [[nodiscard]]
size_t splitAtChar(
const std::string& line,
unsigned maxWidth)
const;
47 [[nodiscard]]
size_t splitAtWord(
const std::string& line,
unsigned maxWidth)
const;
48 [[nodiscard]] std::string getCharWrappedText(
const std::string& txt,
unsigned maxWidth)
const;
49 [[nodiscard]] std::string getWordWrappedText(
const std::string& txt,
unsigned maxWidth)
const;
52 enum WrapMode { NONE, WORD, CHAR };
58 WrapMode wrapMode = NONE;
59 float wrapw = 0.0f, wraprelw = 1.0f;
Represents the output window/screen of openMSX.
std::span< const std::string_view > getProperties() const override
static constexpr auto textProperties
OSDText(Display &display, const TclObject &name)
void getProperty(std::string_view name, TclObject &result) const override
void setProperty(Interpreter &interp, std::string_view name, const TclObject &value) override
std::string_view getType() const override
A frame buffer where pixels can be written to.
This file implemented 3 utility functions:
constexpr auto concatArray(const std::array< T, X > &x, const std::array< T, Y > &y)