sl@0: // Copyright (c) 1997-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: #ifndef __BITSTD_H__ sl@0: #define __BITSTD_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: sl@0: // For use when testing the code, allows the fast blending to be disabled so back to back comparisons sl@0: // can done be to check either timing or exact output. sl@0: //#define __ALLOW_FAST_BLEND_DISABLE__ sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CFbsBitGcFont : public CFbsFont sl@0: { sl@0: public: sl@0: IMPORT_C CFbsBitGcFont(); sl@0: IMPORT_C virtual ~CFbsBitGcFont(); sl@0: IMPORT_C CBitmapFont* Address() const; sl@0: IMPORT_C TInt Duplicate(TInt aHandle); sl@0: IMPORT_C void Reset(); sl@0: IMPORT_C void operator=(const CFbsBitGcFont& aFont); sl@0: protected: sl@0: TBool iCopy; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: A bitmap managed by the font and bitmap server. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CFbsBitGcBitmap : public CFbsBitmap sl@0: sl@0: { sl@0: public: sl@0: IMPORT_C CBitwiseBitmap* Address() const; sl@0: IMPORT_C void LockHeap() const; sl@0: IMPORT_C void UnlockHeap() const; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class TEllipse sl@0: { sl@0: public: sl@0: /** sl@0: Enumeration for the ellipse production life cycle sl@0: */ sl@0: enum TEllipseStatus sl@0: { sl@0: /** sl@0: Ellipse has been initialised but has no area sl@0: */ sl@0: EInitialised, sl@0: /** sl@0: The ellipse is drawn as two parabolas. These are in two sectors, the top and bottom sl@0: half of the rectangle. The first sector means the top parabola has been produced. sl@0: */ sl@0: EFirstSector, sl@0: /** sl@0: The parabola that occupies the bottom half of the rectangle has been produced. sl@0: */ sl@0: ESecondSector, sl@0: /** sl@0: The ellipse is complete sl@0: */ sl@0: EComplete, sl@0: /** sl@0: The ellipse has either a height or width of two units or less sl@0: and so takes the appearance of a line sl@0: */ sl@0: ELine sl@0: }; sl@0: public: sl@0: IMPORT_C void Construct(const TRect& aRect); sl@0: IMPORT_C TBool SingleStep(TPoint& aTopLeft,TPoint& aTopRight,TPoint& aBottomLeft,TPoint& aBottomRight); sl@0: IMPORT_C TBool NextStep(TPoint& aTopLeft,TPoint& aTopRight,TPoint& aBottomLeft,TPoint& aBottomRight); sl@0: IMPORT_C TPoint Intersection(const TRect& aRect,const TPoint& aPoint); sl@0: protected: sl@0: IMPORT_C TBool Output(TPoint& aTopLeft,TPoint& aTopRight,TPoint& aBottomLeft,TPoint& aBottomRight); sl@0: protected: sl@0: TEllipseStatus iStatus; sl@0: TInt iA; sl@0: TInt iB; sl@0: TInt64 iASquared; sl@0: TInt64 iBSquared; sl@0: TInt64 iASquBSqu; sl@0: TInt iX; sl@0: TInt iY; sl@0: TInt iXAdj; sl@0: TInt iYAdj; sl@0: TPoint iOffset; sl@0: TInt64 iD1; sl@0: TInt64 iD2; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CPolygonFiller : public CBase sl@0: sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Describes how pixels are to be displayed in the polygon. aUsage should be select to sl@0: one of these values before CPolygonFiller::Construct is used. sl@0: */ sl@0: enum TUsage sl@0: { sl@0: /** sl@0: A request for all pixel runs in sequential order sl@0: */ sl@0: EGetAllPixelRunsSequentially, sl@0: /** sl@0: A request for all pixel runs in sequential order but only for specified lines. sl@0: */ sl@0: EGetPixelRunsSequentiallyForSpecifiedScanLines sl@0: }; sl@0: public: sl@0: IMPORT_C CPolygonFiller(); sl@0: IMPORT_C ~CPolygonFiller(); sl@0: IMPORT_C void Construct(const CArrayFix* aPointArray,CGraphicsContext::TFillRule aFillRule,TUsage aUsage=EGetAllPixelRunsSequentially); // N.B. this cannot fail sl@0: IMPORT_C void Construct(const TPoint* aPointList,TInt aNumPoints, CGraphicsContext::TFillRule aFillRule, TUsage aUsage=EGetAllPixelRunsSequentially); // N.B. this cannot fail sl@0: IMPORT_C void Reset(); sl@0: IMPORT_C void GetNextPixelRun(TBool& aExists, TInt& aScanLine, TInt& aStart, TInt& aEnd); sl@0: IMPORT_C void GetNextPixelRunOnSpecifiedScanLine(TBool& aExists, TInt aScanLine, TInt& aStart, TInt& aEnd); sl@0: private: // data-types for the fast algorithm sl@0: struct SFastEdge sl@0: { sl@0: TInt upperVertex; sl@0: TInt lowerVertex; sl@0: TInt firstVertex; sl@0: }; sl@0: struct SFastScanLineIntersection; sl@0: struct SFastActiveEdge sl@0: { sl@0: SFastEdge* edgePtr; sl@0: TLinearDDA lineGenerator; sl@0: SFastScanLineIntersection* scanLineIntersectionPtr; sl@0: }; sl@0: struct SFastScanLineIntersection sl@0: { sl@0: TInt firstPixel; sl@0: TInt lastPixel; sl@0: SFastActiveEdge* activeEdgePtr; sl@0: }; sl@0: private: // data-types for the slow algorithm sl@0: struct SSlowScanLineIntersection sl@0: { sl@0: TInt firstPixel; sl@0: TInt lastPixel; sl@0: TInt firstVertexOfEdge; sl@0: }; sl@0: private: // data-types for both algorithms sl@0: struct SFastData sl@0: { sl@0: TPoint* vertexList; sl@0: SFastEdge* edgeList; sl@0: SFastActiveEdge* activeEdgeList; sl@0: SFastScanLineIntersection* scanLineIntersectionList; sl@0: TInt numActiveEdges; sl@0: TInt numScanLineIntersections; sl@0: TInt nextEdgeToActivate; sl@0: }; sl@0: struct SSlowData sl@0: { sl@0: enum {EStoreSize=8}; sl@0: TLinearDDA lineGenerator; sl@0: SSlowScanLineIntersection scanLineIntersectionList[EStoreSize]; sl@0: TInt numIntersectionsWithSameFirstPixelPreviouslyMet; sl@0: TInt numIntersectionsWithSameFirstPixelMetThisTime; sl@0: TInt numScanLineIntersections; sl@0: TBool scanLineComplete; sl@0: TInt firstPixelOfLastIntersectionInPrevBuffer; sl@0: }; sl@0: private: sl@0: void Construct(CGraphicsContext::TFillRule aFillRule,TUsage aUsage); sl@0: void FastHandleVertexIntersection(TInt& aCurrentActiveEdge, TBool aIsLowerVertex); sl@0: void SetFastIntersection(SFastActiveEdge& aActiveEdge, SFastScanLineIntersection& aScanLineIntersection); sl@0: void SlowHandleVertexIntersection(SSlowScanLineIntersection& aScanLineIntersection, TInt& aVertexStartingCurrentEdge,TBool aIsLowerVertex); sl@0: void JumpToCurrentScanLine(TLinearDDA& aLineGenerator, const TPoint& aUpper, const TPoint& aLower,TPoint& aStartPos, TPoint& aEndPos) const; sl@0: const TPoint& Point(TInt aIndex); sl@0: private: sl@0: const CArrayFix* iPointArray; // not owned by the class sl@0: const TPoint* iPointList; // not owned by the class sl@0: CGraphicsContext::TFillRule iFillRule; sl@0: TBool iUseFastAlgorithm; sl@0: TInt iNumVertexes; sl@0: TBool iToggler; // used by EAlternate fill-rule sl@0: TInt iNestingLevel; // used by EWinding fill-rule sl@0: TInt iScanLineIntersection; sl@0: TInt iRightMostPixelOnScanLine; sl@0: TInt iFirstVertex; sl@0: TBool iPolygonIsAllHorizontal; sl@0: TInt iFirstScanLine; sl@0: TInt iLastScanLine; sl@0: TInt iCurrentScanLine; sl@0: SFastData iFastData; sl@0: SSlowData iSlowData; sl@0: private: sl@0: friend class TCompareEdgesUpperY; sl@0: friend class TCompareActiveEdgesFirstVertex; sl@0: friend class TCompareScanLineIntersectionsFirstPixel; sl@0: friend class TSwapEdges; sl@0: friend class TSwapActiveEdges; sl@0: friend class TSwapScanLineIntersections; sl@0: }; sl@0: sl@0: class CFbsDevice; sl@0: class CFbsDrawDevice; sl@0: class TOpenFontCharMetrics; sl@0: class CGraphicsAccelerator; sl@0: class CWsBitmap; sl@0: class MFastBlend; sl@0: class CFbsRasterizer; sl@0: class CFbsBitGcExtraData; sl@0: sl@0: /** sl@0: Concrete implementation of a bitmapped graphics context. sl@0: sl@0: The class provides new functionality, and implementations of the pure virtual sl@0: functions defined in CGraphicsContext and CBitmapContext. sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CFbsBitGc : public CBitmapContext sl@0: { sl@0: public: sl@0: sl@0: sl@0: /** Defines possible rotation values. */ sl@0: enum TGraphicsOrientation sl@0: { sl@0: /** Normal orientation is supported. */ sl@0: EGraphicsOrientationNormal, sl@0: /** A 90 degree rotation is supported. */ sl@0: EGraphicsOrientationRotated90, sl@0: /** A 180 degree rotation is supported. */ sl@0: EGraphicsOrientationRotated180, sl@0: /** A 270 degree rotation is supported. */ sl@0: EGraphicsOrientationRotated270 sl@0: }; sl@0: public: sl@0: IMPORT_C static CFbsBitGc* NewL(); sl@0: IMPORT_C virtual ~CFbsBitGc(); sl@0: IMPORT_C void Activate(CFbsDevice* aDevice); sl@0: IMPORT_C void ActivateNoJustAutoUpdate(CFbsDevice* aDevice); sl@0: IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitGc& aGc); sl@0: IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitGc& aGc,const TRect& aSourceRect); sl@0: IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitmap* aBitmap); sl@0: IMPORT_C void BitBlt(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect); sl@0: IMPORT_C void BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask); sl@0: IMPORT_C void CancelClipping(); sl@0: IMPORT_C void CancelClippingRect(); sl@0: IMPORT_C void CancelClippingRegion(); sl@0: IMPORT_C void Clear(); sl@0: IMPORT_C void Clear(const TRect& aRect); sl@0: IMPORT_C void CopyRect(const TPoint& aOffset,const TRect& aRect); sl@0: IMPORT_C void CopySettings(const CFbsBitGc& aGc); sl@0: IMPORT_C CGraphicsDevice* Device() const; sl@0: IMPORT_C void DiscardBrushPattern(); sl@0: IMPORT_C void DiscardFont(); sl@0: IMPORT_C void DrawArc(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd); sl@0: IMPORT_C void DrawPie(const TRect& aRect,const TPoint& aStart,const TPoint& aEnd); sl@0: IMPORT_C void DrawBitmap(const TPoint& aTopLeft,const CFbsBitmap* aSource); sl@0: IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource); sl@0: IMPORT_C void DrawBitmap(const TRect& aDestRect,const CFbsBitmap* aSource,const TRect& aSourceRect); sl@0: IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask); sl@0: IMPORT_C void DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSourceRect,const CWsBitmap* aMaskBitmap,TBool aInvertMask); sl@0: IMPORT_C void DrawRoundRect(const TRect& aRect,const TSize& aEllipse); sl@0: IMPORT_C void DrawPolyLine(const CArrayFix* aPointList); sl@0: IMPORT_C void DrawPolyLineNoEndPoint(const CArrayFix* aPointList); sl@0: IMPORT_C void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints); sl@0: IMPORT_C void DrawPolyLineNoEndPoint(const TPoint* aPointList,TInt aNumPoints); sl@0: IMPORT_C TInt DrawPolygon(const CArrayFix* aPointList,CGraphicsContext::TFillRule aFillRule=CGraphicsContext::EAlternate); sl@0: IMPORT_C TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,CGraphicsContext::TFillRule aFillRule=CGraphicsContext::EAlternate); sl@0: IMPORT_C void DrawEllipse(const TRect& aRect); sl@0: IMPORT_C void DrawLine(const TPoint& aStart,const TPoint& aEnd); sl@0: IMPORT_C void DrawLineTo(const TPoint& aPoint); sl@0: IMPORT_C void DrawLineBy(const TPoint& aVector); sl@0: IMPORT_C void DrawRect(const TRect& aRect); sl@0: IMPORT_C void DrawText(const TDesC& aText); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TPoint& aPosition); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TRect& aBox); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TTextAlign aHrz=ELeft,TInt aMargin=0); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TInt aTextWidth,TTextAlign aHrz=ELeft,TInt aMargin=0); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,TBool aUp); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TPoint& aPosition,TBool aUp); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TBool aUp); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TInt aTextWidth,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0); sl@0: IMPORT_C void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs=2,TBool aMapForwards=ETrue); sl@0: IMPORT_C void MoveTo(const TPoint& aPoint); sl@0: IMPORT_C void MoveBy(const TPoint& aVector); sl@0: IMPORT_C void OrientationsAvailable(TBool aOrientation[4]); sl@0: IMPORT_C void Plot(const TPoint& aPoint); sl@0: IMPORT_C void RectDrawnTo(TRect& aRect); sl@0: IMPORT_C void Reset(); sl@0: IMPORT_C void Resized(); sl@0: IMPORT_C void SetBrushColor(const TRgb& aColor); sl@0: IMPORT_C void SetBrushOrigin(const TPoint& aOrigin); sl@0: IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle); sl@0: IMPORT_C void SetClippingRegion(const TRegion* aRegion); sl@0: IMPORT_C void SetClippingRect(const TRect& aRect); sl@0: IMPORT_C void SetDitherOrigin(const TPoint& aPoint); sl@0: IMPORT_C void SetDrawMode(TDrawMode); sl@0: IMPORT_C void SetOrigin(const TPoint& aPoint=TPoint(0,0)); sl@0: IMPORT_C void SetPenColor(const TRgb& aColor); sl@0: IMPORT_C void SetPenStyle(TPenStyle); sl@0: IMPORT_C void SetPenSize(const TSize& aSize); sl@0: IMPORT_C void SetCharJustification(TInt aExcessWidth,TInt aNumGaps); sl@0: IMPORT_C void SetWordJustification(TInt aExcessWidth,TInt aNumChars); sl@0: IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle); sl@0: IMPORT_C void SetUserDisplayMode(TDisplayMode aDisplayMode); sl@0: IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle); sl@0: IMPORT_C void SetShadowMode(TBool aShadowMode = EFalse); sl@0: inline void SetFadeMode(TBool aFadeMode = EFalse); //Deprecated sl@0: inline void SetFadingParameters(TUint8 aBlackMap = 0); //Deprecated sl@0: IMPORT_C void SetFaded(TBool aFaded); //Virtual from CBitmapContext sl@0: IMPORT_C void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap); //Virtual from CBitmapContext sl@0: IMPORT_C TBool SetOrientation(TGraphicsOrientation aOrientation); sl@0: IMPORT_C void ShadowArea(const TRegion* aRegion); sl@0: IMPORT_C void FadeArea(const TRegion* aRegion); sl@0: IMPORT_C void UpdateJustification(const TDesC& aText); sl@0: IMPORT_C void UpdateJustificationVertical(const TDesC& aText,TBool aUp); sl@0: IMPORT_C void UseBrushPattern(const CFbsBitmap* aBitmap); sl@0: IMPORT_C TInt UseBrushPattern(TInt aFbsBitmapHandle); sl@0: IMPORT_C void UseFont(const CFont* aFont); sl@0: IMPORT_C TInt UseFont(TInt aFontHandle); sl@0: IMPORT_C void UseFontNoDuplicate(const CFbsBitGcFont* aFont); sl@0: IMPORT_C TBool IsBrushPatternUsed() const; sl@0: IMPORT_C TBool IsFontUsed() const; sl@0: inline static TInt16 Load16(const TUint8* aPtr) { return TInt16(aPtr[0]+(aPtr[1]<<8)); } sl@0: IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, sl@0: const CFbsBitmap* aSrcBmp1, sl@0: const CFbsBitmap* aSrcBmp2, sl@0: const TRect& aSrcRect1, sl@0: const TPoint& aSrcPt2, sl@0: const CFbsBitmap* aAlphaBmp, sl@0: const TPoint& aAlphaPt); sl@0: IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, sl@0: const CFbsBitmap* aSrcBmp, sl@0: const TRect& aSrcRect, sl@0: const CFbsBitmap* aAlphaBmp, sl@0: const TPoint& aAlphaPt); sl@0: IMPORT_C void ExternalizeL(RWriteStream& aWriteStream); sl@0: IMPORT_C void InternalizeL(RReadStream& aReadStream); sl@0: IMPORT_C TInt SetClippingRegion(const TRegion& aRegion); sl@0: sl@0: IMPORT_C TInt AlphaBlendBitmaps(const TPoint& aDestPt, sl@0: const CWsBitmap* aSrcBmp, sl@0: const TRect& aSrcRect, sl@0: const CWsBitmap* aAlphaBmp, sl@0: const TPoint& aAlphaPt); sl@0: IMPORT_C TRgb BrushColor(); sl@0: IMPORT_C TRgb PenColor(); sl@0: IMPORT_C void ChangeDevice(CFbsDevice* aDevice); sl@0: // New DrawText API's that take in extra paramemters such as context. Extensible. sl@0: IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TTextAlign aHrz=ELeft,TInt aMargin=0); sl@0: IMPORT_C void DrawText(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TInt aTextWidth,TTextAlign aHrz=ELeft,TInt aMargin=0); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition,TBool aUp); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TBool aUp); sl@0: IMPORT_C void DrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0); sl@0: 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); sl@0: IMPORT_C void UpdateJustification(const TDesC& aText,const TTextParameters* aParam); sl@0: IMPORT_C void UpdateJustificationVertical(const TDesC& aText,const TTextParameters* aParam,TBool aUp); sl@0: private: sl@0: CFbsBitGc(); sl@0: void AddRect(const TRect& aRect); sl@0: TBool AnalyseEllipse(const TRect& rc, TPoint& srad, TPoint& erad, TInt& startq, TInt& endq, TBool* quads); sl@0: void BitMultiply(TUint32* aBinaryDataPtr,TInt aBitLength,TInt aMultiplier); sl@0: void CheckDevice() const; sl@0: TBool CheckDevice(const TRect& aRect) const; sl@0: TUint32* ClipBinaryArray(TUint32* aArray,TUint32* aArrayLimit,TInt aArrayWordWd,TInt& aDataWd,TInt& aDataHt,TPoint& aPos); sl@0: void ClipFillLine(TPoint,TPoint); sl@0: void CopyCharWord(TUint32* aBinaryDataPtr,const TUint8* aData,TInt aBitShift); sl@0: void CopyCharLine(TUint32* aBinaryDataPtr,TInt aBufferWords,const TUint8* aData,TInt aBitShift,TInt aCharWidth); sl@0: void DrawText(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPosition,TTextAlign aAlignment, sl@0: CFont::TTextDirection aDirection,const TRect* aBox = NULL); sl@0: void DoBitBlt(const TPoint& aDest,CFbsDevice* aDevice,const TRect& aSourceRect); sl@0: void DoBitBlt(const TPoint& aDest,CBitwiseBitmap* aBitmap,TUint32* aBase,TInt aStride,const TRect& aSourceRect); sl@0: void DoBitBltMasked(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode); sl@0: void DoBitBltMaskedFlicker(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode); sl@0: void DoBitBltMaskedNonFlicker(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode); sl@0: void DoBitBltMaskedNonFlickerSolid(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode); sl@0: void DoBitBltMaskedNonFlickerPatterned(const TPoint& aDest,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin,TInt aShadowMode); sl@0: void DoBitBltAlpha(const TPoint& aDest, CBitwiseBitmap* aSourceBitmap, sl@0: TUint32* aSourceBase, const TRect& aSourceRect, sl@0: CBitwiseBitmap* aMaskBitmap, TUint32* aMaskBase, sl@0: const TPoint& aAlphaPoint, TInt aShadowMode, TBool aInvertMask); sl@0: void DoBitBltAlpha(const TPoint& aDestPt, sl@0: const CBitwiseBitmap* aSrcBmp1, sl@0: TUint32* aSrcBmpDataAddr1, sl@0: const CBitwiseBitmap* aSrcBmp2, sl@0: TUint32* aSrcBmpDataAddr2, sl@0: const CBitwiseBitmap* aAlphaBmp, sl@0: TUint32* aAlphaBmpDataAddr, sl@0: const TRect& aSrcRect1, sl@0: const TPoint& aSrcPt2, sl@0: const TPoint& aAlphaPt, sl@0: TInt aShadowMode); sl@0: void DoCopyRect(const TPoint&,const TRect&); sl@0: void DoDrawBitmap(const TRect&,CBitwiseBitmap*,TUint32* aBase,TInt aStride,const TRect&,const TPoint& aDitherOrigin); sl@0: void DoDrawBitmapMasked(const TRect& aDestRect,CBitwiseBitmap* aSourceBitmap,TUint32* aSourceBase,const TRect& aSourceRect,CBitwiseBitmap* aMaskBitmap,TUint32* aMaskBase,TBool aInvertMask,const TPoint& aDitherOrigin); sl@0: void DoDrawLine(TPoint aStart,TPoint aEnd,TBool aDrawStartPoint); sl@0: void DoDrawDottedWideLine(const TPoint& pt1,const TPoint& pt2,TBool drawstart,const TRect& screenrect); sl@0: void DoDrawSolidWideLine(const TPoint& pt1,const TPoint& pt2,TBool drawstart,const TRect& screenrect); sl@0: void DoDrawText(CFont::TPositionParam& aParam,const TInt aEnd); sl@0: void DoDrawCharacter(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData); sl@0: void DoDrawTextEx(CFont::TPositionParam& aParam,const CBitmapFont* font,const TInt aEnd, const TInt aUnderlineStrikethroughOffset); sl@0: void DoDrawCharacterEx(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData, sl@0: TBool aBold,TBool aItalic,TInt aSemiAscent); sl@0: void DoDrawCharacterAntiAliased(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData, const TGlyphBitmapType aGlyphType); sl@0: void DoDrawTextLarge(CFont::TPositionParam& aParam,const CBitmapFont* font,const TInt aEnd); sl@0: void DoDrawCharacterLarge(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData, sl@0: TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthFactor,TInt aHeightFactor); sl@0: void DoDrawCharacterExLarge(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData, sl@0: TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthFactor,TInt aHeightFactor); sl@0: void DoDrawCharacterMultiplied(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData, sl@0: TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthMultiplier,TInt aHeightMultiplier); sl@0: void DoDrawTextVertical(CFont::TPositionParam& aParam,const CBitmapFont* font,TBool aUp,const TInt aEnd); sl@0: void DoDrawCharacterVertical(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData, sl@0: TBool aBold,TBool aItalic,TInt aSemiAscent,TInt aWidthFactor,TInt aHeightFactor,TBool aUp); sl@0: void DoDrawCharacterVerticalAntiAliased(const TPoint& aTopLeft,const TSize& aDataSize,const TUint8* aData,TBool aUp, TGlyphBitmapType aGlyphBitmapType); sl@0: void DoPlot(const TPoint& pt); sl@0: void EllipseFill(const TRect& aRect); sl@0: void EllipseOutline(const TRect& aRect); sl@0: void EllipseOutlineWide(const TRect& aRect); sl@0: void GetStrikethroughMetrics(TInt& aTop,TInt& aBottom); sl@0: void OutputCharLine(TPoint aPrintPos,TUint32* aBuffer,TInt aDataLength,TInt aNum,TBool aBold,TInt aWidthFactor,TInt aHeightFactor); sl@0: void OutputCharLineMultiplied(TPoint aPrintPos,TUint32* aBuffer,TInt aDataLength,TInt aNum,TBool aBold,TInt aWidthMultiplier,TInt aHeightMultiplier); sl@0: void OutputCharLineVertical(TPoint aPrintPos,TUint32* aBuffer,TInt aDataLength,TInt aNum,TBool aBold,TInt aWidthFactor,TInt aHeightFactor,TBool aUp); sl@0: void PenAllocate(); sl@0: void PenDrawClipped(TPoint aPoint); sl@0: void PenDrawDeferred(TPoint aPoint,TInt* aArray,TInt aFirstElement); sl@0: void PieArcOutline(const TRect& aRect,const TPoint& aStartRadius,const TPoint& aEndRadius,TBool aDoPie); sl@0: void PieFill(const TRect& ellrect, const TPoint& aStartIntersect, const TPoint& aEndIntersect, sl@0: TInt aStartQuadrant, TInt aEndQuadrant, const TBool* aQuadrants); sl@0: void PieShell(const TRect& ellrect, const TPoint& startradius, const TPoint& endradius, sl@0: const TBool* quads, TInt startquad, TInt endquad); sl@0: void PieTriangles(TBool aInside,const TPoint& aStart,const TPoint& aEnd); sl@0: void PieSliver(const TRect& ellrect,const TPoint& startradius,const TPoint& endradius,TInt quad); sl@0: void PolyFill(const CArrayFix* aPointList,TFillRule aFillRule); sl@0: void PolyFillLarge(const CArrayFix* aPointList,TFillRule aFillRule); sl@0: void PolyFill(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule); sl@0: void PolyFillLarge(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule); sl@0: void PolyOutline(const CArrayFix* aPointList); sl@0: void PolyOutline(const TPoint* aPointList,TInt aNumPoints); sl@0: void RectFill(const TRect& aRect); sl@0: void RoundRectFill(const TRect& aRect,TSize aSize); sl@0: void RoundRectOutline(const TRect& aRect,TSize aSize); sl@0: void SetupDevice() const; sl@0: void ShadowFadeArea(const TRegion* aRegion,TInt8 aShadowMode); sl@0: TBool UserClipRect(TRect& aRect); sl@0: CGraphicsAccelerator* GraphicsAccelerator(); sl@0: TUint MemoryOffsetForPixelPitch(TUint aX, TDisplayMode aDisplayMode); sl@0: TUint32* GetScanLineOffsetPtr(CBitwiseBitmap* aSrce, TUint32*& aSlptr, TInt aLength, TPoint aPixel,TUint32* aBase, TLineScanningPosition& aLineScanningPosition, TUint aXOffset); sl@0: void APIExGetUnderlineMetrics(TAny*& aOutput); sl@0: TInt APIExSetShadowColor(TAny* aShadowColor); sl@0: TInt APIExGetShadowColor(TAny*& aShadowColor); sl@0: TInt FastBlendInterface(const CBitwiseBitmap* aSource, const CBitwiseBitmap* aMask, MFastBlend*& aFastBlend) const; sl@0: TInt APIExIsFbsBitGc(TAny*& aIsCFbsBitGc); sl@0: TDisplayMode ScanLineBufferDisplayMode(CFbsDrawDevice* aDrawDevice); sl@0: TInt BaselineCorrection(); sl@0: CFbsRasterizer* PrepareRasterizerForExtendedBitmap(const CFbsBitmap& aBitmap); sl@0: CFbsRasterizer* PrepareRasterizerForExtendedBitmap(const CFbsBitmap& aBitmap, const TRect& aDestRect, const TPoint& aOffset); sl@0: CFbsRasterizer* PrepareRasterizerForExtendedBitmap(const CFbsBitmap& aBitmap, const TRect& aDestRect, const TRect& aSourceRect); sl@0: protected: sl@0: /** This function should not be used by externals but must retain the sl@0: same ordinal number to maintain BC, thus is exported.*/ sl@0: IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput); sl@0: sl@0: private: sl@0: IMPORT_C void Reserved_CGraphicsContext_2(); sl@0: sl@0: IMPORT_C void Reserved_CBitmapContext_1(); sl@0: IMPORT_C void Reserved_CBitmapContext_2(); sl@0: IMPORT_C void Reserved_CBitmapContext_3(); sl@0: sl@0: IMPORT_C virtual void Reserved_CFbsBitGc_1(); sl@0: IMPORT_C virtual void Reserved_CFbsBitGc_2(); sl@0: IMPORT_C virtual void Reserved_CFbsBitGc_3(); sl@0: IMPORT_C virtual void Reserved_CFbsBitGc_4(); sl@0: IMPORT_C virtual void Reserved_CFbsBitGc_5(); sl@0: sl@0: private: sl@0: CFbsBitGcBitmap iBrushBitmap; sl@0: TBool iBrushUsed; sl@0: TRgb iBrushColor; sl@0: TPoint iBrushOrigin; sl@0: TBrushStyle iBrushStyle; sl@0: TRect iClipRect; sl@0: TRegionFix<1> iDefaultRegion; sl@0: const TRegion* iDefaultRegionPtr; sl@0: TRect iUserClipRect; sl@0: CFbsDevice* iDevice; sl@0: TPoint iDitherOrigin; sl@0: TInt iDotLength; sl@0: TInt iDotMask; sl@0: TInt iDotParam; sl@0: TInt iDotDirection; sl@0: TDrawMode iDrawMode; sl@0: TRect iDrawnTo; sl@0: CFbsBitGcFont iFont; sl@0: TInt iCharJustExcess; sl@0: TInt iCharJustNum; sl@0: TInt iWordJustExcess; sl@0: TInt iWordJustNum; sl@0: TPoint iLastPrintPosition; sl@0: TPoint iLinePosition; sl@0: TPoint iOrigin; sl@0: CFbsBitGcExtraData* iFbsBitGcExtraData; sl@0: TRgb iPenColor; sl@0: TPenStyle iPenStyle; sl@0: TSize iPenSize; sl@0: TInt8 iShadowMode; sl@0: TInt8 iAutoUpdateJustification; sl@0: TUint8 iFadeBlackMap; sl@0: TUint8 iFadeWhiteMap; sl@0: TFontStrikethrough iStrikethrough; sl@0: TFontUnderline iUnderline; sl@0: TDisplayMode iUserDisplayMode; sl@0: RRegion iClippingRegion; sl@0: #if defined(__ALLOW_FAST_BLEND_DISABLE__) sl@0: TBool iFastBlendDisabled; sl@0: #endif sl@0: }; sl@0: sl@0: inline void CFbsBitGc::SetFadeMode(TBool aFadeMode /*=EFalse*/) sl@0: {SetFaded(aFadeMode);} sl@0: inline void CFbsBitGc::SetFadingParameters(TUint8 aBlackMap /*=0*/) sl@0: {SetFadingParameters(aBlackMap,255);} //255 is the value of white map when not fading sl@0: sl@0: #endif sl@0: