os/graphics/graphicsresourceservices/graphicsresource/inc/sgresource.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @publishedPartner
sl@0
    19
 @prototype
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef SGRESOURCE_INL
sl@0
    23
#define SGRESOURCE_INL
sl@0
    24
sl@0
    25
/**
sl@0
    26
@publishedPartner
sl@0
    27
@prototype
sl@0
    28
@deprecated
sl@0
    29
sl@0
    30
Compares this identifier with another one to check if they are the same.
sl@0
    31
sl@0
    32
@param aId The other identifier to compare against.
sl@0
    33
@pre None.
sl@0
    34
@post None.
sl@0
    35
@return ETrue if the two identifiers are the same, EFalse otherwise.
sl@0
    36
*/
sl@0
    37
inline TBool TSgDrawableId::operator ==(const TSgDrawableId& aId) const
sl@0
    38
	{
sl@0
    39
	return iId[0] == aId.iId[0]
sl@0
    40
		&& iId[1] == aId.iId[1]
sl@0
    41
		&& iId[2] == aId.iId[2]
sl@0
    42
		&& iId[3] == aId.iId[3]
sl@0
    43
		&& iId[4] == aId.iId[4]
sl@0
    44
		&& iId[5] == aId.iId[5];
sl@0
    45
	}
sl@0
    46
sl@0
    47
sl@0
    48
/**
sl@0
    49
@publishedPartner
sl@0
    50
@prototype
sl@0
    51
@deprecated
sl@0
    52
sl@0
    53
Compares this identifier with another one to check if they are different.
sl@0
    54
sl@0
    55
@param aId The other identifier to compare against.
sl@0
    56
@pre None.
sl@0
    57
@post None.
sl@0
    58
@return ETrue if the two identifiers are different, EFalse otherwise.
sl@0
    59
*/
sl@0
    60
inline TBool TSgDrawableId::operator !=(const TSgDrawableId& aId) const
sl@0
    61
	{
sl@0
    62
	return !operator ==(aId);
sl@0
    63
	}
sl@0
    64
sl@0
    65
sl@0
    66
/**
sl@0
    67
@publishedPartner
sl@0
    68
@prototype
sl@0
    69
@deprecated
sl@0
    70
sl@0
    71
Retrieves the type of a handle derived from RSgDrawable as a globally unique identifier.
sl@0
    72
The type is set by the constructor of the handle and does not depend on the run-time
sl@0
    73
type of the referenced drawable resource.
sl@0
    74
sl@0
    75
@pre None.
sl@0
    76
@post None.
sl@0
    77
@return The type of the handle as a globally unique identifier.
sl@0
    78
@see RSgDrawable::DrawableType()
sl@0
    79
*/
sl@0
    80
inline TUid RSgDrawable::HandleType() const
sl@0
    81
	{
sl@0
    82
	return iHandleType;
sl@0
    83
	}
sl@0
    84
sl@0
    85
/**
sl@0
    86
@publishedPartner
sl@0
    87
@prototype
sl@0
    88
@deprecated
sl@0
    89
sl@0
    90
Makes an extension interface available on a drawable resource. The extension interface
sl@0
    91
is specified by type. The following example demonstrates how to use this function
sl@0
    92
to get access to an extension interface.
sl@0
    93
sl@0
    94
@code
sl@0
    95
	MExampleExtensionInterface* interface;
sl@0
    96
	if (drawable.GetInterface(interface) == KErrNone)
sl@0
    97
		{
sl@0
    98
@endcode
sl@0
    99
sl@0
   100
@param aInterfacePtr On return, a pointer to the specified interface.
sl@0
   101
@pre The Graphics Resource driver is initialised for use in the context of the
sl@0
   102
     calling process.
sl@0
   103
@pre This RSgDrawable handle is valid and not null.
sl@0
   104
@pre The specified interface is supported on the drawable resource.
sl@0
   105
@post The specified interface is available until this RSgDrawable handle is closed.
sl@0
   106
@return KErrNone if successful.
sl@0
   107
@return KErrBadHandle if this RSgDrawable handle is null.
sl@0
   108
@return KErrExtensionNotSupported if the specified interface is not supported on
sl@0
   109
        the drawable resource.
sl@0
   110
@return KErrNoMemory if there is not enough system memory.
sl@0
   111
@panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
sl@0
   112
@panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
sl@0
   113
       for use in the context of the calling process.
sl@0
   114
@see RSgDrawable::GetInterface<M>(const M*&) const
sl@0
   115
sl@0
   116
WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. 
sl@0
   117
*/
sl@0
   118
template<class M>
sl@0
   119
inline TInt RSgDrawable::GetInterface(M*& aInterfacePtr)
sl@0
   120
	{
sl@0
   121
	return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
sl@0
   122
	}
sl@0
   123
sl@0
   124
/**
sl@0
   125
@publishedPartner
sl@0
   126
@prototype
sl@0
   127
@deprecated
sl@0
   128
sl@0
   129
Makes an extension interface available on a drawable resource. The extension interface
sl@0
   130
is specified by type and returned const-qualified. The following example demonstrates
sl@0
   131
how to use this function to get access to an extension interface.
sl@0
   132
sl@0
   133
@code
sl@0
   134
	const MExampleExtensionInterface* interface;
sl@0
   135
	if (drawable.GetInterface(interface) == KErrNone)
sl@0
   136
		{
sl@0
   137
@endcode
sl@0
   138
sl@0
   139
@param aInterfacePtr On return, a pointer to the specified interface.
sl@0
   140
@pre The Graphics Resource driver is initialised for use in the context of the
sl@0
   141
     calling process.
sl@0
   142
@pre This RSgDrawable handle is valid and not null.
sl@0
   143
@pre The specified interface is supported on the drawable resource.
sl@0
   144
@post The specified interface is available until this RSgDrawable handle is closed.
sl@0
   145
@return KErrNone if successful.
sl@0
   146
@return KErrBadHandle if this RSgDrawable handle is null.
sl@0
   147
@return KErrExtensionNotSupported if the specified interface is not supported on
sl@0
   148
        the drawable resource.
sl@0
   149
@return KErrNoMemory if there is not enough system memory.
sl@0
   150
@panic SGRES 2 in debug builds if this RSgDrawable handle is invalid.
sl@0
   151
@panic SGRES 5 in debug builds if the Graphics Resource driver is not initialised
sl@0
   152
       for use in the context of the calling process.
sl@0
   153
@see RSgDrawable::GetInterface<M>(M*&)
sl@0
   154
sl@0
   155
WARNING: Function for internal use ONLY.  Compatibility is not guaranteed in future releases. 
sl@0
   156
*/
sl@0
   157
template<class M>
sl@0
   158
inline TInt RSgDrawable::GetInterface(const M*& aInterfacePtr) const
sl@0
   159
	{
sl@0
   160
	return GetInterface(TUid::Uid(M::EInterfaceUid), (TAny*&)aInterfacePtr);
sl@0
   161
	}
sl@0
   162
sl@0
   163
#endif // SGRESOURCE_INL