1053 |
1053 |
1054 // check the panning in four directions now. |
1054 // check the panning in four directions now. |
1055 TInt aX,aY; |
1055 TInt aX,aY; |
1056 // Check in Left direction |
1056 // Check in Left direction |
1057 aX = 1; aY = 0; |
1057 aX = 1; aY = 0; |
1058 if ( xmax <= clipWidth && aX < 0 ) |
1058 //Coverity fixes |
|
1059 if ( bound.iX >= zero ) |
1059 aX = 0; |
1060 aX = 0; |
1060 if ( bound.iX >= zero && aX > 0 ) |
1061 |
1061 aX = 0; |
|
1062 if ( ymax <= clipHeight && aY < 0 ) |
|
1063 aY = 0; |
|
1064 if ( bound.iY >= zero && aY > 0 ) |
|
1065 aY = 0; |
|
1066 // Do panning |
1062 // Do panning |
1067 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1063 left = ((aY)||(aX)); |
1068 left = EFalse; |
|
1069 else |
|
1070 left = ETrue; |
|
1071 |
1064 |
1072 // Check in Right direction |
1065 // Check in Right direction |
1073 aX = -1; aY = 0; |
1066 aX = -1; aY = 0; |
1074 if ( xmax <= clipWidth && aX < 0 ) |
1067 if ( xmax <= clipWidth ) |
1075 aX = 0; |
1068 aX = 0; |
1076 if ( bound.iX >= zero && aX > 0 ) |
1069 |
1077 aX = 0; |
|
1078 if ( ymax <= clipHeight && aY < 0 ) |
|
1079 aY = 0; |
|
1080 if ( bound.iY >= zero && aY > 0 ) |
|
1081 aY = 0; |
|
1082 // Do panning |
1070 // Do panning |
1083 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1071 right = ((aY)||(aX)); |
1084 right = EFalse; |
|
1085 else |
|
1086 right = ETrue; |
|
1087 |
1072 |
1088 // Check in Up direction |
1073 // Check in Up direction |
1089 aX = 0; aY = 1; |
1074 aX = 0; aY = 1; |
1090 if ( xmax <= clipWidth && aX < 0 ) |
1075 if ( bound.iY >= zero ) |
1091 aX = 0; |
|
1092 if ( bound.iX >= zero && aX > 0 ) |
|
1093 aX = 0; |
|
1094 if ( ymax <= clipHeight && aY < 0 ) |
|
1095 aY = 0; |
1076 aY = 0; |
1096 if ( bound.iY >= zero && aY > 0 ) |
1077 |
1097 aY = 0; |
|
1098 // Do panning |
1078 // Do panning |
1099 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1079 up = ((aY)||(aX)); |
1100 up = EFalse; |
|
1101 else |
|
1102 up = ETrue; |
|
1103 |
1080 |
1104 // Check in down direction |
1081 // Check in down direction |
1105 aX = 0; aY = -1; |
1082 aX = 0; aY = -1; |
1106 if ( xmax <= clipWidth && aX < 0 ) |
1083 if ( ymax <= clipHeight ) |
1107 aX = 0; |
|
1108 if ( bound.iX >= zero && aX > 0 ) |
|
1109 aX = 0; |
|
1110 if ( ymax <= clipHeight && aY < 0 ) |
|
1111 aY = 0; |
1084 aY = 0; |
1112 if ( bound.iY >= zero && aY > 0 ) |
1085 |
1113 aY = 0; |
|
1114 // Do panning |
1086 // Do panning |
1115 if ( ( aY == 0 ) && ( aX == 0 ) ) |
1087 down = ((aY)||(aX)); |
1116 down = EFalse; |
|
1117 else |
|
1118 down = ETrue; |
|
1119 |
1088 |
1120 } |
1089 } |
1121 // -------------------------------------------------------------------------- |
1090 // -------------------------------------------------------------------------- |
1122 // EXPORT_C void CSvgEngineInterfaceImpl::Rotate( TReal32 aAngle, |
1091 // EXPORT_C void CSvgEngineInterfaceImpl::Rotate( TReal32 aAngle, |
1123 // --------------------------------------------------------------------------- |
1092 // --------------------------------------------------------------------------- |
1217 TSize bbSize = GetSvgBoundingBox().Size(); |
1186 TSize bbSize = GetSvgBoundingBox().Size(); |
1218 if( svgElement->iWidthInPercentage ) |
1187 if( svgElement->iWidthInPercentage ) |
1219 { |
1188 { |
1220 bbSize.iWidth = ((TReal32)bbSize.iWidth) * percentWidth / 100.0; |
1189 bbSize.iWidth = ((TReal32)bbSize.iWidth) * percentWidth / 100.0; |
1221 } |
1190 } |
1222 else |
|
1223 { |
|
1224 bbSize.iWidth = bbSize.iWidth; |
|
1225 } |
|
1226 |
1191 |
1227 if( svgElement->iHeightInPercentage ) |
1192 if( svgElement->iHeightInPercentage ) |
1228 { |
1193 { |
1229 bbSize.iHeight = ((TReal32)bbSize.iHeight) * percentHeight / 100.0; |
1194 bbSize.iHeight = ((TReal32)bbSize.iHeight) * percentHeight / 100.0; |
1230 } |
|
1231 else |
|
1232 { |
|
1233 bbSize.iHeight = bbSize.iHeight; |
|
1234 } |
1195 } |
1235 return bbSize; |
1196 return bbSize; |
1236 } |
1197 } |
1237 } |
1198 } |
1238 |
1199 |
1536 { |
1497 { |
1537 iSvgEngine->GenerateMask(aMask); |
1498 iSvgEngine->GenerateMask(aMask); |
1538 } |
1499 } |
1539 } |
1500 } |
1540 |
1501 |
|
1502 EXPORT_C void CSvgEngineInterfaceImpl::GenerateMask(CSvgtBitmap* aMask, TInt aEngine ) |
|
1503 { |
|
1504 if ( ChooseEngine( aEngine ) ) |
|
1505 { |
|
1506 iSvgEngine->GenerateMask(aMask); |
|
1507 } |
|
1508 } |
1541 |
1509 |
1542 // -------------------------------------------------------------------------- |
1510 // -------------------------------------------------------------------------- |
1543 // EXPORT_C void CSvgEngineInterfaceImpl::SetBackgroundColor(TUint32 aRGBA8888Color, CSvgEngineImpl* aEngine) |
1511 // EXPORT_C void CSvgEngineInterfaceImpl::SetBackgroundColor(TUint32 aRGBA8888Color, CSvgEngineImpl* aEngine) |
1544 // --------------------------------------------------------------------------- |
1512 // --------------------------------------------------------------------------- |
1545 EXPORT_C void CSvgEngineInterfaceImpl::SetBackgroundColor(TUint32 aRGBA8888Color, CSvgEngineImpl* aEngine) |
1513 EXPORT_C void CSvgEngineInterfaceImpl::SetBackgroundColor(TUint32 aRGBA8888Color, CSvgEngineImpl* aEngine) |
2502 if( aEngine ) |
2470 if( aEngine ) |
2503 { |
2471 { |
2504 aEngine->SetGdiContextL( aFrameBuffer ); |
2472 aEngine->SetGdiContextL( aFrameBuffer ); |
2505 } |
2473 } |
2506 } |
2474 } |
|
2475 |
|
2476 // -------------------------------------------------------------------------- |
|
2477 // M2G: Overloaded SetGdiContextL() for CSvgtBitmap to enable rendering on target buffer. |
|
2478 // --------------------------------------------------------------------------- |
|
2479 EXPORT_C void CSvgEngineInterfaceImpl::SetGdiContextL( CSvgEngineImpl* aEngine, CSvgtBitmap* aFrameBuffer ) |
|
2480 { |
|
2481 if( aEngine ) |
|
2482 { |
|
2483 aEngine->EnableTargetRendering(ETrue); |
|
2484 aEngine->SetGdiContextL( aFrameBuffer ); |
|
2485 } |
|
2486 } |
|
2487 |
2507 // -------------------------------------------------------------------------- |
2488 // -------------------------------------------------------------------------- |
2508 // EXPORT_C void CSvgEngineInterfaceImpl::SetDocument( CSvgEngineImpl* aEngine, CSvgDocumentImpl* aDocument ) |
2489 // EXPORT_C void CSvgEngineInterfaceImpl::SetDocument( CSvgEngineImpl* aEngine, CSvgDocumentImpl* aDocument ) |
2509 // --------------------------------------------------------------------------- |
2490 // --------------------------------------------------------------------------- |
2510 EXPORT_C void CSvgEngineInterfaceImpl::SetDocument( CSvgEngineImpl* aEngine, CSvgDocumentImpl* aDocument ) |
2491 EXPORT_C void CSvgEngineInterfaceImpl::SetDocument( CSvgEngineImpl* aEngine, CSvgDocumentImpl* aDocument ) |
2511 { |
2492 { |
3100 EXPORT_C void CSvgEngineInterfaceImpl::GetFourPointElementBoundingBox(CSvgTextElementImpl* aTextElementHandle, TPoint& aPoint1, TPoint& aPoint2, TPoint& aPoint3, TPoint& aPoint4) |
3081 EXPORT_C void CSvgEngineInterfaceImpl::GetFourPointElementBoundingBox(CSvgTextElementImpl* aTextElementHandle, TPoint& aPoint1, TPoint& aPoint2, TPoint& aPoint3, TPoint& aPoint4) |
3101 { |
3082 { |
3102 TSvgFourPointRect fourPointRect; |
3083 TSvgFourPointRect fourPointRect; |
3103 |
3084 |
3104 //updates CTM from root |
3085 //updates CTM from root |
3105 aTextElementHandle->UpdateCTM(); |
|
3106 |
|
3107 if (aTextElementHandle) |
3086 if (aTextElementHandle) |
3108 { |
3087 { |
|
3088 aTextElementHandle->UpdateCTM(); |
3109 aTextElementHandle->GetFourPointBBox(fourPointRect); |
3089 aTextElementHandle->GetFourPointBBox(fourPointRect); |
3110 } |
3090 } |
3111 |
3091 |
3112 fourPointRect.GetPoints(aPoint1, aPoint2, aPoint3, aPoint4); |
3092 fourPointRect.GetPoints(aPoint1, aPoint2, aPoint3, aPoint4); |
3113 } |
3093 } |