Massimo Del Fedele wrote:
Steven Edwards ha scritto:
On Wed, Nov 12, 2008 at 12:51 PM, Massimo Del Fedele max@veneto.com wrote:
The best way would be, of course, replace ALL LPR code with direct cups calls. It's feasible, but it requires some refactoring of all printing code. For example, what's now exec("|lpr -P myPrinter") which I replaced with exec("|lpr -P myPrinter -o myPaperSize") should become CupsCreateJob(....) CupsStartDocument(....) CupsWriteRequestData(....) CupsFinishDocument(....)
That would require some amount of work and, over all, I'm not sure it could be accepted to go into wine code.
You should check if cups is present at compile time (which I guess we already do) and then dlopen the cups libraries if present (again I assume we already do this) and yes use the cups api if possible rather than directly invoking lpr.
So, replace ALL existing execs to lpr with direct cups calls ? Mixing them for a single print job is not possible, AFAIK.
The correct way is to fix winspool and friends to use schedule_cups() which in turn uses cupsPrintFile(). Detlef could probably comment on how far away we are from using this.
Huw.