r=mkaply, a=blizzard
Change initialization of widget resources to we can embed


git-svn-id: svn://10.0.0.236/trunk@90182 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com
2001-03-23 03:19:06 +00:00
parent 3ddc369197
commit 33007e25ed
13 changed files with 211 additions and 109 deletions

View File

@@ -54,8 +54,12 @@
#define KBD_CTRL KBD_CONTROL
#endif
NS_IMPL_ISUPPORTS(nsWidgetModuleData, NS_GET_IID(nsISupports))
nsWidgetModuleData::nsWidgetModuleData()
{}
{
hModResources = NULLHANDLE;
}
// This is called when the first appshell is created.
void nsWidgetModuleData::Init( nsIAppShell *aPrimaevalAppShell)
@@ -98,8 +102,10 @@ void nsWidgetModuleData::Init( nsIAppShell *aPrimaevalAppShell)
// NS_ADDREF(dragService);
// keep a ref beyond the client app so we shut ourselves down properly.
// don't do this for embedding where the appshell pointer is nsnull
appshell = aPrimaevalAppShell;
NS_ADDREF(appshell);
if (appshell != nsnull)
NS_ADDREF(appshell);
converter = 0;
supplantConverter = FALSE;
@@ -135,7 +141,9 @@ nsWidgetModuleData::~nsWidgetModuleData()
// finally shut down the appshell. No more PM.
// (hope that gfxos2 has gone first!)
NS_IF_RELEASE(appshell);
// don't do this if appshell is nsnull for embedding
if (appshell != nsnull)
NS_IF_RELEASE(appshell);
}
HPOINTER nsWidgetModuleData::GetPointer( nsCursor aCursor)
@@ -525,5 +533,4 @@ int nsWidgetModuleData::WideCharToMultiByte( int CodePage, const PRUnichar *pTex
return ulSize - cplen;
}
nsWidgetModuleData gModuleData;
nsWidgetModuleData *gModuleData = nsnull;