Changed throbber and web shell to not aggregate in the widget

This commit is contained in:
troy%netscape.com 1998-10-06 22:33:13 +00:00
Родитель 4358c88eeb
Коммит ce220b9056
3 изменённых файлов: 15 добавлений и 70 удалений

Просмотреть файл

@ -244,7 +244,6 @@ protected:
nsIDeviceContext* mDeviceContext;
nsIPref* mPrefs;
nsIWidget* mWindow;
nsISupports* mInnerWindow;
nsIDocumentLoader* mDocLoader;
nsIStreamObserver* mObserver;
@ -379,7 +378,7 @@ nsWebShell::~nsWebShell()
// Cancel any timers that were set for this loader.
CancelRefreshURLTimers();
NS_IF_RELEASE(mInnerWindow);
NS_IF_RELEASE(mWindow);
NS_IF_RELEASE(mContentViewer);
NS_IF_RELEASE(mDeviceContext);
@ -485,12 +484,6 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
}
#endif /* NS_DEBUG */
NS_LOCK_INSTANCE();
if (nsnull != mInnerWindow) {
rv = mInnerWindow->QueryInterface(aIID, aInstancePtr);
}
NS_UNLOCK_INSTANCE();
return rv;
}
@ -619,27 +612,15 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDeviceContext->SetGamma(1.0f);
// Create a Native window for the shell container...
rv = nsRepository::CreateInstance(kChildCID,
(nsISupports*)((nsIWebShell*)this),
kISupportsIID,
(void**)&mInnerWindow);
rv = nsRepository::CreateInstance(kChildCID, nsnull, kIWidgetIID, (void**)&mWindow);
if (NS_OK != rv) {
goto done;
}
mInnerWindow->QueryInterface(kIWidgetIID, (void**) &mWindow);
if (NS_OK != rv) {
NS_RELEASE(mInnerWindow);
}
else {
nsWidgetInitData widgetInit;
nsWidgetInitData widgetInit;
widgetInit.clipChildren = PR_FALSE;
mWindow->Create(aNativeParent, aBounds, nsWebShell::HandleEvent,
mDeviceContext, nsnull, nsnull, &widgetInit);
// Get rid of extra reference count
// XXX FIX ME...
mWindow->Release();
}
done:
return rv;

Просмотреть файл

@ -118,7 +118,6 @@ public:
PRInt32 mWidth;
PRInt32 mHeight;
nsIWidget* mWidget;
nsISupports* mInnerWidget;
nsVoidArray* mImages;
PRInt32 mNumImages;
PRInt32 mIndex;
@ -172,9 +171,6 @@ public:
NS_ADDREF_THIS();
return NS_OK;
}
if (nsnull != mInnerWidget) {
return mInnerWidget->QueryInterface(aIID, aInstancePtr);
}
return NS_NOINTERFACE;
}
@ -329,7 +325,7 @@ nsThrobber::nsThrobber(nsISupports* aOuter)
nsThrobber::~nsThrobber()
{
NS_IF_RELEASE(mInnerWidget);
NS_IF_RELEASE(mWidget);
RemoveThrobber(this);
DestroyThrobberImages();
}
@ -368,24 +364,11 @@ nsThrobber::Init(nsIWidget* aParent, const nsRect& aBounds, const nsString& aFil
mNumImages = aNumImages;
// Create widget
nsresult rv = nsRepository::CreateInstance(kChildCID,
(nsIThrobber *)this,
kISupportsIID,
(void**)&mInnerWidget);
nsresult rv = nsRepository::CreateInstance(kChildCID, nsnull, kIWidgetIID, (void**)&mWidget);
if (NS_OK != rv) {
return rv;
}
mInnerWidget->QueryInterface(kIWidgetIID, (void**) &mWidget);
if (NS_OK != rv) {
NS_RELEASE(mInnerWidget);
}
else {
// Get rid of extra reference count
// XXX FIX ME...
mWidget->Release();
mWidget->Create(aParent, aBounds, HandleThrobberEvent, NULL);
}
return LoadThrobberImages(aFileNameMask, aNumImages);
}

Просмотреть файл

@ -244,7 +244,6 @@ protected:
nsIDeviceContext* mDeviceContext;
nsIPref* mPrefs;
nsIWidget* mWindow;
nsISupports* mInnerWindow;
nsIDocumentLoader* mDocLoader;
nsIStreamObserver* mObserver;
@ -379,7 +378,7 @@ nsWebShell::~nsWebShell()
// Cancel any timers that were set for this loader.
CancelRefreshURLTimers();
NS_IF_RELEASE(mInnerWindow);
NS_IF_RELEASE(mWindow);
NS_IF_RELEASE(mContentViewer);
NS_IF_RELEASE(mDeviceContext);
@ -485,12 +484,6 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
}
#endif /* NS_DEBUG */
NS_LOCK_INSTANCE();
if (nsnull != mInnerWindow) {
rv = mInnerWindow->QueryInterface(aIID, aInstancePtr);
}
NS_UNLOCK_INSTANCE();
return rv;
}
@ -619,27 +612,15 @@ nsWebShell::Init(nsNativeWidget aNativeParent,
mDeviceContext->SetGamma(1.0f);
// Create a Native window for the shell container...
rv = nsRepository::CreateInstance(kChildCID,
(nsISupports*)((nsIWebShell*)this),
kISupportsIID,
(void**)&mInnerWindow);
rv = nsRepository::CreateInstance(kChildCID, nsnull, kIWidgetIID, (void**)&mWindow);
if (NS_OK != rv) {
goto done;
}
mInnerWindow->QueryInterface(kIWidgetIID, (void**) &mWindow);
if (NS_OK != rv) {
NS_RELEASE(mInnerWindow);
}
else {
nsWidgetInitData widgetInit;
nsWidgetInitData widgetInit;
widgetInit.clipChildren = PR_FALSE;
mWindow->Create(aNativeParent, aBounds, nsWebShell::HandleEvent,
mDeviceContext, nsnull, nsnull, &widgetInit);
// Get rid of extra reference count
// XXX FIX ME...
mWindow->Release();
}
done:
return rv;