Feat: Introducing Printing on Windows - #21988
Conversation
…iation correction in printing.c
Working win32_print.c
…1988 CoPilot Code Review Final Cleanup
|
Ready for review once again. Release notes update pending review completion. I think this might be considered a "big one" but please advise. |
|
@Cjhemmer : I'll review this soon. And yes this is definitely a BIG ONE, thanks! |
TurboGit
left a comment
There was a problem hiding this comment.
After a new pass on the code, some comments/changes.
Also, can you squash all commits together when pushing the changes, TIA.
5305732 to
7597da1
Compare
I made the requested changes and then tried to do some squashing of commits, which in my unfamilarility with git I made an complete mess of instead. Sorry about that. I ended up reverting back and rebuilding my commits up, but the mess remains in the record. Final files to review should be clean though. Let me know if you have any further questions, comments, or when it is time to update the RELEASE_NOTES |
TurboGit
left a comment
There was a problem hiding this comment.
Very minor style comments. Apart from that looks good.
@wpferguson : I can't test myself, can you do some testing for this new feature?
|
@Cjhemmer : You can update the release notes now I would say. TIA. |
TurboGit
left a comment
There was a problem hiding this comment.
Last comment from me, let's get some feedback from @wpferguson after testing. Really thanks for the work @Cjhemmer, nice to see Windows to be on par with other platforms.
Windows Printing has been lacking from Darktable. I have implemented a working print module, building upon the work already in the base code. The majority of changes occur in two files.
libs/print_settings.c which has been modified with _WIN32 guarded code except for rare instances where a change made sense for all platforms. This scaffolds onto the existing code base the functions necesary to keep the Windows print ticket and device mode (DEVMODE) up to date as settings are changed.
The other is a new file, win/win32_print.c (along with its header) which attempts to mirror the functionality of common/cups_print.c. cups_print.c is not included in the cmake though, only the header to cover compiling the cross platform print_settings. It handles printer discovery, DEVMODE enumeration, and print job creation.
CMake files are modified to enable the Print module on a WIndows build.
A minor edit was also made to instantiate pos in printing.c as it was throwing a compile error on in MSYS2.
A minor edit was made to cups_print.h to add a paper_id variable that is specific to my Windows structure but might be useful for all platforms.
I have tested this with a modern Epson inkjet, older Canon laser all in one, and Microsoft Print to PDF with success. It leverages the XPS print API for print job creation, so very old printers may not work, but i found xps to be far faster than GDI printing. I only have physical access to the two listed to test.
Print pipeline is fully color managed and prints directly to the printer, not relying on an external utility which may or may not respectcembedded color profiles, like PDF printing does on Windows.