-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5.4.0: Add API to customize clipboard setting behavior
- Loading branch information
Showing
5 changed files
with
118 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "clipboard-win" | ||
version = "5.3.1" | ||
version = "5.4.0" | ||
authors = ["Douman <[email protected]>"] | ||
description = "Provides simple way to interact with Windows clipboard." | ||
license = "BSL-1.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ extern crate std; | |
|
||
extern crate alloc; | ||
|
||
pub mod options; | ||
mod sys; | ||
pub mod types; | ||
pub mod formats; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//! Configuration options | ||
use crate::SysResult; | ||
use crate::raw::empty; | ||
|
||
///Function type to empty clipboard | ||
pub type EmptyFn = fn() -> SysResult<()>; | ||
|
||
///Clearing parameter | ||
pub trait Clearing { | ||
///Empty behavior definition | ||
const EMPTY_FN: EmptyFn; | ||
} | ||
|
||
#[derive(Copy, Clone)] | ||
///Performs no clearing of clipboard | ||
pub struct NoClear; | ||
|
||
fn noop() -> SysResult<()> { | ||
Ok(()) | ||
} | ||
|
||
impl Clearing for NoClear { | ||
const EMPTY_FN: EmptyFn = noop; | ||
} | ||
|
||
#[derive(Copy, Clone)] | ||
///Performs clearing of clipboard before pasting | ||
pub struct DoClear; | ||
|
||
impl Clearing for DoClear { | ||
const EMPTY_FN: EmptyFn = empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters