(filter_ptr: *const u8, title_ptr: *const u8)
| 2308 | // E5b: Native file dialogs (via rfd crate) |
| 2309 | #[no_mangle] |
| 2310 | pub extern "C" fn bloom_open_file_dialog(filter_ptr: *const u8, title_ptr: *const u8) -> *const u8 { |
| 2311 | let filter = str_from_header(filter_ptr); |
| 2312 | let title = str_from_header(title_ptr); |
| 2313 | let mut dialog = rfd::FileDialog::new().set_title(title); |
| 2314 | if !filter.is_empty() { |
| 2315 | dialog = dialog.add_filter("Files", &[filter]); |
| 2316 | } |
| 2317 | match dialog.pick_file() { |
| 2318 | Some(path) => alloc_perry_string(&path.to_string_lossy()), |
| 2319 | None => alloc_perry_string(""), |
| 2320 | } |
| 2321 | } |
| 2322 | |
| 2323 | #[no_mangle] |
| 2324 | pub extern "C" fn bloom_save_file_dialog(default_name_ptr: *const u8, title_ptr: *const u8) -> *const u8 { |
nothing calls this directly
no test coverage detected