@effindomv2/fui-rs 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMMERCIAL.md +7 -0
- package/Cargo.toml +34 -0
- package/LICENSE.md +9 -0
- package/README.md +88 -0
- package/package.json +54 -0
- package/scripts/build.sh +227 -0
- package/scripts/check-runtime-dependency.sh +41 -0
- package/scripts/framework-host-services.ts +40 -0
- package/scripts/generate-host-events.ts +17 -0
- package/scripts/generate-host-services.ts +28 -0
- package/scripts/hostgen/common.ts +73 -0
- package/scripts/hostgen/registry.ts +159 -0
- package/scripts/hostgen/rust-host-events.ts +171 -0
- package/scripts/hostgen/rust-host-services.ts +257 -0
- package/src/animation.rs +625 -0
- package/src/app.rs +324 -0
- package/src/assets.rs +572 -0
- package/src/bindings/mod.rs +1 -0
- package/src/bindings/ui.rs +705 -0
- package/src/bitmap.rs +317 -0
- package/src/bridge_callbacks.rs +242 -0
- package/src/context_menu_manager.rs +332 -0
- package/src/controls/anti_selection_area.rs +54 -0
- package/src/controls/button.rs +542 -0
- package/src/controls/checkbox.rs +372 -0
- package/src/controls/combobox.rs +1574 -0
- package/src/controls/context_menu.rs +1367 -0
- package/src/controls/control_template_set.rs +46 -0
- package/src/controls/control_tokens.rs +596 -0
- package/src/controls/dialog.rs +590 -0
- package/src/controls/dropdown.rs +1010 -0
- package/src/controls/form.rs +229 -0
- package/src/controls/internal/button_presenter.rs +142 -0
- package/src/controls/internal/checkbox_indicator_presenter.rs +210 -0
- package/src/controls/internal/dropdown_chevron_presenter.rs +134 -0
- package/src/controls/internal/dropdown_field_presenter.rs +269 -0
- package/src/controls/internal/dropdown_option_row_presenter.rs +184 -0
- package/src/controls/internal/mod.rs +13 -0
- package/src/controls/internal/pressable_indicator_presenter.rs +26 -0
- package/src/controls/internal/pressable_labeled_control.rs +492 -0
- package/src/controls/internal/radio_indicator_presenter.rs +208 -0
- package/src/controls/internal/selectable_popup_list.rs +597 -0
- package/src/controls/internal/slider_presenter.rs +282 -0
- package/src/controls/internal/switch_indicator_presenter.rs +235 -0
- package/src/controls/internal/text_input_core.rs +1074 -0
- package/src/controls/internal/text_input_presenter.rs +108 -0
- package/src/controls/mod.rs +235 -0
- package/src/controls/nav_link.rs +395 -0
- package/src/controls/popup.rs +191 -0
- package/src/controls/progress_bar.rs +287 -0
- package/src/controls/radio_button.rs +348 -0
- package/src/controls/radio_group.rs +283 -0
- package/src/controls/selection_area.rs +82 -0
- package/src/controls/shared.rs +68 -0
- package/src/controls/slider.rs +701 -0
- package/src/controls/switch.rs +293 -0
- package/src/controls/templating.rs +49 -0
- package/src/controls/tests.rs +3905 -0
- package/src/controls/text_area.rs +207 -0
- package/src/controls/text_input.rs +192 -0
- package/src/debug.rs +146 -0
- package/src/drag_drop.rs +424 -0
- package/src/drag_gesture.rs +258 -0
- package/src/drawing.rs +385 -0
- package/src/event.rs +1603 -0
- package/src/external_drop.rs +467 -0
- package/src/fetch.rs +500 -0
- package/src/ffi.rs +3542 -0
- package/src/file.rs +1677 -0
- package/src/focus_adorner.rs +307 -0
- package/src/focus_visibility.rs +121 -0
- package/src/frame_scheduler.rs +159 -0
- package/src/frame_signal.rs +64 -0
- package/src/generated/ffi.rs +798 -0
- package/src/generated/framework_host_services.rs +74 -0
- package/src/generated/mod.rs +2 -0
- package/src/host_services.rs +162 -0
- package/src/image_sampling.rs +78 -0
- package/src/keyboard_scroll.rs +137 -0
- package/src/keyboard_scroll_tracker.rs +385 -0
- package/src/lib.rs +547 -0
- package/src/logger.rs +56 -0
- package/src/mobile_text_selection_toolbar.rs +1034 -0
- package/src/navigation.rs +48 -0
- package/src/node/core.rs +2210 -0
- package/src/node/custom_drawable.rs +149 -0
- package/src/node/flex_box.rs +874 -0
- package/src/node/grid.rs +304 -0
- package/src/node/helpers.rs +442 -0
- package/src/node/image.rs +506 -0
- package/src/node/mod.rs +315 -0
- package/src/node/scroll_bar.rs +845 -0
- package/src/node/scroll_box.rs +514 -0
- package/src/node/scroll_state.rs +121 -0
- package/src/node/scroll_view.rs +557 -0
- package/src/node/svg_node.rs +474 -0
- package/src/node/text_node.rs +633 -0
- package/src/node/virtual_list.rs +678 -0
- package/src/panic_hook.rs +36 -0
- package/src/persisted.rs +274 -0
- package/src/platform.rs +556 -0
- package/src/popup_presenter.rs +344 -0
- package/src/selection_handle_adorner.rs +838 -0
- package/src/signal.rs +134 -0
- package/src/text.rs +1065 -0
- package/src/theme.rs +571 -0
- package/src/timers.rs +106 -0
- package/src/tool_tip.rs +167 -0
- package/src/tool_tip_manager.rs +691 -0
- package/src/transitions.rs +41 -0
- package/src/typography.rs +520 -0
- package/src/viewport.rs +108 -0
- package/src/worker.rs +308 -0
- package/src/worker_job.rs +82 -0
- package/src/worker_runtime.rs +172 -0
|
@@ -0,0 +1,798 @@
|
|
|
1
|
+
// Generated by v2/abi/generate.ts strategy fui-rs-ffi.
|
|
2
|
+
// Raw ABI imports, ABI enums, and non-wasm test doubles for FUI-RS.
|
|
3
|
+
// Do not edit by hand.
|
|
4
|
+
|
|
5
|
+
#![allow(dead_code)]
|
|
6
|
+
#![allow(non_snake_case)]
|
|
7
|
+
#![allow(clippy::too_many_arguments)]
|
|
8
|
+
#![allow(clippy::missing_safety_doc)]
|
|
9
|
+
|
|
10
|
+
#[repr(u64)]
|
|
11
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
12
|
+
pub enum HandleValue {
|
|
13
|
+
Invalid = 0,
|
|
14
|
+
}
|
|
15
|
+
#[repr(u32)]
|
|
16
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
17
|
+
pub enum NodeType {
|
|
18
|
+
FlexBox = 0,
|
|
19
|
+
Text = 1,
|
|
20
|
+
Image = 2,
|
|
21
|
+
Svg = 3,
|
|
22
|
+
ScrollView = 4,
|
|
23
|
+
Grid = 5,
|
|
24
|
+
}
|
|
25
|
+
#[repr(u32)]
|
|
26
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
27
|
+
pub enum Unit {
|
|
28
|
+
Pixel = 0,
|
|
29
|
+
Auto = 1,
|
|
30
|
+
Percent = 2,
|
|
31
|
+
}
|
|
32
|
+
#[repr(u32)]
|
|
33
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
34
|
+
pub enum GridUnit {
|
|
35
|
+
Pixel = 0,
|
|
36
|
+
Auto = 1,
|
|
37
|
+
Star = 2,
|
|
38
|
+
}
|
|
39
|
+
#[repr(u32)]
|
|
40
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
41
|
+
pub enum PositionType {
|
|
42
|
+
Relative = 0,
|
|
43
|
+
Absolute = 1,
|
|
44
|
+
}
|
|
45
|
+
#[repr(u32)]
|
|
46
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
47
|
+
pub enum Visibility {
|
|
48
|
+
Normal = 0,
|
|
49
|
+
Hidden = 1,
|
|
50
|
+
Collapsed = 2,
|
|
51
|
+
}
|
|
52
|
+
#[repr(u32)]
|
|
53
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
54
|
+
pub enum FlexDirection {
|
|
55
|
+
Column = 0,
|
|
56
|
+
Row = 1,
|
|
57
|
+
}
|
|
58
|
+
#[repr(u32)]
|
|
59
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
60
|
+
pub enum FlexWrap {
|
|
61
|
+
NoWrap = 0,
|
|
62
|
+
Wrap = 1,
|
|
63
|
+
WrapReverse = 2,
|
|
64
|
+
}
|
|
65
|
+
#[repr(u32)]
|
|
66
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
67
|
+
pub enum JustifyContent {
|
|
68
|
+
Start = 0,
|
|
69
|
+
Center = 1,
|
|
70
|
+
End = 2,
|
|
71
|
+
}
|
|
72
|
+
#[repr(u32)]
|
|
73
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
74
|
+
pub enum AlignItems {
|
|
75
|
+
Start = 0,
|
|
76
|
+
Center = 1,
|
|
77
|
+
End = 2,
|
|
78
|
+
Stretch = 3,
|
|
79
|
+
None = 4,
|
|
80
|
+
}
|
|
81
|
+
#[repr(u32)]
|
|
82
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
83
|
+
pub enum AlignSelf {
|
|
84
|
+
Auto = 0,
|
|
85
|
+
Start = 1,
|
|
86
|
+
Center = 2,
|
|
87
|
+
End = 3,
|
|
88
|
+
Stretch = 4,
|
|
89
|
+
}
|
|
90
|
+
#[repr(u32)]
|
|
91
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
92
|
+
pub enum BorderStyle {
|
|
93
|
+
Solid = 0,
|
|
94
|
+
Dashed = 1,
|
|
95
|
+
Dotted = 2,
|
|
96
|
+
}
|
|
97
|
+
#[repr(u32)]
|
|
98
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
99
|
+
pub enum ObjectFit {
|
|
100
|
+
Fill = 0,
|
|
101
|
+
Contain = 1,
|
|
102
|
+
Cover = 2,
|
|
103
|
+
None = 3,
|
|
104
|
+
ScaleDown = 4,
|
|
105
|
+
}
|
|
106
|
+
#[repr(u32)]
|
|
107
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
108
|
+
pub enum ImageSamplingKind {
|
|
109
|
+
Linear = 0,
|
|
110
|
+
Nearest = 1,
|
|
111
|
+
LinearMipmapNearest = 2,
|
|
112
|
+
LinearMipmapLinear = 3,
|
|
113
|
+
CubicMitchell = 4,
|
|
114
|
+
CubicCatmullRom = 5,
|
|
115
|
+
Anisotropic = 6,
|
|
116
|
+
}
|
|
117
|
+
#[repr(u32)]
|
|
118
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
119
|
+
pub enum TextAlign {
|
|
120
|
+
Left = 0,
|
|
121
|
+
Center = 1,
|
|
122
|
+
Right = 2,
|
|
123
|
+
}
|
|
124
|
+
#[repr(u32)]
|
|
125
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
126
|
+
pub enum TextVerticalAlign {
|
|
127
|
+
Top = 0,
|
|
128
|
+
Center = 1,
|
|
129
|
+
Bottom = 2,
|
|
130
|
+
}
|
|
131
|
+
#[repr(u32)]
|
|
132
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
133
|
+
pub enum TextOverflow {
|
|
134
|
+
Clip = 0,
|
|
135
|
+
Ellipsis = 1,
|
|
136
|
+
Fade = 2,
|
|
137
|
+
}
|
|
138
|
+
#[repr(u32)]
|
|
139
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
140
|
+
pub enum Orientation {
|
|
141
|
+
None = 0,
|
|
142
|
+
Horizontal = 1,
|
|
143
|
+
Vertical = 2,
|
|
144
|
+
}
|
|
145
|
+
#[repr(u32)]
|
|
146
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
147
|
+
pub enum KeyEventType {
|
|
148
|
+
Down = 1,
|
|
149
|
+
Up = 2,
|
|
150
|
+
}
|
|
151
|
+
#[repr(u32)]
|
|
152
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
153
|
+
pub enum PointerEventType {
|
|
154
|
+
Down = 1,
|
|
155
|
+
Up = 2,
|
|
156
|
+
Move = 3,
|
|
157
|
+
Enter = 4,
|
|
158
|
+
Leave = 5,
|
|
159
|
+
Cancel = 6,
|
|
160
|
+
}
|
|
161
|
+
#[repr(u32)]
|
|
162
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
163
|
+
pub enum KeyModifier {
|
|
164
|
+
Shift = 1 << 0,
|
|
165
|
+
Ctrl = 1 << 1,
|
|
166
|
+
Alt = 1 << 2,
|
|
167
|
+
Meta = 1 << 3,
|
|
168
|
+
}
|
|
169
|
+
#[repr(u32)]
|
|
170
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
171
|
+
pub enum SemanticRole {
|
|
172
|
+
None = 0,
|
|
173
|
+
Button = 1,
|
|
174
|
+
Textbox = 2,
|
|
175
|
+
Link = 3,
|
|
176
|
+
Heading = 4,
|
|
177
|
+
Form = 5,
|
|
178
|
+
List = 6,
|
|
179
|
+
ListItem = 7,
|
|
180
|
+
Image = 8,
|
|
181
|
+
Dialog = 9,
|
|
182
|
+
StaticText = 10,
|
|
183
|
+
Checkbox = 11,
|
|
184
|
+
Radio = 12,
|
|
185
|
+
RadioGroup = 13,
|
|
186
|
+
Switch = 14,
|
|
187
|
+
Slider = 15,
|
|
188
|
+
ComboBox = 16,
|
|
189
|
+
}
|
|
190
|
+
#[repr(u32)]
|
|
191
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
192
|
+
pub enum CursorStyle {
|
|
193
|
+
Default = 0,
|
|
194
|
+
Pointer = 1,
|
|
195
|
+
Text = 2,
|
|
196
|
+
Move = 3,
|
|
197
|
+
Grab = 4,
|
|
198
|
+
Grabbing = 5,
|
|
199
|
+
ResizeNS = 6,
|
|
200
|
+
ResizeEW = 7,
|
|
201
|
+
}
|
|
202
|
+
#[repr(u32)]
|
|
203
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
204
|
+
pub enum SemanticCheckedState {
|
|
205
|
+
None = 0,
|
|
206
|
+
False = 1,
|
|
207
|
+
True = 2,
|
|
208
|
+
Mixed = 3,
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
#[cfg(any(target_arch = "wasm32", feature = "native-runtime"))]
|
|
212
|
+
#[cfg_attr(target_arch = "wasm32", link(wasm_import_module = "effindom_v2_ui"))]
|
|
213
|
+
unsafe extern "C" {
|
|
214
|
+
pub fn ui_get_abi_version() -> u32;
|
|
215
|
+
pub fn ui_arena_alloc(size: u32) -> usize;
|
|
216
|
+
pub fn ui_reset();
|
|
217
|
+
pub fn ui_create_node(type_: u32) -> u64;
|
|
218
|
+
pub fn ui_delete_node(handle: u64);
|
|
219
|
+
pub fn ui_set_node_id(handle: u64, utf8_id: *const u8, len: u32);
|
|
220
|
+
pub fn ui_set_semantic_role(handle: u64, role_enum: u32);
|
|
221
|
+
pub fn ui_set_semantic_label(handle: u64, utf8_label: *const u8, len: u32);
|
|
222
|
+
pub fn ui_set_semantic_checked(handle: u64, checked_state_enum: u32);
|
|
223
|
+
pub fn ui_set_semantic_selected(handle: u64, has_selected: bool, is_selected: bool);
|
|
224
|
+
pub fn ui_set_semantic_expanded(handle: u64, has_expanded: bool, is_expanded: bool);
|
|
225
|
+
pub fn ui_set_semantic_disabled(handle: u64, has_disabled: bool, is_disabled: bool);
|
|
226
|
+
pub fn ui_set_semantic_value_range(
|
|
227
|
+
handle: u64,
|
|
228
|
+
has_value_range: bool,
|
|
229
|
+
value_now: f32,
|
|
230
|
+
value_min: f32,
|
|
231
|
+
value_max: f32,
|
|
232
|
+
);
|
|
233
|
+
pub fn ui_set_semantic_orientation(handle: u64, orientation_enum: u32);
|
|
234
|
+
pub fn ui_request_semantic_announcement(handle: u64);
|
|
235
|
+
pub fn ui_push_semantic_scope(handle: u64) -> u32;
|
|
236
|
+
pub fn ui_remove_semantic_scope(token: u32);
|
|
237
|
+
pub fn ui_node_add_child(parent: u64, child: u64);
|
|
238
|
+
pub fn ui_node_remove_child(parent: u64, child: u64);
|
|
239
|
+
pub fn ui_set_is_portal(handle: u64, is_portal: bool);
|
|
240
|
+
pub fn ui_set_visibility(handle: u64, visibility_enum: u32);
|
|
241
|
+
pub fn ui_set_width(handle: u64, value: f32, unit_enum: u32);
|
|
242
|
+
pub fn ui_set_height(handle: u64, value: f32, unit_enum: u32);
|
|
243
|
+
pub fn ui_set_fill_width(handle: u64, fill: bool);
|
|
244
|
+
pub fn ui_set_fill_height(handle: u64, fill: bool);
|
|
245
|
+
pub fn ui_set_fill_width_percent(handle: u64, percent: f32);
|
|
246
|
+
pub fn ui_set_fill_height_percent(handle: u64, percent: f32);
|
|
247
|
+
pub fn ui_set_min_width(handle: u64, value: f32, unit_enum: u32);
|
|
248
|
+
pub fn ui_set_max_width(handle: u64, value: f32, unit_enum: u32);
|
|
249
|
+
pub fn ui_set_min_height(handle: u64, value: f32, unit_enum: u32);
|
|
250
|
+
pub fn ui_set_max_height(handle: u64, value: f32, unit_enum: u32);
|
|
251
|
+
pub fn ui_set_flex_direction(handle: u64, dir_enum: u32);
|
|
252
|
+
pub fn ui_set_flex_basis(handle: u64, basis: f32);
|
|
253
|
+
pub fn ui_set_justify_content(handle: u64, justify_enum: u32);
|
|
254
|
+
pub fn ui_set_align_items(handle: u64, align_enum: u32);
|
|
255
|
+
pub fn ui_set_align_self(handle: u64, align_enum: u32);
|
|
256
|
+
pub fn ui_set_padding(handle: u64, left: f32, top: f32, right: f32, bottom: f32);
|
|
257
|
+
pub fn ui_set_margin(handle: u64, left: f32, top: f32, right: f32, bottom: f32);
|
|
258
|
+
pub fn ui_set_position_type(handle: u64, pos_enum: u32);
|
|
259
|
+
pub fn ui_set_position(handle: u64, left: f32, top: f32, right: f32, bottom: f32);
|
|
260
|
+
pub fn ui_set_is_shared_size_scope(handle: u64, is_scope: bool);
|
|
261
|
+
pub fn ui_set_custom_drawable(handle: u64, is_custom_drawable: bool);
|
|
262
|
+
pub fn ui_set_flex_wrap(handle: u64, wrap_enum: u32);
|
|
263
|
+
pub fn ui_prepare_node(handle: u64) -> u32;
|
|
264
|
+
pub fn ui_set_dynamic_text_charset(handle: u64, utf8_charset: *const u8, len: u32);
|
|
265
|
+
pub fn ui_get_text_metrics(
|
|
266
|
+
handle: u64,
|
|
267
|
+
out_width: *mut f32,
|
|
268
|
+
out_height: *mut f32,
|
|
269
|
+
out_baseline: *mut f32,
|
|
270
|
+
out_line_count: *mut u32,
|
|
271
|
+
out_max_line_width: *mut f32,
|
|
272
|
+
) -> bool;
|
|
273
|
+
pub fn ui_grid_set_columns(handle: u64, count: u32, values: *const f32, types: *const u8);
|
|
274
|
+
pub fn ui_grid_set_rows(handle: u64, count: u32, values: *const f32, types: *const u8);
|
|
275
|
+
pub fn ui_grid_set_column_shared_size_group(
|
|
276
|
+
handle: u64,
|
|
277
|
+
index: u32,
|
|
278
|
+
utf8_group: *const u8,
|
|
279
|
+
len: u32,
|
|
280
|
+
);
|
|
281
|
+
pub fn ui_grid_set_row_shared_size_group(
|
|
282
|
+
handle: u64,
|
|
283
|
+
index: u32,
|
|
284
|
+
utf8_group: *const u8,
|
|
285
|
+
len: u32,
|
|
286
|
+
);
|
|
287
|
+
pub fn ui_node_set_grid_placement(child: u64, row: u32, col: u32, row_span: u32, col_span: u32);
|
|
288
|
+
pub fn ui_set_bg_color(handle: u64, color: u32);
|
|
289
|
+
pub fn ui_set_box_style(
|
|
290
|
+
handle: u64,
|
|
291
|
+
bg_color: u32,
|
|
292
|
+
radius_tl: f32,
|
|
293
|
+
radius_tr: f32,
|
|
294
|
+
radius_br: f32,
|
|
295
|
+
radius_bl: f32,
|
|
296
|
+
border_width: f32,
|
|
297
|
+
border_color: u32,
|
|
298
|
+
border_style_enum: u32,
|
|
299
|
+
border_dash_on: f32,
|
|
300
|
+
border_dash_off: f32,
|
|
301
|
+
);
|
|
302
|
+
pub fn ui_set_clip_to_bounds(handle: u64, clip: bool);
|
|
303
|
+
pub fn ui_set_linear_gradient(
|
|
304
|
+
handle: u64,
|
|
305
|
+
sx: f32,
|
|
306
|
+
sy: f32,
|
|
307
|
+
ex: f32,
|
|
308
|
+
ey: f32,
|
|
309
|
+
stop_count: u32,
|
|
310
|
+
offsets: *const f32,
|
|
311
|
+
colors: *const u32,
|
|
312
|
+
);
|
|
313
|
+
pub fn ui_set_drop_shadow(
|
|
314
|
+
handle: u64,
|
|
315
|
+
color: u32,
|
|
316
|
+
offset_x: f32,
|
|
317
|
+
offset_y: f32,
|
|
318
|
+
blur_sigma: f32,
|
|
319
|
+
spread: f32,
|
|
320
|
+
);
|
|
321
|
+
pub fn ui_set_layer_effect(handle: u64, opacity: f32, blur_sigma: f32, blend_mode_enum: u32);
|
|
322
|
+
pub fn ui_set_background_blur(handle: u64, blur_sigma: f32);
|
|
323
|
+
pub fn ui_set_image(
|
|
324
|
+
handle: u64,
|
|
325
|
+
texture_id: u32,
|
|
326
|
+
object_fit_enum: u32,
|
|
327
|
+
sampling_kind: u32,
|
|
328
|
+
max_aniso: u32,
|
|
329
|
+
);
|
|
330
|
+
pub fn ui_set_image_nine(
|
|
331
|
+
handle: u64,
|
|
332
|
+
texture_id: u32,
|
|
333
|
+
inset_l: f32,
|
|
334
|
+
inset_t: f32,
|
|
335
|
+
inset_r: f32,
|
|
336
|
+
inset_b: f32,
|
|
337
|
+
sampling_kind: u32,
|
|
338
|
+
max_aniso: u32,
|
|
339
|
+
);
|
|
340
|
+
pub fn ui_set_svg(
|
|
341
|
+
handle: u64,
|
|
342
|
+
svg_id: u32,
|
|
343
|
+
tint_color: u32,
|
|
344
|
+
sampling_kind: u32,
|
|
345
|
+
max_aniso: u32,
|
|
346
|
+
);
|
|
347
|
+
pub fn ui_set_text(handle: u64, utf8_str: *const u8, len: u32);
|
|
348
|
+
pub fn ui_set_text_style_runs(handle: u64, run_count: u32, runs_words: *const u32);
|
|
349
|
+
pub fn ui_set_font(handle: u64, font_id: u32, size: f32);
|
|
350
|
+
pub fn ui_set_line_height(handle: u64, line_height: f32);
|
|
351
|
+
pub fn ui_set_text_color(handle: u64, color: u32);
|
|
352
|
+
pub fn ui_set_text_align(handle: u64, align_enum: u32);
|
|
353
|
+
pub fn ui_set_text_vertical_align(handle: u64, align_enum: u32);
|
|
354
|
+
pub fn ui_set_text_limits(handle: u64, max_chars: i32, max_lines: i32);
|
|
355
|
+
pub fn ui_set_text_wrapping(handle: u64, wrap: bool);
|
|
356
|
+
pub fn ui_set_text_overflow(handle: u64, overflow_enum: u32);
|
|
357
|
+
pub fn ui_set_text_overflow_fade(handle: u64, horizontal: bool, vertical: bool);
|
|
358
|
+
pub fn ui_set_text_obscured(handle: u64, is_password: bool);
|
|
359
|
+
pub fn ui_measure_text(
|
|
360
|
+
utf8_str: *const u8,
|
|
361
|
+
len: u32,
|
|
362
|
+
font_id: u32,
|
|
363
|
+
size: f32,
|
|
364
|
+
max_width: f32,
|
|
365
|
+
out_width: *mut f32,
|
|
366
|
+
out_height: *mut f32,
|
|
367
|
+
);
|
|
368
|
+
pub fn ui_set_interactive(handle: u64, interactive: bool);
|
|
369
|
+
pub fn ui_set_preserve_selection_on_pointer_down(handle: u64, preserve: bool);
|
|
370
|
+
pub fn ui_set_editor_command_keys(handle: u64, enabled: bool);
|
|
371
|
+
pub fn ui_set_editor_accepts_tab(handle: u64, enabled: bool);
|
|
372
|
+
pub fn ui_set_scroll_proxy_target(handle: u64, scroll_handle: u64);
|
|
373
|
+
pub fn ui_set_scroll_enabled(handle: u64, enabled_x: bool, enabled_y: bool);
|
|
374
|
+
pub fn ui_set_scroll_friction(handle: u64, friction: f32);
|
|
375
|
+
pub fn ui_set_smooth_scrolling(handle: u64, smooth_scrolling: bool);
|
|
376
|
+
pub fn ui_set_focusable(handle: u64, focusable: bool, tab_index: i32);
|
|
377
|
+
pub fn ui_request_focus(handle: u64);
|
|
378
|
+
pub fn ui_set_scroll_offset(handle: u64, offset_x: f32, offset_y: f32);
|
|
379
|
+
pub fn ui_set_scroll_content_size(handle: u64, content_width: f32, content_height: f32);
|
|
380
|
+
pub fn ui_set_selectable(handle: u64, selectable: bool, selection_color: u32);
|
|
381
|
+
pub fn ui_set_selection_area(handle: u64, is_area: bool);
|
|
382
|
+
pub fn ui_set_selection_area_barrier(handle: u64, is_barrier: bool);
|
|
383
|
+
pub fn ui_clear_selection(text_node_handle: u64);
|
|
384
|
+
pub fn ui_retarget_selection(from_text_node_handle: u64, to_text_node_handle: u64);
|
|
385
|
+
pub fn ui_is_point_in_selection(logical_x: f32, logical_y: f32) -> bool;
|
|
386
|
+
pub fn ui_set_text_selection_range(handle: u64, selection_start: u32, selection_end: u32);
|
|
387
|
+
pub fn ui_select_word_at(handle: u64, logical_x: f32, logical_y: f32) -> bool;
|
|
388
|
+
pub fn ui_get_text_snapshot_handle_count() -> u32;
|
|
389
|
+
pub fn ui_copy_text_snapshot_handles(out_handle_words: *mut u32, max_handle_count: u32) -> u32;
|
|
390
|
+
pub fn ui_set_text_find_match(handle: u64, start: u32, end: u32) -> bool;
|
|
391
|
+
pub fn ui_clear_text_find_match();
|
|
392
|
+
pub fn ui_push_text_find_highlight(handle: u64, start: u32, end: u32, color: u32) -> bool;
|
|
393
|
+
pub fn ui_clear_text_find_highlights();
|
|
394
|
+
pub fn ui_get_text_document_utf8_length(handle: u64) -> u32;
|
|
395
|
+
pub fn ui_copy_text_document_utf8(handle: u64, out_utf8: *mut u8, buffer_length: u32) -> bool;
|
|
396
|
+
pub fn ui_get_text_visible_bounds(
|
|
397
|
+
handle: u64,
|
|
398
|
+
out_x: *mut f32,
|
|
399
|
+
out_y: *mut f32,
|
|
400
|
+
out_width: *mut f32,
|
|
401
|
+
out_height: *mut f32,
|
|
402
|
+
) -> bool;
|
|
403
|
+
pub fn ui_get_text_range_rect_count(handle: u64, start: u32, end: u32) -> u32;
|
|
404
|
+
pub fn ui_copy_text_range_rects(
|
|
405
|
+
handle: u64,
|
|
406
|
+
start: u32,
|
|
407
|
+
end: u32,
|
|
408
|
+
out_rect_words: *mut f32,
|
|
409
|
+
max_rect_count: u32,
|
|
410
|
+
) -> u32;
|
|
411
|
+
pub fn ui_copy_cross_selection_endpoint_rects(
|
|
412
|
+
area_handle: u64,
|
|
413
|
+
out_rect_words: *mut f32,
|
|
414
|
+
) -> bool;
|
|
415
|
+
pub fn ui_begin_selection_endpoint_drag(handle: u64, endpoint: u32) -> bool;
|
|
416
|
+
pub fn ui_preserves_selection_on_pointer_down(handle: u64) -> bool;
|
|
417
|
+
pub fn ui_reveal_text_range(handle: u64, start: u32, end: u32) -> bool;
|
|
418
|
+
pub fn ui_clear_current_selection();
|
|
419
|
+
pub fn ui_copy_current_selection();
|
|
420
|
+
pub fn ui_can_undo_text_edit(handle: u64) -> bool;
|
|
421
|
+
pub fn ui_can_redo_text_edit(handle: u64) -> bool;
|
|
422
|
+
pub fn ui_has_text_selection(handle: u64) -> bool;
|
|
423
|
+
pub fn ui_undo_text_edit(handle: u64);
|
|
424
|
+
pub fn ui_redo_text_edit(handle: u64);
|
|
425
|
+
pub fn ui_copy_text_selection(handle: u64);
|
|
426
|
+
pub fn ui_cut_text_selection(handle: u64);
|
|
427
|
+
pub fn ui_paste_text(handle: u64);
|
|
428
|
+
pub fn ui_select_all_text(handle: u64);
|
|
429
|
+
pub fn ui_set_editable(handle: u64, editable: bool);
|
|
430
|
+
pub fn ui_set_caret_color(handle: u64, color: u32);
|
|
431
|
+
pub fn ui_commit_frame();
|
|
432
|
+
pub fn ui_has_pending_visual_work() -> bool;
|
|
433
|
+
pub fn ui_needs_animation_frame() -> bool;
|
|
434
|
+
pub fn ui_has_pointer_autoscroll() -> bool;
|
|
435
|
+
pub fn ui_selection_autoscroll(logical_x: f32, logical_y: f32, edge_threshold: f32) -> u64;
|
|
436
|
+
pub fn ui_on_pointer_event(
|
|
437
|
+
event_enum: u32,
|
|
438
|
+
handle: u64,
|
|
439
|
+
logical_x: f32,
|
|
440
|
+
logical_y: f32,
|
|
441
|
+
pointer_id: i32,
|
|
442
|
+
pointer_type: u32,
|
|
443
|
+
button: i32,
|
|
444
|
+
buttons: u32,
|
|
445
|
+
pressure: f32,
|
|
446
|
+
width: f32,
|
|
447
|
+
height: f32,
|
|
448
|
+
click_count: i32,
|
|
449
|
+
modifiers: u32,
|
|
450
|
+
);
|
|
451
|
+
pub fn ui_on_wheel_event(delta_x: f32, delta_y: f32);
|
|
452
|
+
pub fn ui_touch_scroll_begin(handle: u64, logical_x: f32, logical_y: f32, timestamp_ms: f64);
|
|
453
|
+
pub fn ui_touch_scroll_update(delta_x: f32, delta_y: f32, timestamp_ms: f64);
|
|
454
|
+
pub fn ui_wheel_scroll_can_consume(delta_x: f32, delta_y: f32) -> bool;
|
|
455
|
+
pub fn ui_touch_scroll_can_consume(delta_x: f32, delta_y: f32) -> bool;
|
|
456
|
+
pub fn ui_touch_scroll_end(timestamp_ms: f64);
|
|
457
|
+
pub fn ui_clear_momentum_scroll();
|
|
458
|
+
pub fn ui_touch_scroll_allows_pull_to_refresh() -> bool;
|
|
459
|
+
pub fn ui_set_coarse_pointer_mode(coarse_pointer_mode: bool);
|
|
460
|
+
pub fn ui_set_platform_family(platform_family: u32);
|
|
461
|
+
pub fn ui_on_key_event(type_enum: u32, key_utf8: *const u8, len: u32, modifiers: u32) -> bool;
|
|
462
|
+
pub fn ui_set_interaction_time(interaction_time_ms: u64);
|
|
463
|
+
pub fn ui_on_ime_update(handle: u64, utf8_str: *const u8, len: u32, caret_idx: u32);
|
|
464
|
+
pub fn ui_replace_text_range(
|
|
465
|
+
handle: u64,
|
|
466
|
+
start_idx: u32,
|
|
467
|
+
end_idx: u32,
|
|
468
|
+
utf8_str: *const u8,
|
|
469
|
+
len: u32,
|
|
470
|
+
caret_idx: u32,
|
|
471
|
+
);
|
|
472
|
+
pub fn ui_on_paste_text(handle: u64, utf8_str: *const u8, len: u32);
|
|
473
|
+
pub fn ui_font_loaded(font_id: u32);
|
|
474
|
+
pub fn ui_register_icu_data(bytes: *const u8, len: u32);
|
|
475
|
+
pub fn ui_register_font_fallback(font_id: u32, fallback_font_id: u32);
|
|
476
|
+
pub fn ui_unregister_font_fallback(font_id: u32, fallback_font_id: u32) -> bool;
|
|
477
|
+
pub fn ui_unregister_font(font_id: u32) -> bool;
|
|
478
|
+
pub fn ui_set_root(handle: u64);
|
|
479
|
+
pub fn ui_resize_window(logical_w: f32, logical_h: f32);
|
|
480
|
+
pub fn ui_register_font(font_id: u32, bytes: *const u8, len: u32) -> bool;
|
|
481
|
+
pub fn ui_get_command_buffer(out_length: *mut u32) -> *mut u32;
|
|
482
|
+
pub fn ui_get_semantic_buffer(out_length: *mut u32) -> *mut u32;
|
|
483
|
+
pub fn ui_get_debug_tree_buffer(out_length: *mut u32) -> *mut u32;
|
|
484
|
+
pub fn ui_get_live_fallback_font_buffer(out_length: *mut u32) -> *mut u32;
|
|
485
|
+
pub fn ui_get_bounds(
|
|
486
|
+
handle: u64,
|
|
487
|
+
out_x: *mut f32,
|
|
488
|
+
out_y: *mut f32,
|
|
489
|
+
out_width: *mut f32,
|
|
490
|
+
out_height: *mut f32,
|
|
491
|
+
) -> bool;
|
|
492
|
+
pub fn ui_get_visible_bounds(
|
|
493
|
+
handle: u64,
|
|
494
|
+
out_x: *mut f32,
|
|
495
|
+
out_y: *mut f32,
|
|
496
|
+
out_width: *mut f32,
|
|
497
|
+
out_height: *mut f32,
|
|
498
|
+
) -> bool;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
#[cfg(any(target_arch = "wasm32", feature = "native-runtime"))]
|
|
502
|
+
#[cfg_attr(target_arch = "wasm32", link(wasm_import_module = "fui_host"))]
|
|
503
|
+
unsafe extern "C" {
|
|
504
|
+
pub fn request_render();
|
|
505
|
+
pub fn get_viewport_width() -> f32;
|
|
506
|
+
pub fn get_viewport_height() -> f32;
|
|
507
|
+
pub fn get_device_pixel_ratio() -> f32;
|
|
508
|
+
pub fn fui_set_pointer_capture(handle: u64);
|
|
509
|
+
pub fn fui_release_pointer_capture();
|
|
510
|
+
pub fn fui_reload_page();
|
|
511
|
+
pub fn fui_can_navigate_back() -> bool;
|
|
512
|
+
pub fn fui_can_navigate_forward() -> bool;
|
|
513
|
+
pub fn fui_navigate_back();
|
|
514
|
+
pub fn fui_navigate_forward();
|
|
515
|
+
pub fn fui_copy_text(ptr: usize, len: u32);
|
|
516
|
+
pub fn fui_register_text_input_metadata(
|
|
517
|
+
handle: u64,
|
|
518
|
+
isPassword: bool,
|
|
519
|
+
hintPtr: usize,
|
|
520
|
+
hintLen: u32,
|
|
521
|
+
);
|
|
522
|
+
pub fn fui_has_text_selection_snapshot(handle: u64) -> bool;
|
|
523
|
+
pub fn fui_freeze_text_selection_snapshot(handle: u64);
|
|
524
|
+
pub fn fui_copy_text_selection_snapshot(handle: u64) -> bool;
|
|
525
|
+
pub fn fui_cut_focused_text_selection() -> bool;
|
|
526
|
+
pub fn fui_cut_text_selection_snapshot(handle: u64) -> bool;
|
|
527
|
+
pub fn fui_cut_text_range_snapshot(handle: u64, start: u32, end: u32) -> bool;
|
|
528
|
+
pub fn fui_delete_focused_text_range(start: u32, end: u32) -> bool;
|
|
529
|
+
pub fn fui_commit_text_action_focus(handle: u64);
|
|
530
|
+
pub fn fui_load_svg(svgId: u32, ptr: usize, len: u32);
|
|
531
|
+
pub fn fui_load_texture(textureId: u32, ptr: usize, len: u32);
|
|
532
|
+
pub fn fui_release_svg(svgId: u32);
|
|
533
|
+
pub fn fui_release_texture(textureId: u32);
|
|
534
|
+
pub fn fui_bitmap_commit(
|
|
535
|
+
textureId: u32,
|
|
536
|
+
bytesPtr: usize,
|
|
537
|
+
bytesLen: u32,
|
|
538
|
+
width: u32,
|
|
539
|
+
height: u32,
|
|
540
|
+
);
|
|
541
|
+
pub fn fui_bitmap_commit_dirty(
|
|
542
|
+
textureId: u32,
|
|
543
|
+
bytesPtr: usize,
|
|
544
|
+
bytesLen: u32,
|
|
545
|
+
fullW: u32,
|
|
546
|
+
fullH: u32,
|
|
547
|
+
subX: u32,
|
|
548
|
+
subY: u32,
|
|
549
|
+
subW: u32,
|
|
550
|
+
subH: u32,
|
|
551
|
+
);
|
|
552
|
+
pub fn fui_bitmap_release(textureId: u32);
|
|
553
|
+
pub fn fui_render_node_to_rgba(
|
|
554
|
+
handle: u64,
|
|
555
|
+
width: u32,
|
|
556
|
+
height: u32,
|
|
557
|
+
outPtr: usize,
|
|
558
|
+
outCapacity: u32,
|
|
559
|
+
scale: f32,
|
|
560
|
+
x: f32,
|
|
561
|
+
y: f32,
|
|
562
|
+
) -> u32;
|
|
563
|
+
pub fn fui_load_font(fontId: u32, ptr: usize, len: u32);
|
|
564
|
+
pub fn fui_start_timer(timerId: u32, delayMs: i32);
|
|
565
|
+
pub fn fui_cancel_timer(timerId: u32);
|
|
566
|
+
pub fn fui_set_cursor(style: u32);
|
|
567
|
+
pub fn fui_is_dark_mode() -> bool;
|
|
568
|
+
pub fn fui_get_accent_color() -> u32;
|
|
569
|
+
pub fn fui_get_platform_family() -> u32;
|
|
570
|
+
pub fn fui_is_coarse_pointer() -> bool;
|
|
571
|
+
pub fn fui_show_url_preview(ptr: usize, len: u32);
|
|
572
|
+
pub fn fui_hide_url_preview();
|
|
573
|
+
pub fn fui_navigate_to(ptr: usize, len: u32, openInNewTab: bool);
|
|
574
|
+
pub fn fui_set_persisted_scroll_offset(nodeIdPtr: usize, nodeIdLen: u32, x: f32, y: f32);
|
|
575
|
+
pub fn fui_try_get_persisted_scroll_offset(
|
|
576
|
+
nodeIdPtr: usize,
|
|
577
|
+
nodeIdLen: u32,
|
|
578
|
+
outX: usize,
|
|
579
|
+
outY: usize,
|
|
580
|
+
) -> bool;
|
|
581
|
+
pub fn fui_set_persisted_state(
|
|
582
|
+
nodeIdPtr: usize,
|
|
583
|
+
nodeIdLen: u32,
|
|
584
|
+
kindPtr: usize,
|
|
585
|
+
kindLen: u32,
|
|
586
|
+
version: u32,
|
|
587
|
+
payloadPtr: usize,
|
|
588
|
+
payloadLen: u32,
|
|
589
|
+
);
|
|
590
|
+
pub fn fui_copy_persisted_state(
|
|
591
|
+
nodeIdPtr: usize,
|
|
592
|
+
nodeIdLen: u32,
|
|
593
|
+
kindPtr: usize,
|
|
594
|
+
kindLen: u32,
|
|
595
|
+
outVersionPtr: usize,
|
|
596
|
+
payloadPtr: usize,
|
|
597
|
+
payloadCapacity: u32,
|
|
598
|
+
) -> i32;
|
|
599
|
+
pub fn fui_log(categoryPtr: usize, catLen: u32, msgPtr: usize, msgLen: u32);
|
|
600
|
+
pub fn fui_logs_enabled() -> bool;
|
|
601
|
+
pub fn fui_worker_start_string(
|
|
602
|
+
workerId: u32,
|
|
603
|
+
wasmPathPtr: usize,
|
|
604
|
+
wasmPathLen: u32,
|
|
605
|
+
entryPtr: usize,
|
|
606
|
+
entryLen: u32,
|
|
607
|
+
inputPtr: usize,
|
|
608
|
+
inputLen: u32,
|
|
609
|
+
);
|
|
610
|
+
pub fn fui_worker_cancel(workerId: u32);
|
|
611
|
+
pub fn fui_file_capabilities() -> u32;
|
|
612
|
+
pub fn fui_file_pick(requestId: u32, acceptPtr: usize, acceptLen: u32, multiple: bool);
|
|
613
|
+
pub fn fui_file_read_chunk(
|
|
614
|
+
requestId: u32,
|
|
615
|
+
fileIdPtr: usize,
|
|
616
|
+
fileIdLen: u32,
|
|
617
|
+
offsetBytes: u64,
|
|
618
|
+
maxBytes: u32,
|
|
619
|
+
);
|
|
620
|
+
pub fn fui_file_save_text(
|
|
621
|
+
requestId: u32,
|
|
622
|
+
suggestedNamePtr: usize,
|
|
623
|
+
suggestedNameLen: u32,
|
|
624
|
+
mimeTypePtr: usize,
|
|
625
|
+
mimeTypeLen: u32,
|
|
626
|
+
fileExtensionPtr: usize,
|
|
627
|
+
fileExtensionLen: u32,
|
|
628
|
+
textPtr: usize,
|
|
629
|
+
textLen: u32,
|
|
630
|
+
);
|
|
631
|
+
pub fn fui_file_save_bytes(
|
|
632
|
+
requestId: u32,
|
|
633
|
+
suggestedNamePtr: usize,
|
|
634
|
+
suggestedNameLen: u32,
|
|
635
|
+
mimeTypePtr: usize,
|
|
636
|
+
mimeTypeLen: u32,
|
|
637
|
+
fileExtensionPtr: usize,
|
|
638
|
+
fileExtensionLen: u32,
|
|
639
|
+
bytesPtr: usize,
|
|
640
|
+
bytesLen: u32,
|
|
641
|
+
);
|
|
642
|
+
pub fn fui_file_create_writer(
|
|
643
|
+
requestId: u32,
|
|
644
|
+
suggestedNamePtr: usize,
|
|
645
|
+
suggestedNameLen: u32,
|
|
646
|
+
mimeTypePtr: usize,
|
|
647
|
+
mimeTypeLen: u32,
|
|
648
|
+
fileExtensionPtr: usize,
|
|
649
|
+
fileExtensionLen: u32,
|
|
650
|
+
);
|
|
651
|
+
pub fn fui_file_writer_write_text(
|
|
652
|
+
requestId: u32,
|
|
653
|
+
writerIdPtr: usize,
|
|
654
|
+
writerIdLen: u32,
|
|
655
|
+
textPtr: usize,
|
|
656
|
+
textLen: u32,
|
|
657
|
+
);
|
|
658
|
+
pub fn fui_file_writer_write_bytes(
|
|
659
|
+
requestId: u32,
|
|
660
|
+
writerIdPtr: usize,
|
|
661
|
+
writerIdLen: u32,
|
|
662
|
+
bytesPtr: usize,
|
|
663
|
+
bytesLen: u32,
|
|
664
|
+
);
|
|
665
|
+
pub fn fui_file_writer_finish(requestId: u32, writerIdPtr: usize, writerIdLen: u32);
|
|
666
|
+
pub fn fui_file_process_worker_start(
|
|
667
|
+
requestId: u32,
|
|
668
|
+
workerWasmPathPtr: usize,
|
|
669
|
+
workerWasmPathLen: u32,
|
|
670
|
+
workerEntryPtr: usize,
|
|
671
|
+
workerEntryLen: u32,
|
|
672
|
+
fileIdPtr: usize,
|
|
673
|
+
fileIdLen: u32,
|
|
674
|
+
suggestedNamePtr: usize,
|
|
675
|
+
suggestedNameLen: u32,
|
|
676
|
+
chunkBytes: u32,
|
|
677
|
+
saveToPickedFile: bool,
|
|
678
|
+
);
|
|
679
|
+
pub fn fui_file_process_worker_cancel(requestId: u32);
|
|
680
|
+
pub fn fui_canvas_save(canvasPtr: usize);
|
|
681
|
+
pub fn fui_canvas_restore(canvasPtr: usize);
|
|
682
|
+
pub fn fui_canvas_translate(canvasPtr: usize, x: f32, y: f32);
|
|
683
|
+
pub fn fui_canvas_scale(canvasPtr: usize, sx: f32, sy: f32);
|
|
684
|
+
pub fn fui_canvas_rotate(canvasPtr: usize, degrees: f32);
|
|
685
|
+
pub fn fui_canvas_clip_rect(canvasPtr: usize, x: f32, y: f32, w: f32, h: f32);
|
|
686
|
+
pub fn fui_canvas_clip_round_rect(
|
|
687
|
+
canvasPtr: usize,
|
|
688
|
+
x: f32,
|
|
689
|
+
y: f32,
|
|
690
|
+
w: f32,
|
|
691
|
+
h: f32,
|
|
692
|
+
topLeft: f32,
|
|
693
|
+
topRight: f32,
|
|
694
|
+
bottomRight: f32,
|
|
695
|
+
bottomLeft: f32,
|
|
696
|
+
);
|
|
697
|
+
pub fn fui_canvas_draw_rect(
|
|
698
|
+
canvasPtr: usize,
|
|
699
|
+
x: f32,
|
|
700
|
+
y: f32,
|
|
701
|
+
w: f32,
|
|
702
|
+
h: f32,
|
|
703
|
+
fillColor: u32,
|
|
704
|
+
strokeColor: u32,
|
|
705
|
+
strokeWidth: f32,
|
|
706
|
+
);
|
|
707
|
+
pub fn fui_canvas_draw_circle(
|
|
708
|
+
canvasPtr: usize,
|
|
709
|
+
cx: f32,
|
|
710
|
+
cy: f32,
|
|
711
|
+
radius: f32,
|
|
712
|
+
fillColor: u32,
|
|
713
|
+
strokeColor: u32,
|
|
714
|
+
strokeWidth: f32,
|
|
715
|
+
);
|
|
716
|
+
pub fn fui_canvas_draw_line(
|
|
717
|
+
canvasPtr: usize,
|
|
718
|
+
x1: f32,
|
|
719
|
+
y1: f32,
|
|
720
|
+
x2: f32,
|
|
721
|
+
y2: f32,
|
|
722
|
+
color: u32,
|
|
723
|
+
strokeWidth: f32,
|
|
724
|
+
);
|
|
725
|
+
pub fn fui_canvas_draw_round_rect(
|
|
726
|
+
canvasPtr: usize,
|
|
727
|
+
x: f32,
|
|
728
|
+
y: f32,
|
|
729
|
+
w: f32,
|
|
730
|
+
h: f32,
|
|
731
|
+
rx: f32,
|
|
732
|
+
ry: f32,
|
|
733
|
+
fillColor: u32,
|
|
734
|
+
strokeColor: u32,
|
|
735
|
+
strokeWidth: f32,
|
|
736
|
+
);
|
|
737
|
+
pub fn fui_path_create() -> u32;
|
|
738
|
+
pub fn fui_path_destroy(pathId: u32);
|
|
739
|
+
pub fn fui_path_move_to(pathId: u32, x: f32, y: f32);
|
|
740
|
+
pub fn fui_path_line_to(pathId: u32, x: f32, y: f32);
|
|
741
|
+
pub fn fui_path_quad_to(pathId: u32, cx: f32, cy: f32, x: f32, y: f32);
|
|
742
|
+
pub fn fui_path_cubic_to(pathId: u32, cx1: f32, cy1: f32, cx2: f32, cy2: f32, x: f32, y: f32);
|
|
743
|
+
pub fn fui_path_close(pathId: u32);
|
|
744
|
+
pub fn fui_path_add_rect(pathId: u32, x: f32, y: f32, w: f32, h: f32);
|
|
745
|
+
pub fn fui_path_add_circle(pathId: u32, cx: f32, cy: f32, r: f32);
|
|
746
|
+
pub fn fui_canvas_draw_path(
|
|
747
|
+
canvasPtr: usize,
|
|
748
|
+
pathId: u32,
|
|
749
|
+
fillColor: u32,
|
|
750
|
+
strokeColor: u32,
|
|
751
|
+
strokeWidth: f32,
|
|
752
|
+
);
|
|
753
|
+
pub fn fui_canvas_draw_text_node(
|
|
754
|
+
canvasPtr: usize,
|
|
755
|
+
handleLo: u32,
|
|
756
|
+
handleHi: u32,
|
|
757
|
+
x: f32,
|
|
758
|
+
y: f32,
|
|
759
|
+
);
|
|
760
|
+
pub fn fui_canvas_draw_image(
|
|
761
|
+
canvasPtr: usize,
|
|
762
|
+
textureId: u32,
|
|
763
|
+
x: f32,
|
|
764
|
+
y: f32,
|
|
765
|
+
w: f32,
|
|
766
|
+
h: f32,
|
|
767
|
+
samplingKind: u32,
|
|
768
|
+
maxAniso: u32,
|
|
769
|
+
);
|
|
770
|
+
pub fn fui_canvas_draw_svg(canvasPtr: usize, svgId: u32, x: f32, y: f32, w: f32, h: f32);
|
|
771
|
+
pub fn fui_canvas_draw_batch(canvasPtr: usize, wordsPtr: usize, wordCount: u32);
|
|
772
|
+
pub fn fui_canvas_create_offscreen(width: u32, height: u32) -> u32;
|
|
773
|
+
pub fn fui_canvas_get_offscreen_ptr(offscreenId: u32) -> usize;
|
|
774
|
+
pub fn fui_canvas_read_offscreen_pixels(
|
|
775
|
+
offscreenId: u32,
|
|
776
|
+
outPtr: usize,
|
|
777
|
+
width: u32,
|
|
778
|
+
height: u32,
|
|
779
|
+
);
|
|
780
|
+
pub fn fui_canvas_destroy_offscreen(offscreenId: u32);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
#[cfg(any(target_arch = "wasm32", feature = "native-runtime"))]
|
|
784
|
+
#[cfg_attr(target_arch = "wasm32", link(wasm_import_module = "fui_fetch_host"))]
|
|
785
|
+
unsafe extern "C" {
|
|
786
|
+
pub fn fui_fetch_start(
|
|
787
|
+
requestId: u32,
|
|
788
|
+
methodPtr: usize,
|
|
789
|
+
methodLen: u32,
|
|
790
|
+
urlPtr: usize,
|
|
791
|
+
urlLen: u32,
|
|
792
|
+
headersPtr: usize,
|
|
793
|
+
headersLen: u32,
|
|
794
|
+
bodyPtr: usize,
|
|
795
|
+
bodyLen: u32,
|
|
796
|
+
);
|
|
797
|
+
pub fn fui_fetch_cancel(requestId: u32);
|
|
798
|
+
}
|