14const std::string charset[][2] = {
22class Separator :
public Node {
24 Separator(std::string value) : value_(value) {}
26 void ComputeRequirement()
override {
31 void Render(Screen& screen)
override {
34 screen.PixelAt(x, y).character = value_;
42class SeparatorAuto :
public Node {
46 void ComputeRequirement()
override {
51 void Render(Screen& screen)
override {
55 const std::string c = charset[style_][is_line && !is_column];
59 screen.PixelAt(x, y).character = c;
67class SeparatorWithPixel :
public SeparatorAuto {
69 SeparatorWithPixel(Pixel pixel) : SeparatorAuto(
LIGHT), pixel_(pixel) {}
70 void Render(Screen& screen)
override {
73 screen.PixelAt(x, y) = pixel_;
115 return std::make_shared<SeparatorAuto>(
LIGHT);
152 return std::make_shared<SeparatorAuto>(style);
188 return std::make_shared<SeparatorAuto>(
LIGHT);
224 return std::make_shared<SeparatorAuto>(
HEAVY);
260 return std::make_shared<SeparatorAuto>(
DOUBLE);
296 return std::make_shared<SeparatorAuto>(
EMPTY);
333 return std::make_shared<Separator>(value);
363 return std::make_shared<SeparatorWithPixel>(pixel);
A rectangular grid of Pixel.
Element separatorStyled(BorderStyle)
Draw a vertical or horizontal separation in between two other elements.
Element separatorEmpty()
Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
std::shared_ptr< Node > Element
Element separatorLight()
Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
Element separatorCharacter(std::string)
Draw a vertical or horizontal separation in between two other elements.
Element separator(void)
Draw a vertical or horizontal separation in between two other elements.
Element separatorDouble()
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
Element separatorHeavy()
Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
A unicode character and its associated style.