From 13954c9204bd67ebc4821259e24553c428391eae Mon Sep 17 00:00:00 2001 From: NiiightmareXD Date: Fri, 8 Mar 2024 16:48:25 +0330 Subject: [PATCH] =?UTF-8?q?Fix=20Typo=20=F0=9F=94=A5=F0=9F=93=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- README.md | 10 +++++----- examples/basic.rs | 8 ++++---- src/graphics_capture_api.rs | 14 +++++++------- src/lib.rs | 10 +++++----- src/settings.rs | 6 +++--- windows-capture-python/Cargo.toml | 2 +- windows-capture-python/pyproject.toml | 2 +- windows-capture-python/src/lib.rs | 10 +++++----- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d54892..33ef112 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,7 +306,7 @@ dependencies = [ [[package]] name = "windows-capture" -version = "1.0.65" +version = "1.0.68" dependencies = [ "parking_lot", "rayon", @@ -316,7 +316,7 @@ dependencies = [ [[package]] name = "windows-capture-python" -version = "1.0.65" +version = "1.0.68" dependencies = [ "pyo3", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index fd25c05..f9ff48b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windows-capture" -version = "1.0.65" +version = "1.0.68" authors = ["NiiightmareXD"] edition = "2021" description = "Fastest Windows Screen Capture Library For Rust 🔥" diff --git a/README.md b/README.md index 5d99c3f..f4ec507 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Add this library to your `Cargo.toml`: ```toml [dependencies] -windows-capture = "1.0.65" +windows-capture = "1.0.68" ``` or run this command @@ -48,7 +48,7 @@ use windows_capture::{ frame::Frame, graphics_capture_api::InternalCaptureControl, monitor::Monitor, - settings::{ColorFormat, CursorCaptuerSettings, DrawBorderSettings, Settings}, + settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings, Settings}, }; // This struct will be used to handle the capture events. @@ -133,9 +133,9 @@ fn main() { let settings = Settings::new( // Item To Captue primary_monitor, - // Capture Cursor - CursorCaptuerSettings::Default, - // Draw Borders (None Means Default Api Configuration) + // Capture Cursor Settings + CursorCaptureSettings::Default, + // Draw Borders Settings DrawBorderSettings::Default, // The desired color format for the captured frame. ColorFormat::Rgba8, diff --git a/examples/basic.rs b/examples/basic.rs index af1a0fe..087e0a5 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -9,7 +9,7 @@ use windows_capture::{ frame::Frame, graphics_capture_api::InternalCaptureControl, monitor::Monitor, - settings::{ColorFormat, CursorCaptuerSettings, DrawBorderSettings, Settings}, + settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings, Settings}, }; // This struct will be used to handle the capture events. @@ -94,9 +94,9 @@ fn main() { let settings = Settings::new( // Item To Captue primary_monitor, - // Capture Cursor - CursorCaptuerSettings::Default, - // Draw Borders (None Means Default Api Configuration) + // Capture Cursor Settings + CursorCaptureSettings::Default, + // Draw Borders Settings DrawBorderSettings::Default, // The desired color format for the captured frame. ColorFormat::Rgba8, diff --git a/src/graphics_capture_api.rs b/src/graphics_capture_api.rs index d5cad6d..dfaf757 100644 --- a/src/graphics_capture_api.rs +++ b/src/graphics_capture_api.rs @@ -25,7 +25,7 @@ use crate::{ capture::GraphicsCaptureApiHandler, d3d11::{self, create_d3d_device, create_direct3d_device, SendDirectX}, frame::Frame, - settings::{ColorFormat, CursorCaptuerSettings, DrawBorderSettings}, + settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings}, }; #[derive(thiserror::Error, Eq, PartialEq, Clone, Debug)] @@ -116,7 +116,7 @@ impl GraphicsCaptureApi { >( item: GraphicsCaptureItem, callback: Arc>, - cursor_capture: CursorCaptuerSettings, + cursor_capture: CursorCaptureSettings, draw_border: DrawBorderSettings, color_format: ColorFormat, thread_id: u32, @@ -127,7 +127,7 @@ impl GraphicsCaptureApi { return Err(Error::Unsupported); } - if cursor_capture != CursorCaptuerSettings::Default + if cursor_capture != CursorCaptureSettings::Default && !Self::is_cursor_settings_supported()? { return Err(Error::CursorConfigUnsupported); @@ -293,12 +293,12 @@ impl GraphicsCaptureApi { } }))?; - if cursor_capture != CursorCaptuerSettings::Default { + if cursor_capture != CursorCaptureSettings::Default { if Self::is_cursor_settings_supported()? { match cursor_capture { - CursorCaptuerSettings::Default => (), - CursorCaptuerSettings::WithCursor => session.SetIsCursorCaptureEnabled(true)?, - CursorCaptuerSettings::WithoutCursor => { + CursorCaptureSettings::Default => (), + CursorCaptureSettings::WithCursor => session.SetIsCursorCaptureEnabled(true)?, + CursorCaptureSettings::WithoutCursor => { session.SetIsCursorCaptureEnabled(false)? } }; diff --git a/src/lib.rs b/src/lib.rs index 521c979..5303689 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,7 @@ //! //! ```toml //! [dependencies] -//! windows-capture = "1.0.65" +//! windows-capture = "1.0.68" //! ``` //! or run this command //! @@ -44,7 +44,7 @@ //! frame::Frame, //! graphics_capture_api::InternalCaptureControl, //! monitor::Monitor, -//! settings::{ColorFormat, CursorCaptuerSettings, DrawBorderSettings, Settings}, +//! settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings, Settings}, //! }; //! //! // This struct will be used to handle the capture events. @@ -128,9 +128,9 @@ //! let settings = Settings::new( //! // Item To Captue //! primary_monitor, -//! // Capture Cursor -//! CursorCaptuerSettings::Default, -//! // Draw Borders (None Means Default Api Configuration) +//! // Capture Cursor Settings +//! CursorCaptureSettings::Default, +//! // Draw Borders Settings //! DrawBorderSettings::Default, //! // The desired color format for the captured frame. //! ColorFormat::Rgba8, diff --git a/src/settings.rs b/src/settings.rs index d50b365..7513c57 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -20,7 +20,7 @@ impl Default for ColorFormat { } #[derive(Eq, PartialEq, Clone, Debug)] -pub enum CursorCaptuerSettings { +pub enum CursorCaptureSettings { Default, WithCursor, WithoutCursor, @@ -39,7 +39,7 @@ pub struct Settings { /// The graphics capture item to capture. pub item: GraphicsCaptureItem, /// Specifies whether to capture the cursor. - pub cursor_capture: CursorCaptuerSettings, + pub cursor_capture: CursorCaptureSettings, /// Specifies whether to draw a border around the captured region. pub draw_border: DrawBorderSettings, /// The color format for the captured graphics. @@ -64,7 +64,7 @@ impl Settings { /// Returns a `Result` containing the `Settings` if successful, or an `Error` if conversion to `GraphicsCaptureItem` fails. pub fn new>( item: T, - cursor_capture: CursorCaptuerSettings, + cursor_capture: CursorCaptureSettings, draw_border: DrawBorderSettings, color_format: ColorFormat, flags: Flags, diff --git a/windows-capture-python/Cargo.toml b/windows-capture-python/Cargo.toml index 9d33f1f..04dc93e 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.65" +version = "1.0.68" 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 a281452..a6e87e6 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.65" +version = "1.0.68" description = "Fastest Windows Screen Capture Library For Python 🔥" readme = "README.md" requires-python = ">=3.9" diff --git a/windows-capture-python/src/lib.rs b/windows-capture-python/src/lib.rs index 630e67c..cd8a109 100644 --- a/windows-capture-python/src/lib.rs +++ b/windows-capture-python/src/lib.rs @@ -11,7 +11,7 @@ use ::windows_capture::{ frame::{self, Frame}, graphics_capture_api::InternalCaptureControl, monitor::Monitor, - settings::{ColorFormat, CursorCaptuerSettings, DrawBorderSettings, Settings}, + settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings, Settings}, window::Window, }; use pyo3::{exceptions::PyException, prelude::*, types::PyList}; @@ -120,7 +120,7 @@ impl NativeCaptureControl { pub struct NativeWindowsCapture { on_frame_arrived_callback: Arc, on_closed: Arc, - cursor_capture: CursorCaptuerSettings, + cursor_capture: CursorCaptureSettings, draw_border: DrawBorderSettings, monitor_index: Option, window_name: Option, @@ -148,9 +148,9 @@ impl NativeWindowsCapture { } let cursor_capture = match cursor_capture { - Some(true) => CursorCaptuerSettings::WithCursor, - Some(false) => CursorCaptuerSettings::WithoutCursor, - None => CursorCaptuerSettings::Default, + Some(true) => CursorCaptureSettings::WithCursor, + Some(false) => CursorCaptureSettings::WithoutCursor, + None => CursorCaptureSettings::Default, }; let draw_border = match draw_border {