sl@0: // Copyright (c) 2008-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: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "stresscrp.h" sl@0: sl@0: NONSHARABLE_CLASS(CStressCRP): public CWsGraphicDrawer sl@0: { sl@0: public: sl@0: static CStressCRP* CreateL(); sl@0: enum sl@0: { sl@0: EImplUid = 0xa0005923 sl@0: }; sl@0: void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& aData); sl@0: void HandleMessage(const TDesC8& aData); sl@0: private: sl@0: void DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& aData) const; sl@0: mutable MWsGraphicDrawerEnvironment* iEnv; sl@0: }; sl@0: sl@0: CStressCRP* CStressCRP::CreateL() sl@0: { sl@0: return new(ELeave) CStressCRP; sl@0: } sl@0: sl@0: void CStressCRP::ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& /*aData*/) sl@0: { sl@0: BaseConstructL(aEnv,aId,aOwner); sl@0: iEnv = &aEnv; sl@0: } sl@0: sl@0: void CStressCRP::HandleMessage(const TDesC8&/* aData*/) sl@0: { sl@0: } sl@0: sl@0: void CStressCRP::DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& /*aData*/) const sl@0: { sl@0: MWsGraphicsContext* context = static_cast(aGc.ResolveObjectInterface(KMWsGraphicsContext)); sl@0: if(context) //NGA sl@0: StressCrpNgaContext::Draw(aGc, aRect); sl@0: else //NON NGA sl@0: StressCrpNonNgaContext::Draw(aGc, aRect); sl@0: } sl@0: sl@0: EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) //lint -e714 Suppress 'not referenced' sl@0: { sl@0: static const TImplementationProxy KImplementationTable[] = sl@0: { sl@0: IMPLEMENTATION_PROXY_ENTRY(CStressCRP::EImplUid,CStressCRP::CreateL) //lint !e611 Suspicious cast sl@0: }; sl@0: aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy)); sl@0: return KImplementationTable; sl@0: }