openvg/openvgrefimplementation/sfopenvg/test/inc/tigerContainer.h
changeset 43 7579f232bae7
equal deleted inserted replaced
36:01a6848ebfd7 43:7579f232bae7
       
     1 /*
       
     2 * Copyright (c) 2009 Symbian Foundation Ltd
       
     3 * This component and the accompanying materials are made available
       
     4 * under the terms of the License "Eclipse Public License v1.0"
       
     5 * which accompanies this distribution, and is available
       
     6 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 *
       
     8 * Initial Contributors:
       
     9 * Symbian Foundation Ltd - initial contribution.
       
    10 * 
       
    11 * Contributors:
       
    12 *
       
    13 * Description:
       
    14 * Tiger app container class
       
    15 */
       
    16 #ifndef TIGERCONTAINER_H
       
    17 #define TIGERCONTAINER_H
       
    18 
       
    19 // INCLUDES
       
    20 #include <coecntrl.h>
       
    21 #include "tiger.h"
       
    22 #include <akndef.h>
       
    23 
       
    24 #include <eglosnativewindowtype.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29  * Container control class that handles the OpenGL ES initialization and deinitializations.
       
    30  * Also uses the CTiger class to do the actual OpenGL ES rendering.
       
    31  */
       
    32 class CTicker;
       
    33 class CTigerContainer : public CCoeControl, MCoeControlObserver
       
    34     {
       
    35     public: // Constructors and destructor
       
    36 
       
    37         /**
       
    38          * EPOC default constructor. Initializes the OpenGL ES for rendering to the window surface.
       
    39          * @param aRect Screen rectangle for container.
       
    40          */
       
    41         void ConstructL(const TRect& aRect);
       
    42 
       
    43         /**
       
    44          * Destructor. Destroys the CPeriodic, CTiger and uninitializes OpenGL ES.
       
    45          */
       
    46         virtual ~CTigerContainer();
       
    47 
       
    48     private: // Functions from base classes
       
    49 
       
    50         /**
       
    51          * Method from CoeControl that gets called when the display size changes.
       
    52          * If OpenGL has been initialized, notifies the renderer class that the screen
       
    53          * size has changed.
       
    54          */
       
    55         void SizeChanged();
       
    56 
       
    57         /**
       
    58          * Handles a change to the control's resources. This method
       
    59          * reacts to the KEikDynamicLayoutVariantSwitch event (that notifies of
       
    60          * screen size change) by calling the SetExtentToWholeScreen() again so that
       
    61          * this control fills the new screen size. This will then trigger a call to the
       
    62          * SizeChanged() method.
       
    63          * @param aType Message UID value, only KEikDynamicLayoutVariantSwitch is handled by this method.
       
    64          */
       
    65         void HandleResourceChange(TInt aType);
       
    66 
       
    67         /**
       
    68          * Method from CoeControl. Does nothing in this implementation.
       
    69          */
       
    70         TInt CountComponentControls() const;
       
    71 
       
    72         /**
       
    73          * Method from CCoeControl. Does nothing in this implementation.
       
    74          */
       
    75         CCoeControl* ComponentControl(TInt aIndex) const;
       
    76 
       
    77         /**
       
    78          * Method from CCoeControl. Does nothing in this implementation.
       
    79          * All rendering is done in the DrawCallBack() method.
       
    80          */
       
    81         void Draw(const TRect& aRect) const;
       
    82 
       
    83         /**
       
    84          * Method from MCoeControlObserver that handles an event from the observed control.
       
    85          * Does nothing in this implementation.
       
    86 		 * @param aControl   Control changing its state.
       
    87 		 * @param aEventType Type of the control event.
       
    88          */
       
    89         void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
       
    90         
       
    91         void  RenderBitmap(CWindowGc& aGc, CFbsBitmap* aBitmap) const;
       
    92         void  CopyAndRender(CWindowGc& aGc) const;
       
    93         TInt FlipVertical(CFbsBitmap& aBitmap) const;
       
    94 
       
    95     private:  //data
       
    96 
       
    97         CTiger* iTiger;
       
    98     };
       
    99 
       
   100 #endif
       
   101 
       
   102 // End of File