added zooming front end.

git-svn-id: svn://10.0.0.236/trunk@27819 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
michaelp%netscape.com
1999-04-16 04:25:17 +00:00
parent b1151158bc
commit 8e8857351f
5 changed files with 134 additions and 1 deletions

View File

@@ -185,6 +185,8 @@ public:
NS_IMETHOD SetScrolling(PRInt32 aScrolling, PRBool aSetCurrentAndInitial = PR_TRUE);
NS_IMETHOD GetIsFrame(PRBool& aIsFrame);
NS_IMETHOD SetIsFrame(PRBool aIsFrame);
NS_IMETHOD SetZoom(float aZoom);
NS_IMETHOD GetZoom(float *aZoom);
// Document load api's
NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult);
@@ -365,6 +367,8 @@ protected:
nsURLReloadType aType,
const PRUint32 aLocalIP);
float mZoom;
static nsIPluginHost *mPluginHost;
static nsIPluginManager *mPluginManager;
static PRUint32 mPluginInitCnt;
@@ -1279,6 +1283,55 @@ nsWebShell::SetIsFrame(PRBool aIsFrame)
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::SetZoom(float aZoom)
{
mZoom = aZoom;
if (mDeviceContext)
mDeviceContext->SetZoom(mZoom);
if (mContentViewer) {
nsIDocumentViewer* docv = nsnull;
mContentViewer->QueryInterface(kIDocumentViewerIID, (void**) &docv);
if (nsnull != docv) {
nsIPresContext* cx = nsnull;
docv->GetPresContext(cx);
if (nsnull != cx) {
nsIPresShell *shell = nsnull;
cx->GetShell(&shell);
if (nsnull != shell) {
nsIViewManager *vm = nsnull;
shell->GetViewManager(&vm);
if (nsnull != vm) {
nsIView *rootview = nsnull;
nsIScrollableView *sv = nsnull;
vm->GetRootScrollableView(&sv);
if (nsnull != sv)
sv->ComputeScrollOffsets();
vm->GetRootView(rootview);
if (nsnull != rootview)
vm->UpdateView(rootview, nsnull, 0);
NS_RELEASE(vm);
}
NS_RELEASE(shell);
}
NS_RELEASE(cx);
}
NS_RELEASE(docv);
}
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::GetZoom(float *aZoom)
{
*aZoom = mZoom;
return NS_OK;
}
/**
* Document Load methods