Symbian3/PDK/Source/GUID-A15C553D-9D64-5C48-9274-6DD1642CDC23.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 14 578be2adaf3e
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-A15C553D-9D64-5C48-9274-6DD1642CDC23" xml:lang="en"><title>Direct:
Direct Screen Access example</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-3CE6ED7C-72D8-5C99-8877-6FCB6C053D1D"><title>Description</title> <p> <filepath>Direct</filepath> demonstrates
the window server's direct screen area (<codeph>CDirectScreenAccess</codeph>)
interface. </p> <p>The example has an engine, <codeph>CLifeEngine</codeph>,
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. </p> <p>The UI simply has little user
interaction. It simply draws the current grid using <codeph>CDirectScreenAccess</codeph>,
and requests the engine to generate the next update. The UI classes are: </p> <ul>
<li id="GUID-155FE7BA-3FC2-5C95-89C6-295CDB0C1B0E"><p> <codeph>CDirectDisplayLife</codeph>:
the object that draws the grid through a <codeph>CDirectScreenAccess</codeph>,
and which implements the API's <codeph>MDirectScreenAccess</codeph> callback
interface, so that the window server can indicate when conditions (e.g. overlaying
windows) change </p> </li>
<li id="GUID-A01FC1E3-F76C-5892-A29D-7645263A5431"><p> <codeph>CExampleAppView</codeph>:
the application's window, which owns the <codeph>CDirectDisplayLife</codeph> object </p> </li>
<li id="GUID-8E45AD8C-642C-5DB9-8113-693BA4E0CA05"><p> <codeph>CExampleAppUi</codeph>:
handles commands and calls the view appropriately </p> </li>
</ul> </section>
<section id="GUID-C81BD7D0-C899-5A8B-B704-91B81C3E0C1A"><title>Download</title><p>Click
on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-51e33be2-ed3d-4412-8f0f-1535b86beb6f.zip" scope="external">Direct.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-51e33be2-ed3d-4412-8f0f-1535b86beb6f.html" scope="peer">browse</xref> to view the example code. </p> </section>
<section><title>Class Summary</title><p><xref href="GUID-24C7AE25-B44A-3B6F-AA05-EA90A8D36129.dita"><apiname>CDirectScreenAccess</apiname></xref></p><p><xref href="GUID-5A289A8A-1485-3AB9-94CF-177B83D4F450.dita"><apiname>MDirectScreenAccess</apiname></xref></p><p><xref href="GUID-A6B66713-FECA-3BE7-BB81-1AE5551AD83D.dita"><apiname>RNotifier</apiname></xref></p></section>
<section id="GUID-3B2CEB41-C76F-5C4A-82B8-05668190A5C6"><title>Usage</title> <p>Commands
are given to the example through its Lifemenu. The commands are: </p> <ul>
<li id="GUID-82639EB4-7E0A-5626-BC00-68E86A5E6188"><p> Start: starts or restarts
the life display </p> </li>
<li id="GUID-3BE84871-91A0-5230-96F8-F3565141CA43"><p> Test overlay: simulates
a window from another program being placed partially over the display area.
The display area is then clipped appropriately, so that the upper window is
not overwritten </p> </li>
</ul> </section>
<section id="GUID-C1EE963E-9325-5DE2-A4A9-D327218A3C6E"><title>Note
for developers</title> <p>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). </p> </section>
</conbody></concept>