XU XUv0.8.8
中文

API

#ui

import: #ui

counts: 71 fns, 17 methods, 10 types, 47 consts, 0 ifaces

Windows, menus, tray. run reports host not available when the host is not wired.

const content_none

XuAPI
pub const content_none = 0

Purpose

Desktop shell: App / Window / Icon / Menu / Tray / events / post queue. Owns the UI (shell) runtime event loop and host process. Content backends: register_content_plugin(ContentPlugin) with per-OS sources. Native open: compile-time `$macos` / `$linux` / `$windows` files (host_open_*.xu) each define open_native_window — App.run does not branch on OS. Host modes default → OS native host (macOS / Linux / Windows) XU_UI_SIM=1 → in-process sim (fixtures/CI) Value `0`.

Parameters

none

const content_webview

XuAPI
pub const content_webview = 1

Purpose

Public constant `content_webview`. Value `1`.

Parameters

none

const content_draw

XuAPI
pub const content_draw = 2

Purpose

Public constant `content_draw`. Value `2`.

Parameters

none

const content_native

XuAPI
pub const content_native = 3

Purpose

Public constant `content_native`. Value `3`.

Parameters

none

struct ContentPlugin

XuAPI
pub struct ContentPlugin {
    pub kind int
    pub bootstrap string
    pub macos_src string
    pub macos_frameworks string
    pub linux_src string
    pub linux_libs string
    pub windows_src string
    pub windows_libs string
}

Purpose

Per-OS content backend registration. Shell picks fields for xu_target_os only. Empty src on an OS ⇒ that backend is unavailable there (shell may still run empty).

Parameters

kind int
kind tag
bootstrap string
field (string)
macos_src string
field (string)
macos_frameworks string
field (string)
linux_src string
field (string)
linux_libs string
field (string)
windows_src string
field (string)
windows_libs string
field (string)

const os_macos

XuAPI
pub const os_macos = 0

Purpose

Public constant `os_macos`. Value `0`.

Parameters

none

const os_linux

XuAPI
pub const os_linux = 1

Purpose

Public constant `os_linux`. Value `1`.

Parameters

none

const os_windows

XuAPI
pub const os_windows = 2

Purpose

Public constant `os_windows`. Value `2`.

Parameters

none

const os_none

XuAPI
pub const os_none = 3

Purpose

Public constant `os_none`. Value `3`.

Parameters

none

const ev_none

XuAPI
pub const ev_none = 0

Purpose

Public constant `ev_none`. Value `0`.

Parameters

none

const ev_ready

XuAPI
pub const ev_ready = 1

Purpose

Public constant `ev_ready`. Value `1`.

Parameters

none

const ev_exit

XuAPI
pub const ev_exit = 2

Purpose

Public constant `ev_exit`. Value `2`.

Parameters

none

const ev_before_exit

XuAPI
pub const ev_before_exit = 3

Purpose

Public constant `ev_before_exit`. Value `3`.

Parameters

none

const ev_close_requested

XuAPI
pub const ev_close_requested = 10

Purpose

Public constant `ev_close_requested`. Value `10`.

Parameters

none

const ev_closed

XuAPI
pub const ev_closed = 11

Purpose

Public constant `ev_closed`. Value `11`.

Parameters

none

const ev_focused

XuAPI
pub const ev_focused = 12

Purpose

Public constant `ev_focused`. Value `12`.

Parameters

none

const ev_blurred

XuAPI
pub const ev_blurred = 13

Purpose

Public constant `ev_blurred`. Value `13`.

Parameters

none

const ev_resized

XuAPI
pub const ev_resized = 14

Purpose

Public constant `ev_resized`. Value `14`.

Parameters

none

const ev_moved

XuAPI
pub const ev_moved = 15

Purpose

Public constant `ev_moved`. Value `15`.

Parameters

none

const ev_menu_clicked

XuAPI
pub const ev_menu_clicked = 20

Purpose

Public constant `ev_menu_clicked`. Value `20`.

Parameters

none

const ev_tray_clicked

XuAPI
pub const ev_tray_clicked = 30

Purpose

Public constant `ev_tray_clicked`. Value `30`.

Parameters

none

const ev_tray_menu_clicked

XuAPI
pub const ev_tray_menu_clicked = 31

Purpose

Public constant `ev_tray_menu_clicked`. Value `31`.

Parameters

none

const ev_loading

XuAPI
pub const ev_loading = 40

Purpose

Public constant `ev_loading`. Value `40`.

Parameters

none

const ev_loaded

XuAPI
pub const ev_loaded = 41

Purpose

Public constant `ev_loaded`. Value `41`.

Parameters

none

const ev_load_failed

XuAPI
pub const ev_load_failed = 42

Purpose

Public constant `ev_load_failed`. Value `42`.

Parameters

none

const ev_progress

XuAPI
pub const ev_progress = 43

Purpose

Public constant `ev_progress`. Value `43`.

Parameters

none

const ev_file_drop

XuAPI
pub const ev_file_drop = 50

Purpose

Public constant `ev_file_drop`. Value `50`.

Parameters

none

const ev_file_picked

XuAPI
pub const ev_file_picked = 51

Purpose

Public constant `ev_file_picked`. Value `51`.

Parameters

none

const ev_file_saved

XuAPI
pub const ev_file_saved = 52

Purpose

Public constant `ev_file_saved`. Value `52`.

Parameters

none

const ev_external_nav

XuAPI
pub const ev_external_nav = 53

Purpose

Public constant `ev_external_nav`. Value `53`.

Parameters

none

const ev_screenshot

XuAPI
pub const ev_screenshot = 54

Purpose

Public constant `ev_screenshot`. Value `54`.

Parameters

none

const ev_folder_picked

XuAPI
pub const ev_folder_picked = 55

Purpose

Public constant `ev_folder_picked`. Value `55`.

Parameters

none

const ev_alert

XuAPI
pub const ev_alert = 56

Purpose

Public constant `ev_alert`. Value `56`.

Parameters

none

const ev_confirm

XuAPI
pub const ev_confirm = 57

Purpose

Public constant `ev_confirm`. Value `57`.

Parameters

none

const ev_notify

XuAPI
pub const ev_notify = 58

Purpose

Public constant `ev_notify`. Value `58`.

Parameters

none

const ev_close_rejected

XuAPI
pub const ev_close_rejected = 59

Purpose

Public constant `ev_close_rejected`. Value `59`.

Parameters

none

const ev_cache_cleared

XuAPI
pub const ev_cache_cleared = 60

Purpose

Public constant `ev_cache_cleared`. Value `60`.

Parameters

none

const ev_download

XuAPI
pub const ev_download = 61

Purpose

Public constant `ev_download`. Value `61`.

Parameters

none

const ev_download_failed

XuAPI
pub const ev_download_failed = 62

Purpose

Public constant `ev_download_failed`. Value `62`.

Parameters

none

const ev_cookies_cleared

XuAPI
pub const ev_cookies_cleared = 63

Purpose

Public constant `ev_cookies_cleared`. Value `63`.

Parameters

none

const ev_clipboard

XuAPI
pub const ev_clipboard = 65

Purpose

Public constant `ev_clipboard`. Value `65`.

Parameters

none

const ev_bounds

XuAPI
pub const ev_bounds = 66

Purpose

Public constant `ev_bounds`. Value `66`.

Parameters

none

const ev_state

XuAPI
pub const ev_state = 67

Purpose

Public constant `ev_state`. Value `67`.

Parameters

none

const ev_click

XuAPI
pub const ev_click = 68

Purpose

Public constant `ev_click`. Value `68`.

Parameters

none

const ev_prompt

XuAPI
pub const ev_prompt = 69

Purpose

Public constant `ev_prompt`. Value `69`.

Parameters

none

const ev_scroll

XuAPI
pub const ev_scroll = 70

Purpose

Public constant `ev_scroll`. Value `70`.

Parameters

none

const ev_drag

XuAPI
pub const ev_drag = 71

Purpose

Public constant `ev_drag`. Value `71`.

Parameters

none

struct Event

XuAPI
pub struct Event {
    pub kind int
    pub window_id int
    pub menu_id string
    pub width int
    pub height int
}

Purpose

Public struct `Event`.

Parameters

kind int
kind tag
window_id int
field (int)
menu_id string
field (string)
width int
field (int)
height int
field (int)

struct Icon

XuAPI
pub struct Icon {
    pub path string
}

Purpose

Public struct `Icon`.

Parameters

path string
filesystem path

struct MenuItem

XuAPI
pub struct MenuItem {
    pub id string
    pub label string
}

Purpose

Public struct `MenuItem`.

Parameters

id string
field (string)
label string
field (string)

struct Menu

XuAPI
pub struct Menu {
    pub items []MenuItem
}

Purpose

Public struct `Menu`.

Parameters

items []MenuItem
items

struct WindowOpts

XuAPI
pub struct WindowOpts {
    pub title string
    pub width int
    pub height int
}

Purpose

Public struct `WindowOpts`.

Parameters

title string
field (string)
width int
field (int)
height int
field (int)

struct Window

XuAPI
pub struct Window {
    pub id int
    pub title string
    pub width int
    pub height int
    pub content_kind int
    pub content_backend_id int
    pub closed int
}

Purpose

Public struct `Window`.

Parameters

id int
field (int)
title string
field (string)
width int
field (int)
height int
field (int)
content_kind int
field (int)
content_backend_id int
field (int)
closed int
field (int)

struct TrayOpts

XuAPI
pub struct TrayOpts {
    pub tip string
    pub icon Icon
    pub menu Menu
}

Purpose

Public struct `TrayOpts`.

Parameters

tip string
field (string)
icon Icon
field (Icon)
menu Menu
field (Menu)

struct Tray

XuAPI
pub struct Tray {
    pub id int
    pub tip string
}

Purpose

Public struct `Tray`.

Parameters

id int
field (int)
tip string
field (string)

struct App

XuAPI
pub struct App {
    pub next_id int
    pub icon Icon
    pub quit_flag int
    pub sim int
    pub event_ch chan Event
    pub post_ch chan int
    pub menu_ids []string
    pub win_title string
    pub win_w int
    pub win_h int
}

Purpose

Public struct `App`.

Parameters

next_id int
field (int)
icon Icon
field (Icon)
quit_flag int
field (int)
sim int
field (int)
event_ch chan Event
field (channel; type chan Event)
post_ch chan int
field (channel; type chan int)
menu_ids []string
field ([]string)
win_title string
field (string)
win_w int
field (int)
win_h int
field (int)

new_app

XuAPI
pub fn new_app() App

Purpose

Construct app.

Parameters

none

Returns

App — a value of this type

new_app_events

XuAPI
pub fn new_app_events(ech chan Event) App

Purpose

new_app_events shares `ech` with IPC / draw workers. Host events are pumped here (not in #ui/webview.bind_ipc).

Parameters

ech chan Event
ech (channel; type chan Event)

Returns

App — a value of this type

icon_default

XuAPI
pub fn icon_default() Icon

Purpose

Icon default.

Parameters

none

Returns

Icon — a value of this type

icon_from_file

XuAPI
pub fn icon_from_file(path string) Icon

Purpose

Icon from file.

Parameters

path string
filesystem path (string)

Returns

Icon — a value of this type

target_os

XuAPI
pub fn target_os() int

Purpose

Target os.

Parameters

none

Returns

int — a value of this type

platform_supported

XuAPI
pub fn platform_supported() bool

Purpose

Platform supported.

Parameters

none

Returns

bool — true or false

(&mut App) alloc_id

XuAPI
pub fn (a &mut App) alloc_id() int

Purpose

Method on `&mut App`: alloc id.

Parameters

a &mut App
receiver &mut App (exclusive borrow)

Returns

int — a value of this type

(&mut App) set_icon

XuAPI
pub fn (a &mut App) set_icon(icon Icon)

Purpose

Method on `&mut App`: set icon.

Parameters

a &mut App
receiver &mut App (exclusive borrow)
icon Icon
icon (Icon)

install_tray_icon

XuAPI
pub fn install_tray_icon(path string) int

Purpose

Install tray icon. Throws on failure.

Parameters

path string
filesystem path (string)

Returns

int — a value of this type

(&mut App) new_window

XuAPI
pub fn (a &mut App) new_window(opts WindowOpts) Window

Purpose

Method on `&mut App`: construct window.

Parameters

a &mut App
receiver &mut App (exclusive borrow)
opts WindowOpts
opts (WindowOpts)

Returns

Window — a value of this type

install_menu

XuAPI
pub fn install_menu(m Menu) int

Purpose

Install menu. Throws on failure.

Parameters

m Menu
m (Menu)

Returns

int — a value of this type

native_set_menu_visible

XuAPI
pub fn native_set_menu_visible(on int) int

Purpose

Opt out of the Windows host's default menu bar before or after App.run. Throws on failure.

Parameters

on int
on (int)

Returns

int — a value of this type

install_tray

XuAPI
pub fn install_tray(tip string, m Menu) int

Purpose

Install tray. Throws on failure.

Parameters

tip string
tip (string)
m Menu
m (Menu)

Returns

int — a value of this type

(&mut Window) set_menu

XuAPI
pub fn (w &mut Window) set_menu(m Menu)

Purpose

Method on `&mut Window`: set menu.

Parameters

w &mut Window
receiver &mut Window (exclusive borrow)
m Menu
m (Menu)

(&mut App) new_tray

XuAPI
pub fn (a &mut App) new_tray(opts TrayOpts) Tray

Purpose

Method on `&mut App`: construct tray.

Parameters

a &mut App
receiver &mut App (exclusive borrow)
opts TrayOpts
opts (TrayOpts)

Returns

Tray — a value of this type

(&mut Window) set_title

XuAPI
pub fn (w &mut Window) set_title(title string)

Purpose

Method on `&mut Window`: set title.

Parameters

w &mut Window
receiver &mut Window (exclusive borrow)
title string
title (string)

native_set_title

XuAPI
pub fn native_set_title(title string) int

Purpose

native_set_title updates the live host title file (no Window handle needed). Throws on failure.

Parameters

title string
title (string)

Returns

int — a value of this type

native_set_size

XuAPI
pub fn native_set_size(width int, height int) int

Purpose

native_set_size updates live window size (host polls xu_ui_size.txt). Throws on failure.

Parameters

width int
width (int)
height int
height (int)

Returns

int — a value of this type

append_shell_cmd

XuAPI
pub fn append_shell_cmd(line string) int

Purpose

Append shell cmd. Throws on failure.

Parameters

line string
line (string)

Returns

int — a value of this type

append_content_cmd

XuAPI
pub fn append_content_cmd(line string) int

Purpose

Content-backend cmds (#ui/webview / #ui/draw / …). Prefer this for non-shell backends. Throws on failure.

Parameters

line string
line (string)

Returns

int — a value of this type

append_wv_cmd

XuAPI
pub fn append_wv_cmd(line string) int

Purpose

Alias: webview historically used the "wv." prefix (still accepted by host). Throws on failure.

Parameters

line string
line (string)

Returns

int — a value of this type

host_enabled

XuAPI
pub fn host_enabled() bool

Purpose

Host enabled.

Parameters

none

Returns

bool — true or false

host_tmp

XuAPI
pub fn host_tmp() string

Purpose

Host tmp.

Parameters

none

Returns

string — result string

native_show

XuAPI
pub fn native_show() int

Purpose

Native show. Throws on failure.

Parameters

none

Returns

int — a value of this type

native_hide

XuAPI
pub fn native_hide() int

Purpose

Native hide. Throws on failure.

Parameters

none

Returns

int — a value of this type

native_minimize

XuAPI
pub fn native_minimize() int

Purpose

Native minimize. Throws on failure.

Parameters

none

Returns

int — a value of this type

native_set_position

XuAPI
pub fn native_set_position(x int, y int) int

Purpose

Native set position. Throws on failure.

Parameters

x int
value (int)
y int
value (int)

Returns

int — a value of this type

native_set_fullscreen

XuAPI
pub fn native_set_fullscreen(on int) int

Purpose

Native set fullscreen. Throws on failure.

Parameters

on int
on (int)

Returns

int — a value of this type

native_set_floating

XuAPI
pub fn native_set_floating(on int) int

Purpose

Native set floating. Throws on failure.

Parameters

on int
on (int)

Returns

int — a value of this type

native_center

XuAPI
pub fn native_center() int

Purpose

Native center. Throws on failure.

Parameters

none

Returns

int — a value of this type

native_open_external

XuAPI
pub fn native_open_external(url string) int

Purpose

Native open external. Throws on failure.

Parameters

url string
url (string)

Returns

int — a value of this type

native_clipboard_set

XuAPI
pub fn native_clipboard_set(text string) int

Purpose

Native clipboard set. Throws on failure.

Parameters

text string
text (string)

Returns

int — a value of this type

native_clipboard_get

XuAPI
pub fn native_clipboard_get() string

Purpose

Posts clipboard_get. Result arrives as shell event `clipboard\t…` → emit (XUN post).

Parameters

none

Returns

string — result string

native_set_maximized

XuAPI
pub fn native_set_maximized(on int) int

Purpose

Native set maximized. Throws on failure.

Parameters

on int
on (int)

Returns

int — a value of this type

native_bounce

XuAPI
pub fn native_bounce() int

Purpose

Native bounce. Throws on failure.

Parameters

none

Returns

int — a value of this type

native_pick_file

XuAPI
pub fn native_pick_file() string

Purpose

Posts pick_file. Result: shell event `file_picked\tpath` (empty path = cancel).

Parameters

none

Returns

string — result string

native_set_opacity

XuAPI
pub fn native_set_opacity(percent int) int

Purpose

Native set opacity. Throws on failure.

Parameters

percent int
percent (int)

Returns

int — a value of this type

native_save_file

XuAPI
pub fn native_save_file(suggested_name string) string

Purpose

Posts save_file. Result: shell event `file_saved\tpath`.

Parameters

suggested_name string
suggested_name (string)

Returns

string — result string

native_screenshot

XuAPI
pub fn native_screenshot() string

Purpose

Posts screenshot. Result: shell event `screenshot\tpath`.

Parameters

none

Returns

string — result string

native_alert

XuAPI
pub fn native_alert(title string, message string) int

Purpose

Posts alert. Completion: shell event `alert\tok`.

Parameters

title string
title (string)
message string
message (string)

Returns

int — a value of this type

native_confirm

XuAPI
pub fn native_confirm(title string, message string) int

Purpose

Posts confirm. Result: shell event `confirm\t1|0`.

Parameters

title string
title (string)
message string
message (string)

Returns

int — a value of this type

native_notify

XuAPI
pub fn native_notify(title string, body string) int

Purpose

Native notify.

Parameters

title string
title (string)
body string
body (string)

Returns

int — a value of this type

native_pick_folder

XuAPI
pub fn native_pick_folder() string

Purpose

Posts pick_folder. Result: shell event `folder_picked\tpath`.

Parameters

none

Returns

string — result string

native_set_min_size

XuAPI
pub fn native_set_min_size(width int, height int) int

Purpose

Native set min size. Throws on failure.

Parameters

width int
width (int)
height int
height (int)

Returns

int — a value of this type

native_set_resizable

XuAPI
pub fn native_set_resizable(on int) int

Purpose

Native set resizable. Throws on failure.

Parameters

on int
on (int)

Returns

int — a value of this type

native_get_bounds

XuAPI
pub fn native_get_bounds() string

Purpose

Posts get_bounds. Result: shell event `bounds\t…`.

Parameters

none

Returns

string — result string

native_set_titlebar_visible

XuAPI
pub fn native_set_titlebar_visible(on int) int

Purpose

Native set titlebar visible.

Parameters

on int
on (int)

Returns

int — a value of this type

native_set_close_guard

XuAPI
pub fn native_set_close_guard(on int) int

Purpose

Native set close guard.

Parameters

on int
on (int)

Returns

int — a value of this type

native_accept_close

XuAPI
pub fn native_accept_close() int

Purpose

Native accept close.

Parameters

none

Returns

int — a value of this type

native_reject_close

XuAPI
pub fn native_reject_close() int

Purpose

Native reject close.

Parameters

none

Returns

int — a value of this type

native_set_visible_on_all_spaces

XuAPI
pub fn native_set_visible_on_all_spaces(on int) int

Purpose

Native set visible on all spaces.

Parameters

on int
on (int)

Returns

int — a value of this type

native_get_state

XuAPI
pub fn native_get_state() string

Purpose

Posts get_state. Result: shell event `state\t…`.

Parameters

none

Returns

string — result string

native_open_path

XuAPI
pub fn native_open_path(path string) int

Purpose

Native open path.

Parameters

path string
filesystem path (string)

Returns

int — a value of this type

native_reveal_path

XuAPI
pub fn native_reveal_path(path string) int

Purpose

Native reveal path.

Parameters

path string
filesystem path (string)

Returns

int — a value of this type

native_set_appearance

XuAPI
pub fn native_set_appearance(mode string) int

Purpose

"dark" | "light" | "system"

Parameters

mode string
mode (string)

Returns

int — a value of this type

native_set_dock_badge

XuAPI
pub fn native_set_dock_badge(text string) int

Purpose

Native set dock badge.

Parameters

text string
text (string)

Returns

int — a value of this type

native_screenshot_to_clipboard

XuAPI
pub fn native_screenshot_to_clipboard() int

Purpose

Native screenshot to clipboard.

Parameters

none

Returns

int — a value of this type

native_set_shadow

XuAPI
pub fn native_set_shadow(on int) int

Purpose

Native set shadow.

Parameters

on int
on (int)

Returns

int — a value of this type

native_set_frameless

XuAPI
pub fn native_set_frameless(on int) int

Purpose

Frameless shell (no system titlebar/chrome). Prefer with transparent + mask for shaped windows.

Parameters

on int
on (int)

Returns

int — a value of this type

native_set_transparent

XuAPI
pub fn native_set_transparent(on int) int

Purpose

Transparent window / client background (needed for PNG alpha shaped windows).

Parameters

on int
on (int)

Returns

int — a value of this type

native_set_window_mask

XuAPI
pub fn native_set_window_mask(path string) int

Purpose

PNG alpha mask: opaque pixels visible + hit-test; alpha≈0 click-through. macOS AppKit / Linux GTK4 / Windows Win32+GDI+ UpdateLayeredWindow. Throws on failure.

Parameters

path string
filesystem path (string)

Returns

int — a value of this type

native_clear_window_mask

XuAPI
pub fn native_clear_window_mask() int

Purpose

Native clear window mask.

Parameters

none

Returns

int — a value of this type

native_quit

XuAPI
pub fn native_quit() int

Purpose

Ask the native host to quit (frameless windows have no red close button). Throws on failure.

Parameters

none

Returns

int — a value of this type

unsupported_msg

XuAPI
pub fn unsupported_msg() string

Purpose

Unsupported msg.

Parameters

none

Returns

string — result string

(&mut App) remember_menu

XuAPI
pub fn (a &mut App) remember_menu(m Menu)

Purpose

Method on `&mut App`: remember menu.

Parameters

a &mut App
receiver &mut App (exclusive borrow)
m Menu
m (Menu)

(&mut Window) set_content_slot

XuAPI
pub fn (w &mut Window) set_content_slot(kind int, backend_id int)

Purpose

Method on `&mut Window`: set content slot.

Parameters

w &mut Window
receiver &mut Window (exclusive borrow)
kind int
kind tag (int)
backend_id int
backend_id (int)

(Window) content_slot_kind

XuAPI
pub fn (w Window) content_slot_kind() int

Purpose

Method on `Window`: content slot kind.

Parameters

w Window
receiver Window (value receiver)

Returns

int — a value of this type

(Window) content_slot_backend_id

XuAPI
pub fn (w Window) content_slot_backend_id() int

Purpose

Method on `Window`: content slot backend id.

Parameters

w Window
receiver Window (value receiver)

Returns

int — a value of this type

(&mut Window) close

XuAPI
pub fn (w &mut Window) close()

Purpose

Method on `&mut Window`: close the resource.

Parameters

w &mut Window
receiver &mut Window (exclusive borrow)

(&mut App) quit

XuAPI
pub fn (a &mut App) quit()

Purpose

Call `quit` on `&mut App`.

Parameters

a &mut App
receiver &mut App (exclusive borrow)

(&mut App) push_event

XuAPI
pub fn (a &mut App) push_event(ev Event)

Purpose

Method on `&mut App`: push event.

Parameters

a &mut App
receiver &mut App (exclusive borrow)
ev Event
ev (Event)

(&mut App) poll_event

XuAPI
pub fn (a &mut App) poll_event() Event

Purpose

Method on `&mut App`: poll event.

Parameters

a &mut App
receiver &mut App (exclusive borrow)

Returns

Event — a value of this type

(&mut App) post

XuAPI
pub fn (a &mut App) post(token int)

Purpose

Call `post` on `&mut App`.

Parameters

a &mut App
receiver &mut App (exclusive borrow)
token int
token (int)

(&mut App) try_recv_post

XuAPI
pub fn (a &mut App) try_recv_post() int

Purpose

Method on `&mut App`: try recv post.

Parameters

a &mut App
receiver &mut App (exclusive borrow)

Returns

int — a value of this type

content_plugin_webview

XuAPI
pub fn content_plugin_webview() ContentPlugin

Purpose

Default webview ContentPlugin (per-OS host sources). Used by #ui/webview.attach.

Parameters

none

Returns

ContentPlugin — a value of this type

content_plugin_draw

XuAPI
pub fn content_plugin_draw() ContentPlugin

Purpose

Direct-draw content plugin (no WebKit). Same registration shape as webview.

Parameters

none

Returns

ContentPlugin — a value of this type

use_draw_content

XuAPI
pub fn use_draw_content(w &mut Window) int

Purpose

Attach draw backend to a window slot and register the plugin for App.run.

Parameters

w &mut Window
writer or width (exclusive borrow; type &mut Window)

Returns

int — a value of this type

native_draw_set_bg

XuAPI
pub fn native_draw_set_bg(hex string) int

Purpose

Draw-plugin cmds (content_draw). Hex like "#3366cc" or "3366cc". Canvas API (immediate-mode 2D, Love2D/Raylib-style): `#ui/draw`. Throws on failure.

Parameters

hex string
hex (string)

Returns

int — a value of this type

native_draw_clear

XuAPI
pub fn native_draw_clear() int

Purpose

Native draw clear. Throws on failure.

Parameters

none

Returns

int — a value of this type

native_draw_set_label

XuAPI
pub fn native_draw_set_label(text string) int

Purpose

Native draw set label. Throws on failure.

Parameters

text string
text (string)

Returns

int — a value of this type

register_content_plugin

XuAPI
pub fn register_content_plugin(p ContentPlugin) int

Purpose

Register a content backend before App.run. Spec carries macOS / Linux / Windows sources separately — shell never hardcodes a backend or a single-OS path. Future draw / native views use the same shape.

Parameters

p ContentPlugin
p (ContentPlugin)

Returns

int — a value of this type

(&mut App) run

XuAPI
pub fn (a &mut App) run() int

Purpose

Call `run` on `&mut App`. Throws on failure.

Parameters

a &mut App
receiver &mut App (exclusive borrow)

Returns

int — a value of this type

load_asset

XuAPI
pub fn load_asset(path string) string

Purpose

Load asset. Throws on failure.

Parameters

path string
filesystem path (string)

Returns

string — result string

push_host_event

XuAPI
pub fn push_host_event(ech chan Event, pl0 string)

Purpose

Push host event.

Parameters

ech chan Event
ech (channel; type chan Event)
pl0 string
pl0 (string)

drain_host_events

XuAPI
pub fn drain_host_events(ech chan Event)

Purpose

Drain host events.

Parameters

ech chan Event
ech (channel; type chan Event)

poll_chan

XuAPI
pub fn poll_chan(ech chan Event) Event

Purpose

Poll chan.

Parameters

ech chan Event
ech (channel; type chan Event)

Returns

Event — a value of this type