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

Refactor code and create methods to expose functionality that can be reused to implement drag and drop in Windows #2

Closed
wants to merge 1 commit into from

Conversation

martincapello
Copy link
Member

  • Separates BitmapInfo implementation from interface, putting code in cpp file and data + methods definitions in header file. It is also moved inside the win namespace. This was needed to be able to reuse the BitmapInfo struct when implementing DragDataProvider::getImage().
  • Moves implementation of write_png_on_stream, write_png, and read_png to cpp file and leaves only definitions on header.
  • Creates create_img and create_dibv5 functions which basically contains code copy & pasted from other methods with some slight changes.

Note: I've noted that using vscode for comparing differences is better than using the split view on Github, at least for these changes, because it shows a better match between lines of codes on each side.

…reused to implement drag and drop in Windows
SetClipboardData(png_format, png_handle);
}
}
namespace win {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we don't need this namespace here and we could move create_img to the other namespace block. I just did this because the code comparison is actually easier when this code is here (when using vscode to compare changes). If you don't see the point in having this, I will be happy to move it.

@martincapello
Copy link
Member Author

Created by mistake.

@dacap dacap deleted the refactor-for-win-dnd branch April 22, 2024 18:42
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.

1 participant