os/graphics/graphicsresourceservices/graphicsresourceimplementation/inc/sgdevice.inl
First public contribution.
1 // Copyright (c) 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 - logical device driver inline functions
20 inline TVersion SgDeviceVersionRequired()
22 return TVersion(1, 1, 0);
25 #ifndef __KERNEL_MODE__
27 inline TInt RSgDevice::Connect()
29 return DoCreate(KSgDeviceName, SgDeviceVersionRequired(), KNullUnit, NULL, NULL);
32 inline TInt RSgDevice::CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, TUint64& aId)
34 TCreateResourceArgs args;
35 args.iAttributes = aAttribs;
36 args.iMetaData = &aMetaData;
37 args.iDataSize = aDataSize;
38 return DoControl(EControlCreateResource, &args, &aId);
41 inline TInt RSgDevice::OpenResource(TUint64 aId)
43 return DoControl(EControlOpenResource, &aId);
46 inline TInt RSgDevice::CloseResource(TUint64 aId)
48 return DoControl(EControlCloseResource, &aId);
51 inline TUint32 RSgDevice::ResourceAttributes(TUint64 aId)
53 return static_cast<TUint32>(DoControl(EControlResourceAttributes, &aId));
56 inline TInt RSgDevice::GetResourceMetaData(TUint64 aId, TDes8& aMetaData)
58 return DoControl(EControlGetResourceMetaData, &aId, &aMetaData);
61 inline TAny* RSgDevice::ResourceDataAddress(TUint64 aId)
63 return reinterpret_cast<TAny*>(DoControl(EControlResourceDataAddress, &aId));
66 inline TInt RSgDevice::ResourceDataSize(TUint64 aId)
68 return DoControl(EControlResourceDataSize, &aId);
71 inline TInt RSgDevice::GlobalResourceCount()
73 return DoControl(EControlGlobalResourceCount);
76 inline TInt RSgDevice::LocalGraphicsMemoryUsed()
78 return DoControl(EControlLocalGraphicsMemoryUsed);
81 inline TInt RSgDevice::GlobalGraphicsMemoryUsed()
83 return DoControl(EControlGlobalGraphicsMemoryUsed);
86 #endif // __KERNEL_MODE__
88 #endif // SGDEVICE_INL