Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to read/write data of any format #11

Open
DjDeveloperr opened this issue Mar 10, 2021 · 12 comments
Open

Allow to read/write data of any format #11

DjDeveloperr opened this issue Mar 10, 2021 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@DjDeveloperr
Copy link

DjDeveloperr commented Mar 10, 2021

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?

@ArturKovacs
Copy link
Collaborator

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 ArturKovacs changed the title Allow to read/write bytes to Clipboard Allow to read/write data of any format Mar 10, 2021
@ArturKovacs
Copy link
Collaborator

I started working on this

@ArturKovacs ArturKovacs self-assigned this Mar 12, 2021
@ArturKovacs
Copy link
Collaborator

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)

@crowlKats
Copy link

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

@ArturKovacs
Copy link
Collaborator

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.

@crowlKats
Copy link

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.

@ArturKovacs
Copy link
Collaborator

Got it! Thanks for letting me know.

@vezaynk
Copy link

vezaynk commented Jan 15, 2022

@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?

@ArturKovacs
Copy link
Collaborator

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.

@ndd7xv
Copy link

ndd7xv commented Oct 30, 2022

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!

@80avin
Copy link

80avin commented Dec 20, 2022

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])

@ArturKovacs
Copy link
Collaborator

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

@complexspaces complexspaces added the enhancement New feature or request label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants