sl@0
|
1 |
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
|
sl@0
|
17 |
#ifndef OPENVGENGINE_H_
|
sl@0
|
18 |
#define OPENVGENGINE_H_
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
#include "engine.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
#include <VG/openvg.h>
|
sl@0
|
24 |
#include <EGL/egl.h>
|
sl@0
|
25 |
|
sl@0
|
26 |
|
sl@0
|
27 |
const TInt KMaxDisplayCoversExample3 = 40;
|
sl@0
|
28 |
const TInt KMaxDisplayLeftExample3 = -3;
|
sl@0
|
29 |
const TInt KMaxDisplayRightExample3 = 3;
|
sl@0
|
30 |
|
sl@0
|
31 |
// the max number of covers visible on the screen at any given time
|
sl@0
|
32 |
const TInt KMaxCoversExample3 = 40;
|
sl@0
|
33 |
|
sl@0
|
34 |
|
sl@0
|
35 |
class COpenVGEngine : public CBase, public MEngine
|
sl@0
|
36 |
{
|
sl@0
|
37 |
public:
|
sl@0
|
38 |
static COpenVGEngine* NewL(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
|
sl@0
|
39 |
~COpenVGEngine();
|
sl@0
|
40 |
TInt GetSpeed();
|
sl@0
|
41 |
|
sl@0
|
42 |
// From MEngine
|
sl@0
|
43 |
void ActivateL();
|
sl@0
|
44 |
void Deactivate();
|
sl@0
|
45 |
void Step();
|
sl@0
|
46 |
TBool IsPending();
|
sl@0
|
47 |
void Refresh();
|
sl@0
|
48 |
TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent);
|
sl@0
|
49 |
|
sl@0
|
50 |
private:
|
sl@0
|
51 |
COpenVGEngine(RWindow& aWindow, EGLDisplay& aDisplay, EGLSurface& aSurface, EGLContext& aContext);
|
sl@0
|
52 |
void DrawCover(TInt i);
|
sl@0
|
53 |
void NextCover();
|
sl@0
|
54 |
void PreviousCover();
|
sl@0
|
55 |
void ToggleCoverReflection();
|
sl@0
|
56 |
VGfloat GetMiddleCoverScalingFactor(VGfloat coverPosition);
|
sl@0
|
57 |
|
sl@0
|
58 |
private:
|
sl@0
|
59 |
RWindow& iWindow;
|
sl@0
|
60 |
EGLDisplay& iDisplay;
|
sl@0
|
61 |
EGLSurface& iSurface;
|
sl@0
|
62 |
EGLContext& iContext;
|
sl@0
|
63 |
|
sl@0
|
64 |
TPoint iOldPos;
|
sl@0
|
65 |
TBool isResize;
|
sl@0
|
66 |
|
sl@0
|
67 |
VGfloat iCoverLocation[KMaxCoversExample3];
|
sl@0
|
68 |
VGint iWantedCover;
|
sl@0
|
69 |
TBool iHasPendingDraw;
|
sl@0
|
70 |
TBool iShowCoverImage;
|
sl@0
|
71 |
VGfloat iSpeedOffset;
|
sl@0
|
72 |
TBool iShowMirror;
|
sl@0
|
73 |
|
sl@0
|
74 |
TSize iSurfaceSize;
|
sl@0
|
75 |
|
sl@0
|
76 |
VGfloat iSpeed;
|
sl@0
|
77 |
RArray<VGImage> iImages;
|
sl@0
|
78 |
TInt iCurrentImageIndex;
|
sl@0
|
79 |
|
sl@0
|
80 |
VGPaint iShadowPaint;
|
sl@0
|
81 |
};
|
sl@0
|
82 |
|
sl@0
|
83 |
#endif
|