os/graphics/graphicsutils/commongraphicsheaders/inc/surface.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsutils/commongraphicsheaders/inc/surface.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,91 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// surface
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @publishedPartner
    1.24 + @released
    1.25 +*/
    1.26 +#ifndef __SURFACE_H__
    1.27 +#define __SURFACE_H__
    1.28 +
    1.29 +#include <e32def.h>
    1.30 +
    1.31 +class TSurfaceId
    1.32 +	{
    1.33 +	public:
    1.34 +	enum
    1.35 +		{
    1.36 +		EInvalidSurface = 0,
    1.37 +		EScreenSurface = 1,
    1.38 +		EStreamHandle = 2,
    1.39 +		EAdaptationSurfaceBase = 33,
    1.40 +		};
    1.41 +	struct TSurfaceUsage 			 //TSurfaceId::TSurfaceUsage::
    1.42 +		{
    1.43 +		enum	
    1.44 +			{
    1.45 +			//screen usage
    1.46 +			EScreenField=0,
    1.47 +			EHalField=1,
    1.48 +			EHalFlippedFlag=0x80000000,
    1.49 +			ETypeGuidField=2,
    1.50 +			//stream handle usage
    1.51 +			EObjectRefField=0,
    1.52 +			//general class usage
    1.53 +			ETypeClassField=3,
    1.54 +			ETypeClassShift=24
    1.55 +			};
    1.56 +		};
    1.57 +	typedef TSurfaceUsage TScreenSurfaceUsage; 			 //Backward compatibility
    1.58 +	
    1.59 +	
    1.60 +	inline static TSurfaceId CreateNullId(void) 
    1.61 +		{
    1.62 +		TSurfaceId id = TSurfaceId();
    1.63 +		for (TInt i = 0; i < 4; ++i) id.iInternal[i] = 0; 
    1.64 +		return id;
    1.65 +		};
    1.66 +	inline TBool IsNull() const 
    1.67 +		{
    1.68 +		return ((iInternal[0] == 0) &&
    1.69 +				(iInternal[1] == 0) &&
    1.70 +				(iInternal[2] == 0) &&
    1.71 +				(iInternal[3] == 0));
    1.72 +			
    1.73 +		};
    1.74 +	inline TInt Type() const {return (TInt)(iInternal[3] >> 24);}
    1.75 +	public:
    1.76 +	TUint32 iInternal[4];
    1.77 +	};
    1.78 +
    1.79 +
    1.80 +inline bool operator == (const TSurfaceId& lhs, const TSurfaceId& rhs)
    1.81 +	{
    1.82 +	return ((lhs.iInternal[0] == rhs.iInternal[0]) &&
    1.83 +			(lhs.iInternal[1] == rhs.iInternal[1]) &&
    1.84 +			(lhs.iInternal[2] == rhs.iInternal[2]) &&
    1.85 +			(lhs.iInternal[3] == rhs.iInternal[3]));
    1.86 +	}
    1.87 +
    1.88 +inline bool operator != (const TSurfaceId& lhs, const TSurfaceId& rhs)
    1.89 +	{
    1.90 +	return !(lhs == rhs);
    1.91 +	}
    1.92 +
    1.93 +#endif
    1.94 +