diff -r 5d03bc08d59c -r 01a6848ebfd7 graphicsresourceservices/graphicsresourceinterface/inc/sgresource.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graphicsresourceservices/graphicsresourceinterface/inc/sgresource.inl Fri Apr 16 16:21:04 2010 +0300 @@ -0,0 +1,110 @@ +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Graphics Resource - general inline functions +// + +#ifndef SGRESOURCE_INL +#define SGRESOURCE_INL + +_LIT(KSgResourcePanicCategory, "SGRES"); + +inline void Panic(TSgResourcePanicReason aReason) + { + User::Panic(KSgResourcePanicCategory, aReason); + } + +inline TSgAttribute::TSgAttribute() + { + } + +inline TSgAttribute::TSgAttribute(TUid aUid, TInt aValue) + : iUid(aUid), iValue(aValue) + { + } + +inline TSgAttributeArrayBase::TSgAttributeArrayBase(TInt aCount) + : iCount(aCount) + { + } + +inline void TSgAttributeArrayBase::operator =(const TSgAttributeArrayBase&) + { + } + +inline TInt TSgAttributeArrayBase::Count() const + { + return iCount; + } + +inline TSgAttribute& TSgAttributeArrayBase::operator [](TInt aIndex) + { + __ASSERT_ALWAYS(aIndex >= 0 && aIndex < iCount, Panic(ESgPanicBadAttributeArrayIndex)); + return reinterpret_cast(this + 1)[aIndex]; + } + +inline const TSgAttribute& TSgAttributeArrayBase::operator [](TInt aIndex) const + { + __ASSERT_ALWAYS(aIndex >= 0 && aIndex < iCount, Panic(ESgPanicBadAttributeArrayIndex)); + return reinterpret_cast(this + 1)[aIndex]; + } + +template +inline TSgAttributeArray::TSgAttributeArray() + : TSgAttributeArrayBase(S) + { + } + +inline TBool TSgDrawableId::operator ==(TSgDrawableId aId) const + { + return iId == aId.iId; + } + +inline TBool TSgDrawableId::operator !=(TSgDrawableId aId) const + { + return iId != aId.iId; + } + +inline RSgDriver::RSgDriver() + : iImpl(NULL) + { + } + +template +inline TInt RSgDriver::GetInterface(M*& aInterfacePtr) const + { + return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr); + } + +inline RSgDrawable::RSgDrawable() + : iHandleType(KSgDrawableTypeUid), iImpl(NULL) + { + } + +inline RSgDrawable::RSgDrawable(TUid aHandleType) + : iHandleType(aHandleType), iImpl(NULL) + { + } + +inline TBool RSgDrawable::IsNull() const + { + return !iImpl; + } + +template +inline TInt RSgDrawable::GetInterface(M*& aInterfacePtr) const + { + return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr); + } + +#endif // SGRESOURCE_INL