Re: how to get nsIPresShell interface
"Pit M." <[email protected]> Tue, 31 May 2011 06:54:58 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.embedding |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <e89d52a1-219c-4b94-b043-4166239697a8@a10g2000vbz.googlegroups.com> |
On 30 Mai, 22:58, Boris Zbarsky <[email protected]> wrote: > On 5/30/11 4:22 PM, Boris Zbarsky wrote: > > > You can also getInterface a presshell from a docshell. > > More precisely, you can just GetPresShell there. > > -Boris Hi Boris! Thank you! The following code works now to geht PresShell but how can i now render in my own DC? RenderDocument requires gfxContext, but where can I get this one? There is a gfxSurfaceType "SurfaceTypeWin32Printing" -> i think i will need this one :-) nsIInterfaceRequestor* pInterfaceRequestor = NULL; mMozView->GetInterfaceRequestor(&pInterfaceRequestor); nsPIDOMWindow* psPIDOMWindow = NULL; nsID xIDDOMWindow = NS_PIDOMWINDOW_IID; if(pInterfaceRequestor) pInterfaceRequestor->GetInterface(xIDDOMWindow, (void**)&psPIDOMWindow); if(psPIDOMWindow) { nsIDocShell* pShell = psPIDOMWindow->GetDocShell(); if(pShell) { nsIPresShell* pPresShell = NULL; pShell->GetPresShell(&pPresShell); // WORKS !!!! :-)) if(pPresShell)