os/graphics/graphicstest/uibench/s60/src/openvgengine.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicstest/uibench/s60/src/openvgengine.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,83 @@
     1.4 + // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 + // All rights reserved.
     1.6 + // This component and the accompanying materials are made available
     1.7 + // under the terms of "Eclipse Public License v1.0"
     1.8 + // which accompanies this distribution, and is available
     1.9 + // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 + //
    1.11 + // Initial Contributors:
    1.12 + // Nokia Corporation - initial contribution.
    1.13 + //
    1.14 + // Contributors:
    1.15 + //
    1.16 + // Description:
    1.17 + //
    1.18 +
    1.19 +
    1.20 +#ifndef OPENVGENGINE_H_
    1.21 +#define OPENVGENGINE_H_
    1.22 +
    1.23 +
    1.24 +#include "engine.h"
    1.25 +
    1.26 +#include <VG/openvg.h>
    1.27 +#include <EGL/egl.h>
    1.28 +
    1.29 +
    1.30 +const TInt KMaxDisplayCoversExample3 = 40;
    1.31 +const TInt KMaxDisplayLeftExample3 = -3;
    1.32 +const TInt KMaxDisplayRightExample3 = 3;
    1.33 +
    1.34 +// the max number of covers visible on the screen at any given time
    1.35 +const TInt KMaxCoversExample3 = 40;
    1.36 +
    1.37 +
    1.38 +class  COpenVGEngine : public CBase, public MEngine
    1.39 +	{
    1.40 +public: 
    1.41 +	static COpenVGEngine* NewL(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
    1.42 +	~COpenVGEngine();
    1.43 +	TInt GetSpeed();
    1.44 +	
    1.45 +	// From MEngine
    1.46 +	void ActivateL();
    1.47 +	void Deactivate();	
    1.48 +	void Step();
    1.49 +	TBool IsPending();
    1.50 +	void Refresh();
    1.51 +	TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent);
    1.52 +	
    1.53 +private: 
    1.54 +	COpenVGEngine(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
    1.55 +	void DrawCover(TInt i);
    1.56 +	void NextCover();
    1.57 +	void PreviousCover();		
    1.58 +	void ToggleCoverReflection();
    1.59 +	VGfloat GetMiddleCoverScalingFactor(VGfloat coverPosition);
    1.60 +	
    1.61 +private:
    1.62 +    RWindow& iWindow;
    1.63 +    EGLDisplay& iDisplay;
    1.64 +    EGLSurface& iSurface;
    1.65 +    EGLContext& iContext;
    1.66 +    
    1.67 +	TPoint iOldPos;
    1.68 +	TBool isResize;
    1.69 +		
    1.70 +	VGfloat iCoverLocation[KMaxCoversExample3];
    1.71 +	VGint iWantedCover;
    1.72 +    TBool iHasPendingDraw;
    1.73 +	TBool iShowCoverImage;
    1.74 +	VGfloat iSpeedOffset;
    1.75 +	TBool iShowMirror;
    1.76 +	
    1.77 +	TSize iSurfaceSize;
    1.78 +	
    1.79 +	VGfloat iSpeed;
    1.80 +	RArray<VGImage> iImages;
    1.81 +	TInt iCurrentImageIndex;	
    1.82 +
    1.83 +	VGPaint iShadowPaint;
    1.84 +	};
    1.85 +
    1.86 +#endif