os/graphics/graphicsresourceservices/graphicsresourceimplementation/inc/sgdevice.inl
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Graphics Resource - logical device driver inline functions
    15 //
    16 
    17 #ifndef SGDEVICE_INL
    18 #define SGDEVICE_INL
    19 
    20 inline TVersion SgDeviceVersionRequired()
    21 	{
    22 	return TVersion(1, 1, 0);
    23 	}
    24 
    25 #ifndef __KERNEL_MODE__
    26 
    27 inline TInt RSgDevice::Connect()
    28 	{
    29 	return DoCreate(KSgDeviceName, SgDeviceVersionRequired(), KNullUnit, NULL, NULL);
    30 	}
    31 
    32 inline TInt RSgDevice::CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, TUint64& aId)
    33 	{
    34 	TCreateResourceArgs args;
    35 	args.iAttributes = aAttribs;
    36 	args.iMetaData = &aMetaData;
    37 	args.iDataSize = aDataSize;
    38 	return DoControl(EControlCreateResource, &args, &aId);
    39 	}
    40 
    41 inline TInt RSgDevice::OpenResource(TUint64 aId)
    42 	{
    43 	return DoControl(EControlOpenResource, &aId);
    44 	}
    45 
    46 inline TInt RSgDevice::CloseResource(TUint64 aId)
    47 	{
    48 	return DoControl(EControlCloseResource, &aId);
    49 	}
    50 
    51 inline TUint32 RSgDevice::ResourceAttributes(TUint64 aId)
    52 	{
    53 	return static_cast<TUint32>(DoControl(EControlResourceAttributes, &aId));
    54 	}
    55 
    56 inline TInt RSgDevice::GetResourceMetaData(TUint64 aId, TDes8& aMetaData)
    57 	{
    58 	return DoControl(EControlGetResourceMetaData, &aId, &aMetaData);
    59 	}
    60 
    61 inline TAny* RSgDevice::ResourceDataAddress(TUint64 aId)
    62 	{
    63 	return reinterpret_cast<TAny*>(DoControl(EControlResourceDataAddress, &aId));
    64 	}
    65 
    66 inline TInt RSgDevice::ResourceDataSize(TUint64 aId)
    67 	{
    68 	return DoControl(EControlResourceDataSize, &aId);
    69 	}
    70 
    71 inline TInt RSgDevice::GlobalResourceCount()
    72 	{
    73 	return DoControl(EControlGlobalResourceCount);
    74 	}
    75 
    76 inline TInt RSgDevice::LocalGraphicsMemoryUsed()
    77 	{
    78 	return DoControl(EControlLocalGraphicsMemoryUsed);
    79 	}
    80 
    81 inline TInt RSgDevice::GlobalGraphicsMemoryUsed()
    82 	{
    83 	return DoControl(EControlGlobalGraphicsMemoryUsed);
    84 	}
    85 
    86 #endif // __KERNEL_MODE__
    87 
    88 #endif // SGDEVICE_INL