windowing/windowserver/test/t_stress/inc/animatedwin.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2008-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent
       
    20 */
       
    21 
       
    22 #ifndef ANIMATED_H
       
    23 #define ANIMATED_H
       
    24 
       
    25 #include <w32std.h>
       
    26 #include "compwin.h"
       
    27 #include "test_step_conf.h"
       
    28 
       
    29 _LIT8(KAnimatedWindowType, "Animated");
       
    30 
       
    31 class CAnimatedWin : public CCompWin
       
    32 	{
       
    33 public:
       
    34 	static CAnimatedWin* NewLC(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
       
    35 	static void LoadConfiguration(const MTestStepConfigurationContext* aContext);
       
    36 	static TBool IsEnabled() { return iEnabled; }
       
    37 
       
    38 	~CAnimatedWin();
       
    39 	
       
    40 	// from CCompWin
       
    41 	void Redraw(const TRect& aRect);
       
    42 	void DrawBitmap(CFbsBitGc* aGc, TRect& aClip, TPoint& aOrigin);
       
    43 	void SetSize(const TSize & aSize);
       
    44 	void SetPos(const TPoint & aPos);
       
    45 	virtual const TDesC8& TypeName() { return KAnimatedWindowType; }
       
    46 	void DumpDetails(RFile & aFile, TInt aDepth);
       
    47 	
       
    48 protected:
       
    49 	CAnimatedWin(RWsSession& aWs, RWindowGroup* aGroup, CCompWin* aParent, CWindowGc& aGc);
       
    50 	void ConstructL();
       
    51 	
       
    52 	// from CCompWin
       
    53 	TBool QueryReadyForVerification();
       
    54 
       
    55 private:
       
    56 	void SetAnimPos(const TPoint& aPos);
       
    57 	void AppendTime(TDes& aTimeText,const TTime& aTime) const;
       
    58 	
       
    59 	static TBool iEnabled;
       
    60 	static TBool iTransparent;
       
    61 	static TBool iTransparentForegroundWindow;
       
    62 	
       
    63 private:
       
    64 	class RStressAnim : public RAnim
       
    65 	{ 
       
    66 	public:
       
    67 		RStressAnim (RAnimDll& aAnimDll);
       
    68 		TInt Construct(const RWindowBase &aDevice, const TDesC8 &aParams);
       
    69 		
       
    70 		TInt RequestAnimThis(TInt aOpcode);
       
    71 		TInt RequestAnimThis(TInt aOpcode, const TDesC8 &aParams);
       
    72 			
       
    73 		friend class CAnimatedWin;
       
    74 	};
       
    75 	
       
    76 	enum TValues
       
    77 	{
       
    78 	ENofFrames = 2,
       
    79 	EFrame1	   = 0,
       
    80 	EFrame2	   = 1,
       
    81 	EFrameSzX  = 64,
       
    82 	EFrameSzY  = 64,
       
    83 	EFrameSzXHalf = (EFrameSzX / 2),
       
    84 	EFrameSzYHalf = (EFrameSzY / 2),
       
    85 	EFrameSzXQtr = (EFrameSzX / 4),
       
    86 	EFrameSzYQtr = (EFrameSzY / 4),
       
    87 	EFrameSzXEgt = (EFrameSzX / 8),
       
    88 	EFrameSzYEgt = (EFrameSzY / 8),
       
    89 	EFrameDurMult = 100000,
       
    90 	EFrameDurMaxTenthSec = 15,
       
    91 	EWatchUrgentSync	= 100000,   	// 	1/10 sec
       
    92 	EWatchLazySync		= 800000,	    // 	8/10 sec
       
    93 	EWatchSafeGap		= 100000,
       
    94 	EWatchMatchGap		= 900000
       
    95 	};
       
    96 
       
    97 	RAnimDll				iAnimDll;
       
    98 	RStressAnim*			iAnim;
       
    99 
       
   100 	CFbsBitmap* 			iAnimContent [ENofFrames];
       
   101 	CFbsBitmap* 			iAnimMask;
       
   102 
       
   103 	CFbsFont*				iAnimFont; 				
       
   104 	
       
   105 	CFbsBitmapDevice*		iAnimCntDevice [ENofFrames];
       
   106 	CFbsBitmapDevice*		iAnimMskDevice;
       
   107 	
       
   108 	TBool					iConstructed;
       
   109 	
       
   110 	TRgb					iBgColor;
       
   111 
       
   112 	TTimeIntervalMicroSeconds32
       
   113 							iFrameDuration;
       
   114 	
       
   115 	TUint32 				iAnimStartup,
       
   116 							iAnimLastKnownAction;
       
   117 	TInt 					iKernelTicksPeriod;
       
   118 	
       
   119 	RBlankWindow*  			iForeWin; //transparent foreground window
       
   120 	};
       
   121 
       
   122 
       
   123 #endif // ANIMATED_H