Currently, using the Wine supplied print dialog, printing to a file results in a file named "FILE:". In Windows (at least Win2k) a simple one line dialog box is put up where the filename can be typed in. I don't see a reason why a full Save As dialog would not be preferable; some programs override the standard dialog with a full Save As dialog.
It looks to me like the correct place to do this is in gdi/printdrv.c CreateSpoolFile(). So I have tried adding the attached patch to the function to play with, adding comdlg32 to the libraries in the makefile. But the call to GetSaveFileNameW(&ofn) crashes. I guess the first question is whether it is ok to call that from printdrv. And if so, is there an example of how to do it correctly?
Duane Clark wrote:
Currently, using the Wine supplied print dialog, printing to a file results in a file named "FILE:".
Yes, that's bug # 3975
It looks to me like the correct place to do this is in gdi/printdrv.c CreateSpoolFile().
Using dlls/gdi/printdrv.c for Printing is the old win3.1 - Style.
We should not duplicate the code from winspool.drv in gdi, but should call winspool.drv for all print-related functions.
The Magic for "FILE:" is already in dlls/winspool.drv/info.c in StartDocDlgA / StartDocDlgW
Thanks for looking at printing in wine.
My direction to fix printing in wine is from low-level to high-level. Print-Monitors are already managed in git-HEAD, and they are loaded and used in my tree (Port-Functions). Afterwards, the Printer-Functions will be updated and then "gdi.exe" (16-Bit) is no longer required for printing.
Detlef Riekenberg wrote:
My direction to fix printing in wine is from low-level to high-level. Print-Monitors are already managed in git-HEAD, and they are loaded and used in my tree (Port-Functions). Afterwards, the Printer-Functions will be updated and then "gdi.exe" (16-Bit) is no longer required for printing.
Ok, I'll leave this part alone for awhile then.
Duane Clark wrote:
Detlef Riekenberg wrote:
My direction to fix printing in wine is from low-level to high-level. Print-Monitors are already managed in git-HEAD, and they are loaded and used in my tree (Port-Functions). Afterwards, the Printer-Functions will be updated and then "gdi.exe" (16-Bit) is no longer required for printing.
Ok, I'll leave this part alone for awhile then.
No need to leave alone. You are very Welcome to Help.
Updating the current Dialog in winspool.drv might be an Idea or find the locations, where gdi.exe / gdi32.dll should call winspool.drv and what need to be fixed to get that part working.
Another big Part is the w2k - Printing-Dialog (comdlg32.dll,PrintDlgEx).
I send a proposed Patch to wine-devel, that uses the Monitors to manage the Ports: http://www.winehq.org/pipermail/wine-devel/2006-July/049895.html
Feel free to test and comment.
Thanks for your Help about Printing in wine.