NAME
Clay::UI::_FrameRegistry - what one Clay::UI frame laid out
DESCRIPTION
Clay::UI builds one registry per frame while it walks the widget tree and replaces the previous one only when the frame completes, so a failed frame leaves the last good registry in place. It answers the questions the next frame's pointer and scroll handling asks about the last layout: which widget a render command's userData or a Clay element id belongs to, where widgets came in the walk, which scroll containers were declared under which element id, and how far they have scrolled since.
It also defines what a scroll container is: a widget composing Clay::UI::Role::Layout::HasScroll. The walker injects Clay's scroll offset only into scroll containers, and only they receive OnScroll.
Widget references are weak.
This module is internal. The API is not part of the public contract.
METHODS
add_back_reference($widget)-
Records
$widget; returns theuserDatavalue for its render commands. is_scroll_container($widget)-
1 if
$widgetis a scroll container, else 0. add_element($widget, $element_id, $padding)-
Records a widget Clay declared an element for (an element or a text widget) in walk order under the element id hash Clay named it by, with the padding of its declaration (a
Clay_Paddinghash, or undef for none; missing sides are 0); a scroll container is also listed byscroll_containers. element_count-
How many widgets
add_back_referencerecorded: the Clay layout elements the walk declared, element and text widgets alike. widget_for($user_data),widget_for_element($id)-
The widget, or undef.
element_id_of($widget),padding_of($widget)-
The element id hash, or a copy of the padding (
{ left, top, right, bottom }), the walk declared$widgetwith; undef for a widget the walk did not reach. in_tree_order(@widgets)-
@widgetssorted by walk position. Widgets the walk did not reach come last, in the depth-first pre-order of the tree they are in now; ties keep their original order. scroll_containers-
List of
[ $widget, $element_id ]for the scroll containers that still exist, in walk order. scroll_positions($ui)-
Hashref
refaddr => [ $widget, $element_id, $position ]for the scroll containers that still belong to$uiand that Clay knows, with their current scroll position. Needs$ui's Clay context to be current. scroll_changes($positions)-
List of
[ $widget, $delta_x, $delta_y ]for the containers of an earlierscroll_positionsresult that have moved since.