Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

X11 Clipboard interfacing library in Rust

License

Apache-2.0, GPL-2.0 licenses found

Licenses found

Apache-2.0
LICENSE.apache2
GPL-2.0
LICENSE.gpl2
Notifications You must be signed in to change notification settings

servo/rust-clipboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-clipboard

rust-clipboard is a cross-platform library for getting and setting the contents of the OS-level clipboard. It has been tested on Windows, Mac OSX, and GNU/Linux. It is used in Mozilla Servo.

Example

fn example() {
    let mut ctx = ClipboardContext::new().unwrap();
    println!("{}", ctx.get_contents());
    ctx.set_contents(&"some string");
}

API

fn new() -> Result<ClipboardContext, Box<Error>>
fn get_contents(&ClipboardContext) -> Result<String, Box<Error>>
fn set_contents(&mut ClipboardContext, String) -> Result<(), Box<Error>>

ClipboardContext is an opaque struct that is defined in different ways based on the OS via conditional compilation.

License

Since the x11 backend contains code derived from xclip (which is GPLv2), rust-clipboard must currently be treated as GPLv2. I plan to rewrite x11-clipboard.rs by strictly referencing the ICCCM standard, and relicense to Apache2. All the other code in rust-clipboard may be treated as Apache2.

About

X11 Clipboard interfacing library in Rust

Resources

License

Apache-2.0, GPL-2.0 licenses found

Licenses found

Apache-2.0
LICENSE.apache2
GPL-2.0
LICENSE.gpl2

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%