graphicstest/uibench/s60/src/openvgengine.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1  // Copyright (c) 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 #ifndef OPENVGENGINE_H_
       
    18 #define OPENVGENGINE_H_
       
    19 
       
    20 
       
    21 #include "engine.h"
       
    22 
       
    23 #include <VG/openvg.h>
       
    24 #include <EGL/egl.h>
       
    25 
       
    26 
       
    27 const TInt KMaxDisplayCoversExample3 = 40;
       
    28 const TInt KMaxDisplayLeftExample3 = -3;
       
    29 const TInt KMaxDisplayRightExample3 = 3;
       
    30 
       
    31 // the max number of covers visible on the screen at any given time
       
    32 const TInt KMaxCoversExample3 = 40;
       
    33 
       
    34 
       
    35 class  COpenVGEngine : public CBase, public MEngine
       
    36 	{
       
    37 public: 
       
    38 	static COpenVGEngine* NewL(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
       
    39 	~COpenVGEngine();
       
    40 	TInt GetSpeed();
       
    41 	
       
    42 	// From MEngine
       
    43 	void ActivateL();
       
    44 	void Deactivate();	
       
    45 	void Step();
       
    46 	TBool IsPending();
       
    47 	void Refresh();
       
    48 	TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent);
       
    49 	
       
    50 private: 
       
    51 	COpenVGEngine(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
       
    52 	void DrawCover(TInt i);
       
    53 	void NextCover();
       
    54 	void PreviousCover();		
       
    55 	void ToggleCoverReflection();
       
    56 	VGfloat GetMiddleCoverScalingFactor(VGfloat coverPosition);
       
    57 	
       
    58 private:
       
    59     RWindow& iWindow;
       
    60     EGLDisplay& iDisplay;
       
    61     EGLSurface& iSurface;
       
    62     EGLContext& iContext;
       
    63     
       
    64 	TPoint iOldPos;
       
    65 	TBool isResize;
       
    66 		
       
    67 	VGfloat iCoverLocation[KMaxCoversExample3];
       
    68 	VGint iWantedCover;
       
    69     TBool iHasPendingDraw;
       
    70 	TBool iShowCoverImage;
       
    71 	VGfloat iSpeedOffset;
       
    72 	TBool iShowMirror;
       
    73 	
       
    74 	TSize iSurfaceSize;
       
    75 	
       
    76 	VGfloat iSpeed;
       
    77 	RArray<VGImage> iImages;
       
    78 	TInt iCurrentImageIndex;	
       
    79 
       
    80 	VGPaint iShadowPaint;
       
    81 	};
       
    82 
       
    83 #endif