uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectParser.cpp
changeset 19 f5bac0badc7e
parent 13 8f67d927ea57
child 36 a7cff2fbd499
equal deleted inserted replaced
14:83d2d132aa58 19:f5bac0badc7e
   343 #ifdef _HUI_FX_PARSER_LOGGING
   343 #ifdef _HUI_FX_PARSER_LOGGING
   344             __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeVisual");
   344             __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeVisual");
   345 #endif
   345 #endif
   346             TPtrC16 extBitmap;
   346             TPtrC16 extBitmap;
   347             THuiFxVisualSrcType srcType = GetSrcTypeL( aNode, extBitmap );
   347             THuiFxVisualSrcType srcType = GetSrcTypeL( aNode, extBitmap );
   348             CHuiFxVisualLayer* visual = CHuiFxVisualLayer::NewL( *iVisual );
   348             TBool opaqueHint = GetOpaqueHintL(aNode);
       
   349             CHuiFxVisualLayer* visual = CHuiFxVisualLayer::NewL( iVisual );
   349             CleanupStack::PushL( visual );
   350             CleanupStack::PushL( visual );
   350             visual->SetSourceType( srcType );
   351             visual->SetSourceType( srcType );
       
   352             visual->SetFxmlUsesOpaqueHint( opaqueHint );
   351             if ( srcType == EVisualSrcBitmap && extBitmap.Length() > 0 )
   353             if ( srcType == EVisualSrcBitmap && extBitmap.Length() > 0 )
   352                 {
   354                 {
   353                 visual->SetExtBitmapFileL( extBitmap );
   355                 visual->SetExtBitmapFileL( extBitmap );
   354                 }
   356                 }
   355             if (aLayer && aLayer->Type() == ELayerTypeGroup)
   357             if (aLayer && aLayer->Type() == ELayerTypeGroup)
  1157 #ifdef _HUI_FX_PARSER_LOGGING
  1159 #ifdef _HUI_FX_PARSER_LOGGING
  1158     __ALFFXLOGSTRING1("CHuiFxEffectParser::GetReferencePointL - return %d",ref);
  1160     __ALFFXLOGSTRING1("CHuiFxEffectParser::GetReferencePointL - return %d",ref);
  1159 #endif
  1161 #endif
  1160     return ref;
  1162     return ref;
  1161     }
  1163     }
       
  1164 TBool CHuiFxEffectParser::GetOpaqueHintL( CMDXMLNode *aNode )
       
  1165     {
       
  1166     if (aNode->NodeType() != CMDXMLNode::EElementNode)
       
  1167         {
       
  1168         FAIL(KErrGeneral, _L("Text node expected while reading visual source type"));
       
  1169         }
       
  1170     TInt attributeIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitOpaque );
       
  1171     if (attributeIndex == KErrNotFound)
       
  1172         {
       
  1173         // If src not found, the source defaults to visual itself
       
  1174         return EFalse;
       
  1175         }
       
  1176       
       
  1177     TPtrC attributeValue;
       
  1178     TPtrC attributeName;
       
  1179     User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails( attributeIndex, attributeName, attributeValue ));
       
  1180   
       
  1181     if( attributeValue.Compare( KLitTrue ) == 0 )
       
  1182         {
       
  1183         return ETrue;
       
  1184         }
       
  1185     
       
  1186     if( attributeValue.Compare( KLitFalse ) == 0 )
       
  1187         {
       
  1188         return EFalse;
       
  1189         }
       
  1190 
       
  1191     return EFalse;
       
  1192     }
  1162 
  1193 
  1163 THuiFxVisualSrcType CHuiFxEffectParser::GetSrcTypeL( CMDXMLNode* aNode, TPtrC16& aBitmap )
  1194 THuiFxVisualSrcType CHuiFxEffectParser::GetSrcTypeL( CMDXMLNode* aNode, TPtrC16& aBitmap )
  1164     {
  1195     {
  1165 #ifdef _HUI_FX_PARSER_LOGGING
  1196 #ifdef _HUI_FX_PARSER_LOGGING
  1166     __ALFFXLOGSTRING1("CHuiFxEffectParser::GetSrcTypeL - 0x%x ",this);
  1197     __ALFFXLOGSTRING1("CHuiFxEffectParser::GetSrcTypeL - 0x%x ",this);