added init() method to prescontext.

creator of prescontext is responsible for initializing pres context.
devicecontext is now init()ed with a nsNativeWidget.
removed hacky X Display stuff from device context and font metrics.
removed hacky code from windows font metrics.
changed nsNativeWindow to be nsNativeWidget.
added more code for compositor back-to-front pass.
improved text performance on X.
changed nsHTMLTagContent.cpp so that it will build with MSVC 4.1.


git-svn-id: svn://10.0.0.236/trunk@4472 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
michaelp
1998-06-25 04:24:45 +00:00
parent d68195318d
commit c0d17b54f9
64 changed files with 404 additions and 271 deletions

View File

@@ -420,6 +420,19 @@ GeometryTest::GeometryTest(BasicTest *aDoc)
#endif
nsIDeviceContext *dx;
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
static NS_DEFINE_IID(kDeviceContextIID, NS_IDEVICE_CONTEXT_IID);
nsresult rv = NSRepository::CreateInstance(kDeviceContextCID, nsnull, kDeviceContextIID, (void **)&dx);
if (NS_OK == rv) {
dx->Init(nsnull);
dx->SetDevUnitsToAppUnits(dx->GetDevUnitsToTwips());
dx->SetAppUnitsToDevUnits(dx->GetTwipsToDevUnits());
}
nsIPresContext * pc = nsnull;
nsresult status = NS_NewGalleyContext(&pc);
if ((NS_FAILED(status)) || nsnull==pc)
@@ -428,6 +441,8 @@ GeometryTest::GeometryTest(BasicTest *aDoc)
NS_ASSERTION(PR_FALSE, "bad galley pc");
}
pc->Init(dx);
// create a view manager
nsIViewManager * vm = nsnull;
@@ -501,6 +516,7 @@ GeometryTest::GeometryTest(BasicTest *aDoc)
fprintf(out, "bad paginated pc");
NS_ASSERTION(PR_FALSE, "");
}
pc->Init(dx);
aDoc->CreateCorrectContent(rows, cols);
CreateGeometry(aDoc, pc);
VerifyGeometry(aDoc, pc);