sl@0: // Copyright (c) 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: sl@0: #ifndef OPENVGENGINE_H_ sl@0: #define OPENVGENGINE_H_ sl@0: sl@0: sl@0: #include "engine.h" sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: const TInt KMaxDisplayCoversExample3 = 40; sl@0: const TInt KMaxDisplayLeftExample3 = -3; sl@0: const TInt KMaxDisplayRightExample3 = 3; sl@0: sl@0: // the max number of covers visible on the screen at any given time sl@0: const TInt KMaxCoversExample3 = 40; sl@0: sl@0: sl@0: class COpenVGEngine : public CBase, public MEngine sl@0: { sl@0: public: sl@0: static COpenVGEngine* NewL(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext); sl@0: ~COpenVGEngine(); sl@0: TInt GetSpeed(); sl@0: sl@0: // From MEngine sl@0: void ActivateL(); sl@0: void Deactivate(); sl@0: void Step(); sl@0: TBool IsPending(); sl@0: void Refresh(); sl@0: TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent); sl@0: sl@0: private: sl@0: COpenVGEngine(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext); sl@0: void DrawCover(TInt i); sl@0: void NextCover(); sl@0: void PreviousCover(); sl@0: void ToggleCoverReflection(); sl@0: VGfloat GetMiddleCoverScalingFactor(VGfloat coverPosition); sl@0: sl@0: private: sl@0: RWindow& iWindow; sl@0: EGLDisplay& iDisplay; sl@0: EGLSurface& iSurface; sl@0: EGLContext& iContext; sl@0: sl@0: TPoint iOldPos; sl@0: TBool isResize; sl@0: sl@0: VGfloat iCoverLocation[KMaxCoversExample3]; sl@0: VGint iWantedCover; sl@0: TBool iHasPendingDraw; sl@0: TBool iShowCoverImage; sl@0: VGfloat iSpeedOffset; sl@0: TBool iShowMirror; sl@0: sl@0: TSize iSurfaceSize; sl@0: sl@0: VGfloat iSpeed; sl@0: RArray iImages; sl@0: TInt iCurrentImageIndex; sl@0: sl@0: VGPaint iShadowPaint; sl@0: }; sl@0: sl@0: #endif