#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::missing_safety_doc)]
#[repr(u64)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HandleValue {
Invalid = 0,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum NodeType {
FlexBox = 0,
Text = 1,
Image = 2,
Svg = 3,
ScrollView = 4,
Grid = 5,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Unit {
Pixel = 0,
Auto = 1,
Percent = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GridUnit {
Pixel = 0,
Auto = 1,
Star = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PositionType {
Relative = 0,
Absolute = 1,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Visibility {
Normal = 0,
Hidden = 1,
Collapsed = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FlexDirection {
Column = 0,
Row = 1,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FlexWrap {
NoWrap = 0,
Wrap = 1,
WrapReverse = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum JustifyContent {
Start = 0,
Center = 1,
End = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AlignItems {
Start = 0,
Center = 1,
End = 2,
Stretch = 3,
None = 4,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AlignSelf {
Auto = 0,
Start = 1,
Center = 2,
End = 3,
Stretch = 4,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BorderStyle {
Solid = 0,
Dashed = 1,
Dotted = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ObjectFit {
Fill = 0,
Contain = 1,
Cover = 2,
None = 3,
ScaleDown = 4,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ImageSamplingKind {
Linear = 0,
Nearest = 1,
LinearMipmapNearest = 2,
LinearMipmapLinear = 3,
CubicMitchell = 4,
CubicCatmullRom = 5,
Anisotropic = 6,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TextAlign {
Left = 0,
Center = 1,
Right = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TextVerticalAlign {
Top = 0,
Center = 1,
Bottom = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TextOverflow {
Clip = 0,
Ellipsis = 1,
Fade = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Orientation {
None = 0,
Horizontal = 1,
Vertical = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum KeyEventType {
Down = 1,
Up = 2,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PointerEventType {
Down = 1,
Up = 2,
Move = 3,
Enter = 4,
Leave = 5,
Cancel = 6,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum KeyModifier {
Shift = 1 << 0,
Ctrl = 1 << 1,
Alt = 1 << 2,
Meta = 1 << 3,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SemanticRole {
None = 0,
Button = 1,
Textbox = 2,
Link = 3,
Heading = 4,
Form = 5,
List = 6,
ListItem = 7,
Image = 8,
Dialog = 9,
StaticText = 10,
Checkbox = 11,
Radio = 12,
RadioGroup = 13,
Switch = 14,
Slider = 15,
ComboBox = 16,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PlatformFamily {
Unknown = 0,
Apple = 1,
Windows = 2,
Linux = 3,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HostEnvironment {
Unknown = 0,
Browser = 1,
Desktop = 2,
Headless = 3,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HostCapability {
BrowserHistory = 1,
Reload = 2,
NewBrowsingContext = 4,
OpenExternalUri = 8,
ClipboardRead = 16,
ClipboardWrite = 32,
FileDialogs = 64,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CursorStyle {
Default = 0,
Pointer = 1,
Text = 2,
Move = 3,
Grab = 4,
Grabbing = 5,
ResizeNS = 6,
ResizeEW = 7,
}
#[repr(u32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SemanticCheckedState {
None = 0,
False = 1,
True = 2,
Mixed = 3,
}
#[cfg(any(target_arch = "wasm32", feature = "native-runtime"))]
#[cfg_attr(target_arch = "wasm32", link(wasm_import_module = "effindom_v2_ui"))]
unsafe extern "C" {
pub fn ui_get_abi_version() -> u32;
pub fn ui_arena_alloc(size: u32) -> usize;
pub fn ui_reset();
pub fn ui_create_node(type_: u32) -> u64;
pub fn ui_delete_node(handle: u64);
pub fn ui_set_node_id(handle: u64, utf8_id: *const u8, len: u32);
pub fn ui_set_semantic_role(handle: u64, role_enum: u32);
pub fn ui_set_semantic_label(handle: u64, utf8_label: *const u8, len: u32);
pub fn ui_set_semantic_checked(handle: u64, checked_state_enum: u32);
pub fn ui_set_semantic_selected(handle: u64, has_selected: bool, is_selected: bool);
pub fn ui_set_semantic_expanded(handle: u64, has_expanded: bool, is_expanded: bool);
pub fn ui_set_semantic_disabled(handle: u64, has_disabled: bool, is_disabled: bool);
pub fn ui_set_semantic_value_range(
handle: u64,
has_value_range: bool,
value_now: f32,
value_min: f32,
value_max: f32,
);
pub fn ui_set_semantic_orientation(handle: u64, orientation_enum: u32);
pub fn ui_request_semantic_announcement(handle: u64);
pub fn ui_push_semantic_scope(handle: u64) -> u32;
pub fn ui_remove_semantic_scope(token: u32);
pub fn ui_node_add_child(parent: u64, child: u64);
pub fn ui_node_remove_child(parent: u64, child: u64);
pub fn ui_set_is_portal(handle: u64, is_portal: bool);
pub fn ui_set_visibility(handle: u64, visibility_enum: u32);
pub fn ui_set_width(handle: u64, value: f32, unit_enum: u32);
pub fn ui_set_height(handle: u64, value: f32, unit_enum: u32);
pub fn ui_set_fill_width(handle: u64, fill: bool);
pub fn ui_set_fill_height(handle: u64, fill: bool);
pub fn ui_set_fill_width_percent(handle: u64, percent: f32);
pub fn ui_set_fill_height_percent(handle: u64, percent: f32);
pub fn ui_set_min_width(handle: u64, value: f32, unit_enum: u32);
pub fn ui_set_max_width(handle: u64, value: f32, unit_enum: u32);
pub fn ui_set_min_height(handle: u64, value: f32, unit_enum: u32);
pub fn ui_set_max_height(handle: u64, value: f32, unit_enum: u32);
pub fn ui_set_flex_direction(handle: u64, dir_enum: u32);
pub fn ui_set_flex_basis(handle: u64, basis: f32);
pub fn ui_set_justify_content(handle: u64, justify_enum: u32);
pub fn ui_set_align_items(handle: u64, align_enum: u32);
pub fn ui_set_align_self(handle: u64, align_enum: u32);
pub fn ui_set_padding(handle: u64, left: f32, top: f32, right: f32, bottom: f32);
pub fn ui_set_margin(handle: u64, left: f32, top: f32, right: f32, bottom: f32);
pub fn ui_set_position_type(handle: u64, pos_enum: u32);
pub fn ui_set_position(handle: u64, left: f32, top: f32, right: f32, bottom: f32);
pub fn ui_set_is_shared_size_scope(handle: u64, is_scope: bool);
pub fn ui_set_custom_drawable(handle: u64, is_custom_drawable: bool);
pub fn ui_set_flex_wrap(handle: u64, wrap_enum: u32);
pub fn ui_prepare_node(handle: u64) -> u32;
pub fn ui_set_dynamic_text_charset(handle: u64, utf8_charset: *const u8, len: u32);
pub fn ui_get_text_metrics(
handle: u64,
out_width: *mut f32,
out_height: *mut f32,
out_baseline: *mut f32,
out_line_count: *mut u32,
out_max_line_width: *mut f32,
) -> bool;
pub fn ui_grid_set_columns(handle: u64, count: u32, values: *const f32, types: *const u8);
pub fn ui_grid_set_rows(handle: u64, count: u32, values: *const f32, types: *const u8);
pub fn ui_grid_set_column_shared_size_group(
handle: u64,
index: u32,
utf8_group: *const u8,
len: u32,
);
pub fn ui_grid_set_row_shared_size_group(
handle: u64,
index: u32,
utf8_group: *const u8,
len: u32,
);
pub fn ui_node_set_grid_placement(child: u64, row: u32, col: u32, row_span: u32, col_span: u32);
pub fn ui_set_bg_color(handle: u64, color: u32);
pub fn ui_set_box_style(
handle: u64,
bg_color: u32,
radius_tl: f32,
radius_tr: f32,
radius_br: f32,
radius_bl: f32,
border_width: f32,
border_color: u32,
border_style_enum: u32,
border_dash_on: f32,
border_dash_off: f32,
);
pub fn ui_set_clip_to_bounds(handle: u64, clip: bool);
pub fn ui_set_linear_gradient(
handle: u64,
sx: f32,
sy: f32,
ex: f32,
ey: f32,
stop_count: u32,
offsets: *const f32,
colors: *const u32,
);
pub fn ui_set_drop_shadow(
handle: u64,
color: u32,
offset_x: f32,
offset_y: f32,
blur_sigma: f32,
spread: f32,
);
pub fn ui_set_layer_effect(handle: u64, opacity: f32, blur_sigma: f32, blend_mode_enum: u32);
pub fn ui_set_background_blur(handle: u64, blur_sigma: f32);
pub fn ui_set_image(
handle: u64,
texture_id: u32,
object_fit_enum: u32,
sampling_kind: u32,
max_aniso: u32,
);
pub fn ui_set_image_nine(
handle: u64,
texture_id: u32,
inset_l: f32,
inset_t: f32,
inset_r: f32,
inset_b: f32,
sampling_kind: u32,
max_aniso: u32,
);
pub fn ui_set_svg(
handle: u64,
svg_id: u32,
tint_color: u32,
sampling_kind: u32,
max_aniso: u32,
);
pub fn ui_set_text(handle: u64, utf8_str: *const u8, len: u32);
pub fn ui_set_text_style_runs(handle: u64, run_count: u32, runs_words: *const u32);
pub fn ui_set_font(handle: u64, font_id: u32, size: f32);
pub fn ui_set_line_height(handle: u64, line_height: f32);
pub fn ui_set_text_color(handle: u64, color: u32);
pub fn ui_set_text_align(handle: u64, align_enum: u32);
pub fn ui_set_text_vertical_align(handle: u64, align_enum: u32);
pub fn ui_set_text_limits(handle: u64, max_chars: i32, max_lines: i32);
pub fn ui_set_text_wrapping(handle: u64, wrap: bool);
pub fn ui_set_text_overflow(handle: u64, overflow_enum: u32);
pub fn ui_set_text_overflow_fade(handle: u64, horizontal: bool, vertical: bool);
pub fn ui_set_text_obscured(handle: u64, is_password: bool);
pub fn ui_measure_text(
utf8_str: *const u8,
len: u32,
font_id: u32,
size: f32,
max_width: f32,
out_width: *mut f32,
out_height: *mut f32,
);
pub fn ui_set_interactive(handle: u64, interactive: bool);
pub fn ui_set_preserve_selection_on_pointer_down(handle: u64, preserve: bool);
pub fn ui_set_editor_command_keys(handle: u64, enabled: bool);
pub fn ui_set_editor_accepts_tab(handle: u64, enabled: bool);
pub fn ui_set_scroll_proxy_target(handle: u64, scroll_handle: u64);
pub fn ui_set_scroll_enabled(handle: u64, enabled_x: bool, enabled_y: bool);
pub fn ui_set_scroll_friction(handle: u64, friction: f32);
pub fn ui_set_smooth_scrolling(handle: u64, smooth_scrolling: bool);
pub fn ui_set_focusable(handle: u64, focusable: bool, tab_index: i32);
pub fn ui_request_focus(handle: u64);
pub fn ui_set_scroll_offset(handle: u64, offset_x: f32, offset_y: f32);
pub fn ui_set_scroll_content_size(handle: u64, content_width: f32, content_height: f32);
pub fn ui_set_selectable(handle: u64, selectable: bool, selection_color: u32);
pub fn ui_set_selection_area(handle: u64, is_area: bool);
pub fn ui_set_selection_area_barrier(handle: u64, is_barrier: bool);
pub fn ui_clear_selection(text_node_handle: u64);
pub fn ui_retarget_selection(from_text_node_handle: u64, to_text_node_handle: u64);
pub fn ui_is_point_in_selection(logical_x: f32, logical_y: f32) -> bool;
pub fn ui_set_text_selection_range(handle: u64, selection_start: u32, selection_end: u32);
pub fn ui_select_word_at(handle: u64, logical_x: f32, logical_y: f32) -> bool;
pub fn ui_get_text_snapshot_handle_count() -> u32;
pub fn ui_copy_text_snapshot_handles(out_handle_words: *mut u32, max_handle_count: u32) -> u32;
pub fn ui_set_text_find_match(handle: u64, start: u32, end: u32) -> bool;
pub fn ui_clear_text_find_match();
pub fn ui_push_text_find_highlight(handle: u64, start: u32, end: u32, color: u32) -> bool;
pub fn ui_clear_text_find_highlights();
pub fn ui_get_text_document_utf8_length(handle: u64) -> u32;
pub fn ui_copy_text_document_utf8(handle: u64, out_utf8: *mut u8, buffer_length: u32) -> bool;
pub fn ui_get_text_visible_bounds(
handle: u64,
out_x: *mut f32,
out_y: *mut f32,
out_width: *mut f32,
out_height: *mut f32,
) -> bool;
pub fn ui_get_text_range_rect_count(handle: u64, start: u32, end: u32) -> u32;
pub fn ui_copy_text_range_rects(
handle: u64,
start: u32,
end: u32,
out_rect_words: *mut f32,
max_rect_count: u32,
) -> u32;
pub fn ui_copy_cross_selection_endpoint_rects(
area_handle: u64,
out_rect_words: *mut f32,
) -> bool;
pub fn ui_begin_selection_endpoint_drag(handle: u64, endpoint: u32) -> bool;
pub fn ui_preserves_selection_on_pointer_down(handle: u64) -> bool;
pub fn ui_reveal_text_range(handle: u64, start: u32, end: u32) -> bool;
pub fn ui_clear_current_selection();
pub fn ui_copy_current_selection();
pub fn ui_can_undo_text_edit(handle: u64) -> bool;
pub fn ui_can_redo_text_edit(handle: u64) -> bool;
pub fn ui_has_text_selection(handle: u64) -> bool;
pub fn ui_undo_text_edit(handle: u64);
pub fn ui_redo_text_edit(handle: u64);
pub fn ui_copy_text_selection(handle: u64);
pub fn ui_cut_text_selection(handle: u64);
pub fn ui_paste_text(handle: u64);
pub fn ui_select_all_text(handle: u64);
pub fn ui_set_editable(handle: u64, editable: bool);
pub fn ui_set_caret_color(handle: u64, color: u32);
pub fn ui_commit_frame();
pub fn ui_has_pending_visual_work() -> bool;
pub fn ui_needs_animation_frame() -> bool;
pub fn ui_has_pointer_autoscroll() -> bool;
pub fn ui_selection_autoscroll(logical_x: f32, logical_y: f32, edge_threshold: f32) -> u64;
pub fn ui_on_pointer_event(
event_enum: u32,
handle: u64,
logical_x: f32,
logical_y: f32,
pointer_id: i32,
pointer_type: u32,
button: i32,
buttons: u32,
pressure: f32,
width: f32,
height: f32,
click_count: i32,
modifiers: u32,
) -> bool;
pub fn ui_on_wheel_event(delta_x: f32, delta_y: f32);
pub fn ui_touch_scroll_begin(handle: u64, logical_x: f32, logical_y: f32, timestamp_ms: f64);
pub fn ui_touch_scroll_update(delta_x: f32, delta_y: f32, timestamp_ms: f64);
pub fn ui_wheel_scroll_can_consume(delta_x: f32, delta_y: f32) -> bool;
pub fn ui_touch_scroll_can_consume(delta_x: f32, delta_y: f32) -> bool;
pub fn ui_touch_scroll_end(timestamp_ms: f64);
pub fn ui_clear_momentum_scroll();
pub fn ui_touch_scroll_allows_pull_to_refresh() -> bool;
pub fn ui_set_coarse_pointer_mode(coarse_pointer_mode: bool);
pub fn ui_set_platform_family(platform_family: u32);
pub fn ui_on_key_event(type_enum: u32, key_utf8: *const u8, len: u32, modifiers: u32) -> bool;
pub fn ui_set_interaction_time(interaction_time_ms: u64);
pub fn ui_on_ime_update(handle: u64, utf8_str: *const u8, len: u32, caret_idx: u32);
pub fn ui_replace_text_range(
handle: u64,
start_idx: u32,
end_idx: u32,
utf8_str: *const u8,
len: u32,
caret_idx: u32,
);
pub fn ui_on_paste_text(handle: u64, utf8_str: *const u8, len: u32);
pub fn ui_font_loaded(font_id: u32);
pub fn ui_register_icu_data(bytes: *const u8, len: u32);
pub fn ui_register_font_fallback(font_id: u32, fallback_font_id: u32);
pub fn ui_unregister_font_fallback(font_id: u32, fallback_font_id: u32) -> bool;
pub fn ui_unregister_font(font_id: u32) -> bool;
pub fn ui_set_root(handle: u64);
pub fn ui_resize_window(logical_w: f32, logical_h: f32);
pub fn ui_register_font(font_id: u32, bytes: *const u8, len: u32) -> bool;
pub fn ui_get_command_buffer(out_length: *mut u32) -> *mut u32;
pub fn ui_get_semantic_buffer(out_length: *mut u32) -> *mut u32;
pub fn ui_get_debug_tree_buffer(out_length: *mut u32) -> *mut u32;
pub fn ui_get_live_fallback_font_buffer(out_length: *mut u32) -> *mut u32;
pub fn ui_get_bounds(
handle: u64,
out_x: *mut f32,
out_y: *mut f32,
out_width: *mut f32,
out_height: *mut f32,
) -> bool;
pub fn ui_get_focused_handle() -> u64;
pub fn ui_get_visible_bounds(
handle: u64,
out_x: *mut f32,
out_y: *mut f32,
out_width: *mut f32,
out_height: *mut f32,
) -> bool;
pub fn ui_set_host_callbacks(callbacks: *const u32);
}
#[cfg(any(target_arch = "wasm32", feature = "native-runtime"))]
#[cfg_attr(target_arch = "wasm32", link(wasm_import_module = "fui_host"))]
unsafe extern "C" {
pub fn request_render();
pub fn get_viewport_width() -> f32;
pub fn get_viewport_height() -> f32;
pub fn get_device_pixel_ratio() -> f32;
pub fn fui_set_application_caption(captionPtr: usize, captionLen: u32);
pub fn fui_set_pointer_capture(handle: u64);
pub fn fui_release_pointer_capture();
pub fn fui_reload_page();
pub fn fui_can_navigate_back() -> bool;
pub fn fui_can_navigate_forward() -> bool;
pub fn fui_navigate_back();
pub fn fui_navigate_forward();
pub fn fui_copy_text(ptr: usize, len: u32);
pub fn fui_register_text_input_metadata(
handle: u64,
isPassword: bool,
hintPtr: usize,
hintLen: u32,
);
pub fn fui_has_text_selection_snapshot(handle: u64) -> bool;
pub fn fui_freeze_text_selection_snapshot(handle: u64);
pub fn fui_copy_text_selection_snapshot(handle: u64) -> bool;
pub fn fui_cut_focused_text_selection() -> bool;
pub fn fui_cut_text_selection_snapshot(handle: u64) -> bool;
pub fn fui_cut_text_range_snapshot(handle: u64, start: u32, end: u32) -> bool;
pub fn fui_delete_focused_text_range(start: u32, end: u32) -> bool;
pub fn fui_commit_text_action_focus(handle: u64);
pub fn fui_load_svg(svgId: u32, ptr: usize, len: u32);
pub fn fui_load_texture(textureId: u32, ptr: usize, len: u32);
pub fn fui_release_svg(svgId: u32);
pub fn fui_release_texture(textureId: u32);
pub fn fui_bitmap_commit(
textureId: u32,
bytesPtr: usize,
bytesLen: u32,
width: u32,
height: u32,
);
pub fn fui_bitmap_commit_dirty(
textureId: u32,
bytesPtr: usize,
bytesLen: u32,
fullW: u32,
fullH: u32,
subX: u32,
subY: u32,
subW: u32,
subH: u32,
);
pub fn fui_bitmap_release(textureId: u32);
pub fn fui_render_node_to_rgba(
handle: u64,
width: u32,
height: u32,
outPtr: usize,
outCapacity: u32,
scale: f32,
x: f32,
y: f32,
) -> u32;
pub fn fui_load_font(fontId: u32, ptr: usize, len: u32);
pub fn fui_start_timer(timerId: u32, delayMs: i32);
pub fn fui_cancel_timer(timerId: u32);
pub fn fui_set_cursor(style: u32);
pub fn fui_is_dark_mode() -> bool;
pub fn fui_get_accent_color() -> u32;
pub fn fui_get_platform_family() -> u32;
pub fn fui_get_host_environment() -> u32;
pub fn fui_get_host_capabilities() -> u32;
pub fn fui_is_coarse_pointer() -> bool;
pub fn fui_show_url_preview(ptr: usize, len: u32);
pub fn fui_hide_url_preview();
pub fn fui_navigate_to(ptr: usize, len: u32, openInNewTab: bool);
pub fn fui_set_persisted_scroll_offset(nodeIdPtr: usize, nodeIdLen: u32, x: f32, y: f32);
pub fn fui_try_get_persisted_scroll_offset(
nodeIdPtr: usize,
nodeIdLen: u32,
outX: usize,
outY: usize,
) -> bool;
pub fn fui_set_persisted_state(
nodeIdPtr: usize,
nodeIdLen: u32,
kindPtr: usize,
kindLen: u32,
version: u32,
payloadPtr: usize,
payloadLen: u32,
);
pub fn fui_copy_persisted_state(
nodeIdPtr: usize,
nodeIdLen: u32,
kindPtr: usize,
kindLen: u32,
outVersionPtr: usize,
payloadPtr: usize,
payloadCapacity: u32,
) -> i32;
pub fn fui_log(categoryPtr: usize, catLen: u32, msgPtr: usize, msgLen: u32);
pub fn fui_logs_enabled() -> bool;
pub fn fui_worker_start_string(
workerId: u32,
wasmPathPtr: usize,
wasmPathLen: u32,
entryPtr: usize,
entryLen: u32,
inputPtr: usize,
inputLen: u32,
);
pub fn fui_worker_cancel(workerId: u32);
pub fn fui_file_capabilities() -> u32;
pub fn fui_file_pick(requestId: u32, acceptPtr: usize, acceptLen: u32, multiple: bool);
pub fn fui_file_read_chunk(
requestId: u32,
fileIdPtr: usize,
fileIdLen: u32,
offsetBytes: u64,
maxBytes: u32,
);
pub fn fui_file_save_text(
requestId: u32,
suggestedNamePtr: usize,
suggestedNameLen: u32,
mimeTypePtr: usize,
mimeTypeLen: u32,
fileExtensionPtr: usize,
fileExtensionLen: u32,
textPtr: usize,
textLen: u32,
);
pub fn fui_file_save_bytes(
requestId: u32,
suggestedNamePtr: usize,
suggestedNameLen: u32,
mimeTypePtr: usize,
mimeTypeLen: u32,
fileExtensionPtr: usize,
fileExtensionLen: u32,
bytesPtr: usize,
bytesLen: u32,
);
pub fn fui_file_create_writer(
requestId: u32,
suggestedNamePtr: usize,
suggestedNameLen: u32,
mimeTypePtr: usize,
mimeTypeLen: u32,
fileExtensionPtr: usize,
fileExtensionLen: u32,
);
pub fn fui_file_writer_write_text(
requestId: u32,
writerIdPtr: usize,
writerIdLen: u32,
textPtr: usize,
textLen: u32,
);
pub fn fui_file_writer_write_bytes(
requestId: u32,
writerIdPtr: usize,
writerIdLen: u32,
bytesPtr: usize,
bytesLen: u32,
);
pub fn fui_file_writer_finish(requestId: u32, writerIdPtr: usize, writerIdLen: u32);
pub fn fui_file_process_worker_start(
requestId: u32,
workerWasmPathPtr: usize,
workerWasmPathLen: u32,
workerEntryPtr: usize,
workerEntryLen: u32,
fileIdPtr: usize,
fileIdLen: u32,
suggestedNamePtr: usize,
suggestedNameLen: u32,
chunkBytes: u32,
saveToPickedFile: bool,
);
pub fn fui_file_process_worker_cancel(requestId: u32);
pub fn fui_canvas_save(canvasPtr: usize);
pub fn fui_canvas_restore(canvasPtr: usize);
pub fn fui_canvas_translate(canvasPtr: usize, x: f32, y: f32);
pub fn fui_canvas_scale(canvasPtr: usize, sx: f32, sy: f32);
pub fn fui_canvas_rotate(canvasPtr: usize, degrees: f32);
pub fn fui_canvas_clip_rect(canvasPtr: usize, x: f32, y: f32, w: f32, h: f32);
pub fn fui_canvas_clip_round_rect(
canvasPtr: usize,
x: f32,
y: f32,
w: f32,
h: f32,
topLeft: f32,
topRight: f32,
bottomRight: f32,
bottomLeft: f32,
);
pub fn fui_canvas_draw_rect(
canvasPtr: usize,
x: f32,
y: f32,
w: f32,
h: f32,
fillColor: u32,
strokeColor: u32,
strokeWidth: f32,
);
pub fn fui_canvas_draw_circle(
canvasPtr: usize,
cx: f32,
cy: f32,
radius: f32,
fillColor: u32,
strokeColor: u32,
strokeWidth: f32,
);
pub fn fui_canvas_draw_line(
canvasPtr: usize,
x1: f32,
y1: f32,
x2: f32,
y2: f32,
color: u32,
strokeWidth: f32,
);
pub fn fui_canvas_draw_round_rect(
canvasPtr: usize,
x: f32,
y: f32,
w: f32,
h: f32,
rx: f32,
ry: f32,
fillColor: u32,
strokeColor: u32,
strokeWidth: f32,
);
pub fn fui_path_create() -> u32;
pub fn fui_path_destroy(pathId: u32);
pub fn fui_path_move_to(pathId: u32, x: f32, y: f32);
pub fn fui_path_line_to(pathId: u32, x: f32, y: f32);
pub fn fui_path_quad_to(pathId: u32, cx: f32, cy: f32, x: f32, y: f32);
pub fn fui_path_cubic_to(pathId: u32, cx1: f32, cy1: f32, cx2: f32, cy2: f32, x: f32, y: f32);
pub fn fui_path_close(pathId: u32);
pub fn fui_path_add_rect(pathId: u32, x: f32, y: f32, w: f32, h: f32);
pub fn fui_path_add_circle(pathId: u32, cx: f32, cy: f32, r: f32);
pub fn fui_canvas_draw_path(
canvasPtr: usize,
pathId: u32,
fillColor: u32,
strokeColor: u32,
strokeWidth: f32,
);
pub fn fui_canvas_draw_text_node(
canvasPtr: usize,
handleLo: u32,
handleHi: u32,
x: f32,
y: f32,
);
pub fn fui_canvas_draw_image(
canvasPtr: usize,
textureId: u32,
x: f32,
y: f32,
w: f32,
h: f32,
samplingKind: u32,
maxAniso: u32,
);
pub fn fui_canvas_draw_svg(canvasPtr: usize, svgId: u32, x: f32, y: f32, w: f32, h: f32);
pub fn fui_canvas_draw_batch(canvasPtr: usize, wordsPtr: usize, wordCount: u32);
pub fn fui_canvas_create_offscreen(width: u32, height: u32) -> u32;
pub fn fui_canvas_get_offscreen_ptr(offscreenId: u32) -> usize;
pub fn fui_canvas_read_offscreen_pixels(
offscreenId: u32,
outPtr: usize,
width: u32,
height: u32,
);
pub fn fui_canvas_destroy_offscreen(offscreenId: u32);
}
#[cfg(any(target_arch = "wasm32", feature = "native-runtime"))]
#[cfg_attr(target_arch = "wasm32", link(wasm_import_module = "fui_fetch_host"))]
unsafe extern "C" {
pub fn fui_fetch_start(
requestId: u32,
methodPtr: usize,
methodLen: u32,
urlPtr: usize,
urlLen: u32,
headersPtr: usize,
headersLen: u32,
bodyPtr: usize,
bodyLen: u32,
);
pub fn fui_fetch_cancel(requestId: u32);
}