diff -r d6dafc5d983f -r 1627c337e51e javauis/m2g_qt/src/jni/M2GDocument.cpp --- a/javauis/m2g_qt/src/jni/M2GDocument.cpp Fri Oct 15 12:29:39 2010 +0300 +++ b/javauis/m2g_qt/src/jni/M2GDocument.cpp Fri Oct 29 11:49:32 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -61,22 +61,22 @@ jstring aData) { M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _createDocument - begin"); - + TInt handle = M2G_INVALID_HANDLE; TInt err = KM2GNotOk; JStringUtils data(*aJni, aData); - //RJString data(*aJni, aData); + TPtrC16* bData = STATIC_CAST(TPtrC16*, &data); M2G_DO_LOCK if (aSvgProxyHandle) - { + { MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); TRAP(err,aProxy->CreateDocumentL(*bData, handle);); - } + } M2G_DO_UNLOCK(aJni) - handle = M2GGeneral::CheckErrorCodeAndHandle(aJni, err, handle, M2G_INVALID_HANDLE); + handle = M2GGeneral::CheckErrorCodeAndHandle(aJni, err, handle, M2G_INVALID_HANDLE); M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _createDocument: %d - end", handle); return handle; } @@ -106,19 +106,19 @@ // Execute native engine method TInt handle = M2G_INVALID_HANDLE; TInt err = KM2GNotOk; - + M2G_DO_LOCK if (aSvgProxyHandle) - { + { MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); TRAP(err,aProxy->CreateElementNsL( - aType, - aDocumentHandle, - handle); ); - - } - M2G_DO_UNLOCK(aJni) - + aType, + aDocumentHandle, + handle);); + + } + M2G_DO_UNLOCK(aJni) + M2GGeneral::CheckErrorCode(aJni, err); M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _createElementNS: %d - end", handle); return handle; @@ -139,18 +139,18 @@ JNIEnv* aJni, jclass, jint aSvgProxyHandle, - jint aDocumentHandle ) + jint aDocumentHandle) { M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _deleteDocument - begin"); TInt err = KM2GNotOk; - + M2G_DO_LOCK // Extract the SVGProxy handle if (aSvgProxyHandle) - { + { MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); TRAP(err,aProxy->DeleteDocumentL(aDocumentHandle);); - } + } M2G_DO_UNLOCK(aJni) M2GGeneral::CheckErrorCode(aJni, err); @@ -180,16 +180,16 @@ M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getElementById - begin"); TInt handle = M2G_INVALID_HANDLE; TInt err = KM2GNotOk; - //RJString id(*aJni, aId); + JStringUtils id(*aJni, aId); TPtrC16* lId = STATIC_CAST(TPtrC16*, &id); M2G_DO_LOCK if (aSvgProxyHandle) - { + { MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); TRAP(err,aProxy->GetElementByIdL(aDocumentHandle, *lId, handle);); - } + } M2G_DO_UNLOCK(aJni) M2GGeneral::CheckErrorCode(aJni, err); @@ -218,13 +218,13 @@ M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getViewportHeight - begin"); TInt err = KM2GNotOk; TInt height = 0; - + M2G_DO_LOCK if (aSvgProxyHandle) - { + { MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); TRAP(err,aProxy->GetViewportHeightL(aDocumentHandle, height);); - } + } M2G_DO_UNLOCK(aJni) M2GGeneral::CheckErrorCode(aJni, err); @@ -255,13 +255,13 @@ M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getViewportWidth - begin"); TInt err = KM2GNotOk; TInt width = 0; - + M2G_DO_LOCK if (aSvgProxyHandle) - { + { MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); TRAP(err,aProxy->GetViewportWidthL(aDocumentHandle, width);); - } + } M2G_DO_UNLOCK(aJni) M2GGeneral::CheckErrorCode(aJni, err); @@ -295,11 +295,11 @@ M2G_DO_LOCK if (aSvgProxyHandle) - { - MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); - TRAP(err,aProxy->IsElementInDomL( - aDocumentHandle, aElementHandle, isElementInDom);); - } + { + MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); + TRAP(err,aProxy->IsElementInDomL( + aDocumentHandle, aElementHandle, isElementInDom);); + } M2G_DO_UNLOCK(aJni) M2GGeneral::CheckErrorCode(aJni, err); @@ -338,34 +338,34 @@ jbyte* resBytes = NULL; if (aResourceData) - { + { resBytes = aJni->GetByteArrayElements(aResourceData, NULL); lResData8.Set(REINTERPRET_CAST(TUint8*, resBytes), aJni->GetArrayLength(aResourceData)); - } + } TInt completed = -1; TPtrC16* pUri = STATIC_CAST(TPtrC16*, &uri); - + M2G_DO_LOCK - + if (aSvgProxyHandle) - { - + { + MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); - + TRAP(err, aProxy->RequestCompletedL( - aDocumentHandle, - *pUri, - lResData8, - completed);); - } + aDocumentHandle, + *pUri, + lResData8, + completed);); + } M2G_DO_UNLOCK(aJni) M2GGeneral::CheckErrorCode(aJni, err); if (aResourceData) - { + { aJni->ReleaseByteArrayElements(aResourceData, resBytes, JNI_ABORT); // don't copy back - } + } M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _requestCompleted: %d - end", completed); @@ -393,16 +393,16 @@ { M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportHeight - begin"); TInt err = KM2GNotOk; - + M2G_DO_LOCK if (aSvgProxyHandle) - { + { MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); TRAP(err,aProxy->SetViewportHeightL( - (TM2GSvgDocumentHandle)aDocumentHandle, aHeight);); - } + (TM2GSvgDocumentHandle)aDocumentHandle, aHeight);); + } M2G_DO_UNLOCK(aJni) - + M2GGeneral::CheckErrorCode(aJni, err); M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportHeight - end"); @@ -428,16 +428,16 @@ { M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportWidth - begin"); TInt err = KM2GNotOk; - + M2G_DO_LOCK if (aSvgProxyHandle) - { - MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); - TRAP(err, aProxy->SetViewportWidthL( - (TM2GSvgDocumentHandle)aDocumentHandle, aWidth);); - } + { + MM2GSVGProxy* aProxy = JavaUnhand(aSvgProxyHandle); + TRAP(err, aProxy->SetViewportWidthL( + (TM2GSvgDocumentHandle)aDocumentHandle, aWidth);); + } M2G_DO_UNLOCK(aJni) - + M2GGeneral::CheckErrorCode(aJni, err); M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportWidth - end"); }