is docShell.setZoom not supported by XULRunner? [message #488727] |
Tue, 29 September 2009 19:13  |
Eclipse User |
|
|
|
Hi,
browser = new Browser(shell, SWT.MOZILLA);
nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser();
nsIInterfaceRequestor requestor = (nsIInterfaceRequestor)webBrowser.queryInterface(nsIInterfac eRequestor.NS_IINTERFACEREQUESTOR_IID);
nsIDocShell docShell = (nsIDocShell)requestor.getInterface(nsIDocShell.NS_IDOCSHELL _IID);
docShell.setZoom(1.0f);
returns an error
org.mozilla.xpcom.XPCOMException: The function "zoom" returned an error condition (0x80004001)
at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Na tive Method)
at org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaPr oxy.java:143)
at $Proxy21.setZoom(Unknown Source)
Des this mean XULRunner doesn't support setZoom ??
javadoc says
Set/Get the document scale factor. When setting this attribute, a NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations not supporting zoom
Using XULRunner 1.9.1.3 on windows 32 bit
Cheers,
Ryan
|
|
|
Re: is docShell.setZoom not supported by XULRunner? [message #488868 is a reply to message #488727] |
Wed, 30 September 2009 10:37  |
Eclipse User |
|
|
|
Hi Ryan,
0x80004001 is NS_ERROR_NOT_IMPLEMENTED. Once you have the nsIDocShell you
need to do:
nsIContentViewer contentView = docShell.getContentViewer();
nsIMarkupDocumentViewer docView =
(nsIMarkupDocumentViewer)contentView.queryInterface(nsIMarku pDocumentViewer.
NS_IMARKUPDOCUMENTVIEWER_IID);
docView.setFullZoom(2);
This has been asked before, so I'll probably make a permanent snippet for
it. Also, since it's functionality you're interested in, you may want to CC
yourself to https://bugs.eclipse.org/bugs/show_bug.cgi?id=160620 in case it
becomes API in the future.
Grant
"Ryan" <ryan_swt@itheroes.com.au> wrote in message
news:h9u4a8$l0u$1@build.eclipse.org...
> Hi,
>
> browser = new Browser(shell, SWT.MOZILLA);
> nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser();
> nsIInterfaceRequestor requestor =
(nsIInterfaceRequestor)webBrowser.queryInterface(nsIInterfac
eRequestor.NS_IINTERFACEREQUESTOR_IID);
> nsIDocShell docShell =
(nsIDocShell)requestor.getInterface(nsIDocShell.NS_IDOCSHELL _IID);
> docShell.setZoom(1.0f);
>
> returns an error
>
> org.mozilla.xpcom.XPCOMException: The function "zoom" returned an error
condition (0x80004001)
> at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Na tive
Method)
> at org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaPr
oxy.java:143)
> at $Proxy21.setZoom(Unknown Source)
>
>
> Des this mean XULRunner doesn't support setZoom ??
>
> javadoc says
>
> Set/Get the document scale factor. When setting this attribute, a
NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations not
supporting zoom
>
> Using XULRunner 1.9.1.3 on windows 32 bit
>
> Cheers,
>
> Ryan
|
|
|
Powered by
FUDForum. Page generated in 0.03998 seconds