From 429e4efc2feb786d686e2e5a0c02841359980965 Mon Sep 17 00:00:00 2001 From: "duncan%be.com" Date: Thu, 1 Jul 1999 16:26:43 +0000 Subject: [PATCH] Get gfx to build under BeOS (BeOS specific changes) --- gfx/src/beos/nsDeviceContextBeOS.cpp | 29 ++++++++++++++++++++----- gfx/src/beos/nsRenderingContextBeOS.cpp | 5 +++++ gfx/src/beos/nsRenderingContextBeOS.h | 1 + 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/gfx/src/beos/nsDeviceContextBeOS.cpp b/gfx/src/beos/nsDeviceContextBeOS.cpp index 7a25bab6411..16b95018035 100644 --- a/gfx/src/beos/nsDeviceContextBeOS.cpp +++ b/gfx/src/beos/nsDeviceContextBeOS.cpp @@ -24,7 +24,8 @@ #include "nsDeviceContextBeOS.h" #include "nsGfxCIID.h" -#include "../ps/nsDeviceContextPS.h" +#include "nsGfxPSCID.h" +#include "nsIDeviceContextPS.h" #include #include @@ -235,11 +236,29 @@ NS_IMETHODIMP nsDeviceContextBeOS::GetDeviceSurfaceDimensions(PRInt32 &aWidth, P NS_IMETHODIMP nsDeviceContextBeOS::GetDeviceContextFor(nsIDeviceContextSpec *aDevice, nsIDeviceContext *&aContext) { + static NS_DEFINE_CID(kCDeviceContextPS, NS_DEVICECONTEXTPS_CID); + // Create a Postscript device context - aContext = new nsDeviceContextPS(); - ((nsDeviceContextPS *)aContext)->SetSpec(aDevice); - NS_ADDREF(aDevice); - return((nsDeviceContextPS *) aContext)->Init((nsIDeviceContext*)aContext, (nsIDeviceContext*)this); + nsresult rv; + nsIDeviceContextPS *dcps; + + rv = nsComponentManager::CreateInstance(kCDeviceContextPS, + nsnull, + nsIDeviceContextPS::GetIID(), + (void **)&dcps); + + NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't create PS Device context"); + + dcps->SetSpec(aDevice); + dcps->InitDeviceContextPS((nsIDeviceContext*)aContext, + (nsIDeviceContext*)this); + + rv = dcps->QueryInterface(nsIDeviceContext::GetIID(), + (void **)&aContext); + + NS_RELEASE(dcps); + + return rv; } NS_IMETHODIMP nsDeviceContextBeOS::BeginDocument(void) diff --git a/gfx/src/beos/nsRenderingContextBeOS.cpp b/gfx/src/beos/nsRenderingContextBeOS.cpp index 2e700b98752..7807f3ff4d3 100644 --- a/gfx/src/beos/nsRenderingContextBeOS.cpp +++ b/gfx/src/beos/nsRenderingContextBeOS.cpp @@ -1278,3 +1278,8 @@ nsRenderingContextBeOS::CopyOffScreenBits(nsDrawingSurface aSrcSurf, return NS_OK; } + +NS_IMETHODIMP nsRenderingContextBeOS::RetrieveCurrentNativeGraphicData(PRUint32 * ngd) +{ + return NS_OK; +} diff --git a/gfx/src/beos/nsRenderingContextBeOS.h b/gfx/src/beos/nsRenderingContextBeOS.h index 0c0dcee4bd2..569029e5d99 100644 --- a/gfx/src/beos/nsRenderingContextBeOS.h +++ b/gfx/src/beos/nsRenderingContextBeOS.h @@ -145,6 +145,7 @@ public: NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY, const nsRect &aDestBounds, PRUint32 aCopyFlags); + NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd); protected: virtual ~nsRenderingContextBeOS();