|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 /*static*/ |
|
21 inline |
|
22 TChunkId TChunkId::FromPtr(const TText8* aPtr) |
|
23 { |
|
24 TChunkId temp; |
|
25 Mem::Copy(&temp, aPtr, sizeof(TChunkId)); |
|
26 return temp; |
|
27 } |
|
28 |
|
29 inline |
|
30 TBool TChunkId::operator==(const TInt aRight) const |
|
31 { |
|
32 return (iChunkIdInt == aRight); |
|
33 } |
|
34 |
|
35 inline |
|
36 TBool TChunkId::operator==(const TDesC8& aRight) const |
|
37 { |
|
38 __ASSERT_DEBUG(aRight.Length()==4, MngPanic(EPanicWrongChunkIdLength)); |
|
39 return (aRight.Compare( TPtrC8(iChunkIdChr, 4) ) == 0 ); |
|
40 } |
|
41 |
|
42 inline |
|
43 TBool TChunkId::operator!=(const TInt aRight) const |
|
44 { |
|
45 return !(*this==aRight); |
|
46 } |
|
47 |
|
48 /*static*/ |
|
49 inline |
|
50 TInt TMNGChunkHeader::RequiredData() |
|
51 { |
|
52 return sizeof(TInt32) + sizeof(TChunkId); |
|
53 } |
|
54 |
|
55 inline |
|
56 TChunkCrc::TChunkCrc():iCrc((TInt32)(TUint32)~0) |
|
57 { |
|
58 } |
|
59 |
|
60 inline |
|
61 TChunkCrc::operator const TInt32&() const |
|
62 { |
|
63 return iCrc; |
|
64 } |
|
65 |
|
66 inline |
|
67 TMngChunk::TMngChunk(const TMNGChunkHeader& aHeader):iHeader(aHeader) |
|
68 { |
|
69 Crc32::Calc(iCalculatedCrc.iCrc, &iHeader.iChunkId.iChunkIdInt, sizeof(iHeader.iChunkId)); |
|
70 } |
|
71 |
|
72 inline |
|
73 TInt TMngChunk::RequiredData() const |
|
74 { |
|
75 return iHeader.iLength + sizeof(TInt32); // and Crc |
|
76 } |
|
77 |
|
78 inline |
|
79 TMngRawChunk::TMngRawChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader) |
|
80 { |
|
81 } |
|
82 |
|
83 inline |
|
84 TUnknownChunk::TUnknownChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader) |
|
85 { |
|
86 } |
|
87 |
|
88 inline |
|
89 TMhdrChunk::TMhdrChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader) |
|
90 { |
|
91 } |
|
92 |
|
93 inline |
|
94 TDefiChunk::TDefiChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader) |
|
95 |
|
96 { |
|
97 Mem::Fill(&iObjectId, _FOFF(TDefiChunk, iBottomClippingBoundary) - _FOFF(TDefiChunk, iObjectId) |
|
98 + sizeof(iBottomClippingBoundary) , 0); |
|
99 iRightClippingBoundary =-1; |
|
100 } |
|
101 |
|
102 inline |
|
103 TTermChunk::TTermChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader), |
|
104 iPostIterationAction(EMngShowLastFrameIndef), |
|
105 iDelay(0), |
|
106 iIterationMax(1) |
|
107 { |
|
108 } |
|
109 |
|
110 inline |
|
111 TBackChunk::TBackChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader), |
|
112 iBgMandatory(EMngTermBgColorAndImgAdvisory) |
|
113 { |
|
114 } |
|
115 |
|
116 inline TMagnChunk::TMagnChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader) |
|
117 { |
|
118 Mem::Fill(&iFirstMagnifiedObjId, _FOFF(TMagnChunk, iYMagnMethod) - |
|
119 _FOFF(TMagnChunk, iFirstMagnifiedObjId) + sizeof(iFirstMagnifiedObjId), 0); |
|
120 iXMagnFactor =1; |
|
121 } |
|
122 |
|
123 inline |
|
124 TFramChunk::TFramChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader), |
|
125 iFramingMode(EMngFramDoNotChangeMode) |
|
126 { |
|
127 Mem::Fill(&iChangeInterFrmDelay, _FOFF(TFramChunk, iFirstSyncId)-_FOFF(TFramChunk, iChangeInterFrmDelay)+sizeof(iFirstSyncId), 0); |
|
128 } |
|
129 |
|
130 inline |
|
131 TLoopChunk::TLoopChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader), |
|
132 iNestLevel(0) |
|
133 { |
|
134 } |
|
135 |
|
136 inline |
|
137 TEndlChunk::TEndlChunk(const TMNGChunkHeader& aHeader):TMngChunk(aHeader), |
|
138 iNestLevel(0) |
|
139 { |
|
140 } |
|
141 |
|
142 inline |
|
143 const TUint8* TMngRawChunk::Data() const |
|
144 { |
|
145 return iBite; |
|
146 } |
|
147 |
|
148 |
|
149 |