sl@0
|
1 |
// Copyright (c) 2006-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 |
// surface
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
@publishedPartner
|
sl@0
|
21 |
@released
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
#ifndef __SURFACE_H__
|
sl@0
|
24 |
#define __SURFACE_H__
|
sl@0
|
25 |
|
sl@0
|
26 |
#include <e32def.h>
|
sl@0
|
27 |
|
sl@0
|
28 |
class TSurfaceId
|
sl@0
|
29 |
{
|
sl@0
|
30 |
public:
|
sl@0
|
31 |
enum
|
sl@0
|
32 |
{
|
sl@0
|
33 |
EInvalidSurface = 0,
|
sl@0
|
34 |
EScreenSurface = 1,
|
sl@0
|
35 |
EStreamHandle = 2,
|
sl@0
|
36 |
EAdaptationSurfaceBase = 33,
|
sl@0
|
37 |
};
|
sl@0
|
38 |
struct TSurfaceUsage //TSurfaceId::TSurfaceUsage::
|
sl@0
|
39 |
{
|
sl@0
|
40 |
enum
|
sl@0
|
41 |
{
|
sl@0
|
42 |
//screen usage
|
sl@0
|
43 |
EScreenField=0,
|
sl@0
|
44 |
EHalField=1,
|
sl@0
|
45 |
EHalFlippedFlag=0x80000000,
|
sl@0
|
46 |
ETypeGuidField=2,
|
sl@0
|
47 |
//stream handle usage
|
sl@0
|
48 |
EObjectRefField=0,
|
sl@0
|
49 |
//general class usage
|
sl@0
|
50 |
ETypeClassField=3,
|
sl@0
|
51 |
ETypeClassShift=24
|
sl@0
|
52 |
};
|
sl@0
|
53 |
};
|
sl@0
|
54 |
typedef TSurfaceUsage TScreenSurfaceUsage; //Backward compatibility
|
sl@0
|
55 |
|
sl@0
|
56 |
|
sl@0
|
57 |
inline static TSurfaceId CreateNullId(void)
|
sl@0
|
58 |
{
|
sl@0
|
59 |
TSurfaceId id = TSurfaceId();
|
sl@0
|
60 |
for (TInt i = 0; i < 4; ++i) id.iInternal[i] = 0;
|
sl@0
|
61 |
return id;
|
sl@0
|
62 |
};
|
sl@0
|
63 |
inline TBool IsNull() const
|
sl@0
|
64 |
{
|
sl@0
|
65 |
return ((iInternal[0] == 0) &&
|
sl@0
|
66 |
(iInternal[1] == 0) &&
|
sl@0
|
67 |
(iInternal[2] == 0) &&
|
sl@0
|
68 |
(iInternal[3] == 0));
|
sl@0
|
69 |
|
sl@0
|
70 |
};
|
sl@0
|
71 |
inline TInt Type() const {return (TInt)(iInternal[3] >> 24);}
|
sl@0
|
72 |
public:
|
sl@0
|
73 |
TUint32 iInternal[4];
|
sl@0
|
74 |
};
|
sl@0
|
75 |
|
sl@0
|
76 |
|
sl@0
|
77 |
inline bool operator == (const TSurfaceId& lhs, const TSurfaceId& rhs)
|
sl@0
|
78 |
{
|
sl@0
|
79 |
return ((lhs.iInternal[0] == rhs.iInternal[0]) &&
|
sl@0
|
80 |
(lhs.iInternal[1] == rhs.iInternal[1]) &&
|
sl@0
|
81 |
(lhs.iInternal[2] == rhs.iInternal[2]) &&
|
sl@0
|
82 |
(lhs.iInternal[3] == rhs.iInternal[3]));
|
sl@0
|
83 |
}
|
sl@0
|
84 |
|
sl@0
|
85 |
inline bool operator != (const TSurfaceId& lhs, const TSurfaceId& rhs)
|
sl@0
|
86 |
{
|
sl@0
|
87 |
return !(lhs == rhs);
|
sl@0
|
88 |
}
|
sl@0
|
89 |
|
sl@0
|
90 |
#endif
|
sl@0
|
91 |
|