os/graphics/graphicsresourceservices/graphicsresourceimplementation/inc/sgdevice.inl
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresourceimplementation/inc/sgdevice.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,88 @@
1.4 +// Copyright (c) 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 +// Graphics Resource - logical device driver inline functions
1.18 +//
1.19 +
1.20 +#ifndef SGDEVICE_INL
1.21 +#define SGDEVICE_INL
1.22 +
1.23 +inline TVersion SgDeviceVersionRequired()
1.24 + {
1.25 + return TVersion(1, 1, 0);
1.26 + }
1.27 +
1.28 +#ifndef __KERNEL_MODE__
1.29 +
1.30 +inline TInt RSgDevice::Connect()
1.31 + {
1.32 + return DoCreate(KSgDeviceName, SgDeviceVersionRequired(), KNullUnit, NULL, NULL);
1.33 + }
1.34 +
1.35 +inline TInt RSgDevice::CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, TUint64& aId)
1.36 + {
1.37 + TCreateResourceArgs args;
1.38 + args.iAttributes = aAttribs;
1.39 + args.iMetaData = &aMetaData;
1.40 + args.iDataSize = aDataSize;
1.41 + return DoControl(EControlCreateResource, &args, &aId);
1.42 + }
1.43 +
1.44 +inline TInt RSgDevice::OpenResource(TUint64 aId)
1.45 + {
1.46 + return DoControl(EControlOpenResource, &aId);
1.47 + }
1.48 +
1.49 +inline TInt RSgDevice::CloseResource(TUint64 aId)
1.50 + {
1.51 + return DoControl(EControlCloseResource, &aId);
1.52 + }
1.53 +
1.54 +inline TUint32 RSgDevice::ResourceAttributes(TUint64 aId)
1.55 + {
1.56 + return static_cast<TUint32>(DoControl(EControlResourceAttributes, &aId));
1.57 + }
1.58 +
1.59 +inline TInt RSgDevice::GetResourceMetaData(TUint64 aId, TDes8& aMetaData)
1.60 + {
1.61 + return DoControl(EControlGetResourceMetaData, &aId, &aMetaData);
1.62 + }
1.63 +
1.64 +inline TAny* RSgDevice::ResourceDataAddress(TUint64 aId)
1.65 + {
1.66 + return reinterpret_cast<TAny*>(DoControl(EControlResourceDataAddress, &aId));
1.67 + }
1.68 +
1.69 +inline TInt RSgDevice::ResourceDataSize(TUint64 aId)
1.70 + {
1.71 + return DoControl(EControlResourceDataSize, &aId);
1.72 + }
1.73 +
1.74 +inline TInt RSgDevice::GlobalResourceCount()
1.75 + {
1.76 + return DoControl(EControlGlobalResourceCount);
1.77 + }
1.78 +
1.79 +inline TInt RSgDevice::LocalGraphicsMemoryUsed()
1.80 + {
1.81 + return DoControl(EControlLocalGraphicsMemoryUsed);
1.82 + }
1.83 +
1.84 +inline TInt RSgDevice::GlobalGraphicsMemoryUsed()
1.85 + {
1.86 + return DoControl(EControlGlobalGraphicsMemoryUsed);
1.87 + }
1.88 +
1.89 +#endif // __KERNEL_MODE__
1.90 +
1.91 +#endif // SGDEVICE_INL