64
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
#include <e32base.h>
|
|
18 |
#include <w32std.h>
|
|
19 |
#include <apgwgnam.h>
|
|
20 |
#include <sensrvdatalistener.h>
|
|
21 |
#include <AknsSrvClient.h>
|
|
22 |
|
|
23 |
#include <EGL/egl.h>
|
|
24 |
|
|
25 |
#include "highrestimer.h"
|
|
26 |
#include "plugininterface.h"
|
|
27 |
#include "themerepositorylistener.h"
|
|
28 |
#include "screensaverpropertylistener.h"
|
|
29 |
#include "fgapppropertylistener.h"
|
|
30 |
#include "sensor.h"
|
|
31 |
|
|
32 |
#include "../../../../uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h"
|
|
33 |
|
|
34 |
class CBgAnimHost : public CBase, public MAlfCompositionObserver, public MSensrvDataListener, public MAknsSkinChangeObserver
|
|
35 |
{
|
|
36 |
public:
|
|
37 |
void ConstructL();
|
|
38 |
CBgAnimHost();
|
|
39 |
~CBgAnimHost();
|
|
40 |
void ExecuteL();
|
|
41 |
|
|
42 |
static TInt TimerFunc(TAny* aPtr);
|
|
43 |
static TInt ReaperFunc(TAny* aPtr);
|
|
44 |
static TInt DoomBringerFunc(TAny* aPtr);
|
|
45 |
|
|
46 |
// from MAlfCompositionObserver
|
|
47 |
void FrameReady(TInt aScreenNumber);
|
|
48 |
void RunningLowOnGraphicsMemory();
|
|
49 |
void GraphicsMemoryGood();
|
|
50 |
void CompositionTargetHidden();
|
|
51 |
void CompositionTargetVisible();
|
|
52 |
|
|
53 |
// from MSensrvDataListener
|
|
54 |
void DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost );
|
|
55 |
void DataError( CSensrvChannel& aChannel, TSensrvErrorSeverity aError );
|
|
56 |
void GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface);
|
|
57 |
|
|
58 |
// from MAknsSkinChangeObserver
|
|
59 |
void SkinContentChanged();
|
|
60 |
void SkinConfigurationChanged( const TAknsSkinStatusConfigurationChangeReason aReason );
|
|
61 |
void SkinPackageChanged( const TAknsSkinStatusPackageChangeReason aReason );
|
|
62 |
|
|
63 |
protected:
|
|
64 |
void CreateWindowL();
|
|
65 |
void DestroyWindow();
|
|
66 |
void InitEGLL();
|
|
67 |
void ReleaseEGL();
|
|
68 |
void CreateWindowSurfaceL();
|
|
69 |
void ReleaseWindowSurface(TBool aReleaseObserver = ETrue);
|
|
70 |
void LoadPluginL();
|
|
71 |
void ReleasePlugin();
|
|
72 |
void NewFrame();
|
|
73 |
void Kill();
|
|
74 |
void HandleScreenSaverEvent();
|
|
75 |
void HandleFGAppEvent();
|
|
76 |
TBool GetPluginConfigurationL();
|
|
77 |
void StartSensorsL();
|
|
78 |
void StopSensors();
|
|
79 |
static TInt ScreenSaverCallback(TAny* aPtr);
|
|
80 |
static TInt FgAppCallback(TAny* aPtr);
|
|
81 |
|
|
82 |
private:
|
|
83 |
// windowing stuff
|
|
84 |
RWsSession iWsSession;
|
|
85 |
RWindowGroup iWindowGroup;
|
|
86 |
RWindow iWindow;
|
|
87 |
CApaWindowGroupName* iWindGroupName;
|
|
88 |
CWsScreenDevice* iScreenDevice;
|
|
89 |
TSize iDisplaySize;
|
|
90 |
TSize iRealDisplaySize;
|
|
91 |
|
|
92 |
// EGL stuff
|
|
93 |
EGLDisplay iEGLDisplay;
|
|
94 |
EGLConfig iEGLConfig;
|
|
95 |
EGLContext iEGLContext;
|
|
96 |
EGLSurface iEGLSurface;
|
|
97 |
|
|
98 |
// plugin
|
|
99 |
RLibrary iPluginLibrary;
|
|
100 |
plugin_export_v1_t* iPlugin;
|
|
101 |
|
|
102 |
// timer
|
|
103 |
CHighResTimer* iTimer;
|
|
104 |
TBool iTimerRunning;
|
|
105 |
CHighResTimer* iTheReaper;
|
|
106 |
CHighResTimer* iDoomBringer;
|
|
107 |
|
|
108 |
TBool iEGLInitialized;
|
|
109 |
TBool iSurfaceInitialized;
|
|
110 |
TBool iHiddenDueSC;
|
|
111 |
|
|
112 |
// composition API
|
|
113 |
CAlfCompositionSource* iCompSource;
|
|
114 |
|
|
115 |
TBool iRunning;
|
|
116 |
|
|
117 |
CThemeRepositoryListener* iThemeRepositoryListener;
|
|
118 |
CScreenSaverPropertyListener* iSCPropertyListener;
|
|
119 |
CFGAppPropertyListener *iHSFgStatusPropertyListener;
|
|
120 |
|
|
121 |
RPointerArray<CSensorListener> iSensorListeners;
|
|
122 |
TBool iSensorsStopped;
|
|
123 |
|
|
124 |
RAknsSrvSession iSkinSrv;
|
|
125 |
HBufC* iCurrentPluginDllName;
|
|
126 |
HBufC* iCurrentPluginAssetDir;
|
|
127 |
TBool iIsUIReady;
|
|
128 |
|
|
129 |
TBool iReaped;
|
|
130 |
|
|
131 |
TBool iWindowVisible;
|
|
132 |
};
|