examples/SFExamples/GfxWorkbench/src/GfxDirectScreenView.cpp

00001 /*
00002 Copyright (c) 2002-2011 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003 
00004 Redistribution and use in source and binary forms, with or without
00005 modification, are permitted provided that the following conditions are met:
00006 
00007 * Redistributions of source code must retain the above copyright notice, this
00008   list of conditions and the following disclaimer.
00009 * Redistributions in binary form must reproduce the above copyright notice,
00010   this list of conditions and the following disclaimer in the documentation
00011   and/or other materials provided with the distribution.
00012 * Neither the name of Nokia Corporation nor the names of its contributors
00013   may be used to endorse or promote products derived from this software
00014   without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 
00027 Description:  Application view implementation
00028 */
00029 
00030 
00031 
00032 // INCLUDE FILES
00033 #include <coemain.h>
00034 #include <EIKENV.H>
00035 #include "GfxDirectScreenView.h"
00036 #include "CGfxDirectAccess.h"
00037 #include "GfxVideoPlayer.h"
00038 
00039 // ============================ MEMBER FUNCTIONS ===============================
00040 
00041 // -----------------------------------------------------------------------------
00042 // CGfxDirectScreenView::NewL()
00043 // Two-phased constructor.
00044 // -----------------------------------------------------------------------------
00045 //
00046 CGfxDirectScreenView* CGfxDirectScreenView::NewL( const TRect& aRect )
00047         {
00048         CGfxDirectScreenView* self = CGfxDirectScreenView::NewLC( aRect );
00049         CleanupStack::Pop( self );
00050         return self;
00051         }
00052 
00053 // -----------------------------------------------------------------------------
00054 // CGfxDirectScreenView::NewLC()
00055 // Two-phased constructor.
00056 // -----------------------------------------------------------------------------
00057 //
00058 CGfxDirectScreenView* CGfxDirectScreenView::NewLC( const TRect& aRect )
00059         {
00060         CGfxDirectScreenView* self = new ( ELeave ) CGfxDirectScreenView;
00061         CleanupStack::PushL( self );
00062         self->ConstructL( aRect );
00063         return self;
00064         }
00065 
00066 // -----------------------------------------------------------------------------
00067 // CGfxDirectScreenView::ConstructL()
00068 // Symbian 2nd phase constructor can leave.
00069 // -----------------------------------------------------------------------------
00070 //
00071 void CGfxDirectScreenView::ConstructL( const TRect& aRect )
00072         {
00073         // Create a window for this application view
00074         CreateWindowL();
00075 
00076         // Set the windows size
00077         SetRect( aRect );
00078 
00079 
00080         // Activate the window, which makes it ready to be drawn
00081         ActivateL();
00082         }
00083 
00084 // -----------------------------------------------------------------------------
00085 // CGfxDirectScreenView::CGfxDirectScreenView()
00086 // C++ default constructor can NOT contain any code, that might leave.
00087 // -----------------------------------------------------------------------------
00088 //
00089 CGfxDirectScreenView::CGfxDirectScreenView()
00090         {
00091         // No implementation required
00092         }
00093 
00094 
00095 // -----------------------------------------------------------------------------
00096 // CGfxDirectScreenView::~CGfxDirectScreenView()
00097 // Destructor.
00098 // -----------------------------------------------------------------------------
00099 //
00100 CGfxDirectScreenView::~CGfxDirectScreenView()
00101         {
00102         // No implementation required
00103         delete iDirectDisplay;
00104         }
00105 
00106 
00107 // -----------------------------------------------------------------------------
00108 // CGfxDirectScreenView::Draw()
00109 // Draws the display.
00110 // -----------------------------------------------------------------------------
00111 //
00112 void CGfxDirectScreenView::Draw( const TRect& /*aRect*/ ) const
00113         {
00114         // Get the standard graphics context
00115         /*CWindowGc& gc = SystemGc();
00116 
00117         // Gets the control's extent
00118         TRect drawRect( Rect());
00119 
00120         // Clears the screen
00121         gc.Clear( drawRect );
00122         */
00123         }
00124 
00125 // -----------------------------------------------------------------------------
00126 // CGfxDirectScreenView::SizeChanged()
00127 // Called by framework when the view size is changed.
00128 // -----------------------------------------------------------------------------
00129 //
00130 void CGfxDirectScreenView::SizeChanged()
00131         {  
00132         DrawNow();
00133         }
00134 // End of File
00135 
00136 void CGfxDirectScreenView::StartL(TBool aGcMode)
00137         {
00138         
00139         const TRect dsaRect =  TRect(PositionRelativeToScreen(),Size());
00140     
00141           // Set up direct displayer for life engine
00142     iDirectDisplay = new (ELeave) CGfxDirectAccess (
00143         iEikonEnv->WsSession(),      // Window server session
00144         Window(),dsaRect,aGcMode          // The window itself
00145         );
00146     iDirectDisplay -> ConstructL();
00147         
00148         iDirectDisplay->StartL();
00149         
00150         }
00151         
00152 void CGfxDirectScreenView::StopL()
00153 {
00154 }

Generated by  doxygen 1.6.2