uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h
changeset 0 15bf7259bb7c
child 8 10534483575f
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     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 
       
    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 "sensor.h"
       
    30 
       
    31 #include "../../../../uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h"
       
    32 
       
    33 class CBgAnimHost : public CBase, public MAlfCompositionObserver, public MSensrvDataListener
       
    34     {
       
    35     public:
       
    36         void ConstructL();
       
    37         CBgAnimHost();
       
    38         ~CBgAnimHost();
       
    39         void ExecuteL();
       
    40         
       
    41         static TInt TimerFunc(TAny* aPtr);
       
    42         
       
    43         // from MAlfCompositionObserver
       
    44         void FrameReady(TInt aScreenNumber);
       
    45         void RunningLowOnGraphicsMemory();
       
    46         void GraphicsMemoryGood(); 
       
    47         void CompositionTargetHidden();
       
    48         void CompositionTargetVisible();
       
    49         
       
    50         // from MSensrvDataListener
       
    51         void DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost );
       
    52         void DataError( CSensrvChannel& aChannel, TSensrvErrorSeverity aError );
       
    53         void GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface);
       
    54         
       
    55         
       
    56     protected:
       
    57         void CreateWindowL();
       
    58         void DestroyWindow();
       
    59         void InitEGLL();
       
    60         void ReleaseEGL();
       
    61         void CreateWindowSurfaceL();
       
    62         void ReleaseWindowSurface(TBool aReleaseObserver = ETrue);
       
    63         void LoadPluginL();
       
    64         void NewFrame();
       
    65         void HandleScreenSaverEvent();
       
    66         static TInt ScreenSaverCallback(TAny* aPtr);
       
    67     private:
       
    68         // windowing stuff
       
    69         RWsSession iWsSession;
       
    70         RWindowGroup iWindowGroup;
       
    71         RWindow iWindow;
       
    72         CApaWindowGroupName* iWindGroupName;
       
    73         CWsScreenDevice* iScreenDevice;
       
    74         TSize iDisplaySize;
       
    75         TSize iRealDisplaySize;
       
    76         
       
    77         // EGL stuff
       
    78         EGLDisplay iEGLDisplay;
       
    79         EGLConfig  iEGLConfig;
       
    80         EGLContext iEGLContext;
       
    81         EGLSurface iEGLSurface;
       
    82         
       
    83         // plugin
       
    84         RLibrary iPluginLibrary;
       
    85         plugin_export_v1_t* iPlugin;
       
    86 
       
    87         // timer
       
    88         CHighResTimer* iTimer;
       
    89         TBool iTimerRunning;
       
    90         
       
    91         TBool iEGLInitialized;
       
    92         TBool iSurfaceInitialized;
       
    93         
       
    94         // composition API
       
    95         CAlfCompositionSource* iCompSource;
       
    96         
       
    97         TBool iRunning;
       
    98     
       
    99         CThemeRepositoryListener* iThemeRepositoryListener;
       
   100         CScreenSaverPropertyListener* iSCPropertyListener;
       
   101 
       
   102         RPointerArray<CSensorListener> iSensorListeners;
       
   103 
       
   104     };