graphicscompositionref/surfacemgrcommon/inc/surfacemanagerdriver.h
author Faisal Memon <faisal.memon@nokia.com>
Mon, 16 Aug 2010 10:28:15 +0100
changeset 0 91fe342bd9c4
permissions -rwxr-xr-x
Provide code to deliver both syborg and reference implementations of surface manager.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     7
//
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    10
//
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    11
// Contributors:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    12
//
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    13
// Description:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    14
// Surface Manager Implementation
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    15
// 
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    16
//
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    17
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    18
/**
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    19
@file
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    20
@internalComponent
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    21
@prototype
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    22
*/
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    23
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    24
#ifndef __SURFACEMANAGERDRIVER_H__
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    25
#define __SURFACEMANAGERDRIVER_H__
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    26
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    27
#include <graphics/surfacemanager.h>
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    28
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    29
/**
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    30
RSurface Manager driver. This is a simple user side interface class derived from RBusLogicalChannel
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    31
with each surface manager function implemented with a call to DoControl
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    32
*/
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    33
class RSurfaceManagerDriver : public RBusLogicalChannel
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    34
	{
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    35
public:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    36
	
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    37
	/** Package class to exchange data between the client interface of the driver (RSurfaceManagerDriver)
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    38
	 * and the kernel extension which implement it (DSurfaceManger)*/
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    39
	class TDeviceParam
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    40
		{
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    41
	public:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    42
		TDeviceParam(){}
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    43
		TDeviceParam(TAny* aSurfaceId, TAny* aBuffer) : iSurfaceId(aSurfaceId), iBuffer(aBuffer) {}
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    44
		/** Generic object used to pass as a parameter to device driver*/
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    45
		TAny* iBuffer;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    46
		/** Generic object used to pass as a parameter to device driver*/
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    47
		TAny* iSurfaceId;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    48
		};
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    49
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    50
	class TCaps
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    51
		{
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    52
	public:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    53
		TVersion iVersion;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    54
		};
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    55
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    56
public:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    57
#ifndef __KERNEL_MODE__
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    58
	inline TInt CreateSurface(const RSurfaceManager::TSurfaceCreationAttributesBuf& aReqs, TSurfaceId& aSurfaceId);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    59
	inline TInt CreateSurface(const RSurfaceManager::TSurfaceCreationAttributesBuf& aReqs, TSurfaceId& aSurfaceId, const RChunk& aChunkHandle);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    60
	inline TInt OpenSurface(const TSurfaceId& aSurfaceId);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    61
	inline TInt CloseSurface(const TSurfaceId& aSurfaceId);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    62
	inline TInt MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    63
	inline TInt SurfaceInfo(const TSurfaceId& aSurfaceId, RSurfaceManager::TInfoBuf& aInfo);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    64
	inline TInt Open();
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    65
	inline TInt SynchronizeCache(const TSurfaceId& aSurfaceId, TInt aBuffer, RSurfaceManager::TSyncOperation aOperation);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    66
	inline TInt GetSurfaceHint(const TSurfaceId& aSurfaceId, RSurfaceManager::THintPair& aHint);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    67
	inline TInt SetSurfaceHint(const TSurfaceId& aSurfaceId, const RSurfaceManager::THintPair& aHint);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    68
	inline TInt AddSurfaceHint(const TSurfaceId&aSurface, const RSurfaceManager::THintPair& aHint);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    69
	inline TInt GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    70
	inline TInt GetSurfaceManagerAttrib(RSurfaceManager::TSurfaceManagerAttrib aAttrib, TInt& aValue);
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    71
#endif	//__KERNEL_MODE__
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    72
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    73
	inline static const TDesC& Name();
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    74
	inline static TVersion VersionRequired();	
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    75
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    76
private:
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    77
	enum TSurfaceManagerControl
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    78
		{
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    79
		EControlCreateSurface,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    80
		EControlOpenSurface,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    81
		EControlCloseSurface,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    82
		EControlAccessSurfaceData,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    83
		EControlSurfaceInfo,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    84
		EControlCreateSurfaceEx,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    85
		EControlSynchronizeCache,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    86
		EControlGetSurfaceHint,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    87
		EControlSetSurfaceHint,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    88
		EControlAddSurfaceHint,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    89
		EControlGetBufferOffset,
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    90
		EControlGetSurfaceManagerAttrib
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    91
		};
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    92
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    93
	friend class DSurfaceManagerChannel;
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    94
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    95
	};
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    96
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    97
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    98
#include "surfacemanagerdriver.inl"
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
    99
91fe342bd9c4 Provide code to deliver both syborg and reference implementations of surface manager.
Faisal Memon <faisal.memon@nokia.com>
parents:
diff changeset
   100
#endif	//__SURFACEMANAGERDRIVER_H__