examples/Graphics/WS/Direct/CDirectDisplayLife.h

00001 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 #if !defined(__DIRECT_H__)
00017 #define __DIRECT_H__
00018 
00019 #include <w32std.h>
00020 
00021 #include "CLifeEngine.h"
00022 
00023 // Displays a running Game of Life using DSA API
00024 class CDirectDisplayLife : 
00025         public CTimer,                          
00026         public MDirectScreenAccess      // Call backs from DSA
00027         {
00028 public:
00029         // Construction & destruction
00030         CDirectDisplayLife (RWsSession& aClient, 
00031                 RWindow& aWindow, 
00032                 CLifeEngine& aLifeEngine);
00033         ~CDirectDisplayLife ();
00034         void ConstructL();
00035 
00036         // Start game display
00037         void StartL();
00038         
00039         // Implement MDirectScreenAccess
00040         void Restart(RDirectScreenAccess::TTerminationReasons aReason);
00041         void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
00042 
00043 private:
00044         // Implement CTimer
00045         void RunL();
00046         void DoCancel();
00047 
00048 private:
00049         // Window server handling
00050         RWsSession& iClient;
00051         RWindow& iWindow;
00052 
00053         // DSA objects
00054         CDirectScreenAccess* iDirectScreenAccess;
00055         CFbsBitGc* iGc;
00056         RRegion* iRegion;
00057 
00058         // Drawing constants
00059         static const TInt KBlockSize;
00060         static const TInt KGenerationInterval;
00061         static const TInt iXOrigin;
00062         static const TInt iYOrigin;
00063 
00064         // Life game engine
00065         CLifeEngine& iLifeEngine;
00066         };
00067 
00068 #endif //__DIRECT_H__

Generated by  doxygen 1.6.2