changeset 50 | c6286dcf6040 |
parent 0 | 05e9090e2422 |
child 64 | ecb300a325e8 |
43:1951b3078691 | 50:c6286dcf6040 |
---|---|
17 |
17 |
18 #include "SDCGlobals.h" |
18 #include "SDCGlobals.h" |
19 #include "SDCReader.h" |
19 #include "SDCReader.h" |
20 #include "SDCIIDConstants.h" |
20 #include "SDCIIDConstants.h" |
21 #include "SDCException.h" |
21 #include "SDCException.h" |
22 #include "SDCCompat.h" |
|
22 |
23 |
23 // Make std namespace available for compatibility |
24 // Make std namespace available for compatibility |
24 namespace std {} |
25 namespace std {} |
25 using namespace std; |
26 using namespace std; |
26 |
27 |
42 ////////////////////////////////////////////////////////////////////// |
43 ////////////////////////////////////////////////////////////////////// |
43 |
44 |
44 void CSDCReader::Parse() |
45 void CSDCReader::Parse() |
45 { |
46 { |
46 gInput.NextTokenAllowLF(); |
47 gInput.NextTokenAllowLF(); |
47 if( _wcsicmp( gInput.iToken, L"SKINTYPE" ) != 0 ) UnexpectedTokenError( gInput.iToken, L"SKINTYPE" ); |
48 if( sd_wcscasecmp( gInput.iToken, L"SKINTYPE" ) != 0 ) UnexpectedTokenError( gInput.iToken, L"SKINTYPE" ); |
48 ParseSkintype(); |
49 ParseSkintype(); |
49 |
50 |
50 gInput.NextTokenAllowLF(); |
51 gInput.NextTokenAllowLF(); |
51 if( _wcsicmp( gInput.iToken, L"UID" ) == 0 ) |
52 if( sd_wcscasecmp( gInput.iToken, L"UID" ) == 0 ) |
52 { |
53 { |
53 ParseUID(); |
54 ParseUID(); |
54 gInput.NextTokenAllowLF(); |
55 gInput.NextTokenAllowLF(); |
55 } |
56 } |
56 else if( _wcsicmp( gInput.iToken, L"PID" ) == 0 ) |
57 else if( sd_wcscasecmp( gInput.iToken, L"PID" ) == 0 ) |
57 { |
58 { |
58 ParsePID(); |
59 ParsePID(); |
59 gInput.NextTokenAllowLF(); |
60 gInput.NextTokenAllowLF(); |
60 } |
61 } |
61 else |
62 else |
62 { |
63 { |
63 GeneratePID(); |
64 GeneratePID(); |
64 } |
65 } |
65 |
66 |
66 if( _wcsicmp( gInput.iToken, L"NAME" ) != 0 ) UnexpectedTokenError( gInput.iToken, L"NAME" ); |
67 if( sd_wcscasecmp( gInput.iToken, L"NAME" ) != 0 ) UnexpectedTokenError( gInput.iToken, L"NAME" ); |
67 ParseName(); |
68 ParseName(); |
68 |
69 |
69 while( gInput.NextTokenAllowLF() ) |
70 while( gInput.NextTokenAllowLF() ) |
70 { |
71 { |
71 if( _wcsicmp( gInput.iToken, L"NAME" ) == 0 ) |
72 if( sd_wcscasecmp( gInput.iToken, L"NAME" ) == 0 ) |
72 { |
73 { |
73 ParseName(); |
74 ParseName(); |
74 } |
75 } |
75 else if( _wcsicmp( gInput.iToken, L"LANGUAGEOVERRIDE" ) == 0 ) |
76 else if( sd_wcscasecmp( gInput.iToken, L"LANGUAGEOVERRIDE" ) == 0 ) |
76 { |
77 { |
77 ParseLanguageOverride(); |
78 ParseLanguageOverride(); |
78 } |
79 } |
79 else if( _wcsicmp( gInput.iToken, L"LANGUAGEPARENT" ) == 0 ) |
80 else if( sd_wcscasecmp( gInput.iToken, L"LANGUAGEPARENT" ) == 0 ) |
80 { |
81 { |
81 ParseParentUID(); |
82 ParseParentUID(); |
82 } |
83 } |
83 else if( _wcsicmp( gInput.iToken, L"PROTECT" ) == 0 ) |
84 else if( sd_wcscasecmp( gInput.iToken, L"PROTECT" ) == 0 ) |
84 { |
85 { |
85 ParseProtect(); |
86 ParseProtect(); |
86 } |
87 } |
87 else if( _wcsicmp( gInput.iToken, L"AUTHOR" ) == 0 ) |
88 else if( sd_wcscasecmp( gInput.iToken, L"AUTHOR" ) == 0 ) |
88 { |
89 { |
89 ParseAuthor(); |
90 ParseAuthor(); |
90 } |
91 } |
91 else if( _wcsicmp( gInput.iToken, L"COPYRIGHT" ) == 0 ) |
92 else if( sd_wcscasecmp( gInput.iToken, L"COPYRIGHT" ) == 0 ) |
92 { |
93 { |
93 ParseCopyright(); |
94 ParseCopyright(); |
94 } |
95 } |
95 else if( _wcsicmp( gInput.iToken, L"TARGETDEVICE" ) == 0 ) |
96 else if( sd_wcscasecmp( gInput.iToken, L"TARGETDEVICE" ) == 0 ) |
96 { |
97 { |
97 ParseTargetDevice(); |
98 ParseTargetDevice(); |
98 } |
99 } |
99 else if( _wcsicmp( gInput.iToken, L"TOOL" ) == 0 ) |
100 else if( sd_wcscasecmp( gInput.iToken, L"TOOL" ) == 0 ) |
100 { |
101 { |
101 ParseTool(); |
102 ParseTool(); |
102 } |
103 } |
103 else if( _wcsicmp( gInput.iToken, L"BITMAP" ) == 0 ) |
104 else if( sd_wcscasecmp( gInput.iToken, L"BITMAP" ) == 0 ) |
104 { |
105 { |
105 ParseBitmap(); |
106 ParseBitmap(); |
106 } |
107 } |
107 else if( _wcsicmp( gInput.iToken, L"COLORTABLE" ) == 0 ) |
108 else if( sd_wcscasecmp( gInput.iToken, L"COLORTABLE" ) == 0 ) |
108 { |
109 { |
109 ParseColorTable(); |
110 ParseColorTable(); |
110 } |
111 } |
111 else if( _wcsicmp( gInput.iToken, L"FRAME" ) == 0 ) |
112 else if( sd_wcscasecmp( gInput.iToken, L"FRAME" ) == 0 ) |
112 { |
113 { |
113 ParseFrame(); |
114 ParseFrame(); |
114 } |
115 } |
115 else if( _wcsicmp( gInput.iToken, L"BMPANIM" ) == 0 ) |
116 else if( sd_wcscasecmp( gInput.iToken, L"BMPANIM" ) == 0 ) |
116 { |
117 { |
117 ParseBmpAnim(); |
118 ParseBmpAnim(); |
118 } |
119 } |
119 else if( _wcsicmp( gInput.iToken, L"APPICON" ) == 0 ) |
120 else if( sd_wcscasecmp( gInput.iToken, L"APPICON" ) == 0 ) |
120 { |
121 { |
121 ParseAppIcon(); |
122 ParseAppIcon(); |
122 } |
123 } |
123 else if( _wcsicmp( gInput.iToken, L"PALETTE" ) == 0 ) |
124 else if( sd_wcscasecmp( gInput.iToken, L"PALETTE" ) == 0 ) |
124 { |
125 { |
125 ParsePalette(); |
126 ParsePalette(); |
126 } |
127 } |
127 else if( (_wcsicmp( gInput.iToken, L"SOUND" ) == 0) |
128 else if( (sd_wcscasecmp( gInput.iToken, L"SOUND" ) == 0) |
128 || (_wcsicmp( gInput.iToken, L"STRING" ) == 0) ) |
129 || (sd_wcscasecmp( gInput.iToken, L"STRING" ) == 0) ) |
129 { |
130 { |
130 ParseString(); |
131 ParseString(); |
131 } |
132 } |
132 else if( _wcsicmp( gInput.iToken, L"SCALABLEITEM" ) == 0 ) |
133 else if( sd_wcscasecmp( gInput.iToken, L"SCALABLEITEM" ) == 0 ) |
133 { |
134 { |
134 if( !iData->IsScalable() ) throw CSDCException( ESDCContentError, "SCALABLEITEM can only be included in scalable skins" ); |
135 if( !iData->IsScalable() ) throw CSDCException( ESDCContentError, "SCALABLEITEM can only be included in scalable skins" ); |
135 ParseScalableItem(); |
136 ParseScalableItem(); |
136 } |
137 } |
137 else if( _wcsicmp( gInput.iToken, L"ANIMATION" ) == 0 ) |
138 else if( sd_wcscasecmp( gInput.iToken, L"ANIMATION" ) == 0 ) |
138 { |
139 { |
139 if( !iData->IsScalable() ) throw CSDCException( ESDCContentError, "ANIMATION can only be included in scalable skins" ); |
140 if( !iData->IsScalable() ) throw CSDCException( ESDCContentError, "ANIMATION can only be included in scalable skins" ); |
140 ParseAnimation(); |
141 ParseAnimation(); |
141 } |
142 } |
142 else if( _wcsicmp( gInput.iToken, L"BITMAPPATH" ) == 0 ) |
143 else if( sd_wcscasecmp( gInput.iToken, L"BITMAPPATH" ) == 0 ) |
143 { |
144 { |
144 ParseBitmapPath(); |
145 ParseBitmapPath(); |
145 } |
146 } |
146 else if( _wcsicmp( gInput.iToken, L"RESTRICTION" ) == 0 ) |
147 else if( sd_wcscasecmp( gInput.iToken, L"RESTRICTION" ) == 0 ) |
147 { |
148 { |
148 ParseRestriction(); |
149 ParseRestriction(); |
149 } |
150 } |
150 else |
151 else |
151 { |
152 { |
157 |
158 |
158 void CSDCReader::ParseSkintype() |
159 void CSDCReader::ParseSkintype() |
159 { |
160 { |
160 gInput.NextToken(); |
161 gInput.NextToken(); |
161 |
162 |
162 if( _wcsicmp( gInput.iToken, L"normal" ) == 0 ) |
163 if( sd_wcscasecmp( gInput.iToken, L"normal" ) == 0 ) |
163 { |
164 { |
164 iData->iSkinType = 0x0; |
165 iData->iSkinType = 0x0; |
165 } |
166 } |
166 else if( _wcsicmp( gInput.iToken, L"system" ) == 0 ) |
167 else if( sd_wcscasecmp( gInput.iToken, L"system" ) == 0 ) |
167 { |
168 { |
168 iData->iSkinType = 0x1; |
169 iData->iSkinType = 0x1; |
169 } |
170 } |
170 else if( _wcsicmp( gInput.iToken, L"scalable" ) == 0 ) |
171 else if( sd_wcscasecmp( gInput.iToken, L"scalable" ) == 0 ) |
171 { |
172 { |
172 #if !defined( RD_ENHANCED_SKINNING ) |
173 #if !defined( RD_ENHANCED_SKINNING ) |
173 throw CSDCException( ESDCNotSupportedError, "Scalable skins not supported" ); |
174 throw CSDCException( ESDCNotSupportedError, "Scalable skins not supported" ); |
174 #endif |
175 #endif |
175 iData->iSkinType = 0x80; |
176 iData->iSkinType = 0x80; |
180 throw CSDCException( ESDCParseError, "Unknown or missing parameter for SKINTYPE" ); |
181 throw CSDCException( ESDCParseError, "Unknown or missing parameter for SKINTYPE" ); |
181 } |
182 } |
182 |
183 |
183 if( gInput.NextToken() ) |
184 if( gInput.NextToken() ) |
184 { |
185 { |
185 if( _wcsicmp( gInput.iToken, L"language=AH" ) == 0 ) |
186 if( sd_wcscasecmp( gInput.iToken, L"language=AH" ) == 0 ) |
186 { |
187 { |
187 iData->iSkinType |= 0x102; |
188 iData->iSkinType |= 0x102; |
188 } |
189 } |
189 else |
190 else |
190 { |
191 { |
233 { |
234 { |
234 if( iData->IsScalable() ) |
235 if( iData->IsScalable() ) |
235 throw CSDCException( ESDCParseError, "Language override can not be used with scalable skins" ); |
236 throw CSDCException( ESDCParseError, "Language override can not be used with scalable skins" ); |
236 |
237 |
237 gInput.NextToken(); |
238 gInput.NextToken(); |
238 if( _wcsicmp( gInput.iToken, L"AH" ) != 0 ) |
239 if( sd_wcscasecmp( gInput.iToken, L"AH" ) != 0 ) |
239 { |
240 { |
240 throw CSDCException( ESDCParseError, "Unknown or missing parameter for LANGUAGEOVERRIDE" ); |
241 throw CSDCException( ESDCParseError, "Unknown or missing parameter for LANGUAGEOVERRIDE" ); |
241 } |
242 } |
242 |
243 |
243 gInput.NextToken(); |
244 gInput.NextToken(); |
274 } |
275 } |
275 |
276 |
276 void CSDCReader::ParseProtect() |
277 void CSDCReader::ParseProtect() |
277 { |
278 { |
278 gInput.NextToken(); |
279 gInput.NextToken(); |
279 if( _wcsicmp( gInput.iToken, L"disablecopy" ) != 0 ) |
280 if( sd_wcscasecmp( gInput.iToken, L"disablecopy" ) != 0 ) |
280 { |
281 { |
281 throw CSDCException( ESDCParseError, "Unknown or missing parameter for PROTECT" ); |
282 throw CSDCException( ESDCParseError, "Unknown or missing parameter for PROTECT" ); |
282 } |
283 } |
283 |
284 |
284 iData->iProtection = 1; |
285 iData->iProtection = 1; |
311 void CSDCReader::ParseBitmap() |
312 void CSDCReader::ParseBitmap() |
312 { |
313 { |
313 gInput.NextToken(); |
314 gInput.NextToken(); |
314 |
315 |
315 bool appIcon = false; |
316 bool appIcon = false; |
316 if( _wcsicmp( gInput.iToken, L"CLASS=appicon" ) == 0 ) |
317 if( sd_wcscasecmp( gInput.iToken, L"CLASS=appicon" ) == 0 ) |
317 { |
318 { |
318 appIcon = true; |
319 appIcon = true; |
319 gInput.NextToken(); |
320 gInput.NextToken(); |
320 } |
321 } |
321 |
322 |
322 int restriction( iData->iCurrentRestriction ); |
323 int restriction( iData->iCurrentRestriction ); |
323 const TSDCIIDEntry* iid = NULL; |
324 const TSDCIIDEntry* iid = NULL; |
324 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
325 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
325 { |
326 { |
326 wchar_t iidBuf[512]; |
327 wchar_t iidBuf[512]; |
327 wcscpy( iidBuf, gInput.iToken+4 ); |
328 wcscpy( iidBuf, gInput.iToken+4 ); |
328 StripIIDPrefix( iidBuf, restriction ); |
329 StripIIDPrefix( iidBuf, restriction ); |
329 iid = SDCIIDConstants::FindPlain( iidBuf ); |
330 iid = SDCIIDConstants::FindPlain( iidBuf ); |
359 |
360 |
360 int maskIndex = -1; |
361 int maskIndex = -1; |
361 |
362 |
362 while( gInput.NextToken() ) |
363 while( gInput.NextToken() ) |
363 { |
364 { |
364 if( _wcsnicmp( gInput.iToken, L"MASK=", 5 ) == 0 ) |
365 if( sd_wcsncasecmp( gInput.iToken, L"MASK=", 5 ) == 0 ) |
365 { |
366 { |
366 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
367 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
367 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
368 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
368 { |
369 { |
369 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
370 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
374 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
375 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
375 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
376 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
376 } |
377 } |
377 maskIndex = mbmIndex+1; |
378 maskIndex = mbmIndex+1; |
378 } |
379 } |
379 else if( _wcsnicmp( gInput.iToken, L"SOFTMASK=", 9 ) == 0 ) |
380 else if( sd_wcsncasecmp( gInput.iToken, L"SOFTMASK=", 9 ) == 0 ) |
380 { |
381 { |
381 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
382 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
382 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
383 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
383 { |
384 { |
384 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
385 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
389 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
390 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
390 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
391 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
391 } |
392 } |
392 maskIndex = mbmIndex+1; |
393 maskIndex = mbmIndex+1; |
393 } |
394 } |
394 else if( _wcsicmp( gInput.iToken, L"MASK" ) == 0 ) |
395 else if( sd_wcscasecmp( gInput.iToken, L"MASK" ) == 0 ) |
395 { |
396 { |
396 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
397 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
397 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
398 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
398 maskIndex = mbmIndex+1; |
399 maskIndex = mbmIndex+1; |
399 } |
400 } |
400 else if( _wcsicmp( gInput.iToken, L"SOFTMASK" ) == 0 ) |
401 else if( sd_wcscasecmp( gInput.iToken, L"SOFTMASK" ) == 0 ) |
401 { |
402 { |
402 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
403 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
403 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
404 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
404 maskIndex = mbmIndex+1; |
405 maskIndex = mbmIndex+1; |
405 } |
406 } |
419 { |
420 { |
420 gInput.NextToken(); |
421 gInput.NextToken(); |
421 |
422 |
422 TSDCIID realIid; |
423 TSDCIID realIid; |
423 int restriction( iData->iCurrentRestriction ); |
424 int restriction( iData->iCurrentRestriction ); |
424 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
425 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
425 { |
426 { |
426 wchar_t iidBuf[512]; |
427 wchar_t iidBuf[512]; |
427 wcscpy( iidBuf, gInput.iToken+4 ); |
428 wcscpy( iidBuf, gInput.iToken+4 ); |
428 StripIIDPrefix( iidBuf, restriction ); |
429 StripIIDPrefix( iidBuf, restriction ); |
429 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
430 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
438 |
439 |
439 vector<TSDCColorTableEntry> colors; |
440 vector<TSDCColorTableEntry> colors; |
440 |
441 |
441 while( gInput.NextTokenAllowLF() ) |
442 while( gInput.NextTokenAllowLF() ) |
442 { |
443 { |
443 if( _wcsicmp( gInput.iToken, L"END" ) == 0 ) |
444 if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0 ) |
444 { |
445 { |
445 iData->CreateColorTableDef( realIid, colors, restriction ); |
446 iData->CreateColorTableDef( realIid, colors, restriction ); |
446 return; |
447 return; |
447 } |
448 } |
448 else if( _wcsnicmp( gInput.iToken, L"IDX=", 4 ) == 0 ) |
449 else if( sd_wcsncasecmp( gInput.iToken, L"IDX=", 4 ) == 0 ) |
449 { |
450 { |
450 TSDCColorTableEntry entry; |
451 TSDCColorTableEntry entry; |
451 entry.iIndex = gInput.ConvertToNumber( gInput.iToken+4 ); |
452 entry.iIndex = gInput.ConvertToNumber( gInput.iToken+4 ); |
452 entry.iRgb = 0; |
453 entry.iRgb = 0; |
453 colors.push_back( entry ); |
454 colors.push_back( entry ); |
454 } |
455 } |
455 else if( _wcsnicmp( gInput.iToken, L"RGB=", 4 ) == 0 ) |
456 else if( sd_wcsncasecmp( gInput.iToken, L"RGB=", 4 ) == 0 ) |
456 { |
457 { |
457 TSDCColorTableEntry entry; |
458 TSDCColorTableEntry entry; |
458 entry.iIndex = -1; |
459 entry.iIndex = -1; |
459 int rgb = gInput.ConvertToNumber( gInput.iToken+4 ); |
460 int rgb = gInput.ConvertToNumber( gInput.iToken+4 ); |
460 // SymbianOS actually uses BGR order |
461 // SymbianOS actually uses BGR order |
472 { |
473 { |
473 gInput.NextToken(); |
474 gInput.NextToken(); |
474 |
475 |
475 TSDCIID realIid; |
476 TSDCIID realIid; |
476 int restriction( iData->iCurrentRestriction ); |
477 int restriction( iData->iCurrentRestriction ); |
477 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
478 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
478 { |
479 { |
479 wchar_t iidBuf[512]; |
480 wchar_t iidBuf[512]; |
480 wcscpy( iidBuf, gInput.iToken+4 ); |
481 wcscpy( iidBuf, gInput.iToken+4 ); |
481 StripIIDPrefix( iidBuf, restriction ); |
482 StripIIDPrefix( iidBuf, restriction ); |
482 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
483 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
491 |
492 |
492 vector<TSDCIID> elements; |
493 vector<TSDCIID> elements; |
493 |
494 |
494 while( gInput.NextTokenAllowLF() ) |
495 while( gInput.NextTokenAllowLF() ) |
495 { |
496 { |
496 if( _wcsicmp( gInput.iToken, L"END" ) == 0) |
497 if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0) |
497 { |
498 { |
498 iData->CreateFrameDef( realIid, elements, restriction ); |
499 iData->CreateFrameDef( realIid, elements, restriction ); |
499 return; |
500 return; |
500 } |
501 } |
501 else |
502 else |
511 { |
512 { |
512 gInput.NextToken(); |
513 gInput.NextToken(); |
513 |
514 |
514 TSDCIID realIid; |
515 TSDCIID realIid; |
515 int restriction( iData->iCurrentRestriction ); |
516 int restriction( iData->iCurrentRestriction ); |
516 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
517 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
517 { |
518 { |
518 wchar_t iidBuf[512]; |
519 wchar_t iidBuf[512]; |
519 wcscpy( iidBuf, gInput.iToken+4 ); |
520 wcscpy( iidBuf, gInput.iToken+4 ); |
520 StripIIDPrefix( iidBuf, restriction ); |
521 StripIIDPrefix( iidBuf, restriction ); |
521 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
522 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
533 int flash = 0; |
534 int flash = 0; |
534 bool svganim = false; |
535 bool svganim = false; |
535 |
536 |
536 while( gInput.NextToken() ) |
537 while( gInput.NextToken() ) |
537 { |
538 { |
538 if( _wcsnicmp( gInput.iToken, L"INTERVAL=", 9 ) == 0 ) |
539 if( sd_wcsncasecmp( gInput.iToken, L"INTERVAL=", 9 ) == 0 ) |
539 { |
540 { |
540 interval = gInput.ConvertToNumber( gInput.iToken+9 ); |
541 interval = gInput.ConvertToNumber( gInput.iToken+9 ); |
541 } |
542 } |
542 else if( _wcsicmp( gInput.iToken, L"MODE=play" ) == 0 ) |
543 else if( sd_wcscasecmp( gInput.iToken, L"MODE=play" ) == 0 ) |
543 { |
544 { |
544 playMode = 0; |
545 playMode = 0; |
545 } |
546 } |
546 else if( _wcsicmp( gInput.iToken, L"MODE=cycle" ) == 0 ) |
547 else if( sd_wcscasecmp( gInput.iToken, L"MODE=cycle" ) == 0 ) |
547 { |
548 { |
548 playMode = 1; |
549 playMode = 1; |
549 } |
550 } |
550 else if( _wcsicmp( gInput.iToken, L"MODE=bounce" ) == 0 ) |
551 else if( sd_wcscasecmp( gInput.iToken, L"MODE=bounce" ) == 0 ) |
551 { |
552 { |
552 playMode = 2; |
553 playMode = 2; |
553 } |
554 } |
554 else if( _wcsicmp( gInput.iToken, L"MODE=svganim" ) == 0 ) |
555 else if( sd_wcscasecmp( gInput.iToken, L"MODE=svganim" ) == 0 ) |
555 { |
556 { |
556 playMode = 255; |
557 playMode = 255; |
557 svganim = true; |
558 svganim = true; |
558 } |
559 } |
559 else if( _wcsicmp( gInput.iToken, L"FLASH" ) == 0 ) |
560 else if( sd_wcscasecmp( gInput.iToken, L"FLASH" ) == 0 ) |
560 { |
561 { |
561 flash = 1; |
562 flash = 1; |
562 } |
563 } |
563 else |
564 else |
564 { |
565 { |
571 int time = -1; |
572 int time = -1; |
572 int posx = 0; |
573 int posx = 0; |
573 int posy = 0; |
574 int posy = 0; |
574 while( gInput.NextTokenAllowLF() ) |
575 while( gInput.NextTokenAllowLF() ) |
575 { |
576 { |
576 if( _wcsnicmp( gInput.iToken, L"TIME=", 5 ) == 0 ) |
577 if( sd_wcsncasecmp( gInput.iToken, L"TIME=", 5 ) == 0 ) |
577 { |
578 { |
578 time = gInput.ConvertToNumber( gInput.iToken+5 ); |
579 time = gInput.ConvertToNumber( gInput.iToken+5 ); |
579 } |
580 } |
580 else if( _wcsnicmp( gInput.iToken, L"POS=", 4 ) == 0 ) |
581 else if( sd_wcsncasecmp( gInput.iToken, L"POS=", 4 ) == 0 ) |
581 { |
582 { |
582 wchar_t buf[512]; |
583 wchar_t buf[512]; |
583 wcscpy( buf, gInput.iToken+4 ); |
584 wcscpy( buf, gInput.iToken+4 ); |
584 wchar_t* p = wcsstr( buf, L"," ); |
585 wchar_t* p = wcsstr( buf, L"," ); |
585 if( !p ) throw CSDCException( ESDCParseError, "No comma found in POS parameter of BMPANIM" ); |
586 if( !p ) throw CSDCException( ESDCParseError, "No comma found in POS parameter of BMPANIM" ); |
586 *p = 0; |
587 *p = 0; |
587 posx = gInput.ConvertToNumber( buf ); |
588 posx = gInput.ConvertToNumber( buf ); |
588 posy = gInput.ConvertToNumber( p+1 ); |
589 posy = gInput.ConvertToNumber( p+1 ); |
589 } |
590 } |
590 else if( _wcsicmp( gInput.iToken, L"END" ) == 0 ) |
591 else if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0 ) |
591 { |
592 { |
592 iData->CreateBmpAnimDef( realIid, interval, playMode, flash, frames, restriction ); |
593 iData->CreateBmpAnimDef( realIid, interval, playMode, flash, frames, restriction ); |
593 return; |
594 return; |
594 } |
595 } |
595 else |
596 else |
613 |
614 |
614 void CSDCReader::ParseAppIcon() |
615 void CSDCReader::ParseAppIcon() |
615 { |
616 { |
616 gInput.NextToken(); |
617 gInput.NextToken(); |
617 int uid; |
618 int uid; |
618 if( _wcsnicmp( gInput.iToken, L"UID=", 4 ) == 0 ) |
619 if( sd_wcsncasecmp( gInput.iToken, L"UID=", 4 ) == 0 ) |
619 { |
620 { |
620 uid = gInput.ConvertToNumber( gInput.iToken+4 ); |
621 uid = gInput.ConvertToNumber( gInput.iToken+4 ); |
621 } |
622 } |
622 else |
623 else |
623 { |
624 { |
627 int restriction( iData->iCurrentRestriction ); |
628 int restriction( iData->iCurrentRestriction ); |
628 |
629 |
629 vector<TSDCIID> iconBitmaps; |
630 vector<TSDCIID> iconBitmaps; |
630 while( gInput.NextTokenAllowLF() ) |
631 while( gInput.NextTokenAllowLF() ) |
631 { |
632 { |
632 if( _wcsicmp( gInput.iToken, L"END" ) == 0) |
633 if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0) |
633 { |
634 { |
634 TSDCIID realIid; |
635 TSDCIID realIid; |
635 realIid.iMajor = EAknsMajorAppIcon; |
636 realIid.iMajor = EAknsMajorAppIcon; |
636 realIid.iMinor = uid; |
637 realIid.iMinor = uid; |
637 iData->CreateAppIconDef( realIid, iconBitmaps, restriction ); |
638 iData->CreateAppIconDef( realIid, iconBitmaps, restriction ); |
657 } |
658 } |
658 |
659 |
659 void CSDCReader::ParsePalette() |
660 void CSDCReader::ParsePalette() |
660 { |
661 { |
661 gInput.NextToken(); |
662 gInput.NextToken(); |
662 if( _wcsnicmp( gInput.iToken, L"SCHEME=", 7 ) == 0 ) |
663 if( sd_wcsncasecmp( gInput.iToken, L"SCHEME=", 7 ) == 0 ) |
663 { |
664 { |
664 iData->iPalettePid.iPID2 = 0; |
665 iData->iPalettePid.iPID2 = 0; |
665 iData->iPalettePid.iPID1 = gInput.ConvertToNumber( gInput.iToken+7 ); |
666 iData->iPalettePid.iPID1 = gInput.ConvertToNumber( gInput.iToken+7 ); |
666 } |
667 } |
667 else |
668 else |
673 void CSDCReader::ParseString() |
674 void CSDCReader::ParseString() |
674 { |
675 { |
675 gInput.NextToken(); |
676 gInput.NextToken(); |
676 TSDCIID realIid; |
677 TSDCIID realIid; |
677 int restriction( iData->iCurrentRestriction ); |
678 int restriction( iData->iCurrentRestriction ); |
678 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
679 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
679 { |
680 { |
680 wchar_t iidBuf[512]; |
681 wchar_t iidBuf[512]; |
681 wcscpy( iidBuf, gInput.iToken+4 ); |
682 wcscpy( iidBuf, gInput.iToken+4 ); |
682 StripIIDPrefix( iidBuf, restriction ); |
683 StripIIDPrefix( iidBuf, restriction ); |
683 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
684 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
697 void CSDCReader::ParseScalableItem() |
698 void CSDCReader::ParseScalableItem() |
698 { |
699 { |
699 gInput.NextToken(); |
700 gInput.NextToken(); |
700 TSDCIID realIid; |
701 TSDCIID realIid; |
701 int restriction( iData->iCurrentRestriction ); |
702 int restriction( iData->iCurrentRestriction ); |
702 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
703 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
703 { |
704 { |
704 wchar_t iidBuf[512]; |
705 wchar_t iidBuf[512]; |
705 wcscpy( iidBuf, gInput.iToken+4 ); |
706 wcscpy( iidBuf, gInput.iToken+4 ); |
706 StripIIDPrefix( iidBuf, restriction ); |
707 StripIIDPrefix( iidBuf, restriction ); |
707 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
708 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
714 throw CSDCException( ESDCParseError, "IID parameter expected for SCALABLEITEM" ); |
715 throw CSDCException( ESDCParseError, "IID parameter expected for SCALABLEITEM" ); |
715 } |
716 } |
716 |
717 |
717 gInput.NextToken(); |
718 gInput.NextToken(); |
718 int input = 0; |
719 int input = 0; |
719 if( _wcsnicmp( gInput.iToken, L"INPUT=", 6 ) == 0 ) |
720 if( sd_wcsncasecmp( gInput.iToken, L"INPUT=", 6 ) == 0 ) |
720 { |
721 { |
721 input = CSDCInput::ConvertToLayer( gInput.iToken+6 ); |
722 input = CSDCInput::ConvertToLayer( gInput.iToken+6 ); |
722 } |
723 } |
723 else if( _wcsnicmp( gInput.iToken, L"REFIID=", 7 ) == 0 ) |
724 else if( sd_wcsncasecmp( gInput.iToken, L"REFIID=", 7 ) == 0 ) |
724 { |
725 { |
725 // Reference only |
726 // Reference only |
726 TSDCIID refIid; |
727 TSDCIID refIid; |
727 int ignored; |
728 int ignored; |
728 wchar_t iidBuf[512]; |
729 wchar_t iidBuf[512]; |
746 throw CSDCException( ESDCParseError, "INPUT parameter expected for SCALABLEITEM" ); |
747 throw CSDCException( ESDCParseError, "INPUT parameter expected for SCALABLEITEM" ); |
747 } |
748 } |
748 |
749 |
749 gInput.NextToken(); |
750 gInput.NextToken(); |
750 int output = 0; |
751 int output = 0; |
751 if( _wcsnicmp( gInput.iToken, L"OUTPUT=", 7 ) == 0 ) |
752 if( sd_wcsncasecmp( gInput.iToken, L"OUTPUT=", 7 ) == 0 ) |
752 { |
753 { |
753 output = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
754 output = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
754 } |
755 } |
755 else |
756 else |
756 { |
757 { |
758 } |
759 } |
759 |
760 |
760 vector<TSDCEffectCommand> commands; |
761 vector<TSDCEffectCommand> commands; |
761 while( gInput.NextTokenAllowLF() ) |
762 while( gInput.NextTokenAllowLF() ) |
762 { |
763 { |
763 if( _wcsicmp( gInput.iToken, L"END" ) == 0) |
764 if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0) |
764 { |
765 { |
765 iData->CreateScalableItemDef( realIid, input, output, commands, restriction ); |
766 iData->CreateScalableItemDef( realIid, input, output, commands, restriction ); |
766 return; |
767 return; |
767 } |
768 } |
768 else if( _wcsicmp( gInput.iToken, L"EFFECT" ) == 0) |
769 else if( sd_wcscasecmp( gInput.iToken, L"EFFECT" ) == 0) |
769 { |
770 { |
770 TSDCEffectCommand command; |
771 TSDCEffectCommand command; |
771 ParseEffectCommand( command ); |
772 ParseEffectCommand( command ); |
772 commands.push_back( command ); |
773 commands.push_back( command ); |
773 } |
774 } |
783 void CSDCReader::ParseAnimation() |
784 void CSDCReader::ParseAnimation() |
784 { |
785 { |
785 gInput.NextToken(); |
786 gInput.NextToken(); |
786 TSDCIID realIid; |
787 TSDCIID realIid; |
787 int restriction( iData->iCurrentRestriction ); |
788 int restriction( iData->iCurrentRestriction ); |
788 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
789 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
789 { |
790 { |
790 wchar_t iidBuf[512]; |
791 wchar_t iidBuf[512]; |
791 wcscpy( iidBuf, gInput.iToken+4 ); |
792 wcscpy( iidBuf, gInput.iToken+4 ); |
792 StripIIDPrefix( iidBuf, restriction ); |
793 StripIIDPrefix( iidBuf, restriction ); |
793 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
794 const TSDCIIDEntry* iid = SDCIIDConstants::FindPlain( iidBuf ); |
800 throw CSDCException( ESDCParseError, "IID parameter expected for ANIMATION" ); |
801 throw CSDCException( ESDCParseError, "IID parameter expected for ANIMATION" ); |
801 } |
802 } |
802 |
803 |
803 gInput.NextToken(); |
804 gInput.NextToken(); |
804 int input = 0; |
805 int input = 0; |
805 if( _wcsnicmp( gInput.iToken, L"INPUT=", 6 ) == 0 ) |
806 if( sd_wcsncasecmp( gInput.iToken, L"INPUT=", 6 ) == 0 ) |
806 { |
807 { |
807 input = CSDCInput::ConvertToLayer( gInput.iToken+6 ); |
808 input = CSDCInput::ConvertToLayer( gInput.iToken+6 ); |
808 } |
809 } |
809 else |
810 else |
810 { |
811 { |
811 throw CSDCException( ESDCParseError, "INPUT parameter expected for ANIMATION" ); |
812 throw CSDCException( ESDCParseError, "INPUT parameter expected for ANIMATION" ); |
812 } |
813 } |
813 |
814 |
814 gInput.NextToken(); |
815 gInput.NextToken(); |
815 int output = 0; |
816 int output = 0; |
816 if( _wcsnicmp( gInput.iToken, L"OUTPUT=", 7 ) == 0 ) |
817 if( sd_wcsncasecmp( gInput.iToken, L"OUTPUT=", 7 ) == 0 ) |
817 { |
818 { |
818 output = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
819 output = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
819 } |
820 } |
820 else |
821 else |
821 { |
822 { |
822 throw CSDCException( ESDCParseError, "OUTPUT parameter expected for ANIMATION" ); |
823 throw CSDCException( ESDCParseError, "OUTPUT parameter expected for ANIMATION" ); |
823 } |
824 } |
824 |
825 |
825 gInput.NextToken(); |
826 gInput.NextToken(); |
826 int mininterval = 0; |
827 int mininterval = 0; |
827 if( _wcsnicmp( gInput.iToken, L"MININTERVAL=", 12 ) == 0 ) |
828 if( sd_wcsncasecmp( gInput.iToken, L"MININTERVAL=", 12 ) == 0 ) |
828 { |
829 { |
829 mininterval = CSDCInput::ConvertToNumber( gInput.iToken+12 ); |
830 mininterval = CSDCInput::ConvertToNumber( gInput.iToken+12 ); |
830 } |
831 } |
831 else |
832 else |
832 { |
833 { |
834 } |
835 } |
835 |
836 |
836 gInput.NextTokenAllowLF(); |
837 gInput.NextTokenAllowLF(); |
837 |
838 |
838 bool morphing = false; |
839 bool morphing = false; |
839 if( _wcsicmp( gInput.iToken, L"MORPHING" ) == 0 ) |
840 if( sd_wcscasecmp( gInput.iToken, L"MORPHING" ) == 0 ) |
840 { |
841 { |
841 morphing = true; |
842 morphing = true; |
842 |
843 |
843 gInput.NextTokenAllowLF(); |
844 gInput.NextTokenAllowLF(); |
844 } |
845 } |
845 |
846 |
846 vector<TSDCEffectCommand> preprocessCommands; |
847 vector<TSDCEffectCommand> preprocessCommands; |
847 if( _wcsicmp( gInput.iToken, L"PREPROCESS" ) == 0 ) |
848 if( sd_wcscasecmp( gInput.iToken, L"PREPROCESS" ) == 0 ) |
848 { |
849 { |
849 bool terminated( false ); |
850 bool terminated( false ); |
850 while( gInput.NextTokenAllowLF() ) |
851 while( gInput.NextTokenAllowLF() ) |
851 { |
852 { |
852 if( _wcsicmp( gInput.iToken, L"END" ) == 0) |
853 if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0) |
853 { |
854 { |
854 terminated = true; |
855 terminated = true; |
855 break; |
856 break; |
856 } |
857 } |
857 else if( _wcsicmp( gInput.iToken, L"EFFECT" ) == 0) |
858 else if( sd_wcscasecmp( gInput.iToken, L"EFFECT" ) == 0) |
858 { |
859 { |
859 TSDCEffectCommand command; |
860 TSDCEffectCommand command; |
860 ParseEffectCommand( command ); |
861 ParseEffectCommand( command ); |
861 preprocessCommands.push_back( command ); |
862 preprocessCommands.push_back( command ); |
862 } |
863 } |
876 vector<TSDCAnimParamGroup> sizeBoundParams; |
877 vector<TSDCAnimParamGroup> sizeBoundParams; |
877 |
878 |
878 bool terminated( false ); |
879 bool terminated( false ); |
879 do |
880 do |
880 { |
881 { |
881 if( _wcsicmp( gInput.iToken, L"END" ) == 0) |
882 if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0) |
882 { |
883 { |
883 terminated = true; |
884 terminated = true; |
884 break; |
885 break; |
885 } |
886 } |
886 else if( _wcsicmp( gInput.iToken, L"COMMAND" ) == 0) |
887 else if( sd_wcscasecmp( gInput.iToken, L"COMMAND" ) == 0) |
887 { |
888 { |
888 TSDCEffectCommand command; |
889 TSDCEffectCommand command; |
889 ParseEffectCommand( command ); |
890 ParseEffectCommand( command ); |
890 animCommands.push_back( command ); |
891 animCommands.push_back( command ); |
891 } |
892 } |
892 else if( _wcsicmp( gInput.iToken, L"VALUE" ) == 0) |
893 else if( sd_wcscasecmp( gInput.iToken, L"VALUE" ) == 0) |
893 { |
894 { |
894 gInput.NextToken(); |
895 gInput.NextToken(); |
895 if( _wcsnicmp( gInput.iToken, L"UID=", 4 ) ) |
896 if( sd_wcsncasecmp( gInput.iToken, L"UID=", 4 ) ) |
896 throw new CSDCException( ESDCParseError, "UID parameter expected for VALUE" ); |
897 throw new CSDCException( ESDCParseError, "UID parameter expected for VALUE" ); |
897 int uid = CSDCInput::ConvertToNumber( gInput.iToken+4 ); |
898 int uid = CSDCInput::ConvertToNumber( gInput.iToken+4 ); |
898 |
899 |
899 gInput.NextToken(); |
900 gInput.NextToken(); |
900 if( _wcsnicmp( gInput.iToken, L"TIMINGID=", 9 ) ) |
901 if( sd_wcsncasecmp( gInput.iToken, L"TIMINGID=", 9 ) ) |
901 throw new CSDCException( ESDCParseError, "TIMINGID parameter expected for VALUE" ); |
902 throw new CSDCException( ESDCParseError, "TIMINGID parameter expected for VALUE" ); |
902 int timingId = CSDCInput::ConvertToNumber( gInput.iToken+9 ); |
903 int timingId = CSDCInput::ConvertToNumber( gInput.iToken+9 ); |
903 |
904 |
904 TSDCAnimParamGroup paramGroup; |
905 TSDCAnimParamGroup paramGroup; |
905 |
906 |
906 while( gInput.NextTokenAllowLF() && _wcsicmp( gInput.iToken, L"END" ) ) |
907 while( gInput.NextTokenAllowLF() && sd_wcscasecmp( gInput.iToken, L"END" ) ) |
907 { |
908 { |
908 TSDCEffectParameter parameter; |
909 TSDCEffectParameter parameter; |
909 ParseEffectParameter( parameter ); |
910 ParseEffectParameter( parameter ); |
910 paramGroup.iParameters.push_back( parameter ); |
911 paramGroup.iParameters.push_back( parameter ); |
911 } |
912 } |
912 |
913 |
913 paramGroup.iValueA = uid; |
914 paramGroup.iValueA = uid; |
914 paramGroup.iValueB = timingId; |
915 paramGroup.iValueB = timingId; |
915 values.push_back( paramGroup ); |
916 values.push_back( paramGroup ); |
916 } |
917 } |
917 else if( _wcsicmp( gInput.iToken, L"TIMINGMODEL" ) == 0) |
918 else if( sd_wcscasecmp( gInput.iToken, L"TIMINGMODEL" ) == 0) |
918 { |
919 { |
919 gInput.NextToken(); |
920 gInput.NextToken(); |
920 if( _wcsnicmp( gInput.iToken, L"UID=", 4 ) ) |
921 if( sd_wcsncasecmp( gInput.iToken, L"UID=", 4 ) ) |
921 throw new CSDCException( ESDCParseError, "UID parameter expected for TIMINGMODEL" ); |
922 throw new CSDCException( ESDCParseError, "UID parameter expected for TIMINGMODEL" ); |
922 int uid = CSDCInput::ConvertToNumber( gInput.iToken+4 ); |
923 int uid = CSDCInput::ConvertToNumber( gInput.iToken+4 ); |
923 |
924 |
924 TSDCAnimParamGroup paramGroup; |
925 TSDCAnimParamGroup paramGroup; |
925 |
926 |
926 while( gInput.NextTokenAllowLF() && _wcsicmp( gInput.iToken, L"END" ) ) |
927 while( gInput.NextTokenAllowLF() && sd_wcscasecmp( gInput.iToken, L"END" ) ) |
927 { |
928 { |
928 TSDCEffectParameter parameter; |
929 TSDCEffectParameter parameter; |
929 ParseEffectParameter( parameter ); |
930 ParseEffectParameter( parameter ); |
930 paramGroup.iParameters.push_back( parameter ); |
931 paramGroup.iParameters.push_back( parameter ); |
931 } |
932 } |
932 |
933 |
933 paramGroup.iValueA = uid; |
934 paramGroup.iValueA = uid; |
934 paramGroup.iValueB = 0; |
935 paramGroup.iValueB = 0; |
935 timingModels.push_back( paramGroup ); |
936 timingModels.push_back( paramGroup ); |
936 } |
937 } |
937 else if( _wcsicmp( gInput.iToken, L"SIZEBOUNDPARAM" ) == 0) |
938 else if( sd_wcscasecmp( gInput.iToken, L"SIZEBOUNDPARAM" ) == 0) |
938 { |
939 { |
939 gInput.NextToken(); |
940 gInput.NextToken(); |
940 TSDCEffectParameter parameter; |
941 TSDCEffectParameter parameter; |
941 parameter.iType = 0; |
942 parameter.iType = 0; |
942 wcscpy( parameter.iName, gInput.iToken ); |
943 wcscpy( parameter.iName, gInput.iToken ); |
943 parameter.iNumber = 0; |
944 parameter.iNumber = 0; |
944 |
945 |
945 gInput.NextToken(); |
946 gInput.NextToken(); |
946 if( _wcsnicmp( gInput.iToken, L"VALUEID=", 8 ) ) |
947 if( sd_wcsncasecmp( gInput.iToken, L"VALUEID=", 8 ) ) |
947 throw new CSDCException( ESDCParseError, "VALUEID parameter expected for SIZEBOUNDPARAM" ); |
948 throw new CSDCException( ESDCParseError, "VALUEID parameter expected for SIZEBOUNDPARAM" ); |
948 int valueId = CSDCInput::ConvertToNumber( gInput.iToken+8 ); |
949 int valueId = CSDCInput::ConvertToNumber( gInput.iToken+8 ); |
949 |
950 |
950 gInput.NextToken(); |
951 gInput.NextToken(); |
951 int flags = 0; |
952 int flags = 0; |
952 if( _wcsicmp( gInput.iToken, L"FLAGS=W" ) == 0 ) |
953 if( sd_wcscasecmp( gInput.iToken, L"FLAGS=W" ) == 0 ) |
953 { |
954 { |
954 flags = 1; |
955 flags = 1; |
955 } |
956 } |
956 else if( _wcsicmp( gInput.iToken, L"FLAGS=H" ) == 0 ) |
957 else if( sd_wcscasecmp( gInput.iToken, L"FLAGS=H" ) == 0 ) |
957 { |
958 { |
958 flags = 2; |
959 flags = 2; |
959 } |
960 } |
960 else if( _wcsicmp( gInput.iToken, L"FLAGS=W_AND_H" ) == 0 ) |
961 else if( sd_wcscasecmp( gInput.iToken, L"FLAGS=W_AND_H" ) == 0 ) |
961 { |
962 { |
962 flags = 3; |
963 flags = 3; |
963 } |
964 } |
964 else throw new CSDCException( ESDCParseError, "FLAGS=W|H|W_AND_H parameter expected for SIZEBOUNDPARAM" ); |
965 else throw new CSDCException( ESDCParseError, "FLAGS=W|H|W_AND_H parameter expected for SIZEBOUNDPARAM" ); |
965 |
966 |
984 void CSDCReader::ParseBitmapPath() |
985 void CSDCReader::ParseBitmapPath() |
985 { |
986 { |
986 if( gInput.NextToken() ) |
987 if( gInput.NextToken() ) |
987 { |
988 { |
988 bool changed( true ); |
989 bool changed( true ); |
989 if( _wcsicmp( gInput.iToken, iData->iBmpPath ) == 0 ) changed = false; |
990 if( sd_wcscasecmp( gInput.iToken, iData->iBmpPath ) == 0 ) changed = false; |
990 iData->SetBmpPath( gInput.iToken ); |
991 iData->SetBmpPath( gInput.iToken ); |
991 char buf[512]; |
992 char buf[512]; |
992 CSDCInput::ConvertToAscii( buf, gInput.iToken ); |
993 CSDCInput::ConvertToAscii( buf, gInput.iToken ); |
993 if( changed ) |
994 if( changed ) |
994 printf("NOTE: Bitmap source path set to %s\n", buf ); |
995 printf("NOTE: Bitmap source path set to %s\n", buf ); |
1004 { |
1005 { |
1005 if( !iData->IsScalable() ) |
1006 if( !iData->IsScalable() ) |
1006 printf( "WARNING: RESTRICTION elements is only allowed in scalable skins, layout types will not work with this skin (line %i)\n", gInput.iLineNumber ); |
1007 printf( "WARNING: RESTRICTION elements is only allowed in scalable skins, layout types will not work with this skin (line %i)\n", gInput.iLineNumber ); |
1007 |
1008 |
1008 gInput.NextToken(); |
1009 gInput.NextToken(); |
1009 if( _wcsicmp( gInput.iToken, L"S60_2_6" ) == 0 ) |
1010 if( sd_wcscasecmp( gInput.iToken, L"S60_2_6" ) == 0 ) |
1010 { |
1011 { |
1011 iData->iCurrentRestriction = 0x0206; |
1012 iData->iCurrentRestriction = 0x0206; |
1012 printf("NOTE: Current restriction set to 2.6\n"); |
1013 printf("NOTE: Current restriction set to 2.6\n"); |
1013 } |
1014 } |
1014 else if( _wcsicmp( gInput.iToken, L"S60_2_7" ) == 0 ) |
1015 else if( sd_wcscasecmp( gInput.iToken, L"S60_2_7" ) == 0 ) |
1015 { |
1016 { |
1016 iData->iCurrentRestriction = 0x0207; |
1017 iData->iCurrentRestriction = 0x0207; |
1017 printf("NOTE: Current restriction set to 2.7\n"); |
1018 printf("NOTE: Current restriction set to 2.7\n"); |
1018 } |
1019 } |
1019 else if( _wcsicmp( gInput.iToken, L"S60_2_8" ) == 0 ) |
1020 else if( sd_wcscasecmp( gInput.iToken, L"S60_2_8" ) == 0 ) |
1020 { |
1021 { |
1021 iData->iCurrentRestriction = 0x0208; |
1022 iData->iCurrentRestriction = 0x0208; |
1022 printf("NOTE: Current restriction set to 2.8\n"); |
1023 printf("NOTE: Current restriction set to 2.8\n"); |
1023 } |
1024 } |
1024 else if( _wcsicmp( gInput.iToken, L"S60_3_0" ) == 0 ) |
1025 else if( sd_wcscasecmp( gInput.iToken, L"S60_3_0" ) == 0 ) |
1025 { |
1026 { |
1026 iData->iCurrentRestriction = 0x0300; |
1027 iData->iCurrentRestriction = 0x0300; |
1027 printf("NOTE: Current restriction set to 3.0\n"); |
1028 printf("NOTE: Current restriction set to 3.0\n"); |
1028 } |
1029 } |
1029 else if( _wcsicmp( gInput.iToken, L"S60_3_1" ) == 0 ) |
1030 else if( sd_wcscasecmp( gInput.iToken, L"S60_3_1" ) == 0 ) |
1030 { |
1031 { |
1031 iData->iCurrentRestriction = 0x0301; |
1032 iData->iCurrentRestriction = 0x0301; |
1032 printf("NOTE: Current restriction set to 3.1\n"); |
1033 printf("NOTE: Current restriction set to 3.1\n"); |
1033 } |
1034 } |
1034 else if( _wcsicmp( gInput.iToken, L"S60_3_2" ) == 0 ) |
1035 else if( sd_wcscasecmp( gInput.iToken, L"S60_3_2" ) == 0 ) |
1035 { |
1036 { |
1036 iData->iCurrentRestriction = 0x0302; |
1037 iData->iCurrentRestriction = 0x0302; |
1037 printf("NOTE: Current restriction set to 3.2\n"); |
1038 printf("NOTE: Current restriction set to 3.2\n"); |
1038 } |
1039 } |
1039 else if( _wcsicmp( gInput.iToken, L"S60_5_0" ) == 0 ) |
1040 else if( sd_wcscasecmp( gInput.iToken, L"S60_5_0" ) == 0 ) |
1040 { |
1041 { |
1041 iData->iCurrentRestriction = 0x0500; |
1042 iData->iCurrentRestriction = 0x0500; |
1042 printf("NOTE: Current restriction set to 5.0\n"); |
1043 printf("NOTE: Current restriction set to 5.0\n"); |
1043 } |
1044 } |
1044 else if( _wcsicmp( gInput.iToken, L"LAY_W" ) == 0 ) |
1045 else if( sd_wcscasecmp( gInput.iToken, L"LAY_W" ) == 0 ) |
1045 { |
1046 { |
1046 iData->iCurrentRestriction = 0x00010000; |
1047 iData->iCurrentRestriction = 0x00010000; |
1047 printf("NOTE: Current restriction set to Layout/Non-Mirrored\n"); |
1048 printf("NOTE: Current restriction set to Layout/Non-Mirrored\n"); |
1048 } |
1049 } |
1049 else if( _wcsicmp( gInput.iToken, L"LAY_AH" ) == 0 ) |
1050 else if( sd_wcscasecmp( gInput.iToken, L"LAY_AH" ) == 0 ) |
1050 { |
1051 { |
1051 iData->iCurrentRestriction = 0x00020000; |
1052 iData->iCurrentRestriction = 0x00020000; |
1052 printf("NOTE: Current restriction set to Layout/Mirrored\n"); |
1053 printf("NOTE: Current restriction set to Layout/Mirrored\n"); |
1053 } |
1054 } |
1054 else if( _wcsnicmp( gInput.iToken, L"LANG=", 5 ) == 0 ) |
1055 else if( sd_wcsncasecmp( gInput.iToken, L"LANG=", 5 ) == 0 ) |
1055 { |
1056 { |
1056 int language = (CSDCInput::ConvertToNumber( gInput.iToken+5 ))&0xffff; |
1057 int language = (CSDCInput::ConvertToNumber( gInput.iToken+5 ))&0xffff; |
1057 printf("NOTE: Current restriction set to Language/langcode:%d\n", language); |
1058 printf("NOTE: Current restriction set to Language/langcode:%d\n", language); |
1058 iData->iCurrentRestriction = language|0x00030000; |
1059 iData->iCurrentRestriction = language|0x00030000; |
1059 iData->iLanguageVector.push_back(language|0x00030000); |
1060 iData->iLanguageVector.push_back(language|0x00030000); |
1060 } |
1061 } |
1061 else if( _wcsicmp( gInput.iToken, L"NONE" ) == 0 ) |
1062 else if( sd_wcscasecmp( gInput.iToken, L"NONE" ) == 0 ) |
1062 { |
1063 { |
1063 iData->iCurrentRestriction = 0; |
1064 iData->iCurrentRestriction = 0; |
1064 printf("NOTE: Current restriction cleared\n"); |
1065 printf("NOTE: Current restriction cleared\n"); |
1065 } |
1066 } |
1066 else |
1067 else |
1070 } |
1071 } |
1071 |
1072 |
1072 TSDCIID CSDCReader::ParseBitmapSource( const bool aAppIcon, const int aRestriction, const bool aSvgAnim ) |
1073 TSDCIID CSDCReader::ParseBitmapSource( const bool aAppIcon, const int aRestriction, const bool aSvgAnim ) |
1073 { |
1074 { |
1074 int restriction( iData->iCurrentRestriction ); |
1075 int restriction( iData->iCurrentRestriction ); |
1075 if( _wcsnicmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
1076 if( sd_wcsncasecmp( gInput.iToken, L"IID=", 4 ) == 0 ) |
1076 { |
1077 { |
1077 wchar_t iidBuf[512]; |
1078 wchar_t iidBuf[512]; |
1078 wcscpy( iidBuf, gInput.iToken+4 ); |
1079 wcscpy( iidBuf, gInput.iToken+4 ); |
1079 StripIIDPrefix( iidBuf, restriction ); |
1080 StripIIDPrefix( iidBuf, restriction ); |
1080 char buf[512]; |
1081 char buf[512]; |
1152 |
1153 |
1153 int maskIndex = -1; |
1154 int maskIndex = -1; |
1154 |
1155 |
1155 while( gInput.NextToken() ) |
1156 while( gInput.NextToken() ) |
1156 { |
1157 { |
1157 if( _wcsnicmp( gInput.iToken, L"MASK=", 5 ) == 0 ) |
1158 if( sd_wcsncasecmp( gInput.iToken, L"MASK=", 5 ) == 0 ) |
1158 { |
1159 { |
1159 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1160 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1160 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1161 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1161 { |
1162 { |
1162 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1163 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1167 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1168 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1168 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1169 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1169 } |
1170 } |
1170 maskIndex = mbmIndex+1; |
1171 maskIndex = mbmIndex+1; |
1171 } |
1172 } |
1172 else if( _wcsnicmp( gInput.iToken, L"SOFTMASK=", 9 ) == 0 ) |
1173 else if( sd_wcsncasecmp( gInput.iToken, L"SOFTMASK=", 9 ) == 0 ) |
1173 { |
1174 { |
1174 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1175 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1175 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1176 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1176 { |
1177 { |
1177 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1178 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1182 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1183 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1183 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1184 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1184 } |
1185 } |
1185 maskIndex = mbmIndex+1; |
1186 maskIndex = mbmIndex+1; |
1186 } |
1187 } |
1187 else if( _wcsicmp( gInput.iToken, L"MASK" ) == 0 ) |
1188 else if( sd_wcscasecmp( gInput.iToken, L"MASK" ) == 0 ) |
1188 { |
1189 { |
1189 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1190 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1190 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1191 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1191 maskIndex = mbmIndex+1; |
1192 maskIndex = mbmIndex+1; |
1192 } |
1193 } |
1193 else if( _wcsicmp( gInput.iToken, L"SOFTMASK" ) == 0 ) |
1194 else if( sd_wcscasecmp( gInput.iToken, L"SOFTMASK" ) == 0 ) |
1194 { |
1195 { |
1195 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1196 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1196 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1197 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1197 maskIndex = mbmIndex+1; |
1198 maskIndex = mbmIndex+1; |
1198 } |
1199 } |
1214 void CSDCReader::ProcessAttribute( TSDCImageAttributes& aAttributes, wchar_t* aSource ) |
1215 void CSDCReader::ProcessAttribute( TSDCImageAttributes& aAttributes, wchar_t* aSource ) |
1215 { |
1216 { |
1216 wchar_t buf[512]; |
1217 wchar_t buf[512]; |
1217 wcscpy( buf, aSource ); |
1218 wcscpy( buf, aSource ); |
1218 |
1219 |
1219 if( _wcsnicmp( buf, L"COORDS=", 7 ) == 0 ) |
1220 if( sd_wcsncasecmp( buf, L"COORDS=", 7 ) == 0 ) |
1220 { |
1221 { |
1221 wchar_t* p = wcsstr( buf, L"," ); |
1222 wchar_t* p = wcsstr( buf, L"," ); |
1222 if( !p ) throw CSDCException( ESDCParseError, "No comma in image attribute COORDS" ); |
1223 if( !p ) throw CSDCException( ESDCParseError, "No comma in image attribute COORDS" ); |
1223 *p = 0; |
1224 *p = 0; |
1224 aAttributes.iAttributeFlags |= ESDCImageAttributeCoords; |
1225 aAttributes.iAttributeFlags |= ESDCImageAttributeCoords; |
1225 aAttributes.iCoordX = gInput.ConvertToNumber( buf+7 ); |
1226 aAttributes.iCoordX = gInput.ConvertToNumber( buf+7 ); |
1226 aAttributes.iCoordY = gInput.ConvertToNumber( p+1 ); |
1227 aAttributes.iCoordY = gInput.ConvertToNumber( p+1 ); |
1227 } |
1228 } |
1228 else if( _wcsnicmp( buf, L"SIZE=", 5 ) == 0 ) |
1229 else if( sd_wcsncasecmp( buf, L"SIZE=", 5 ) == 0 ) |
1229 { |
1230 { |
1230 wchar_t* p = wcsstr( buf, L"," ); |
1231 wchar_t* p = wcsstr( buf, L"," ); |
1231 if( !p ) throw CSDCException( ESDCParseError, "No comma in image attribute SIZE" ); |
1232 if( !p ) throw CSDCException( ESDCParseError, "No comma in image attribute SIZE" ); |
1232 *p = 0; |
1233 *p = 0; |
1233 aAttributes.iAttributeFlags |= ESDCImageAttributeSize; |
1234 aAttributes.iAttributeFlags |= ESDCImageAttributeSize; |
1234 aAttributes.iSizeW = gInput.ConvertToNumber( buf+5 ); |
1235 aAttributes.iSizeW = gInput.ConvertToNumber( buf+5 ); |
1235 aAttributes.iSizeH = gInput.ConvertToNumber( p+1 ); |
1236 aAttributes.iSizeH = gInput.ConvertToNumber( p+1 ); |
1236 } |
1237 } |
1237 else if( _wcsicmp( buf, L"STRETCH" ) == 0 ) |
1238 else if( sd_wcscasecmp( buf, L"STRETCH" ) == 0 ) |
1238 { |
1239 { |
1239 aAttributes.iAttributeFlags |= ESDCImageAttributeStretch; |
1240 aAttributes.iAttributeFlags |= ESDCImageAttributeStretch; |
1240 } |
1241 } |
1241 else if( _wcsicmp( buf, L"TILE" ) == 0 ) |
1242 else if( sd_wcscasecmp( buf, L"TILE" ) == 0 ) |
1242 { |
1243 { |
1243 aAttributes.iAttributeFlags |= ESDCImageAttributeTile; |
1244 aAttributes.iAttributeFlags |= ESDCImageAttributeTile; |
1244 } |
1245 } |
1245 else if( _wcsicmp( buf, L"TILEX" ) == 0 ) |
1246 else if( sd_wcscasecmp( buf, L"TILEX" ) == 0 ) |
1246 { |
1247 { |
1247 aAttributes.iAttributeFlags |= ESDCImageAttributeTileX; |
1248 aAttributes.iAttributeFlags |= ESDCImageAttributeTileX; |
1248 } |
1249 } |
1249 else if( _wcsicmp( buf, L"TILEY" ) == 0 ) |
1250 else if( sd_wcscasecmp( buf, L"TILEY" ) == 0 ) |
1250 { |
1251 { |
1251 aAttributes.iAttributeFlags |= ESDCImageAttributeTileY; |
1252 aAttributes.iAttributeFlags |= ESDCImageAttributeTileY; |
1252 } |
1253 } |
1253 else if( _wcsnicmp( buf, L"ALIGN=", 6 ) == 0 ) |
1254 else if( sd_wcsncasecmp( buf, L"ALIGN=", 6 ) == 0 ) |
1254 { |
1255 { |
1255 if( _wcsicmp( buf+6, L"TL" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignTL; |
1256 if( sd_wcscasecmp( buf+6, L"TL" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignTL; |
1256 else if( _wcsicmp( buf+6, L"TC" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignTC; |
1257 else if( sd_wcscasecmp( buf+6, L"TC" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignTC; |
1257 else if( _wcsicmp( buf+6, L"TR" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignTR; |
1258 else if( sd_wcscasecmp( buf+6, L"TR" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignTR; |
1258 else if( _wcsicmp( buf+6, L"CL" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignCL; |
1259 else if( sd_wcscasecmp( buf+6, L"CL" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignCL; |
1259 else if( _wcsicmp( buf+6, L"CC" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignCC; |
1260 else if( sd_wcscasecmp( buf+6, L"CC" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignCC; |
1260 else if( _wcsicmp( buf+6, L"CR" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignCR; |
1261 else if( sd_wcscasecmp( buf+6, L"CR" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignCR; |
1261 else if( _wcsicmp( buf+6, L"BL" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignBL; |
1262 else if( sd_wcscasecmp( buf+6, L"BL" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignBL; |
1262 else if( _wcsicmp( buf+6, L"BC" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignBC; |
1263 else if( sd_wcscasecmp( buf+6, L"BC" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignBC; |
1263 else if( _wcsicmp( buf+6, L"BR" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignBR; |
1264 else if( sd_wcscasecmp( buf+6, L"BR" ) == 0 ) aAttributes.iAlignmentFlags = ESDCImageAlignBR; |
1264 else throw CSDCException( ESDCParseError, "Unknown parameter for image attribute ALIGN" ); |
1265 else throw CSDCException( ESDCParseError, "Unknown parameter for image attribute ALIGN" ); |
1265 |
1266 |
1266 aAttributes.iAttributeFlags |= ESDCImageAttributeAlign; |
1267 aAttributes.iAttributeFlags |= ESDCImageAttributeAlign; |
1267 } |
1268 } |
1268 else throw CSDCException( ESDCParseError, "Unknown attribute parameter" ); |
1269 else throw CSDCException( ESDCParseError, "Unknown attribute parameter" ); |
1269 } |
1270 } |
1270 |
1271 |
1271 void CSDCReader::ParseEffectCommand( TSDCEffectCommand& aCommand ) |
1272 void CSDCReader::ParseEffectCommand( TSDCEffectCommand& aCommand ) |
1272 { |
1273 { |
1273 gInput.NextToken(); |
1274 gInput.NextToken(); |
1274 if( _wcsnicmp( gInput.iToken, L"UID=", 4 ) == 0 ) |
1275 if( sd_wcsncasecmp( gInput.iToken, L"UID=", 4 ) == 0 ) |
1275 { |
1276 { |
1276 aCommand.iUid = CSDCInput::ConvertToNumber( gInput.iToken+4 ); |
1277 aCommand.iUid = CSDCInput::ConvertToNumber( gInput.iToken+4 ); |
1277 } |
1278 } |
1278 else |
1279 else |
1279 { |
1280 { |
1280 throw CSDCException( ESDCParseError, "UID parameter expected for EFFECT" ); |
1281 throw CSDCException( ESDCParseError, "UID parameter expected for EFFECT" ); |
1281 } |
1282 } |
1282 |
1283 |
1283 gInput.NextToken(); |
1284 gInput.NextToken(); |
1284 if( _wcsnicmp( gInput.iToken, L"INPUTA=", 7 ) == 0 ) |
1285 if( sd_wcsncasecmp( gInput.iToken, L"INPUTA=", 7 ) == 0 ) |
1285 { |
1286 { |
1286 aCommand.iInputA = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
1287 aCommand.iInputA = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
1287 } |
1288 } |
1288 else |
1289 else |
1289 { |
1290 { |
1290 throw CSDCException( ESDCParseError, "INPUTA parameter expected for EFFECT" ); |
1291 throw CSDCException( ESDCParseError, "INPUTA parameter expected for EFFECT" ); |
1291 } |
1292 } |
1292 |
1293 |
1293 gInput.NextToken(); |
1294 gInput.NextToken(); |
1294 if( _wcsnicmp( gInput.iToken, L"INPUTB=", 7 ) == 0 ) |
1295 if( sd_wcsncasecmp( gInput.iToken, L"INPUTB=", 7 ) == 0 ) |
1295 { |
1296 { |
1296 aCommand.iInputB = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
1297 aCommand.iInputB = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
1297 } |
1298 } |
1298 else |
1299 else |
1299 { |
1300 { |
1300 throw CSDCException( ESDCParseError, "INPUTB parameter expected for EFFECT" ); |
1301 throw CSDCException( ESDCParseError, "INPUTB parameter expected for EFFECT" ); |
1301 } |
1302 } |
1302 |
1303 |
1303 gInput.NextToken(); |
1304 gInput.NextToken(); |
1304 if( _wcsnicmp( gInput.iToken, L"OUTPUT=", 7 ) == 0 ) |
1305 if( sd_wcsncasecmp( gInput.iToken, L"OUTPUT=", 7 ) == 0 ) |
1305 { |
1306 { |
1306 aCommand.iOutput = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
1307 aCommand.iOutput = CSDCInput::ConvertToLayer( gInput.iToken+7 ); |
1307 } |
1308 } |
1308 else |
1309 else |
1309 { |
1310 { |
1310 throw CSDCException( ESDCParseError, "OUTPUT parameter expected for EFFECT" ); |
1311 throw CSDCException( ESDCParseError, "OUTPUT parameter expected for EFFECT" ); |
1311 } |
1312 } |
1312 |
1313 |
1313 while( gInput.NextTokenAllowLF() ) |
1314 while( gInput.NextTokenAllowLF() ) |
1314 { |
1315 { |
1315 if( _wcsicmp( gInput.iToken, L"END" ) == 0) |
1316 if( sd_wcscasecmp( gInput.iToken, L"END" ) == 0) |
1316 { |
1317 { |
1317 // Just return, everything should be in the struct by now |
1318 // Just return, everything should be in the struct by now |
1318 return; |
1319 return; |
1319 } |
1320 } |
1320 else |
1321 else |
1328 throw CSDCException( ESDCParseError, "No END token for EFFECT" ); |
1329 throw CSDCException( ESDCParseError, "No END token for EFFECT" ); |
1329 } |
1330 } |
1330 |
1331 |
1331 void CSDCReader::ParseEffectParameter( TSDCEffectParameter& aParameter ) |
1332 void CSDCReader::ParseEffectParameter( TSDCEffectParameter& aParameter ) |
1332 { |
1333 { |
1333 if( _wcsicmp( gInput.iToken, L"INT" ) == 0) |
1334 if( sd_wcscasecmp( gInput.iToken, L"INT" ) == 0) |
1334 { |
1335 { |
1335 aParameter.iType = 0; |
1336 aParameter.iType = 0; |
1336 } |
1337 } |
1337 else if( _wcsicmp( gInput.iToken, L"STR" ) == 0) |
1338 else if( sd_wcscasecmp( gInput.iToken, L"STR" ) == 0) |
1338 { |
1339 { |
1339 aParameter.iType = 1; |
1340 aParameter.iType = 1; |
1340 } |
1341 } |
1341 else if( _wcsicmp( gInput.iToken, L"BMP" ) == 0) |
1342 else if( sd_wcscasecmp( gInput.iToken, L"BMP" ) == 0) |
1342 { |
1343 { |
1343 aParameter.iType = 2; |
1344 aParameter.iType = 2; |
1344 } |
1345 } |
1345 else if( _wcsicmp( gInput.iToken, L"NAMEDREF" ) == 0) |
1346 else if( sd_wcscasecmp( gInput.iToken, L"NAMEDREF" ) == 0) |
1346 { |
1347 { |
1347 aParameter.iType = 3; |
1348 aParameter.iType = 3; |
1348 } |
1349 } |
1349 else if( _wcsicmp( gInput.iToken, L"RAW" ) == 0) |
1350 else if( sd_wcscasecmp( gInput.iToken, L"RAW" ) == 0) |
1350 { |
1351 { |
1351 aParameter.iType = 4; |
1352 aParameter.iType = 4; |
1352 } |
1353 } |
1353 else |
1354 else |
1354 { |
1355 { |
1382 |
1383 |
1383 // Mask |
1384 // Mask |
1384 aParameter.iMaskIndex = -1; |
1385 aParameter.iMaskIndex = -1; |
1385 if( gInput.NextToken() ) |
1386 if( gInput.NextToken() ) |
1386 { |
1387 { |
1387 if( _wcsnicmp( gInput.iToken, L"MASK=", 5 ) == 0 ) |
1388 if( sd_wcsncasecmp( gInput.iToken, L"MASK=", 5 ) == 0 ) |
1388 { |
1389 { |
1389 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1390 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1390 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1391 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1391 { |
1392 { |
1392 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1393 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1397 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1398 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1398 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1399 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1399 } |
1400 } |
1400 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1401 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1401 } |
1402 } |
1402 else if( _wcsnicmp( gInput.iToken, L"SOFTMASK=", 9 ) == 0 ) |
1403 else if( sd_wcsncasecmp( gInput.iToken, L"SOFTMASK=", 9 ) == 0 ) |
1403 { |
1404 { |
1404 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1405 if( svg ) throw CSDCException( ESDCParseError, "SVG icon can not have a named mask" ); |
1405 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1406 if( mbmEntry->iMaskColorDepth!=ESDCColorDepthNone ) |
1406 { |
1407 { |
1407 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1408 printf("NOTE: Mask already defined, second definition ignored (line %i)\n", gInput.iLineNumber ); |
1412 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1413 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1413 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1414 wcscpy( mbmEntry->iMaskSourceFilename, maskFile ); |
1414 } |
1415 } |
1415 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1416 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1416 } |
1417 } |
1417 else if( _wcsicmp( gInput.iToken, L"MASK" ) == 0 ) |
1418 else if( sd_wcscasecmp( gInput.iToken, L"MASK" ) == 0 ) |
1418 { |
1419 { |
1419 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1420 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1420 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1421 mbmEntry->iMaskColorDepth = ESDCColorDepth1; |
1421 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1422 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1422 } |
1423 } |
1423 else if( _wcsicmp( gInput.iToken, L"SOFTMASK" ) == 0 ) |
1424 else if( sd_wcscasecmp( gInput.iToken, L"SOFTMASK" ) == 0 ) |
1424 { |
1425 { |
1425 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1426 if( !svg ) throw CSDCException( ESDCParseError, "Non-SVG icon can not have an unnamed mask" ); |
1426 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1427 mbmEntry->iMaskColorDepth = ESDCColorDepth8; |
1427 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1428 aParameter.iMaskIndex = aParameter.iBmpIndex+1; |
1428 } |
1429 } |
1433 } |
1434 } |
1434 } |
1435 } |
1435 else if( aParameter.iType == 3 ) |
1436 else if( aParameter.iType == 3 ) |
1436 { |
1437 { |
1437 gInput.NextToken(); |
1438 gInput.NextToken(); |
1438 if( _wcsnicmp( gInput.iToken, L"VALUEID=", 8 ) == 0 ) |
1439 if( sd_wcsncasecmp( gInput.iToken, L"VALUEID=", 8 ) == 0 ) |
1439 { |
1440 { |
1440 aParameter.iNumber = CSDCInput::ConvertToNumber( gInput.iToken+8 ); |
1441 aParameter.iNumber = CSDCInput::ConvertToNumber( gInput.iToken+8 ); |
1441 } |
1442 } |
1442 else |
1443 else |
1443 { |
1444 { |
1493 |
1494 |
1494 wchar_t buf[512]; |
1495 wchar_t buf[512]; |
1495 wcscpy( buf, delimiter+1 ); |
1496 wcscpy( buf, delimiter+1 ); |
1496 |
1497 |
1497 *delimiter = 0; |
1498 *delimiter = 0; |
1498 if( _wcsicmp( aIID, L"S60_2_6" ) == 0 ) |
1499 if( sd_wcscasecmp( aIID, L"S60_2_6" ) == 0 ) |
1499 { |
1500 { |
1500 aRestriction = 0x0206; |
1501 aRestriction = 0x0206; |
1501 } |
1502 } |
1502 else if( _wcsicmp( aIID, L"S60_2_7" ) == 0 ) |
1503 else if( sd_wcscasecmp( aIID, L"S60_2_7" ) == 0 ) |
1503 { |
1504 { |
1504 aRestriction = 0x0207; |
1505 aRestriction = 0x0207; |
1505 } |
1506 } |
1506 else if( _wcsicmp( aIID, L"S60_2_8" ) == 0 ) |
1507 else if( sd_wcscasecmp( aIID, L"S60_2_8" ) == 0 ) |
1507 { |
1508 { |
1508 aRestriction = 0x0208; |
1509 aRestriction = 0x0208; |
1509 } |
1510 } |
1510 else if( _wcsicmp( aIID, L"S60_3_0" ) == 0 ) |
1511 else if( sd_wcscasecmp( aIID, L"S60_3_0" ) == 0 ) |
1511 { |
1512 { |
1512 aRestriction = 0x0300; |
1513 aRestriction = 0x0300; |
1513 } |
1514 } |
1514 else if( _wcsicmp( aIID, L"S60_3_1" ) == 0 ) |
1515 else if( sd_wcscasecmp( aIID, L"S60_3_1" ) == 0 ) |
1515 { |
1516 { |
1516 aRestriction = 0x0301; |
1517 aRestriction = 0x0301; |
1517 } |
1518 } |
1518 else if( _wcsicmp( aIID, L"S60_3_2" ) == 0 ) |
1519 else if( sd_wcscasecmp( aIID, L"S60_3_2" ) == 0 ) |
1519 { |
1520 { |
1520 aRestriction = 0x0302; |
1521 aRestriction = 0x0302; |
1521 } |
1522 } |
1522 else if( _wcsicmp( aIID, L"S60_5_0" ) == 0 ) |
1523 else if( sd_wcscasecmp( aIID, L"S60_5_0" ) == 0 ) |
1523 { |
1524 { |
1524 aRestriction = 0x0500; |
1525 aRestriction = 0x0500; |
1525 } |
1526 } |
1526 else if( _wcsicmp( aIID, L"LAY_W" ) == 0 ) |
1527 else if( sd_wcscasecmp( aIID, L"LAY_W" ) == 0 ) |
1527 { |
1528 { |
1528 aRestriction = 0x00010000; |
1529 aRestriction = 0x00010000; |
1529 } |
1530 } |
1530 else if( _wcsicmp( aIID, L"LAY_AH" ) == 0 ) |
1531 else if( sd_wcscasecmp( aIID, L"LAY_AH" ) == 0 ) |
1531 { |
1532 { |
1532 aRestriction = 0x00020000; |
1533 aRestriction = 0x00020000; |
1533 } |
1534 } |
1534 else |
1535 else |
1535 { |
1536 { |