1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
#[allow(unused_imports)] use crate::*; extern "C" { fn htmlcanvaselement_get_width(instance: i32) -> i32; fn htmlcanvaselement_set_width(instance: i32, value: i32); } pub fn get_width(instance: i32) -> i32 { unsafe { htmlcanvaselement_get_width(instance) } } pub fn set_width(instance: i32, value: i32) { unsafe { htmlcanvaselement_set_width(instance, value); } } extern "C" { fn htmlcanvaselement_get_height(instance: i32) -> i32; fn htmlcanvaselement_set_height(instance: i32, value: i32); } pub fn get_height(instance: i32) -> i32 { unsafe { htmlcanvaselement_get_height(instance) } } pub fn set_height(instance: i32, value: i32) { unsafe { htmlcanvaselement_set_height(instance, value); } } extern "C" { fn htmlcanvaselement_get_context(instance: i32, context_id: CString) -> i32; } pub fn get_context(instance: i32, context_id: &str) -> i32 { unsafe { htmlcanvaselement_get_context(instance, to_cstring(context_id)) } } extern "C" { fn htmlcanvaselement_to_data_url( instance: i32, data_type: CString, encoder_options: i32, ) -> CString; } pub fn to_data_url(instance: i32, data_type: &str, encoder_options: i32) -> String { unsafe { to_string(htmlcanvaselement_to_data_url( instance, to_cstring(data_type), encoder_options, )) } } extern "C" { fn htmlcanvaselement_to_blob( instance: i32, callback: i32, blob_type: CString, encoder_options: i32, ); } pub fn to_blob(instance: i32, callback: i32, blob_type: &str, encoder_options: i32) { unsafe { htmlcanvaselement_to_blob(instance, callback, to_cstring(blob_type), encoder_options) } } extern "C" { fn htmlcanvaselement_transfer_control_to_offscreen(instance: i32) -> i32; } pub fn transfer_control_to_offscreen(instance: i32) -> i32 { unsafe { htmlcanvaselement_transfer_control_to_offscreen(instance) } }