Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clipboard-win to v5 and replace winapi with windows-sys #123

Merged
merged 14 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rust-version = "1.61"

[features]
default = ["image-data"]
image-data = ["core-graphics", "image", "winapi/minwindef", "winapi/wingdi", "winapi/winnt"]
image-data = ["core-graphics", "image", "windows-sys"]
wayland-data-control = ["wl-clipboard-rs"]

[dependencies]
Expand All @@ -22,12 +22,14 @@ thiserror = "1.0"
env_logger = "0.9.0"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", optional = true, features = [
"basetsd",
"winuser",
"winbase",
windows-sys = { version = "0.48.0", optional = true, features = [
"Win32_Foundation",
"Win32_Graphics_Gdi",
"Win32_System_DataExchange",
"Win32_System_Memory",
"Win32_System_Ole",
]}
clipboard-win = "4.4.2"
clipboard-win = "5.0.0"
log = "0.4"

[target.'cfg(target_os = "macos")'.dependencies]
Expand Down
7 changes: 7 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ impl std::fmt::Debug for Error {
}
}

impl Error {
#[cfg(windows)]
pub(crate) fn unknown<M: Into<String>>(message: M) -> Self {
Error::Unknown { description: message.into() }
}
}

/// Stores pixel data of an image.
///
/// Each element in `bytes` stores the value of a channel of a single pixel.
Expand Down
Loading
Loading