os/graphics/graphicsresourceservices/graphicsresource/inc/sgresourceadapter.h
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 SGRESOURCEADAPTER_H
sl@0
    23
#define SGRESOURCEADAPTER_H
sl@0
    24
sl@0
    25
#include <graphics/sgresource.h>
sl@0
    26
#include <pixelformats.h>
sl@0
    27
sl@0
    28
sl@0
    29
/**
sl@0
    30
@publishedPartner
sl@0
    31
@prototype
sl@0
    32
@deprecated
sl@0
    33
sl@0
    34
The file name of the Graphics Resource Adapter DLL.
sl@0
    35
*/
sl@0
    36
_LIT(KSgResourceAdapterLibraryName, "graphicsresourceadapter");
sl@0
    37
sl@0
    38
sl@0
    39
/**
sl@0
    40
@publishedPartner
sl@0
    41
@prototype
sl@0
    42
@deprecated
sl@0
    43
sl@0
    44
The UID3 value in the compound identifier of the Graphics Resource Adapter DLL.
sl@0
    45
*/
sl@0
    46
const TUid KSgResourceAdapterLibraryUid = {0x10285A71};
sl@0
    47
sl@0
    48
sl@0
    49
/**
sl@0
    50
@publishedPartner
sl@0
    51
@prototype
sl@0
    52
@deprecated
sl@0
    53
sl@0
    54
The category name of the panics raised by the Graphics Resource API.
sl@0
    55
*/
sl@0
    56
_LIT(KSgResourcePanicCategory, "SGRES");
sl@0
    57
sl@0
    58
sl@0
    59
/**
sl@0
    60
@publishedPartner
sl@0
    61
@prototype
sl@0
    62
@deprecated
sl@0
    63
sl@0
    64
The reason numbers of the panics raised by the Graphics Resource API.
sl@0
    65
*/
sl@0
    66
enum TSgResourcePanicReason
sl@0
    67
	{
sl@0
    68
	/**
sl@0
    69
	SGRES 1 In debug builds, there still are open handles to graphics resources in
sl@0
    70
	a process when the process termination tasks are carried out.
sl@0
    71
	*/
sl@0
    72
	ESgPanicUnclosedResources = 1,
sl@0
    73
	/**
sl@0
    74
	SGRES 2 In debug builds, an RSgDrawable handle is invalid.
sl@0
    75
	*/
sl@0
    76
	ESgPanicBadDrawableHandle = 2,
sl@0
    77
	/**
sl@0
    78
	SGRES 3 In debug builds, an RSgImage handle is invalid.
sl@0
    79
	*/
sl@0
    80
	ESgPanicBadImageHandle = 3,
sl@0
    81
	/**
sl@0
    82
	SGRES 4 In debug builds, an RSgImageCollection handle is invalid.
sl@0
    83
	*/
sl@0
    84
	ESgPanicBadImageCollectionHandle = 4,
sl@0
    85
	/**
sl@0
    86
	SGRES 5 In debug builds, the Graphics Resource driver is not initialised for
sl@0
    87
	use in the context of the calling process.
sl@0
    88
	*/
sl@0
    89
	ESgPanicNoDriver = 5
sl@0
    90
	};
sl@0
    91
sl@0
    92
sl@0
    93
/**
sl@0
    94
@publishedPartner
sl@0
    95
@prototype
sl@0
    96
@deprecated
sl@0
    97
sl@0
    98
Panics the current thread specifying a panic reason from the Graphics Resource API.
sl@0
    99
*/
sl@0
   100
inline void Panic(TSgResourcePanicReason aReason);
sl@0
   101
sl@0
   102
sl@0
   103
/**
sl@0
   104
@publishedPartner
sl@0
   105
@prototype
sl@0
   106
@deprecated
sl@0
   107
sl@0
   108
This constant consists of all the flags specifying usage of a graphics resource
sl@0
   109
as a source of any rendering pipeline.
sl@0
   110
*/
sl@0
   111
const TUint32 KSgUsageAllSources = ESgUsageDirectGdiSource | ESgUsageCompositionSource
sl@0
   112
	| ESgUsageScreenSource | ESgUsageOpenGlesTexture2D | ESgUsageOpenVgImage
sl@0
   113
	| ESgUsageOpenGles2Texture2D | ESgUsageWindowGcSource;
sl@0
   114
sl@0
   115
sl@0
   116
/**
sl@0
   117
@publishedPartner
sl@0
   118
@prototype
sl@0
   119
@deprecated
sl@0
   120
sl@0
   121
This constant consists of all the flags specifying usage of a graphics resource
sl@0
   122
as a target of any rendering pipeline.
sl@0
   123
*/
sl@0
   124
const TUint32 KSgUsageAllTargets = ESgUsageDirectGdiTarget | ESgUsageCompositionTarget
sl@0
   125
	| ESgUsageOpenGlesTarget | ESgUsageOpenVgTarget | ESgUsageEglCopyBuffersTarget
sl@0
   126
	| ESgUsageOpenGles2Target;
sl@0
   127
sl@0
   128
sl@0
   129
/**
sl@0
   130
@publishedPartner
sl@0
   131
@prototype
sl@0
   132
@deprecated
sl@0
   133
sl@0
   134
The default open mode for drawable resources.
sl@0
   135
*/
sl@0
   136
const TUint32 KSgDefaultOpenMode = 0;
sl@0
   137
sl@0
   138
sl@0
   139
/**
sl@0
   140
@publishedPartner
sl@0
   141
@prototype
sl@0
   142
@deprecated
sl@0
   143
sl@0
   144
This interface must be implemented by all the user-side objects in the adaptation
sl@0
   145
layer of the Graphics subsystem which are referenced by instances of any handle
sl@0
   146
class in the Graphics Resource API. The interface between the user-side and the
sl@0
   147
kernel-side parts of the adaptation layer is outside the scope of the specification
sl@0
   148
of the Graphics Resource API.
sl@0
   149
sl@0
   150
Each resource referenced by a handle opened in the context of a process must be
sl@0
   151
represented by an adapter object inside the process. Both the adapter object and
sl@0
   152
the resource itself have reference counts. The reference count for the adapter object
sl@0
   153
equals the number of handles to the resource open in the process, while the adapter
sl@0
   154
object counts as a single reference to the resource.
sl@0
   155
sl@0
   156
Adapter objects can be shared between all the threads in a process. This has two
sl@0
   157
consequences:
sl@0
   158
	- Adapter objects must be allocated in a multi-threaded heap owned by the Graphics
sl@0
   159
	  Resource Adapter singleton.
sl@0
   160
	- Access to adapter objects must be synchronised by means of a mutual exclusion
sl@0
   161
	  mechanism.
sl@0
   162
*/
sl@0
   163
class MSgResourceAdapter
sl@0
   164
	{
sl@0
   165
public:
sl@0
   166
	/**
sl@0
   167
	@publishedPartner
sl@0
   168
	@prototype
sl@0
   169
	@deprecated
sl@0
   170
sl@0
   171
	Closes this adapter object by decrementing its reference count by one and, if the
sl@0
   172
	count becomes zero, destroying the adapter object. If the adapter object is
sl@0
   173
	destroyed then the reference count for the represented resource is decremented
sl@0
   174
	by one.
sl@0
   175
sl@0
   176
	@see RSgDrawable::Close()
sl@0
   177
	@see RSgImageCollection::Close()
sl@0
   178
	*/
sl@0
   179
	virtual void Close() = 0;
sl@0
   180
	};
sl@0
   181
sl@0
   182
sl@0
   183
/**
sl@0
   184
@publishedPartner
sl@0
   185
@prototype
sl@0
   186
@deprecated
sl@0
   187
sl@0
   188
This interface must be implemented by all the user-side objects in the adaptation
sl@0
   189
layer of the Graphics subsystem which are referenced by instances of RSgDrawable.
sl@0
   190
The interface between the user-side and the kernel-side parts of the adaptation
sl@0
   191
layer is outside the scope of the specification of the Graphics Resource API.
sl@0
   192
sl@0
   193
@see RSgDrawable
sl@0
   194
*/
sl@0
   195
class MSgDrawableAdapter: public MSgResourceAdapter
sl@0
   196
	{
sl@0
   197
public:
sl@0
   198
	/**
sl@0
   199
	@publishedPartner
sl@0
   200
	@prototype
sl@0
   201
	@deprecated
sl@0
   202
sl@0
   203
	Retrieves the unique identifier of the drawable resource represented by this
sl@0
   204
	adapter object.
sl@0
   205
sl@0
   206
	@return The unique identifier of the drawable resource.
sl@0
   207
	@see RSgDrawable::Id()
sl@0
   208
	*/
sl@0
   209
	virtual const TSgDrawableId& Id() const = 0;
sl@0
   210
	/**
sl@0
   211
	@publishedPartner
sl@0
   212
	@prototype
sl@0
   213
	@deprecated
sl@0
   214
sl@0
   215
	Retrieves the actual type of the drawable resource represented by this adapter
sl@0
   216
	object as a globally unique identifier.
sl@0
   217
sl@0
   218
	@return The actual type of the drawable resource as a globally unique identifier.
sl@0
   219
	@see RSgDrawable::DrawableType()
sl@0
   220
	*/
sl@0
   221
	virtual TUid DrawableType() const = 0;
sl@0
   222
	/**
sl@0
   223
	@publishedPartner
sl@0
   224
	@prototype
sl@0
   225
	@deprecated
sl@0
   226
sl@0
   227
	Makes an extension interface available on the drawable resource represented by
sl@0
   228
	this adapter object.
sl@0
   229
sl@0
   230
	@param aInterfaceUid Globally unique identifier of the interface to be made
sl@0
   231
	       available.
sl@0
   232
	@param aInterfacePtr On return, a pointer to the specified interface.
sl@0
   233
	@pre The specified interface is supported on the drawable resource.
sl@0
   234
	@post The specified interface is available until this adapter object is destroyed.
sl@0
   235
	@return KErrNone if successful.
sl@0
   236
	@return KErrExtensionNotSupported if the specified interface is not supported
sl@0
   237
	        on the drawable resource.
sl@0
   238
	@return KErrNoMemory if there is not enough system memory.
sl@0
   239
	@see RSgDrawable::GetInterface()
sl@0
   240
	*/
sl@0
   241
	virtual TInt GetInterface(TUid aInterfaceUid, TAny*& aInterfacePtr) = 0;
sl@0
   242
	};
sl@0
   243
sl@0
   244
sl@0
   245
class TSgImageInfo;
sl@0
   246
class RSgImage;
sl@0
   247
class MSgImageAdapter;
sl@0
   248
class MSgImageCollectionAdapter;
sl@0
   249
sl@0
   250
/**
sl@0
   251
@publishedPartner
sl@0
   252
@prototype
sl@0
   253
@deprecated
sl@0
   254
sl@0
   255
This interface must be implemented by the Graphics Resource Adapter singleton.
sl@0
   256
There must be a single instance of the adaptation layer class that implements
sl@0
   257
this interface in each process using the Graphics Resource API.
sl@0
   258
*/
sl@0
   259
class MSgDriverAdapter
sl@0
   260
	{
sl@0
   261
public:
sl@0
   262
	/**
sl@0
   263
	@publishedPartner
sl@0
   264
	@prototype
sl@0
   265
	@deprecated
sl@0
   266
sl@0
   267
	Creates a new instance of the singleton class and carries out the initialisation
sl@0
   268
	tasks needed to use the Graphics Resource API in the context of the calling
sl@0
   269
	process. This is the only function that must be exported by the Graphics Resource
sl@0
   270
	Adapter DLL, at ordinal 1.
sl@0
   271
sl@0
   272
	@param aPtr On return, a pointer to the new instance of the singleton class.
sl@0
   273
	@return KErrNone if successful.
sl@0
   274
	@return KErrNoMemory if there is not enough system memory.
sl@0
   275
	@see SgDriver::Open()
sl@0
   276
	*/
sl@0
   277
	IMPORT_C static TInt New(MSgDriverAdapter*& aPtr);
sl@0
   278
	/**
sl@0
   279
	@publishedPartner
sl@0
   280
	@prototype
sl@0
   281
	@deprecated
sl@0
   282
sl@0
   283
	Deletes an instance of the singleton class and carries out the termination tasks
sl@0
   284
	needed to release the internal resources allocated for the calling process.
sl@0
   285
sl@0
   286
	@see SgDriver::Close()
sl@0
   287
	*/
sl@0
   288
	virtual void Delete() = 0;
sl@0
   289
	/**
sl@0
   290
	@publishedPartner
sl@0
   291
	@prototype
sl@0
   292
	@deprecated
sl@0
   293
sl@0
   294
	Retrieves the list of image pixel formats supported on this device for a
sl@0
   295
	specified usage.
sl@0
   296
sl@0
   297
	@param aInfo The image attributes. aInfo.iPixelFormat is ignored.
sl@0
   298
	@param aPixelFormats A pointer to an array that on return will contain the
sl@0
   299
	       supported pixel formats. If this parameter is null, then this function
sl@0
   300
	       will just return the number of supported pixel formats in aCount.
sl@0
   301
	@param aCount On input, the number of elements in the array pointed to by
sl@0
   302
	       aPixelFormats if not null, ignored otherwise. On return, the actual number
sl@0
   303
	       of supported pixel formats. If this number is greater than the number of
sl@0
   304
	       elements in the array, then the array will be filled with as many pixel
sl@0
   305
	       formats as it can hold and the function will return KErrOverflow.
sl@0
   306
	@pre aInfo is valid.
sl@0
   307
	@pre If aPixelFormats is not null then aCount is greater than zero.
sl@0
   308
	@return KErrNone if successful.
sl@0
   309
	@return KErrArgument if aInfo is invalid or if aPixelFormats is not null and
sl@0
   310
	        aCount is negative.
sl@0
   311
	@return KErrOverflow if the actual number of supported pixel formats is greater
sl@0
   312
	        than the number of elements in the array pointed to by aPixelFormats.
sl@0
   313
	@return KErrNoMemory if there is not enough system memory.
sl@0
   314
	@see RSgImage::GetPixelFormats()
sl@0
   315
	*/
sl@0
   316
	virtual TInt GetPixelFormats(const TSgImageInfo& aInfo, TUidPixelFormat* aPixelFormats, TInt& aCount) = 0;
sl@0
   317
	/**
sl@0
   318
	@publishedPartner
sl@0
   319
	@prototype
sl@0
   320
	@deprecated
sl@0
   321
sl@0
   322
	Creates an image with the specified attributes and, optionally, the specified
sl@0
   323
	initial contents.
sl@0
   324
sl@0
   325
	@param aInfo The attributes of the image to be created.
sl@0
   326
	@param aDataAddress The base address of the pixel data used to populate the
sl@0
   327
	       new image. If this value is null, the initial contents of the image are
sl@0
   328
	       undefined. If aInfo specifies that the new image is constant, this value
sl@0
   329
	       must not be null.
sl@0
   330
	@param aDataStride The number of bytes between rows of the pixel data used to
sl@0
   331
	       populate the new image.
sl@0
   332
	@param aResult On return, a pointer to the adapter object that represents the
sl@0
   333
	       new image.
sl@0
   334
	@pre aInfo is supported.
sl@0
   335
	@pre aResult is null.
sl@0
   336
	@post aResult points to an adapter object that represents a newly created image
sl@0
   337
	      with the specified attributes and initial contents. The initial reference
sl@0
   338
	      count for the image is one.
sl@0
   339
	@return KErrNone if successful.
sl@0
   340
	@return KErrInUse if aResult was not null.
sl@0
   341
	@return KErrArgument if aInfo is invalid.
sl@0
   342
	@return KErrNoInitializationData if aInfo requests a constant image and aDataAddress
sl@0
   343
	        is null.
sl@0
   344
	@return KErrTooBig if the size specified in aInfo is too large.
sl@0
   345
	@return KErrNotSupported if aInfo is not supported.
sl@0
   346
	@return KErrNoMemory if there is not enough system memory.
sl@0
   347
	@return KErrNoSpecializedMemory if there is not enough specialised graphics memory.
sl@0
   348
	@see RSgImage::Create()
sl@0
   349
	*/
sl@0
   350
	virtual TInt CreateImage(const TSgImageInfo& aInfo, const TAny* aDataAddress, TInt aDataStride, MSgDrawableAdapter*& aResult) = 0;
sl@0
   351
	/**
sl@0
   352
	@publishedPartner
sl@0
   353
	@prototype
sl@0
   354
	@deprecated
sl@0
   355
sl@0
   356
	Creates an image with the specified attributes and initial contents copied
sl@0
   357
	from an existing image.
sl@0
   358
sl@0
   359
	@param aInfo The attributes of the image to be created.
sl@0
   360
	@param aImage A pointer to the adapter object that represents the existing
sl@0
   361
	       image to be copied.
sl@0
   362
	@param aResult On return, a pointer to the adapter object that represents the
sl@0
   363
	       new image.
sl@0
   364
	@pre aInfo is supported.
sl@0
   365
	@pre aImage is not null.
sl@0
   366
	@pre The size and the pixel format specified in aInfo must be the same as the
sl@0
   367
	     size and the pixel format of the image represented by aImage.
sl@0
   368
	@pre aResult is null.
sl@0
   369
	@post aResult points to an adapter object that represents a newly created image
sl@0
   370
	      with the specified attributes and initial contents. The initial reference
sl@0
   371
	      count for the image is one.
sl@0
   372
	@return KErrNone if successful.
sl@0
   373
	@return KErrInUse if aResult was not null.
sl@0
   374
	@return KErrArgument if aInfo is invalid or if aImage is null.
sl@0
   375
	@return KErrNotSupported if aInfo is not supported or if the size and the pixel
sl@0
   376
	        format specified in aInfo are not the same as the size and the pixel
sl@0
   377
	        format of the image represented by aImage.
sl@0
   378
	@return KErrNoMemory if there is not enough system memory.
sl@0
   379
	@return KErrNoSpecializedMemory if there is not enough specialised graphics memory.
sl@0
   380
	@see RSgImage::Create()
sl@0
   381
	*/
sl@0
   382
	virtual TInt CreateImage(const TSgImageInfo& aInfo, MSgImageAdapter* aImage, MSgDrawableAdapter*& aResult) = 0;
sl@0
   383
	/**
sl@0
   384
	@publishedPartner
sl@0
   385
	@prototype
sl@0
   386
	@deprecated
sl@0
   387
sl@0
   388
	Creates an image collection with the specified attributes.
sl@0
   389
sl@0
   390
	@param aInfo The image attributes of the collection to be created.
sl@0
   391
	@param aImageCount The number of images in the collection to be created.
sl@0
   392
	@param aResult On return, a pointer to the adapter object that represents the
sl@0
   393
	       new image collection.
sl@0
   394
	@pre aInfo is supported and specifies mutable images.
sl@0
   395
	@pre aImageCount is greater than zero.
sl@0
   396
	@pre aResult is null.
sl@0
   397
	@post aResult points to an adapter object that represents a newly created image
sl@0
   398
	      collection with the specified attributes. The initial reference count
sl@0
   399
	      for the image collection is one.
sl@0
   400
	@return KErrNone if successful.
sl@0
   401
	@return KErrInUse if aResult was not null.
sl@0
   402
	@return KErrArgument if aInfo is invalid or if aImageCount is negative or zero.
sl@0
   403
	@return KErrTooBig if the size specified in aInfo is too large.
sl@0
   404
	@return KErrNotSupported if aInfo is not supported or does not specify mutable
sl@0
   405
	        images.
sl@0
   406
	@return KErrNoMemory if there is not enough system memory.
sl@0
   407
	@return KErrNoSpecializedMemory if there is not enough specialised graphics memory.
sl@0
   408
	@see RSgImageCollection::Create()
sl@0
   409
	*/
sl@0
   410
	virtual TInt CreateImageCollection(const TSgImageInfo& aInfo, TInt aImageCount, MSgImageCollectionAdapter*& aResult) = 0;
sl@0
   411
	/**
sl@0
   412
	@publishedPartner
sl@0
   413
	@prototype
sl@0
   414
	@deprecated
sl@0
   415
sl@0
   416
	Creates a set of image collections that share a single memory chunk.
sl@0
   417
sl@0
   418
	@param aInfos An array of aCollectionCount elements with the image attributes
sl@0
   419
	       of each of the collections to be created.
sl@0
   420
	@param aImageCount The number of images in each of the collections to be created.
sl@0
   421
	@param aCollections On return, an array of pointers to the adapter objects that
sl@0
   422
	       represent the new image collections.
sl@0
   423
	@param aCollectionCount The number of image collections to be created.
sl@0
   424
	@pre All the elements of aInfos are supported and specify mutable images.
sl@0
   425
	@pre aImageCount is greater than zero.
sl@0
   426
	@pre All the pointers in aCollections are null.
sl@0
   427
	@pre aCollectionCount is greater than zero.
sl@0
   428
	@post The elements of aCollections point to aCollectionCount adapter objects that
sl@0
   429
	      represent newly created image collections with the specified attributes.
sl@0
   430
	      The initial reference count for each of the image collections is one.
sl@0
   431
	@return KErrNone if successful.
sl@0
   432
	@return KErrInUse if any of the pointers in aCollections was not null.
sl@0
   433
	@return KErrArgument if any element of aInfos is invalid, if aImageCount is
sl@0
   434
	        negative or zero, or if aCollectionCount is negative or zero.
sl@0
   435
	@return KErrTooBig if any of the sizes specified in aInfos is too large.
sl@0
   436
	@return KErrNotSupported if any element of aInfos is not supported or does not
sl@0
   437
	        specify mutable images.
sl@0
   438
	@return KErrNoMemory if there is not enough system memory.
sl@0
   439
	@return KErrNoSpecializedMemory if there is not enough specialised graphics memory.
sl@0
   440
	@see RSgImageCollection::Create()
sl@0
   441
	*/
sl@0
   442
	virtual TInt CreateImageCollections(const TSgImageInfo aInfos[], TInt aImageCount,
sl@0
   443
	                                    MSgImageCollectionAdapter* aCollections[], TInt aCollectionCount) = 0;
sl@0
   444
	/**
sl@0
   445
	@publishedPartner
sl@0
   446
	@prototype
sl@0
   447
	@deprecated
sl@0
   448
sl@0
   449
	Opens a new handle to a drawable resource. If there are no handles to the drawable
sl@0
   450
	resource open in the calling process then this function creates a new adapter
sl@0
   451
	object that represents the drawable resource in the context of the calling process.
sl@0
   452
	Otherwise this function just increments the reference count of the existing adapter
sl@0
   453
	object that represents the drawable resource in the context of the calling process.
sl@0
   454
sl@0
   455
	@param aId The unique identifier of the drawable resource.
sl@0
   456
	@param aMode Flags controlling how the drawable resource is opened. The only value
sl@0
   457
	       of this parameter which it is mandatory to support is KSgDefaultOpenMode.
sl@0
   458
	       Extra opening options may be defined by an implementation of the Graphics
sl@0
   459
	       Resource API and made available through additional functions.
sl@0
   460
	@param aHandleType The type of the handle which is to store the reference to
sl@0
   461
	       the specified drawable resource as a globally unique identifier.
sl@0
   462
	@param aResult On return, a pointer to the adapter object that represents the
sl@0
   463
	       specified drawable resource.
sl@0
   464
	@pre aId identifies an existing drawable resource.
sl@0
   465
	@pre All of the requested opening options in aMode are supported.
sl@0
   466
	@pre aHandleType specifies an instance of RSgDrawable or any other handle type
sl@0
   467
	     that is compatible with the actual type of the specified drawable resource.
sl@0
   468
	@pre aResult is null.
sl@0
   469
	@post aResult points to either a newly created or an existing adapter object
sl@0
   470
	      that represents the drawable resource specified by its unique identifier.
sl@0
   471
	      If a new adapter object is created then its initial reference count is
sl@0
   472
	      one and the reference count for the drawable resource itself is incremented
sl@0
   473
	      by one. Otherwise only the reference count for the adapter object is
sl@0
   474
	      incremented by one.
sl@0
   475
	@return KErrNone if successful.
sl@0
   476
	@return KErrInUse if aResult was not null.
sl@0
   477
	@return KErrArgument if aId is the null drawable resource identifier.
sl@0
   478
	@return KErrNotFound if aId cannot be found to refer to an existing drawable
sl@0
   479
	        resource.
sl@0
   480
	@return KErrPermissionDenied if this process is not permitted to access the
sl@0
   481
	        drawable resource specified by aId.
sl@0
   482
	@return KErrNotSupported if any of the requested opening options in aMode is
sl@0
   483
	        not supported or if aHandleType is not compatible with the actual type
sl@0
   484
	        of the drawable resource specified by aId.
sl@0
   485
	@return KErrNoMemory if there is not enough system memory.
sl@0
   486
	@see RSgDrawable::Open()
sl@0
   487
	*/
sl@0
   488
	virtual TInt OpenDrawable(const TSgDrawableId& aId, TUint32 aMode, TUid aHandleType, MSgDrawableAdapter*& aResult) = 0;
sl@0
   489
	/**
sl@0
   490
	@publishedPartner
sl@0
   491
	@prototype
sl@0
   492
	@deprecated
sl@0
   493
sl@0
   494
	Tests whether aDrawable references an existing adapter object representing a
sl@0
   495
	drawable resource. This function is called in debug builds to detect invalid
sl@0
   496
	RSgDrawable handles.
sl@0
   497
sl@0
   498
	@return ETrue if aDrawable is a valid reference to an adapter object representing
sl@0
   499
	        a drawable resource, EFalse otherwise.
sl@0
   500
	*/
sl@0
   501
	virtual TBool CheckDrawable(const MSgResourceAdapter& aDrawable) const = 0;
sl@0
   502
	/**
sl@0
   503
	@publishedPartner
sl@0
   504
	@prototype
sl@0
   505
	@deprecated
sl@0
   506
sl@0
   507
	Tests whether aImage references an existing adapter object representing an image.
sl@0
   508
	This function is called in debug builds to detect invalid RSgImage handles.
sl@0
   509
sl@0
   510
	@return ETrue if aImage is a valid reference to an adapter object representing
sl@0
   511
	        an image, EFalse otherwise.
sl@0
   512
	*/
sl@0
   513
	virtual TBool CheckImage(const MSgResourceAdapter& aImage) const = 0;
sl@0
   514
	/**
sl@0
   515
	@publishedPartner
sl@0
   516
	@prototype
sl@0
   517
	@deprecated
sl@0
   518
sl@0
   519
	Tests whether aImageCollection references an existing adapter object representing
sl@0
   520
	an image collection. This function is called in debug builds to detect invalid
sl@0
   521
	RSgImageCollection handles.
sl@0
   522
sl@0
   523
	@return ETrue if aImageCollection is a valid reference to an adapter object
sl@0
   524
	        representing an image collection, EFalse otherwise.
sl@0
   525
	*/
sl@0
   526
	virtual TBool CheckImageCollection(const MSgResourceAdapter& aImageCollection) const = 0;
sl@0
   527
	/**
sl@0
   528
	@publishedPartner
sl@0
   529
	@deprecated
sl@0
   530
	@test
sl@0
   531
sl@0
   532
	Retrieves the number of handles to graphics resources open in the calling process.
sl@0
   533
sl@0
   534
	@return The number of handles to graphics resources open in the calling process.
sl@0
   535
	*/
sl@0
   536
	virtual TInt ResourceCount() const = 0;
sl@0
   537
	/**
sl@0
   538
	@publishedPartner
sl@0
   539
	@deprecated
sl@0
   540
	@test
sl@0
   541
sl@0
   542
	Marks the start of cell checking on the heap for adapter objects. Calls to this
sl@0
   543
	function can be nested but each call must be matched by a corresponding call to
sl@0
   544
	AllocMarkEnd().
sl@0
   545
sl@0
   546
	@see RAllocator::__DbgMarkStart()
sl@0
   547
	*/
sl@0
   548
	virtual void AllocMarkStart() = 0;
sl@0
   549
	/**
sl@0
   550
	@publishedPartner
sl@0
   551
	@deprecated
sl@0
   552
	@test
sl@0
   553
sl@0
   554
	Marks the end of cell checking at the current nesting level on the heap for
sl@0
   555
	adapter objects. Each call to this function must match an earlier call to
sl@0
   556
	AllocMarkStart().
sl@0
   557
sl@0
   558
	This function checks that the number of cells allocated in the heap for adapter
sl@0
   559
	objects, at the current nesting level, is aCount. If the check fails then an
sl@0
   560
	SGALLOC:nnnnnnnn panic is raised, where nnnnnnnn is the hexadecimal address
sl@0
   561
	of the first orphaned cell.
sl@0
   562
sl@0
   563
	@param aCount The number of allocated heap cells expected.
sl@0
   564
	@see RAllocator::__DbgMarkEnd()
sl@0
   565
	*/
sl@0
   566
	virtual void AllocMarkEnd(TInt aCount) = 0;
sl@0
   567
	/**
sl@0
   568
	@publishedPartner
sl@0
   569
	@deprecated
sl@0
   570
	@test
sl@0
   571
sl@0
   572
	Sets the type and rate of simulated allocation failure on the heap for adapter
sl@0
   573
	objects.
sl@0
   574
sl@0
   575
	@param aType The type of allocation failure requested.
sl@0
   576
	@param aRate The rate of allocation failure requested.
sl@0
   577
	@see RAllocator::__DbgSetAllocFail()
sl@0
   578
	*/
sl@0
   579
	virtual void SetAllocFail(RAllocator::TAllocFail aType, TInt aRate) = 0;
sl@0
   580
	};
sl@0
   581
sl@0
   582
sl@0
   583
#include <graphics/sgresourceadapter.inl>
sl@0
   584
sl@0
   585
sl@0
   586
#endif // SGRESOURCEADAPTER_H