Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // CPlaybackGc and associated classes definitions
18 #ifndef __PLAYBACKGC_H__
19 #define __PLAYBACKGC_H__
26 class CPlaybackGc : public CBase, public MWsGc
29 static void InitStaticsL();
30 static void DeleteStatics();
31 static CPlaybackGc * Instance() { return iSelf; }
34 void Activate(CWsClientWindow * aWin, CFbsBitGc * aGc, const TRegion * aRegion);
35 void CommandL(TWsGcOpcodes aOpcode, const TDesC8& aCmdData);
37 inline CFbsBitGc *Gdi() const;
38 void SetOrigin(const TPoint &aOrigin);
39 void InternalizeL(const CBufBase& aBuffer,TInt& aStartPos);
40 void InternalizeClippingRegionL(RReadStream& aReadStream);
41 TInt FbsBitmapHandle(TInt aOpcode, const TWsGcCmdUnion &pData, TInt& aMaskHandle);
42 TInt WsBitmapHandle(TInt aOpcode, const TWsGcCmdUnion &pData, TInt& aMaskHandle);
46 TPoint GcOrigin() const;
47 const TRegion& ClippingRegion();
49 TInt PushBitGcSettings();
50 void PopBitGcSettings();
51 const TTime& Now() const;
52 void ScheduleAnimation(const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow);
53 void ScheduleAnimation(const TRect& aRect,const TTimeIntervalMicroSeconds& aFromNow,const TTimeIntervalMicroSeconds& aFreq,const TTimeIntervalMicroSeconds& aStop);
54 void SetGcOrigin(const TPoint& aOrigin);
55 void SetTargetRegion(const TRegion* aRegion);
57 public: // from MWsObjectProvider
58 TAny * ResolveObjectInterface(TUint aId);
62 void DoDrawing(TWsGcOpcodes aOpcode, const TDesC8& aCmdData);
63 void CancelUserClippingRegion();
64 void RemoteReadDataAndDrawL(const CWsGraphicDrawer* aGraphic, CWsClient* aOwner, const TWsGcCmdUnion &aData);
65 void DoDrawCommand(TWsGcOpcodes aOpcode, const TDesC8& aCmdData, const TRegion *aRegion);
66 void SetClippingRect(const TRect &aRect);
67 const RWsRegion& Region();
68 void DoDrawPolygon(const TWsGcCmdDrawPolygon *aDrawPolygon);
69 void DoDrawPolyLine(const TWsGcCmdDrawPolyLine *aDrawPolyLine, TBool aContinued);
70 void GcOwnerPanic(TClientPanic aPanic);
71 void ResetClippingRect();
72 void EndSegmentedPolygon();
73 void StartSegmentedDrawPolygonL(const TWsGcCmdStartSegmentedDrawPolygon *aDrawPolygon);
74 void SegmentedDrawPolygonData(const TWsGcCmdSegmentedDrawPolygonData *aDrawPolygon);
75 void UpdateJustification(TText* aText,TInt aLen, const TDesC8& aCmdData);
76 void InternalizeAlphaValueL(RReadStream& aReadStream);
78 void CheckPolyData(const TAny* aDataPtr, TInt aHeaderSize, TInt aNumPoints);
79 TPtrC BufferTPtr(TText* aStart, TInt aLen, const TDesC8& aCmdData);
82 static CPlaybackGc * iSelf;
83 CWsClientWindow *iWin;
84 TPoint iMasterOrigin; // Origin available to wserv. Usually the window origin.
87 const TRegion *iTargetRegion; //Clipping region set by wserv window management.
88 RWsRegion* iUserDefinedClippingRegion; //Clipping region that is set explicitly by the user.
89 const TRegion *iDrawRegion; //Pointer to one of the above regions
90 TRect iClippingRect; // All drawing clipped to this rectangle in addition to other clipping
91 TBool iClippingRectSet; // ETrue if the iClippingRect is in use
92 TPoint iOrigin; // User defined origin, relative to the top left of the window
93 TPoint iLinePos; // Current line position for LineBy, LineTo etc
95 TInt iPolyPointListSize;
96 CFbsBitmap *iScratchBitmap;
97 CFbsBitmap *iScratchMaskBitmap;
98 // members used for keeping state when drawing CWsGraphicDrawers
100 const TRegion* iCurrentClippingRegion; // Clipping region while doing DoDrawCommand
103 #endif // __PLAYBACKGC_H__