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