os/graphics/graphicsdeviceinterface/bitgdi/inc/BITSTD.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsdeviceinterface/bitgdi/inc/BITSTD.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,566 @@
     1.4 +// Copyright (c) 1997-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 +#ifndef __BITSTD_H__
    1.20 +#define __BITSTD_H__
    1.21 +
    1.22 +#include <e32std.h>
    1.23 +#include <gdi.h>
    1.24 +#include <fbs.h>
    1.25 +#include <bitbase.h>
    1.26 +
    1.27 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.28 +#include <bitgdi/bitgcextradata.h>
    1.29 +#endif
    1.30 +
    1.31 +// For use when testing the code, allows the fast blending to be disabled so back to back comparisons
    1.32 +// can done be to check either timing or exact output.
    1.33 +//#define __ALLOW_FAST_BLEND_DISABLE__
    1.34 +
    1.35 +/**
    1.36 + @publishedAll
    1.37 + @released 
    1.38 +*/
    1.39 +class CFbsBitGcFont : public CFbsFont
    1.40 +	{
    1.41 +public:
    1.42 +	IMPORT_C CFbsBitGcFont();
    1.43 +	IMPORT_C virtual ~CFbsBitGcFont();
    1.44 +	IMPORT_C CBitmapFont* Address() const;
    1.45 +	IMPORT_C TInt Duplicate(TInt aHandle);
    1.46 +	IMPORT_C void Reset();
    1.47 +	IMPORT_C void operator=(const CFbsBitGcFont& aFont);
    1.48 +protected:
    1.49 +	TBool iCopy;
    1.50 +	};
    1.51 +
    1.52 +
    1.53 +/**
    1.54 +A bitmap managed by the font and bitmap server.
    1.55 +@publishedAll
    1.56 +@released 
    1.57 +*/
    1.58 +class CFbsBitGcBitmap : public CFbsBitmap
    1.59 +
    1.60 +	{
    1.61 +public:
    1.62 +	IMPORT_C CBitwiseBitmap* Address() const;
    1.63 +	IMPORT_C void LockHeap() const;
    1.64 +	IMPORT_C void UnlockHeap() const;
    1.65 +	};
    1.66 +
    1.67 +/**
    1.68 + @publishedAll
    1.69 + @released 
    1.70 +*/
    1.71 +class TEllipse
    1.72 +	{
    1.73 +public:
    1.74 +	/**	
    1.75 +	Enumeration for the ellipse production life cycle
    1.76 +	*/
    1.77 +	enum TEllipseStatus
    1.78 +		{
    1.79 +		/**
    1.80 +		Ellipse has been initialised but has no area
    1.81 +		*/
    1.82 +		EInitialised,
    1.83 +		/**
    1.84 +		The ellipse is drawn as two parabolas. These are in two sectors, the top and bottom
    1.85 +		half of the rectangle. The first sector means the top parabola has been produced.
    1.86 +		*/
    1.87 +		EFirstSector,
    1.88 +		/**
    1.89 +		The parabola that occupies the bottom half of the rectangle has been produced. 
    1.90 +		*/
    1.91 +		ESecondSector,
    1.92 +		/**
    1.93 +		The ellipse is complete
    1.94 +		*/
    1.95 +		EComplete,
    1.96 +		/**
    1.97 +		The ellipse has either a height or width of two units or less
    1.98 +		and so takes the appearance of a line
    1.99 +		*/
   1.100 +		ELine
   1.101 +		};
   1.102 +public:
   1.103 +	IMPORT_C void Construct(const TRect& aRect);
   1.104 +	IMPORT_C TBool SingleStep(TPoint& aTopLeft,TPoint& aTopRight,TPoint& aBottomLeft,TPoint& aBottomRight);
   1.105 +	IMPORT_C TBool NextStep(TPoint& aTopLeft,TPoint& aTopRight,TPoint& aBottomLeft,TPoint& aBottomRight);
   1.106 +	IMPORT_C TPoint Intersection(const TRect& aRect,const TPoint& aPoint);
   1.107 +protected:
   1.108 +	IMPORT_C TBool Output(TPoint& aTopLeft,TPoint& aTopRight,TPoint& aBottomLeft,TPoint& aBottomRight);
   1.109 +protected:
   1.110 +	TEllipseStatus iStatus;
   1.111 +	TInt iA;
   1.112 +	TInt iB;
   1.113 +	TInt64 iASquared;
   1.114 +	TInt64 iBSquared;
   1.115 +	TInt64 iASquBSqu;
   1.116 +	TInt iX;
   1.117 +	TInt iY;
   1.118 +	TInt iXAdj;
   1.119 +	TInt iYAdj;
   1.120 +	TPoint iOffset;
   1.121 +	TInt64 iD1;
   1.122 +	TInt64 iD2;
   1.123 +	};
   1.124 +
   1.125 +/**
   1.126 + @publishedAll
   1.127 + @released 
   1.128 +*/
   1.129 +class CPolygonFiller : public CBase
   1.130 +
   1.131 +	{
   1.132 +public:
   1.133 +
   1.134 +	/**
   1.135 +	Describes how pixels are to be displayed in the polygon. aUsage should be select to
   1.136 +	one of these values before CPolygonFiller::Construct is used.
   1.137 +	*/
   1.138 +	enum TUsage
   1.139 +		{
   1.140 +		/**
   1.141 +		A request for all pixel runs in sequential order
   1.142 +		*/
   1.143 +		EGetAllPixelRunsSequentially,
   1.144 +		/**
   1.145 +		A request for all pixel runs in sequential order but only for specified lines.
   1.146 +		*/
   1.147 +		EGetPixelRunsSequentiallyForSpecifiedScanLines
   1.148 +		};
   1.149 +public:
   1.150 +	IMPORT_C CPolygonFiller();
   1.151 +	IMPORT_C ~CPolygonFiller();
   1.152 +	IMPORT_C void Construct(const CArrayFix<TPoint>* aPointArray,CGraphicsContext::TFillRule aFillRule,TUsage aUsage=EGetAllPixelRunsSequentially); // N.B. this cannot fail
   1.153 +	IMPORT_C void Construct(const TPoint* aPointList,TInt aNumPoints, CGraphicsContext::TFillRule aFillRule, TUsage aUsage=EGetAllPixelRunsSequentially); // N.B. this cannot fail
   1.154 +	IMPORT_C void Reset();
   1.155 +	IMPORT_C void GetNextPixelRun(TBool& aExists, TInt& aScanLine, TInt& aStart, TInt& aEnd);
   1.156 +	IMPORT_C void GetNextPixelRunOnSpecifiedScanLine(TBool& aExists, TInt aScanLine, TInt& aStart, TInt& aEnd);
   1.157 +private: // data-types for the fast algorithm
   1.158 +	struct SFastEdge
   1.159 +		{
   1.160 +		TInt upperVertex;
   1.161 +		TInt lowerVertex;
   1.162 +		TInt firstVertex;
   1.163 +		};
   1.164 +	struct SFastScanLineIntersection;
   1.165 +	struct SFastActiveEdge
   1.166 +		{
   1.167 +		SFastEdge* edgePtr;
   1.168 +		TLinearDDA lineGenerator;
   1.169 +		SFastScanLineIntersection* scanLineIntersectionPtr;
   1.170 +		};
   1.171 +	struct SFastScanLineIntersection
   1.172 +		{
   1.173 +		TInt firstPixel;
   1.174 +		TInt lastPixel;
   1.175 +		SFastActiveEdge* activeEdgePtr;
   1.176 +		};
   1.177 +private: // data-types for the slow algorithm
   1.178 +	struct SSlowScanLineIntersection
   1.179 +		{
   1.180 +		TInt firstPixel;
   1.181 +		TInt lastPixel;
   1.182 +		TInt firstVertexOfEdge;
   1.183 +		};
   1.184 +private: // data-types for both algorithms
   1.185 +	struct SFastData
   1.186 +		{
   1.187 +		TPoint* vertexList;
   1.188 +		SFastEdge* edgeList;
   1.189 +		SFastActiveEdge* activeEdgeList;
   1.190 +		SFastScanLineIntersection* scanLineIntersectionList;
   1.191 +		TInt numActiveEdges;
   1.192 +		TInt numScanLineIntersections;
   1.193 +		TInt nextEdgeToActivate;
   1.194 +		};
   1.195 +	struct SSlowData
   1.196 +		{
   1.197 +		enum {EStoreSize=8};
   1.198 +		TLinearDDA lineGenerator;
   1.199 +		SSlowScanLineIntersection scanLineIntersectionList[EStoreSize];
   1.200 +		TInt numIntersectionsWithSameFirstPixelPreviouslyMet;
   1.201 +		TInt numIntersectionsWithSameFirstPixelMetThisTime;
   1.202 +		TInt numScanLineIntersections;
   1.203 +		TBool scanLineComplete;
   1.204 +		TInt firstPixelOfLastIntersectionInPrevBuffer;
   1.205 +		};
   1.206 +private:
   1.207 +	void Construct(CGraphicsContext::TFillRule aFillRule,TUsage aUsage);
   1.208 +	void FastHandleVertexIntersection(TInt& aCurrentActiveEdge, TBool aIsLowerVertex);
   1.209 +	void SetFastIntersection(SFastActiveEdge& aActiveEdge, SFastScanLineIntersection& aScanLineIntersection);
   1.210 +	void SlowHandleVertexIntersection(SSlowScanLineIntersection& aScanLineIntersection, TInt& aVertexStartingCurrentEdge,TBool aIsLowerVertex);
   1.211 +	void JumpToCurrentScanLine(TLinearDDA& aLineGenerator, const TPoint& aUpper, const TPoint& aLower,TPoint& aStartPos, TPoint& aEndPos) const;
   1.212 +	const TPoint& Point(TInt aIndex);
   1.213 +private:
   1.214 +	const CArrayFix<TPoint>* iPointArray; // not owned by the class
   1.215 +	const TPoint* iPointList; // not owned by the class
   1.216 +	CGraphicsContext::TFillRule iFillRule;
   1.217 +	TBool iUseFastAlgorithm;
   1.218 +	TInt iNumVertexes;
   1.219 +	TBool iToggler; // used by EAlternate fill-rule
   1.220 +	TInt iNestingLevel; // used by EWinding fill-rule
   1.221 +	TInt iScanLineIntersection;
   1.222 +	TInt iRightMostPixelOnScanLine;
   1.223 +	TInt iFirstVertex;
   1.224 +	TBool iPolygonIsAllHorizontal;
   1.225 +	TInt iFirstScanLine;
   1.226 +	TInt iLastScanLine;
   1.227 +	TInt iCurrentScanLine;
   1.228 +	SFastData iFastData;
   1.229 +	SSlowData iSlowData;
   1.230 +private:
   1.231 +	friend class TCompareEdgesUpperY;
   1.232 +	friend class TCompareActiveEdgesFirstVertex;
   1.233 +	friend class TCompareScanLineIntersectionsFirstPixel;
   1.234 +	friend class TSwapEdges;
   1.235 +	friend class TSwapActiveEdges;
   1.236 +	friend class TSwapScanLineIntersections;
   1.237 +	};
   1.238 +
   1.239 +class CFbsDevice;
   1.240 +class CFbsDrawDevice;
   1.241 +class TOpenFontCharMetrics;
   1.242 +class CGraphicsAccelerator;
   1.243 +class CWsBitmap;
   1.244 +class MFastBlend;
   1.245 +class CFbsRasterizer;
   1.246 +class CFbsBitGcExtraData;
   1.247 +
   1.248 +/** 
   1.249 +Concrete implementation of a bitmapped graphics context.
   1.250 +
   1.251 +The class provides new functionality, and implementations of the pure virtual 
   1.252 +functions defined in CGraphicsContext and CBitmapContext. 
   1.253 +@publishedAll
   1.254 +@released
   1.255 +*/
   1.256 +class CFbsBitGc : public CBitmapContext
   1.257 +	{
   1.258 +public:
   1.259 +
   1.260 +
   1.261 +/** Defines possible rotation values. */
   1.262 +	enum TGraphicsOrientation
   1.263 +		{
   1.264 +	/** Normal orientation is supported. */
   1.265 +		EGraphicsOrientationNormal,
   1.266 +	/** A 90 degree rotation is supported. */
   1.267 +		EGraphicsOrientationRotated90,
   1.268 +	/** A 180 degree rotation is supported. */
   1.269 +		EGraphicsOrientationRotated180,
   1.270 +	/** A 270 degree rotation is supported. */
   1.271 +		EGraphicsOrientationRotated270
   1.272 +		};
   1.273 +public:
   1.274 +	IMPORT_C static CFbsBitGc* NewL();
   1.275 +	IMPORT_C virtual ~CFbsBitGc();
   1.276 +	IMPORT_C void Activate(CFbsDevice* aDevice);
   1.277 +	IMPORT_C void ActivateNoJustAutoUpdate(CFbsDevice* aDevice);
   1.278 +	IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitGc& aGc);
   1.279 +	IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitGc& aGc,const TRect& aSourceRect);
   1.280 +	IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitmap* aBitmap);
   1.281 +	IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect);
   1.282 +	IMPORT_C void BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
   1.283 +	IMPORT_C void CancelClipping();
   1.284 +	IMPORT_C void CancelClippingRect();
   1.285 +	IMPORT_C void CancelClippingRegion();
   1.286 +	IMPORT_C void Clear();
   1.287 +	IMPORT_C void Clear(const TRect& aRect);
   1.288 +	IMPORT_C void CopyRect(const TPoint& aOffset,const TRect& aRect);
   1.289 +	IMPORT_C void CopySettings(const CFbsBitGc& aGc);
   1.290 +	IMPORT_C CGraphicsDevice* Device() const;
   1.291 +	IMPORT_C void DiscardBrushPattern();
   1.292 +	IMPORT_C void DiscardFont();
   1.293 +	IMPORT_C void DrawArc(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd);
   1.294 +	IMPORT_C void DrawPie(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd);
   1.295 +	IMPORT_C void DrawBitmap(const TPoint& aTopLeft,const CFbsBitmap* aSource);
   1.296 +	IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource);
   1.297 +	IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource,const TRect& aSourceRect);
   1.298 +	IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
   1.299 +	IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask);
   1.300 +	IMPORT_C void DrawRoundRect(const TRect& aRect,const TSize& aEllipse);
   1.301 +	IMPORT_C void DrawPolyLine(const CArrayFix<TPoint>* aPointList);
   1.302 +	IMPORT_C void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>* aPointList);
   1.303 +	IMPORT_C void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints);
   1.304 +	IMPORT_C void DrawPolyLineNoEndPoint(const TPoint* aPointList,TInt aNumPoints);
   1.305 +	IMPORT_C TInt DrawPolygon(const CArrayFix<TPoint>* aPointList,CGraphicsContext::TFillRule aFillRule=CGraphicsContext::EAlternate);
   1.306 +	IMPORT_C TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,CGraphicsContext::TFillRule aFillRule=CGraphicsContext::EAlternate);
   1.307 +	IMPORT_C void DrawEllipse(const TRect& aRect);
   1.308 +	IMPORT_C void DrawLine(const TPoint& aStart,const TPoint& aEnd);
   1.309 +	IMPORT_C void DrawLineTo(const TPoint& aPoint);
   1.310 +	IMPORT_C void DrawLineBy(const TPoint& aVector);
   1.311 +	IMPORT_C void DrawRect(const TRect& aRect);
   1.312 +	IMPORT_C void DrawText(const TDesC& aText);
   1.313 +	IMPORT_C void DrawText(const TDesC& aText,const TPoint& aPosition);
   1.314 +	IMPORT_C void DrawText(const TDesC& aText,const TRect& aBox);
   1.315 +	IMPORT_C void DrawText(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TTextAlign aHrz=ELeft,TInt aMargin=0);
   1.316 +	IMPORT_C void DrawText(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TInt aTextWidth,TTextAlign aHrz=ELeft,TInt aMargin=0);
   1.317 +	IMPORT_C void DrawTextVertical(const TDesC& aText,TBool aUp);
   1.318 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TPoint& aPosition,TBool aUp);
   1.319 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TBool aUp);
   1.320 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
   1.321 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TInt aTextWidth,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
   1.322 +	IMPORT_C void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs=2,TBool aMapForwards=ETrue);
   1.323 +	IMPORT_C void MoveTo(const TPoint& aPoint);
   1.324 +	IMPORT_C void MoveBy(const TPoint& aVector);
   1.325 +	IMPORT_C void OrientationsAvailable(TBool aOrientation[4]);
   1.326 +	IMPORT_C void Plot(const TPoint& aPoint);
   1.327 +	IMPORT_C void RectDrawnTo(TRect& aRect);
   1.328 +	IMPORT_C void Reset();
   1.329 +	IMPORT_C void Resized();
   1.330 +	IMPORT_C void SetBrushColor(const TRgb& aColor);
   1.331 +	IMPORT_C void SetBrushOrigin(const TPoint& aOrigin);
   1.332 +	IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle);
   1.333 +	IMPORT_C void SetClippingRegion(const TRegion* aRegion);
   1.334 +	IMPORT_C void SetClippingRect(const TRect& aRect);
   1.335 +	IMPORT_C void SetDitherOrigin(const TPoint& aPoint);
   1.336 +	IMPORT_C void SetDrawMode(TDrawMode);
   1.337 +	IMPORT_C void SetOrigin(const TPoint& aPoint=TPoint(0,0));
   1.338 +	IMPORT_C void SetPenColor(const TRgb& aColor);
   1.339 +	IMPORT_C void SetPenStyle(TPenStyle);
   1.340 +	IMPORT_C void SetPenSize(const TSize& aSize);
   1.341 +	IMPORT_C void SetCharJustification(TInt aExcessWidth,TInt aNumGaps);
   1.342 +	IMPORT_C void SetWordJustification(TInt aExcessWidth,TInt aNumChars);
   1.343 +	IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
   1.344 +	IMPORT_C void SetUserDisplayMode(TDisplayMode aDisplayMode);
   1.345 +	IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
   1.346 +	IMPORT_C void SetShadowMode(TBool aShadowMode = EFalse);
   1.347 +	inline void SetFadeMode(TBool aFadeMode = EFalse);			//Deprecated
   1.348 +	inline void SetFadingParameters(TUint8 aBlackMap = 0);		//Deprecated
   1.349 +	IMPORT_C void SetFaded(TBool aFaded);		//Virtual from CBitmapContext
   1.350 +	IMPORT_C void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);	//Virtual from CBitmapContext
   1.351 +	IMPORT_C TBool SetOrientation(TGraphicsOrientation aOrientation);
   1.352 +	IMPORT_C void ShadowArea(const TRegion* aRegion);
   1.353 +	IMPORT_C void FadeArea(const TRegion* aRegion);
   1.354 +	IMPORT_C void UpdateJustification(const TDesC& aText);
   1.355 +	IMPORT_C void UpdateJustificationVertical(const TDesC& aText,TBool aUp);
   1.356 +	IMPORT_C void UseBrushPattern(const CFbsBitmap* aBitmap);
   1.357 +	IMPORT_C TInt UseBrushPattern(TInt aFbsBitmapHandle);
   1.358 +	IMPORT_C void UseFont(const CFont* aFont);
   1.359 +	IMPORT_C TInt UseFont(TInt aFontHandle);
   1.360 +	IMPORT_C void UseFontNoDuplicate(const CFbsBitGcFont* aFont);
   1.361 +	IMPORT_C TBool IsBrushPatternUsed() const;
   1.362 +	IMPORT_C TBool IsFontUsed() const;
   1.363 +	inline static TInt16 Load16(const TUint8* aPtr) { return TInt16(aPtr[0]+(aPtr[1]<<8)); }
   1.364 +	IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt,
   1.365 +									const CFbsBitmap* aSrcBmp1,
   1.366 +									const CFbsBitmap* aSrcBmp2,
   1.367 +									const TRect& aSrcRect1,
   1.368 +									const TPoint& aSrcPt2,
   1.369 +									const CFbsBitmap* aAlphaBmp,
   1.370 +									const TPoint& aAlphaPt);
   1.371 +	IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt,
   1.372 +									const CFbsBitmap* aSrcBmp,
   1.373 +									const TRect& aSrcRect,
   1.374 +									const CFbsBitmap* aAlphaBmp,
   1.375 +									const TPoint& aAlphaPt);
   1.376 +	IMPORT_C void ExternalizeL(RWriteStream& aWriteStream);
   1.377 +	IMPORT_C void InternalizeL(RReadStream& aReadStream);
   1.378 +	IMPORT_C TInt SetClippingRegion(const TRegion& aRegion);
   1.379 +
   1.380 +	IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt,
   1.381 +											const CWsBitmap* aSrcBmp,
   1.382 +											const TRect& aSrcRect,
   1.383 +											const CWsBitmap* aAlphaBmp,
   1.384 +											const TPoint& aAlphaPt);
   1.385 +	IMPORT_C TRgb BrushColor();
   1.386 +	IMPORT_C TRgb PenColor();	
   1.387 +	IMPORT_C void ChangeDevice(CFbsDevice* aDevice);
   1.388 +	// New DrawText API's that take in extra paramemters such as context. Extensible.
   1.389 +	IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam);
   1.390 +	IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition);
   1.391 +	IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox);
   1.392 +	IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TTextAlign aHrz=ELeft,TInt aMargin=0);
   1.393 +	IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TInt aTextWidth,TTextAlign aHrz=ELeft,TInt aMargin=0);
   1.394 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp);
   1.395 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition,TBool aUp);
   1.396 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TBool aUp);
   1.397 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
   1.398 +	IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TInt aTextWidth,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
   1.399 +	IMPORT_C void UpdateJustification(const TDesC& aText,const TTextParameters* aParam);
   1.400 +	IMPORT_C void UpdateJustificationVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp);
   1.401 +private:
   1.402 +	CFbsBitGc();
   1.403 +	void AddRect(const TRect& aRect);
   1.404 +	TBool AnalyseEllipse(const TRect& rc, TPoint& srad, TPoint& erad, TInt& startq, TInt& endq, TBool* quads);
   1.405 +	void BitMultiply(TUint32* aBinaryDataPtr,TInt aBitLength,TInt aMultiplier);
   1.406 +	void CheckDevice() const;
   1.407 +	TBool CheckDevice(const TRect& aRect) const;
   1.408 +	TUint32* ClipBinaryArray(TUint32* aArray,TUint32* aArrayLimit,TInt aArrayWordWd,TInt& aDataWd,TInt& aDataHt,TPoint& aPos);
   1.409 +	void ClipFillLine(TPoint,TPoint);
   1.410 +	void CopyCharWord(TUint32* aBinaryDataPtr,const TUint8* aData,TInt aBitShift);
   1.411 +	void CopyCharLine(TUint32* aBinaryDataPtr,TInt aBufferWords,const TUint8* aData,TInt aBitShift,TInt aCharWidth);
   1.412 +	void DrawText(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition,TTextAlign aAlignment,
   1.413 +				  CFont::TTextDirection aDirection,const TRect* aBox = NULL);
   1.414 +	void DoBitBlt(const TPoint& aDest,CFbsDevice* aDevice,const TRect& aSourceRect);
   1.415 +	void DoBitBlt(const TPoint& aDest,CBitwiseBitmap* aBitmap,TUint32* aBase,TInt aStride,const TRect& aSourceRect);
   1.416 +	void DoBitBltMasked(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode);
   1.417 +	void DoBitBltMaskedFlicker(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode);
   1.418 +	void DoBitBltMaskedNonFlicker(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode);
   1.419 +	void DoBitBltMaskedNonFlickerSolid(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode);
   1.420 +	void DoBitBltMaskedNonFlickerPatterned(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode);
   1.421 +	void DoBitBltAlpha(const TPoint& aDest, CBitwiseBitmap* aSourceBitmap,
   1.422 +					   TUint32* aSourceBase, const TRect& aSourceRect,
   1.423 +					   CBitwiseBitmap* aMaskBitmap, TUint32* aMaskBase,
   1.424 +					   const TPoint& aAlphaPoint, TInt aShadowMode, TBool aInvertMask);
   1.425 +	void DoBitBltAlpha(const TPoint& aDestPt,
   1.426 +					   const CBitwiseBitmap* aSrcBmp1,
   1.427 +					   TUint32* aSrcBmpDataAddr1,
   1.428 +					   const CBitwiseBitmap* aSrcBmp2,
   1.429 +					   TUint32* aSrcBmpDataAddr2,
   1.430 +					   const CBitwiseBitmap* aAlphaBmp,
   1.431 +					   TUint32* aAlphaBmpDataAddr,
   1.432 +					   const TRect& aSrcRect1,
   1.433 +					   const TPoint& aSrcPt2,
   1.434 +					   const TPoint& aAlphaPt,
   1.435 +					   TInt aShadowMode);
   1.436 +	void DoCopyRect(const TPoint&,const TRect&);
   1.437 +	void DoDrawBitmap(const TRect&,CBitwiseBitmap*,TUint32* aBase,TInt aStride,const TRect&,const TPoint& aDitherOrigin);
   1.438 +	void DoDrawBitmapMasked(const TRect& aDestRect,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin);
   1.439 +	void DoDrawLine(TPoint aStart,TPoint aEnd,TBool aDrawStartPoint);
   1.440 +	void DoDrawDottedWideLine(const TPoint& pt1,const TPoint& pt2,TBool drawstart,const TRect& screenrect);
   1.441 +	void DoDrawSolidWideLine(const TPoint& pt1,const TPoint& pt2,TBool drawstart,const TRect& screenrect);
   1.442 +	void DoDrawText(CFont::TPositionParam& aParam,const TInt aEnd);
   1.443 +	void DoDrawCharacter(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData);
   1.444 +	void DoDrawTextEx(CFont::TPositionParam& aParam,const CBitmapFont* font,const TInt aEnd, const TInt aUnderlineStrikethroughOffset);
   1.445 +	void DoDrawCharacterEx(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData,
   1.446 +		TBool aBold,TBool aItalic,TInt aSemiAscent);
   1.447 +	void DoDrawCharacterAntiAliased(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData, const TGlyphBitmapType aGlyphType);
   1.448 +	void DoDrawTextLarge(CFont::TPositionParam& aParam,const CBitmapFont* font,const TInt aEnd);
   1.449 +	void DoDrawCharacterLarge(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData,
   1.450 +		TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthFactor,TInt aHeightFactor);
   1.451 +	void DoDrawCharacterExLarge(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData,
   1.452 +		TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthFactor,TInt aHeightFactor);
   1.453 +	void DoDrawCharacterMultiplied(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData,
   1.454 +		TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthMultiplier,TInt aHeightMultiplier);
   1.455 +	void DoDrawTextVertical(CFont::TPositionParam& aParam,const CBitmapFont* font,TBool aUp,const TInt aEnd);
   1.456 +	void DoDrawCharacterVertical(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData,
   1.457 +		TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthFactor,TInt aHeightFactor,TBool aUp);
   1.458 +	void DoDrawCharacterVerticalAntiAliased(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData,TBool aUp, TGlyphBitmapType aGlyphBitmapType);
   1.459 +	void DoPlot(const TPoint& pt);
   1.460 +	void EllipseFill(const TRect& aRect);
   1.461 +	void EllipseOutline(const TRect& aRect);
   1.462 +	void EllipseOutlineWide(const TRect& aRect);
   1.463 +	void GetStrikethroughMetrics(TInt& aTop,TInt& aBottom);
   1.464 +	void OutputCharLine(TPoint aPrintPos,TUint32* aBuffer,TInt aDataLength,TInt aNum,TBool aBold,TInt aWidthFactor,TInt aHeightFactor);
   1.465 +	void OutputCharLineMultiplied(TPoint aPrintPos,TUint32* aBuffer,TInt aDataLength,TInt aNum,TBool aBold,TInt aWidthMultiplier,TInt aHeightMultiplier);
   1.466 +	void OutputCharLineVertical(TPoint aPrintPos,TUint32* aBuffer,TInt aDataLength,TInt aNum,TBool aBold,TInt aWidthFactor,TInt aHeightFactor,TBool aUp);
   1.467 +	void PenAllocate();
   1.468 +	void PenDrawClipped(TPoint aPoint);
   1.469 +	void PenDrawDeferred(TPoint aPoint,TInt* aArray,TInt aFirstElement);
   1.470 +	void PieArcOutline(const TRect& aRect,const TPoint& aStartRadius,const TPoint& aEndRadius,TBool aDoPie);
   1.471 +	void PieFill(const TRect& ellrect, const TPoint& aStartIntersect, const TPoint& aEndIntersect,
   1.472 +		TInt aStartQuadrant, TInt aEndQuadrant, const TBool* aQuadrants);
   1.473 +	void PieShell(const TRect& ellrect, const TPoint& startradius, const TPoint& endradius,
   1.474 +		const TBool* quads, TInt startquad, TInt endquad);
   1.475 +	void PieTriangles(TBool aInside,const TPoint& aStart,const TPoint& aEnd);
   1.476 +	void PieSliver(const TRect& ellrect,const TPoint& startradius,const TPoint& endradius,TInt quad);
   1.477 +	void PolyFill(const CArrayFix<TPoint>* aPointList,TFillRule aFillRule);
   1.478 +	void PolyFillLarge(const CArrayFix<TPoint>* aPointList,TFillRule aFillRule);
   1.479 +	void PolyFill(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule);
   1.480 +	void PolyFillLarge(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule);
   1.481 +	void PolyOutline(const CArrayFix<TPoint>* aPointList);
   1.482 +	void PolyOutline(const TPoint* aPointList,TInt aNumPoints);
   1.483 +	void RectFill(const TRect& aRect);
   1.484 +	void RoundRectFill(const TRect& aRect,TSize aSize);
   1.485 +	void RoundRectOutline(const TRect& aRect,TSize aSize);
   1.486 +	void SetupDevice() const;
   1.487 +	void ShadowFadeArea(const TRegion* aRegion,TInt8 aShadowMode);
   1.488 +	TBool UserClipRect(TRect& aRect);
   1.489 +	CGraphicsAccelerator* GraphicsAccelerator();
   1.490 +	TUint MemoryOffsetForPixelPitch(TUint aX, TDisplayMode aDisplayMode);
   1.491 +	TUint32* GetScanLineOffsetPtr(CBitwiseBitmap* aSrce, TUint32*& aSlptr, TInt aLength, TPoint aPixel,TUint32* aBase, TLineScanningPosition& aLineScanningPosition, TUint aXOffset);
   1.492 +	void APIExGetUnderlineMetrics(TAny*& aOutput);
   1.493 +	TInt APIExSetShadowColor(TAny* aShadowColor);
   1.494 +	TInt APIExGetShadowColor(TAny*& aShadowColor);
   1.495 +	TInt FastBlendInterface(const CBitwiseBitmap* aSource, const CBitwiseBitmap* aMask, MFastBlend*& aFastBlend) const;
   1.496 +	TInt APIExIsFbsBitGc(TAny*& aIsCFbsBitGc);
   1.497 +	TDisplayMode ScanLineBufferDisplayMode(CFbsDrawDevice* aDrawDevice);
   1.498 +	TInt BaselineCorrection();
   1.499 +	CFbsRasterizer* PrepareRasterizerForExtendedBitmap(const CFbsBitmap& aBitmap);
   1.500 +	CFbsRasterizer* PrepareRasterizerForExtendedBitmap(const CFbsBitmap& aBitmap, const TRect& aDestRect, const TPoint& aOffset);
   1.501 +	CFbsRasterizer* PrepareRasterizerForExtendedBitmap(const CFbsBitmap& aBitmap, const TRect& aDestRect, const TRect& aSourceRect);
   1.502 +protected:
   1.503 +	/** This function should not be used by externals but must retain the
   1.504 +	same ordinal number to maintain BC, thus is exported.*/
   1.505 +	IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
   1.506 +	
   1.507 +private:
   1.508 +	IMPORT_C void Reserved_CGraphicsContext_2();
   1.509 +
   1.510 +	IMPORT_C void Reserved_CBitmapContext_1();
   1.511 +	IMPORT_C void Reserved_CBitmapContext_2();
   1.512 +	IMPORT_C void Reserved_CBitmapContext_3();
   1.513 +	
   1.514 +	IMPORT_C virtual void Reserved_CFbsBitGc_1();	
   1.515 +	IMPORT_C virtual void Reserved_CFbsBitGc_2();	
   1.516 +	IMPORT_C virtual void Reserved_CFbsBitGc_3();	
   1.517 +	IMPORT_C virtual void Reserved_CFbsBitGc_4();	
   1.518 +	IMPORT_C virtual void Reserved_CFbsBitGc_5();	
   1.519 +	
   1.520 +private:
   1.521 +	CFbsBitGcBitmap iBrushBitmap;
   1.522 +	TBool iBrushUsed;
   1.523 +	TRgb iBrushColor;
   1.524 +	TPoint iBrushOrigin;
   1.525 +	TBrushStyle iBrushStyle;
   1.526 +	TRect iClipRect;
   1.527 +	TRegionFix<1> iDefaultRegion;
   1.528 +	const TRegion* iDefaultRegionPtr;
   1.529 +	TRect iUserClipRect;
   1.530 +	CFbsDevice* iDevice;
   1.531 +	TPoint iDitherOrigin;
   1.532 +	TInt iDotLength;
   1.533 +	TInt iDotMask;
   1.534 +	TInt iDotParam;
   1.535 +	TInt iDotDirection;
   1.536 +	TDrawMode iDrawMode;
   1.537 +	TRect iDrawnTo;
   1.538 +	CFbsBitGcFont iFont;
   1.539 +	TInt iCharJustExcess;
   1.540 +	TInt iCharJustNum;
   1.541 +	TInt iWordJustExcess;
   1.542 +	TInt iWordJustNum;
   1.543 +	TPoint iLastPrintPosition;
   1.544 +	TPoint iLinePosition;
   1.545 +	TPoint iOrigin;
   1.546 +	CFbsBitGcExtraData* iFbsBitGcExtraData;
   1.547 +	TRgb iPenColor;
   1.548 +	TPenStyle iPenStyle;
   1.549 +	TSize iPenSize;
   1.550 +	TInt8 iShadowMode;
   1.551 +	TInt8 iAutoUpdateJustification;
   1.552 +	TUint8 iFadeBlackMap;
   1.553 +	TUint8 iFadeWhiteMap;
   1.554 +	TFontStrikethrough iStrikethrough;
   1.555 +	TFontUnderline iUnderline;
   1.556 +	TDisplayMode iUserDisplayMode;
   1.557 +	RRegion iClippingRegion;
   1.558 +#if defined(__ALLOW_FAST_BLEND_DISABLE__)
   1.559 +	TBool iFastBlendDisabled;
   1.560 +#endif
   1.561 +	};
   1.562 +
   1.563 +inline void CFbsBitGc::SetFadeMode(TBool aFadeMode /*=EFalse*/)
   1.564 +	{SetFaded(aFadeMode);}
   1.565 +inline void CFbsBitGc::SetFadingParameters(TUint8 aBlackMap /*=0*/)
   1.566 +	{SetFadingParameters(aBlackMap,255);}		//255 is the value of white map when not fading
   1.567 +
   1.568 +#endif
   1.569 +