graphics_plat/surfacemanager_api/inc/surfacemanager.h
author bdonegan
Fri, 22 Oct 2010 10:41:04 +0100
branchbug235_bringup_0
changeset 203 71a455a885b7
parent 153 d8f29c307082
permissions -rwxr-xr-x
Code to draw a line
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
153
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     1
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     2
// All rights reserved.
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     3
// This component and the accompanying materials are made available
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     5
// which accompanies this distribution, and is available
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     7
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     8
// Initial Contributors:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
     9
// Nokia Corporation - initial contribution.
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    10
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    11
// Contributors:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    12
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    13
// Description:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    14
// Surface Manager API
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    15
// 
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    16
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    17
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    18
/**
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    19
 @file
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    20
 @publishedPartner
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    21
 @prototype
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    22
*/
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    23
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    24
#ifndef __SURFACEMANAGER_H__
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    25
#define __SURFACEMANAGER_H__
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    26
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    27
#ifndef __KERNEL_MODE__
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    28
#include <e32std.h>
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    29
#endif
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    30
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    31
#include <e32cmn.h>
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    32
#include <e32ver.h>
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    33
#include <pixelformats.h>
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    34
#include <graphics/surface.h>
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    35
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    36
class RSurfaceManagerDriver;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    37
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    38
/**
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    39
RSurface Manager User API.
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    40
*/
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    41
class RSurfaceManager
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    42
	{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    43
public:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    44
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    45
	class THintPair
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    46
		{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    47
	public:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    48
		/** UID key number */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    49
		TUid iKey;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    50
		/** Integer key value */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    51
		TInt iValue;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    52
		/** Is the value modifiable */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    53
		TBool iMutable;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    54
	public:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    55
		inline void Set(TUid aKey,TInt aValue,TBool aMutable);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    56
		};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    57
	
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    58
	enum TCacheAttribute
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    59
		{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    60
		/** CPU cached */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    61
		ECached = 0,
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    62
		/** Non CPU cached */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    63
		ENotCached = 1
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    64
		};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    65
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    66
	class TSurfaceCreationAttributes
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    67
		{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    68
	public:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    69
		/** Width and height of the surface in pixels. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    70
		TSize iSize;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    71
		/** Number of buffers in the surface. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    72
		TInt iBuffers;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    73
		/** The pixel format. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    74
		TUidPixelFormat iPixelFormat;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    75
		/** Minimum or required number of bytes between start of one line and
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    76
		start of next. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    77
		TInt iStride;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    78
		/** Minimum or required offset to the first buffer from the base of the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    79
		chunk. Typically this will be set to 0. The value specified for the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    80
		offset must comply with the alignment specified in iAlignment.
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    81
		
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    82
		If iAlignment is page aligned, this value will be rounded up to a
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    83
		multiple of the page size when the surface is created, therefore the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    84
		surface info must be queried for the actual value used. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    85
		TInt iOffsetToFirstBuffer;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    86
		/** Alignment applied to the base address of each buffer in the surface:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    87
		1, 2, 4, 8 ,16, 32, 64 bytes or EPageAligned. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    88
		TInt iAlignment;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    89
		/** Require physically contiguous memory. This value will be ignored if
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    90
		using a chunk which already exists. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    91
		TBool iContiguous;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    92
		/** Caching attribute to create chunk memory. This value will be 
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    93
		ignored if using a chunk which already exists. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    94
		TCacheAttribute iCacheAttrib;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    95
		/** Minimum or required offset between the start of one buffer and the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    96
		start of the next one in bytes. When set to 0 the surface manager will
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    97
	   	choose how buffers are laid out within the chunk. If it is too small
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    98
		and doesn't fit with the alignment, CreateSurface() will return
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
    99
		KErrArgument. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   100
		TInt iOffsetBetweenBuffers;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   101
		/** Array of hints which should be associated with the surface. This
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   102
		array must not contain duplicate hint keys. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   103
		THintPair* iSurfaceHints;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   104
		/** Number of hints in the array iSurfaceHints. The number should not
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   105
		exceed the maximum number supported by the surface manager, see 
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   106
		GetSurfaceManagerAttrib(EMaxNumberOfHints). */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   107
		TInt iHintCount;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   108
		/** Should the surface be mappable. If EFalse any call to MapSurface()
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   109
		will fail with KErrNotSupported -- Note, some architectures may not
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   110
		support mappable surfaces. */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   111
		TBool iMappable;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   112
	public:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   113
		inline TSurfaceCreationAttributes();
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   114
		};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   115
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   116
	class TSurfaceInfoV01
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   117
		{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   118
	public:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   119
		/** Width and height of the surface in pixels */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   120
		TSize iSize;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   121
		/** Number of buffers in the surface */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   122
		TInt iBuffers;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   123
		/** The pixel format */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   124
		TUidPixelFormat iPixelFormat;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   125
		/** Number of bytes between start of one line and start of next */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   126
		TInt iStride;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   127
		/** Has physically contiguous memory */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   128
		TBool iContiguous;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   129
		/** Specified if the underlying chunk is CPU cached or not */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   130
		TCacheAttribute iCacheAttrib;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   131
		/** ETrue if the surface can be mapped */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   132
		TBool iMappable;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   133
		};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   134
	
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   135
	enum TSurfaceManagerAttrib
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   136
		{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   137
		/** Maximum number of hints per surface */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   138
		EMaxNumberOfHints = 0x0 
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   139
		};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   140
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   141
	/** Package buf used to pass information about a surface from the driver */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   142
	typedef TPckgBuf<TSurfaceInfoV01> TInfoBuf;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   143
	/** Package buf used to pass the surface creation attributes to the device driver */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   144
	typedef TPckgBuf<TSurfaceCreationAttributes> TSurfaceCreationAttributesBuf;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   145
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   146
	enum TSyncOperation
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   147
		{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   148
		/** Synchronize before non CPU hardware reads from the memory, i.e. if the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   149
		buffer is cached and may have been written to by the CPU, this type of
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   150
		synchronisation should be used before a peripheral is used to read from the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   151
		buffer's memory */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   152
		ESyncBeforeNonCPURead,
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   153
		/** Synchronize before non CPU hardware writes to the memory, i.e. if the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   154
		buffer is cached and may have been written to by the CPU, this type of
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   155
		synchronisation should be used before a peripheral is used to write to the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   156
		buffer's memory */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   157
		ESyncBeforeNonCPUWrite,
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   158
		/** Synchronize after non CPU hardware writes to the memory, i.e. if the
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   159
		buffer is cached, this type of synchronisation should be used after a
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   160
		peripheral has been used to write to the buffer's memory */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   161
		ESyncAfterNonCPUWrite
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   162
		};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   163
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   164
	enum TPageAlignment
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   165
		{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   166
		/** Specifies iAlignment is a page alignment */
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   167
		EPageAligned = -1
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   168
		};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   169
	
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   170
public:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   171
#ifndef __KERNEL_MODE__
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   172
	IMPORT_C RSurfaceManager();
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   173
	IMPORT_C TInt Open();
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   174
	IMPORT_C void Close();
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   175
	IMPORT_C TInt CreateSurface(const TSurfaceCreationAttributesBuf& aReqs, TSurfaceId& aSurfaceId);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   176
	IMPORT_C TInt CreateSurface(const TSurfaceCreationAttributesBuf& aReqs, TSurfaceId& aSurfaceId, const RChunk& aChunkHandle);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   177
	IMPORT_C TInt OpenSurface(const TSurfaceId& aSurfaceId);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   178
	IMPORT_C TInt CloseSurface(const TSurfaceId& aSurfaceId);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   179
	IMPORT_C TInt MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   180
	IMPORT_C TInt SurfaceInfo(const TSurfaceId& aSurfaceId, TInfoBuf& aInfo);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   181
	IMPORT_C TInt SynchronizeCache(const TSurfaceId& aSurfaceId, TInt aBuffer, TSyncOperation aOperation);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   182
	IMPORT_C TInt GetSurfaceManagerAttrib(TSurfaceManagerAttrib aAttrib, TInt& aValue);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   183
	IMPORT_C TInt GetSurfaceHint(const TSurfaceId& aSurfaceId, THintPair& aHint);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   184
	IMPORT_C TInt SetSurfaceHint(const TSurfaceId& aSurfaceId, const THintPair& aHint);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   185
	IMPORT_C TInt AddSurfaceHint(const TSurfaceId&aSurface, const THintPair& aHint);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   186
	IMPORT_C TInt GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset);
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   187
#endif	//__KERNEL_MODE__	
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   188
private:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   189
	inline RSurfaceManagerDriver& Driver();
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   190
private:
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   191
	TInt32 iDriverBuf[4];
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   192
	};
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   193
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   194
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   195
// THintPair inline
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   196
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   197
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   198
/**
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   199
Sets key, value and mutability of the hint.
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   200
@param aKeyUid The UID of the key
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   201
@param aValue The value of the hint
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   202
@param aMutable ETrue if the hint value is mutable
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   203
*/
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   204
inline void RSurfaceManager::THintPair::Set(TUid aKeyUid,TInt aValue,TBool aMutable)
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   205
	{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   206
	iKey = aKeyUid;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   207
	iValue = aValue;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   208
	iMutable = aMutable;
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   209
	}
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   210
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   211
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   212
// TSurfaceCreationAttributes inline
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   213
//
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   214
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   215
/**
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   216
Default constructor, zero initializes all attributes.
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   217
*/
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   218
inline RSurfaceManager::TSurfaceCreationAttributes::TSurfaceCreationAttributes()
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   219
	{
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   220
	memclr(this, sizeof(TSurfaceCreationAttributes));
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   221
	}
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   222
d8f29c307082 Add export of def files, add requesthandlerextension import library, and fix files to to unix line ending
Faisal Memon <faisal.memon@nokia.com>
parents: 146
diff changeset
   223
#endif //__SURFACEMANAGER_H__