examples/Graphics/coverflow/inc/openvgengine.h

Go to the documentation of this file.
00001 // openvgengine.h
00002 //
00003 /*
00004  * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
00005  * All rights reserved.
00006  * This component and the accompanying materials are made available
00007  * under the terms of "Eclipse Public License v1.0"
00008  * which accompanies this distribution, and is available
00009  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
00010  */
00015 #ifndef __OPENVGENGINE_H__
00016 #define __OPENVGENGINE_H__
00017 
00018 #include <VG/openvg.h>
00019 #include <EGL/egl.h>
00020 #include "engine.h"
00021 // image Height/Width
00022 const TInt KImageSize = 128;
00023 
00024 // KMaxDisplayCoversExample3 refers to the number of album covers
00025 // visible on the screen at any given point
00026 const TInt KMaxDisplayCoversExample3 = 40;
00027 const TInt KMaxDisplayLeftExample3 = -3;
00028 const TInt KMaxDisplayRightExample3 = 3;
00029 
00030 
00031 // the max number of covers you can store
00032 const TInt KMaxCoversExample3 = 40;
00033 
00038 class  COpenVGEngine :  public CBase, public MEngine
00039         {
00040 public:
00041 
00042         static COpenVGEngine* NewL(TSize aSize,EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
00043         virtual ~COpenVGEngine();
00044         TInt GetSpeed();
00045         //From MEngine
00046         void ActivateL();
00047         void Deactivate();
00048         void Step();
00049         TBool IsPending();
00050         TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent);
00051 
00052 
00053 private:
00054         COpenVGEngine(TSize aSize,EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
00055 
00056         void DrawCover(TInt i);
00057 
00058         void NextCover();
00059         void PreviousCover();
00060 
00061         void ToggleCoverReflection();
00062         VGfloat GetMiddleCoverScalingFactor(VGfloat coverPosition);
00063 
00064 
00065 private:
00069         EGLDisplay& iDisplay;
00073         EGLSurface& iSurface;
00077         EGLContext& iContext;
00081         VGImage iImage;
00085         VGfloat iCoverLocation[KMaxCoversExample3];
00089         VGint iWantedCover;
00093     TBool iHasPendingDraw;
00097         VGfloat iSpeedOffset;
00101         TBool iShowMirror;
00105         TSize iSurfaceSize;
00109         VGfloat iSpeed;
00113         RArray<VGImage> iImages;
00117         TInt iCurrentImageIndex;
00121         VGPaint iShadowPaint;
00122         };
00123 
00124 
00125 #endif

Generated by  doxygen 1.6.2