sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: #include "E32Std.h"
sl@0: #include "E32Cons.h"
sl@0: 
sl@0: #include "dummy.h"
sl@0: 
sl@0: CDummyDevice::CDummyDevice()
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: EXPORT_C CDummyDevice* CDummyDevice::NewL()
sl@0: 	{
sl@0: 	CDummyDevice* device=new(ELeave) CDummyDevice;
sl@0: 	device->iConsole=(CConsoleBase*)NewConsole();
sl@0: 	return device;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C CDummyDevice::~CDummyDevice()
sl@0: 	{
sl@0: 	delete iConsole;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::HorizontalTwipsToPixels(TInt aTwips) const
sl@0: 	{
sl@0: 	return aTwips;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::VerticalTwipsToPixels(TInt aTwips) const
sl@0: 	{
sl@0: 	return aTwips;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::HorizontalPixelsToTwips(TInt aPixels) const
sl@0: 	{
sl@0: 	return aPixels;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::VerticalPixelsToTwips(TInt aPixels) const
sl@0: 	{
sl@0: 	return aPixels;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::GetNearestFontInTwips(CFont*& /*aFont*/,const TFontSpec& /*aFontSpec*/)
sl@0: 	{
sl@0: 	return KErrNone;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::GetNearestFontToDesignHeightInTwips(CFont*& /*aFont*/,const TFontSpec& /*aFontSpec*/)
sl@0: 	{
sl@0: 	return KErrNone;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyDevice::ReleaseFont(CFont* /*aFont*/)
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TDisplayMode CDummyDevice::DisplayMode() const
sl@0: 	{
sl@0: 	return EGray2;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TSize CDummyDevice::SizeInPixels() const
sl@0: 	{
sl@0: 	return TSize(1000,1000);
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TSize CDummyDevice::SizeInTwips() const
sl@0: 	{
sl@0: 	return TSize(1000,1000);
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::CreateContext(CGraphicsContext*& aGC)
sl@0: 	{
sl@0: 	TInt ret;
sl@0: 	CDummyGc* gc = new CDummyGc(this);
sl@0: 	if (!gc)
sl@0: 		ret=KErrNoMemory;
sl@0: 	else
sl@0: 		{
sl@0: 		aGC=gc;
sl@0: 		ret=KErrNone;
sl@0: 		} 
sl@0: 	return ret;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::NumTypefaces() const
sl@0: 	{
sl@0: 	return 0;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyDevice::TypefaceSupport(TTypefaceSupport& /*aTypefaceSupport*/,TInt /*aTypefaceIndex*/) const
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::FontHeightInTwips(TInt /*aTypefaceIndex*/,TInt /*aHeightIndex*/) const
sl@0: 	{
sl@0: 	return 0;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyDevice::PaletteAttributes(TBool& /*aModifiable*/,TInt& /*aNumEntries*/) const
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyDevice::SetPalette(CPalette* /*aPalette*/)
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyDevice::GetPalette(CPalette*& /*aPalette*/) const
sl@0: 	{
sl@0: 	return 0;
sl@0: 	}
sl@0: 	 
sl@0: EXPORT_C CDummyGc::CDummyGc(CDummyDevice* aDevice):
sl@0: 	iDevice(aDevice)
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: EXPORT_C CDummyGc::~CDummyGc()
sl@0: 	{
sl@0: 	iDevice->iConsole->Getch();
sl@0: 	}
sl@0: 
sl@0: EXPORT_C CGraphicsDevice* CDummyGc::Device() const
sl@0: 	{
sl@0: 	return iDevice;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetOrigin(const TPoint& /*aPos*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetOrigin\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetDrawMode(TDrawMode /*aDrawingMode*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetDrawMode\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetClippingRect(const TRect& /*aRect*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetClippingRect\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::CancelClippingRect()
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("CancelClippingRect\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::Reset()
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("Reset\n"));
sl@0: 	}
sl@0: 
sl@0: 
sl@0: EXPORT_C void CDummyGc::UseFont(const CFont* /*aFont*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("UseFont\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DiscardFont()
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DiscardFont\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetUnderlineStyle(TFontUnderline /*aUnderlineStyle*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetUnderlineStyle\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetStrikethroughStyle(TFontStrikethrough /*aStrikethroughStyle*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetStrikethroughStyle\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetWordJustification(TInt /*aExcessWidth*/,TInt /*aNumGaps*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetWordJustification\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetCharJustification(TInt /*aExcessWidth*/,TInt /*aNumChars*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetCharJustification\n"));
sl@0: 	}
sl@0: 
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetPenColor(const TRgb& /*aColor*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetPenColor\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetPenStyle(TPenStyle /*aPenStyle*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetPenStyle\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetPenSize(const TSize& /*aSize*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetPenSize\n"));
sl@0: 	}
sl@0: 
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetBrushColor(const TRgb& /*aColor*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetBrushColor\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetBrushStyle(TBrushStyle /*aBrushStyle*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetBrushStyle\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::SetBrushOrigin(const TPoint& /*aOrigin*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetBrushOrigin\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::UseBrushPattern(const CFbsBitmap* /*aBitmap*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("SetBrushPattern\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DiscardBrushPattern()
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DiscardBrushPattern\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::MoveTo(const TPoint& /*aPoint*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("MoveTo\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::MoveBy(const TPoint& /*aVector*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("MoveBy\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::Plot(const TPoint& /*aPoint*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("Plot\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawArc(const TRect& /*aRect*/,const TPoint& /*aStart*/,const TPoint& /*aEnd*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawArc\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawLine(const TPoint& /*aPoint1*/,const TPoint& /*aPoint2*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawLine\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawLineTo(const TPoint& /*aPoint*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawLineTo\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawLineBy(const TPoint& /*aVector*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawLineBy\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawPolyLine(const CArrayFix<TPoint>* /*aPointList*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawPolyLine\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawPolyLine(const TPoint* /*aPointList*/,TInt /*aNumPoints*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawPolyLine\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawPie(const TRect& /*aRect*/,const TPoint& /*aStart*/,const TPoint& /*aEnd*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawPie\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawEllipse(const TRect& /*aRect*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawEllipse\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawRect(const TRect& /*aRect*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawRect\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawRoundRect(const TRect& /*aRect*/,const TSize& /*aCornerSize*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawRoundRect\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyGc::DrawPolygon(const CArrayFix<TPoint>* /*aPointList*/,TFillRule /*aFillRule*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawPolygon\n"));
sl@0: 	return KErrNone;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C TInt CDummyGc::DrawPolygon(const TPoint* /*aPointList*/,TInt /*aNumPoints*/,TFillRule /*aFillRule*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawPolygon\n"));
sl@0: 	return KErrNone;
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawBitmap(const TPoint& /*aTopLeft*/,const CFbsBitmap* /*aSource*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawBitmap\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawBitmap(const TRect& /*aDestRect*/,const CFbsBitmap* /*aSource*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawBitmap\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawBitmap(const TRect& /*aDestRect*/,const CFbsBitmap* /*aSource*/,const TRect& /*aSourceRect*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawBitmap\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawText(const TDesC& /*aString*/,const TPoint& /*aPosition*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawText\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawText(const TDesC& /*aString*/,const TRect& /*aBox*/,TInt /*aBaselineOffset*/,TTextAlign /*aHoriz*/,TInt /*aLeftMrg*/)
sl@0: 	{
sl@0: 	iDevice->iConsole->Printf(_L("DrawText\n"));
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawBitmapMasked(const TRect& /*aDestRect*/,const CFbsBitmap* /*aBitmap*/,const TRect& /*aSourceRect*/,const CFbsBitmap* /*aMaskBitmap*/,TBool /*aInvertMask*/)
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: EXPORT_C void CDummyGc::DrawBitmapMasked(const TRect& /*aDestRect*/,const CWsBitmap* /*aBitmap*/,const TRect& /*aSourceRect*/,const CWsBitmap* /*aMaskBitmap*/,TBool /*aInvertMask*/)
sl@0: 	{
sl@0: 	}