os/graphics/printingservices/printerdriversupport/tps/DUMMY.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/printingservices/printerdriversupport/tps/DUMMY.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,348 @@
     1.4 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include "E32Std.h"
    1.20 +#include "E32Cons.h"
    1.21 +
    1.22 +#include "dummy.h"
    1.23 +
    1.24 +CDummyDevice::CDummyDevice()
    1.25 +	{
    1.26 +	}
    1.27 +
    1.28 +EXPORT_C CDummyDevice* CDummyDevice::NewL()
    1.29 +	{
    1.30 +	CDummyDevice* device=new(ELeave) CDummyDevice;
    1.31 +	device->iConsole=(CConsoleBase*)NewConsole();
    1.32 +	return device;
    1.33 +	}
    1.34 +
    1.35 +EXPORT_C CDummyDevice::~CDummyDevice()
    1.36 +	{
    1.37 +	delete iConsole;
    1.38 +	}
    1.39 +
    1.40 +EXPORT_C TInt CDummyDevice::HorizontalTwipsToPixels(TInt aTwips) const
    1.41 +	{
    1.42 +	return aTwips;
    1.43 +	}
    1.44 +
    1.45 +EXPORT_C TInt CDummyDevice::VerticalTwipsToPixels(TInt aTwips) const
    1.46 +	{
    1.47 +	return aTwips;
    1.48 +	}
    1.49 +
    1.50 +EXPORT_C TInt CDummyDevice::HorizontalPixelsToTwips(TInt aPixels) const
    1.51 +	{
    1.52 +	return aPixels;
    1.53 +	}
    1.54 +
    1.55 +EXPORT_C TInt CDummyDevice::VerticalPixelsToTwips(TInt aPixels) const
    1.56 +	{
    1.57 +	return aPixels;
    1.58 +	}
    1.59 +
    1.60 +EXPORT_C TInt CDummyDevice::GetNearestFontInTwips(CFont*& /*aFont*/,const TFontSpec& /*aFontSpec*/)
    1.61 +	{
    1.62 +	return KErrNone;
    1.63 +	}
    1.64 +
    1.65 +EXPORT_C TInt CDummyDevice::GetNearestFontToDesignHeightInTwips(CFont*& /*aFont*/,const TFontSpec& /*aFontSpec*/)
    1.66 +	{
    1.67 +	return KErrNone;
    1.68 +	}
    1.69 +
    1.70 +EXPORT_C void CDummyDevice::ReleaseFont(CFont* /*aFont*/)
    1.71 +	{
    1.72 +	}
    1.73 +
    1.74 +EXPORT_C TDisplayMode CDummyDevice::DisplayMode() const
    1.75 +	{
    1.76 +	return EGray2;
    1.77 +	}
    1.78 +
    1.79 +EXPORT_C TSize CDummyDevice::SizeInPixels() const
    1.80 +	{
    1.81 +	return TSize(1000,1000);
    1.82 +	}
    1.83 +
    1.84 +EXPORT_C TSize CDummyDevice::SizeInTwips() const
    1.85 +	{
    1.86 +	return TSize(1000,1000);
    1.87 +	}
    1.88 +
    1.89 +EXPORT_C TInt CDummyDevice::CreateContext(CGraphicsContext*& aGC)
    1.90 +	{
    1.91 +	TInt ret;
    1.92 +	CDummyGc* gc = new CDummyGc(this);
    1.93 +	if (!gc)
    1.94 +		ret=KErrNoMemory;
    1.95 +	else
    1.96 +		{
    1.97 +		aGC=gc;
    1.98 +		ret=KErrNone;
    1.99 +		} 
   1.100 +	return ret;
   1.101 +	}
   1.102 +
   1.103 +EXPORT_C TInt CDummyDevice::NumTypefaces() const
   1.104 +	{
   1.105 +	return 0;
   1.106 +	}
   1.107 +
   1.108 +EXPORT_C void CDummyDevice::TypefaceSupport(TTypefaceSupport& /*aTypefaceSupport*/,TInt /*aTypefaceIndex*/) const
   1.109 +	{
   1.110 +	}
   1.111 +
   1.112 +EXPORT_C TInt CDummyDevice::FontHeightInTwips(TInt /*aTypefaceIndex*/,TInt /*aHeightIndex*/) const
   1.113 +	{
   1.114 +	return 0;
   1.115 +	}
   1.116 +
   1.117 +EXPORT_C void CDummyDevice::PaletteAttributes(TBool& /*aModifiable*/,TInt& /*aNumEntries*/) const
   1.118 +	{
   1.119 +	}
   1.120 +
   1.121 +EXPORT_C void CDummyDevice::SetPalette(CPalette* /*aPalette*/)
   1.122 +	{
   1.123 +	}
   1.124 +
   1.125 +EXPORT_C TInt CDummyDevice::GetPalette(CPalette*& /*aPalette*/) const
   1.126 +	{
   1.127 +	return 0;
   1.128 +	}
   1.129 +	 
   1.130 +EXPORT_C CDummyGc::CDummyGc(CDummyDevice* aDevice):
   1.131 +	iDevice(aDevice)
   1.132 +	{
   1.133 +	}
   1.134 +
   1.135 +EXPORT_C CDummyGc::~CDummyGc()
   1.136 +	{
   1.137 +	iDevice->iConsole->Getch();
   1.138 +	}
   1.139 +
   1.140 +EXPORT_C CGraphicsDevice* CDummyGc::Device() const
   1.141 +	{
   1.142 +	return iDevice;
   1.143 +	}
   1.144 +
   1.145 +EXPORT_C void CDummyGc::SetOrigin(const TPoint& /*aPos*/)
   1.146 +	{
   1.147 +	iDevice->iConsole->Printf(_L("SetOrigin\n"));
   1.148 +	}
   1.149 +
   1.150 +EXPORT_C void CDummyGc::SetDrawMode(TDrawMode /*aDrawingMode*/)
   1.151 +	{
   1.152 +	iDevice->iConsole->Printf(_L("SetDrawMode\n"));
   1.153 +	}
   1.154 +
   1.155 +EXPORT_C void CDummyGc::SetClippingRect(const TRect& /*aRect*/)
   1.156 +	{
   1.157 +	iDevice->iConsole->Printf(_L("SetClippingRect\n"));
   1.158 +	}
   1.159 +
   1.160 +EXPORT_C void CDummyGc::CancelClippingRect()
   1.161 +	{
   1.162 +	iDevice->iConsole->Printf(_L("CancelClippingRect\n"));
   1.163 +	}
   1.164 +
   1.165 +EXPORT_C void CDummyGc::Reset()
   1.166 +	{
   1.167 +	iDevice->iConsole->Printf(_L("Reset\n"));
   1.168 +	}
   1.169 +
   1.170 +
   1.171 +EXPORT_C void CDummyGc::UseFont(const CFont* /*aFont*/)
   1.172 +	{
   1.173 +	iDevice->iConsole->Printf(_L("UseFont\n"));
   1.174 +	}
   1.175 +
   1.176 +EXPORT_C void CDummyGc::DiscardFont()
   1.177 +	{
   1.178 +	iDevice->iConsole->Printf(_L("DiscardFont\n"));
   1.179 +	}
   1.180 +
   1.181 +EXPORT_C void CDummyGc::SetUnderlineStyle(TFontUnderline /*aUnderlineStyle*/)
   1.182 +	{
   1.183 +	iDevice->iConsole->Printf(_L("SetUnderlineStyle\n"));
   1.184 +	}
   1.185 +
   1.186 +EXPORT_C void CDummyGc::SetStrikethroughStyle(TFontStrikethrough /*aStrikethroughStyle*/)
   1.187 +	{
   1.188 +	iDevice->iConsole->Printf(_L("SetStrikethroughStyle\n"));
   1.189 +	}
   1.190 +
   1.191 +EXPORT_C void CDummyGc::SetWordJustification(TInt /*aExcessWidth*/,TInt /*aNumGaps*/)
   1.192 +	{
   1.193 +	iDevice->iConsole->Printf(_L("SetWordJustification\n"));
   1.194 +	}
   1.195 +
   1.196 +EXPORT_C void CDummyGc::SetCharJustification(TInt /*aExcessWidth*/,TInt /*aNumChars*/)
   1.197 +	{
   1.198 +	iDevice->iConsole->Printf(_L("SetCharJustification\n"));
   1.199 +	}
   1.200 +
   1.201 +
   1.202 +EXPORT_C void CDummyGc::SetPenColor(const TRgb& /*aColor*/)
   1.203 +	{
   1.204 +	iDevice->iConsole->Printf(_L("SetPenColor\n"));
   1.205 +	}
   1.206 +
   1.207 +EXPORT_C void CDummyGc::SetPenStyle(TPenStyle /*aPenStyle*/)
   1.208 +	{
   1.209 +	iDevice->iConsole->Printf(_L("SetPenStyle\n"));
   1.210 +	}
   1.211 +
   1.212 +EXPORT_C void CDummyGc::SetPenSize(const TSize& /*aSize*/)
   1.213 +	{
   1.214 +	iDevice->iConsole->Printf(_L("SetPenSize\n"));
   1.215 +	}
   1.216 +
   1.217 +
   1.218 +EXPORT_C void CDummyGc::SetBrushColor(const TRgb& /*aColor*/)
   1.219 +	{
   1.220 +	iDevice->iConsole->Printf(_L("SetBrushColor\n"));
   1.221 +	}
   1.222 +
   1.223 +EXPORT_C void CDummyGc::SetBrushStyle(TBrushStyle /*aBrushStyle*/)
   1.224 +	{
   1.225 +	iDevice->iConsole->Printf(_L("SetBrushStyle\n"));
   1.226 +	}
   1.227 +
   1.228 +EXPORT_C void CDummyGc::SetBrushOrigin(const TPoint& /*aOrigin*/)
   1.229 +	{
   1.230 +	iDevice->iConsole->Printf(_L("SetBrushOrigin\n"));
   1.231 +	}
   1.232 +
   1.233 +EXPORT_C void CDummyGc::UseBrushPattern(const CFbsBitmap* /*aBitmap*/)
   1.234 +	{
   1.235 +	iDevice->iConsole->Printf(_L("SetBrushPattern\n"));
   1.236 +	}
   1.237 +
   1.238 +EXPORT_C void CDummyGc::DiscardBrushPattern()
   1.239 +	{
   1.240 +	iDevice->iConsole->Printf(_L("DiscardBrushPattern\n"));
   1.241 +	}
   1.242 +
   1.243 +EXPORT_C void CDummyGc::MoveTo(const TPoint& /*aPoint*/)
   1.244 +	{
   1.245 +	iDevice->iConsole->Printf(_L("MoveTo\n"));
   1.246 +	}
   1.247 +
   1.248 +EXPORT_C void CDummyGc::MoveBy(const TPoint& /*aVector*/)
   1.249 +	{
   1.250 +	iDevice->iConsole->Printf(_L("MoveBy\n"));
   1.251 +	}
   1.252 +
   1.253 +EXPORT_C void CDummyGc::Plot(const TPoint& /*aPoint*/)
   1.254 +	{
   1.255 +	iDevice->iConsole->Printf(_L("Plot\n"));
   1.256 +	}
   1.257 +
   1.258 +EXPORT_C void CDummyGc::DrawArc(const TRect& /*aRect*/,const TPoint& /*aStart*/,const TPoint& /*aEnd*/)
   1.259 +	{
   1.260 +	iDevice->iConsole->Printf(_L("DrawArc\n"));
   1.261 +	}
   1.262 +
   1.263 +EXPORT_C void CDummyGc::DrawLine(const TPoint& /*aPoint1*/,const TPoint& /*aPoint2*/)
   1.264 +	{
   1.265 +	iDevice->iConsole->Printf(_L("DrawLine\n"));
   1.266 +	}
   1.267 +
   1.268 +EXPORT_C void CDummyGc::DrawLineTo(const TPoint& /*aPoint*/)
   1.269 +	{
   1.270 +	iDevice->iConsole->Printf(_L("DrawLineTo\n"));
   1.271 +	}
   1.272 +
   1.273 +EXPORT_C void CDummyGc::DrawLineBy(const TPoint& /*aVector*/)
   1.274 +	{
   1.275 +	iDevice->iConsole->Printf(_L("DrawLineBy\n"));
   1.276 +	}
   1.277 +
   1.278 +EXPORT_C void CDummyGc::DrawPolyLine(const CArrayFix<TPoint>* /*aPointList*/)
   1.279 +	{
   1.280 +	iDevice->iConsole->Printf(_L("DrawPolyLine\n"));
   1.281 +	}
   1.282 +
   1.283 +EXPORT_C void CDummyGc::DrawPolyLine(const TPoint* /*aPointList*/,TInt /*aNumPoints*/)
   1.284 +	{
   1.285 +	iDevice->iConsole->Printf(_L("DrawPolyLine\n"));
   1.286 +	}
   1.287 +
   1.288 +EXPORT_C void CDummyGc::DrawPie(const TRect& /*aRect*/,const TPoint& /*aStart*/,const TPoint& /*aEnd*/)
   1.289 +	{
   1.290 +	iDevice->iConsole->Printf(_L("DrawPie\n"));
   1.291 +	}
   1.292 +
   1.293 +EXPORT_C void CDummyGc::DrawEllipse(const TRect& /*aRect*/)
   1.294 +	{
   1.295 +	iDevice->iConsole->Printf(_L("DrawEllipse\n"));
   1.296 +	}
   1.297 +
   1.298 +EXPORT_C void CDummyGc::DrawRect(const TRect& /*aRect*/)
   1.299 +	{
   1.300 +	iDevice->iConsole->Printf(_L("DrawRect\n"));
   1.301 +	}
   1.302 +
   1.303 +EXPORT_C void CDummyGc::DrawRoundRect(const TRect& /*aRect*/,const TSize& /*aCornerSize*/)
   1.304 +	{
   1.305 +	iDevice->iConsole->Printf(_L("DrawRoundRect\n"));
   1.306 +	}
   1.307 +
   1.308 +EXPORT_C TInt CDummyGc::DrawPolygon(const CArrayFix<TPoint>* /*aPointList*/,TFillRule /*aFillRule*/)
   1.309 +	{
   1.310 +	iDevice->iConsole->Printf(_L("DrawPolygon\n"));
   1.311 +	return KErrNone;
   1.312 +	}
   1.313 +
   1.314 +EXPORT_C TInt CDummyGc::DrawPolygon(const TPoint* /*aPointList*/,TInt /*aNumPoints*/,TFillRule /*aFillRule*/)
   1.315 +	{
   1.316 +	iDevice->iConsole->Printf(_L("DrawPolygon\n"));
   1.317 +	return KErrNone;
   1.318 +	}
   1.319 +
   1.320 +EXPORT_C void CDummyGc::DrawBitmap(const TPoint& /*aTopLeft*/,const CFbsBitmap* /*aSource*/)
   1.321 +	{
   1.322 +	iDevice->iConsole->Printf(_L("DrawBitmap\n"));
   1.323 +	}
   1.324 +
   1.325 +EXPORT_C void CDummyGc::DrawBitmap(const TRect& /*aDestRect*/,const CFbsBitmap* /*aSource*/)
   1.326 +	{
   1.327 +	iDevice->iConsole->Printf(_L("DrawBitmap\n"));
   1.328 +	}
   1.329 +
   1.330 +EXPORT_C void CDummyGc::DrawBitmap(const TRect& /*aDestRect*/,const CFbsBitmap* /*aSource*/,const TRect& /*aSourceRect*/)
   1.331 +	{
   1.332 +	iDevice->iConsole->Printf(_L("DrawBitmap\n"));
   1.333 +	}
   1.334 +
   1.335 +EXPORT_C void CDummyGc::DrawText(const TDesC& /*aString*/,const TPoint& /*aPosition*/)
   1.336 +	{
   1.337 +	iDevice->iConsole->Printf(_L("DrawText\n"));
   1.338 +	}
   1.339 +
   1.340 +EXPORT_C void CDummyGc::DrawText(const TDesC& /*aString*/,const TRect& /*aBox*/,TInt /*aBaselineOffset*/,TTextAlign /*aHoriz*/,TInt /*aLeftMrg*/)
   1.341 +	{
   1.342 +	iDevice->iConsole->Printf(_L("DrawText\n"));
   1.343 +	}
   1.344 +
   1.345 +EXPORT_C void CDummyGc::DrawBitmapMasked(const TRect& /*aDestRect*/,const CFbsBitmap* /*aBitmap*/,const TRect& /*aSourceRect*/,const CFbsBitmap* /*aMaskBitmap*/,TBool /*aInvertMask*/)
   1.346 +	{
   1.347 +	}
   1.348 +
   1.349 +EXPORT_C void CDummyGc::DrawBitmapMasked(const TRect& /*aDestRect*/,const CWsBitmap* /*aBitmap*/,const TRect& /*aSourceRect*/,const CWsBitmap* /*aMaskBitmap*/,TBool /*aInvertMask*/)
   1.350 +	{
   1.351 +	}