sl@0
|
1 |
// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
//
|
sl@0
|
3 |
// Permission is hereby granted, free of charge, to any person obtaining a
|
sl@0
|
4 |
// copy of this software and/or associated documentation files (the
|
sl@0
|
5 |
// "Materials"), to deal in the Materials without restriction, including
|
sl@0
|
6 |
// without limitation the rights to use, copy, modify, merge, publish,
|
sl@0
|
7 |
// distribute, sublicense, and/or sell copies of the Materials, and to
|
sl@0
|
8 |
// permit persons to whom the Materials are furnished to do so, subject to
|
sl@0
|
9 |
// the following conditions:
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// The above copyright notice and this permission notice shall be included
|
sl@0
|
12 |
// in all copies or substantial portions of the Materials.
|
sl@0
|
13 |
//
|
sl@0
|
14 |
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
sl@0
|
15 |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
sl@0
|
16 |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
sl@0
|
17 |
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
sl@0
|
18 |
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
sl@0
|
19 |
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
sl@0
|
20 |
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
sl@0
|
21 |
//
|
sl@0
|
22 |
// Description:
|
sl@0
|
23 |
// Display Adaptation Interface
|
sl@0
|
24 |
//
|
sl@0
|
25 |
//
|
sl@0
|
26 |
|
sl@0
|
27 |
#ifndef OPENWFC_RI_DISPLAY_H
|
sl@0
|
28 |
#define OPENWFC_RI_DISPLAY_H
|
sl@0
|
29 |
|
sl@0
|
30 |
#include <WF/openwfc_ri_display_update.h>
|
sl@0
|
31 |
#include <pixelformats.h>
|
sl@0
|
32 |
|
sl@0
|
33 |
class COpenWFC_RI_Display: public CBase, public MOpenWFC_RI_Display_Update
|
sl@0
|
34 |
{
|
sl@0
|
35 |
public:
|
sl@0
|
36 |
typedef enum
|
sl@0
|
37 |
{
|
sl@0
|
38 |
EScreenInvalid = 0x0000, // Initialisation value, don't use
|
sl@0
|
39 |
EScreenRotate0 = 0x0001, // No rotation
|
sl@0
|
40 |
EScreenRotate90 = 0x0002, // 90 degree
|
sl@0
|
41 |
EScreenRotate180 = 0x0004, // 180 degree
|
sl@0
|
42 |
EScreenRotate270 = 0x0008, // 270 degree
|
sl@0
|
43 |
EScreenRotateMirrorVertical = 0x0010, // Upside down/flip
|
sl@0
|
44 |
EScreenRotateMirrorHorizontal = 0x0020, // Mirrored
|
sl@0
|
45 |
EScreenRotateAll = 0x000F
|
sl@0
|
46 |
} TScreenRotation;
|
sl@0
|
47 |
|
sl@0
|
48 |
typedef enum
|
sl@0
|
49 |
{
|
sl@0
|
50 |
EScreenAttributeInvalid = 0,
|
sl@0
|
51 |
EScreenAttributeImplementationVersion, // Version implementation (TUint32) RO
|
sl@0
|
52 |
// Currently the only pixel format support is EUidPixelFormatXRGB_8888
|
sl@0
|
53 |
EScreenAttributePixelFormat, // Pixel format (TUint32) RO
|
sl@0
|
54 |
// Curently, the only value supported is "4"
|
sl@0
|
55 |
EScreenAttributeBytesPerPixel, // Bytes per pixel (TUint32) RO
|
sl@0
|
56 |
EScreenAttributeSupportedRotation, // Supported rotation bitmap(TUint32) RO
|
sl@0
|
57 |
EScreenAttributeDefaultRotation, // Default rotation (TUint32) RO
|
sl@0
|
58 |
EScreenAttributeCurrentRotation, // Current rotation (TUint32) RW
|
sl@0
|
59 |
EScreenAttributeNormalWidth, // Width - rotaton 0 (TUint32) RO
|
sl@0
|
60 |
EScreenAttributeNormalHeight, // Height - rotaton 0 (TUint32) RO
|
sl@0
|
61 |
EScreenAttributeNormalStride, // Stride - rotaton 0 (TUint32) RO
|
sl@0
|
62 |
EScreenAttributeFlippedWidth, // Width - rotaton 90 (TUint32) RO
|
sl@0
|
63 |
EScreenAttributeFlippedHeight, // Height - rotaton 90 (TUint32) RO
|
sl@0
|
64 |
EScreenAttributeFlippedStride, // Stride - rotaton 90 (TUint32) RO
|
sl@0
|
65 |
EScreenAttributeScreenGeometry // geometry struct RO
|
sl@0
|
66 |
} TScreenAttribute;
|
sl@0
|
67 |
|
sl@0
|
68 |
typedef struct {
|
sl@0
|
69 |
TInt32 iSupportedRotations;
|
sl@0
|
70 |
TInt32 iBytesPerPixel;
|
sl@0
|
71 |
TScreenRotation iDefaultRotation;
|
sl@0
|
72 |
TScreenRotation iCurrentRotation;
|
sl@0
|
73 |
TUidPixelFormat iPixelFormat;
|
sl@0
|
74 |
TInt32 iNormalWidth;
|
sl@0
|
75 |
TInt32 iNormalHeight;
|
sl@0
|
76 |
TInt32 iNormalStride;
|
sl@0
|
77 |
TInt32 iFlippedWidth;
|
sl@0
|
78 |
TInt32 iFlippedHeight;
|
sl@0
|
79 |
TInt32 iFlippedStride;
|
sl@0
|
80 |
} TScreenGeometryAttribute;
|
sl@0
|
81 |
|
sl@0
|
82 |
public:
|
sl@0
|
83 |
/**
|
sl@0
|
84 |
* API version
|
sl@0
|
85 |
*
|
sl@0
|
86 |
* @return API version
|
sl@0
|
87 |
*/
|
sl@0
|
88 |
inline TUint32 APIVersion();
|
sl@0
|
89 |
|
sl@0
|
90 |
/**
|
sl@0
|
91 |
* Symbian function factory
|
sl@0
|
92 |
*
|
sl@0
|
93 |
* @param aStream Screen Id
|
sl@0
|
94 |
*
|
sl@0
|
95 |
* @return An instance of implemented interface
|
sl@0
|
96 |
*/
|
sl@0
|
97 |
IMPORT_C static COpenWFC_RI_Display* NewL(TUint aScreen);
|
sl@0
|
98 |
|
sl@0
|
99 |
/**
|
sl@0
|
100 |
* retrieves the default screen number for an implementation
|
sl@0
|
101 |
*
|
sl@0
|
102 |
*
|
sl@0
|
103 |
* @return Default Screen ID
|
sl@0
|
104 |
*/
|
sl@0
|
105 |
IMPORT_C static TUint32 DefaultScreenNumber();
|
sl@0
|
106 |
|
sl@0
|
107 |
public:
|
sl@0
|
108 |
static const TInt32 KTopMostLayer = 0;
|
sl@0
|
109 |
static const TUint32 KAPIVersion = 0x00000001;
|
sl@0
|
110 |
|
sl@0
|
111 |
protected:
|
sl@0
|
112 |
TInt GetAttributeSize(TUint aAttributeId);
|
sl@0
|
113 |
};
|
sl@0
|
114 |
|
sl@0
|
115 |
inline TUint32 COpenWFC_RI_Display::APIVersion()
|
sl@0
|
116 |
{
|
sl@0
|
117 |
return KAPIVersion;
|
sl@0
|
118 |
}
|
sl@0
|
119 |
|
sl@0
|
120 |
|
sl@0
|
121 |
#endif // OPENWFC_RI_DISPLAY_H
|