windowing/windowserver/inc/Graphics/wsdisplaypolicy.h
author Faisal Memon <faisal.memon@nokia.com>
Fri, 14 May 2010 15:41:33 +0100
branchNewGraphicsArchitecture
changeset 64 5c983aa672ea
parent 0 5d03bc08d59c
permissions -rw-r--r--
Merge 1. Pull in cpp files in the performance enhanced Khronos RI OVG files which are newly added. I've ignored platform-specific cpp files for linux, macosx, and null operating systems because this local solution has its own platform glue (i.e. facility to target Bitmaps but no full windowing support). I've ignored sfEGLInterface.cpp because this is used as a bridge to go from EGL to Nokia's Platsim which offers an EGL service. That's not relevant to this implementation because this is ARM side code, not Intel side. I just left a comment to sfEGLInterface.cpp in case we need to pick up this later on. The current code compiles on winscw. Prior to this fix, the code works on winscw, and can launch the SVG tiger (tiger.exe). That takes about 20 seconds to render. I hope to always be able to show this icon on each commit, and the plan is for the render time to reduce with this series of submissions. On this commit, the tiger renders ok in 20 seconds.

// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "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:
//
// Description:
// Interface for Render Stage Display Policy
// 
//

#ifndef WSDISPLAYPOLICY_H_
#define WSDISPLAYPOLICY_H_

/**
@file
@publishedpartner 
@released
*/

#include <graphics/displayconfiguration.h>
#include <graphics/wsgraphicdrawerinterface.h>

class MWsDisplayPolicy: public MWsObjectProvider
	{
public:
	enum	
		{
		KUidWsDisplayPolicy	 =  0x102869FA, 	 
		ETypeId=				KUidWsDisplayPolicy,
		EWsObjectInterfaceId=	KUidWsDisplayPolicy
		};
	
	enum TDisplayStatus
		{
		EDetach = 0,
		EAttach,
		EConnecting,
		};
public:
	/**
	 * Notification from the Window Server that the application size mode list has been updated.
	 */
	virtual void NewAppModesAvailable()=0;
	/**
	 * Determine the display configuration and application rendering extent to use for a given screen size mode.
	 * 
	 * The Window Server uses this function when a request to change to a new screen size mode or new display 
	 * configuration is made by a client. The display configuration passed in may be partially filled, and the 
	 * combination of the defined entries in it and the requested screen size mode values shall be used to define 
	 * the rest of the configuration and new application extent to be used.
	 * 
	 * Only undefined entries in the configuration may be set by this function. Entries already defined must retain 
	 * the same values. If the combination of defined entries and size mode values is not acceptable to the implementer, 
	 * the function shall return KErrArgument.
	 * 
	 * If the function returns KErrNone, the Window Server shall set the returned display configuration, notify render 
	 * stages of the new application extent and change to use the screen size mode. If either this function returns 
	 * EFalse or the call to set the display configuration fails for any reason (such as KErrNoMemory, for example), 
	 * then no further changes are made.
	 * 
	 * @see MWsScreenConfigList
	 * @see MWsDisplayMapping
	 * 
	 * @param aScreenSizeMode The requested screen size mode. If static, the size in pixels, size in twips, and 
	 * the rotation must be respected. If dynamic, only the rotation must be respected.
	 * @param aConfig The requested display configuration on input, the required configuration on return. Only 
	 * undefined entries may be set.
	 * @param aExtent The screen size mode offset and size on input, the required application offset and size on return. 
	 * If the screen driver buffer is used as the UI surface, this must be left unchanged.
	 * @return KErrNone if no error, otherwise a system wide error code
	 */
	virtual TInt GetSizeModeConfiguration(TInt aScreenSizeMode, TDisplayConfiguration& aConfig, TRect& aSizeModePosition) const =0;
	virtual TInt SuitableAppMode(TDisplayStatus aSituation)=0;
	/**
	 * Sets the application mode resumed to after a display is connected again after a disconnect.
	 * 
	 * @param aMode The application mode.
	 */
	virtual void SetLastAppMode(TInt aMode)=0;
	};

#endif /*WSDISPLAYPOLICY_H_*/