FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
ftxui 命名空间参考

#include "ftxui/component/component_base.hpp" // 用于 ComponentBase 更多...

命名空间

namespace  animation
 FTXUI ftxui::animation:: 命名空间
 
namespace  box_helper
 
namespace  Container
 
namespace  Dimension
 定义屏幕的尺寸应如何呈现。
 
namespace  flexbox_helper
 
namespace  literals
 
namespace  task
 
namespace  Terminal
 
namespace  util
 

struct  AnimatedColorOption
 可能是动画颜色的选项。 更多...
 
struct  AnimatedColorsOption
 
class  AnimationTask
 
class  AutoReset
 为变量赋值,当超出作用域时恢复其旧值。 更多...
 
struct  Box
 Box是一个表示2D空间中矩形区域的结构体。 更多...
 
struct  ButtonOption
 AnimatedButton 组件的选项。 更多...
 
struct  Canvas
 Canvas 是一个与绘图操作相关的可绘制缓冲区。 更多...
 
class  CapturedMouseInterface
 
struct  CheckboxOption
 Checkbox 组件的选项。 更多...
 
class  Color
 Color 是一个表示终端用户界面中颜色的类。 更多...
 
struct  ColorInfo
 ColorInfo是一个包含终端颜色调色板信息的结构。 颜色调色板信息。 更多...
 
class  ComponentBase
 它将自身实现为 ftxui::Element。它通过响应 ftxui::Event 来实现键盘导航。 更多...
 
class  ConstRef
 一个适配器。拥有或引用一个不可变对象。 更多...
 
class  ConstStringListRef
 一个适配器。引用一个字符串列表。 更多...
 
class  ConstStringRef
 一个适配器。拥有或引用一个常量字符串。为了方便,这个 类将多个不可变字符串转换为共享表示。 更多...
 
struct  Dimensions
 Dimensions 是一个表示终端大小的结构。 更多...
 
struct  DropdownOption
 Dropdown 组件的选项。下拉菜单是打开/关闭单选框的复选框。 更多...
 
struct  EntryState
 来自 |ButtonOption|、|CheckboxOption|、 |RadioboxOption|、|MenuEntryOption|、|MenuOption| 的转换参数。 更多...
 
struct  Event
 代表一个事件。它可以是按键事件、终端大小调整等等... 更多...
 
struct  FlexboxConfig
 FlexboxConfig 是一个配置结构体,定义了弹性盒子容器的布局属性。 更多...
 
class  Image
 像素的矩形网格。 更多...
 
struct  InputOption
 Input 组件的选项。 更多...
 
struct  InputState
 用于定义 Input 组件的样式。 更多...
 
struct  LinearGradient
 一个表示线性渐变颜色效果设置的类。 更多...
 
class  Loop
 Loop 是一个管理组件事件循环的类。 更多...
 
struct  MenuEntryOption
 MenuEntry 组件的选项。 更多...
 
struct  MenuOption
 Menu 组件的选项。 更多...
 
struct  Mouse
 一个鼠标事件。它包含鼠标的坐标、按下的按钮以及修饰符(shift、ctrl、meta)。 更多...
 
class  Node
 Node 是 DOM 树中所有元素的基类。 更多...
 
class  NodeDecorator
 
struct  Pixel
 一个 Unicode 字符及其相关样式。 更多...
 
struct  RadioboxOption
 Radiobox 组件的选项。 更多...
 
class  ReceiverImpl
 
class  Ref
 一个适配器。拥有或引用一个可变对象。 更多...
 
struct  Requirement
 Requirement 是一个结构体,用于定义终端用户界面中 Node 的布局要求。 更多...
 
struct  ResizableSplitOption
 
class  Screen
 像素的矩形网格。 更多...
 
class  ScreenInteractive
 ScreenInteractive 是一个可以处理事件、运行主循环和管理组件的 Screen更多...
 
class  Selection
 代表终端用户界面中的选择。 更多...
 
class  SenderImpl
 
struct  SliderOption
 
class  StringRef
 一个适配器。拥有或引用一个常量字符串。为了方便,这个 类将多个可变字符串转换为共享表示。 更多...
 
class  Table
 Table 是一个绘制表格的实用工具。 更多...
 
class  TableSelection
 
class  TerminalInputParser
 
struct  UnderlineOption
 下划线效果的选项。 更多...
 
struct  WindowOptions
 
struct  WindowRenderState
 传递给 Window 组件渲染函数的 State。 更多...
 

类型定义

using CapturedMouse = std::unique_ptr<CapturedMouseInterface>
 
using ComponentDecorator = std::function<Component(Component)>
 
using ElementDecorator = std::function<Element(Element)>
 
using Component = std::shared_ptr<ComponentBase>
 
using Components = std::vector<Component>
 
template<class T >
using Sender = std::unique_ptr<SenderImpl<T>>
 
template<class T >
using Receiver = std::unique_ptr<ReceiverImpl<T>>
 
using Closure = std::function<void()>
 
using Task = std::variant<Event, Closure, AnimationTask>
 
using Element = std::shared_ptr<Node>
 
using Elements = std::vector<Element>
 
using Decorator = std::function<Element(Element)>
 
using GraphFunction = std::function<std::vector<int>(int, int)>
 

枚举

enum class  Direction {
  Up = 0 ,
  Down = 1 ,
  Left = 2 ,
  Right = 3
}
 Direction 是一个枚举,表示四个基本方向。 更多...
 
enum  BorderStyle {
  LIGHT ,
  DASHED ,
  HEAVY ,
  DOUBLE ,
  ROUNDED ,
  EMPTY
}
 BorderStyle 是一个枚举,表示可应用于终端 UI 中元素的不同边框样式。 更多...
 
enum  WidthOrHeight {
  WIDTH ,
  HEIGHT
}
 
enum  Constraint {
  LESS_THAN ,
  EQUAL ,
  GREATER_THAN
}
 
enum class  WordBreakProperty : int8_t {
  ALetter ,
  CR ,
  Double_Quote ,
  Extend ,
  ExtendNumLet ,
  Format ,
  Hebrew_Letter ,
  Katakana ,
  LF ,
  MidLetter ,
  MidNum ,
  MidNumLet ,
  Newline ,
  Numeric ,
  Regional_Indicator ,
  Single_Quote ,
  WSegSpace ,
  ZWJ
}
 

函数

template<class T , class... Args>
std::shared_ptr< T > Make (Args &&... args)
 
Component operator| (Component component, ComponentDecorator decorator)
 
Component operator| (Component component, ElementDecorator decorator)
 
Componentoperator|= (Component &component, ComponentDecorator decorator)
 
Componentoperator|= (Component &component, ElementDecorator decorator)
 
Component Button (ButtonOption option)
 绘制一个按钮。点击时执行一个函数。
 
Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
 绘制一个按钮。点击时执行一个函数。
 
Component Checkbox (CheckboxOption option)
 绘制可勾选元素。
 
Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
 绘制可勾选元素。
 
Component Input (InputOption option)
 用于编辑文本的输入框。
 
Component Input (StringRef content, InputOption option)
 用于编辑文本的输入框。
 
Component Input (StringRef content, StringRef placeholder, InputOption option)
 用于编辑文本的输入框。
 
Component Menu (MenuOption option)
 文本列表。選定的元素是焦點。
 
Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
 文本列表。選定的元素是焦點。
 
Component MenuEntry (MenuEntryOption option)
 一個特定的菜單條目。它們可以放入 Container::Vertical 中形成一個菜單。
 
Component MenuEntry (ConstStringRef label, MenuEntryOption option)
 一個特定的菜單條目。它們可以放入 Container::Vertical 中形成一個菜單。
 
Component Radiobox (RadioboxOption option)
 元素列表,其中只能选择一个。
 
Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
 元素列表,其中只能选择一个。
 
Component Dropdown (ConstStringListRef entries, int *selected)
 一个下拉菜单。
 
Component Dropdown (DropdownOption option)
 一个下拉菜单。
 
Component Toggle (ConstStringListRef entries, int *selected)
 元素的水平列表。用戶可以瀏覽它們。
 
template<typename T >
Component Slider (SliderOption< T > options)
 任意方向的滑块。
 
Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
 一个水平滑块。
 
Component Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
 
Component Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
 
Component ResizableSplit (ResizableSplitOption options)
 两个组件之间的分割。
 
Component ResizableSplitLeft (Component main, Component back, int *main_size)
 两个组件之间的水平分割,可通过鼠标配置。
 
Component ResizableSplitRight (Component main, Component back, int *main_size)
 两个组件之间的水平分割,可通过鼠标配置。
 
Component ResizableSplitTop (Component main, Component back, int *main_size)
 两个组件之间的垂直分割,可通过鼠标配置。
 
Component ResizableSplitBottom (Component main, Component back, int *main_size)
 两个组件之间的垂直分割,可通过鼠标配置。
 
Component Renderer (Component child, std::function< Element()> render)
 返回一个新组件,类似于 |child|,但使用 |render| 作为 Component::Render() 事件。
 
Component Renderer (std::function< Element()> render)
 返回一个组件,使用 |render| 来渲染其界面。
 
Component Renderer (std::function< Element(bool)> render)
 返回一个可聚焦的组件,使用 |render| 来渲染其界面。
 
ComponentDecorator Renderer (ElementDecorator decorator)
 装饰一个组件,通过装饰其渲染内容。
 
Component CatchEvent (Component child, std::function< bool(Event)>)
 
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
 装饰一个组件,使用|on_event|捕获事件。当事件已被处理时,此函数必须返回true,否则返回false。
 
Component Maybe (Component child, const bool *show)
 装饰一个组件 |child|。它仅在 |show| 为 true 时显示。
 
Component Maybe (Component child, std::function< bool()> show)
 装饰一个组件 |child|。它仅在 |show| 返回 true 时显示。 true。
 
ComponentDecorator Maybe (const bool *show)
 装饰一个组件。它仅在 |show| 为 true 时显示。
 
ComponentDecorator Maybe (std::function< bool()> show)
 装饰一个组件。它仅在 |show| 函数返回 true 时显示。 返回 true。
 
Component Modal (Component main, Component modal, const bool *show_modal)
 
ComponentDecorator Modal (Component modal, const bool *show_modal)
 
Component Collapsible (ConstStringRef label, Component child, Ref< bool > show=false)
 
Component Hoverable (Component component, bool *hover)
 
Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
 包装一个组件。使用回调。
 
Component Hoverable (Component component, std::function< void(bool)> on_change)
 包装一个组件。使其能够知道鼠标是否悬停在其上。
 
ComponentDecorator Hoverable (bool *hover)
 包装一个组件。使其能够知道鼠标是否悬停在其上。
 
ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
 包装一个组件。使其能够知道鼠标是否悬停在其上。
 
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
 包装一个组件。使其能够知道鼠标是否悬停在其上。
 
Component Window (WindowOptions option)
 一个可拖动/可调整大小的窗口。要使用多个窗口,它们必须 使用 Container::Stacked({...}) 组件进行堆叠;
 
template<class T >
Receiver< T > MakeReceiver ()
 
Element text (std::wstring text)
 显示一段Unicode文本。
 
Element vtext (std::wstring text)
 垂直显示一段Unicode文本。
 
Elements paragraph (std::wstring text)
 
Elementoperator|= (Element &e, Decorator d)
 对元素应用一个装饰器。
 
Elements operator| (Elements elements, Decorator decorator)
 从一组元素中,对每个元素应用一个装饰器。
 
Decorator operator| (Decorator a, Decorator b)
 将两个装饰器组合成一个。
 
Element text (std::string text)
 显示一段UTF8编码的Unicode文本。
 
Element vtext (std::string text)
 垂直显示一段Unicode文本。
 
Element separator ()
 在两个其他元素之间绘制垂直或水平分隔线。
 
Element separatorLight ()
 使用 LIGHT 样式在两个其他元素之间绘制垂直或水平分隔线。
 
Element separatorDashed ()
 使用 DASHED 样式在两个其他元素之间绘制垂直或水平分隔线。
 
Element separatorHeavy ()
 使用 HEAVY 样式在两个其他元素之间绘制垂直或水平分隔线。
 
Element separatorDouble ()
 使用 DOUBLE 样式在两个其他元素之间绘制垂直或水平分隔线。
 
Element separatorEmpty ()
 使用 EMPTY 样式在两个其他元素之间绘制垂直或水平分隔线。
 
Element separatorStyled (BorderStyle style)
 在两个其他元素之间绘制垂直或水平分隔线。
 
Element separator (Pixel pixel)
 在两个元素之间绘制用给定像素填充的分隔线。
 
Element separatorCharacter (std::string value)
 在两个其他元素之间绘制垂直或水平分隔线。
 
Element separatorHSelector (float left, float right, Color unselected_color, Color selected_color)
 绘制一个水平条,左右区域颜色不同。
 
Element separatorVSelector (float up, float down, Color unselected_color, Color selected_color)
 绘制一个垂直条,上下区域颜色不同。
 
Element gauge (float progress)
 绘制一个高清进度条。
 
Element gaugeLeft (float progress)
 绘制一个从右到左推进的高清进度条。
 
Element gaugeRight (float progress)
 绘制一个从左到右推进的高清进度条。
 
Element gaugeUp (float progress)
 绘制一个从下到上推进的高清进度条。
 
Element gaugeDown (float progress)
 绘制一个从上到下推进的高清进度条。
 
Element gaugeDirection (float progress, Direction direction)
 绘制一个向指定方向推进的高清进度条。
 
Element border (Element)
 
Element borderLight (Element)
 
Element borderDashed (Element)
 
Element borderHeavy (Element)
 
Element borderDouble (Element)
 
Element borderRounded (Element)
 
Element borderEmpty (Element)
 
Decorator borderStyled (BorderStyle)
 
Decorator borderStyled (BorderStyle, Color)
 
Decorator borderStyled (Color)
 
Decorator borderWith (const Pixel &)
 
Element window (Element title, Element content, BorderStyle border=ROUNDED)
 
Element spinner (int charset_index, size_t image_index)
 用于表示时间或事件的效果。这显示了一个 ASCII 艺术“视频”。
 
Element paragraph (const std::string &the_text)
 返回一个在多行上绘制段落的元素。
 
Element paragraphAlignLeft (const std::string &the_text)
 返回一个在多行上绘制段落并左对齐的元素。
 
Element paragraphAlignRight (const std::string &the_text)
 返回一个在多行上绘制段落并右对齐的元素。
 
Element paragraphAlignCenter (const std::string &the_text)
 返回一个在多行上绘制段落并居中对齐的元素。
 
Element paragraphAlignJustify (const std::string &the_text)
 返回一个在多行上绘制段落并使用两端对齐方式的元素。 居中对齐。
 
Element graph (GraphFunction graph_function)
 使用 GraphFunction 绘制图表。
 
Element emptyElement ()
 
Element canvas (ConstRef< Canvas > canvas)
 CanvasCanvas 引用生成元素。
 
Element canvas (int width, int height, std::function< void(Canvas &)> fn)
 生成一个绘制指定大小画布的元素。
 
Element canvas (std::function< void(Canvas &)> fn)
 生成一个绘制画布的元素。
 
Element bold (Element child)
 使用粗体字体,用于强调元素。
 
Element dim (Element child)
 使用浅色字体,用于不那么重要的元素。
 
Element italic (Element child)
 对文本应用双下划线。
 
Element inverted (Element child)
 添加一个过滤器,用于反转前景色和背景色。
 
Element underlined (Element child)
 给定元素加下划线。
 
Element underlinedDouble (Element child)
 对文本应用双下划线。
 
Element blink (Element child)
 绘制的文本在可见和隐藏之间交替。
 
Element strikethrough (Element child)
 对文本应用删除线。
 
Decorator color (Color c)
 使用前景色进行装饰。
 
Decorator bgcolor (Color color)
 使用背景色进行装饰。
 
Decorator color (const LinearGradient &)
 
Decorator bgcolor (const LinearGradient &)
 
Element color (Color color, Element child)
 设置元素的前景颜色。
 
Element bgcolor (Color color, Element child)
 设置元素的背景颜色。
 
Element color (const LinearGradient &, Element)
 
Element bgcolor (const LinearGradient &, Element)
 
Decorator focusPosition (int x, int y)
 frame 内部使用,这会强制视图滚动到给定位置。位置以单元格数量表示。
 
Decorator focusPositionRelative (float x, float y)
 frame 内部使用,这会强制视图滚动到给定位置。位置以请求大小的比例表示。
 
Element automerge (Element child)
 启用字符自动与附近的其它字符合并。
 
Decorator hyperlink (std::string link)
 使用超链接进行装饰。 当用户点击时,链接将被打开。 这仅在有限的终端模拟器中受支持。 列表:https://github.com/Alhadis/OSC8-Adoption/
 
Element hyperlink (std::string link, Element child)
 使渲染区域可通过网络浏览器点击。 当用户点击时,链接将被打开。 这仅在有限的终端模拟器中受支持。 列表:https://github.com/Alhadis/OSC8-Adoption/
 
Element selectionStyleReset (Element child)
 重置元素的选中样式。
 
Decorator selectionColor (Color foreground)
 设置元素选中时的颜色。
 
Decorator selectionBackgroundColor (Color foreground)
 设置元素选中时的背景颜色。 请注意,此样式是在现有样式之上应用的。
 
Decorator selectionForegroundColor (Color foreground)
 设置元素选中时的前景色。 请注意,此样式是在现有样式之上应用的。
 
Decorator selectionStyle (std::function< void(Pixel &)> style)
 设置元素选中时的样式。
 
Element hbox (Elements children)
 一个按水平顺序逐一显示元素的容器。
 
Element vbox (Elements children)
 垂直一个接一个显示元素的容器。
 
Element dbox (Elements children_)
 将多个元素堆叠在一起。
 
Element flexbox (Elements children, FlexboxConfig config)
 一个容器,用于在行/列中显示元素,并且在填满时能够换行到下一列/行。
 
Element gridbox (std::vector< Elements > lines)
 一个显示元素网格的容器。
 
Element hflow (Elements children)
 一个容器,用于从左到右在行中显示元素。当填满时,它会在下方开始新的一行。
 
Element vflow (Elements children)
 一个容器,用于从上到下在行中显示元素。当填满时,它会在右侧开始新的一列。
 
Element flex (Element child)
 使子元素按比例扩展以填充容器中剩余的空间。
 
Element flex_grow (Element child)
 如果可能,进行扩展。
 
Element flex_shrink (Element child)
 如果需要,进行收缩。
 
Element xflex (Element child)
 在 X 轴上尽可能地扩展/收缩。
 
Element xflex_grow (Element child)
 如果可能,在 X 轴上进行扩展。
 
Element xflex_shrink (Element child)
 如果需要,在 X 轴上进行收缩。
 
Element yflex (Element child)
 在 Y 轴上尽可能地扩展/收缩。
 
Element yflex_grow (Element child)
 如果可能,在 Y 轴上进行扩展。
 
Element yflex_shrink (Element child)
 如果需要,在 Y 轴上进行收缩。
 
Element notflex (Element child)
 使元素不可伸缩。
 
Element filler ()
 一个元素,它将按比例扩展以填充容器中剩余的空间。
 
Decorator size (WidthOrHeight direction, Constraint constraint, int value)
 对元素大小应用约束。
 
Element frame (Element child)
 允许元素显示在“虚拟”区域内。其大小可以 大于其容器。在这种情况下,只显示较小的部分。 视图是可滚动的,以使获得焦点的元素可见。
 
Element xframe (Element child)
 frame 相同,但仅限于 x 轴。
 
Element yframe (Element child)
 frame 相同,但仅限于 y 轴。
 
Element focus (Element child)
 child 设置为其同级元素中获得焦点的元素。
 
Element select (Element child)
 child 设置为其同级元素中获得焦点的元素。
 
Element focusCursorBlock (Element)
 
Element focusCursorBlockBlinking (Element)
 
Element focusCursorBar (Element)
 
Element focusCursorBarBlinking (Element)
 
Element focusCursorUnderline (Element)
 
Element focusCursorUnderlineBlinking (Element)
 
Element vscroll_indicator (Element child)
 在右侧显示一个垂直滚动条。 颜色跟随内容。
 
Element hscroll_indicator (Element child)
 在底部显示一个水平滚动条。 颜色跟随内容。
 
Decorator reflect (Box &box)
 
Element clear_under (Element element)
 在绘制 |child| 之前,清除下方的像素。这与 dbox 结合使用很有用。
 
Element hcenter (Element child)
 水平居中一个元素。
 
Element vcenter (Element child)
 垂直居中一个元素。
 
Element center (Element child)
 水平并垂直居中一个元素。
 
Element align_right (Element child)
 将元素右对齐。
 
Element nothing (Element element)
 一个什么都不做的装饰器。
 
void Render (Screen &screen, const Element &element)
 ftxui::Screen 上显示元素。
 
void Render (Screen &screen, Node *node)
 ftxui::Screen 上显示元素。
 
void Render (Screen &screen, Node *node, Selection &selection)
 
std::string GetNodeSelectedContent (Screen &screen, Node *node, Selection &selection)
 
Color operator""_rgb (unsigned long long int combined)
 从组合的十六进制 RGB 表示创建颜色, 例如 0x808000_rgb
 
ColorInfo GetColorInfo (Color::Palette256 index)
 
ColorInfo GetColorInfo (Color::Palette16 index)
 
int wchar_width (wchar_t)
 
int wstring_width (const std::wstring &)
 
std::string to_string (const std::wstring &s)
 将 std::wstring 转换为 UTF8 std::string。
 
std::wstring to_wstring (const std::string &s)
 将 UTF8 std::string 转换为 std::wstring。
 
template<typename T >
std::wstring to_wstring (T s)
 
int string_width (const std::string &)
 
std::vector< std::string > Utf8ToGlyphs (const std::string &input)
 
std::vector< int > CellToGlyphIndex (const std::string &input)
 
Component CatchEvent (Component child, std::function< bool(Event event)> on_event)
 返回一个组件,使用|on_event|捕获事件。当事件已被处理时,此函数必须返回true,否则返回false。
 
template Component Slider (SliderOption< int8_t >)
 
template Component Slider (SliderOption< int16_t >)
 
template Component Slider (SliderOption< int32_t >)
 
template Component Slider (SliderOption< int64_t >)
 
template Component Slider (SliderOption< uint8_t >)
 
template Component Slider (SliderOption< uint16_t >)
 
template Component Slider (SliderOption< uint32_t >)
 
template Component Slider (SliderOption< uint64_t >)
 
template Component Slider (SliderOption< float >)
 
template Component Slider (SliderOption< double >)
 
Element operator| (Element element, Decorator decorator)
 从一个元素中,应用一个装饰器。
 
bool EatCodePoint (const std::string &input, size_t start, size_t *end, uint32_t *ucs)
 
bool EatCodePoint (const std::wstring &input, size_t start, size_t *end, uint32_t *ucs)
 
bool IsCombining (uint32_t ucs)
 
bool IsFullWidth (uint32_t ucs)
 
bool IsControl (uint32_t ucs)
 
WordBreakProperty CodepointToWordBreakProperty (uint32_t codepoint)
 
size_t GlyphPrevious (const std::string &input, size_t start)
 
size_t GlyphNext (const std::string &input, size_t start)
 
size_t GlyphIterate (const std::string &input, int glyph_offset, size_t start)
 
int GlyphCount (const std::string &input)
 
std::vector< WordBreakPropertyUtf8ToWordBreakProperty (const std::string &input)
 
bool IsWordBreakingCharacter (const std::string &input, size_t glyph_index)
 

变量

const std::map< std::string, std::string > g_uniformize
 
const std::array< ColorInfo, 256 > palette256
 

详细描述

#include "ftxui/component/component_base.hpp" // 用于 ComponentBase

FTXUI 的 ftxui:: 命名空间

FTXUI ftxui::命名空间

FTXUI ftxui:: 命名空间

类型定义说明

◆ CapturedMouse

using CapturedMouse = std::unique_ptr<CapturedMouseInterface>

在文件 captured_mouse.hpp20 行定义.

◆ ComponentDecorator

using ComponentDecorator = std::function<Component(Component)>

在文件 component.hpp32 行定义.

◆ ElementDecorator

using ElementDecorator = std::function<Element(Element)>

在文件 component.hpp33 行定义.

◆ Component

typedef std::shared_ptr< ComponentBase > Component = std::shared_ptr<ComponentBase>

在文件 component_base.hpp23 行定义.

◆ Components

using Components = std::vector<Component>

在文件 component_base.hpp24 行定义.

◆ Sender

template<class T >
using Sender = std::unique_ptr<SenderImpl<T>>

在文件 receiver.hpp51 行定义.

◆ Receiver

template<class T >
using Receiver = std::unique_ptr<ReceiverImpl<T>>

在文件 receiver.hpp53 行定义.

◆ Closure

using Closure = std::function<void()>

在文件 task.hpp12 行定义.

◆ Task

using Task = std::variant<Event, Closure, AnimationTask>

在文件 task.hpp13 行定义.

◆ Element

typedef std::shared_ptr< Node > Element = std::shared_ptr<Node>

在文件 elements.hpp22 行定义.

◆ Elements

typedef std::vector< Element > Elements = std::vector<Element>

在文件 elements.hpp23 行定义.

◆ Decorator

using Decorator = std::function<Element(Element)>

在文件 elements.hpp24 行定义.

◆ GraphFunction

using GraphFunction = std::function<std::vector<int>(int, int)>

在文件 elements.hpp25 行定义.

枚举类型说明

◆ WidthOrHeight

枚举值
WIDTH 
HEIGHT 

在文件 elements.hpp157 行定义.

◆ Constraint

enum Constraint
枚举值
LESS_THAN 
EQUAL 
GREATER_THAN 

在文件 elements.hpp158 行定义.

◆ WordBreakProperty

enum class WordBreakProperty : int8_t
strong
枚举值
ALetter 
CR 
Double_Quote 
Extend 
ExtendNumLet 
Format 
Hebrew_Letter 
Katakana 
LF 
MidLetter 
MidNum 
MidNumLet 
Newline 
Numeric 
Regional_Indicator 
Single_Quote 
WSegSpace 
ZWJ 

在文件 string_internal.hpp38 行定义.

函数说明

◆ Make()

template<class T , class... Args>
std::shared_ptr< T > Make ( Args &&... args)

在文件 component.hpp27 行定义.

◆ operator|() [1/2]

Component operator| ( Component component,
ComponentDecorator decorator )

在文件 component/util.cpp11 行定义.

◆ operator|() [2/2]

Component operator| ( Component component,
ElementDecorator decorator )

在文件 component/util.cpp16 行定义.

◆ operator|=() [1/2]

Component & operator|= ( Component & component,
ComponentDecorator decorator )

在文件 component/util.cpp21 行定义.

◆ operator|=() [2/2]

Component & operator|= ( Component & component,
ElementDecorator decorator )

在文件 component/util.cpp27 行定义.

◆ Slider() [1/13]

template<typename T >
Component Slider ( SliderOption< T > options)

任意方向的滑块。

参数
options选项

示例

int value = 50;
auto slider = Slider({
.value = &value,
.min = 0,
.max = 100,
.increment= 20,
});
screen.Loop(slider);
static ScreenInteractive TerminalOutput()
Component Slider(SliderOption< T > options)
任意方向的滑块。

在文件 src/ftxui/component/slider.cpp316 行定义.

◆ Slider() [2/13]

Component Slider ( ConstStringRef label,
Ref< float > value,
ConstRef< float > min = 0.f,
ConstRef< float > max = 100.f,
ConstRef< float > increment = 5.f )

在文件 src/ftxui/component/slider.cpp273 行定义.

◆ Slider() [3/13]

Component Slider ( ConstStringRef label,
Ref< long > value,
ConstRef< long > min = 0L,
ConstRef< long > max = 100L,
ConstRef< long > increment = 5L )

在文件 src/ftxui/component/slider.cpp286 行定义.

◆ ResizableSplit()

Component ResizableSplit ( ResizableSplitOption options)

两个组件之间的分割。

参数
options所有参数。

Example

auto left = Renderer([] { return text("Left") | center;});
auto right = Renderer([] { return text("right") | center;});
int left_size = 10;
auto component = ResizableSplit({
.main = left,
.back = right,
.direction = Direction::Left,
.main_size = &left_size,
.separator_func = [] { return separatorDouble(); },
});
Component Renderer(Component child, std::function< Element()>)
返回一个新组件,类似于 |child|,但使用 |render| 作为 Component::Render() 事件。
Element center(Element)
水平并垂直居中一个元素。
Element text(std::wstring text)
显示一段Unicode文本。
Element separatorDouble()
使用 DOUBLE 样式在两个其他元素之间绘制垂直或水平分隔线。
Component ResizableSplit(ResizableSplitOption options)
两个组件之间的分割。
std::uint8_t left
std::uint8_t right

Output

left ║ right

在文件 src/ftxui/component/resizable_split.cpp169 行定义.

◆ CatchEvent()

Component CatchEvent ( Component child,
std::function< bool(Event)>  )

◆ Collapsible()

Component Collapsible ( ConstStringRef label,
Component child,
Ref< bool > show = false )

◆ MakeReceiver()

template<class T >
Receiver< T > MakeReceiver ( )

在文件 receiver.hpp148 行定义.

◆ paragraph()

Elements paragraph ( std::wstring text)

◆ separatorHSelector()

Element separatorHSelector ( float left,
float right,
Color unselected_color,
Color selected_color )

绘制一个水平条,左右区域颜色不同。

参数
left活动区域的左侧限制。
right活动区域的右侧限制。
selected_color选定区域的颜色。
unselected_color未选定区域的颜色。

示例

std::shared_ptr< Node > Element
Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
绘制一个水平条,左右区域颜色不同。

在文件 src/ftxui/dom/separator.cpp432 行定义.

◆ separatorVSelector()

Element separatorVSelector ( float up,
float down,
Color unselected_color,
Color selected_color )

绘制一个垂直条,上下区域颜色不同。

参数
up活动区域的左侧限制。
down活动区域的右侧限制。
selected_color选定区域的颜色。
unselected_color未选定区域的颜色。

示例

在文件 src/ftxui/dom/separator.cpp501 行定义.

◆ gauge()

Element gauge ( float progress)

绘制一个高清进度条。

参数
progress要填充区域的比例。范围在 [0,1] 之间。

示例

一个仪表盘。它可以用来表示进度条。

Element border(Element)
Element gauge(float progress)
绘制一个高清进度条。

输出

┌──────────────────────────────────────────────────────────────────────────┐
│█████████████████████████████████████ │
└──────────────────────────────────────────────────────────────────────────┘

在文件 src/ftxui/dom/gauge.cpp284 行定义.

◆ gaugeLeft()

Element gaugeLeft ( float progress)

绘制一个从右到左推进的高清进度条。

参数
progress要填充区域的比例。范围在 [0,1] 之间。

示例

一个仪表盘。它可以用来表示进度条。

Element gaugeLeft(float progress)
绘制一个从右到左推进的高清进度条。

输出

┌──────────────────────────────────────────────────────────────────────────┐
│ █████████████████████████████████████│
└──────────────────────────────────────────────────────────────────────────┘

在文件 src/ftxui/dom/gauge.cpp207 行定义.

◆ gaugeRight()

Element gaugeRight ( float progress)

绘制一个从左到右推进的高清进度条。

参数
progress要填充区域的比例。范围在 [0,1] 之间。

示例

一个仪表盘。它可以用来表示进度条。

Element gaugeRight(float progress)
绘制一个从左到右推进的高清进度条。

输出

┌──────────────────────────────────────────────────────────────────────────┐
│█████████████████████████████████████ │
└──────────────────────────────────────────────────────────────────────────┘

在文件 src/ftxui/dom/gauge.cpp186 行定义.

◆ gaugeUp()

Element gaugeUp ( float progress)

绘制一个从下到上推进的高清进度条。

参数
progress要填充区域的比例。范围在 [0,1] 之间。

示例

一个仪表盘。它可以用来表示进度条。

Element gaugeUp(float progress)
绘制一个从下到上推进的高清进度条。

输出

┌─┐
│ │
│ │
│ │
│ │
│█│
│█│
│█│
│█│
└─┘

在文件 src/ftxui/dom/gauge.cpp235 行定义.

◆ gaugeDown()

Element gaugeDown ( float progress)

绘制一个从上到下推进的高清进度条。

参数
progress要填充区域的比例。范围在 [0,1] 之间。

示例

一个仪表盘。它可以用来表示进度条。

Element gaugeDown(float progress)
绘制一个从上到下推进的高清进度条。

输出

┌─┐
│█│
│█│
│█│
│█│
│ │
│ │
│ │
│ │
└─┘

在文件 src/ftxui/dom/gauge.cpp263 行定义.

◆ border()

Element border ( Element )

◆ borderLight()

Element borderLight ( Element )

◆ borderDashed()

Element borderDashed ( Element )

◆ borderHeavy()

Element borderHeavy ( Element )

◆ borderDouble()

Element borderDouble ( Element )

◆ borderRounded()

Element borderRounded ( Element )

◆ borderEmpty()

Element borderEmpty ( Element )

◆ borderStyled() [1/3]

Decorator borderStyled ( BorderStyle )

◆ borderStyled() [2/3]

Decorator borderStyled ( BorderStyle ,
Color  )

◆ borderStyled() [3/3]

Decorator borderStyled ( Color )

◆ borderWith()

Decorator borderWith ( const Pixel & )

◆ window()

Element window ( Element title,
Element content,
BorderStyle border = ROUNDED )

◆ graph()

Element graph ( GraphFunction graph_function)

使用 GraphFunction 绘制图表。

参数
graph_function用于获取数据的函数。

在文件 src/ftxui/dom/graph.cpp69 行定义.

◆ canvas() [1/3]

Element canvas ( ConstRef< Canvas > canvas)

CanvasCanvas 引用生成元素。

在文件 src/ftxui/dom/canvas.cpp890 行定义.

◆ canvas() [2/3]

Element canvas ( int width,
int height,
std::function< void(Canvas &)> fn )

生成一个绘制指定大小画布的元素。

参数
width画布的宽度。
height画布的高度。
fn绘制画布的函数。

在文件 src/ftxui/dom/canvas.cpp907 行定义.

◆ canvas() [3/3]

Element canvas ( std::function< void(Canvas &)> fn)

生成一个绘制画布的元素。

参数
fn绘制画布的函数。

在文件 src/ftxui/dom/canvas.cpp937 行定义.

◆ color() [1/2]

Decorator color ( const LinearGradient & )

◆ bgcolor() [1/2]

Decorator bgcolor ( const LinearGradient & )

◆ color() [2/2]

Element color ( const LinearGradient & ,
Element  )

◆ bgcolor() [2/2]

Element bgcolor ( const LinearGradient & ,
Element  )

◆ selectionStyleReset()

Element selectionStyleReset ( Element child)

重置元素的选中样式。

参数
child输入元素。
返回
重置选中样式的输出元素。

在文件 selection_style.cpp54 行定义.

◆ selectionColor()

Decorator selectionColor ( Color foreground)

设置元素选中时的颜色。

参数
foreground要应用的颜色。 请注意,此样式是在现有样式之上应用的。

在文件 selection_style.cpp77 行定义.

◆ selectionBackgroundColor()

Decorator selectionBackgroundColor ( Color foreground)

设置元素选中时的背景颜色。 请注意,此样式是在现有样式之上应用的。

在文件 selection_style.cpp60 行定义.

◆ selectionForegroundColor()

Decorator selectionForegroundColor ( Color foreground)

设置元素选中时的前景色。 请注意,此样式是在现有样式之上应用的。

在文件 selection_style.cpp68 行定义.

◆ selectionStyle()

Decorator selectionStyle ( std::function< void(Pixel &)> style)

设置元素选中时的样式。

参数
style要应用的样式。 请注意,此样式是在现有样式之上应用的。

在文件 selection_style.cpp85 行定义.

◆ hbox()

Element hbox ( Elements children)

一个按水平顺序逐一显示元素的容器。

参数
children容器中的元素
返回
容器。

示例

text("Left"),
text("Right"),
});
Element hbox(Elements)
一个按水平顺序逐一显示元素的容器。

在文件 hbox.cpp94 行定义.

◆ flexbox()

Element flexbox ( Elements children,
FlexboxConfig config )

一个容器,用于在行/列中显示元素,并且在填满时能够换行到下一列/行。

参数
children容器中的元素
config选项
返回
容器。

Example

text("element 1"),
text("element 2"),
text("element 3"),
}, FlexboxConfig()
.SetGapMainAxis(1)
.SetGapCrossAxis(1)
)
@ Column
弹性项目按列排列。
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
一个容器,用于在行/列中显示元素,并且在填满时能够换行到下一列/行。

在文件 flexbox.cpp249 行定义.

◆ gridbox()

Element gridbox ( std::vector< Elements > lines)

一个显示元素网格的容器。

参数
lines行的列表,每行都是元素的列表。
返回
容器。

示例

auto cell = [](const char* t) { return text(t) | border; };
auto document = gridbox({
{cell("north-west") , cell("north") , cell("north-east")} ,
{cell("west") , cell("center") , cell("east")} ,
{cell("south-west") , cell("south") , cell("south-east")} ,
});
Element gridbox(std::vector< Elements > lines)
一个显示元素网格的容器。

Output:

╭──────────╮╭──────╮╭──────────╮
│north-west││north ││north-east│
╰──────────╯╰──────╯╰──────────╯
╭──────────╮╭──────╮╭──────────╮
│west ││center││east │
╰──────────╯╰──────╯╰──────────╯
╭──────────╮╭──────╮╭──────────╮
│south-west││south ││south-east│
╰──────────╯╰──────╯╰──────────╯

在文件 src/ftxui/dom/gridbox.cpp172 行定义.

◆ hflow()

Element hflow ( Elements children)

一个容器,用于从左到右在行中显示元素。当填满时,它会在下方开始新的一行。

参数
children容器中的元素
返回
容器。

Example

text("element 1"),
text("element 2"),
text("element 3"),
});
Element hflow(Elements)
一个容器,用于从左到右在行中显示元素。当填满时,它会在下方开始新的一行。

在文件 flexbox.cpp266 行定义.

◆ vflow()

Element vflow ( Elements children)

一个容器,用于从上到下在行中显示元素。当填满时,它会在右侧开始新的一列。

参数
children容器中的元素
返回
容器。

Example

text("element 1"),
text("element 2"),
text("element 3"),
});
Element vflow(Elements)
一个容器,用于从上到下在行中显示元素。当填满时,它会在右侧开始新的一列。

在文件 flexbox.cpp283 行定义.

◆ frame()

Element frame ( Element child)

允许元素显示在“虚拟”区域内。其大小可以 大于其容器。在这种情况下,只显示较小的部分。 视图是可滚动的,以使获得焦点的元素可见。

参见
frame
xframe
yframe

在文件 frame.cpp117 行定义.

◆ xframe()

Element xframe ( Element child)

frame 相同,但仅限于 x 轴。

参见
frame
xframe
yframe

在文件 frame.cpp125 行定义.

◆ yframe()

Element yframe ( Element child)

frame 相同,但仅限于 y 轴。

参见
frame
xframe
yframe

在文件 frame.cpp133 行定义.

◆ select()

Element select ( Element child)

child 设置为其同级元素中获得焦点的元素。

此功能已弃用。请改用 focus

参数
child要获得焦点的元素。

在文件 frame.cpp107 行定义.

◆ focusCursorBlock()

Element focusCursorBlock ( Element )

◆ focusCursorBlockBlinking()

Element focusCursorBlockBlinking ( Element )

◆ focusCursorBar()

Element focusCursorBar ( Element )

◆ focusCursorBarBlinking()

Element focusCursorBarBlinking ( Element )

◆ focusCursorUnderline()

Element focusCursorUnderline ( Element )

◆ focusCursorUnderlineBlinking()

Element focusCursorUnderlineBlinking ( Element )

◆ reflect()

Decorator reflect ( Box & box)

在文件 reflect.cpp43 行定义.

◆ Render()

void Render ( Screen & screen,
Node * node,
Selection & selection )

在文件 node.cpp96 行定义.

◆ GetNodeSelectedContent()

std::string GetNodeSelectedContent ( Screen & screen,
Node * node,
Selection & selection )

在文件 node.cpp167 行定义.

◆ GetColorInfo() [1/2]

ColorInfo GetColorInfo ( Color::Palette256 index)

在文件 color_info.cpp271 行定义.

◆ GetColorInfo() [2/2]

ColorInfo GetColorInfo ( Color::Palette16 index)

在文件 color_info.cpp275 行定义.

◆ wchar_width()

int wchar_width ( wchar_t ucs)

在文件 string.cpp1311 行定义.

◆ wstring_width()

int wstring_width ( const std::wstring & text)

在文件 string.cpp1315 行定义.

◆ to_string()

std::string to_string ( const std::wstring & s)

将 std::wstring 转换为 UTF8 std::string。

在文件 string.cpp1563 行定义.

◆ to_wstring() [1/2]

std::wstring to_wstring ( const std::string & s)

将 UTF8 std::string 转换为 std::wstring。

在文件 string.cpp1635 行定义.

◆ to_wstring() [2/2]

template<typename T >
std::wstring to_wstring ( T s)

在文件 string.hpp15 行定义.

◆ string_width()

int string_width ( const std::string & input)

在文件 string.cpp1328 行定义.

◆ Utf8ToGlyphs()

std::vector< std::string > Utf8ToGlyphs ( const std::string & input)

在文件 string.cpp1355 行定义.

◆ CellToGlyphIndex()

std::vector< int > CellToGlyphIndex ( const std::string & input)

在文件 string.cpp1462 行定义.

◆ Slider() [4/13]

template Component Slider ( SliderOption< int8_t > )

◆ Slider() [5/13]

template Component Slider ( SliderOption< int16_t > )

◆ Slider() [6/13]

template Component Slider ( SliderOption< int32_t > )

◆ Slider() [7/13]

template Component Slider ( SliderOption< int64_t > )

◆ Slider() [8/13]

template Component Slider ( SliderOption< uint8_t > )

◆ Slider() [9/13]

template Component Slider ( SliderOption< uint16_t > )

◆ Slider() [10/13]

template Component Slider ( SliderOption< uint32_t > )

◆ Slider() [11/13]

template Component Slider ( SliderOption< uint64_t > )

◆ Slider() [12/13]

template Component Slider ( SliderOption< float > )

◆ Slider() [13/13]

template Component Slider ( SliderOption< double > )

◆ EatCodePoint() [1/2]

bool EatCodePoint ( const std::string & input,
size_t start,
size_t * end,
uint32_t * ucs )

在文件 string.cpp1172 行定义.

◆ EatCodePoint() [2/2]

bool EatCodePoint ( const std::wstring & input,
size_t start,
size_t * end,
uint32_t * ucs )

在文件 string.cpp1241 行定义.

◆ IsCombining()

bool IsCombining ( uint32_t ucs)

在文件 string.cpp1279 行定义.

◆ IsFullWidth()

bool IsFullWidth ( uint32_t ucs)

在文件 string.cpp1283 行定义.

◆ IsControl()

bool IsControl ( uint32_t ucs)

在文件 string.cpp1291 行定义.

◆ CodepointToWordBreakProperty()

WordBreakProperty CodepointToWordBreakProperty ( uint32_t codepoint)

在文件 string.cpp1305 行定义.

◆ GlyphPrevious()

size_t GlyphPrevious ( const std::string & input,
size_t start )

在文件 string.cpp1397 行定义.

◆ GlyphNext()

size_t GlyphNext ( const std::string & input,
size_t start )

在文件 string.cpp1422 行定义.

◆ GlyphIterate()

size_t GlyphIterate ( const std::string & input,
int glyph_offset,
size_t start )

在文件 string.cpp1448 行定义.

◆ GlyphCount()

int GlyphCount ( const std::string & input)

在文件 string.cpp1503 行定义.

◆ Utf8ToWordBreakProperty()

std::vector< WordBreakProperty > Utf8ToWordBreakProperty ( const std::string & input)

在文件 string.cpp1531 行定义.

◆ IsWordBreakingCharacter()

bool IsWordBreakingCharacter ( const std::string & input,
size_t glyph_index )

变量说明

◆ g_uniformize

const std::map<std::string, std::string> g_uniformize

在文件 terminal_input_parser.cpp19 行定义.

◆ palette256

const std::array<ColorInfo, 256> palette256

在文件 color_info.cpp12 行定义.