NS_IMETHODIMP nsThebesDeviceContext::GetRect(nsRect &aRect) { if (mPrintingSurface) { // we have a printer device aRect.x = 0; aRect.y = 0; aRect.width = mWidth; aRect.height = mHeight; } else ComputeFullAreaUsingScreen ( &aRect ); return NS_OK; }
NS_IMETHODIMP nsDeviceContextOS2 :: GetRect(nsRect &aRect) { if ( mSpec ) { // we have a printer device aRect.x = 0; aRect.y = 0; aRect.width = NSToIntRound(mWidth * mDevUnitsToAppUnits); aRect.height = NSToIntRound(mHeight * mDevUnitsToAppUnits); } else ComputeFullAreaUsingScreen ( &aRect ); return NS_OK; }
NS_IMETHODIMP nsThebesDeviceContext::GetDeviceSurfaceDimensions(nscoord &aWidth, nscoord &aHeight) { if (mPrintingSurface) { // we have a printer device aWidth = mWidth; aHeight = mHeight; } else { nsRect area; ComputeFullAreaUsingScreen(&area); aWidth = area.width; aHeight = area.height; } return NS_OK; }
NS_IMETHODIMP nsDeviceContextOS2 :: GetDeviceSurfaceDimensions(PRInt32 &aWidth, PRInt32 &aHeight) { #ifdef NS_PRINT_PREVIEW // Defer to Alt when there is one if (mAltDC && (mUseAltDC & kUseAltDCFor_SURFACE_DIM)) return mAltDC->GetDeviceSurfaceDimensions(aWidth, aHeight); #endif if ( mSpec ) { // we have a printer device aWidth = NSToIntRound(mWidth * mDevUnitsToAppUnits); aHeight = NSToIntRound(mHeight * mDevUnitsToAppUnits); } else { nsRect area; ComputeFullAreaUsingScreen ( &area ); aWidth = area.width; aHeight = area.height; } return NS_OK; }