os/graphics/windowing/windowserver/inc/Graphics/surfaceconfiguration.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/inc/Graphics/surfaceconfiguration.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,129 @@
     1.4 +// Copyright (c) 2007-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 +//
    1.18 +
    1.19 +#ifndef SURFACECONFIGURATION_H
    1.20 +#define SURFACECONFIGURATION_H
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <graphics/surface.h>
    1.24 +#include <bitstd.h>
    1.25 +
    1.26 +/** 
    1.27 +The base class for the surface configuration containing the size of the surface configuration.  
    1.28 +Provides a Size function to help identify which attributes are available.
    1.29 +
    1.30 +@publishedPartner
    1.31 +@prototype
    1.32 +*/
    1.33 +class TSurfaceConfigurationSize
    1.34 +{
    1.35 +public:
    1.36 +	inline TInt Size() const;
    1.37 +protected:
    1.38 +	inline TSurfaceConfigurationSize(TInt aSize);
    1.39 +	template <class Member> TBool MemberAccessible (const Member& aMember) const
    1.40 +		{
    1.41 +		return iSize>=sizeof(Member)+TInt(&aMember)-TInt(this);
    1.42 +		}
    1.43 +	inline TBool operator == (const TSurfaceConfigurationSize& aRhs)const;
    1.44 +private:	
    1.45 +	inline TSurfaceConfigurationSize();
    1.46 +	inline TSurfaceConfigurationSize(const TSurfaceConfigurationSize& /*aSurfaceConfigurationSize*/);
    1.47 +	inline TSurfaceConfigurationSize operator = (const TSurfaceConfigurationSize& /*aRhs*/)const;
    1.48 +protected:
    1.49 +	TInt iSize;
    1.50 +};
    1.51 +
    1.52 +/** 
    1.53 +The first set of surface configuration attributes containing the surface id, viewport, extent
    1.54 +and orientation of the surface, along with a SupportsAllMembers function to help identify which 
    1.55 +attributes are available.
    1.56 +
    1.57 +@publishedPartner
    1.58 +@prototype
    1.59 +*/
    1.60 +class TSurfaceConfiguration1: public TSurfaceConfigurationSize
    1.61 +{
    1.62 +public:
    1.63 +	inline TSurfaceConfiguration1();
    1.64 +	inline TInt SetSurfaceId (const TSurfaceId& aSurfaceId);
    1.65 +	inline void GetSurfaceId (TSurfaceId& aSurfaceId) const;
    1.66 +	inline TInt SetViewport (const TRect& aViewport);
    1.67 +	inline void GetViewport (TRect& aViewport) const;
    1.68 +	inline TInt SetOrientation (CFbsBitGc::TGraphicsOrientation aOrientation);
    1.69 +	inline CFbsBitGc::TGraphicsOrientation Orientation() const;
    1.70 +	inline TInt SetExtent(const TRect& aExtent);
    1.71 +	inline void GetExtent(TRect& aExtent) const;
    1.72 +	inline TBool SupportsAllMembers();
    1.73 +protected:
    1.74 +	inline TSurfaceConfiguration1(TInt aSize);
    1.75 +	inline TBool operator == (const TSurfaceConfiguration1& aRhs)const;
    1.76 +private:
    1.77 +	inline TSurfaceConfiguration1(const TSurfaceConfiguration1& /*aSurfaceConfiguration1*/);
    1.78 +	inline TSurfaceConfiguration1 operator = (const TSurfaceConfiguration1& /*aRhs*/)const;
    1.79 +private:
    1.80 +	TSurfaceId iSurfaceId;
    1.81 +	CFbsBitGc::TGraphicsOrientation iOrientation;
    1.82 +	TRect iExtent;
    1.83 +	TRect iViewport;
    1.84 +};
    1.85 +
    1.86 +/** 
    1.87 +The second set of surface configuration attributes containing the flip attribute of the surface, along with a SupportsAllMembers function to help identify which 
    1.88 +attributes are available.
    1.89 +
    1.90 +@publishedPartner
    1.91 +@prototype
    1.92 +*/
    1.93 +class TSurfaceConfiguration2: public TSurfaceConfiguration1
    1.94 +{
    1.95 +public:
    1.96 +    inline TSurfaceConfiguration2();
    1.97 +    inline TInt SetFlip(TBool aFlip);
    1.98 +    inline TBool Flip()const;
    1.99 +    inline TBool SupportsAllMembers();
   1.100 +protected:
   1.101 +    inline TSurfaceConfiguration2(TInt aSize);
   1.102 +    inline TBool operator == (const TSurfaceConfiguration2& aRhs)const;
   1.103 +private:
   1.104 +    inline TSurfaceConfiguration2(const TSurfaceConfiguration2& /*aSurfaceConfiguration2*/);
   1.105 +    inline TSurfaceConfiguration2 operator = (const TSurfaceConfiguration2& /*aRhs*/)const;
   1.106 +    //iFlip is a x-axis flip
   1.107 +    TBool iFlip;
   1.108 +};
   1.109 +
   1.110 +/** 
   1.111 +TSurfaceConfiguration is provided as a chain of derived classes representing the growing 
   1.112 +history of the class.
   1.113 +
   1.114 +@publishedPartner
   1.115 +@prototype
   1.116 +*/
   1.117 +class TSurfaceConfiguration: public TSurfaceConfiguration2
   1.118 +{
   1.119 +	typedef	TSurfaceConfiguration2	TBiggestConfiguration;
   1.120 +public:
   1.121 +	inline TSurfaceConfiguration();
   1.122 +	inline TSurfaceConfiguration(const TSurfaceConfiguration& aSurfaceConfiguration);
   1.123 +	inline TSurfaceConfiguration(TInt aPreferredMaxSize);
   1.124 +	inline TBool operator == (const TSurfaceConfiguration& aRhs)const
   1.125 +		{
   1.126 +		return TSurfaceConfiguration2::operator==(aRhs);
   1.127 +		}
   1.128 +private:
   1.129 +	inline TSurfaceConfiguration operator = (const TSurfaceConfiguration& /*aRhs*/);
   1.130 +};
   1.131 +#include <graphics/surfaceconfiguration.inl>
   1.132 +#endif // SURFACECONFIGURATION_H