|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: NVG Decoder header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TLVICONCREATER_H_ |
|
20 #define TLVICONCREATER_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <VG/openvg.h> |
|
24 #include <VG/vgu.h> |
|
25 #include "FloatFixPt.h" |
|
26 #include "PseudoVG.h" |
|
27 |
|
28 class CNVGTLVIcon; |
|
29 class CNVGIconData; |
|
30 class CTLVIconCreator : public CBase |
|
31 { |
|
32 |
|
33 public: |
|
34 static CTLVIconCreator * NewL(const TDesC8& aPtr, TInt aWidth, TInt aHeight, CNVGTLVIcon * aNVGTLVIcon); |
|
35 |
|
36 static CTLVIconCreator * NewLC(const TDesC8& aPtr, TInt aWidth, TInt aHeight, CNVGTLVIcon * aNVGTLVIcon); |
|
37 |
|
38 virtual ~CTLVIconCreator(); |
|
39 |
|
40 TInt ExecuteL(); |
|
41 |
|
42 void SetTLVIcon(CNVGTLVIcon * aNVGTLVIcon) |
|
43 { |
|
44 iNVGTLVIcon = aNVGTLVIcon; |
|
45 } |
|
46 |
|
47 private: |
|
48 CTLVIconCreator(TInt aWidth, TInt aHeight, CNVGTLVIcon * aNVGTLVIcon); |
|
49 void ConstructL(const TDesC8& aPtr); |
|
50 |
|
51 void DvgAddCommandL(TInt aLength, TInt aPos); |
|
52 void DvgAddCommandL(); |
|
53 void DvgSetParameterfvL( ); |
|
54 void DvgSetPaintL( ); |
|
55 void DvgAppendPathDataL( ); |
|
56 void DvgDrawPathL( ); |
|
57 void DvgClearPathL(); |
|
58 void DvgCreatePaintL( ); |
|
59 void DvgSetivL( ); |
|
60 void DvgClearL(); |
|
61 void DvgSetfvL(); |
|
62 void DvgCreatePathL(); |
|
63 void DvgCreateImageL(); |
|
64 void DvgGetPixelsL(); |
|
65 void DvgClearImageL(); |
|
66 void DvgImageSubDataL(); |
|
67 void DvgDrawImageL(); |
|
68 void DvgDestroyImageL(); |
|
69 void DvgDestroyPaintL(); |
|
70 void DvgDestroyPathL(); |
|
71 |
|
72 void DvguRectL(); |
|
73 void DvguEllipseL(); |
|
74 void DvguRoundRectL(); |
|
75 void DvguLineL(); |
|
76 |
|
77 void DvgPrepareToBindImageL(); |
|
78 void DvgBindImageL(); |
|
79 void DvgUnBindImageL(); |
|
80 |
|
81 void DvgFlushL(); |
|
82 |
|
83 TInt ExecuteL(TInt index); |
|
84 |
|
85 #ifdef NVG_DEBUG |
|
86 //Command specific logging methods |
|
87 void LogvgSeti(VGParamType type, VGint fvalue, TInt cmdsize); |
|
88 void LogvgSetf (VGParamType type, VGfloat fvalue, TInt cmdsize); |
|
89 void LogvgSetParameteri(VGHandle handle, VGint paramType, VGint pvalue, TInt cmdsize, TInt Lpvalue); |
|
90 void LogvgSetPaint(VGPaint paint, VGbitfield paintModes, TInt cmdsize, TInt Lpvalue); |
|
91 void LogvgDrawPath(VGbitfield paintModes, int cmdsize); |
|
92 void LogvgSetParameterfv(VGPaint handle, VGint paramtype, TInt count, TInt handlenum); |
|
93 #endif |
|
94 |
|
95 private: |
|
96 |
|
97 typedef void (CTLVIconCreator::*pvgapi)( ); |
|
98 |
|
99 VGPath CreatePathL(); |
|
100 |
|
101 pvgapi vgapi[EvgFlush + 1]; |
|
102 |
|
103 CNVGIconData * iNVGIconData; |
|
104 TInt iDataLength; |
|
105 TSize iResizedCanvasSize; |
|
106 |
|
107 |
|
108 TUint8 iNvgHeader[KNVGHeaderSize]; |
|
109 TInt iTargetWidth; |
|
110 TInt iTargetHeight; |
|
111 TBool iScaled; |
|
112 |
|
113 TReal32 iUserMatrix[9]; |
|
114 TUint iPrepareToBindImage; |
|
115 |
|
116 TPtrC8 iNVGDataPtr; |
|
117 |
|
118 CNVGTLVIcon * iNVGTLVIcon; |
|
119 |
|
120 TInt8 iCurrentCommand; |
|
121 TUint8 * iCommandBuffer; |
|
122 VGPath iLastVGPath; |
|
123 |
|
124 friend class CNVGTLVIcon; |
|
125 }; |
|
126 |
|
127 #endif |
|
128 //--------------------------------EndOfFile------------------------------------ |