sl@0
|
1 |
// Copyright (c) 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 |
// Graphics Resource - kernel extension internal functionality
|
sl@0
|
15 |
//
|
sl@0
|
16 |
|
sl@0
|
17 |
#ifndef SGEXTENSIONIMPL_H
|
sl@0
|
18 |
#define SGEXTENSIONIMPL_H
|
sl@0
|
19 |
|
sl@0
|
20 |
#include <sgresource/sgextension.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
NONSHARABLE_CLASS(DSgExtensionImpl): public DBase
|
sl@0
|
23 |
{
|
sl@0
|
24 |
public:
|
sl@0
|
25 |
TInt Construct();
|
sl@0
|
26 |
TInt CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, DSgResource*& aResource);
|
sl@0
|
27 |
TInt FindAndOpenResource(TUint64 aId, DSgResource*& aResource);
|
sl@0
|
28 |
void DeleteResource(DSgResource* aResource);
|
sl@0
|
29 |
TInt GlobalResourceCount() const;
|
sl@0
|
30 |
TInt GlobalGraphicsMemoryUsed() const;
|
sl@0
|
31 |
private:
|
sl@0
|
32 |
DMutex* iMutex;
|
sl@0
|
33 |
TUint64 iLastResourceId;
|
sl@0
|
34 |
RPointerArray<DSgResource> iResources;
|
sl@0
|
35 |
};
|
sl@0
|
36 |
|
sl@0
|
37 |
NONSHARABLE_CLASS(DSgResourceImpl): public DSgResource
|
sl@0
|
38 |
{
|
sl@0
|
39 |
public:
|
sl@0
|
40 |
DSgResourceImpl(DSgExtensionImpl& aExtensionImpl, TUint64 aId, TUint32 aAttribs,
|
sl@0
|
41 |
const TDesC8& aMetaData, DChunk* aDataChunk, TInt aDataSize);
|
sl@0
|
42 |
// From DSgResource
|
sl@0
|
43 |
TInt Open();
|
sl@0
|
44 |
void Close();
|
sl@0
|
45 |
TUint64 Id() const;
|
sl@0
|
46 |
TUint32 Attributes() const;
|
sl@0
|
47 |
TInt GetMetaData(TDes8& aMetaData) const;
|
sl@0
|
48 |
DChunk* DataChunk() const;
|
sl@0
|
49 |
TInt DataSize() const;
|
sl@0
|
50 |
private:
|
sl@0
|
51 |
~DSgResourceImpl();
|
sl@0
|
52 |
private:
|
sl@0
|
53 |
DSgExtensionImpl& iExtensionImpl;
|
sl@0
|
54 |
TInt iRefCount;
|
sl@0
|
55 |
TUint64 iId;
|
sl@0
|
56 |
TUint32 iAttributes;
|
sl@0
|
57 |
TInt iMetaDataSize;
|
sl@0
|
58 |
DChunk* iDataChunk;
|
sl@0
|
59 |
TInt iDataSize;
|
sl@0
|
60 |
};
|
sl@0
|
61 |
|
sl@0
|
62 |
#endif // SGEXTENSIONIMPL_H
|