arboard icon indicating copy to clipboard operation
arboard copied to clipboard

Allow to read/write data of any format

Open DjDeveloperr opened this issue 4 years ago • 16 comments

Hi, nice crate! I'm looking into implementing Web Clipboard API for Deno and this crate seems perfect for that. Though, there has to be a method to directly read/write bytes to implement that. Will it be added?

DjDeveloperr avatar Mar 10 '21 14:03 DjDeveloperr

Yeah, allowing to read and write arbitrarily typed data seems like a useful addition. Maybe an enum of possible clipboard types could be used as an efficient and typo-resistent alternative to MIME type strings.

ArturKovacs avatar Mar 10 '21 15:03 ArturKovacs

I started working on this

ArturKovacs avatar Mar 12 '21 21:03 ArturKovacs

Which operating system would you use for the implementation work? Just because I'll start working on that next. (The macOS implementation should be usable at this point)

ArturKovacs avatar Mar 13 '21 16:03 ArturKovacs

@ArturKovacs we would need support for all the 3 systems this crate supports; so win, osx & x11.

crowlKats avatar Mar 14 '21 08:03 crowlKats

I was going to implement it for all of those anyways. I was just asking in case you wanted to start working on it before the implementation here is complete.

ArturKovacs avatar Mar 14 '21 08:03 ArturKovacs

Oh I see, I misunderstood. Well we currently are unsure whether to add the clipboard API or not, so implementation wont start in the next few days in either case.

crowlKats avatar Mar 14 '21 11:03 crowlKats

Got it! Thanks for letting me know.

ArturKovacs avatar Mar 14 '21 11:03 ArturKovacs

@ArturKovacs Hi! I'm interested in this library. I need rich text and file clipboard access too. I'd happily settle for a binary API for arbitrary formats though!

Is this still actively being worked on?

vezaynk avatar Jan 15 '22 22:01 vezaynk

Hi I would like to finish #23 first, but admittedly I lost motivation to work on that PR after many failed attempts.

Although it is possible, that I will spend some time with either the any-format branch or #23 in the near future, now that you ask.

ArturKovacs avatar Jan 15 '22 23:01 ArturKovacs

Hello! I'm working on a toy terminal hex editor and I'm wondering if there's any status updates on this issue, as it'd be useful to copy raw bytes into the clipboard.

Regardless, really nice project and thanks for all of the work!

ndd7xv avatar Oct 30 '22 18:10 ndd7xv

Hi @ArturKovacs , is there any update on this ?

I started experimenting on this and was able to support any format on X11. However, I just noticed that my approach/API is a lot different than yours.

My approach was to implement these functions on clipboard:

// get formats currently present in clipboard
get_formats()

// get bytes for given format
get_bytes(format: &[u8])

// sets the bytes with given format(mime-type)
set_bytes(bytes: &[u8], format: &[u8])

80avin avatar Dec 20 '22 20:12 80avin

Hi I lost interest to continue working on this. Anyone can of course use/steal my work from the any-format branch.

ArturKovacs avatar Dec 21 '22 10:12 ArturKovacs