-
Notifications
You must be signed in to change notification settings - Fork 61
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
Update clipboard-win to v5 and replace winapi with windows-sys #123
Conversation
Thanks for the PR, I appreciate the effort. Would you consider modifying this to use I would definitely be in favor of implementing a helper function to wrap some of the |
It makes sense. I'll try windows-sys. |
I focused on replacing winapi with windows-rs with as small diff as possible. But I'll refactor the code more idiomtic. |
No worries either way, I could refactor it later if you are busy. I generally don't mind a little bit of scope creep in PRs that touches the same area as long as its independently reviewable (its own commit, etc). |
No problem. I like refactorying so I'll try it by myself :) |
CreateDIBitmap, DeleteObject, GetDIBits, LCS_sRGB, BITMAPINFO, BITMAPINFOHEADER, | ||
BITMAPV5HEADER, BI_RGB, CBM_INIT, DIB_RGB_COLORS, LCS_GM_IMAGES, PROFILE_EMBEDDED, | ||
PROFILE_LINKED, RGBQUAD, | ||
mod image_data { |
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.
Separating this module as a new file may be a good idea.
I added some refactorings:
|
The dependency tree is now: > cargo tree --edges no-dev
arboard v3.3.0
├── clipboard-win v5.0.0
│ └── error-code v3.0.0
├── log v0.4.20
├── thiserror v1.0.35
│ └── thiserror-impl v1.0.35 (proc-macro)
│ ├── proc-macro2 v1.0.43
│ │ └── unicode-ident v1.0.4
│ ├── quote v1.0.21
│ │ └── proc-macro2 v1.0.43 (*)
│ └── syn v1.0.100
│ ├── proc-macro2 v1.0.43 (*)
│ ├── quote v1.0.21 (*)
│ └── unicode-ident v1.0.4
└── windows-sys v0.52.0
└── windows-targets v0.52.0
└── windows_x86_64_msvc v0.52.0 |
Thank you for your reviews. I'll have a look at them tonight. |
@complexspaces I addressed all review comments. Would you take a look again? |
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.
Thanks a lot for your work on this, everything looks good now!
This PR does two things for Windows support:
winapi
crate dependency withwindows-rs
platform/windows.rs
I confirmed writing/reading clipboard with both text and image contents using
hello_world
andset_image
/get_image
examples on my Windows 10 machine.With this PR, cargo dependencies will change to: