javauis/m2g_qt/src/jni/M2GDocument.cpp
author hgs
Fri, 29 Oct 2010 11:49:32 +0300
changeset 87 1627c337e51e
parent 80 d6dafc5d983f
permissions -rw-r--r--
v2.2.21_1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     1
/*
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     3
* All rights reserved.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     8
*
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
     9
* Initial Contributors:
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    11
*
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    12
* Contributors:
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    13
*
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    14
* Description:  JNI methods
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    15
*
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    16
*/
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    17
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    18
// INCLUDE FILES
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    19
#include "com_nokia_microedition_m2g_M2GDocument.h"
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    20
#include "MM2GSVGProxy.h"
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    21
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    22
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    23
M2G_NS_START
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    24
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    25
// EXTERNAL DATA STRUCTURES
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    26
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    27
// EXTERNAL FUNCTION PROTOTYPES
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    28
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    29
// CONSTANTS
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    30
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    31
// MACROS
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    32
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    33
// LOCAL CONSTANTS AND MACROS
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    34
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    35
// MODULE DATA STRUCTURES
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    36
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    37
// LOCAL FUNCTION PROTOTYPES
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    38
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    39
// FORWARD DECLARATIONS
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    40
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    41
// CLASS DECLARATION
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    42
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    43
// ================================ FUNCTIONS ==================================
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    44
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    45
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    46
// Java_com_nokia_microedition_m2g_M2GDocument::_createDocument
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    47
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    48
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    49
 * Calls MM2GSVGProxy::CreateDocumentL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    50
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    51
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    52
 * @param aData Document data
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    53
 * @param aHandle Document handle to be returned
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    54
 * @throws Exception if not ok
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    55
*/
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    56
JNIEXPORT jint JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    57
Java_com_nokia_microedition_m2g_M2GDocument__1createDocument(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    58
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    59
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    60
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    61
    jstring aData)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    62
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    63
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _createDocument - begin");
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
    64
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    65
    TInt handle = M2G_INVALID_HANDLE;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    66
    TInt err    = KM2GNotOk;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    67
    JStringUtils data(*aJni, aData);
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
    68
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    69
    TPtrC16* bData = STATIC_CAST(TPtrC16*, &data);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    70
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    71
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    72
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
    73
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    74
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    75
        TRAP(err,aProxy->CreateDocumentL(*bData, handle););
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
    76
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    77
    M2G_DO_UNLOCK(aJni)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    78
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
    79
    handle = M2GGeneral::CheckErrorCodeAndHandle(aJni, err, handle, M2G_INVALID_HANDLE);
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    80
    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _createDocument: %d - end", handle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    81
    return handle;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    82
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    83
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    84
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    85
// Java_com_nokia_microedition_m2g_M2GDocument::_createElementNS
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    86
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    87
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    88
 * Calls MM2GSVGProxy::CreateElementNsL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    89
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    90
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    91
 * @param aType Element type id.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    92
 * @param aDocumentHandle Document handle.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    93
 * @param aHandle Element handle to be returned
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    94
 * @throws Exception if not ok
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    95
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    96
JNIEXPORT jint JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    97
Java_com_nokia_microedition_m2g_M2GDocument__1createElementNS(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    98
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
    99
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   100
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   101
    jshort aType,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   102
    jint aDocumentHandle)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   103
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   104
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _createElementNS - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   105
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   106
    // Execute native engine method
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   107
    TInt handle = M2G_INVALID_HANDLE;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   108
    TInt err = KM2GNotOk;
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   109
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   110
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   111
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   112
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   113
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   114
        TRAP(err,aProxy->CreateElementNsL(
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   115
                 aType,
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   116
                 aDocumentHandle,
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   117
                 handle););
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   118
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   119
    }
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   120
    M2G_DO_UNLOCK(aJni)
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   121
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   122
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   123
    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _createElementNS: %d - end", handle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   124
    return handle;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   125
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   126
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   127
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   128
// Java_com_nokia_microedition_m2g_M2GDocument::_deleteDocument
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   129
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   130
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   131
 * Calls MM2GSVGProxy::DeleteDocumentL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   132
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   133
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   134
 * @param aDocumentHandle Document handle
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   135
 * @throws Exception if not ok
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   136
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   137
JNIEXPORT void JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   138
Java_com_nokia_microedition_m2g_M2GDocument__1deleteDocument(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   139
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   140
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   141
    jint aSvgProxyHandle,
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   142
    jint aDocumentHandle)
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   143
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   144
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _deleteDocument - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   145
    TInt err = KM2GNotOk;
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   146
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   147
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   148
    // Extract the SVGProxy handle
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   149
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   150
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   151
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   152
        TRAP(err,aProxy->DeleteDocumentL(aDocumentHandle););
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   153
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   154
    M2G_DO_UNLOCK(aJni)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   155
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   156
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   157
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _deleteDocument - end");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   158
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   159
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   160
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   161
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   162
// Java_com_nokia_microedition_m2g_M2GDocument::_getElementById
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   163
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   164
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   165
 * Calls MM2GSVGProxy::GetElementByIdL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   166
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   167
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   168
 * @param aDocumentHandle Document pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   169
 * @param aId Element ID.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   170
 * @param aHandle Element handle to be returned.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   171
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   172
JNIEXPORT jint JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   173
Java_com_nokia_microedition_m2g_M2GDocument__1getElementById(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   174
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   175
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   176
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   177
    jint aDocumentHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   178
    jstring aId)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   179
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   180
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getElementById - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   181
    TInt handle = M2G_INVALID_HANDLE;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   182
    TInt err    = KM2GNotOk;
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   183
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   184
    JStringUtils id(*aJni, aId);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   185
    TPtrC16* lId = STATIC_CAST(TPtrC16*, &id);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   186
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   187
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   188
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   189
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   190
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   191
        TRAP(err,aProxy->GetElementByIdL(aDocumentHandle, *lId, handle););
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   192
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   193
    M2G_DO_UNLOCK(aJni)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   194
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   195
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   196
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   197
    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _getElementById: %d - end", handle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   198
    return handle;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   199
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   200
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   201
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   202
// Java_com_nokia_microedition_m2g_M2GDocument::_getViewportHeight
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   203
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   204
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   205
 * Calls MM2GSVGProxy::GetViewportHeightL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   206
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   207
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   208
 * @param aDocumentHandle Document pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   209
 * @param aHeight Height to be returned.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   210
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   211
JNIEXPORT jint JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   212
Java_com_nokia_microedition_m2g_M2GDocument__1getViewportHeight(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   213
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   214
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   215
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   216
    jint aDocumentHandle)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   217
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   218
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getViewportHeight - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   219
    TInt err    = KM2GNotOk;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   220
    TInt height = 0;
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   221
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   222
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   223
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   224
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   225
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   226
        TRAP(err,aProxy->GetViewportHeightL(aDocumentHandle, height););
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   227
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   228
    M2G_DO_UNLOCK(aJni)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   229
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   230
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   231
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   232
    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _getViewportHeight: %d - end", height);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   233
    return height;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   234
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   235
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   236
// Java_com_nokia_microedition_m2g_M2GDocument::_getViewportWidth
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   237
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   238
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   239
 * Calls MM2GSVGProxy::GetViewportWidthL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   240
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   241
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   242
 * @param aDocumentHandle Document pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   243
 * @param aWidth Width to be returned.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   244
 * Class: com_nokia_microedition_m2g_M2GDocument
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   245
 * Method: _getViewportWidth
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   246
 * Signature:
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   247
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   248
JNIEXPORT jint JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   249
Java_com_nokia_microedition_m2g_M2GDocument__1getViewportWidth(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   250
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   251
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   252
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   253
    jint aDocumentHandle)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   254
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   255
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getViewportWidth - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   256
    TInt   err = KM2GNotOk;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   257
    TInt width = 0;
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   258
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   259
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   260
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   261
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   262
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   263
        TRAP(err,aProxy->GetViewportWidthL(aDocumentHandle, width););
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   264
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   265
    M2G_DO_UNLOCK(aJni)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   266
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   267
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   268
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   269
    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _getViewportWidth: %d - end", width);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   270
    return width;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   271
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   272
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   273
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   274
// Java_com_nokia_microedition_m2g_M2GDocument::_isElementInDom
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   275
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   276
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   277
 * Calls MM2GSVGProxy::IsElementInDomL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   278
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   279
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   280
 * @param aDocumentHandle Document pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   281
 * @param aElementHandle Element pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   282
 * @param aIsElementInDom Result
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   283
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   284
JNIEXPORT jint JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   285
Java_com_nokia_microedition_m2g_M2GDocument__1isElementInDOM(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   286
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   287
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   288
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   289
    jint aDocumentHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   290
    jint aElementHandle)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   291
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   292
    M2G_DEBUG_0("M2G_DEBUG: JNI _isElementInDOM - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   293
    TInt isElementInDom = -1;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   294
    TInt            err = KM2GNotOk;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   295
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   296
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   297
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   298
    {
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   299
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   300
        TRAP(err,aProxy->IsElementInDomL(
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   301
                 aDocumentHandle, aElementHandle, isElementInDom););
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   302
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   303
    M2G_DO_UNLOCK(aJni)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   304
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   305
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   306
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   307
    M2G_DEBUG_1("M2G_DEBUG: JNI _isElementInDOM: %d - end", isElementInDom);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   308
    return isElementInDom;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   309
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   310
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   311
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   312
// Java_com_nokia_microedition_m2g_M2GDocument::_requestCompleted
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   313
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   314
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   315
 * Calls MM2GSVGProxy::RequestCompletedL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   316
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   317
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   318
 * @param aDocumentHandle Document pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   319
 * @param aURI Resource uri
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   320
 * @param aResourceData Resource data
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   321
 * @param aCompleted Result
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   322
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   323
JNIEXPORT jint JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   324
Java_com_nokia_microedition_m2g_M2GDocument__1requestCompleted(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   325
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   326
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   327
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   328
    jint aDocumentHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   329
    jstring aURI,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   330
    jbyteArray aResourceData)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   331
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   332
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _requestCompleted - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   333
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   334
    //RJString uri(*aJni, aURI);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   335
    JStringUtils uri(*aJni, aURI);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   336
    TInt err = KM2GNotOk;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   337
    TPtrC8 lResData8;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   338
    jbyte* resBytes = NULL;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   339
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   340
    if (aResourceData)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   341
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   342
        resBytes  = aJni->GetByteArrayElements(aResourceData, NULL);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   343
        lResData8.Set(REINTERPRET_CAST(TUint8*, resBytes), aJni->GetArrayLength(aResourceData));
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   344
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   345
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   346
    TInt completed = -1;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   347
    TPtrC16* pUri = STATIC_CAST(TPtrC16*, &uri);
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   348
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   349
    M2G_DO_LOCK
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   350
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   351
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   352
    {
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   353
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   354
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   355
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   356
        TRAP(err,    aProxy->RequestCompletedL(
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   357
                 aDocumentHandle,
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   358
                 *pUri,
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   359
                 lResData8,
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   360
                 completed););
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   361
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   362
    M2G_DO_UNLOCK(aJni)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   363
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   364
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   365
    if (aResourceData)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   366
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   367
        aJni->ReleaseByteArrayElements(aResourceData, resBytes, JNI_ABORT);   // don't copy back
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   368
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   369
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   370
    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _requestCompleted: %d - end", completed);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   371
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   372
    return completed;
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   373
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   374
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   375
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   376
// Java_com_nokia_microedition_m2g_M2GDocument::_setViewportHeight
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   377
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   378
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   379
 * Calls MM2GSVGProxy::SetViewportHeightL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   380
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   381
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   382
 * @param aDocumentHandle Document pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   383
 * @param aHeight Height
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   384
 * JNI method
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   385
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   386
JNIEXPORT void JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   387
Java_com_nokia_microedition_m2g_M2GDocument__1setViewportHeight(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   388
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   389
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   390
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   391
    jint aDocumentHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   392
    jint aHeight)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   393
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   394
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportHeight - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   395
    TInt err = KM2GNotOk;
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   396
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   397
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   398
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   399
    {
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   400
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   401
        TRAP(err,aProxy->SetViewportHeightL(
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   402
                 (TM2GSvgDocumentHandle)aDocumentHandle, aHeight););
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   403
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   404
    M2G_DO_UNLOCK(aJni)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   405
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   406
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   407
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   408
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportHeight - end");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   409
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   410
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   411
// Java_com_nokia_microedition_m2g_M2GDocument::_setViewportWidth
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   412
// -----------------------------------------------------------------------------
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   413
/**
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   414
 * Calls MM2GSVGProxy::SetViewportWidthL method.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   415
 * @since Series S60 3.0
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   416
 * @param aProxy Proxy instance.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   417
 * @param aDocumentHandle Document pointer.
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   418
 * @param aWidth Width
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   419
 * JNI method
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   420
 */
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   421
JNIEXPORT void JNICALL
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   422
Java_com_nokia_microedition_m2g_M2GDocument__1setViewportWidth(
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   423
    JNIEnv* aJni,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   424
    jclass,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   425
    jint aSvgProxyHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   426
    jint aDocumentHandle,
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   427
    jint aWidth)
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   428
{
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   429
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportWidth - begin");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   430
    TInt err = KM2GNotOk;
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   431
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   432
    M2G_DO_LOCK
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   433
    if (aSvgProxyHandle)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   434
    {
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   435
        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   436
        TRAP(err,    aProxy->SetViewportWidthL(
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   437
                 (TM2GSvgDocumentHandle)aDocumentHandle, aWidth););
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   438
    }
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   439
    M2G_DO_UNLOCK(aJni)
87
1627c337e51e v2.2.21_1
hgs
parents: 80
diff changeset
   440
80
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   441
    M2GGeneral::CheckErrorCode(aJni, err);
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   442
    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportWidth - end");
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   443
}
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   444
d6dafc5d983f v2.2.19_1
hgs
parents:
diff changeset
   445
M2G_NS_END