From 6df8228df70213e72706d1a9a18699f245b02868 Mon Sep 17 00:00:00 2001 From: NiiightmareXD Date: Sat, 25 Nov 2023 04:56:52 -0800 Subject: [PATCH] =?UTF-8?q?Better=20Error=20Message=20=F0=9F=98=8A=20=09mo?= =?UTF-8?q?dified:=20=20=20Cargo.lock=20=09modified:=20=20=20Cargo.toml=20?= =?UTF-8?q?=09modified:=20=20=20README.md=20=09modified:=20=20=20examples/?= =?UTF-8?q?basic.rs=20=09modified:=20=20=20src/graphics=5Fcapture=5Fapi.rs?= =?UTF-8?q?=20=09modified:=20=20=20src/lib.rs=20=09modified:=20=20=20windo?= =?UTF-8?q?ws-capture-python/Cargo.lock=20=09modified:=20=20=20windows-cap?= =?UTF-8?q?ture-python/Cargo.toml=20=09modified:=20=20=20windows-capture-p?= =?UTF-8?q?ython/pyproject.toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- README.md | 6 +++--- examples/basic.rs | 4 ++-- src/graphics_capture_api.rs | 8 ++++---- src/lib.rs | 6 +++--- windows-capture-python/Cargo.lock | 2 +- windows-capture-python/Cargo.toml | 2 +- windows-capture-python/pyproject.toml | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index adfd623..ace9426 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -548,7 +548,7 @@ dependencies = [ [[package]] name = "windows-capture" -version = "1.0.35" +version = "1.0.36" dependencies = [ "image", "log", @@ -560,7 +560,7 @@ dependencies = [ [[package]] name = "windows-capture-python" -version = "1.0.35" +version = "1.0.36" dependencies = [ "pyo3", "windows", diff --git a/Cargo.toml b/Cargo.toml index 5007bcd..302b835 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windows-capture" -version = "1.0.35" +version = "1.0.36" authors = ["NiiightmareXD"] edition = "2021" description = "Fastest Windows Screen Capture Library For Rust 🔥" diff --git a/README.md b/README.md index 73f60c4..1c027df 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Add this library to your `Cargo.toml`: ```toml [dependencies] -windows-capture = "1.0.35" +windows-capture = "1.0.36" ``` or run this command @@ -88,8 +88,8 @@ fn main() { foreground_window, // Capture Cursor Some(true), - // Draw Borders - Some(false), + // Draw Borders (None Means Default Api Configuration) + None, // Kind Of Pixel Format For Frame To Have ColorFormat::Rgba8, // Will Be Passed To The New Function diff --git a/examples/basic.rs b/examples/basic.rs index c23c3c8..528557c 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -57,8 +57,8 @@ fn main() { foreground_window, // Capture Cursor Some(true), - // Draw Borders - Some(false), + // Draw Borders (None Means Default Api Configuration) + None, // Kind Of Pixel Format For Frame To Have ColorFormat::Rgba8, // Will Be Passed To The New Function diff --git a/src/graphics_capture_api.rs b/src/graphics_capture_api.rs index 8b4ab47..09cd2bb 100644 --- a/src/graphics_capture_api.rs +++ b/src/graphics_capture_api.rs @@ -42,9 +42,9 @@ pub enum WindowsCaptureError { #[error("Graphics Capture API Is Not Supported")] Unsupported, #[error("Graphics Capture API Toggling Cursor Capture Is Not Supported")] - CursorUnsupported, + CursorConfigUnsupported, #[error("Graphics Capture API Toggling Border Capture Is Not Supported")] - BorderUnsupported, + BorderConfigUnsupported, #[error("Already Started")] AlreadyStarted, } @@ -285,7 +285,7 @@ impl GraphicsCaptureApi { .unwrap() .SetIsCursorCaptureEnabled(self.capture_cursor.unwrap())?; } else { - return Err(Box::new(WindowsCaptureError::CursorUnsupported)); + return Err(Box::new(WindowsCaptureError::CursorConfigUnsupported)); } } @@ -299,7 +299,7 @@ impl GraphicsCaptureApi { .unwrap() .SetIsBorderRequired(self.draw_border.unwrap())?; } else { - return Err(Box::new(WindowsCaptureError::BorderUnsupported)); + return Err(Box::new(WindowsCaptureError::BorderConfigUnsupported)); } } diff --git a/src/lib.rs b/src/lib.rs index 7bb3909..e02f4f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,7 @@ //! //! ```toml //! [dependencies] -//! windows-capture = "1.0.35" +//! windows-capture = "1.0.36" //! ``` //! or run this command //! @@ -91,8 +91,8 @@ //! foreground_window, //! // Capture Cursor //! Some(true), -//! // Draw Borders -//! Some(false), +//! // Draw Borders (None Means Default Api Configuration) +//! None, //! // Kind Of Pixel Format For Frame To Have //! ColorFormat::Rgba8, //! // Will Be Passed To The New Function diff --git a/windows-capture-python/Cargo.lock b/windows-capture-python/Cargo.lock index b7dd0f0..3c6ba42 100644 --- a/windows-capture-python/Cargo.lock +++ b/windows-capture-python/Cargo.lock @@ -131,7 +131,7 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ diff --git a/windows-capture-python/Cargo.toml b/windows-capture-python/Cargo.toml index ad83dbb..635e09f 100644 --- a/windows-capture-python/Cargo.toml +++ b/windows-capture-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windows-capture-python" -version = "1.0.35" +version = "1.0.36" authors = ["NiiightmareXD"] edition = "2021" description = "Fastest Windows Screen Capture Library For Python 🔥" diff --git a/windows-capture-python/pyproject.toml b/windows-capture-python/pyproject.toml index c3a14fd..36fba0e 100644 --- a/windows-capture-python/pyproject.toml +++ b/windows-capture-python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "windows-capture" -version = "1.0.35" +version = "1.0.36" description = "Fastest Windows Screen Capture Library For Python 🔥" readme = "README.md" requires-python = ">=3.9"