1 /* |
1 /* |
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
277 { |
277 { |
278 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL() native:%d, document:%d - begin", iNative, aDocumentHandle); |
278 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL() native:%d, document:%d - begin", iNative, aDocumentHandle); |
279 TInt findResult = iSvgDocuments.Find(aDocumentHandle); |
279 TInt findResult = iSvgDocuments.Find(aDocumentHandle); |
280 if (findResult != KErrNotFound) |
280 if (findResult != KErrNotFound) |
281 { |
281 { |
282 // Try to remove the handle from the container |
282 // Remove the handle from the container |
283 TRAPD(err, iSvgDocuments.Remove(findResult)); |
283 TRAPD(err, iSvgDocuments.Remove(findResult)); |
284 if (err != KM2GOk) |
284 if (err != KM2GOk) |
285 { |
285 { |
286 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL(), cannot add handle=%d, err=%d", aDocumentHandle, err); |
286 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL(), cannot add handle=%d, err=%d", aDocumentHandle, err); |
287 } |
287 } |
299 { |
299 { |
300 M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL() engine:%d - begin", aEngineHandle); |
300 M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL() engine:%d - begin", aEngineHandle); |
301 TInt findResult = iSvgEngines.Find(aEngineHandle); |
301 TInt findResult = iSvgEngines.Find(aEngineHandle); |
302 if (findResult != KErrNotFound) |
302 if (findResult != KErrNotFound) |
303 { |
303 { |
304 // Try to remove the handle from the container |
304 // Remove the handle from the container |
305 TRAPD(err, iSvgEngines.Remove(findResult)); |
305 TRAPD(err, iSvgEngines.Remove(findResult)); |
306 if (err != KM2GOk) |
306 if (err != KM2GOk) |
307 { |
307 { |
308 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL(), cannot add handle=%d, err=%d", aEngineHandle, err); |
308 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL(), cannot add handle=%d, err=%d", aEngineHandle, err); |
309 } |
309 } |
835 iNative->SvgEngineRenderDocument( |
835 iNative->SvgEngineRenderDocument( |
836 aEngineHandle, aDocumentHandle, aSurfaceHandle, aSurfaceMaskHandle, aCurrentTime); |
836 aEngineHandle, aDocumentHandle, aSurfaceHandle, aSurfaceMaskHandle, aCurrentTime); |
837 M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() - end"); |
837 M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() - end"); |
838 } |
838 } |
839 |
839 |
840 //TODO following changes done for Qimage |
|
841 //Check for TUint or TInt for subsequent API Call |
|
842 void CM2GSVGProxy::RenderDocumentL( |
840 void CM2GSVGProxy::RenderDocumentL( |
843 const TM2GSvgEngineHandle& aEngineHandle, |
841 const TM2GSvgEngineHandle& aEngineHandle, |
844 const TM2GSvgDocumentHandle& aDocumentHandle, |
842 const TM2GSvgDocumentHandle& aDocumentHandle, |
845 const TM2GSvgBitmapHandle& aSurfaceHandle, |
843 const TM2GSvgBitmapHandle& aSurfaceHandle, |
846 TM2GSvgBitmapHandle aSurfaceMaskHandle, |
844 TM2GSvgBitmapHandle aSurfaceMaskHandle, |
847 TReal32 aCurrentTime) |
845 TReal32 aCurrentTime) |
848 { |
846 { |
849 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() Qimage variant native:%d, time=%f - begin", iNative, aCurrentTime); |
847 M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() Qimage variant native:%d, time=%f - begin", iNative, aCurrentTime); |
850 M2G_DEBUG_3("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() engine:%d, doc:%d, SvgBitmapHandle:%d", aEngineHandle, aDocumentHandle, aSurfaceHandle); |
848 M2G_DEBUG_3("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() engine:%d, doc:%d, SvgBitmapHandle:%d", aEngineHandle, aDocumentHandle, aSurfaceHandle); |
851 iNative->SvgEngineRenderDocument( |
849 iNative->SvgEngineRenderDocument( |
852 aEngineHandle, aDocumentHandle, aSurfaceHandle, aSurfaceMaskHandle, aCurrentTime); |
850 aEngineHandle, aDocumentHandle, aSurfaceHandle, aSurfaceMaskHandle, aCurrentTime); |
853 M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() - end"); |
851 M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() - end"); |
854 |
852 |
855 } |
853 } |
856 |
854 |
857 // ----------------------------------------------------------------------------- |
855 // ----------------------------------------------------------------------------- |
858 // CM2GSVGProxy::RenderQualityL |
856 // CM2GSVGProxy::RenderQualityL |
859 // ----------------------------------------------------------------------------- |
857 // ----------------------------------------------------------------------------- |
860 void CM2GSVGProxy::RenderQualityL( |
858 void CM2GSVGProxy::RenderQualityL( |
1096 void CM2GSVGProxy::ConstructL() |
1094 void CM2GSVGProxy::ConstructL() |
1097 { |
1095 { |
1098 M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::ConstructL() - begin"); |
1096 M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::ConstructL() - begin"); |
1099 |
1097 |
1100 //Get the font spec with variant default font |
1098 //Get the font spec with variant default font |
1101 const TInt KApacFontId = EApacPlain16; |
1099 |
1102 const TInt KLatintFontId = ELatinBold12; |
|
1103 TInt fontId = KLatintFontId; |
|
1104 |
|
1105 /* switch (AknLayoutUtils::Variant()) |
|
1106 { |
|
1107 case EApacVariant: |
|
1108 { |
|
1109 fontId = KApacFontId; |
|
1110 } |
|
1111 break; |
|
1112 |
|
1113 case EEuropeanVariant: |
|
1114 default: |
|
1115 break; |
|
1116 } |
|
1117 FeatureManager::InitializeLibL(); |
|
1118 |
|
1119 if (FeatureManager::FeatureSupported(KFeatureIdAvkonApac)) |
|
1120 { |
|
1121 fontId = KApacFontId; |
|
1122 } |
|
1123 |
|
1124 FeatureManager::UnInitializeLib(); |
|
1125 |
|
1126 const CFont* font = AknLayoutUtils::FontFromId(fontId); |
|
1127 TFontSpec spec = font->FontSpecInTwips();*/ |
|
1128 // TODO have to check for substitute of above. |
|
1129 const CFont* font = CEikonEnv::Static()->NormalFont(); |
1100 const CFont* font = CEikonEnv::Static()->NormalFont(); |
1130 TFontSpec spec = font->FontSpecInTwips(); |
1101 TFontSpec spec = font->FontSpecInTwips(); |
1131 iNative = CSvgJavaInterfaceImpl::NewL(spec); |
1102 iNative = CSvgJavaInterfaceImpl::NewL(spec); |
1132 M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::ConstructL() - SVGTopt created: %d", iNative); |
1103 M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::ConstructL() - SVGTopt created: %d", iNative); |
1133 } |
1104 } |