XU XUv0.13.1
中文

#ui/phone

import: #ui/phone

counts: 39 functions, 154 methods, 14 types, 52 constants, 0 method sets

Mobile UI

#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.

Package an app and configure the platform tools using the mobile app guide.

const NONE

XuAPI
pub const NONE = 0

Purpose

Constant NONE, defining protocol or algorithm parameters.

const IOS

XuAPI
pub const IOS = 1

Purpose

Constant IOS, defining protocol or algorithm parameters.

const ANDROID

XuAPI
pub const ANDROID = 2

Purpose

Constant ANDROID, defining protocol or algorithm parameters.

const HAPTIC_SELECTION

XuAPI
pub const HAPTIC_SELECTION = 1

Purpose

Constant HAPTIC_SELECTION, defining protocol or algorithm parameters.

const HAPTIC_IMPACT

XuAPI
pub const HAPTIC_IMPACT = 2

Purpose

Constant HAPTIC_IMPACT, defining protocol or algorithm parameters.

const HAPTIC_SUCCESS

XuAPI
pub const HAPTIC_SUCCESS = 3

Purpose

Constant HAPTIC_SUCCESS, defining protocol or algorithm parameters.

const HAPTIC_ERROR

XuAPI
pub const HAPTIC_ERROR = 4

Purpose

Constant HAPTIC_ERROR, defining protocol or algorithm parameters.

platform

XuAPI
pub fn platform() int

Purpose

Phone applications retain the Darwin/Linux runtime ABI. Query the application platform here rather than inferring it from xu_target_os.

Parameters

No arguments are required.

Returns

int — a value of this type

available

XuAPI
pub fn available() bool

Purpose

Execute available.

Parameters

No arguments are required.

Returns

bool — true or false

set_back_enabled

XuAPI
pub fn set_back_enabled(enabled bool) int

Purpose

Capture 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.

Parameters

enabled bool
enabled (bool)

Returns

int — a value of this type

set_dark_appearance

XuAPI
pub fn set_dark_appearance(dark bool) int

Purpose

Match system status/navigation bars and safe-area backgrounds to the theme. Throws on failure; handle the error or propagate it to the caller.

Parameters

dark bool
dark (bool)

Returns

int — a value of this type

set_overlay

XuAPI
pub fn set_overlay(visible bool) int

Purpose

Extend a bottom sheet's scrim and surface through the native safe areas. Throws on failure; handle the error or propagate it to the caller.

Parameters

visible bool
visible (bool)

Returns

int — a value of this type

haptic

XuAPI
pub fn haptic(kind int)

Purpose

Request a lightweight native haptic feedback cue. Falls back cleanly when running headless or on a host without a haptic bridge.

Parameters

kind int
kind tag (int)

Returns

This call does not return a value.

struct Canvas

XuAPI
pub struct Canvas {
    pub frame draw.Frame
}

Purpose

Reuses the Draw frame/resource protocol. Temporary layouts remain alive until present accepts the complete frame, then the frame lease retains them.

Public fields

frame draw.Frame
field (draw.Frame)

canvas

XuAPI
pub fn canvas(context &draw.Context) Canvas

Purpose

Execute canvas.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)

Returns

Canvas — a value of this type

canvas_with_identity

XuAPI
pub fn canvas_with_identity(context &draw.Context,identity &ui.CanvasEvent) Canvas

Purpose

Canvas with identity.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)

Returns

Canvas — a value of this type

($&Canvas) set_identity

XuAPI
pub fn (c $&Canvas) set_identity(identity &ui.CanvasEvent)

Purpose

Operation on $&Canvas: set identity.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)

Returns

This call does not return a value.

($&Canvas) set_locale

XuAPI
pub fn (c $&Canvas) set_locale(locale int)

Purpose

Operation on $&Canvas: set locale.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
locale int
locale (int)

Returns

This call does not return a value.

($&Canvas) set_text_selectable

XuAPI
pub fn (c $&Canvas) set_text_selectable(id int,selectable bool)

Purpose

Operation on $&Canvas: set text selectable.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
id int
id (int)
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Canvas) is_text_selectable

XuAPI
pub fn (c &Canvas) is_text_selectable(id int) bool

Purpose

Operation on &Canvas: whether it is text selectable.

Parameters

c &Canvas
The Canvas instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

(&Canvas) selected_text

XuAPI
pub fn (c &Canvas) selected_text(id int) string

Purpose

Operation on &Canvas: selected text.

Parameters

c &Canvas
The Canvas instance used by this call (borrow).
id int
id (int)

Returns

string — result string

($&Canvas) set_font_stack

XuAPI
pub fn (c $&Canvas) set_font_stack(stack font.FontStack)

Purpose

Operation on $&Canvas: set font stack.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
stack font.FontStack
stack (font.FontStack)

Returns

This call does not return a value.

($&Canvas) add_ttf_bytes

XuAPI
pub fn (c $&Canvas) add_ttf_bytes(ttf_bytes &[]u8,font_index int,face_id int) int

Purpose

Operation on $&Canvas: add ttf bytes. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
ttf_bytes &[]u8
ttf_bytes (read-only borrow; caller keeps the original; type &[]u8)
font_index int
font_index (int)
face_id int
face_id (int)

Returns

int — a value of this type

($&Canvas) begin

XuAPI
pub fn (c $&Canvas) begin(theme &Theme) int

Purpose

Execute begin on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

($&Canvas) present

XuAPI
pub fn (c $&Canvas) present() int

Purpose

Execute present on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Canvas) export_xdf

XuAPI
pub fn (c $&Canvas) export_xdf() string

Purpose

Operation on $&Canvas: export xdf. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).

Returns

string — result string

($&Canvas) dispose

XuAPI
pub fn (c $&Canvas) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Canvas) shape_text

XuAPI
pub fn (c $&Canvas) shape_text(value &string,size f64,weight int,line_height f64,width f64,align int) draw.TextLayout

Purpose

Operation on $&Canvas: shape text. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
value &string
value (read-only borrow; caller keeps the original; type &string)
size f64
size (f64)
weight int
weight (int)
line_height f64
line_height (f64)
width f64
width (f64)
align int
align (int)

Returns

draw.TextLayout — a value of this type

($&Canvas) put_text

XuAPI
pub fn (c $&Canvas) put_text(text draw.TextLayout,x f64,y f64,color draw.Color) int

Purpose

Operation on $&Canvas: put text. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
text draw.TextLayout
text (draw.TextLayout)
x f64
value (f64)
y f64
value (f64)
color draw.Color
color (draw.Color)

Returns

int — a value of this type

($&Canvas) label

XuAPI
pub fn (c $&Canvas) label(bounds layout.Rect,value string,size f64,weight int,color draw.Color,align int) int

Purpose

Single-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.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
value string
value (string)
size f64
size (f64)
weight int
weight (int)
color draw.Color
color (draw.Color)
align int
align (int)

Returns

int — a value of this type

($&Canvas) measure_paragraph

XuAPI
pub fn (c $&Canvas) measure_paragraph(value &string,size f64,weight int,line_height f64,width f64) f64

Purpose

Measure wrapped multi-line height at width without retaining a layout handle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
value &string
value (read-only borrow; caller keeps the original; type &string)
size f64
size (f64)
weight int
weight (int)
line_height f64
line_height (f64)
width f64
width (f64)

Returns

f64 — a value of this type

($&Canvas) paragraph

XuAPI
pub fn (c $&Canvas) paragraph(bounds layout.Rect,value string,size f64,weight int,line_height f64,color draw.Color,align int) f64

Purpose

Draw wrapped multi-line text inside bounds.width and return measured height. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
value string
value (string)
size f64
size (f64)
weight int
weight (int)
line_height f64
line_height (f64)
color draw.Color
color (draw.Color)
align int
align (int)

Returns

f64 — a value of this type

($&Canvas) selectable_label

XuAPI
pub 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) int

Purpose

Operation on $&Canvas: selectable label. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
t $&Touch
t (exclusive borrow; may modify the original; type $&Touch)
id int
id (int)
bounds layout.Rect
bounds (layout.Rect)
value string
value (string)
size f64
size (f64)
weight int
weight (int)
color draw.Color
color (draw.Color)
align int
align (int)
clip &layout.Rect
clip (read-only borrow; caller keeps the original; type &layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

($&Canvas) selectable_paragraph

XuAPI
pub 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) f64

Purpose

Operation on $&Canvas: selectable paragraph. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
t $&Touch
t (exclusive borrow; may modify the original; type $&Touch)
id int
id (int)
bounds layout.Rect
bounds (layout.Rect)
value string
value (string)
size f64
size (f64)
weight int
weight (int)
line_height f64
line_height (f64)
color draw.Color
color (draw.Color)
align int
align (int)
clip &layout.Rect
clip (read-only borrow; caller keeps the original; type &layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

f64 — a value of this type

($&Canvas) draw_selectable

XuAPI
pub fn (c $&Canvas) draw_selectable(state $&SelectableText,t $&Touch,bounds layout.Rect,clip &layout.Rect,theme &Theme,color draw.Color) f64

Purpose

Operation on $&Canvas: draw selectable. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
state $&SelectableText
state (exclusive borrow; may modify the original; type $&SelectableText)
t $&Touch
t (exclusive borrow; may modify the original; type $&Touch)
bounds layout.Rect
bounds (layout.Rect)
clip &layout.Rect
clip (read-only borrow; caller keeps the original; type &layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
color draw.Color
color (draw.Color)

Returns

f64 — a value of this type

($&Canvas) handle_text_selection

XuAPI
pub fn (c $&Canvas) handle_text_selection(event &ui.Event,touches &Touch,action int) SelectableTextResult

Purpose

Operation on $&Canvas: handle text selection.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)
touches &Touch
touches (read-only borrow; caller keeps the original; type &Touch)
action int
action (int)

Returns

SelectableTextResult — a value of this type

($&Canvas) card

XuAPI
pub fn (c $&Canvas) card(bounds layout.Rect,theme &Theme) int

Purpose

Execute card on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

const ICON_HOME

XuAPI
pub const ICON_HOME = 1

Purpose

Constant ICON_HOME, defining protocol or algorithm parameters.

const ICON_HISTORY

XuAPI
pub const ICON_HISTORY = 2

Purpose

Constant ICON_HISTORY, defining protocol or algorithm parameters.

const ICON_SETTINGS

XuAPI
pub const ICON_SETTINGS = 3

Purpose

Constant ICON_SETTINGS, defining protocol or algorithm parameters.

const ICON_PLUS

XuAPI
pub const ICON_PLUS = 4

Purpose

Constant ICON_PLUS, defining protocol or algorithm parameters.

const ICON_CHEVRON

XuAPI
pub const ICON_CHEVRON = 5

Purpose

Constant ICON_CHEVRON, defining protocol or algorithm parameters.

const ICON_CLOSE

XuAPI
pub const ICON_CLOSE = 6

Purpose

Constant ICON_CLOSE, defining protocol or algorithm parameters.

const ICON_CHECK

XuAPI
pub const ICON_CHECK = 7

Purpose

Constant ICON_CHECK, defining protocol or algorithm parameters.

const ICON_FOCUS

XuAPI
pub const ICON_FOCUS = 8

Purpose

Constant ICON_FOCUS, defining protocol or algorithm parameters.

const ICON_BOOK

XuAPI
pub const ICON_BOOK = 9

Purpose

Constant ICON_BOOK, defining protocol or algorithm parameters.

const ICON_ACTIVITY

XuAPI
pub const ICON_ACTIVITY = 10

Purpose

Constant ICON_ACTIVITY, defining protocol or algorithm parameters.

const ICON_BACK

XuAPI
pub const ICON_BACK = 11

Purpose

Constant ICON_BACK, defining protocol or algorithm parameters.

const ICON_REFRESH

XuAPI
pub const ICON_REFRESH = 12

Purpose

Constant ICON_REFRESH, defining protocol or algorithm parameters.

const ICON_COPY

XuAPI
pub const ICON_COPY = 13

Purpose

Constant ICON_COPY, defining protocol or algorithm parameters.

const TONE_SECONDARY

XuAPI
pub const TONE_SECONDARY = 0

Purpose

Constant TONE_SECONDARY, defining protocol or algorithm parameters.

const TONE_PRIMARY

XuAPI
pub const TONE_PRIMARY = 1

Purpose

Constant TONE_PRIMARY, defining protocol or algorithm parameters.

const TONE_DANGER

XuAPI
pub const TONE_DANGER = 2

Purpose

Constant TONE_DANGER, defining protocol or algorithm parameters.

($&Canvas) icon

XuAPI
pub fn (c $&Canvas) icon(bounds layout.Rect,kind int,color draw.Color) int

Purpose

Execute icon on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
kind int
kind tag (int)
color draw.Color
color (draw.Color)

Returns

int — a value of this type

($&Canvas) button_tone

XuAPI
pub fn (c $&Canvas) button_tone(bounds layout.Rect,theme &Theme,label string,tone int,pressed bool) int

Purpose

Operation on $&Canvas: button tone. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
label string
label (string)
tone int
tone (int)
pressed bool
pressed (bool)

Returns

int — a value of this type

($&Canvas) button

XuAPI
pub fn (c $&Canvas) button(bounds layout.Rect,theme &Theme,label string,primary bool,pressed bool) int

Purpose

Execute button on $&Canvas.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
label string
label (string)
primary bool
primary (bool)
pressed bool
pressed (bool)

Returns

int — a value of this type

($&Canvas) chip

XuAPI
pub fn (c $&Canvas) chip(bounds layout.Rect,theme &Theme,label string,selected bool,pressed bool) int

Purpose

Execute chip on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
label string
label (string)
selected bool
selected (bool)
pressed bool
pressed (bool)

Returns

int — a value of this type

($&Canvas) navigation

XuAPI
pub fn (c $&Canvas) navigation(shell &Scaffold,theme &Theme,selected int,touches &Touch) int

Purpose

Execute navigation on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
shell &Scaffold
shell (read-only borrow; caller keeps the original; type &Scaffold)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
selected int
selected (int)
touches &Touch
touches (read-only borrow; caller keeps the original; type &Touch)

Returns

int — a value of this type

($&Canvas) scrollbar

XuAPI
pub fn (c $&Canvas) scrollbar(bounds &layout.Rect,theme &Theme,scroll f64,maximum f64,content_height f64) int

Purpose

Execute scrollbar on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
scroll f64
scroll (f64)
maximum f64
maximum (f64)
content_height f64
content_height (f64)

Returns

int — a value of this type

snackbar_action_bounds

XuAPI
pub fn snackbar_action_bounds(bounds &layout.Rect,has_action bool) layout.Rect

Purpose

Snackbar action bounds.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
has_action bool
has_action (bool)

Returns

layout.Rect — a value of this type

($&Canvas) refresh_indicator

XuAPI
pub fn (c $&Canvas) refresh_indicator(bounds layout.Rect,theme &Theme,pull f64,ready bool,reduced bool) int

Purpose

Compact 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.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
pull f64
pull (f64)
ready bool
ready (bool)
reduced bool
reduced (bool)

Returns

int — a value of this type

($&Canvas) snackbar

XuAPI
pub fn (c $&Canvas) snackbar(bounds &layout.Rect,theme &Theme,message string,action_label string,action_pressed bool) int

Purpose

Execute snackbar on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
message string
message (string)
action_label string
action_label (string)
action_pressed bool
action_pressed (bool)

Returns

int — a value of this type

($&Canvas) row

XuAPI
pub fn (c $&Canvas) row(bounds layout.Rect,theme &Theme,title string,detail string,kind int,pressed bool) int

Purpose

Execute row on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
title string
title (string)
detail string
detail (string)
kind int
kind tag (int)
pressed bool
pressed (bool)

Returns

int — a value of this type

($&Canvas) sheet

XuAPI
pub fn (c $&Canvas) sheet(shell &Scaffold,theme &Theme,bounds layout.Rect,title string) int

Purpose

Execute sheet on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
shell &Scaffold
shell (read-only borrow; caller keeps the original; type &Scaffold)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
bounds layout.Rect
bounds (layout.Rect)
title string
title (string)

Returns

int — a value of this type

($&Canvas) fill_round_rect

XuAPI
pub fn (c $&Canvas) fill_round_rect(x f64,y f64,width f64,height f64,radius f64,color draw.Color) int

Purpose

Operation on $&Canvas: fill round rectangle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
width f64
width (f64)
height f64
height (f64)
radius f64
radius (f64)
color draw.Color
color (draw.Color)

Returns

int — a value of this type

($&Canvas) fill_rect

XuAPI
pub fn (c $&Canvas) fill_rect(x f64,y f64,width f64,height f64,color draw.Color) int

Purpose

Operation on $&Canvas: fill rectangle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
width f64
width (f64)
height f64
height (f64)
color draw.Color
color (draw.Color)

Returns

int — a value of this type

($&Canvas) line

XuAPI
pub fn (c $&Canvas) line(x1 f64,y1 f64,x2 f64,y2 f64,color draw.Color,width f64) int

Purpose

Execute line on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
x1 f64
x1 (f64)
y1 f64
y1 (f64)
x2 f64
x2 (f64)
y2 f64
y2 (f64)
color draw.Color
color (draw.Color)
width f64
width (f64)

Returns

int — a value of this type

($&Canvas) fill_circle

XuAPI
pub fn (c $&Canvas) fill_circle(x f64,y f64,radius f64,color draw.Color) int

Purpose

Operation on $&Canvas: fill circle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
radius f64
radius (f64)
color draw.Color
color (draw.Color)

Returns

int — a value of this type

($&Canvas) stroke_circle

XuAPI
pub fn (c $&Canvas) stroke_circle(x f64,y f64,radius f64,color draw.Color,width f64) int

Purpose

Operation on $&Canvas: stroke circle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
radius f64
radius (f64)
color draw.Color
color (draw.Color)
width f64
width (f64)

Returns

int — a value of this type

($&Canvas) stroke_round_rect

XuAPI
pub fn (c $&Canvas) stroke_round_rect(x f64,y f64,width f64,height f64,radius f64,color draw.Color,line_width f64) int

Purpose

Operation on $&Canvas: stroke round rectangle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
width f64
width (f64)
height f64
height (f64)
radius f64
radius (f64)
color draw.Color
color (draw.Color)
line_width f64
line_width (f64)

Returns

int — a value of this type

($&Canvas) clip_rect

XuAPI
pub fn (c $&Canvas) clip_rect(x f64,y f64,width f64,height f64) int

Purpose

Operation on $&Canvas: clip rectangle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
width f64
width (f64)
height f64
height (f64)

Returns

int — a value of this type

($&Canvas) push

XuAPI
pub fn (c $&Canvas) push() int

Purpose

Execute push on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Canvas) pop

XuAPI
pub fn (c $&Canvas) pop() int

Purpose

Execute pop on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Canvas) scrim

XuAPI
pub fn (c $&Canvas) scrim(width f64,height f64,theme &Theme) int

Purpose

Execute scrim on $&Canvas.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
width f64
width (f64)
height f64
height (f64)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

($&Canvas) divider

XuAPI
pub fn (c $&Canvas) divider(bounds layout.Rect,theme &Theme) int

Purpose

Execute divider on $&Canvas.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

($&Canvas) toggle_switch

XuAPI
pub fn (c $&Canvas) toggle_switch(bounds layout.Rect,theme &Theme,checked bool,pressed bool,enabled bool) int

Purpose

Operation on $&Canvas: toggle switch. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
checked bool
checked (bool)
pressed bool
pressed (bool)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Canvas) switch_row

XuAPI
pub fn (c $&Canvas) switch_row(bounds layout.Rect,theme &Theme,title string,detail string,checked bool,pressed bool,enabled bool) int

Purpose

Operation on $&Canvas: switch row. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
title string
title (string)
detail string
detail (string)
checked bool
checked (bool)
pressed bool
pressed (bool)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Canvas) check_row

XuAPI
pub fn (c $&Canvas) check_row(bounds layout.Rect,theme &Theme,title string,detail string,checked bool,pressed bool,enabled bool) int

Purpose

Operation on $&Canvas: check row. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
title string
title (string)
detail string
detail (string)
checked bool
checked (bool)
pressed bool
pressed (bool)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Canvas) radio_row

XuAPI
pub fn (c $&Canvas) radio_row(bounds layout.Rect,theme &Theme,title string,detail string,selected bool,pressed bool,enabled bool) int

Purpose

Operation on $&Canvas: radio row. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
title string
title (string)
detail string
detail (string)
selected bool
selected (bool)
pressed bool
pressed (bool)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Canvas) progress_bar

XuAPI
pub fn (c $&Canvas) progress_bar(bounds layout.Rect,theme &Theme,value f64,tone int) int

Purpose

Operation on $&Canvas: progress bar. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
value f64
value (f64)
tone int
tone (int)

Returns

int — a value of this type

($&Canvas) badge

XuAPI
pub fn (c $&Canvas) badge(bounds layout.Rect,theme &Theme,text string,tone int) int

Purpose

Execute badge on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
text string
text (string)
tone int
tone (int)

Returns

int — a value of this type

($&Canvas) badge_count

XuAPI
pub fn (c $&Canvas) badge_count(bounds layout.Rect,theme &Theme,count int) int

Purpose

Operation on $&Canvas: badge count. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
count int
count (int)

Returns

int — a value of this type

($&Canvas) empty_state

XuAPI
pub fn (c $&Canvas) empty_state(bounds layout.Rect,theme &Theme,icon_kind int,title string,body string) int

Purpose

Operation on $&Canvas: empty state. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
icon_kind int
icon_kind (int)
title string
title (string)
body string
body (string)

Returns

int — a value of this type

($&Canvas) segmented

XuAPI
pub fn (c $&Canvas) segmented(bounds layout.Rect,theme &Theme,labels &[]string,selected int,pressed_index int) int

Purpose

Execute segmented on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
labels &[]string
labels (read-only borrow; caller keeps the original; type &[]string)
selected int
selected (int)
pressed_index int
pressed_index (int)

Returns

int — a value of this type

($&Canvas) slider

XuAPI
pub fn (c $&Canvas) slider(bounds layout.Rect,theme &Theme,value f64,min_val f64,max_val f64,pressed bool,enabled bool) int

Purpose

Execute slider on $&Canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
value f64
value (f64)
min_val f64
min_val (f64)
max_val f64
max_val (f64)
pressed bool
pressed (bool)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Canvas) confirm_dialog

XuAPI
pub 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) int

Purpose

Operation on $&Canvas: confirm dialog. Throws on failure; handle the error or propagate it to the caller.

Parameters

c $&Canvas
The Canvas instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
title string
title (string)
body string
body (string)
cancel_label string
cancel_label (string)
confirm_label string
confirm_label (string)
danger bool
danger (bool)
cancel_pressed bool
cancel_pressed (bool)
confirm_pressed bool
confirm_pressed (bool)

Returns

int — a value of this type

const TOUCH_SIZE

XuAPI
pub const TOUCH_SIZE = 48

Purpose

Logical 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_PADDING

XuAPI
pub const PAGE_PADDING = 20

Purpose

Constant PAGE_PADDING, defining protocol or algorithm parameters.

const ROW_HEIGHT

XuAPI
pub const ROW_HEIGHT = 72

Purpose

Constant ROW_HEIGHT, defining protocol or algorithm parameters.

const REFRESH_THRESHOLD

XuAPI
pub const REFRESH_THRESHOLD = 64

Purpose

Constant REFRESH_THRESHOLD, defining protocol or algorithm parameters.

const TAB_HOME

XuAPI
pub const TAB_HOME = 1

Purpose

Constant TAB_HOME, defining protocol or algorithm parameters.

const TAB_HISTORY

XuAPI
pub const TAB_HISTORY = 2

Purpose

Constant TAB_HISTORY, defining protocol or algorithm parameters.

const TAB_SETTINGS

XuAPI
pub const TAB_SETTINGS = 3

Purpose

Constant TAB_SETTINGS, defining protocol or algorithm parameters.

const BADGE_NEUTRAL

XuAPI
pub const BADGE_NEUTRAL = 0

Purpose

Constant BADGE_NEUTRAL, defining protocol or algorithm parameters.

const BADGE_INFO

XuAPI
pub const BADGE_INFO = 1

Purpose

Constant BADGE_INFO, defining protocol or algorithm parameters.

const BADGE_POSITIVE

XuAPI
pub const BADGE_POSITIVE = 2

Purpose

Constant BADGE_POSITIVE, defining protocol or algorithm parameters.

const BADGE_WARNING

XuAPI
pub const BADGE_WARNING = 3

Purpose

Constant BADGE_WARNING, defining protocol or algorithm parameters.

const BADGE_DANGER

XuAPI
pub const BADGE_DANGER = 4

Purpose

Constant BADGE_DANGER, defining protocol or algorithm parameters.

const SWITCH_WIDTH

XuAPI
pub const SWITCH_WIDTH = 44

Purpose

Constant SWITCH_WIDTH, defining protocol or algorithm parameters.

const SWITCH_HEIGHT

XuAPI
pub const SWITCH_HEIGHT = 24

Purpose

Constant SWITCH_HEIGHT, defining protocol or algorithm parameters.

const SLIDER_THUMB

XuAPI
pub const SLIDER_THUMB = 24

Purpose

Constant SLIDER_THUMB, defining protocol or algorithm parameters.

const PROGRESS_HEIGHT

XuAPI
pub const PROGRESS_HEIGHT = 6

Purpose

Constant PROGRESS_HEIGHT, defining protocol or algorithm parameters.

const DIALOG_RADIUS

XuAPI
pub const DIALOG_RADIUS = 16

Purpose

Constant DIALOG_RADIUS, defining protocol or algorithm parameters.

refresh_threshold

XuAPI
pub fn refresh_threshold() f64

Purpose

Refresh threshold.

Parameters

No arguments are required.

Returns

f64 — a value of this type

switch_width

XuAPI
pub fn switch_width() f64

Purpose

Switch width.

Parameters

No arguments are required.

Returns

f64 — a value of this type

switch_height

XuAPI
pub fn switch_height() f64

Purpose

Switch height.

Parameters

No arguments are required.

Returns

f64 — a value of this type

slider_thumb

XuAPI
pub fn slider_thumb() f64

Purpose

Slider thumb.

Parameters

No arguments are required.

Returns

f64 — a value of this type

progress_height

XuAPI
pub fn progress_height() f64

Purpose

Progress height.

Parameters

No arguments are required.

Returns

f64 — a value of this type

dialog_radius

XuAPI
pub fn dialog_radius() f64

Purpose

Dialog radius.

Parameters

No arguments are required.

Returns

f64 — a value of this type

struct Theme

XuAPI
pub 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
}

Purpose

Structure encapsulating dark, background, surface, elevated, subtle.

Public fields

dark bool
field (bool)
background draw.Color
field (draw.Color)
surface draw.Color
field (draw.Color)
elevated draw.Color
field (draw.Color)
subtle draw.Color
field (draw.Color)
subtle_pressed draw.Color
field (draw.Color)
ink draw.Color
field (draw.Color)
muted draw.Color
field (draw.Color)
border draw.Color
field (draw.Color)
control_border draw.Color
field (draw.Color)
accent draw.Color
field (draw.Color)
accent_hover draw.Color
field (draw.Color)
accent_pressed draw.Color
field (draw.Color)
accent_tint draw.Color
field (draw.Color)
on_accent draw.Color
field (draw.Color)
positive draw.Color
field (draw.Color)
positive_soft draw.Color
field (draw.Color)
warning draw.Color
field (draw.Color)
warning_soft draw.Color
field (draw.Color)
danger draw.Color
field (draw.Color)
danger_soft draw.Color
field (draw.Color)
info draw.Color
field (draw.Color)
info_soft draw.Color
field (draw.Color)
focus draw.Color
field (draw.Color)
scrim draw.Color
field (draw.Color)

light_theme

XuAPI
pub fn light_theme() Theme

Purpose

Paper / Obsidian / Cinnabar tokens synchronized with xu-ui-design.

Parameters

No arguments are required.

Returns

Theme — a value of this type

dark_theme

XuAPI
pub fn dark_theme() Theme

Purpose

Dark theme.

Parameters

No arguments are required.

Returns

Theme — a value of this type

rect

XuAPI
pub fn rect(x f64,y f64,width f64,height f64) layout.Rect

Purpose

Rectangle.

Parameters

x f64
value (f64)
y f64
value (f64)
width f64
width (f64)
height f64
height (f64)

Returns

layout.Rect — a value of this type

struct Scaffold

XuAPI
pub 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
}

Purpose

Structure encapsulating width, height, wide, safe, header.

Public fields

width f64
field (f64)
height f64
field (f64)
wide bool
field (bool)
safe Insets
field (Insets)
header layout.Rect
field (layout.Rect)
body layout.Rect
body
navigation layout.Rect
field (layout.Rect)
action layout.Rect
field (layout.Rect)

scaffold_with

XuAPI
pub fn scaffold_with(width f64,height f64,safe Insets) Scaffold

Purpose

Edge-to-edge layout inside width/height while placing interactive controls inside safe. Throws on failure; handle the error or propagate it to the caller.

Parameters

width f64
width (f64)
height f64
height (f64)
safe Insets
safe (Insets)

Returns

Scaffold — a value of this type

scaffold

XuAPI
pub fn scaffold(width f64,height f64) Scaffold

Purpose

A 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.

Parameters

width f64
width (f64)
height f64
height (f64)

Returns

Scaffold — a value of this type

tab_bounds

XuAPI
pub fn tab_bounds(shell &Scaffold,index int) layout.Rect

Purpose

Tab bounds.

Parameters

shell &Scaffold
shell (read-only borrow; caller keeps the original; type &Scaffold)
index int
index (int)

Returns

layout.Rect — a value of this type

sheet_bounds

XuAPI
pub fn sheet_bounds(width f64,height f64,preferred_height f64) layout.Rect

Purpose

Sheet bounds.

Parameters

width f64
width (f64)
height f64
height (f64)
preferred_height f64
preferred_height (f64)

Returns

layout.Rect — a value of this type

sheet_bounds_with

XuAPI
pub fn sheet_bounds_with(shell &Scaffold,preferred_height f64) layout.Rect

Purpose

Sheet bounds with.

Parameters

shell &Scaffold
shell (read-only borrow; caller keeps the original; type &Scaffold)
preferred_height f64
preferred_height (f64)

Returns

layout.Rect — a value of this type

snackbar_bounds

XuAPI
pub fn snackbar_bounds(shell &Scaffold) layout.Rect

Purpose

Snackbar bounds.

Parameters

shell &Scaffold
shell (read-only borrow; caller keeps the original; type &Scaffold)

Returns

layout.Rect — a value of this type

intersection

XuAPI
pub fn intersection(a &layout.Rect,b &layout.Rect) layout.Rect

Purpose

Execute intersection.

Parameters

a &layout.Rect
value (read-only borrow; caller keeps the original; type &layout.Rect)
b &layout.Rect
b (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

layout.Rect — a value of this type

dialog_bounds

XuAPI
pub fn dialog_bounds(width f64,height f64,safe Insets,ime_bottom f64,dialog_height f64) layout.Rect

Purpose

Dialog bounds.

Parameters

width f64
width (f64)
height f64
height (f64)
safe Insets
safe (Insets)
ime_bottom f64
ime_bottom (f64)
dialog_height f64
dialog_height (f64)

Returns

layout.Rect — a value of this type

dialog_button_bounds

XuAPI
pub fn dialog_button_bounds(dialog &layout.Rect,which int) layout.Rect

Purpose

Dialog button bounds.

Parameters

dialog &layout.Rect
dialog (read-only borrow; caller keeps the original; type &layout.Rect)
which int
which (int)

Returns

layout.Rect — a value of this type

segmented_item_bounds

XuAPI
pub fn segmented_item_bounds(bounds &layout.Rect,count int,index int) layout.Rect

Purpose

Segmented item bounds.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
count int
count (int)
index int
index (int)

Returns

layout.Rect — a value of this type

slider_value_at

XuAPI
pub fn slider_value_at(bounds &layout.Rect,x f64,min_val f64,max_val f64,step f64) f64

Purpose

Slider value at.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
x f64
value (f64)
min_val f64
min_val (f64)
max_val f64
max_val (f64)
step f64
step (f64)

Returns

f64 — a value of this type

const DRAG_NONE

XuAPI
pub const DRAG_NONE = 0

Purpose

Constant DRAG_NONE, defining protocol or algorithm parameters.

const DRAG_VERTICAL

XuAPI
pub const DRAG_VERTICAL = 1

Purpose

Constant DRAG_VERTICAL, defining protocol or algorithm parameters.

const DRAG_HORIZONTAL

XuAPI
pub const DRAG_HORIZONTAL = 2

Purpose

Constant DRAG_HORIZONTAL, defining protocol or algorithm parameters.

struct Touch

XuAPI
pub struct Touch {

}

Purpose

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.

Public fields

This type has no public fields.

touch

XuAPI
pub fn touch(identity &ui.CanvasEvent) Touch

Purpose

Execute touch.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)

Returns

Touch — a value of this type

($&Touch) set_bouncing

XuAPI
pub fn (t $&Touch) set_bouncing(enabled bool)

Purpose

Operation on $&Touch: set bouncing.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Touch) set_edge_back

XuAPI
pub fn (t $&Touch) set_edge_back(enabled bool,safe_left f64)

Purpose

Operation on $&Touch: set edge back.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
enabled bool
enabled (bool)
safe_left f64
safe_left (f64)

Returns

This call does not return a value.

($&Touch) set_refresh_enabled

XuAPI
pub fn (t $&Touch) set_refresh_enabled(enabled bool)

Purpose

Operation on $&Touch: set refresh enabled.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Touch) refresh_pull

XuAPI
pub fn (t &Touch) refresh_pull() f64

Purpose

Operation on &Touch: refresh pull.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

f64 — a value of this type

(&Touch) refresh_progress

XuAPI
pub fn (t &Touch) refresh_progress() f64

Purpose

Operation on &Touch: refresh progress.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

f64 — a value of this type

(&Touch) refresh_ready

XuAPI
pub fn (t &Touch) refresh_ready() bool

Purpose

Operation on &Touch: refresh ready.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

bool — true or false

($&Touch) take_refresh

XuAPI
pub fn (t $&Touch) take_refresh() bool

Purpose

Operation on $&Touch: take refresh.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Touch) take_refresh_haptic

XuAPI
pub fn (t $&Touch) take_refresh_haptic() bool

Purpose

Operation on $&Touch: take refresh haptic.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Touch) begin

XuAPI
pub fn (t $&Touch) begin()

Purpose

Execute begin on $&Touch.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Touch) selection_region

XuAPI
pub fn (t $&Touch) selection_region(bounds layout.Rect,active bool)

Purpose

Operation on $&Touch: selection region.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
active bool
active (bool)

Returns

This call does not return a value.

($&Touch) target

XuAPI
pub fn (t $&Touch) target(id int,bounds layout.Rect) int

Purpose

Execute target on $&Touch. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
id int
id (int)
bounds layout.Rect
bounds (layout.Rect)

Returns

int — a value of this type

(&Touch) pressed

XuAPI
pub fn (t &Touch) pressed(id int) bool

Purpose

Execute pressed on &Touch.

Parameters

t &Touch
The Touch instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

(&Touch) offset

XuAPI
pub fn (t &Touch) offset() f64

Purpose

Execute offset on &Touch.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

f64 — a value of this type

(&Touch) scroll_offset

XuAPI
pub fn (t &Touch) scroll_offset() f64

Purpose

Operation on &Touch: scroll offset.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

f64 — a value of this type

(&Touch) scroll_maximum

XuAPI
pub fn (t &Touch) scroll_maximum() f64

Purpose

Operation on &Touch: scroll maximum.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

f64 — a value of this type

(&Touch) tap_x

XuAPI
pub fn (t &Touch) tap_x() f64

Purpose

Operation on &Touch: tap x.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

f64 — a value of this type

(&Touch) tap_y

XuAPI
pub fn (t &Touch) tap_y() f64

Purpose

Operation on &Touch: tap y.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

f64 — a value of this type

(&Touch) was_dragged

XuAPI
pub fn (t &Touch) was_dragged() bool

Purpose

Operation on &Touch: was dragged.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

bool — true or false

(&Touch) click_count

XuAPI
pub fn (t &Touch) click_count() int

Purpose

Operation on &Touch: click count.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

int — a value of this type

(&Touch) pointer_down

XuAPI
pub fn (t &Touch) pointer_down() bool

Purpose

Operation on &Touch: pointer down.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

bool — true or false

(&Touch) is_selection_drag

XuAPI
pub fn (t &Touch) is_selection_drag() bool

Purpose

Operation on &Touch: whether it is selection drag.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

bool — true or false

($&Touch) set_selection_drag

XuAPI
pub fn (t $&Touch) set_selection_drag(active bool)

Purpose

Operation on $&Touch: set selection drag.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
active bool
active (bool)

Returns

This call does not return a value.

(&Touch) is_waiting_long_press

XuAPI
pub fn (t &Touch) is_waiting_long_press() bool

Purpose

Operation on &Touch: whether it is waiting long press.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

bool — true or false

(&Touch) is_long_pressed

XuAPI
pub fn (t &Touch) is_long_pressed() bool

Purpose

Operation on &Touch: whether it is long pressed.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

bool — true or false

($&Touch) poll_long_press_at

XuAPI
pub fn (t $&Touch) poll_long_press_at(now_ns int) bool

Purpose

Operation on $&Touch: poll long press at.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
now_ns int
now_ns (int)

Returns

bool — true or false

($&Touch) poll_long_press

XuAPI
pub fn (t $&Touch) poll_long_press() bool

Purpose

Operation on $&Touch: poll long press.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Touch) take_long_press

XuAPI
pub fn (t $&Touch) take_long_press() int

Purpose

Operation on $&Touch: take long press.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Touch) ensure_visible

XuAPI
pub fn (t $&Touch) ensure_visible(content_top f64,content_height f64)

Purpose

Operation on $&Touch: ensure visible.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
content_top f64
content_top (f64)
content_height f64
content_height (f64)

Returns

This call does not return a value.

(&Touch) animating

XuAPI
pub fn (t &Touch) animating() bool

Purpose

Execute animating on &Touch.

Parameters

t &Touch
The Touch instance used by this call (borrow).

Returns

bool — true or false

(&Touch) edge_swipe_progress

XuAPI
pub fn (t &Touch) edge_swipe_progress(width f64) f64

Purpose

Operation on &Touch: edge swipe progress.

Parameters

t &Touch
The Touch instance used by this call (borrow).
width f64
width (f64)

Returns

f64 — a value of this type

($&Touch) block_scroll

XuAPI
pub fn (t $&Touch) block_scroll()

Purpose

A modal blocks the scroll gesture without discarding the underlying offset.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Touch) cancel

XuAPI
pub fn (t $&Touch) cancel()

Purpose

Execute cancel on $&Touch.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Touch) reset_scroll

XuAPI
pub fn (t $&Touch) reset_scroll()

Purpose

Operation on $&Touch: reset scroll.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Touch) scroll_region

XuAPI
pub fn (t $&Touch) scroll_region(bounds layout.Rect,content_height f64) int

Purpose

Operation on $&Touch: scroll region. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
bounds layout.Rect
bounds (layout.Rect)
content_height f64
content_height (f64)

Returns

int — a value of this type

($&Touch) step_at

XuAPI
pub fn (t $&Touch) step_at(now_ns int) bool

Purpose

Operation on $&Touch: step at.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
now_ns int
now_ns (int)

Returns

bool — true or false

($&Touch) step

XuAPI
pub fn (t $&Touch) step() bool

Purpose

Execute step on $&Touch.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Touch) event

XuAPI
pub fn (t $&Touch) event(event &ui.Event) int

Purpose

An 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.

Parameters

t $&Touch
The Touch instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

int — a value of this type

(&Touch) swipe_back

XuAPI
pub fn (t &Touch) swipe_back(event &ui.Event,width f64) bool

Purpose

Left-edge horizontal swipe-back gesture. Read before event consumes pointer-up.

Parameters

t &Touch
The Touch instance used by this call (borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)
width f64
width (f64)

Returns

bool — true or false

(&Touch) swipe_down

XuAPI
pub fn (t &Touch) swipe_down(event &ui.Event,area layout.Rect) bool

Purpose

Bottom-sheet grabber/header gesture. Read before event consumes pointer-up.

Parameters

t &Touch
The Touch instance used by this call (borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)
area layout.Rect
area (layout.Rect)

Returns

bool — true or false

struct Insets

XuAPI
pub struct Insets {
    pub top f64
    pub bottom f64
    pub left f64
    pub right f64
    pub ime_bottom f64
}

Purpose

Safe-area and soft-keyboard (IME) insets in logical points / DIP, aligned with Flutter's MediaQuery viewPadding vs viewInsets split.

Public fields

top f64
field (f64)
bottom f64
field (f64)
left f64
field (f64)
right f64
field (f64)
ime_bottom f64
field (f64)

insets_zero

XuAPI
pub fn insets_zero() Insets

Purpose

Insets zero.

Parameters

No arguments are required.

Returns

Insets — a value of this type

(Insets) with_ime

XuAPI
pub fn (i Insets) with_ime(ime f64) Insets

Purpose

Operation on Insets: derive a new value with ime.

Parameters

i Insets
The Insets instance used by this call (value receiver).
ime f64
ime (f64)

Returns

Insets — a value of this type

(Insets) view_padding_bottom

XuAPI
pub fn (i Insets) view_padding_bottom() f64

Purpose

Persistent bottom inset uncovered by the soft keyboard (Flutter padding.bottom).

Parameters

i Insets
The Insets instance used by this call (value receiver).

Returns

f64 — a value of this type

(Insets) bottom_clearance

XuAPI
pub fn (i Insets) bottom_clearance() f64

Purpose

Bottom clearance above both system gesture bar / home indicator and active IME.

Parameters

i Insets
The Insets instance used by this call (value receiver).

Returns

f64 — a value of this type

parse_insets

XuAPI
pub fn parse_insets(raw &string) Insets

Purpose

Parse as insets.

Parameters

raw &string
raw (read-only borrow; caller keeps the original; type &string)

Returns

Insets — a value of this type

host_insets

XuAPI
pub fn host_insets() Insets

Purpose

Host insets.

Parameters

No arguments are required.

Returns

Insets — a value of this type

reduced_motion

XuAPI
pub fn reduced_motion() bool

Purpose

Reduced motion.

Parameters

No arguments are required.

Returns

bool — true or false

const MAX_ROUTE_DEPTH

XuAPI
pub const MAX_ROUTE_DEPTH = 16

Purpose

Constant MAX_ROUTE_DEPTH, defining protocol or algorithm parameters.

struct Route

XuAPI
pub struct Route {
    pub id int
    pub arg int
    pub title string
}

Purpose

Structure encapsulating id, arg, title.

Public fields

id int
field (int)
arg int
field (int)
title string
field (string)

struct RouteStack

XuAPI
pub struct RouteStack {
    pub drag_progress f64
    pub edge_swiping bool
}

Purpose

Single-source navigation stack aligned with Flutter's Navigator / PopScope.

Public fields

drag_progress f64
field (f64)
edge_swiping bool
field (bool)

route_stack

XuAPI
pub fn route_stack(root_id int,root_title string) RouteStack

Purpose

Route stack.

Parameters

root_id int
root_id (int)
root_title string
root_title (string)

Returns

RouteStack — a value of this type

(&RouteStack) depth

XuAPI
pub fn (s &RouteStack) depth() int

Purpose

Execute depth on &RouteStack.

Parameters

s &RouteStack
The RouteStack instance used by this call (borrow).

Returns

int — a value of this type

(&RouteStack) can_pop

XuAPI
pub fn (s &RouteStack) can_pop() bool

Purpose

Operation on &RouteStack: can pop.

Parameters

s &RouteStack
The RouteStack instance used by this call (borrow).

Returns

bool — true or false

(&RouteStack) top

XuAPI
pub fn (s &RouteStack) top() Route

Purpose

Execute top on &RouteStack.

Parameters

s &RouteStack
The RouteStack instance used by this call (borrow).

Returns

Route — a value of this type

(&RouteStack) previous

XuAPI
pub fn (s &RouteStack) previous() Route

Purpose

Execute previous on &RouteStack.

Parameters

s &RouteStack
The RouteStack instance used by this call (borrow).

Returns

Route — a value of this type

($&RouteStack) reset

XuAPI
pub fn (s $&RouteStack) reset(root_id int,root_title string)

Purpose

Operation on $&RouteStack: clear internal state so the value can be reused.

Parameters

s $&RouteStack
The RouteStack instance used by this call (exclusive borrow).
root_id int
root_id (int)
root_title string
root_title (string)

Returns

This call does not return a value.

($&RouteStack) push

XuAPI
pub fn (s $&RouteStack) push(id int,arg int,title string) bool

Purpose

Execute push on $&RouteStack.

Parameters

s $&RouteStack
The RouteStack instance used by this call (exclusive borrow).
id int
id (int)
arg int
arg (int)
title string
title (string)

Returns

bool — true or false

($&RouteStack) pop

XuAPI
pub fn (s $&RouteStack) pop() bool

Purpose

Execute pop on $&RouteStack.

Parameters

s $&RouteStack
The RouteStack instance used by this call (exclusive borrow).

Returns

bool — true or false

($&RouteStack) pop_to_root

XuAPI
pub fn (s $&RouteStack) pop_to_root() int

Purpose

Operation on $&RouteStack: pop to root.

Parameters

s $&RouteStack
The RouteStack instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&RouteStack) set_drag

XuAPI
pub fn (s $&RouteStack) set_drag(progress f64,active bool)

Purpose

Operation on $&RouteStack: set drag.

Parameters

s $&RouteStack
The RouteStack instance used by this call (exclusive borrow).
progress f64
progress (f64)
active bool
active (bool)

Returns

This call does not return a value.

struct Snackbar

XuAPI
pub struct Snackbar {
    pub active bool
    pub message string
    pub action_label string
    pub action_id int
    pub deadline_ns int
}

Purpose

Timed transient feedback strip positioned above bottom navigation / IME.

Public fields

active bool
field (bool)
message string
field (string)
action_label string
field (string)
action_id int
field (int)
deadline_ns int
field (int)

snackbar_empty

XuAPI
pub fn snackbar_empty() Snackbar

Purpose

Snackbar empty.

Parameters

No arguments are required.

Returns

Snackbar — a value of this type

($&Snackbar) show_at

XuAPI
pub fn (b $&Snackbar) show_at(message string,action_id int,action_label string,duration_ms int,now_ns int)

Purpose

Operation on $&Snackbar: show at.

Parameters

b $&Snackbar
The Snackbar instance used by this call (exclusive borrow).
message string
message (string)
action_id int
action_id (int)
action_label string
action_label (string)
duration_ms int
duration_ms (int)
now_ns int
now_ns (int)

Returns

This call does not return a value.

($&Snackbar) show

XuAPI
pub fn (b $&Snackbar) show(message string,action_id int,action_label string,duration_ms int)

Purpose

Execute show on $&Snackbar.

Parameters

b $&Snackbar
The Snackbar instance used by this call (exclusive borrow).
message string
message (string)
action_id int
action_id (int)
action_label string
action_label (string)
duration_ms int
duration_ms (int)

Returns

This call does not return a value.

($&Snackbar) dismiss

XuAPI
pub fn (b $&Snackbar) dismiss()

Purpose

Execute dismiss on $&Snackbar.

Parameters

b $&Snackbar
The Snackbar instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Snackbar) remaining_ms

XuAPI
pub fn (b &Snackbar) remaining_ms(now_ns int) int

Purpose

Operation on &Snackbar: remaining ms.

Parameters

b &Snackbar
The Snackbar instance used by this call (borrow).
now_ns int
now_ns (int)

Returns

int — a value of this type

($&Snackbar) tick

XuAPI
pub fn (b $&Snackbar) tick(now_ns int) bool

Purpose

Advance animation clock and state transition step.

Parameters

b $&Snackbar
The Snackbar instance used by this call (exclusive borrow).
now_ns int
now_ns (int)

Returns

bool — true or false

const LOCALE_EN

XuAPI
pub const LOCALE_EN = 0

Purpose

Constant LOCALE_EN, defining protocol or algorithm parameters.

const LOCALE_ZH_CN

XuAPI
pub const LOCALE_ZH_CN = 1

Purpose

Constant LOCALE_ZH_CN, defining protocol or algorithm parameters.

const ACTION_BAR_NONE

XuAPI
pub const ACTION_BAR_NONE = 0

Purpose

Constant ACTION_BAR_NONE, defining protocol or algorithm parameters.

const ACTION_BAR_COPY

XuAPI
pub const ACTION_BAR_COPY = 1

Purpose

Constant ACTION_BAR_COPY, defining protocol or algorithm parameters.

const ACTION_BAR_CUT

XuAPI
pub const ACTION_BAR_CUT = 2

Purpose

Constant ACTION_BAR_CUT, defining protocol or algorithm parameters.

const ACTION_BAR_PASTE

XuAPI
pub const ACTION_BAR_PASTE = 3

Purpose

Constant ACTION_BAR_PASTE, defining protocol or algorithm parameters.

const ACTION_BAR_SELECT_ALL

XuAPI
pub const ACTION_BAR_SELECT_ALL = 4

Purpose

Constant ACTION_BAR_SELECT_ALL, defining protocol or algorithm parameters.

struct PhoneActionBarItem

XuAPI
pub struct PhoneActionBarItem {
    pub cmd int
    pub rect layout.Rect
    pub label string
    pub enabled bool
}

Purpose

Structure encapsulating cmd, rect, label, enabled.

Public fields

cmd int
field (int)
rect layout.Rect
field (layout.Rect)
label string
field (string)
enabled bool
field (bool)

struct PhoneActionBar

XuAPI
pub struct PhoneActionBar {
    pub bounds layout.Rect
    pub items []PhoneActionBarItem
}

Purpose

Structure encapsulating bounds, items.

Public fields

bounds layout.Rect
field (layout.Rect)
items []PhoneActionBarItem
items

struct SelectableTextResult

XuAPI
pub struct SelectableTextResult {
    pub changed bool
    pub copied bool
    pub focused bool
    pub blurred bool
    pub needs_paint bool
    pub consumed bool
}

Purpose

Structure encapsulating changed, copied, focused, blurred, needs_paint.

Public fields

changed bool
field (bool)
copied bool
field (bool)
focused bool
field (bool)
blurred bool
field (bool)
needs_paint bool
field (bool)
consumed bool
field (bool)

struct SelectableText

XuAPI
pub 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
}

Purpose

Structure encapsulating id, identity, bounds, value, size.

Public fields

id int
field (int)
identity ui.CanvasEvent
field (ui.CanvasEvent)
bounds layout.Rect
field (layout.Rect)
value string
field (string)
size f64
field (f64)
weight int
field (int)
line_height f64
field (f64)
align int
field (int)
multiline bool
field (bool)
selectable bool
field (bool)
focused bool
field (bool)
anchor int
field (int)
focus int
field (int)
locale int
field (int)

selectable_text

XuAPI
pub fn selectable_text(context &draw.Context,identity &ui.CanvasEvent,id int,value string,size f64,multiline bool) SelectableText

Purpose

Create 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).

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
value string
value (string)
size f64
size (f64)
multiline bool
multiline (bool)

Returns

SelectableText — a value of this type

($&SelectableText) set_value

XuAPI
pub fn (s $&SelectableText) set_value(value string) int

Purpose

Operation on $&SelectableText: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
value string
value (string)

Returns

int — a value of this type

($&SelectableText) set_style

XuAPI
pub fn (s $&SelectableText) set_style(weight int,line_height f64,align int)

Purpose

Operation on $&SelectableText: set style.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
weight int
weight (int)
line_height f64
line_height (f64)
align int
align (int)

Returns

This call does not return a value.

($&SelectableText) set_locale

XuAPI
pub fn (s $&SelectableText) set_locale(locale int)

Purpose

Operation on $&SelectableText: set locale.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
locale int
locale (int)

Returns

This call does not return a value.

($&SelectableText) set_selectable

XuAPI
pub fn (s $&SelectableText) set_selectable(selectable bool)

Purpose

Operation on $&SelectableText: set selectable.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&SelectableText) is_selectable

XuAPI
pub fn (s &SelectableText) is_selectable() bool

Purpose

Operation on &SelectableText: whether it is selectable.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) has_selection

XuAPI
pub fn (s &SelectableText) has_selection() bool

Purpose

Operation on &SelectableText: whether it has selection.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) selected_text

XuAPI
pub fn (s &SelectableText) selected_text() string

Purpose

Operation on &SelectableText: selected text.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

string — result string

($&SelectableText) select_all

XuAPI
pub fn (s $&SelectableText) select_all() int

Purpose

Operation on $&SelectableText: select all.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&SelectableText) clear_selection

XuAPI
pub fn (s $&SelectableText) clear_selection()

Purpose

Operation on $&SelectableText: clear selection.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SelectableText) copy_selection

XuAPI
pub fn (s $&SelectableText) copy_selection() int

Purpose

Operation on $&SelectableText: copy selection.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

int — a value of this type

(&SelectableText) cursor_at

XuAPI
pub fn (s &SelectableText) cursor_at(x f64,y f64) int

Purpose

Operation on &SelectableText: cursor at.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

(&SelectableText) measure_height

XuAPI
pub fn (s &SelectableText) measure_height(c $&Canvas,width f64) f64

Purpose

Operation on &SelectableText: measure height.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).
c $&Canvas
byte or character code (exclusive borrow; may modify the original; type $&Canvas)
width f64
width (f64)

Returns

f64 — a value of this type

($&SelectableText) handle_long_press

XuAPI
pub fn (s $&SelectableText) handle_long_press(touches &Touch) bool

Purpose

Operation on $&SelectableText: handle long press.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
touches &Touch
touches (read-only borrow; caller keeps the original; type &Touch)

Returns

bool — true or false

($&SelectableText) handle_event

XuAPI
pub fn (s $&SelectableText) handle_event(event &ui.Event,touches &Touch,action int) SelectableTextResult

Purpose

Operation on $&SelectableText: handle event.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)
touches &Touch
touches (read-only borrow; caller keeps the original; type &Touch)
action int
action (int)

Returns

SelectableTextResult — a value of this type

($&SelectableText) set_font_stack

XuAPI
pub fn (s $&SelectableText) set_font_stack(stack font.FontStack)

Purpose

Operation on $&SelectableText: set font stack.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
stack font.FontStack
stack (font.FontStack)

Returns

This call does not return a value.

($&SelectableText) add_ttf_bytes

XuAPI
pub fn (s $&SelectableText) add_ttf_bytes(ttf_bytes &[]u8,font_index int,face_id int) int

Purpose

Operation on $&SelectableText: add ttf bytes. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
ttf_bytes &[]u8
ttf_bytes (read-only borrow; caller keeps the original; type &[]u8)
font_index int
font_index (int)
face_id int
face_id (int)

Returns

int — a value of this type

($&SelectableText) draw

XuAPI
pub fn (s $&SelectableText) draw(c $&Canvas,t $&Touch,bounds layout.Rect,clip &layout.Rect,theme &Theme,color draw.Color) f64

Purpose

Execute draw on $&SelectableText. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
c $&Canvas
byte or character code (exclusive borrow; may modify the original; type $&Canvas)
t $&Touch
t (exclusive borrow; may modify the original; type $&Touch)
bounds layout.Rect
bounds (layout.Rect)
clip &layout.Rect
clip (read-only borrow; caller keeps the original; type &layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)
color draw.Color
color (draw.Color)

Returns

f64 — a value of this type

const FIELD_HEIGHT

XuAPI
pub const FIELD_HEIGHT = 48

Purpose

Constant FIELD_HEIGHT, defining protocol or algorithm parameters.

text_field_height

XuAPI
pub fn text_field_height() f64

Purpose

Text field height.

Parameters

No arguments are required.

Returns

f64 — a value of this type

struct TextField

XuAPI
pub 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
}

Purpose

Structure encapsulating id, clear_id, identity, bounds, focused.

Public fields

id int
field (int)
clear_id int
field (int)
identity ui.CanvasEvent
field (ui.CanvasEvent)
bounds layout.Rect
field (layout.Rect)
focused bool
field (bool)
enabled bool
field (bool)
selectable bool
field (bool)
password bool
field (bool)
locale int
field (int)
error string
field (string)
placeholder string
field (string)
value string
field (string)
anchor int
field (int)
focus int
field (int)
revision int
field (int)
composing bool
field (bool)
preedit string
field (string)
replacement_start int
field (int)
replacement_end int
field (int)
preedit_anchor int
field (int)
preedit_focus int
field (int)
offset_x f64
field (f64)

struct TextFieldResult

XuAPI
pub struct TextFieldResult {
    pub changed bool
    pub submitted bool
    pub blurred bool
    pub cleared bool
    pub needs_paint bool
}

Purpose

Structure encapsulating changed, submitted, blurred, cleared, needs_paint.

Public fields

changed bool
field (bool)
submitted bool
field (bool)
blurred bool
field (bool)
cleared bool
field (bool)
needs_paint bool
field (bool)

text_field

XuAPI
pub fn text_field(context &draw.Context,identity &ui.CanvasEvent,id int,clear_id int,placeholder string) TextField

Purpose

Text field.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
clear_id int
clear_id (int)
placeholder string
placeholder (string)

Returns

TextField — a value of this type

($&TextField) set_font_stack

XuAPI
pub fn (f $&TextField) set_font_stack(stack font.FontStack)

Purpose

Operation on $&TextField: set font stack.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
stack font.FontStack
stack (font.FontStack)

Returns

This call does not return a value.

($&TextField) add_ttf_bytes

XuAPI
pub fn (f $&TextField) add_ttf_bytes(ttf_bytes &[]u8,font_index int,face_id int) int

Purpose

Operation on $&TextField: add ttf bytes. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
ttf_bytes &[]u8
ttf_bytes (read-only borrow; caller keeps the original; type &[]u8)
font_index int
font_index (int)
face_id int
face_id (int)

Returns

int — a value of this type

(&TextField) is_focused

XuAPI
pub fn (f &TextField) is_focused() bool

Purpose

Operation on &TextField: whether it is focused.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

bool — true or false

(&TextField) is_selectable

XuAPI
pub fn (f &TextField) is_selectable() bool

Purpose

Operation on &TextField: whether it is selectable.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

bool — true or false

(&TextField) is_password

XuAPI
pub fn (f &TextField) is_password() bool

Purpose

Operation on &TextField: whether it is password.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

bool — true or false

(&TextField) is_copy_enabled

XuAPI
pub fn (f &TextField) is_copy_enabled() bool

Purpose

Operation on &TextField: whether it is copy enabled.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

bool — true or false

($&TextField) set_copy_enabled

XuAPI
pub fn (f $&TextField) set_copy_enabled(on bool)

Purpose

Operation on $&TextField: set copy enabled.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

This call does not return a value.

($&TextField) set_locale

XuAPI
pub fn (f $&TextField) set_locale(locale int)

Purpose

Operation on $&TextField: set locale.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
locale int
locale (int)

Returns

This call does not return a value.

($&TextField) set_selectable

XuAPI
pub fn (f $&TextField) set_selectable(selectable bool)

Purpose

Operation on $&TextField: set selectable.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&TextField) set_password

XuAPI
pub fn (f $&TextField) set_password(password bool)

Purpose

Operation on $&TextField: set password.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
password bool
password (bool)

Returns

This call does not return a value.

(&TextField) display_value

XuAPI
pub fn (f &TextField) display_value() string

Purpose

Operation on &TextField: display value.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

string — result string

(&TextField) display_anchor

XuAPI
pub fn (f &TextField) display_anchor() int

Purpose

Operation on &TextField: display anchor.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

int — a value of this type

(&TextField) display_focus

XuAPI
pub fn (f &TextField) display_focus() int

Purpose

Operation on &TextField: display focus.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

int — a value of this type

($&TextField) set_error

XuAPI
pub fn (f $&TextField) set_error(message string)

Purpose

Operation on $&TextField: set error.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
message string
message (string)

Returns

This call does not return a value.

($&TextField) blur

XuAPI
pub fn (f $&TextField) blur()

Purpose

Execute blur on $&TextField.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TextField) focus_session

XuAPI
pub fn (f $&TextField) focus_session(on bool) int

Purpose

Operation on $&TextField: focus session. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

int — a value of this type

($&TextField) set_value

XuAPI
pub fn (f $&TextField) set_value(value string) int

Purpose

Operation on $&TextField: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
value string
value (string)

Returns

int — a value of this type

($&TextField) clear

XuAPI
pub fn (f $&TextField) clear() int

Purpose

Clear all buffered or stored entries and internal state. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&TextField) select_all

XuAPI
pub fn (f $&TextField) select_all() int

Purpose

Operation on $&TextField: select all.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).

Returns

int — a value of this type

(&TextField) has_selection

XuAPI
pub fn (f &TextField) has_selection() bool

Purpose

Operation on &TextField: whether it has selection.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

bool — true or false

(&TextField) selected_text

XuAPI
pub fn (f &TextField) selected_text() string

Purpose

Operation on &TextField: selected text.

Parameters

f &TextField
The TextField instance used by this call (borrow).

Returns

string — result string

($&TextField) copy_selection

XuAPI
pub fn (f $&TextField) copy_selection() int

Purpose

Operation on $&TextField: copy selection.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&TextField) cut_selection

XuAPI
pub fn (f $&TextField) cut_selection() bool

Purpose

Operation on $&TextField: cut selection.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).

Returns

bool — true or false

($&TextField) paste_clipboard

XuAPI
pub fn (f $&TextField) paste_clipboard() int

Purpose

Operation on $&TextField: paste clipboard.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).

Returns

int — a value of this type

(&TextField) cursor_at

XuAPI
pub fn (f &TextField) cursor_at(x f64,y f64) int

Purpose

Operation on &TextField: cursor at.

Parameters

f &TextField
The TextField instance used by this call (borrow).
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

($&TextField) handle_event

XuAPI
pub fn (f $&TextField) handle_event(event &ui.Event,touches &Touch,action int) TextFieldResult

Purpose

Operation on $&TextField: handle event.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)
touches &Touch
touches (read-only borrow; caller keeps the original; type &Touch)
action int
action (int)

Returns

TextFieldResult — a value of this type

($&TextField) draw

XuAPI
pub fn (f $&TextField) draw(c $&Canvas,t $&Touch,bounds layout.Rect,clip &layout.Rect,theme &Theme) int

Purpose

Execute draw on $&TextField. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&TextField
The TextField instance used by this call (exclusive borrow).
c $&Canvas
byte or character code (exclusive borrow; may modify the original; type $&Canvas)
t $&Touch
t (exclusive borrow; may modify the original; type $&Touch)
bounds layout.Rect
bounds (layout.Rect)
clip &layout.Rect
clip (read-only borrow; caller keeps the original; type &layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&TextField) draw_error

XuAPI
pub fn (f &TextField) draw_error(c $&Canvas,bounds layout.Rect,theme &Theme) int

Purpose

Operation on &TextField: draw error.

Parameters

f &TextField
The TextField instance used by this call (borrow).
c $&Canvas
byte or character code (exclusive borrow; may modify the original; type $&Canvas)
bounds layout.Rect
bounds (layout.Rect)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type