1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresource/inc/sgresource.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,163 @@
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 +/**
1.20 + @file
1.21 + @publishedPartner
1.22 + @prototype
1.23 +*/
1.24 +
1.25 +#ifndef SGRESOURCE_INL
1.26 +#define SGRESOURCE_INL
1.27 +
1.28 +/**
1.29 +@publishedPartner
1.30 +@prototype
1.31 +@deprecated
1.32 +
1.33 +Compares this identifier with another one to check if they are the same.
1.34 +
1.35 +@param aId The other identifier to compare against.
1.36 +@pre None.
1.37 +@post None.
1.38 +@return ETrue if the two identifiers are the same, EFalse otherwise.
1.39 +*/
1.40 +inline TBool TSgDrawableId::operator ==(const TSgDrawableId& aId) const
1.41 + {
1.42 + return iId[0] == aId.iId[0]
1.43 + && iId[1] == aId.iId[1]
1.44 + && iId[2] == aId.iId[2]
1.45 + && iId[3] == aId.iId[3]
1.46 + && iId[4] == aId.iId[4]
1.47 + && iId[5] == aId.iId[5];
1.48 + }
1.49 +
1.50 +
1.51 +/**
1.52 +@publishedPartner
1.53 +@prototype
1.54 +@deprecated
1.55 +
1.56 +Compares this identifier with another one to check if they are different.
1.57 +
1.58 +@param aId The other identifier to compare against.
1.59 +@pre None.
1.60 +@post None.
1.61 +@return ETrue if the two identifiers are different, EFalse otherwise.
1.62 +*/
1.63 +inline TBool TSgDrawableId::operator !=(const TSgDrawableId& aId) const
1.64 + {
1.65 + return !operator ==(aId);
1.66 + }
1.67 +
1.68 +
1.69 +/**
1.70 +@publishedPartner
1.71 +@prototype
1.72 +@deprecated
1.73 +
1.74 +Retrieves the type of a handle derived from RSgDrawable as a globally unique identifier.
1.75 +The type is set by the constructor of the handle and does not depend on the run-time
1.76 +type of the referenced drawable resource.
1.77 +
1.78 +@pre None.
1.79 +@post None.
1.80 +@return The type of the handle as a globally unique identifier.
1.81 +@see RSgDrawable::DrawableType()
1.82 +*/
1.83 +inline TUid RSgDrawable::HandleType() const
1.84 + {
1.85 + return iHandleType;
1.86 + }
1.87 +
1.88 +/**
1.89 +@publishedPartner
1.90 +@prototype
1.91 +@deprecated
1.92 +
1.93 +Makes an extension interface available on a drawable resource. The extension interface
1.94 +is specified by type. The following example demonstrates how to use this function
1.95 +to get access to an extension interface.
1.96 +
1.97 +@code
1.98 + MExampleExtensionInterface* interface;
1.99 + if (drawable.GetInterface(interface) == KErrNone)
1.100 + {
1.101 +@endcode
1.102 +
1.103 +@param aInterfacePtr On return, a pointer to the specified interface.
1.104 +@pre The Graphics Resource driver is initialised for use in the context of the
1.105 + calling process.
1.106 +@pre This RSgDrawable handle is valid and not null.
1.107 +@pre The specified interface is supported on the drawable resource.
1.108 +@post The specified interface is available until this RSgDrawable handle is closed.
1.109 +@return KErrNone if successful.
1.110 +@return KErrBadHandle if this RSgDrawable handle is null.
1.111 +@return KErrExtensionNotSupported if the specified interface is not supported on
1.112 + the drawable resource.
1.113 +@return KErrNoMemory if there is not enough system memory.
1.114 +@panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
1.115 +@panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
1.116 + for use in the context of the calling process.
1.117 +@see RSgDrawable::GetInterface<M>(const M*&) const
1.118 +
1.119 +WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
1.120 +*/
1.121 +template<class M>
1.122 +inline TInt RSgDrawable::GetInterface(M*& aInterfacePtr)
1.123 + {
1.124 + return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
1.125 + }
1.126 +
1.127 +/**
1.128 +@publishedPartner
1.129 +@prototype
1.130 +@deprecated
1.131 +
1.132 +Makes an extension interface available on a drawable resource. The extension interface
1.133 +is specified by type and returned const-qualified. The following example demonstrates
1.134 +how to use this function to get access to an extension interface.
1.135 +
1.136 +@code
1.137 + const MExampleExtensionInterface* interface;
1.138 + if (drawable.GetInterface(interface) == KErrNone)
1.139 + {
1.140 +@endcode
1.141 +
1.142 +@param aInterfacePtr On return, a pointer to the specified interface.
1.143 +@pre The Graphics Resource driver is initialised for use in the context of the
1.144 + calling process.
1.145 +@pre This RSgDrawable handle is valid and not null.
1.146 +@pre The specified interface is supported on the drawable resource.
1.147 +@post The specified interface is available until this RSgDrawable handle is closed.
1.148 +@return KErrNone if successful.
1.149 +@return KErrBadHandle if this RSgDrawable handle is null.
1.150 +@return KErrExtensionNotSupported if the specified interface is not supported on
1.151 + the drawable resource.
1.152 +@return KErrNoMemory if there is not enough system memory.
1.153 +@panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
1.154 +@panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
1.155 + for use in the context of the calling process.
1.156 +@see RSgDrawable::GetInterface<M>(M*&)
1.157 +
1.158 +WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
1.159 +*/
1.160 +template<class M>
1.161 +inline TInt RSgDrawable::GetInterface(const M*& aInterfacePtr) const
1.162 + {
1.163 + return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
1.164 + }
1.165 +
1.166 +#endif // SGRESOURCE_INL