-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(*): get non-string contents from clipboard for OSX #60
base: master
Are you sure you want to change the base?
Conversation
let cls: Id<Class> = unsafe { Id::from_ptr(class("NSURL")) }; | ||
unsafe { transmute(cls) } | ||
}; | ||
let classes = vec![url_class, image_class, string_class]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the more "specific" class needs to come first, as readObjectsForClasses
will try to match in order
This looks pretty good. As is though, it breaks the builds on Windows and Linux. Would you mind adding a commit to this PR that adds implementations of |
Yeah, that could be a way to implement them..
One problem here is that windows doesn't seem to support Hope that makes it clear, I will amend this PR next week. Btw, do you have any idea how it is in Linux? PNG/TIFF support? |
Having |
Hi, this addresses in part issue #31, and #46.
Some things I feel may be done differently:
Finder
(OS X), it will be aNSURL
instead of aString
, which cannot be captured as a mime type.&[u8]
from the objc memory (I added a comment) to an ownedVec
which is very inefficient (small clipboards I experimented with when screen capping windows were >18MB). Not sure what's the best approach hereThis is also just for OSX, happy for your feedback. For windows, it should be trivial as far as I can tell, since the
clipboard-win
crate exposes an API for this already