Commit graph

68 commits

Author SHA1 Message Date
ComplexSpaces
189d67500c Improve clipboard documentation and guarentees
This adds unit tests to back up the crate's documentation to
prevent silent regressions in the future.
2022-11-04 10:44:15 -06:00
Rodolphe Bréard
9243631c20
Implement the .set_html() method (#69)
Implement the `.set_html()` method
2022-10-16 18:08:01 -05:00
ComplexSpaces
12664f2447 Redo API for clipboard clearing 2022-09-19 16:51:54 -05:00
ComplexSpaces
7fd3f07c05 Accept optionally borrowed data instead of String for setting text 2022-07-25 08:18:35 -05:00
ComplexSpaces
93c57b8569 Add support for excluding clipboard data from Windows' utilites 2022-07-08 13:01:26 -05:00
ComplexSpaces
d6f244d899 Add support for clearing the clipboard 2022-07-01 08:31:35 -05:00
Sabrina Jewson
9c87c70a6b
Organize platform-specific code in platform/ (#55)
* Organize platform-specific code in `platform/`

* Rename `clipboard_of` to `selection_of`
2022-06-11 15:15:50 -05:00
Sabrina Jewson
5f0fb88c55
Support waiting on the clipboard to be overwritten on Linux (#43)
* Support waiting on the clipboard to be overwritten on Linux

* Add daemonize example

* Improve docs of ClipboardExtLinux

* Allow daemonize to compile on all platforms

* Use a constant in daemonize example

* Improve wording in docs of clipboard waiting

* Add a builder-like API to reduce combinatorial explosion

* Remove ClipboardExtLinux

This also adds support for setting and getting image data on the primary
and secondary clipboards.
2022-06-08 22:52:03 -05:00
Matt
a36ba4f87e
Make never-mutated param non-mut (#44)
* Make never-mutated param non-mut

* Fix some typos
2022-04-18 09:24:42 -05:00
ComplexSpaces
67d53d20f6 Match cargo authors with license headers
Update license dates
2022-03-04 17:19:56 -06:00
Artúr Kovács
e3b0419d27
Fix incorrect get_image and set_image implementation (#23)
* Image copy and paste seems to work again

* Remove unnecessary code, fix clippy warnings

* Add missing clipboard clear for get_image

* Fix incorrectly setting the image on Windows

Also adds some tests

* Fix `get_image` build errors

* Another attempt at fixing the set_image function

* Yet another attempt at fixing `set_image`

This time we make sure that we don't have a negative height in the
bitmap header. Due to this we also flip the image first

* Fix for sometimes failing to set the image

* Word still needs the image to be pre-flipped

Fixes the issue that a blank image is shown when pasting into Word on
Windows

* Fix warnings
2022-02-20 16:09:05 +01:00
Dominik Nakamura
48939d7a0e
Make image data functionality an optional feature (#18)
* Make image data functionality an optional feature

* Add image-data to the default feature set
2021-07-12 19:58:44 +02:00
mathieulj
f978452511
Support selecting which linux clipboard we operate on. (#17)
* Support selecting which linux clipboard we operate on

* Use specific error variant for unsupported clipboard.

* Correct doc comment typo.

* Reduce code duplication.
2021-07-07 21:55:42 +02:00
Artur Kovacs
8a9deb6f83 Re-wrote the x11 backed
Co-authored-by: daxpedda <daxpedda@gmail.com>
2021-04-10 22:48:04 +02:00
Artur Kovacs
b445105c0e Select the wayland protocol at runtime 2021-04-06 21:51:44 +02:00
Alexander Sieg
c6712a130d Wayland clipboard support via data_control protocol
While it is true that wayland can support that X11 way of handling
clipboard support, this requires a running xwayland server and
compositor support for running xwayland.

This change introduces a new clipboard context
`WaylandDataControlClipboardContext` which is a wrapper around the
wl-clipboard-rs crate. This crate handles all of the communication with
the compositor for us.

To selected between X11 and wayland data_control clipboard handle is not
possible via a platform selector, as is the case for windows and mac,
two new features where add `x11` and `wayland-data-control`. The `x11`
feature is in the `default` feature set as to preserve backward
compatibility.

The feature name `wayland-data-control` was chosen to handle other
possible wayland protocols to interface with a clipboard.
2021-04-03 10:46:49 +02:00
Artur Kovacs
e8434f4eb1 Provide the image in CF_BITMAP as well 2020-12-29 20:58:08 +01:00
Jonas Malaco
0285a7b357 X11: document X11 and Mutter-specific parts of the tests 2020-10-25 20:12:04 -03:00
Jonas Malaco
5c73314e91 Add test case for persistence after drop 2020-10-25 08:32:14 -03:00
Artur Kovacs
2f3fde2147 Ran cargo fmt 2020-09-13 10:02:11 +02:00
Artur Kovacs
6970a0487a Minor documentation improvements 2020-09-12 17:55:42 +02:00
Artur Kovacs
c794ff19e8 Improve documentation 2020-09-12 17:28:00 +02:00
Artur Kovacs
ceb1cd0a49 Extend documentation and slight code touch up. 2020-09-12 14:00:18 +02:00
Artur Kovacs
ef117dbd54 Use better errors on Linux 2020-09-06 10:21:30 +02:00
Artur Kovacs
def8b17675 Improve Debug printing of Error values. 2020-09-06 09:37:32 +02:00
Artur Kovacs
8015991778 Implement better errors on Windows 2020-09-05 23:16:12 +02:00
Artur Kovacs
6c8feb441a Implement better errors on macOS 2020-09-05 19:12:30 +02:00
Artur Kovacs
3c09a8a1a9 Moved to 2018 edition 2020-09-05 15:41:32 +02:00
Artur Kovacs
d260659b63 Remove trait on macos 2020-09-05 12:59:08 +02:00
Artur Kovacs
68be7f93cd Removed trait on windows and fixed image function 2020-09-04 20:19:08 +02:00
Artur Kovacs
937d522019 Update readme and remove ClipboardProvider trait 2020-09-03 20:53:50 +02:00
Artur Kovacs
05d292c086 Ran cargo fmt 2020-09-01 21:19:11 +02:00
Artur Kovacs
4df69c8c70 Merge branch 'arboard-add-image' into add-image
# Conflicts:
#	examples/hello_world.rs
#	examples/image.rs
#	examples/primary_selection.rs
#	src/common.rs
#	src/lib.rs
#	src/osx_clipboard.rs
#	src/windows_clipboard.rs
#	src/x11_clipboard.rs
2020-09-01 21:01:26 +02:00
Artur Kovacs
a388a3ff2c Set image now works on x11 2020-09-01 18:33:54 +02:00
Artur Kovacs
492556b515 Fix for drop not getting called. 2020-08-31 07:40:38 +02:00
Artur Kovacs
da788d1042 Ran cargo fmt 2020-08-30 14:34:52 +02:00
Artur Kovacs
28910ef591 Things don't yet work but it's a good place to commit. 2020-08-30 13:04:37 +02:00
Artur Kovacs
e4545b2231 Implemented set_image on macOS. 2020-07-13 16:21:57 +02:00
Artur Kovacs
1b363cd7a2 Adding get image for windows is in progress. 2020-06-29 21:34:28 +02:00
Artur Kovacs
429f58e2e2 Add set_image implementation for windows. 2020-06-29 20:26:01 +02:00
Artur Kovacs
23639c2ef2 Removed the nop clipboard, adding get image for macos 2020-05-23 17:47:29 +02:00
Artur Kovacs
c8a13bd62f Merge branch 'tweaks'
# Conflicts:
#	src/common.rs
#	src/nop_clipboard.rs
#	src/osx_clipboard.rs
2020-05-23 16:29:44 +02:00
Artur Kovacs
d40eb89df9 Renamed set/get_contents to set/get_text. Updated the license file structure. 2020-05-23 16:19:17 +02:00
Artúr Kovács
432f4728b2
Merge pull request #1 from muja/master
Add arbitrary binary content support for MacOS
2020-05-23 13:52:49 +02:00
ice_iix
311e5a6abd Fix compile error on wasm32-unknown-emscripten target 2019-01-12 12:46:26 -08:00
Danyel Bayraktar
638ff7fd33 feat(*): distinguish between error and unset clipboard 2018-11-28 21:17:48 +01:00
Avi Weinstock
10319f55ef Fix cfg patterns to accomodate Android.
Conflicts:
	Cargo.toml
	src/lib.rs
2018-02-22 09:28:41 -05:00
Avi Weinstock
8fc7cbbabf Fix cfg patterns to accomodate Android. 2018-02-20 10:43:15 -05:00
Alex Butler
16e604783f
Fix #50: Use family=unix - macos, instead of os=unix
Add linux travis test compile
2018-02-08 17:53:10 +00:00
Avi Weinstock
35537dfd85 Change target_os="linux" to target_os="unix" to enable BSD support, as suggested in issue #49. 2018-02-08 11:08:05 -05:00