os/graphics/graphicsresourceservices/graphicsresourceinterface/inc/sgresource.inl
Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Graphics Resource - general inline functions
17 #ifndef SGRESOURCE_INL
18 #define SGRESOURCE_INL
20 _LIT(KSgResourcePanicCategory, "SGRES");
22 inline void Panic(TSgResourcePanicReason aReason)
24 User::Panic(KSgResourcePanicCategory, aReason);
27 inline TSgAttribute::TSgAttribute()
31 inline TSgAttribute::TSgAttribute(TUid aUid, TInt aValue)
32 : iUid(aUid), iValue(aValue)
36 inline TSgAttributeArrayBase::TSgAttributeArrayBase(TInt aCount)
41 inline void TSgAttributeArrayBase::operator =(const TSgAttributeArrayBase&)
45 inline TInt TSgAttributeArrayBase::Count() const
50 inline TSgAttribute& TSgAttributeArrayBase::operator [](TInt aIndex)
52 __ASSERT_ALWAYS(aIndex >= 0 && aIndex < iCount, Panic(ESgPanicBadAttributeArrayIndex));
53 return reinterpret_cast<TSgAttribute*>(this + 1)[aIndex];
56 inline const TSgAttribute& TSgAttributeArrayBase::operator [](TInt aIndex) const
58 __ASSERT_ALWAYS(aIndex >= 0 && aIndex < iCount, Panic(ESgPanicBadAttributeArrayIndex));
59 return reinterpret_cast<const TSgAttribute*>(this + 1)[aIndex];
63 inline TSgAttributeArray<S>::TSgAttributeArray()
64 : TSgAttributeArrayBase(S)
68 inline TBool TSgDrawableId::operator ==(TSgDrawableId aId) const
70 return iId == aId.iId;
73 inline TBool TSgDrawableId::operator !=(TSgDrawableId aId) const
75 return iId != aId.iId;
78 inline RSgDriver::RSgDriver()
84 inline TInt RSgDriver::GetInterface(M*& aInterfacePtr) const
86 return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
89 inline RSgDrawable::RSgDrawable()
90 : iHandleType(KSgDrawableTypeUid), iImpl(NULL)
94 inline RSgDrawable::RSgDrawable(TUid aHandleType)
95 : iHandleType(aHandleType), iImpl(NULL)
99 inline TBool RSgDrawable::IsNull() const
105 inline TInt RSgDrawable::GetInterface(M*& aInterfacePtr) const
107 return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
110 #endif // SGRESOURCE_INL