diff --git a/src/common.rs b/src/common.rs index 4b68d6224..03bce854b 100644 --- a/src/common.rs +++ b/src/common.rs @@ -51,6 +51,20 @@ pub const DST_STRIDE_RGBA: usize = 1; // the executable name of the portable version pub const PORTABLE_APPNAME_RUNTIME_ENV_KEY: &str = "RUSTDESK_APPNAME"; +pub mod input { + pub const MOUSE_TYPE_MOVE: i32 = 0; + pub const MOUSE_TYPE_DOWN: i32 = 1; + pub const MOUSE_TYPE_UP: i32 = 2; + pub const MOUSE_TYPE_WHEEL: i32 = 3; + pub const MOUSE_TYPE_TRACKPAD: i32 = 4; + + pub const MOUSE_BUTTON_LEFT: i32 = 0x01; + pub const MOUSE_BUTTON_RIGHT: i32 = 0x02; + pub const MOUSE_BUTTON_WHEEL: i32 = 0x04; + pub const MOUSE_BUTTON_BACK: i32 = 0x08; + pub const MOUSE_BUTTON_FORWARD: i32 = 0x10; +} + lazy_static::lazy_static! { pub static ref CONTENT: Arc> = Default::default(); pub static ref SOFTWARE_UPDATE_URL: Arc> = Default::default(); diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index e698cc9ee..7d4962dc9 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -6,10 +6,7 @@ use crate::{ common::make_fd_to_json, flutter::{self, SESSIONS}, flutter::{session_add, session_start_}, - server::{ - MOUSE_BUTTON_BACK, MOUSE_BUTTON_FORWARD, MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, - MOUSE_BUTTON_WHEEL, MOUSE_TYPE_DOWN, MOUSE_TYPE_TRACKPAD, MOUSE_TYPE_UP, MOUSE_TYPE_WHEEL, - }, + input::*, ui_interface::{self, *}, }; use flutter_rust_bridge::{StreamSink, SyncReturn}; diff --git a/src/platform/macos.rs b/src/platform/macos.rs index 89e102177..fe0987bff 100644 --- a/src/platform/macos.rs +++ b/src/platform/macos.rs @@ -21,7 +21,7 @@ use hbb_common::{allow_err, anyhow::anyhow, bail, log, message_proto::Resolution use include_dir::{include_dir, Dir}; use objc::{class, msg_send, sel, sel_impl}; use scrap::{libc::c_void, quartz::ffi::*}; -use std::{ffi::c_char, path::PathBuf}; +use std::path::PathBuf; static PRIVILEGES_SCRIPTS_DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/src/platform/privileges_scripts"); diff --git a/src/server.rs b/src/server.rs index b8fef148c..896c40e1e 100644 --- a/src/server.rs +++ b/src/server.rs @@ -74,18 +74,6 @@ lazy_static::lazy_static! { pub static ref CLIENT_SERVER: ServerPtr = new(); } -pub const MOUSE_TYPE_MOVE: i32 = 0; -pub const MOUSE_TYPE_DOWN: i32 = 1; -pub const MOUSE_TYPE_UP: i32 = 2; -pub const MOUSE_TYPE_WHEEL: i32 = 3; -pub const MOUSE_TYPE_TRACKPAD: i32 = 4; - -pub const MOUSE_BUTTON_LEFT: i32 = 0x01; -pub const MOUSE_BUTTON_RIGHT: i32 = 0x02; -pub const MOUSE_BUTTON_WHEEL: i32 = 0x04; -pub const MOUSE_BUTTON_BACK: i32 = 0x08; -pub const MOUSE_BUTTON_FORWARD: i32 = 0x10; - pub struct Server { connections: ConnMap, services: HashMap<&'static str, Box>, diff --git a/src/server/input_service.rs b/src/server/input_service.rs index 4dd2d9c1f..d9ba9e1ef 100644 --- a/src/server/input_service.rs +++ b/src/server/input_service.rs @@ -1,4 +1,5 @@ use super::*; +use crate::input::*; #[cfg(target_os = "macos")] use crate::common::is_server; #[cfg(target_os = "linux")]