Add a new host function
This commit is contained in:
parent
d79db4acb3
commit
4592f12349
2 changed files with 7 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "mosaic-tile"
|
||||
version = "0.2.2"
|
||||
version = "0.3.0"
|
||||
authors = ["Brooks J Rady <b.j.rady@gmail.com>"]
|
||||
edition = "2018"
|
||||
description = "A small client-side library for writing mosaic plugins (tiles)"
|
||||
|
|
|
|||
|
|
@ -34,7 +34,13 @@ pub fn open_file(path: &Path) {
|
|||
unsafe { host_open_file() };
|
||||
}
|
||||
|
||||
pub fn set_selectable(selectable: bool) {
|
||||
let selectable = if selectable { 1 } else { 0 };
|
||||
unsafe { host_set_selectable(selectable) };
|
||||
}
|
||||
|
||||
#[link(wasm_import_module = "mosaic")]
|
||||
extern "C" {
|
||||
fn host_open_file();
|
||||
fn host_set_selectable(selectable: i32);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue