sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Interface code for animated DLL's GC sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include "server.h" sl@0: #include "playbackgc.h" sl@0: #include "ANIM.H" sl@0: #include "wsfont.h" sl@0: #include "bitgditomwsgraphicscontextmappings.h" sl@0: #include "devicemap.h" sl@0: sl@0: CWsAnimGc::CWsAnimGc(CWsAnim& aWsAnim) : iOwningWsAnim(aWsAnim), iUserActive(EFalse), iUseDrawingRegion(EFalse) sl@0: { sl@0: __DECLARE_NAME(_S("CWsAnimGc")); sl@0: } sl@0: sl@0: CWsAnimGc::~CWsAnimGc() sl@0: { sl@0: iDrawingRegion.Close(); sl@0: } sl@0: sl@0: void CWsAnimGc::Activate(const TRegion* aRegion, MWsGraphicsContext* aGc) sl@0: { sl@0: iBaseRegion = aRegion ? aRegion : iOwningWsAnim.ClientWindow()->DrawingRegion(); sl@0: iGc = aGc; sl@0: iUserActive = ETrue; sl@0: Reset(); sl@0: } sl@0: sl@0: void CWsAnimGc::Deactivate() sl@0: { sl@0: CloseCurrentFont(); sl@0: iGc = NULL; sl@0: iUserActive = EFalse; sl@0: iUseDrawingRegion = EFalse; sl@0: iDrawingRegion.Close(); sl@0: } sl@0: sl@0: TBool CWsAnimGc::IsActive() const sl@0: { sl@0: return (iUserActive || (iGc != NULL)); sl@0: } sl@0: sl@0: void CWsAnimGc::UserActivate() sl@0: { sl@0: if (iUserActive) sl@0: { sl@0: // Already active sl@0: UserDeactivate(); sl@0: iOwningWsAnim.SessionPanic(); sl@0: } sl@0: iUserActive = ETrue; sl@0: } sl@0: sl@0: void CWsAnimGc::UserDeactivate() sl@0: { sl@0: CloseCurrentFont(); sl@0: sl@0: if (iUserActive) sl@0: { sl@0: iUserActive = EFalse; sl@0: } sl@0: } sl@0: sl@0: CGraphicsDevice* CWsAnimGc::Device() const sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: sl@0: return NULL; //deprecated sl@0: } sl@0: sl@0: void CWsAnimGc::SetClippingRect(const TRect& aRect) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: sl@0: if (iGc) sl@0: { sl@0: iClippingRect = aRect; sl@0: iClippingRect.Move(iOwningWsAnim.ClientWindow()->Origin()); sl@0: iClippingRect.Intersection(iOwningWsAnim.ClientWindow()->AbsRect()); sl@0: sl@0: STACK_REGION region; sl@0: region.Copy(*iBaseRegion); sl@0: if (iUseDrawingRegion) sl@0: region.Intersect(iDrawingRegion); sl@0: region.ClipRect(iClippingRect); sl@0: region.Tidy(); sl@0: sl@0: iGc->SetClippingRegion(region); sl@0: region.Close(); sl@0: sl@0: if (iGc->GetError()) sl@0: iClippingRect = iOwningWsAnim.ClientWindow()->AbsRect(); // On error revert to the default clipping rect sl@0: } sl@0: } sl@0: sl@0: TInt CWsAnimGc::SetClippingRegion(const TRegion &aRegion) sl@0: { sl@0: if (!iUserActive) sl@0: return KErrGeneral; sl@0: sl@0: TInt error = KErrNone; sl@0: if (iGc) sl@0: { sl@0: STACK_REGION region; sl@0: region.Copy(aRegion); sl@0: region.Offset(iOwningWsAnim.ClientWindow()->Origin()); sl@0: region.Intersect(*iBaseRegion); sl@0: region.ClipRect(iClippingRect); sl@0: region.Tidy(); sl@0: sl@0: iGc->SetClippingRegion(region); sl@0: region.Close(); sl@0: sl@0: error = iGc->GetError(); sl@0: if (!error) sl@0: { // Need to keep a copy of the region in screen coordinates sl@0: iDrawingRegion.Copy(aRegion); sl@0: iDrawingRegion.Offset(iOwningWsAnim.ClientWindow()->Origin()); sl@0: iUseDrawingRegion = ETrue; sl@0: } sl@0: } sl@0: return error; sl@0: } sl@0: sl@0: void CWsAnimGc::CancelClippingRegion() sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: sl@0: if (iGc) sl@0: { sl@0: iDrawingRegion.Close(); sl@0: iUseDrawingRegion = EFalse; sl@0: sl@0: STACK_REGION region; sl@0: region.Copy(*iBaseRegion); sl@0: region.ClipRect(iClippingRect); sl@0: region.Tidy(); sl@0: iGc->SetClippingRegion(region); sl@0: region.Close(); sl@0: } sl@0: } sl@0: sl@0: void CWsAnimGc::CancelClippingRect() sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: sl@0: if (iGc) sl@0: { sl@0: iClippingRect = iOwningWsAnim.ClientWindow()->AbsRect(); // Revert to the default clipping rect sl@0: sl@0: STACK_REGION region; sl@0: region.Copy(*iBaseRegion); sl@0: if (iUseDrawingRegion) sl@0: region.Intersect(iDrawingRegion); sl@0: region.ClipRect(iClippingRect); sl@0: region.Tidy(); sl@0: iGc->SetClippingRegion(region); sl@0: region.Close(); sl@0: } sl@0: } sl@0: sl@0: void CWsAnimGc::SetDrawMode(TDrawMode aDrawingMode) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: sl@0: if (iGc) sl@0: iGc->SetDrawMode(BitGdiToMWsGraphicsContextMappings::LossyConvert(aDrawingMode)); sl@0: } sl@0: sl@0: void CWsAnimGc::UseFont(const CFont *aFont) sl@0: { sl@0: CloseCurrentFont(); sl@0: iFont=(CAnimFbsFont *)aFont; sl@0: iFont->Open(); sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetFontNoDuplicate(iFont); sl@0: } sl@0: sl@0: void CWsAnimGc::DiscardFont() sl@0: { sl@0: CloseCurrentFont(); sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->ResetFont(); sl@0: } sl@0: sl@0: void CWsAnimGc::SetUnderlineStyle(TFontUnderline aUnderlineStyle) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetUnderlineStyle(BitGdiToMWsGraphicsContextMappings::Convert(aUnderlineStyle)); sl@0: } sl@0: sl@0: void CWsAnimGc::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetStrikethroughStyle(BitGdiToMWsGraphicsContextMappings::Convert(aStrikethroughStyle)); sl@0: } sl@0: sl@0: void CWsAnimGc::SetWordJustification(TInt aExcessWidth,TInt aNumGaps) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetWordJustification(aExcessWidth,aNumGaps); sl@0: } sl@0: sl@0: void CWsAnimGc::SetCharJustification(TInt aExcessWidth,TInt aNumChars) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetCharJustification(aExcessWidth,aNumChars); sl@0: } sl@0: sl@0: void CWsAnimGc::SetPenColor(const TRgb &aColor) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetPenColor(aColor); sl@0: } sl@0: sl@0: void CWsAnimGc::SetPenStyle(TPenStyle aPenStyle) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetPenStyle(BitGdiToMWsGraphicsContextMappings::Convert(aPenStyle)); sl@0: } sl@0: sl@0: void CWsAnimGc::SetPenSize(const TSize& aSize) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetPenSize(aSize); sl@0: } sl@0: sl@0: void CWsAnimGc::SetBrushColor(const TRgb &aColor) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetBrushColor(aColor); sl@0: } sl@0: sl@0: void CWsAnimGc::SetBrushStyle(TBrushStyle aBrushStyle) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetBrushStyle(BitGdiToMWsGraphicsContextMappings::Convert(aBrushStyle)); sl@0: } sl@0: sl@0: void CWsAnimGc::SetBrushOrigin(const TPoint &aOrigin) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetBrushOrigin(aOrigin); sl@0: } sl@0: sl@0: void CWsAnimGc::UseBrushPattern(const CFbsBitmap *aBitmap) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetBrushPattern(*aBitmap); sl@0: } sl@0: sl@0: void CWsAnimGc::DiscardBrushPattern() sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->ResetBrushPattern(); sl@0: } sl@0: sl@0: void CWsAnimGc::SetFaded(TBool /*aFaded*/) // Deprecated sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: // Do nothing sl@0: } sl@0: sl@0: void CWsAnimGc::SetFadingParameters(TUint8 /*aBlackMap*/,TUint8 /*aWhiteMap*/) // Deprecated sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: // Do nothing sl@0: } sl@0: sl@0: // sl@0: // Drawing commands // sl@0: // sl@0: sl@0: void CWsAnimGc::DrawArc(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawArc(aRect,aStart,aEnd); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawPie(aRect,aStart,aEnd); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawLine(const TPoint &aPoint1,const TPoint &aPoint2) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawLine(aPoint1, aPoint2); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawLineTo(const TPoint &aPoint) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawLineTo(aPoint); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawLineBy(const TPoint &aPoint) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawLineBy(aPoint); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawEllipse(const TRect &aRect) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawEllipse(aRect); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawRect(const TRect &aRect) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawRect(aRect); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawRoundRect(const TRect &aRect,const TSize &aCornerSize) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawRoundRect(aRect, aCornerSize); sl@0: } sl@0: sl@0: void CWsAnimGc::Clear(const TRect &aRect) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->Clear(aRect); sl@0: } sl@0: sl@0: void CWsAnimGc::Clear() sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->Clear(); sl@0: } sl@0: sl@0: void CWsAnimGc::BitBlt(const TPoint &aPoint,const CFbsBitmap *aBitmap) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->BitBlt(aPoint, *aBitmap); sl@0: } sl@0: sl@0: void CWsAnimGc::BitBlt(const TPoint &aDestination,const CFbsBitmap *aBitmap,const TRect &aSource) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->BitBlt(aDestination, *aBitmap, aSource); sl@0: } sl@0: sl@0: void CWsAnimGc::BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->BitBltMasked(aPoint, *aBitmap, aSourceRect, *aMaskBitmap, aInvertMask); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aSource) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: { sl@0: // DrawBitmap(TPoint&, ) uses the size of the bitmap in twips, but sl@0: // MWsGraphicsContext::DrawBitmap() takes a TRect in pixels, so we need to convert sl@0: TRect destRect(iOwningWsAnim.ClientWindow()->Screen()->DeviceMap().TwipsToPixels(aSource->SizeInTwips())); sl@0: destRect.Move(aTopLeft); //aTopLeft is defined in pixels, that's why we're not converting it sl@0: iGc->DrawBitmap(destRect, *aSource); sl@0: } sl@0: } sl@0: sl@0: void CWsAnimGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawBitmap(aDestRect, *aSource); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource, const TRect &aSrcRect) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawBitmap(aDestRect, *aSource, aSrcRect); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawBitmapMasked(const TRect &aDestRect, const CFbsBitmap *aBitmap, const TRect &aSrcRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawBitmapMasked(aDestRect, *aBitmap, aSrcRect, *aMaskBitmap, aInvertMask); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSrcRect,const CWsBitmap* aMaskBitmap, TBool aInvertMask) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawBitmapMasked(aDestRect, *aBitmap, aSrcRect, *aMaskBitmap, aInvertMask); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawPolyLine(const TPoint* aPointList,TInt aNumPoints) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: { sl@0: TArrayWrapper points(aPointList, aNumPoints); sl@0: iGc->DrawPolyLine(points); sl@0: } sl@0: } sl@0: sl@0: void CWsAnimGc::DrawPolyLine(const CArrayFix *aPointList) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->DrawPolyLine(aPointList->Array()); sl@0: } sl@0: sl@0: TInt CWsAnimGc::DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule) sl@0: { sl@0: TInt result = KErrGeneral; sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: { sl@0: TArrayWrapper pointsArray(aPointList, aNumPoints); sl@0: iGc->DrawPolygon(pointsArray, BitGdiToMWsGraphicsContextMappings::Convert(aFillRule)); sl@0: result = iGc->GetError(); sl@0: } sl@0: return result; sl@0: } sl@0: sl@0: TInt CWsAnimGc::DrawPolygon(const CArrayFix *aPointList,TFillRule aFillRule) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if(!aPointList) sl@0: return KErrArgument; sl@0: TInt result = KErrGeneral; sl@0: if (iGc) sl@0: { sl@0: iGc->DrawPolygon(aPointList->Array(), BitGdiToMWsGraphicsContextMappings::Convert(aFillRule)); sl@0: result = iGc->GetError(); sl@0: } sl@0: return result; sl@0: } sl@0: sl@0: void CWsAnimGc::DrawText(const TDesC &aString,const TPoint &aPosition) sl@0: { sl@0: if (!iFont) sl@0: iOwningWsAnim.Panic(EWservPanicNoFont); sl@0: if (iGc) sl@0: iGc->DrawText(aString, NULL, aPosition); sl@0: } sl@0: sl@0: void CWsAnimGc::DrawText(const TDesC &aString,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz,TInt aLeftMrg) sl@0: { sl@0: if (!iFont) sl@0: iOwningWsAnim.Panic(EWservPanicNoFont); sl@0: if (iGc) sl@0: iGc->DrawText(aString, NULL, aBox, aBaselineOffset, BitGdiToMWsGraphicsContextMappings::Convert(aHoriz), aLeftMrg); sl@0: } sl@0: sl@0: void CWsAnimGc::MoveTo(const TPoint &aPoint) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->MoveTo(aPoint); sl@0: } sl@0: sl@0: void CWsAnimGc::MoveBy(const TPoint &aPoint) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->MoveBy(aPoint); sl@0: } sl@0: sl@0: void CWsAnimGc::Plot(const TPoint &aPoint) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->Plot(aPoint); sl@0: } sl@0: sl@0: void CWsAnimGc::SetOrigin(const TPoint &aPoint) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->SetOrigin(iOwningWsAnim.ClientWindow()->Origin() + aPoint); sl@0: } sl@0: sl@0: void CWsAnimGc::CopyRect(const TPoint& aOffset,const TRect& aRect) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->CopyRect(aOffset, aRect); sl@0: } sl@0: sl@0: void CWsAnimGc::Reset() sl@0: { sl@0: CloseCurrentFont(); sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: iGc->Reset(); sl@0: SetOrigin(TPoint(0,0)); sl@0: CancelClippingRect(); sl@0: CancelClippingRegion(); sl@0: } sl@0: sl@0: void CWsAnimGc::CloseCurrentFont() sl@0: { sl@0: if (iFont) sl@0: { sl@0: iFont->Close(); sl@0: iFont=NULL; sl@0: } sl@0: } sl@0: sl@0: /** sl@0: @see CBitmapContext::AlphaBlendBitmaps()*/ sl@0: TInt CWsAnimGc::AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt) sl@0: { sl@0: TInt result = KErrGeneral; sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: if (iGc) sl@0: { sl@0: iGc->BitBltMasked(aDestPt, *aSrcBmp, aSrcRect, *aAlphaBmp, aAlphaPt); sl@0: result = iGc->GetError(); sl@0: } sl@0: return result; sl@0: } sl@0: sl@0: /*Body stub implementation. The alternate AlphaBlendBitmap function using CFbsBitmaps should instead be used*/ sl@0: TInt CWsAnimGc::AlphaBlendBitmaps(const TPoint& /*aDestPt*/, const CWsBitmap* /*aSrcBmp*/, const TRect& /*aSrcRect*/, const CWsBitmap* /*aAlphaBmp*/, const TPoint& /*aAlphaPt*/) sl@0: { sl@0: return KErrNone; sl@0: }; sl@0: sl@0: /** sl@0: @see CGraphicsContext::MapColors()*/ sl@0: void CWsAnimGc::MapColors(const TRect& /*aRect*/,const TRgb* /*aColors*/,TInt /*aNumPairs*/,TBool /*aMapForwards*/) sl@0: { sl@0: if (!iUserActive) sl@0: iOwningWsAnim.Panic(EWservPanicAnimLeave); sl@0: } sl@0: sl@0: /** sl@0: @see CGraphicsContext::DrawTextVertical()*/ sl@0: void CWsAnimGc::DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp) sl@0: { sl@0: if (!iFont) sl@0: iOwningWsAnim.Panic(EWservPanicNoFont); sl@0: if (iGc) sl@0: iGc->DrawTextVertical(aText, NULL, aPos, aUp); sl@0: } sl@0: sl@0: /** sl@0: @see CGraphicsContext::DrawTextVertical()*/ sl@0: void CWsAnimGc::DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert,TInt aMargin) sl@0: { sl@0: if (!iFont) sl@0: iOwningWsAnim.Panic(EWservPanicNoFont); sl@0: if (iGc) sl@0: iGc->DrawTextVertical(aText, NULL, aBox, aBaselineOffset, aUp, BitGdiToMWsGraphicsContextMappings::Convert(aVert), aMargin); sl@0: } sl@0: