opt: add flutter feat

This commit is contained in:
Kingtous 2023-04-13 15:00:01 +00:00 committed by Kingtous
parent bdd314856f
commit 8cad0b7a6c
3 changed files with 10 additions and 3 deletions

View File

@ -10,9 +10,14 @@ name = "custom_plugin"
path = "src/lib.rs"
crate-type = ["cdylib"]
[features]
default = ["flutter"]
flutter = []
[dependencies]
lazy_static = "1.4.0"
rustdesk = { path = "../../", version = "1.2.0"}
rustdesk = { path = "../../", version = "1.2.0", features = ["flutter"]}
[profile.release]
lto = true

View File

@ -9,6 +9,8 @@ lazy_static::lazy_static! {
pub static ref API: RustDeskApiTable = RustDeskApiTable::default();
}
#[no_mangle]
fn plugin_name() -> *const c_char {
return PLUGIN_NAME.as_ptr();

View File

@ -36,8 +36,8 @@ pub trait Plugin {
#[repr(C)]
#[derive(Default, Clone)]
pub struct RustDeskPluginTable {
pub init: Option<PluginInitFunc>,
pub dispose: Option<PluginDisposeFunc>,
pub init: Option<PluginInitFunc>, // NonNull
pub dispose: Option<PluginDisposeFunc>, // NonNull
}
pub struct PluginImpl {