mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-02 16:41:29 +03:00
fix conditional compilation
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
use ashpd::desktop::ResponseError;
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
|
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
|
||||||
@@ -10,6 +9,8 @@ use wayland_client::{
|
|||||||
ConnectError, DispatchError,
|
ConnectError, DispatchError,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
|
use ashpd::desktop::ResponseError;
|
||||||
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
use reis::tokio::{EiConvertEventStreamError, HandshakeError};
|
use reis::tokio::{EiConvertEventStreamError, HandshakeError};
|
||||||
|
|
||||||
@@ -72,6 +73,7 @@ pub enum CaptureCreationError {
|
|||||||
|
|
||||||
impl CaptureCreationError {
|
impl CaptureCreationError {
|
||||||
/// request was intentionally denied by the user
|
/// request was intentionally denied by the user
|
||||||
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
pub(crate) fn cancelled_by_user(&self) -> bool {
|
pub(crate) fn cancelled_by_user(&self) -> bool {
|
||||||
matches!(
|
matches!(
|
||||||
self,
|
self,
|
||||||
@@ -80,6 +82,10 @@ impl CaptureCreationError {
|
|||||||
)))
|
)))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
#[cfg(not(all(unix, feature = "libei", not(target_os = "macos"))))]
|
||||||
|
pub(crate) fn cancelled_by_user(&self) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ use crate::{
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use futures_core::Stream;
|
use futures_core::Stream;
|
||||||
use input_event::Event;
|
use input_event::Event;
|
||||||
|
use std::pin::Pin;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
use std::{io, pin::Pin};
|
|
||||||
|
|
||||||
pub struct MacOSInputCapture;
|
pub struct MacOSInputCapture;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
use ashpd::{desktop::ResponseError, Error::Response};
|
use ashpd::{desktop::ResponseError, Error::Response};
|
||||||
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
use reis::tokio::EiConvertEventStreamError;
|
use reis::tokio::EiConvertEventStreamError;
|
||||||
@@ -78,6 +79,7 @@ pub enum EmulationCreationError {
|
|||||||
|
|
||||||
impl EmulationCreationError {
|
impl EmulationCreationError {
|
||||||
/// request was intentionally denied by the user
|
/// request was intentionally denied by the user
|
||||||
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
pub(crate) fn cancelled_by_user(&self) -> bool {
|
pub(crate) fn cancelled_by_user(&self) -> bool {
|
||||||
matches!(
|
matches!(
|
||||||
self,
|
self,
|
||||||
@@ -88,6 +90,10 @@ impl EmulationCreationError {
|
|||||||
)))
|
)))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
#[cfg(not(all(unix, feature = "libei", not(target_os = "macos"))))]
|
||||||
|
pub(crate) fn cancelled_by_user(&self) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
|
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
|
||||||
|
|||||||
@@ -295,4 +295,6 @@ impl InputEmulation for MacOSEmulation {
|
|||||||
async fn create(&mut self, _handle: EmulationHandle) {}
|
async fn create(&mut self, _handle: EmulationHandle) {}
|
||||||
|
|
||||||
async fn destroy(&mut self, _handle: EmulationHandle) {}
|
async fn destroy(&mut self, _handle: EmulationHandle) {}
|
||||||
|
|
||||||
|
async fn terminate(&mut self) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ impl InputEmulation for WindowsEmulation {
|
|||||||
async fn create(&mut self, _handle: EmulationHandle) {}
|
async fn create(&mut self, _handle: EmulationHandle) {}
|
||||||
|
|
||||||
async fn destroy(&mut self, _handle: EmulationHandle) {}
|
async fn destroy(&mut self, _handle: EmulationHandle) {}
|
||||||
|
|
||||||
|
async fn terminate(&mut self) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WindowsEmulation {
|
impl WindowsEmulation {
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ log = "0.4.22"
|
|||||||
num_enum = "0.7.2"
|
num_enum = "0.7.2"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
thiserror = "1.0.61"
|
thiserror = "1.0.61"
|
||||||
|
|
||||||
|
[target.'cfg(all(unix, not(target_os="macos")))'.dependencies]
|
||||||
reis = { version = "0.2.0", optional = true }
|
reis = { version = "0.2.0", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ pub mod error;
|
|||||||
pub mod proto;
|
pub mod proto;
|
||||||
pub mod scancode;
|
pub mod scancode;
|
||||||
|
|
||||||
#[cfg(feature = "libei")]
|
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||||
mod libei;
|
mod libei;
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
|
|||||||
Reference in New Issue
Block a user