Direct demonstrates the window server's direct screen area (CDirectScreenAccess) interface.
The example has an engine, CLifeEngine, for the famous "Game of Life" algorithm, which generates grids of cells, each update being derived by simple rules from the previous generation. The initial configuration of the cells is random.
The UI simply has little user interaction. It simply draws the current grid using CDirectScreenAccess, and requests the engine to generate the next update. The UI classes are:
CDirectDisplayLife: the object that draws the grid through a CDirectScreenAccess, and which implements the API's MDirectScreenAccess callback interface, so that the window server can indicate when conditions (e.g. overlaying windows) change
CExampleAppView: the application's window, which owns the CDirectDisplayLife object
CExampleAppUi: handles commands and calls the view appropriately
Click on the following link to download the example: Direct.zip
Click: browse to view the example code.
While the DSA is in operation, the client should not make any call to the Window Server (WSERV) that will affect the visible area of the window in which the DSA is taking place. If this happens, it will cause a temporary deadlock (since the client will be waiting for WSERV to make the requested window rearrangement, and WSERV will be waiting for the client to acknowledge that the DSA has aborted).
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.