const NONE
pub const NONE = 0Purpose
Constant NONE, defining protocol or algorithm parameters.
#ui/phone#ui/phone uses the #ui/draw frame protocol. Use available() to check for the mobile host and platform() to distinguish iOS and Android. host_insets() supplies viewport safe areas and keyboard inset in logical units for scaffold_with.
Touch handles tap targets, scrolling, edge-back gestures and pull-to-refresh. Register targets when recording each frame, then feed host events through Touch.event.RouteStack keeps navigation state. TextField handles native IME sessions and uses UTF-8 byte offsets for anchor and focus.light_theme() and dark_theme() supply shared design tokens for the phone controls. Read reduced_motion() when choosing transitions.Package an app and configure the platform tools using the mobile app guide.
const NONEpub const NONE = 0Constant NONE, defining protocol or algorithm parameters.
const IOSpub const IOS = 1Constant IOS, defining protocol or algorithm parameters.
const ANDROIDpub const ANDROID = 2Constant ANDROID, defining protocol or algorithm parameters.
const HAPTIC_SELECTIONpub const HAPTIC_SELECTION = 1Constant HAPTIC_SELECTION, defining protocol or algorithm parameters.
const HAPTIC_IMPACTpub const HAPTIC_IMPACT = 2Constant HAPTIC_IMPACT, defining protocol or algorithm parameters.
const HAPTIC_SUCCESSpub const HAPTIC_SUCCESS = 3Constant HAPTIC_SUCCESS, defining protocol or algorithm parameters.
const HAPTIC_ERRORpub const HAPTIC_ERROR = 4Constant HAPTIC_ERROR, defining protocol or algorithm parameters.
platformpub fn platform() intPhone applications retain the Darwin/Linux runtime ABI. Query the application platform here rather than inferring it from xu_target_os.
No arguments are required.
int — a value of this type
availablepub fn available() boolExecute available.
No arguments are required.
bool — true or false
set_back_enabledpub fn set_back_enabled(enabled bool) intCapture Android Back only while a sheet/detail route can handle it. At the root, the native Activity sends the task to the background as usual. Throws on failure; handle the error or propagate it to the caller.
enabled boolint — a value of this type
set_dark_appearancepub fn set_dark_appearance(dark bool) intMatch system status/navigation bars and safe-area backgrounds to the theme. Throws on failure; handle the error or propagate it to the caller.
dark boolint — a value of this type
set_overlaypub fn set_overlay(visible bool) intExtend a bottom sheet's scrim and surface through the native safe areas. Throws on failure; handle the error or propagate it to the caller.
visible boolint — a value of this type
hapticpub fn haptic(kind int)Request a lightweight native haptic feedback cue. Falls back cleanly when running headless or on a host without a haptic bridge.
kind intThis call does not return a value.
struct Canvaspub struct Canvas {
pub frame draw.Frame
}Reuses the Draw frame/resource protocol. Temporary layouts remain alive until present accepts the complete frame, then the frame lease retains them.
frame draw.Framecanvaspub fn canvas(context &draw.Context) CanvasExecute canvas.
context &draw.ContextCanvas — a value of this type
canvas_with_identitypub fn canvas_with_identity(context &draw.Context,identity &ui.CanvasEvent) CanvasCanvas with identity.
context &draw.Contextidentity &ui.CanvasEventCanvas — a value of this type
($&Canvas) set_identitypub fn (c $&Canvas) set_identity(identity &ui.CanvasEvent)Operation on $&Canvas: set identity.
c $&CanvasCanvas instance used by this call (exclusive borrow).identity &ui.CanvasEventThis call does not return a value.
($&Canvas) set_localepub fn (c $&Canvas) set_locale(locale int)Operation on $&Canvas: set locale.
c $&CanvasCanvas instance used by this call (exclusive borrow).locale intThis call does not return a value.
($&Canvas) set_text_selectablepub fn (c $&Canvas) set_text_selectable(id int,selectable bool)Operation on $&Canvas: set text selectable.
c $&CanvasCanvas instance used by this call (exclusive borrow).id intselectable boolThis call does not return a value.
(&Canvas) is_text_selectablepub fn (c &Canvas) is_text_selectable(id int) boolOperation on &Canvas: whether it is text selectable.
c &CanvasCanvas instance used by this call (borrow).id intbool — true or false
(&Canvas) selected_textpub fn (c &Canvas) selected_text(id int) stringOperation on &Canvas: selected text.
c &CanvasCanvas instance used by this call (borrow).id intstring — result string
($&Canvas) set_font_stackpub fn (c $&Canvas) set_font_stack(stack font.FontStack)Operation on $&Canvas: set font stack.
c $&CanvasCanvas instance used by this call (exclusive borrow).stack font.FontStackThis call does not return a value.
($&Canvas) add_ttf_bytespub fn (c $&Canvas) add_ttf_bytes(ttf_bytes &[]u8,font_index int,face_id int) intOperation on $&Canvas: add ttf bytes. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).ttf_bytes &[]u8font_index intface_id intint — a value of this type
($&Canvas) beginpub fn (c $&Canvas) begin(theme &Theme) intExecute begin on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).theme &Themeint — a value of this type
($&Canvas) presentpub fn (c $&Canvas) present() intExecute present on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).int — a value of this type
($&Canvas) export_xdfpub fn (c $&Canvas) export_xdf() stringOperation on $&Canvas: export xdf. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).string — result string
($&Canvas) disposepub fn (c $&Canvas) dispose()Release and dispose native resources and underlying handles.
c $&CanvasCanvas instance used by this call (exclusive borrow).This call does not return a value.
($&Canvas) shape_textpub fn (c $&Canvas) shape_text(value &string,size f64,weight int,line_height f64,width f64,align int) draw.TextLayoutOperation on $&Canvas: shape text. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).value &stringsize f64weight intline_height f64width f64align intdraw.TextLayout — a value of this type
($&Canvas) put_textpub fn (c $&Canvas) put_text(text draw.TextLayout,x f64,y f64,color draw.Color) intOperation on $&Canvas: put text. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).text draw.TextLayoutx f64y f64color draw.Colorint — a value of this type
($&Canvas) labelpub fn (c $&Canvas) label(bounds layout.Rect,value string,size f64,weight int,color draw.Color,align int) intSingle-line text fits its assigned width, with Canvas-side grapheme-safe ellipsis. Geometry stays independent of the host's estimated text metrics. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Rectvalue stringsize f64weight intcolor draw.Coloralign intint — a value of this type
($&Canvas) measure_paragraphpub fn (c $&Canvas) measure_paragraph(value &string,size f64,weight int,line_height f64,width f64) f64Measure wrapped multi-line height at width without retaining a layout handle. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).value &stringsize f64weight intline_height f64width f64f64 — a value of this type
($&Canvas) paragraphpub fn (c $&Canvas) paragraph(bounds layout.Rect,value string,size f64,weight int,line_height f64,color draw.Color,align int) f64Draw wrapped multi-line text inside bounds.width and return measured height. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Rectvalue stringsize f64weight intline_height f64color draw.Coloralign intf64 — a value of this type
($&Canvas) selectable_labelpub fn (c $&Canvas) selectable_label(t $&Touch,id int,bounds layout.Rect,value string,size f64,weight int,color draw.Color,align int,clip &layout.Rect,theme &Theme) intOperation on $&Canvas: selectable label. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).t $&Touchid intbounds layout.Rectvalue stringsize f64weight intcolor draw.Coloralign intclip &layout.Recttheme &Themeint — a value of this type
($&Canvas) selectable_paragraphpub fn (c $&Canvas) selectable_paragraph(t $&Touch,id int,bounds layout.Rect,value string,size f64,weight int,line_height f64,color draw.Color,align int,clip &layout.Rect,theme &Theme) f64Operation on $&Canvas: selectable paragraph. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).t $&Touchid intbounds layout.Rectvalue stringsize f64weight intline_height f64color draw.Coloralign intclip &layout.Recttheme &Themef64 — a value of this type
($&Canvas) draw_selectablepub fn (c $&Canvas) draw_selectable(state $&SelectableText,t $&Touch,bounds layout.Rect,clip &layout.Rect,theme &Theme,color draw.Color) f64Operation on $&Canvas: draw selectable. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).state $&SelectableTextt $&Touchbounds layout.Rectclip &layout.Recttheme &Themecolor draw.Colorf64 — a value of this type
($&Canvas) handle_text_selectionpub fn (c $&Canvas) handle_text_selection(event &ui.Event,touches &Touch,action int) SelectableTextResultOperation on $&Canvas: handle text selection.
c $&CanvasCanvas instance used by this call (exclusive borrow).event &ui.Eventtouches &Touchaction intSelectableTextResult — a value of this type
($&Canvas) cardpub fn (c $&Canvas) card(bounds layout.Rect,theme &Theme) intExecute card on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themeint — a value of this type
const ICON_HOMEpub const ICON_HOME = 1Constant ICON_HOME, defining protocol or algorithm parameters.
const ICON_HISTORYpub const ICON_HISTORY = 2Constant ICON_HISTORY, defining protocol or algorithm parameters.
const ICON_SETTINGSpub const ICON_SETTINGS = 3Constant ICON_SETTINGS, defining protocol or algorithm parameters.
const ICON_PLUSpub const ICON_PLUS = 4Constant ICON_PLUS, defining protocol or algorithm parameters.
const ICON_CHEVRONpub const ICON_CHEVRON = 5Constant ICON_CHEVRON, defining protocol or algorithm parameters.
const ICON_CLOSEpub const ICON_CLOSE = 6Constant ICON_CLOSE, defining protocol or algorithm parameters.
const ICON_CHECKpub const ICON_CHECK = 7Constant ICON_CHECK, defining protocol or algorithm parameters.
const ICON_FOCUSpub const ICON_FOCUS = 8Constant ICON_FOCUS, defining protocol or algorithm parameters.
const ICON_BOOKpub const ICON_BOOK = 9Constant ICON_BOOK, defining protocol or algorithm parameters.
const ICON_ACTIVITYpub const ICON_ACTIVITY = 10Constant ICON_ACTIVITY, defining protocol or algorithm parameters.
const ICON_BACKpub const ICON_BACK = 11Constant ICON_BACK, defining protocol or algorithm parameters.
const ICON_REFRESHpub const ICON_REFRESH = 12Constant ICON_REFRESH, defining protocol or algorithm parameters.
const ICON_COPYpub const ICON_COPY = 13Constant ICON_COPY, defining protocol or algorithm parameters.
const TONE_SECONDARYpub const TONE_SECONDARY = 0Constant TONE_SECONDARY, defining protocol or algorithm parameters.
const TONE_PRIMARYpub const TONE_PRIMARY = 1Constant TONE_PRIMARY, defining protocol or algorithm parameters.
const TONE_DANGERpub const TONE_DANGER = 2Constant TONE_DANGER, defining protocol or algorithm parameters.
($&Canvas) iconpub fn (c $&Canvas) icon(bounds layout.Rect,kind int,color draw.Color) intExecute icon on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Rectkind intcolor draw.Colorint — a value of this type
($&Canvas) button_tonepub fn (c $&Canvas) button_tone(bounds layout.Rect,theme &Theme,label string,tone int,pressed bool) intOperation on $&Canvas: button tone. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themelabel stringtone intpressed boolint — a value of this type
($&Canvas) buttonpub fn (c $&Canvas) button(bounds layout.Rect,theme &Theme,label string,primary bool,pressed bool) intExecute button on $&Canvas.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themelabel stringprimary boolpressed boolint — a value of this type
($&Canvas) chippub fn (c $&Canvas) chip(bounds layout.Rect,theme &Theme,label string,selected bool,pressed bool) intExecute chip on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themelabel stringselected boolpressed boolint — a value of this type
($&Canvas) navigationpub fn (c $&Canvas) navigation(shell &Scaffold,theme &Theme,selected int,touches &Touch) intExecute navigation on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).shell &Scaffoldtheme &Themeselected inttouches &Touchint — a value of this type
($&Canvas) scrollbarpub fn (c $&Canvas) scrollbar(bounds &layout.Rect,theme &Theme,scroll f64,maximum f64,content_height f64) intExecute scrollbar on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds &layout.Recttheme &Themescroll f64maximum f64content_height f64int — a value of this type
snackbar_action_boundspub fn snackbar_action_bounds(bounds &layout.Rect,has_action bool) layout.RectSnackbar action bounds.
bounds &layout.Recthas_action boollayout.Rect — a value of this type
($&Canvas) refresh_indicatorpub fn (c $&Canvas) refresh_indicator(bounds layout.Rect,theme &Theme,pull f64,ready bool,reduced bool) intCompact pull-to-refresh indicator that drops down inside top pull space and avoids continuous spinning motion when reduced_motion is active. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themepull f64ready boolreduced boolint — a value of this type
($&Canvas) snackbarpub fn (c $&Canvas) snackbar(bounds &layout.Rect,theme &Theme,message string,action_label string,action_pressed bool) intExecute snackbar on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds &layout.Recttheme &Thememessage stringaction_label stringaction_pressed boolint — a value of this type
($&Canvas) rowpub fn (c $&Canvas) row(bounds layout.Rect,theme &Theme,title string,detail string,kind int,pressed bool) intExecute row on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themetitle stringdetail stringkind intpressed boolint — a value of this type
($&Canvas) sheetpub fn (c $&Canvas) sheet(shell &Scaffold,theme &Theme,bounds layout.Rect,title string) intExecute sheet on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).shell &Scaffoldtheme &Themebounds layout.Recttitle stringint — a value of this type
($&Canvas) fill_round_rectpub fn (c $&Canvas) fill_round_rect(x f64,y f64,width f64,height f64,radius f64,color draw.Color) intOperation on $&Canvas: fill round rectangle. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).x f64y f64width f64height f64radius f64color draw.Colorint — a value of this type
($&Canvas) fill_rectpub fn (c $&Canvas) fill_rect(x f64,y f64,width f64,height f64,color draw.Color) intOperation on $&Canvas: fill rectangle. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).x f64y f64width f64height f64color draw.Colorint — a value of this type
($&Canvas) linepub fn (c $&Canvas) line(x1 f64,y1 f64,x2 f64,y2 f64,color draw.Color,width f64) intExecute line on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).x1 f64y1 f64x2 f64y2 f64color draw.Colorwidth f64int — a value of this type
($&Canvas) fill_circlepub fn (c $&Canvas) fill_circle(x f64,y f64,radius f64,color draw.Color) intOperation on $&Canvas: fill circle. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).x f64y f64radius f64color draw.Colorint — a value of this type
($&Canvas) stroke_circlepub fn (c $&Canvas) stroke_circle(x f64,y f64,radius f64,color draw.Color,width f64) intOperation on $&Canvas: stroke circle. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).x f64y f64radius f64color draw.Colorwidth f64int — a value of this type
($&Canvas) stroke_round_rectpub fn (c $&Canvas) stroke_round_rect(x f64,y f64,width f64,height f64,radius f64,color draw.Color,line_width f64) intOperation on $&Canvas: stroke round rectangle. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).x f64y f64width f64height f64radius f64color draw.Colorline_width f64int — a value of this type
($&Canvas) clip_rectpub fn (c $&Canvas) clip_rect(x f64,y f64,width f64,height f64) intOperation on $&Canvas: clip rectangle. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).x f64y f64width f64height f64int — a value of this type
($&Canvas) pushpub fn (c $&Canvas) push() intExecute push on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).int — a value of this type
($&Canvas) poppub fn (c $&Canvas) pop() intExecute pop on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).int — a value of this type
($&Canvas) scrimpub fn (c $&Canvas) scrim(width f64,height f64,theme &Theme) intExecute scrim on $&Canvas.
c $&CanvasCanvas instance used by this call (exclusive borrow).width f64height f64theme &Themeint — a value of this type
($&Canvas) dividerpub fn (c $&Canvas) divider(bounds layout.Rect,theme &Theme) intExecute divider on $&Canvas.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themeint — a value of this type
($&Canvas) toggle_switchpub fn (c $&Canvas) toggle_switch(bounds layout.Rect,theme &Theme,checked bool,pressed bool,enabled bool) intOperation on $&Canvas: toggle switch. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themechecked boolpressed boolenabled boolint — a value of this type
($&Canvas) switch_rowpub fn (c $&Canvas) switch_row(bounds layout.Rect,theme &Theme,title string,detail string,checked bool,pressed bool,enabled bool) intOperation on $&Canvas: switch row. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themetitle stringdetail stringchecked boolpressed boolenabled boolint — a value of this type
($&Canvas) check_rowpub fn (c $&Canvas) check_row(bounds layout.Rect,theme &Theme,title string,detail string,checked bool,pressed bool,enabled bool) intOperation on $&Canvas: check row. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themetitle stringdetail stringchecked boolpressed boolenabled boolint — a value of this type
($&Canvas) radio_rowpub fn (c $&Canvas) radio_row(bounds layout.Rect,theme &Theme,title string,detail string,selected bool,pressed bool,enabled bool) intOperation on $&Canvas: radio row. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themetitle stringdetail stringselected boolpressed boolenabled boolint — a value of this type
($&Canvas) progress_barpub fn (c $&Canvas) progress_bar(bounds layout.Rect,theme &Theme,value f64,tone int) intOperation on $&Canvas: progress bar. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themevalue f64tone intint — a value of this type
($&Canvas) badgepub fn (c $&Canvas) badge(bounds layout.Rect,theme &Theme,text string,tone int) intExecute badge on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themetext stringtone intint — a value of this type
($&Canvas) badge_countpub fn (c $&Canvas) badge_count(bounds layout.Rect,theme &Theme,count int) intOperation on $&Canvas: badge count. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themecount intint — a value of this type
($&Canvas) empty_statepub fn (c $&Canvas) empty_state(bounds layout.Rect,theme &Theme,icon_kind int,title string,body string) intOperation on $&Canvas: empty state. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themeicon_kind inttitle stringbody stringint — a value of this type
($&Canvas) segmentedpub fn (c $&Canvas) segmented(bounds layout.Rect,theme &Theme,labels &[]string,selected int,pressed_index int) intExecute segmented on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themelabels &[]stringselected intpressed_index intint — a value of this type
($&Canvas) sliderpub fn (c $&Canvas) slider(bounds layout.Rect,theme &Theme,value f64,min_val f64,max_val f64,pressed bool,enabled bool) intExecute slider on $&Canvas. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themevalue f64min_val f64max_val f64pressed boolenabled boolint — a value of this type
($&Canvas) confirm_dialogpub fn (c $&Canvas) confirm_dialog(bounds layout.Rect,theme &Theme,title string,body string,cancel_label string,confirm_label string,danger bool,cancel_pressed bool,confirm_pressed bool) intOperation on $&Canvas: confirm dialog. Throws on failure; handle the error or propagate it to the caller.
c $&CanvasCanvas instance used by this call (exclusive borrow).bounds layout.Recttheme &Themetitle stringbody stringcancel_label stringconfirm_label stringdanger boolcancel_pressed boolconfirm_pressed boolint — a value of this type
const TOUCH_SIZEpub const TOUCH_SIZE = 48Logical points/DIP inside the host's safe area. Phone components never add another status-bar or home-indicator inset on top of that viewport.
const PAGE_PADDINGpub const PAGE_PADDING = 20Constant PAGE_PADDING, defining protocol or algorithm parameters.
const ROW_HEIGHTpub const ROW_HEIGHT = 72Constant ROW_HEIGHT, defining protocol or algorithm parameters.
const REFRESH_THRESHOLDpub const REFRESH_THRESHOLD = 64Constant REFRESH_THRESHOLD, defining protocol or algorithm parameters.
const TAB_HOMEpub const TAB_HOME = 1Constant TAB_HOME, defining protocol or algorithm parameters.
const TAB_HISTORYpub const TAB_HISTORY = 2Constant TAB_HISTORY, defining protocol or algorithm parameters.
const TAB_SETTINGSpub const TAB_SETTINGS = 3Constant TAB_SETTINGS, defining protocol or algorithm parameters.
const BADGE_NEUTRALpub const BADGE_NEUTRAL = 0Constant BADGE_NEUTRAL, defining protocol or algorithm parameters.
const BADGE_INFOpub const BADGE_INFO = 1Constant BADGE_INFO, defining protocol or algorithm parameters.
const BADGE_POSITIVEpub const BADGE_POSITIVE = 2Constant BADGE_POSITIVE, defining protocol or algorithm parameters.
const BADGE_WARNINGpub const BADGE_WARNING = 3Constant BADGE_WARNING, defining protocol or algorithm parameters.
const BADGE_DANGERpub const BADGE_DANGER = 4Constant BADGE_DANGER, defining protocol or algorithm parameters.
const SWITCH_WIDTHpub const SWITCH_WIDTH = 44Constant SWITCH_WIDTH, defining protocol or algorithm parameters.
const SWITCH_HEIGHTpub const SWITCH_HEIGHT = 24Constant SWITCH_HEIGHT, defining protocol or algorithm parameters.
const SLIDER_THUMBpub const SLIDER_THUMB = 24Constant SLIDER_THUMB, defining protocol or algorithm parameters.
const PROGRESS_HEIGHTpub const PROGRESS_HEIGHT = 6Constant PROGRESS_HEIGHT, defining protocol or algorithm parameters.
const DIALOG_RADIUSpub const DIALOG_RADIUS = 16Constant DIALOG_RADIUS, defining protocol or algorithm parameters.
refresh_thresholdpub fn refresh_threshold() f64Refresh threshold.
No arguments are required.
f64 — a value of this type
switch_widthpub fn switch_width() f64Switch width.
No arguments are required.
f64 — a value of this type
switch_heightpub fn switch_height() f64Switch height.
No arguments are required.
f64 — a value of this type
slider_thumbpub fn slider_thumb() f64Slider thumb.
No arguments are required.
f64 — a value of this type
progress_heightpub fn progress_height() f64Progress height.
No arguments are required.
f64 — a value of this type
dialog_radiuspub fn dialog_radius() f64Dialog radius.
No arguments are required.
f64 — a value of this type
struct Themepub struct Theme {
pub dark bool
pub background draw.Color
pub surface draw.Color
pub elevated draw.Color
pub subtle draw.Color
pub subtle_pressed draw.Color
pub ink draw.Color
pub muted draw.Color
pub border draw.Color
pub control_border draw.Color
pub accent draw.Color
pub accent_hover draw.Color
pub accent_pressed draw.Color
pub accent_tint draw.Color
pub on_accent draw.Color
pub positive draw.Color
pub positive_soft draw.Color
pub warning draw.Color
pub warning_soft draw.Color
pub danger draw.Color
pub danger_soft draw.Color
pub info draw.Color
pub info_soft draw.Color
pub focus draw.Color
pub scrim draw.Color
}Structure encapsulating dark, background, surface, elevated, subtle.
dark boolbackground draw.Colorsurface draw.Colorelevated draw.Colorsubtle draw.Colorsubtle_pressed draw.Colorink draw.Colormuted draw.Colorborder draw.Colorcontrol_border draw.Coloraccent draw.Coloraccent_hover draw.Coloraccent_pressed draw.Coloraccent_tint draw.Coloron_accent draw.Colorpositive draw.Colorpositive_soft draw.Colorwarning draw.Colorwarning_soft draw.Colordanger draw.Colordanger_soft draw.Colorinfo draw.Colorinfo_soft draw.Colorfocus draw.Colorscrim draw.Colorlight_themepub fn light_theme() ThemePaper / Obsidian / Cinnabar tokens synchronized with xu-ui-design.
No arguments are required.
Theme — a value of this type
dark_themepub fn dark_theme() ThemeDark theme.
No arguments are required.
Theme — a value of this type
rectpub fn rect(x f64,y f64,width f64,height f64) layout.RectRectangle.
x f64y f64width f64height f64layout.Rect — a value of this type
struct Scaffoldpub struct Scaffold {
pub width f64
pub height f64
pub wide bool
pub safe Insets
pub header layout.Rect
pub body layout.Rect
pub navigation layout.Rect
pub action layout.Rect
}Structure encapsulating width, height, wide, safe, header.
width f64height f64wide boolsafe Insetsheader layout.Rectbody layout.Rectnavigation layout.Rectaction layout.Rectscaffold_withpub fn scaffold_with(width f64,height f64,safe Insets) ScaffoldEdge-to-edge layout inside width/height while placing interactive controls inside safe. Throws on failure; handle the error or propagate it to the caller.
width f64height f64safe InsetsScaffold — a value of this type
scaffoldpub fn scaffold(width f64,height f64) ScaffoldA bottom tab bar and thumb-reachable action in portrait; a navigation rail and two-pane body when a short, wide viewport would waste vertical space.
width f64height f64Scaffold — a value of this type
tab_boundspub fn tab_bounds(shell &Scaffold,index int) layout.RectTab bounds.
shell &Scaffoldindex intlayout.Rect — a value of this type
sheet_boundspub fn sheet_bounds(width f64,height f64,preferred_height f64) layout.RectSheet bounds.
width f64height f64preferred_height f64layout.Rect — a value of this type
sheet_bounds_withpub fn sheet_bounds_with(shell &Scaffold,preferred_height f64) layout.RectSheet bounds with.
shell &Scaffoldpreferred_height f64layout.Rect — a value of this type
snackbar_boundspub fn snackbar_bounds(shell &Scaffold) layout.RectSnackbar bounds.
shell &Scaffoldlayout.Rect — a value of this type
intersectionpub fn intersection(a &layout.Rect,b &layout.Rect) layout.RectExecute intersection.
a &layout.Rectb &layout.Rectlayout.Rect — a value of this type
dialog_boundspub fn dialog_bounds(width f64,height f64,safe Insets,ime_bottom f64,dialog_height f64) layout.RectDialog bounds.
width f64height f64safe Insetsime_bottom f64dialog_height f64layout.Rect — a value of this type
dialog_button_boundspub fn dialog_button_bounds(dialog &layout.Rect,which int) layout.RectDialog button bounds.
dialog &layout.Rectwhich intlayout.Rect — a value of this type
segmented_item_boundspub fn segmented_item_bounds(bounds &layout.Rect,count int,index int) layout.RectSegmented item bounds.
bounds &layout.Rectcount intindex intlayout.Rect — a value of this type
slider_value_atpub fn slider_value_at(bounds &layout.Rect,x f64,min_val f64,max_val f64,step f64) f64Slider value at.
bounds &layout.Rectx f64min_val f64max_val f64step f64f64 — a value of this type
const DRAG_NONEpub const DRAG_NONE = 0Constant DRAG_NONE, defining protocol or algorithm parameters.
const DRAG_VERTICALpub const DRAG_VERTICAL = 1Constant DRAG_VERTICAL, defining protocol or algorithm parameters.
const DRAG_HORIZONTALpub const DRAG_HORIZONTAL = 2Constant DRAG_HORIZONTAL, defining protocol or algorithm parameters.
struct Touchpub struct Touch {
}Targets are registered in paint order. Later targets win, so a modal can block its entire surface with id=0 and register only its own actions above it.
This type has no public fields.
touchpub fn touch(identity &ui.CanvasEvent) TouchExecute touch.
identity &ui.CanvasEventTouch — a value of this type
($&Touch) set_bouncingpub fn (t $&Touch) set_bouncing(enabled bool)Operation on $&Touch: set bouncing.
t $&TouchTouch instance used by this call (exclusive borrow).enabled boolThis call does not return a value.
($&Touch) set_edge_backpub fn (t $&Touch) set_edge_back(enabled bool,safe_left f64)Operation on $&Touch: set edge back.
t $&TouchTouch instance used by this call (exclusive borrow).enabled boolsafe_left f64This call does not return a value.
($&Touch) set_refresh_enabledpub fn (t $&Touch) set_refresh_enabled(enabled bool)Operation on $&Touch: set refresh enabled.
t $&TouchTouch instance used by this call (exclusive borrow).enabled boolThis call does not return a value.
(&Touch) refresh_pullpub fn (t &Touch) refresh_pull() f64Operation on &Touch: refresh pull.
t &TouchTouch instance used by this call (borrow).f64 — a value of this type
(&Touch) refresh_progresspub fn (t &Touch) refresh_progress() f64Operation on &Touch: refresh progress.
t &TouchTouch instance used by this call (borrow).f64 — a value of this type
(&Touch) refresh_readypub fn (t &Touch) refresh_ready() boolOperation on &Touch: refresh ready.
t &TouchTouch instance used by this call (borrow).bool — true or false
($&Touch) take_refreshpub fn (t $&Touch) take_refresh() boolOperation on $&Touch: take refresh.
t $&TouchTouch instance used by this call (exclusive borrow).bool — true or false
($&Touch) take_refresh_hapticpub fn (t $&Touch) take_refresh_haptic() boolOperation on $&Touch: take refresh haptic.
t $&TouchTouch instance used by this call (exclusive borrow).bool — true or false
($&Touch) beginpub fn (t $&Touch) begin()Execute begin on $&Touch.
t $&TouchTouch instance used by this call (exclusive borrow).This call does not return a value.
($&Touch) selection_regionpub fn (t $&Touch) selection_region(bounds layout.Rect,active bool)Operation on $&Touch: selection region.
t $&TouchTouch instance used by this call (exclusive borrow).bounds layout.Rectactive boolThis call does not return a value.
($&Touch) targetpub fn (t $&Touch) target(id int,bounds layout.Rect) intExecute target on $&Touch. Throws on failure; handle the error or propagate it to the caller.
t $&TouchTouch instance used by this call (exclusive borrow).id intbounds layout.Rectint — a value of this type
(&Touch) pressedpub fn (t &Touch) pressed(id int) boolExecute pressed on &Touch.
t &TouchTouch instance used by this call (borrow).id intbool — true or false
(&Touch) offsetpub fn (t &Touch) offset() f64Execute offset on &Touch.
t &TouchTouch instance used by this call (borrow).f64 — a value of this type
(&Touch) scroll_offsetpub fn (t &Touch) scroll_offset() f64Operation on &Touch: scroll offset.
t &TouchTouch instance used by this call (borrow).f64 — a value of this type
(&Touch) scroll_maximumpub fn (t &Touch) scroll_maximum() f64Operation on &Touch: scroll maximum.
t &TouchTouch instance used by this call (borrow).f64 — a value of this type
(&Touch) tap_xpub fn (t &Touch) tap_x() f64Operation on &Touch: tap x.
t &TouchTouch instance used by this call (borrow).f64 — a value of this type
(&Touch) tap_ypub fn (t &Touch) tap_y() f64Operation on &Touch: tap y.
t &TouchTouch instance used by this call (borrow).f64 — a value of this type
(&Touch) was_draggedpub fn (t &Touch) was_dragged() boolOperation on &Touch: was dragged.
t &TouchTouch instance used by this call (borrow).bool — true or false
(&Touch) click_countpub fn (t &Touch) click_count() intOperation on &Touch: click count.
t &TouchTouch instance used by this call (borrow).int — a value of this type
(&Touch) pointer_downpub fn (t &Touch) pointer_down() boolOperation on &Touch: pointer down.
t &TouchTouch instance used by this call (borrow).bool — true or false
(&Touch) is_selection_dragpub fn (t &Touch) is_selection_drag() boolOperation on &Touch: whether it is selection drag.
t &TouchTouch instance used by this call (borrow).bool — true or false
($&Touch) set_selection_dragpub fn (t $&Touch) set_selection_drag(active bool)Operation on $&Touch: set selection drag.
t $&TouchTouch instance used by this call (exclusive borrow).active boolThis call does not return a value.
(&Touch) is_waiting_long_presspub fn (t &Touch) is_waiting_long_press() boolOperation on &Touch: whether it is waiting long press.
t &TouchTouch instance used by this call (borrow).bool — true or false
(&Touch) is_long_pressedpub fn (t &Touch) is_long_pressed() boolOperation on &Touch: whether it is long pressed.
t &TouchTouch instance used by this call (borrow).bool — true or false
($&Touch) poll_long_press_atpub fn (t $&Touch) poll_long_press_at(now_ns int) boolOperation on $&Touch: poll long press at.
t $&TouchTouch instance used by this call (exclusive borrow).now_ns intbool — true or false
($&Touch) poll_long_presspub fn (t $&Touch) poll_long_press() boolOperation on $&Touch: poll long press.
t $&TouchTouch instance used by this call (exclusive borrow).bool — true or false
($&Touch) take_long_presspub fn (t $&Touch) take_long_press() intOperation on $&Touch: take long press.
t $&TouchTouch instance used by this call (exclusive borrow).int — a value of this type
($&Touch) ensure_visiblepub fn (t $&Touch) ensure_visible(content_top f64,content_height f64)Operation on $&Touch: ensure visible.
t $&TouchTouch instance used by this call (exclusive borrow).content_top f64content_height f64This call does not return a value.
(&Touch) animatingpub fn (t &Touch) animating() boolExecute animating on &Touch.
t &TouchTouch instance used by this call (borrow).bool — true or false
(&Touch) edge_swipe_progresspub fn (t &Touch) edge_swipe_progress(width f64) f64Operation on &Touch: edge swipe progress.
t &TouchTouch instance used by this call (borrow).width f64f64 — a value of this type
($&Touch) block_scrollpub fn (t $&Touch) block_scroll()A modal blocks the scroll gesture without discarding the underlying offset.
t $&TouchTouch instance used by this call (exclusive borrow).This call does not return a value.
($&Touch) cancelpub fn (t $&Touch) cancel()Execute cancel on $&Touch.
t $&TouchTouch instance used by this call (exclusive borrow).This call does not return a value.
($&Touch) reset_scrollpub fn (t $&Touch) reset_scroll()Operation on $&Touch: reset scroll.
t $&TouchTouch instance used by this call (exclusive borrow).This call does not return a value.
($&Touch) scroll_regionpub fn (t $&Touch) scroll_region(bounds layout.Rect,content_height f64) intOperation on $&Touch: scroll region. Throws on failure; handle the error or propagate it to the caller.
t $&TouchTouch instance used by this call (exclusive borrow).bounds layout.Rectcontent_height f64int — a value of this type
($&Touch) step_atpub fn (t $&Touch) step_at(now_ns int) boolOperation on $&Touch: step at.
t $&TouchTouch instance used by this call (exclusive borrow).now_ns intbool — true or false
($&Touch) steppub fn (t $&Touch) step() boolExecute step on $&Touch.
t $&TouchTouch instance used by this call (exclusive borrow).bool — true or false
($&Touch) eventpub fn (t $&Touch) event(event &ui.Event) intAn activation requires a matching down/up, the same target, and movement below the drag threshold. A vertical drag scrolls without activating a row tapping a spinning list halts inertia without triggering the underlying item. Throws on failure; handle the error or propagate it to the caller.
t $&TouchTouch instance used by this call (exclusive borrow).event &ui.Eventint — a value of this type
(&Touch) swipe_backpub fn (t &Touch) swipe_back(event &ui.Event,width f64) boolLeft-edge horizontal swipe-back gesture. Read before event consumes pointer-up.
t &TouchTouch instance used by this call (borrow).event &ui.Eventwidth f64bool — true or false
(&Touch) swipe_downpub fn (t &Touch) swipe_down(event &ui.Event,area layout.Rect) boolBottom-sheet grabber/header gesture. Read before event consumes pointer-up.
t &TouchTouch instance used by this call (borrow).event &ui.Eventarea layout.Rectbool — true or false
struct Insetspub struct Insets {
pub top f64
pub bottom f64
pub left f64
pub right f64
pub ime_bottom f64
}Safe-area and soft-keyboard (IME) insets in logical points / DIP, aligned with Flutter's MediaQuery viewPadding vs viewInsets split.
top f64bottom f64left f64right f64ime_bottom f64insets_zeropub fn insets_zero() InsetsInsets zero.
No arguments are required.
Insets — a value of this type
(Insets) with_imepub fn (i Insets) with_ime(ime f64) InsetsOperation on Insets: derive a new value with ime.
i InsetsInsets instance used by this call (value receiver).ime f64Insets — a value of this type
(Insets) view_padding_bottompub fn (i Insets) view_padding_bottom() f64Persistent bottom inset uncovered by the soft keyboard (Flutter padding.bottom).
i InsetsInsets instance used by this call (value receiver).f64 — a value of this type
(Insets) bottom_clearancepub fn (i Insets) bottom_clearance() f64Bottom clearance above both system gesture bar / home indicator and active IME.
i InsetsInsets instance used by this call (value receiver).f64 — a value of this type
parse_insetspub fn parse_insets(raw &string) InsetsParse as insets.
raw &stringInsets — a value of this type
host_insetspub fn host_insets() InsetsHost insets.
No arguments are required.
Insets — a value of this type
reduced_motionpub fn reduced_motion() boolReduced motion.
No arguments are required.
bool — true or false
const MAX_ROUTE_DEPTHpub const MAX_ROUTE_DEPTH = 16Constant MAX_ROUTE_DEPTH, defining protocol or algorithm parameters.
struct Routepub struct Route {
pub id int
pub arg int
pub title string
}Structure encapsulating id, arg, title.
id intarg inttitle stringstruct RouteStackpub struct RouteStack {
pub drag_progress f64
pub edge_swiping bool
}Single-source navigation stack aligned with Flutter's Navigator / PopScope.
drag_progress f64edge_swiping boolroute_stackpub fn route_stack(root_id int,root_title string) RouteStackRoute stack.
root_id introot_title stringRouteStack — a value of this type
(&RouteStack) depthpub fn (s &RouteStack) depth() intExecute depth on &RouteStack.
s &RouteStackRouteStack instance used by this call (borrow).int — a value of this type
(&RouteStack) can_poppub fn (s &RouteStack) can_pop() boolOperation on &RouteStack: can pop.
s &RouteStackRouteStack instance used by this call (borrow).bool — true or false
(&RouteStack) toppub fn (s &RouteStack) top() RouteExecute top on &RouteStack.
s &RouteStackRouteStack instance used by this call (borrow).Route — a value of this type
(&RouteStack) previouspub fn (s &RouteStack) previous() RouteExecute previous on &RouteStack.
s &RouteStackRouteStack instance used by this call (borrow).Route — a value of this type
($&RouteStack) resetpub fn (s $&RouteStack) reset(root_id int,root_title string)Operation on $&RouteStack: clear internal state so the value can be reused.
s $&RouteStackRouteStack instance used by this call (exclusive borrow).root_id introot_title stringThis call does not return a value.
($&RouteStack) pushpub fn (s $&RouteStack) push(id int,arg int,title string) boolExecute push on $&RouteStack.
s $&RouteStackRouteStack instance used by this call (exclusive borrow).id intarg inttitle stringbool — true or false
($&RouteStack) poppub fn (s $&RouteStack) pop() boolExecute pop on $&RouteStack.
s $&RouteStackRouteStack instance used by this call (exclusive borrow).bool — true or false
($&RouteStack) pop_to_rootpub fn (s $&RouteStack) pop_to_root() intOperation on $&RouteStack: pop to root.
s $&RouteStackRouteStack instance used by this call (exclusive borrow).int — a value of this type
($&RouteStack) set_dragpub fn (s $&RouteStack) set_drag(progress f64,active bool)Operation on $&RouteStack: set drag.
s $&RouteStackRouteStack instance used by this call (exclusive borrow).progress f64active boolThis call does not return a value.
struct Snackbarpub struct Snackbar {
pub active bool
pub message string
pub action_label string
pub action_id int
pub deadline_ns int
}Timed transient feedback strip positioned above bottom navigation / IME.
active boolmessage stringaction_label stringaction_id intdeadline_ns intsnackbar_emptypub fn snackbar_empty() SnackbarSnackbar empty.
No arguments are required.
Snackbar — a value of this type
($&Snackbar) show_atpub fn (b $&Snackbar) show_at(message string,action_id int,action_label string,duration_ms int,now_ns int)Operation on $&Snackbar: show at.
b $&SnackbarSnackbar instance used by this call (exclusive borrow).message stringaction_id intaction_label stringduration_ms intnow_ns intThis call does not return a value.
($&Snackbar) showpub fn (b $&Snackbar) show(message string,action_id int,action_label string,duration_ms int)Execute show on $&Snackbar.
b $&SnackbarSnackbar instance used by this call (exclusive borrow).message stringaction_id intaction_label stringduration_ms intThis call does not return a value.
($&Snackbar) dismisspub fn (b $&Snackbar) dismiss()Execute dismiss on $&Snackbar.
b $&SnackbarSnackbar instance used by this call (exclusive borrow).This call does not return a value.
(&Snackbar) remaining_mspub fn (b &Snackbar) remaining_ms(now_ns int) intOperation on &Snackbar: remaining ms.
b &SnackbarSnackbar instance used by this call (borrow).now_ns intint — a value of this type
($&Snackbar) tickpub fn (b $&Snackbar) tick(now_ns int) boolAdvance animation clock and state transition step.
b $&SnackbarSnackbar instance used by this call (exclusive borrow).now_ns intbool — true or false
const LOCALE_ENpub const LOCALE_EN = 0Constant LOCALE_EN, defining protocol or algorithm parameters.
const LOCALE_ZH_CNpub const LOCALE_ZH_CN = 1Constant LOCALE_ZH_CN, defining protocol or algorithm parameters.
const ACTION_BAR_NONEpub const ACTION_BAR_NONE = 0Constant ACTION_BAR_NONE, defining protocol or algorithm parameters.
const ACTION_BAR_COPYpub const ACTION_BAR_COPY = 1Constant ACTION_BAR_COPY, defining protocol or algorithm parameters.
const ACTION_BAR_CUTpub const ACTION_BAR_CUT = 2Constant ACTION_BAR_CUT, defining protocol or algorithm parameters.
const ACTION_BAR_PASTEpub const ACTION_BAR_PASTE = 3Constant ACTION_BAR_PASTE, defining protocol or algorithm parameters.
const ACTION_BAR_SELECT_ALLpub const ACTION_BAR_SELECT_ALL = 4Constant ACTION_BAR_SELECT_ALL, defining protocol or algorithm parameters.
struct PhoneActionBarItempub struct PhoneActionBarItem {
pub cmd int
pub rect layout.Rect
pub label string
pub enabled bool
}Structure encapsulating cmd, rect, label, enabled.
cmd intrect layout.Rectlabel stringenabled boolstruct PhoneActionBarpub struct PhoneActionBar {
pub bounds layout.Rect
pub items []PhoneActionBarItem
}Structure encapsulating bounds, items.
bounds layout.Rectitems []PhoneActionBarItemstruct SelectableTextResultpub struct SelectableTextResult {
pub changed bool
pub copied bool
pub focused bool
pub blurred bool
pub needs_paint bool
pub consumed bool
}Structure encapsulating changed, copied, focused, blurred, needs_paint.
changed boolcopied boolfocused boolblurred boolneeds_paint boolconsumed boolstruct SelectableTextpub struct SelectableText {
pub id int
pub identity ui.CanvasEvent
pub bounds layout.Rect
pub value string
pub size f64
pub weight int
pub line_height f64
pub align int
pub multiline bool
pub selectable bool
pub focused bool
pub anchor int
pub focus int
pub locale int
}Structure encapsulating id, identity, bounds, value, size.
id intidentity ui.CanvasEventbounds layout.Rectvalue stringsize f64weight intline_height f64align intmultiline boolselectable boolfocused boolanchor intfocus intlocale intselectable_textpub fn selectable_text(context &draw.Context,identity &ui.CanvasEvent,id int,value string,size f64,multiline bool) SelectableTextCreate a standalone selectable label or multi-line paragraph for mobile UIs. Supports drag selection, double-tap word, triple-tap line, long-press menu, and keyboard shortcuts (Cmd/Ctrl+A, Cmd/Ctrl+C, Shift+Arrows).
context &draw.Contextidentity &ui.CanvasEventid intvalue stringsize f64multiline boolSelectableText — a value of this type
($&SelectableText) set_valuepub fn (s $&SelectableText) set_value(value string) intOperation on $&SelectableText: set value. Throws on failure; handle the error or propagate it to the caller.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).value stringint — a value of this type
($&SelectableText) set_stylepub fn (s $&SelectableText) set_style(weight int,line_height f64,align int)Operation on $&SelectableText: set style.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).weight intline_height f64align intThis call does not return a value.
($&SelectableText) set_localepub fn (s $&SelectableText) set_locale(locale int)Operation on $&SelectableText: set locale.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).locale intThis call does not return a value.
($&SelectableText) set_selectablepub fn (s $&SelectableText) set_selectable(selectable bool)Operation on $&SelectableText: set selectable.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).selectable boolThis call does not return a value.
(&SelectableText) is_selectablepub fn (s &SelectableText) is_selectable() boolOperation on &SelectableText: whether it is selectable.
s &SelectableTextSelectableText instance used by this call (borrow).bool — true or false
(&SelectableText) has_selectionpub fn (s &SelectableText) has_selection() boolOperation on &SelectableText: whether it has selection.
s &SelectableTextSelectableText instance used by this call (borrow).bool — true or false
(&SelectableText) selected_textpub fn (s &SelectableText) selected_text() stringOperation on &SelectableText: selected text.
s &SelectableTextSelectableText instance used by this call (borrow).string — result string
($&SelectableText) select_allpub fn (s $&SelectableText) select_all() intOperation on $&SelectableText: select all.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).int — a value of this type
($&SelectableText) clear_selectionpub fn (s $&SelectableText) clear_selection()Operation on $&SelectableText: clear selection.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).This call does not return a value.
($&SelectableText) copy_selectionpub fn (s $&SelectableText) copy_selection() intOperation on $&SelectableText: copy selection.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).int — a value of this type
(&SelectableText) cursor_atpub fn (s &SelectableText) cursor_at(x f64,y f64) intOperation on &SelectableText: cursor at.
s &SelectableTextSelectableText instance used by this call (borrow).x f64y f64int — a value of this type
(&SelectableText) measure_heightpub fn (s &SelectableText) measure_height(c $&Canvas,width f64) f64Operation on &SelectableText: measure height.
s &SelectableTextSelectableText instance used by this call (borrow).c $&Canvaswidth f64f64 — a value of this type
($&SelectableText) handle_long_presspub fn (s $&SelectableText) handle_long_press(touches &Touch) boolOperation on $&SelectableText: handle long press.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).touches &Touchbool — true or false
($&SelectableText) handle_eventpub fn (s $&SelectableText) handle_event(event &ui.Event,touches &Touch,action int) SelectableTextResultOperation on $&SelectableText: handle event.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).event &ui.Eventtouches &Touchaction intSelectableTextResult — a value of this type
($&SelectableText) set_font_stackpub fn (s $&SelectableText) set_font_stack(stack font.FontStack)Operation on $&SelectableText: set font stack.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).stack font.FontStackThis call does not return a value.
($&SelectableText) add_ttf_bytespub fn (s $&SelectableText) add_ttf_bytes(ttf_bytes &[]u8,font_index int,face_id int) intOperation on $&SelectableText: add ttf bytes. Throws on failure; handle the error or propagate it to the caller.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).ttf_bytes &[]u8font_index intface_id intint — a value of this type
($&SelectableText) drawpub fn (s $&SelectableText) draw(c $&Canvas,t $&Touch,bounds layout.Rect,clip &layout.Rect,theme &Theme,color draw.Color) f64Execute draw on $&SelectableText. Throws on failure; handle the error or propagate it to the caller.
s $&SelectableTextSelectableText instance used by this call (exclusive borrow).c $&Canvast $&Touchbounds layout.Rectclip &layout.Recttheme &Themecolor draw.Colorf64 — a value of this type
const FIELD_HEIGHTpub const FIELD_HEIGHT = 48Constant FIELD_HEIGHT, defining protocol or algorithm parameters.
text_field_heightpub fn text_field_height() f64Text field height.
No arguments are required.
f64 — a value of this type
struct TextFieldpub struct TextField {
pub id int
pub clear_id int
pub identity ui.CanvasEvent
pub bounds layout.Rect
pub focused bool
pub enabled bool
pub selectable bool
pub password bool
pub locale int
pub error string
pub placeholder string
pub value string
pub anchor int
pub focus int
pub revision int
pub composing bool
pub preedit string
pub replacement_start int
pub replacement_end int
pub preedit_anchor int
pub preedit_focus int
pub offset_x f64
}Structure encapsulating id, clear_id, identity, bounds, focused.
id intclear_id intidentity ui.CanvasEventbounds layout.Rectfocused boolenabled boolselectable boolpassword boollocale interror stringplaceholder stringvalue stringanchor intfocus intrevision intcomposing boolpreedit stringreplacement_start intreplacement_end intpreedit_anchor intpreedit_focus intoffset_x f64struct TextFieldResultpub struct TextFieldResult {
pub changed bool
pub submitted bool
pub blurred bool
pub cleared bool
pub needs_paint bool
}Structure encapsulating changed, submitted, blurred, cleared, needs_paint.
changed boolsubmitted boolblurred boolcleared boolneeds_paint booltext_fieldpub fn text_field(context &draw.Context,identity &ui.CanvasEvent,id int,clear_id int,placeholder string) TextFieldText field.
context &draw.Contextidentity &ui.CanvasEventid intclear_id intplaceholder stringTextField — a value of this type
($&TextField) set_font_stackpub fn (f $&TextField) set_font_stack(stack font.FontStack)Operation on $&TextField: set font stack.
f $&TextFieldTextField instance used by this call (exclusive borrow).stack font.FontStackThis call does not return a value.
($&TextField) add_ttf_bytespub fn (f $&TextField) add_ttf_bytes(ttf_bytes &[]u8,font_index int,face_id int) intOperation on $&TextField: add ttf bytes. Throws on failure; handle the error or propagate it to the caller.
f $&TextFieldTextField instance used by this call (exclusive borrow).ttf_bytes &[]u8font_index intface_id intint — a value of this type
(&TextField) is_focusedpub fn (f &TextField) is_focused() boolOperation on &TextField: whether it is focused.
f &TextFieldTextField instance used by this call (borrow).bool — true or false
(&TextField) is_selectablepub fn (f &TextField) is_selectable() boolOperation on &TextField: whether it is selectable.
f &TextFieldTextField instance used by this call (borrow).bool — true or false
(&TextField) is_passwordpub fn (f &TextField) is_password() boolOperation on &TextField: whether it is password.
f &TextFieldTextField instance used by this call (borrow).bool — true or false
(&TextField) is_copy_enabledpub fn (f &TextField) is_copy_enabled() boolOperation on &TextField: whether it is copy enabled.
f &TextFieldTextField instance used by this call (borrow).bool — true or false
($&TextField) set_copy_enabledpub fn (f $&TextField) set_copy_enabled(on bool)Operation on $&TextField: set copy enabled.
f $&TextFieldTextField instance used by this call (exclusive borrow).on boolThis call does not return a value.
($&TextField) set_localepub fn (f $&TextField) set_locale(locale int)Operation on $&TextField: set locale.
f $&TextFieldTextField instance used by this call (exclusive borrow).locale intThis call does not return a value.
($&TextField) set_selectablepub fn (f $&TextField) set_selectable(selectable bool)Operation on $&TextField: set selectable.
f $&TextFieldTextField instance used by this call (exclusive borrow).selectable boolThis call does not return a value.
($&TextField) set_passwordpub fn (f $&TextField) set_password(password bool)Operation on $&TextField: set password.
f $&TextFieldTextField instance used by this call (exclusive borrow).password boolThis call does not return a value.
(&TextField) display_valuepub fn (f &TextField) display_value() stringOperation on &TextField: display value.
f &TextFieldTextField instance used by this call (borrow).string — result string
(&TextField) display_anchorpub fn (f &TextField) display_anchor() intOperation on &TextField: display anchor.
f &TextFieldTextField instance used by this call (borrow).int — a value of this type
(&TextField) display_focuspub fn (f &TextField) display_focus() intOperation on &TextField: display focus.
f &TextFieldTextField instance used by this call (borrow).int — a value of this type
($&TextField) set_errorpub fn (f $&TextField) set_error(message string)Operation on $&TextField: set error.
f $&TextFieldTextField instance used by this call (exclusive borrow).message stringThis call does not return a value.
($&TextField) blurpub fn (f $&TextField) blur()Execute blur on $&TextField.
f $&TextFieldTextField instance used by this call (exclusive borrow).This call does not return a value.
($&TextField) focus_sessionpub fn (f $&TextField) focus_session(on bool) intOperation on $&TextField: focus session. Throws on failure; handle the error or propagate it to the caller.
f $&TextFieldTextField instance used by this call (exclusive borrow).on boolint — a value of this type
($&TextField) set_valuepub fn (f $&TextField) set_value(value string) intOperation on $&TextField: set value. Throws on failure; handle the error or propagate it to the caller.
f $&TextFieldTextField instance used by this call (exclusive borrow).value stringint — a value of this type
($&TextField) clearpub fn (f $&TextField) clear() intClear all buffered or stored entries and internal state. Throws on failure; handle the error or propagate it to the caller.
f $&TextFieldTextField instance used by this call (exclusive borrow).int — a value of this type
($&TextField) select_allpub fn (f $&TextField) select_all() intOperation on $&TextField: select all.
f $&TextFieldTextField instance used by this call (exclusive borrow).int — a value of this type
(&TextField) has_selectionpub fn (f &TextField) has_selection() boolOperation on &TextField: whether it has selection.
f &TextFieldTextField instance used by this call (borrow).bool — true or false
(&TextField) selected_textpub fn (f &TextField) selected_text() stringOperation on &TextField: selected text.
f &TextFieldTextField instance used by this call (borrow).string — result string
($&TextField) copy_selectionpub fn (f $&TextField) copy_selection() intOperation on $&TextField: copy selection.
f $&TextFieldTextField instance used by this call (exclusive borrow).int — a value of this type
($&TextField) cut_selectionpub fn (f $&TextField) cut_selection() boolOperation on $&TextField: cut selection.
f $&TextFieldTextField instance used by this call (exclusive borrow).bool — true or false
($&TextField) paste_clipboardpub fn (f $&TextField) paste_clipboard() intOperation on $&TextField: paste clipboard.
f $&TextFieldTextField instance used by this call (exclusive borrow).int — a value of this type
(&TextField) cursor_atpub fn (f &TextField) cursor_at(x f64,y f64) intOperation on &TextField: cursor at.
f &TextFieldTextField instance used by this call (borrow).x f64y f64int — a value of this type
($&TextField) handle_eventpub fn (f $&TextField) handle_event(event &ui.Event,touches &Touch,action int) TextFieldResultOperation on $&TextField: handle event.
f $&TextFieldTextField instance used by this call (exclusive borrow).event &ui.Eventtouches &Touchaction intTextFieldResult — a value of this type
($&TextField) drawpub fn (f $&TextField) draw(c $&Canvas,t $&Touch,bounds layout.Rect,clip &layout.Rect,theme &Theme) intExecute draw on $&TextField. Throws on failure; handle the error or propagate it to the caller.
f $&TextFieldTextField instance used by this call (exclusive borrow).c $&Canvast $&Touchbounds layout.Rectclip &layout.Recttheme &Themeint — a value of this type
(&TextField) draw_errorpub fn (f &TextField) draw_error(c $&Canvas,bounds layout.Rect,theme &Theme) intOperation on &TextField: draw error.
f &TextFieldTextField instance used by this call (borrow).c $&Canvasbounds layout.Recttheme &Themeint — a value of this type