package mosaic
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/mosaic.ui/Mosaic_ui/Renderable/Private/index.html
Module Renderable.PrivateSource
Context
type context = {tree : unit Toffee.tree;schedule : unit -> unit;focus : t -> bool;blur : t -> unit;register_lifecycle : t -> unit;unregister_lifecycle : t -> unit;alloc_num : unit -> int;register : t -> unit;unregister : t -> unit;
}The type for renderer callbacks inherited by all nodes in a tree.
Root construction
val create_root :
context ->
?id:string ->
?style:Toffee.Style.t ->
?glyph_pool:Glyph.Pool.t ->
unit ->
tcreate_root ctx () is a new root node backed by ctx's layout tree.
Optional parameters:
id: identifier string. Defaults to"node-N".style: flexbox style. Defaults toToffee.Style.default.glyph_pool: glyph pool for text rendering. Defaults to none.
Identity
Layout cache
Render pipeline
pre_render_update t ~delta runs t's on-frame and resize hooks.
render t grid ~delta invokes t's render callback.
ensure_frame_buffer t ~parent is Some buf if t uses buffered rendering and has positive dimensions, None otherwise.
blit_frame_buffer t ~dst copies t's frame buffer into dst.
render_full t ~grid ~delta runs the complete render sequence for t: frame buffer selection, pre-render hook, render callback, post-render hook, and frame buffer blit.
Children
children_z t is t's children sorted by z-index. The result is cached.
iter_children_z t f applies f to each child of t in z-index order.
children_in_viewport ~parent ~viewport ~padding is the children of parent whose bounds intersect viewport expanded by padding cells, sorted by z-index.
Focus
focus_direct t focuses t without delegating to the renderer. Returns false if t is not focusable.
Lifecycle
live_count t is the total number of live-rendering nodes in t's subtree, including t itself.
set_on_live_count_change t cb registers an observer called when live_count t changes. None clears it.
set_lifecycle_pass t callback registers a lifecycle pass hook for t. None clears it.
run_lifecycle_pass t invokes t's lifecycle callback, if any.
Event emission
emit_mouse t event dispatches event to t's mouse handlers, bubbling to ancestors unless propagation is stopped via Event.Mouse.stop_propagation.
emit_default_key t event dispatches event to t's default key handler, if any.
emit_paste t event dispatches event to t's paste handler, if any.
Selection
emit_selection_changed t sel notifies t's selection on_change callback with sel. Returns false if no callback is registered.
should_start_selection t ~x ~y is true iff t's should_start callback returns true for (x, y). Returns false if no callback is registered.
get_selected_text t calls t's get_text callback and returns the result, or "" if no callback is registered.
Child clipping
child_clip t is the clipping rectangle for t's children as returned by t's clip override, or None if no override is set.
Glyph pool
set_glyph_pool t pool assigns a glyph pool for text rendering by t and its descendants.
glyph_pool t is t's glyph pool, or None if none is assigned.