[webkit-dev] Confused by spoolPages API

Brent Fulgham bfulgham at gmail.com
Tue Dec 8 14:39:08 PST 2009


I'm working on getting printing to work with my WinCairo port of
WebKit.  Following the model of the CG implementation, I was planning
on using the spoolPages method of the IWebFrame interface.

This method is declared as follows (see ~ line 191 in WebKit\win\WebFrame.h):

virtual HRESULT STDMETHODCALLTYPE spoolPages (HDC printHDC, UINT
startPage, UINT endPage, void* ctx);

The 'ctx' term appears to be a suitable graphic library context
associated with the print HDC.  I was surprised to see that this was
necessary, as you can usually convert from a device context to the
platform graphic context abstraction.  This would allow the details of
the drawing context to be internal to WebFrame.  As it is now, the
void* passed in must be created externally from the HDC which in my
case means that the Cairo library must now be linked into the main
application (which does not otherwise have any need to know about
Cairo).

Am I misunderstanding the purpose of the ctx argument?  Or could I
propose a patch to refactor this to avoid needing this final argument.

Thanks,

-Brent


More information about the webkit-dev mailing list