bauiv1lib.docui.prep package

Functionality related to prepping a doc-ui page for display.

Consumes native (v2 / language-agnostic) doc-ui documents: text rides as bacommon.langstr.LangStrSpec (handed to widgets as native handles that re-evaluate on language changes) and assets as typed refs.

Warning

This is an internal api and subject to change at any time. Do not use it in mod code.

class bauiv1lib.docui.prep.ButtonPrep(buttoncall: Callable[..., bauiv1.Widget], buttoneditcall: Callable | None, decorations: list[DecorationPrep], textures: dict[str, str], widgetid: str, action: bacommon.docui.v2.Action | None)[source]

Bases: object

Prep for a button in a doc-ui.

action: bacommon.docui.v2.Action | None
buttoncall: Callable[..., bauiv1.Widget]
buttoneditcall: Callable | None
decorations: list[DecorationPrep]
textures: dict[str, str]
widgetid: str
class bauiv1lib.docui.prep.DecorationPrep(call: Callable[..., bauiv1.Widget], textures: dict[str, str], meshes: dict[str, str], highlight: bool)[source]

Bases: object

Prep for a decoration in a doc-ui.

call: Callable[..., bauiv1.Widget]
highlight: bool
meshes: dict[str, str]
textures: dict[str, str]
class bauiv1lib.docui.prep.PagePrep(rootcall: Callable[..., bauiv1.Widget] | None, rows: list[RowPrep], width: float, height: float, simple_culling_v: float, center_vertically: bool, title: bauiv1.LangStr, root_post_calls: list[Callable[[bauiv1.Widget], None]])[source]

Bases: object

Prep for a page in a doc-ui.

center_vertically: bool
height: float
root_post_calls: list[Callable[[bauiv1.Widget], None]]
rootcall: Callable[..., bauiv1.Widget] | None
rows: list[RowPrep]
simple_culling_v: float
title: bauiv1.LangStr

Native language-string title handle.

width: float
class bauiv1lib.docui.prep.RowPrep(width: float, height: float, titlecalls: list[Callable[..., bauiv1.Widget]], hscrollcall: Callable[..., bauiv1.Widget] | None, hscrolleditcall: Callable | None, hsubcall: Callable[..., bauiv1.Widget] | None, buttons: list[ButtonPrep], simple_culling_h: float, decorations: list[DecorationPrep])[source]

Bases: object

Prep for a row in a doc-ui.

buttons: list[ButtonPrep]
decorations: list[DecorationPrep]
height: float
hscrollcall: Callable[..., bauiv1.Widget] | None
hscrolleditcall: Callable | None
hsubcall: Callable[..., bauiv1.Widget] | None
simple_culling_h: float
titlecalls: list[Callable[..., bauiv1.Widget]]
width: float
bauiv1lib.docui.prep.instantiate_page_prep(pageprep: PagePrep, *, rootwidget: bui.Widget, scrollwidget: bui.Widget, backbutton: bui.Widget, windowbackbutton: bui.Widget | None, window: DocUIWindow) bui.Widget[source]

Create a UI using prepped data.

bauiv1lib.docui.prep.prep_button_debug(bsize: tuple[float, float], bcenter: tuple[float, float], tdelay: float | None, out_decoration_preps: list[DecorationPrep]) None[source]

Prep debug decorations for a button.

bauiv1lib.docui.prep.prep_decorations(decorations: list[Decoration], center_x: float, center_y: float, scale: float, tdelay: float | None, *, packages: list[str], highlight: bool, out_decoration_preps: list[DecorationPrep]) None[source]

Prep appropriate decoration types for a list of decorations.

bauiv1lib.docui.prep.prep_display_item(display_item: DisplayItem, parent_center: tuple[float, float], parent_scale: float, tdelay: float | None, out_decoration_preps: list[DecorationPrep], *, highlight: bool) None[source]

Prep decorations for a display-item.

bauiv1lib.docui.prep.prep_image(image: Image, bcenter: tuple[float, float], bscale: float, tdelay: float | None, out_decoration_preps: list[DecorationPrep], *, highlight: bool) None[source]

Prep decorations for an image.

bauiv1lib.docui.prep.prep_page(page: Page, *, packages: list[str], uiscale: UIScale, scroll_width: float, scroll_height: float, idprefix: str, immediate: bool = False) PagePrep[source]

Prep a page.

bauiv1lib.docui.prep.prep_row_debug(size: tuple[float, float], pos: tuple[float, float], tdelay: float | None, out_decoration_preps: list[DecorationPrep]) None[source]

Prep debug decorations for a row.

bauiv1lib.docui.prep.prep_row_debug_button(bsize: tuple[float, float], bcorner: tuple[float, float], tdelay: float | None, out_decoration_preps: list[DecorationPrep]) None[source]

Prep debug decorations for a button.

bauiv1lib.docui.prep.prep_text(text: Text, bcenter: tuple[float, float], bscale: float, tdelay: float | None, out_decoration_preps: list[DecorationPrep], *, packages: list[str], highlight: bool) None[source]

Prep decorations for text.