80
|
1 |
/*
|
87
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
80
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: JNI methods
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
#include "com_nokia_microedition_m2g_M2GManager.h"
|
|
20 |
#include "CM2GSVGProxy.h"
|
|
21 |
|
|
22 |
M2G_NS_START
|
|
23 |
|
|
24 |
// EXTERNAL DATA STRUCTURES
|
|
25 |
|
|
26 |
// EXTERNAL FUNCTION PROTOTYPES
|
|
27 |
|
|
28 |
// CONSTANTS
|
|
29 |
|
|
30 |
// MACROS
|
|
31 |
|
|
32 |
// LOCAL CONSTANTS AND MACROS
|
|
33 |
|
|
34 |
// MODULE DATA STRUCTURES
|
|
35 |
|
|
36 |
// LOCAL FUNCTION PROTOTYPES
|
|
37 |
|
|
38 |
// FORWARD DECLARATIONS
|
|
39 |
|
|
40 |
// CLASS DECLARATION
|
|
41 |
|
|
42 |
// ================================ FUNCTIONS ==================================
|
|
43 |
|
|
44 |
// -----------------------------------------------------------------------------
|
|
45 |
// Java_com_nokia_microedition_m2g_M2GManager::_createSvgEngine
|
|
46 |
// -----------------------------------------------------------------------------
|
|
47 |
/**
|
|
48 |
* Calls MM2GSVGProxy::CreateSvgEngineL method.
|
|
49 |
* @since Series S60 3.0
|
|
50 |
* @param aProxy Proxy instance.
|
|
51 |
* @param aHandle Svg engine handle
|
|
52 |
*/
|
|
53 |
/**
|
|
54 |
* JNI method
|
|
55 |
*/
|
|
56 |
JNIEXPORT jint JNICALL
|
|
57 |
Java_com_nokia_microedition_m2g_M2GManager__1createSvgEngine(
|
|
58 |
JNIEnv* aJni,
|
|
59 |
jclass,
|
|
60 |
jint aSvgProxyHandle)
|
|
61 |
{
|
|
62 |
M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _createSvgEngine - begin");
|
87
|
63 |
|
80
|
64 |
TInt handle = M2G_INVALID_HANDLE;
|
|
65 |
TInt err = KM2GNotOk;
|
87
|
66 |
|
80
|
67 |
M2G_DO_LOCK
|
|
68 |
if (aSvgProxyHandle)
|
87
|
69 |
{
|
80
|
70 |
TRAP(err,JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle)->CreateSvgEngineL(handle););
|
87
|
71 |
}
|
80
|
72 |
M2G_DO_UNLOCK(aJni)
|
|
73 |
|
|
74 |
handle = M2GGeneral::CheckErrorCodeAndHandle(
|
87
|
75 |
aJni, err, handle, M2G_INVALID_HANDLE);
|
|
76 |
|
80
|
77 |
M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GManager ) _createSvgEngine: %d - end", handle);
|
|
78 |
return handle;
|
|
79 |
}
|
|
80 |
// -----------------------------------------------------------------------------
|
|
81 |
// Java_com_nokia_microedition_m2g_M2GManager::_createSvgProxy
|
|
82 |
// -----------------------------------------------------------------------------
|
|
83 |
/**
|
|
84 |
* Creates an svg proxy.
|
|
85 |
* @since Series S60 3.0
|
|
86 |
* @param Svg proxy handle
|
87
|
87 |
*
|
80
|
88 |
* JNI method
|
|
89 |
*/
|
|
90 |
JNIEXPORT jint JNICALL
|
|
91 |
Java_com_nokia_microedition_m2g_M2GManager__1createSvgProxy(
|
|
92 |
JNIEnv* aJni,jclass)
|
|
93 |
{
|
|
94 |
M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _createSvgProxy - begin");
|
|
95 |
TInt handle = M2G_INVALID_HANDLE;
|
|
96 |
TInt err = KM2GNotOk;
|
|
97 |
|
|
98 |
M2G_DO_LOCK
|
|
99 |
TRAP(err, MM2GSVGProxy* proxy = CM2GSVGProxy::NewL(); handle = JavaMakeHandle(proxy););
|
|
100 |
M2G_DO_UNLOCK(aJni)
|
|
101 |
|
|
102 |
handle = M2GGeneral::CheckErrorCodeAndHandle(aJni, err, handle, err);
|
|
103 |
M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GManager ) _createSvgProxy: %d - end", handle);
|
|
104 |
return handle;
|
|
105 |
}
|
|
106 |
|
|
107 |
// -----------------------------------------------------------------------------
|
|
108 |
// Java_com_nokia_microedition_m2g_M2GManager::_deleteSvgEngine
|
|
109 |
// -----------------------------------------------------------------------------
|
|
110 |
/**
|
|
111 |
* Calls MM2GSVGProxy::DeleteSvgEnginedL method.
|
|
112 |
* @since Series S60 3.0
|
|
113 |
* @param aProxy Proxy instance.
|
87
|
114 |
*
|
80
|
115 |
* JNI method
|
|
116 |
*/
|
|
117 |
JNIEXPORT void JNICALL
|
|
118 |
Java_com_nokia_microedition_m2g_M2GManager__1deleteSvgEngine(
|
|
119 |
JNIEnv* aJni,
|
|
120 |
jclass,
|
|
121 |
jint aSvgProxyHandle,
|
87
|
122 |
jint aSvgEngineHandle)
|
80
|
123 |
{
|
|
124 |
M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgEngine - begin");
|
87
|
125 |
|
80
|
126 |
TInt err = KM2GNotOk;
|
87
|
127 |
|
80
|
128 |
M2G_DO_LOCK
|
|
129 |
if (aSvgProxyHandle)
|
87
|
130 |
{
|
|
131 |
TRAP(err,JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle)->DeleteSvgEngineL(
|
|
132 |
STATIC_CAST(TM2GSvgEngineHandle, aSvgEngineHandle)););
|
|
133 |
}
|
80
|
134 |
M2G_DO_UNLOCK(aJni)
|
87
|
135 |
|
80
|
136 |
M2GGeneral::CheckErrorCode(aJni, err);
|
87
|
137 |
|
80
|
138 |
M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgEngine: - end");
|
|
139 |
}
|
|
140 |
|
|
141 |
// -----------------------------------------------------------------------------
|
|
142 |
// Java_com_nokia_microedition_m2g_M2GManager::_deleteSvgProxy
|
|
143 |
// -----------------------------------------------------------------------------
|
|
144 |
/**
|
|
145 |
* Deletes a proxy object. NOTE: The proxy object has to be deleted inside same
|
|
146 |
* thread as it was created, otherwice there will be problem to delete a CFbsBitmap
|
|
147 |
* server object inside the SVGTopt componenet see KATA-6KYA9T (SVGEngineJI: SVGTopt
|
|
148 |
* crashes when deleting svg document object that contains external resource)
|
|
149 |
* @since Series S60 3.0
|
|
150 |
* @param aProxy Proxy instance.
|
87
|
151 |
*
|
80
|
152 |
* JNI method
|
|
153 |
*/
|
|
154 |
JNIEXPORT void JNICALL
|
|
155 |
Java_com_nokia_microedition_m2g_M2GManager__1deleteSvgProxy(
|
|
156 |
JNIEnv* aJni,
|
|
157 |
jclass,
|
|
158 |
jint aSvgProxyHandle)
|
|
159 |
{
|
|
160 |
M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgProxy - begin");
|
|
161 |
TInt err = KM2GNotOk;
|
87
|
162 |
|
80
|
163 |
M2G_DO_LOCK
|
|
164 |
if (aSvgProxyHandle)
|
87
|
165 |
{
|
80
|
166 |
MM2GSVGProxy* proxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
|
|
167 |
TRAP(err,delete proxy;);
|
87
|
168 |
}
|
80
|
169 |
M2G_DO_UNLOCK(aJni)
|
|
170 |
|
|
171 |
M2GGeneral::CheckErrorCode(aJni, err);
|
|
172 |
M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgProxy: - end");
|
|
173 |
}
|
|
174 |
|
|
175 |
M2G_NS_END
|