CustomFrontendInterface

AppCUI::Application::CustomFrontendInterface (class)

class CustomFrontendInterface

A frontend implemented by the application instead of a real terminal (headless / remote / recording screens).

Select it with InitializationData::Frontend = FrontendType::Custom and InitializationData::CustomFrontend. AppCUI calls every method from the UI thread; the object is NOT owned by AppCUI and must outlive the application. The clipboard of a custom frontend is private to the process (it never reaches the OS clipboard).

Public Functions

virtual ~CustomFrontendInterface() = default
virtual bool OnInit(uint32 &width, uint32 &height) = 0

width / height hold the requested size (InitializationData::Width/Height, may be 0); both must be > 0 on return.

virtual void OnUnInit() = 0

Called once when the application stops; the frontend receives no other call afterwards.

virtual void OnFlushToScreen(const Graphics::Character *characters, uint32 width, uint32 height) = 0

The entire screen: width * height characters, row major (valid only during the call).

virtual void OnUpdateCursor(uint32 x, uint32 y, bool visible) = 0

New position / visibility of the text cursor.

virtual bool WaitForEvent(FrontendEvent &evnt, uint32 timeoutMs) = 0

Waits at most timeoutMs milliseconds for the next event; returns false on timeout.

inline virtual bool HasSupportFor(SpecialCharacterSetType type)

Whether a special character set can be displayed (queried when the set is SpecialCharacterSetType::Auto).