FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
ftxui Namespace Reference

FTXUI 的 ftxui:: 命名空間 More...

Namespaces

namespace  animation
 FTXUI ftxui::animation:: 命名空間
 
namespace  box_helper
 
namespace  Container
 
namespace  Dimension
 定義螢幕的維度外觀。
 
namespace  flexbox_helper
 
namespace  literals
 
namespace  task
 
namespace  Terminal
 
namespace  util
 

Classes

struct  AnimatedColorOption
 關於潛在動畫顏色的選項。 More...
 
struct  AnimatedColorsOption
 
class  AnimationTask
 
class  AutoReset
 將一個值賦給一個變數,當超出作用域時,將其舊值重置。 More...
 
struct  Box
 Box 是一個表示二維空間中矩形區域的結構。 More...
 
struct  ButtonOption
 AnimatedButton 元件的選項。 More...
 
struct  Canvas
 畫布是與繪圖操作相關聯的可繪製緩衝區。 More...
 
class  CapturedMouseInterface
 
struct  CheckboxOption
 核取方塊元件的選項。 More...
 
class  Color
 Color 是一個在終端使用者介面中表示顏色的類別。 More...
 
struct  ColorInfo
 ColorInfo 是一個結構,包含有關終端機 顏色調色盤的資訊。 More...
 
class  ComponentBase
 它將自己實作為 ftxui::Element 進行渲染。它透過回應 ftxui::Event 來實現鍵盤導航。 More...
 
class  ConstRef
 一個適配器。擁有或引用一個不可變的物件。 More...
 
class  ConstStringListRef
 一個適配器。引用一個字串列表。 More...
 
class  ConstStringRef
 一個適配器。擁有或引用一個常數字串。為方便起見,此類別將多個不可變字串轉換為共享表示。 More...
 
struct  Dimensions
 Dimensions 是一個表示終端機大小的結構 More...
 
struct  DropdownOption
 Dropdown 元件的選項。下拉式選單是開啟/關閉單選方塊的核取方塊。 More...
 
struct  EntryState
 來自 |ButtonOption|、|CheckboxOption|、 |RadioboxOption|、|MenuEntryOption|、|MenuOption| 的轉換參數。 More...
 
struct  Event
 代表一個事件。它可以是按鍵事件、終端機大小調整,或更多... More...
 
struct  FlexboxConfig
 FlexboxConfig 是一個配置結構,用於定義彈性盒容器的佈局屬性。 More...
 
class  Image
 像素的矩形網格。 More...
 
struct  InputOption
 Input 元件的選項。 More...
 
struct  InputState
 用於定義 Input 元件的樣式。 More...
 
struct  LinearGradient
 表示線性漸變顏色效果設定的類別。 More...
 
class  Loop
 Loop 是一個用於管理元件事件循環的類別。 More...
 
struct  MenuEntryOption
 MenuEntry 元件的選項。 More...
 
struct  MenuOption
 Menu 元件的選項。 More...
 
struct  Mouse
 滑鼠事件。它包含滑鼠的座標、按下的按鈕 以及修飾鍵(shift、ctrl、meta)。 More...
 
class  Node
 節點是DOM樹中所有元素的基底類別。 More...
 
class  NodeDecorator
 
struct  Pixel
 一個 Unicode 字元及其相關樣式。 More...
 
struct  RadioboxOption
 Radiobox 元件的選項。 More...
 
class  ReceiverImpl
 
class  Ref
 一個適配器。擁有或引用一個可變的物件。 More...
 
struct  Requirement
 Requirement 是一個結構,定義了終端使用者介面中節點的佈局要求。 More...
 
struct  ResizableSplitOption
 
class  Screen
 像素的矩形網格。 More...
 
class  ScreenInteractive
 ScreenInteractive 是一個可以處理事件、執行主迴圈並管理組件的 ScreenMore...
 
class  Selection
 表示終端機使用者介面中的選取範圍。 More...
 
class  SenderImpl
 
struct  SliderOption
 
class  StringRef
 一個適配器。擁有或引用一個常數字串。為方便起見,此類別將多個可變字串轉換為共享表示。 More...
 
class  Table
 Table 是一個用於繪製表格的工具。 More...
 
class  TableSelection
 
class  TerminalInputParser
 
struct  UnderlineOption
 底線效果的選項。 More...
 
struct  WindowOptions
 
struct  WindowRenderState
 傳遞給 Window 元件渲染函式的狀態。 More...
 

Typedefs

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)>
 

Enumerations

enum class  Direction {
  Up = 0 ,
  Down = 1 ,
  Left = 2 ,
  Right = 3
}
 Direction 是一個列舉,表示四個主要方向。 More...
 
enum  BorderStyle {
  LIGHT ,
  DASHED ,
  HEAVY ,
  DOUBLE ,
  ROUNDED ,
  EMPTY
}
 BorderStyle 是一個列舉,表示可以應用於終端機 UI 元素的不同邊框樣式。 More...
 
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
}
 

Functions

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 options)
 
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 時顯示。
 
ComponentDecorator Maybe (const bool *show)
 裝飾一個組件。它只在 |show| 為 true 時顯示。
 
ComponentDecorator Maybe (std::function< bool()> show)
 裝飾一個組件。它只在 |show| 函數返回 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)
 可折疊元件。它顯示一個帶有箭頭的核取方塊。一旦啟用,子元件就會顯示。
 
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)
 
Element operator| (Element element, Decorator decorator)
 從一個元素中,應用一個裝飾器。
 
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 separatorRounded ()
 
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 child)
 在元素周圍繪製邊框。
 
Element borderLight (Element child)
 在元素周圍繪製細邊框。
 
Element borderDashed (Element child)
 在元素周圍繪製虛線邊框。
 
Element borderHeavy (Element child)
 在元素周圍繪製粗邊框。
 
Element borderDouble (Element child)
 在元素周圍繪製雙線邊框。
 
Element borderRounded (Element child)
 在元素周圍繪製圓角邊框。
 
Element borderEmpty (Element child)
 在元素周圍繪製空邊框。
 
Decorator borderStyled (BorderStyle style)
 與 border 相同,但具有不同的樣式。
 
Decorator borderStyled (BorderStyle style, Color foreground_color)
 與 border 相同,但具有前景色和不同的樣式。
 
Decorator borderStyled (Color foreground_color)
 與 border 相同,但具有前景色。
 
Decorator borderWith (const Pixel &pixel)
 與 border 相同,但在元素周圍使用恆定的像素。
 
Element window (Element title, Element content, BorderStyle border)
 繪製帶有標題和邊框的視窗。
 
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 >)
 
Element canvas (int width, int height, std::function< void(Canvas &)>)
 
Element canvas (std::function< void(Canvas &)>)
 
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 &gradient)
 使用線性漸變效果裝飾前景色。
 
Decorator bgcolor (const LinearGradient &gradient)
 使用線性漸變效果裝飾背景顏色。
 
Element color (Color color, Element child)
 設定元素的前景顏色。
 
Element bgcolor (Color color, Element child)
 設定元素的背景顏色。
 
Element color (const LinearGradient &gradient, Element child)
 使用線性漸變效果設定元素的前景色。
 
Element bgcolor (const LinearGradient &gradient, Element child)
 使用線性漸變效果設定元素的背景顏色。
 
Decorator focusPosition (int x, int y)
 frame 內部使用,這會強制視圖滾動到給定位置。該位置以單元格數表示。
 
Decorator focusPositionRelative (float x, float y)
 frame 內部使用,這會強制視圖滾動到給定位置。該位置以請求大小的比例表示。
 
Element automerge (Element child)
 啟用字符自動與附近其他字符合併。
 
Decorator hyperlink (std::string link)
 使用超連結裝飾。 當用戶點擊時,連結將被開啟。 此功能僅在有限的終端模擬器中受支援。 List: https://github.com/Alhadis/OSC8-Adoption/
 
Element hyperlink (std::string link, Element child)
 使渲染區域可點擊並使用網路瀏覽器開啟。 當用戶點擊時,連結將被開啟。 此功能僅在有限的終端模擬器中受支援。 List: 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)
 一個容器,用於從上到下在行中顯示元素。當填滿時,它會在右側的新列開始。 filled, it starts on a new row. is full, it starts a new row.
 
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 child)
 focus 相同,但將游標形狀設置為靜止方塊。
 
Element focusCursorBlockBlinking (Element child)
 focus 相同,但將游標形狀設置為閃爍方塊。
 
Element focusCursorBar (Element child)
 focus 相同,但將游標形狀設置為靜止條狀。
 
Element focusCursorBarBlinking (Element child)
 focus 相同,但將游標形狀設置為閃爍條狀。
 
Element focusCursorUnderline (Element child)
 focus 相同,但將游標形狀設置為靜止底線。
 
Element focusCursorUnderlineBlinking (Element child)
 focus 相同,但將游標形狀設置為閃爍底線。
 
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)
 
void Render (Screen &screen, Node *node)
 
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。
 
return Make< Impl > (option)
 
 DrawPointCircleFilled (x, y, radius, [](Pixel &) {})
 繪製一個由盲文點組成的實心圓形。
 
 for (auto &child :children_)
 ftxui::Screen 上顯示元素。
 
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)
 

Variables

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

Detailed Description

FTXUI 的 ftxui:: 命名空間

FTXUI ftxui:: 命名空間

/

Typedef Documentation

◆ CapturedMouse

using CapturedMouse = std::unique_ptr<CapturedMouseInterface>

Definition at line 20 of file captured_mouse.hpp.

◆ ComponentDecorator

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

Definition at line 31 of file component.hpp.

◆ ElementDecorator

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

Definition at line 32 of file component.hpp.

◆ Component

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

Definition at line 23 of file component_base.hpp.

◆ Components

using Components = std::vector<Component>

Definition at line 24 of file component_base.hpp.

◆ Sender

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

Definition at line 52 of file receiver.hpp.

◆ Receiver

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

Definition at line 54 of file receiver.hpp.

◆ Closure

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

Definition at line 13 of file task.hpp.

◆ Task

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

Definition at line 14 of file task.hpp.

◆ Element

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

Definition at line 22 of file elements.hpp.

◆ Elements

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

Definition at line 23 of file elements.hpp.

◆ Decorator

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

Definition at line 24 of file elements.hpp.

◆ GraphFunction

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

Definition at line 25 of file elements.hpp.

Enumeration Type Documentation

◆ WidthOrHeight

Enumerator
WIDTH 
HEIGHT 

Definition at line 158 of file elements.hpp.

◆ Constraint

enum Constraint
Enumerator
LESS_THAN 
EQUAL 
GREATER_THAN 

Definition at line 159 of file elements.hpp.

◆ WordBreakProperty

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

Definition at line 40 of file string_internal.hpp.

Function Documentation

◆ Make()

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

Definition at line 26 of file component.hpp.

◆ operator|() [1/2]

Component operator| ( Component component,
ComponentDecorator decorator )

Definition at line 11 of file component/util.cpp.

◆ operator|() [2/2]

Component operator| ( Component component,
ElementDecorator decorator )

Definition at line 16 of file component/util.cpp.

◆ operator|=() [1/2]

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

Definition at line 21 of file component/util.cpp.

◆ operator|=() [2/2]

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

Definition at line 27 of file component/util.cpp.

◆ Slider() [1/4]

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

◆ Slider() [2/4]

Component Slider ( ConstStringRef label,
Ref< int > value,
ConstRef< int > min,
ConstRef< int > max,
ConstRef< int > increment )

水平滑桿。

Parameters
label滑桿的名稱。
value滑桿的當前值。
min最小值。
max最大值。
increment當遊標使用時的增量。

範例

int value = 50;
auto slider = Slider("Value:", &value, 0, 100, 1);
screen.Loop(slider);
static ScreenInteractive TerminalOutput()
Component Slider(SliderOption< T > options)

輸出

Value:[██████████████████████████ ]

Definition at line 257 of file src/ftxui/component/slider.cpp.

◆ Slider() [3/4]

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

Definition at line 271 of file src/ftxui/component/slider.cpp.

◆ Slider() [4/4]

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

Definition at line 284 of file src/ftxui/component/slider.cpp.

◆ ResizableSplit()

Component ResizableSplit ( ResizableSplitOption options)

兩個元件之間的分隔。

Parameters
options所有參數。

Example

auto left = Renderer([] { return text("Left") | center;});
auto right = Renderer([] { return text("right") | center;});
int left_size = 10;
.main = left,
.back = right,
.direction = Direction::Left,
.main_size = &left_size,
.separator_func = [] { return separatorDouble(); },
});
auto component
Definition gallery.cpp:127
Component Renderer(Component child, std::function< Element()>)
回傳一個新的元件,類似於 |child|,但使用 |render| 作為 Component::Render() 事件。
Element center(Element)
水平與垂直置中一個元素。
Element text(std::wstring text)
顯示一段 Unicode 文字。
Definition text.cpp:160
Element separatorDouble()
使用 DOUBLE 樣式在兩個元素之間繪製垂直或水平分隔線。
Component ResizableSplit(ResizableSplitOption options)
兩個元件之間的分隔。
std::uint8_t left
Definition screen.cpp:130
std::uint8_t right
Definition screen.cpp:132

Output

left ║ right

Definition at line 170 of file src/ftxui/component/resizable_split.cpp.

◆ CatchEvent()

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

◆ Collapsible()

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

可折疊元件。它顯示一個帶有箭頭的核取方塊。一旦啟用,子元件就會顯示。

Parameters
label核取方塊的標籤。
child要顯示的子元件。
show儲存子元件是否顯示的狀態。

範例

auto component = Collapsible("Show details", details);
Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
可折疊元件。它顯示一個帶有箭頭的核取方塊。一旦啟用,子元件就會顯示。

輸出

▼ Show details
<details component>

Definition at line 32 of file src/ftxui/component/collapsible.cpp.

◆ MakeReceiver()

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

Definition at line 149 of file receiver.hpp.

◆ paragraph()

Elements paragraph ( std::wstring text)

◆ separatorRounded()

Element separatorRounded ( )

◆ separatorHSelector()

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

繪製一個水平條,其中左右兩側之間的區域以不同顏色顯示。

Parameters
left活躍區域的左限。
right活躍區域的右限。
selected_color選定區域的顏色。
unselected_color未選定區域的顏色。

範例

std::shared_ptr< Node > Element
Definition elements.hpp:22
Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
繪製一個水平條,其中左右兩側之間的區域以不同顏色顯示。

Definition at line 433 of file src/ftxui/dom/separator.cpp.

◆ separatorVSelector()

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

繪製一個垂直條,其中上方/下方之間的區域以不同顏色顯示。

Parameters
up活躍區域的上限。
down活躍區域的下限。
selected_color選定區域的顏色。
unselected_color未選定區域的顏色。

範例

Definition at line 502 of file src/ftxui/dom/separator.cpp.

◆ graph()

Element graph ( GraphFunction graph_function)

使用 GraphFunction 繪製圖形。

Parameters
graph_function用於獲取數據的函數。

Definition at line 71 of file src/ftxui/dom/graph.cpp.

◆ canvas() [1/3]

Element canvas ( ConstRef< Canvas > )

◆ canvas() [2/3]

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

◆ canvas() [3/3]

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

◆ selectionStyleReset()

Element selectionStyleReset ( Element child)

重設元素的選取樣式。

Parameters
child輸入元素。
Returns
具有重設選取樣式的輸出元素。

Definition at line 55 of file selection_style.cpp.

◆ selectionColor()

Decorator selectionColor ( Color foreground)

設定元素被選取時的顏色。

Parameters
foreground要套用的顏色。 請注意,此樣式會應用在現有樣式之上。

Definition at line 78 of file selection_style.cpp.

◆ selectionBackgroundColor()

Decorator selectionBackgroundColor ( Color foreground)

設定元素被選取時的背景顏色。 請注意,此樣式會應用在現有樣式之上。

Definition at line 61 of file selection_style.cpp.

◆ selectionForegroundColor()

Decorator selectionForegroundColor ( Color foreground)

設定元素被選取時的前景顏色。 請注意,此樣式會應用在現有樣式之上。

Definition at line 69 of file selection_style.cpp.

◆ selectionStyle()

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

設定元素被選取時的樣式。

Parameters
style要套用的樣式。 請注意,此樣式會應用在現有樣式之上。

Definition at line 86 of file selection_style.cpp.

◆ hbox()

Element hbox ( Elements children)

一個逐一水平顯示元素的容器。

Parameters
children容器中的元素
Returns
容器。

範例

text("Left"),
text("Right"),
});
Element hbox(Elements)
一個逐一水平顯示元素的容器。
Definition hbox.cpp:94

Definition at line 94 of file hbox.cpp.

◆ flexbox()

Element flexbox ( Elements children,
FlexboxConfig config )

一個容器,用於在行/列中顯示元素,並在滿時能夠換行到下一列/行。

Parameters
children容器中的元素
config選項
Returns
容器。

範例

text("element 1"),
text("element 2"),
text("element 3"),
}, FlexboxConfig()
.SetGapMainAxis(1)
.SetGapCrossAxis(1)
)
@ Column
彈性項目沿著一列排列。
@ WrapInversed
彈性項目將換行到多行,但順序相反。
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
一個容器,用於在行/列中顯示元素,並在滿時能夠換行到下一列/行。
Definition flexbox.cpp:249

Definition at line 249 of file flexbox.cpp.

◆ gridbox()

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

顯示元素網格的容器。

Parameters
lines行列表,每一行都是一個元素列表。
Returns
容器。

範例

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 border(Element)
在元素周圍繪製邊框。
Element gridbox(std::vector< Elements > lines)
顯示元素網格的容器。

輸出:

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

Definition at line 173 of file src/ftxui/dom/gridbox.cpp.

◆ hflow()

Element hflow ( Elements children)

一個容器,用於從左到右在行中顯示元素。當填滿時,它會在下方的新行開始。

Parameters
children容器中的元素
Returns
容器。

範例

text("element 1"),
text("element 2"),
text("element 3"),
});
Element hflow(Elements)
一個容器,用於從左到右在行中顯示元素。當填滿時,它會在下方的新行開始。
Definition flexbox.cpp:266

Definition at line 266 of file flexbox.cpp.

◆ vflow()

Element vflow ( Elements children)

一個容器,用於從上到下在行中顯示元素。當填滿時,它會在右側的新列開始。 filled, it starts on a new row. is full, it starts a new row.

Parameters
children容器中的元素
Returns
容器。

範例

text("element 1"),
text("element 2"),
text("element 3"),
});
Element vflow(Elements)
一個容器,用於從上到下在行中顯示元素。當填滿時,它會在右側的新列開始。 filled, it starts on a new row. is full, it starts a new row.
Definition flexbox.cpp:285

Definition at line 285 of file flexbox.cpp.

◆ frame()

Element frame ( Element child)

允許元素顯示在「虛擬」區域內。其大小可以大於其容器。在這種情況下,只會顯示較小的一部分。視圖可滾動以使聚焦元素可見。

See also
frame
xframe
yframe

Definition at line 116 of file frame.cpp.

◆ xframe()

Element xframe ( Element child)

frame 相同,但僅限於 x 軸。

See also
frame
xframe
yframe

Definition at line 124 of file frame.cpp.

◆ yframe()

Element yframe ( Element child)

frame 相同,但僅限於 y 軸。

See also
frame
xframe
yframe

Definition at line 132 of file frame.cpp.

◆ select()

Element select ( Element child)

child 設置為其同級元素中被聚焦的元素。

This is deprecated. Use focus instead.

Parameters
child要被聚焦的元素。

Definition at line 108 of file frame.cpp.

◆ reflect()

Decorator reflect ( Box & box)

Definition at line 42 of file reflect.cpp.

◆ Render() [1/3]

void Render ( Screen & screen,
const Element & element )

◆ Render() [2/3]

void Render ( Screen & screen,
Node * node )

◆ Render() [3/3]

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

◆ GetNodeSelectedContent()

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

◆ GetColorInfo() [1/2]

ColorInfo GetColorInfo ( Color::Palette256 index)

Definition at line 272 of file color_info.cpp.

◆ GetColorInfo() [2/2]

ColorInfo GetColorInfo ( Color::Palette16 index)

Definition at line 276 of file color_info.cpp.

◆ wchar_width()

int wchar_width ( wchar_t ucs)

Definition at line 1311 of file string.cpp.

◆ wstring_width()

int wstring_width ( const std::wstring & text)

Definition at line 1315 of file string.cpp.

◆ to_string()

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

將 std::wstring 轉換為 UTF8 std::string。

Definition at line 1542 of file string.cpp.

◆ to_wstring() [1/2]

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

將 UTF8 std::string 轉換為 std::wstring。

Definition at line 1614 of file string.cpp.

◆ to_wstring() [2/2]

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

Definition at line 15 of file string.hpp.

◆ string_width()

int string_width ( const std::string & input)

Definition at line 1328 of file string.cpp.

◆ Utf8ToGlyphs()

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

Definition at line 1354 of file string.cpp.

◆ CellToGlyphIndex()

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

Definition at line 1443 of file string.cpp.

◆ Make< Impl >()

return Make< Impl > ( option )

◆ DrawPointCircleFilled()

DrawPointCircleFilled ( x ,
y ,
radius ,
[] (Pixel &) {}  )

繪製一個由盲文點組成的實心圓形。

Parameters
x圓心點的 x 座標。
y圓心點的 y 座標。
radius圓形的半徑。 {

◆ for()

for ( auto &child :children_ )

ftxui::Screen 上顯示元素。

Definition at line 58 of file node.cpp.

◆ EatCodePoint() [1/2]

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

Definition at line 1172 of file string.cpp.

◆ EatCodePoint() [2/2]

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

Definition at line 1241 of file string.cpp.

◆ IsCombining()

bool IsCombining ( uint32_t ucs)

Definition at line 1279 of file string.cpp.

◆ IsFullWidth()

bool IsFullWidth ( uint32_t ucs)

Definition at line 1283 of file string.cpp.

◆ IsControl()

bool IsControl ( uint32_t ucs)

Definition at line 1291 of file string.cpp.

◆ CodepointToWordBreakProperty()

WordBreakProperty CodepointToWordBreakProperty ( uint32_t codepoint)

Definition at line 1305 of file string.cpp.

◆ GlyphPrevious()

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

Definition at line 1383 of file string.cpp.

◆ GlyphNext()

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

Definition at line 1408 of file string.cpp.

◆ GlyphIterate()

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

Definition at line 1429 of file string.cpp.

◆ GlyphCount()

int GlyphCount ( const std::string & input)

Definition at line 1483 of file string.cpp.

◆ Utf8ToWordBreakProperty()

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

Definition at line 1510 of file string.cpp.

◆ IsWordBreakingCharacter()

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

Variable Documentation

◆ g_uniformize

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

Definition at line 18 of file terminal_input_parser.cpp.

◆ palette256

const std::array<ColorInfo, 256> palette256

Definition at line 13 of file color_info.cpp.