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

Add some options with some refactoring #588

Merged
merged 9 commits into from
Jan 5, 2024

Conversation

PzaThief
Copy link
Contributor

@PzaThief PzaThief commented Jan 4, 2024

for solving #584 added some options.

  1. support PNG format as default.
  • Most programs these days support PNG natively.
  • Moreover if Ditto ignored PNG, CF_DIB is used that has many problems (Windows makes it as no alpha channel and many programs doesn't want to use it)
  1. add support all types advanced option.
  • User might want Ditto to keep all data about clipboard
  • Currently, users have to add the type every time after recognizing the missing item.
  • Because it is experimental and it will ignore supported type list in main option confusedly, default is false.
  • About GetAvailableTypes functions, there is re-check part after get available format using GetNextFormat.
  • Because GetNextFormat has a bug that not return some of formats (especially CF_DIB), it will re-check to cover include at least the standard formats. Ref
  1. in WriteImageToFile use PNG first.
  • PNG might be closer to original source. (CF_DIB is most likely lost information.)

refactoring things

  1. add Image helper to assemble image process.
  2. rename variables that makes confuse.
  3. code diet to enhance readability.
  4. remove special action about Edge. (currently Edge use chromium and it's process name is no more MicrosoftEdge.exe)

Happy new year~

@PzaThief
Copy link
Contributor Author

PzaThief commented Jan 5, 2024

I changed GetAvailableTypes function to use EnumClipboardFormats API to keep all types. (but excluded CF_MAX format because it is not valid)

@sabrogden sabrogden merged commit 7641c03 into sabrogden:master Jan 5, 2024
1 check failed
@PzaThief PzaThief deleted the fix/keep-alpha-channel branch January 6, 2024 00:23
@sabrogden
Copy link
Owner

in void CCopyThread::OnClipboardChange(CString activeWindow, CString activeWindowTitle) i don't see any reason to always call oleData.GetAvailableTypes(); it's only used if they are using a copy buffer or the new option to save all. Can we only do this when needed.

@PzaThief
Copy link
Contributor Author

PzaThief commented Jan 6, 2024

Oh, It was my miss. I'll update it together with FocusCaret fix.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants