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". |
62 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _appendChild - begin"); |
62 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _appendChild - begin"); |
63 TInt err = KM2GNotOk; |
63 TInt err = KM2GNotOk; |
64 |
64 |
65 M2G_DO_LOCK |
65 M2G_DO_LOCK |
66 if (aSvgProxyHandle) |
66 if (aSvgProxyHandle) |
67 { |
67 { |
68 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
68 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
69 TRAP(err, aProxy->AppendChildL( |
69 TRAP(err, aProxy->AppendChildL( |
70 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
70 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
71 STATIC_CAST(TM2GSvgElementHandle, aChildElementHandle)); ); |
71 STATIC_CAST(TM2GSvgElementHandle, aChildElementHandle));); |
72 } |
72 } |
73 M2G_DO_UNLOCK(aJni) |
73 M2G_DO_UNLOCK(aJni) |
74 |
74 |
75 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _appendChild - end"); |
75 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _appendChild - end"); |
76 M2GGeneral::CheckErrorCode(aJni, err); |
76 M2GGeneral::CheckErrorCode(aJni, err); |
77 } |
77 } |
78 |
78 |
79 |
79 |
94 jint aElementHandle) |
94 jint aElementHandle) |
95 { |
95 { |
96 TInt removeable = -1; |
96 TInt removeable = -1; |
97 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _checkRemoveable - begin"); |
97 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _checkRemoveable - begin"); |
98 TInt err = KM2GNotOk; |
98 TInt err = KM2GNotOk; |
99 |
99 |
100 |
100 |
101 M2G_DO_LOCK |
101 M2G_DO_LOCK |
102 if (aSvgProxyHandle) |
102 if (aSvgProxyHandle) |
103 { |
103 { |
104 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
104 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
105 |
105 |
106 TRAP(err, aProxy->CheckRemoveableL(aElementHandle, removeable);); |
106 TRAP(err, aProxy->CheckRemoveableL(aElementHandle, removeable);); |
107 } |
107 } |
108 M2G_DO_UNLOCK(aJni) |
108 M2G_DO_UNLOCK(aJni) |
109 |
109 |
110 M2GGeneral::CheckErrorCode(aJni, err); |
110 M2GGeneral::CheckErrorCode(aJni, err); |
111 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _checkRemoveable: %d - end", removeable); |
111 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _checkRemoveable: %d - end", removeable); |
112 return removeable; |
112 return removeable; |
136 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getBBox - begin"); |
136 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getBBox - begin"); |
137 |
137 |
138 TM2GRectData rect; |
138 TM2GRectData rect; |
139 TInt result = 0; |
139 TInt result = 0; |
140 TInt err = KM2GNotOk; |
140 TInt err = KM2GNotOk; |
141 |
141 |
142 M2G_DO_LOCK |
142 M2G_DO_LOCK |
143 if (aSvgProxyHandle) |
143 if (aSvgProxyHandle) |
144 { |
144 { |
145 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
145 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
146 |
146 |
147 TRAP(err, aProxy->GetBBoxL( |
147 TRAP(err, aProxy->GetBBoxL( |
148 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
148 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
149 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
149 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
150 rect, result); ); |
150 rect, result);); |
151 } |
151 } |
152 M2G_DO_UNLOCK(aJni) |
152 M2G_DO_UNLOCK(aJni) |
153 |
153 |
154 M2GGeneral::CheckErrorCode(aJni, err); |
154 M2GGeneral::CheckErrorCode(aJni, err); |
155 |
155 |
156 aJni->SetFloatArrayRegion( |
156 aJni->SetFloatArrayRegion( |
157 REINTERPRET_CAST(jfloatArray, aRectComponents), |
157 REINTERPRET_CAST(jfloatArray, aRectComponents), |
158 0, |
158 0, |
185 { |
185 { |
186 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getColorTrait - begin"); |
186 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getColorTrait - begin"); |
187 TM2GColorData color; |
187 TM2GColorData color; |
188 TInt result = -1; |
188 TInt result = -1; |
189 TInt err = KM2GNotOk; |
189 TInt err = KM2GNotOk; |
190 |
190 |
191 M2G_DO_LOCK |
191 M2G_DO_LOCK |
192 if (aSvgProxyHandle) |
192 if (aSvgProxyHandle) |
193 { |
193 { |
194 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
194 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
195 TRAP(err, aProxy->GetColorTraitL( |
195 TRAP(err, aProxy->GetColorTraitL( |
196 aElementHandle, |
196 aElementHandle, |
197 aAttributeTypeId, |
197 aAttributeTypeId, |
198 color, |
198 color, |
199 result); ); |
199 result);); |
200 } |
200 } |
201 M2G_DO_UNLOCK(aJni) |
201 M2G_DO_UNLOCK(aJni) |
202 |
202 |
203 M2GGeneral::CheckErrorCode(aJni, err); |
203 M2GGeneral::CheckErrorCode(aJni, err); |
204 if (color[ 0 ] == -1 && color[ 1 ] == -1 && color[ 2 ] == -1) |
204 if (color[ 0 ] == -1 && color[ 1 ] == -1 && color[ 2 ] == -1) |
205 { |
205 { |
235 jint aElementHandle) |
235 jint aElementHandle) |
236 { |
236 { |
237 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getElementTypeId - begin"); |
237 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getElementTypeId - begin"); |
238 TInt16 id = 0; |
238 TInt16 id = 0; |
239 TInt err = KM2GNotOk; |
239 TInt err = KM2GNotOk; |
240 |
240 |
241 M2G_DO_LOCK |
241 M2G_DO_LOCK |
242 if (aSvgProxyHandle) |
242 if (aSvgProxyHandle) |
243 { |
243 { |
244 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
244 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
245 TRAP(err, aProxy->GetElementTypeIdL(aElementHandle, id); ); |
245 TRAP(err, aProxy->GetElementTypeIdL(aElementHandle, id);); |
246 } |
246 } |
247 M2G_DO_UNLOCK(aJni) |
247 M2G_DO_UNLOCK(aJni) |
248 |
248 |
249 M2GGeneral::CheckErrorCode(aJni, err); |
249 M2GGeneral::CheckErrorCode(aJni, err); |
250 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getElementTypeId: %d - end", id); |
250 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getElementTypeId: %d - end", id); |
251 return id; |
251 return id; |
252 } |
252 } |
253 |
253 |
271 jshort aAttributeTypeId) |
271 jshort aAttributeTypeId) |
272 { |
272 { |
273 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getEnumTrait - begin"); |
273 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getEnumTrait - begin"); |
274 TInt16 enumTrait = 0; |
274 TInt16 enumTrait = 0; |
275 TInt err = KM2GNotOk; |
275 TInt err = KM2GNotOk; |
276 |
276 |
277 M2G_DO_LOCK |
277 M2G_DO_LOCK |
278 if (aSvgProxyHandle) |
278 if (aSvgProxyHandle) |
279 { |
279 { |
280 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
280 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
281 |
281 |
282 TRAP(err, aProxy->GetEnumTraitL( |
282 TRAP(err, aProxy->GetEnumTraitL( |
283 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
283 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
284 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
284 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
285 enumTrait); ); |
285 enumTrait);); |
286 } |
286 } |
287 M2G_DO_UNLOCK(aJni) |
287 M2G_DO_UNLOCK(aJni) |
288 |
288 |
289 M2GGeneral::CheckErrorCode(aJni, err); |
289 M2GGeneral::CheckErrorCode(aJni, err); |
290 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getEnumTrait: %d - end", enumTrait); |
290 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getEnumTrait: %d - end", enumTrait); |
291 return enumTrait; |
291 return enumTrait; |
292 } |
292 } |
293 // ----------------------------------------------------------------------------- |
293 // ----------------------------------------------------------------------------- |
312 TInt childHandle = M2G_INVALID_HANDLE; |
312 TInt childHandle = M2G_INVALID_HANDLE; |
313 TInt err = KM2GNotOk; |
313 TInt err = KM2GNotOk; |
314 |
314 |
315 M2G_DO_LOCK |
315 M2G_DO_LOCK |
316 if (aSvgProxyHandle) |
316 if (aSvgProxyHandle) |
317 { |
317 { |
318 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
318 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
319 TRAP(err, aProxy->GetFirstElementChildL(aElementHandle, childHandle); ); |
319 TRAP(err, aProxy->GetFirstElementChildL(aElementHandle, childHandle);); |
320 } |
320 } |
321 M2G_DO_UNLOCK(aJni) |
321 M2G_DO_UNLOCK(aJni) |
322 |
322 |
323 M2GGeneral::CheckErrorCode(aJni, err); |
323 M2GGeneral::CheckErrorCode(aJni, err); |
324 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getFirstElementChild: %d - end", childHandle); |
324 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getFirstElementChild: %d - end", childHandle); |
325 return childHandle; |
325 return childHandle; |
344 jshort aAttributeTypeId) |
344 jshort aAttributeTypeId) |
345 { |
345 { |
346 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getFloatTrait - begin"); |
346 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getFloatTrait - begin"); |
347 TInt err = KM2GNotOk; |
347 TInt err = KM2GNotOk; |
348 TReal32 floatTrait = 0; |
348 TReal32 floatTrait = 0; |
349 |
349 |
350 M2G_DO_LOCK |
350 M2G_DO_LOCK |
351 if (aSvgProxyHandle) |
351 if (aSvgProxyHandle) |
352 { |
352 { |
353 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
353 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
354 |
354 |
355 TRAP(err ,aProxy->GetFloatTraitL( |
355 TRAP(err ,aProxy->GetFloatTraitL( |
356 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
356 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
357 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
357 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
358 floatTrait);); |
358 floatTrait);); |
359 } |
359 } |
360 M2G_DO_UNLOCK(aJni) |
360 M2G_DO_UNLOCK(aJni) |
361 |
361 |
362 M2GGeneral::CheckErrorCode(aJni, err); |
362 M2GGeneral::CheckErrorCode(aJni, err); |
363 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getFloatTrait: %f - end", floatTrait); |
363 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getFloatTrait: %f - end", floatTrait); |
364 return STATIC_CAST(jfloat, floatTrait); |
364 return STATIC_CAST(jfloat, floatTrait); |
386 { |
386 { |
387 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getMatrixTrait - begin"); |
387 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getMatrixTrait - begin"); |
388 TM2GMatrixData matrix; |
388 TM2GMatrixData matrix; |
389 TInt result = -1; |
389 TInt result = -1; |
390 TInt err = KM2GNotOk; |
390 TInt err = KM2GNotOk; |
391 |
391 |
392 M2G_DO_LOCK |
392 M2G_DO_LOCK |
393 if (aSvgProxyHandle) |
393 if (aSvgProxyHandle) |
394 { |
394 { |
395 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
395 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
396 |
396 |
397 TRAP(err, aProxy->GetMatrixTraitL( |
397 TRAP(err, aProxy->GetMatrixTraitL( |
398 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
398 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
399 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
399 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
400 matrix, result); ); |
400 matrix, result);); |
401 } |
401 } |
402 M2G_DO_UNLOCK(aJni) |
402 M2G_DO_UNLOCK(aJni) |
403 |
403 |
404 if (M2GGeneral::CheckErrorCode(aJni, err) == KM2GOk) |
404 if (M2GGeneral::CheckErrorCode(aJni, err) == KM2GOk) |
405 { |
405 { |
406 // Init matrix object |
406 // Init matrix object |
437 jint aElementHandle) |
437 jint aElementHandle) |
438 { |
438 { |
439 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getNextElementSibling - begin"); |
439 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getNextElementSibling - begin"); |
440 TInt siblingHandle = M2G_INVALID_HANDLE; |
440 TInt siblingHandle = M2G_INVALID_HANDLE; |
441 TInt err = KM2GNotOk; |
441 TInt err = KM2GNotOk; |
442 |
442 |
443 M2G_DO_LOCK |
443 M2G_DO_LOCK |
444 if (aSvgProxyHandle) |
444 if (aSvgProxyHandle) |
445 { |
445 { |
446 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
446 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
447 TRAP(err, aProxy->GetNextElementSiblingL(aElementHandle, siblingHandle); ); |
447 TRAP(err, aProxy->GetNextElementSiblingL(aElementHandle, siblingHandle);); |
448 } |
448 } |
449 M2G_DO_UNLOCK(aJni) |
449 M2G_DO_UNLOCK(aJni) |
450 |
450 |
451 M2GGeneral::CheckErrorCode(aJni, err); |
451 M2GGeneral::CheckErrorCode(aJni, err); |
452 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getNextElementSibling: %d - end", siblingHandle); |
452 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getNextElementSibling: %d - end", siblingHandle); |
453 return siblingHandle; |
453 return siblingHandle; |
454 } |
454 } |
455 // ----------------------------------------------------------------------------- |
455 // ----------------------------------------------------------------------------- |
470 jint aElementHandle) |
470 jint aElementHandle) |
471 { |
471 { |
472 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getParent - begin"); |
472 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getParent - begin"); |
473 TInt parentHandle = M2G_INVALID_HANDLE; |
473 TInt parentHandle = M2G_INVALID_HANDLE; |
474 TInt err = KM2GNotOk; |
474 TInt err = KM2GNotOk; |
475 |
475 |
476 M2G_DO_LOCK |
476 M2G_DO_LOCK |
477 |
477 |
478 if (aSvgProxyHandle) |
478 if (aSvgProxyHandle) |
479 { |
479 { |
480 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
480 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
481 TRAP(err, aProxy->GetParentL(aElementHandle, parentHandle);); |
481 TRAP(err, aProxy->GetParentL(aElementHandle, parentHandle);); |
482 } |
482 } |
483 M2G_DO_UNLOCK(aJni) |
483 M2G_DO_UNLOCK(aJni) |
484 |
484 |
485 M2GGeneral::CheckErrorCode(aJni, err); |
485 M2GGeneral::CheckErrorCode(aJni, err); |
486 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getParent: %d - end", parentHandle); |
486 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getParent: %d - end", parentHandle); |
487 return parentHandle; |
487 return parentHandle; |
506 jshort aAttributeTypeId) |
506 jshort aAttributeTypeId) |
507 { |
507 { |
508 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getPathTrait - begin"); |
508 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getPathTrait - begin"); |
509 TInt aPathTrait = 0; |
509 TInt aPathTrait = 0; |
510 TInt err = KM2GNotOk; |
510 TInt err = KM2GNotOk; |
511 |
511 |
512 M2G_DO_LOCK |
512 M2G_DO_LOCK |
513 if (aSvgProxyHandle) |
513 if (aSvgProxyHandle) |
514 { |
514 { |
515 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
515 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
516 |
516 |
517 TRAP(err, aProxy->GetPathTraitL( |
517 TRAP(err, aProxy->GetPathTraitL( |
518 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
518 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
519 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
519 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
520 aPathTrait); ); |
520 aPathTrait);); |
521 } |
521 } |
522 M2G_DO_UNLOCK(aJni) |
522 M2G_DO_UNLOCK(aJni) |
523 |
523 |
524 M2GGeneral::CheckErrorCode(aJni, err); |
524 M2GGeneral::CheckErrorCode(aJni, err); |
525 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getPathTrait: %d - end", aPathTrait); |
525 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getPathTrait: %d - end", aPathTrait); |
526 return aPathTrait; |
526 return aPathTrait; |
527 } |
527 } |
528 |
528 |
549 { |
549 { |
550 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRectTrait - begin"); |
550 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRectTrait - begin"); |
551 TM2GRectData rect; |
551 TM2GRectData rect; |
552 TInt result = 0; |
552 TInt result = 0; |
553 TInt err = KM2GNotOk; |
553 TInt err = KM2GNotOk; |
554 |
554 |
555 M2G_DO_LOCK |
555 M2G_DO_LOCK |
556 if (aSvgProxyHandle) |
556 if (aSvgProxyHandle) |
557 { |
557 { |
558 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
558 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
559 |
559 |
560 TRAP(err , aProxy->GetRectTraitL( |
560 TRAP(err , aProxy->GetRectTraitL( |
561 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
561 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
562 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
562 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
563 rect, result); ); |
563 rect, result);); |
564 } |
564 } |
565 M2G_DO_UNLOCK(aJni) |
565 M2G_DO_UNLOCK(aJni) |
566 |
566 |
567 M2GGeneral::CheckErrorCode(aJni, err); |
567 M2GGeneral::CheckErrorCode(aJni, err); |
568 aJni->SetFloatArrayRegion( |
568 aJni->SetFloatArrayRegion( |
569 REINTERPRET_CAST(jfloatArray, aRectComponents), |
569 REINTERPRET_CAST(jfloatArray, aRectComponents), |
570 0, |
570 0, |
571 rect.Count(), REINTERPRET_CAST(jfloat*, rect.Begin())); |
571 rect.Count(), REINTERPRET_CAST(jfloat*, rect.Begin())); |
593 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRootElement - begin"); |
593 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRootElement - begin"); |
594 TInt rootElementHandle = M2G_INVALID_HANDLE; |
594 TInt rootElementHandle = M2G_INVALID_HANDLE; |
595 TInt err = KM2GNotOk; |
595 TInt err = KM2GNotOk; |
596 M2G_DO_LOCK |
596 M2G_DO_LOCK |
597 if (aSvgProxyHandle) |
597 if (aSvgProxyHandle) |
598 { |
598 { |
599 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
599 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
600 |
600 |
601 TRAP(err, aProxy->GetRootElementL( |
601 TRAP(err, aProxy->GetRootElementL( |
602 STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle), |
602 STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle), |
603 rootElementHandle); ); |
603 rootElementHandle);); |
604 } |
604 } |
605 M2G_DO_UNLOCK(aJni) |
605 M2G_DO_UNLOCK(aJni) |
606 |
606 |
607 M2GGeneral::CheckErrorCode(aJni, err); |
607 M2GGeneral::CheckErrorCode(aJni, err); |
608 |
608 |
609 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getRootElement: %d - end", rootElementHandle); |
609 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getRootElement: %d - end", rootElementHandle); |
610 return rootElementHandle; |
610 return rootElementHandle; |
611 } |
611 } |
629 jfloatArray aScreenBBoxComponents) |
629 jfloatArray aScreenBBoxComponents) |
630 { |
630 { |
631 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getScreenBBox - begin"); |
631 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getScreenBBox - begin"); |
632 TM2GScreenBBoxData screenBBox; |
632 TM2GScreenBBoxData screenBBox; |
633 TInt err = KM2GNotOk; |
633 TInt err = KM2GNotOk; |
634 |
634 |
635 M2G_DO_LOCK |
635 M2G_DO_LOCK |
636 if (aSvgProxyHandle) |
636 if (aSvgProxyHandle) |
637 { |
637 { |
638 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
638 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
639 |
639 |
640 TRAP(err, aProxy->GetScreenBBoxL( |
640 TRAP(err, aProxy->GetScreenBBoxL( |
641 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
641 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
642 screenBBox); ); |
642 screenBBox);); |
643 } |
643 } |
644 M2G_DO_UNLOCK(aJni) |
644 M2G_DO_UNLOCK(aJni) |
645 |
645 |
646 M2GGeneral::CheckErrorCode(aJni, err); |
646 M2GGeneral::CheckErrorCode(aJni, err); |
647 |
647 |
648 aJni->SetFloatArrayRegion( |
648 aJni->SetFloatArrayRegion( |
649 REINTERPRET_CAST(jfloatArray, aScreenBBoxComponents), |
649 REINTERPRET_CAST(jfloatArray, aScreenBBoxComponents), |
650 0, |
650 0, |
674 { |
674 { |
675 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getStringTrait - begin"); |
675 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getStringTrait - begin"); |
676 |
676 |
677 TPtrC16 attribute; |
677 TPtrC16 attribute; |
678 TInt err = KM2GNotOk; |
678 TInt err = KM2GNotOk; |
679 |
679 |
680 M2G_DO_LOCK |
680 M2G_DO_LOCK |
681 if (aSvgProxyHandle) |
681 if (aSvgProxyHandle) |
682 { |
682 { |
683 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
683 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
684 |
684 |
685 TRAP(err, aProxy->GetStringTraitL( |
685 TRAP(err, aProxy->GetStringTraitL( |
686 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
686 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
687 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
687 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
688 attribute); ); |
688 attribute);); |
689 } |
689 } |
690 M2G_DO_UNLOCK(aJni) |
690 M2G_DO_UNLOCK(aJni) |
691 |
691 |
692 if ((M2GGeneral::CheckErrorCode(aJni, err) == KM2GOk) && |
692 if ((M2GGeneral::CheckErrorCode(aJni, err) == KM2GOk) && |
693 (attribute.Length() > 0)) |
693 (attribute.Length() > 0)) |
694 { |
694 { |
695 return CreateJavaString(*aJni, attribute); |
695 return CreateJavaString(*aJni, attribute); |
696 } |
696 } |
716 jint aElementHandle) |
716 jint aElementHandle) |
717 { |
717 { |
718 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getUsedFromElement - begin"); |
718 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getUsedFromElement - begin"); |
719 TInt handle = M2G_INVALID_HANDLE; |
719 TInt handle = M2G_INVALID_HANDLE; |
720 TInt err = KM2GNotOk; |
720 TInt err = KM2GNotOk; |
721 |
721 |
722 M2G_DO_LOCK |
722 M2G_DO_LOCK |
723 if (aSvgProxyHandle) |
723 if (aSvgProxyHandle) |
724 { |
724 { |
725 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
725 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
726 |
726 |
727 TRAP(err, aProxy->GetUsedFromElementL( |
727 TRAP(err, aProxy->GetUsedFromElementL( |
728 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
728 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
729 handle); ); |
729 handle);); |
730 } |
730 } |
731 M2G_DO_UNLOCK(aJni) |
731 M2G_DO_UNLOCK(aJni) |
732 |
732 |
733 M2GGeneral::CheckErrorCode(aJni, err); |
733 M2GGeneral::CheckErrorCode(aJni, err); |
734 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getUsedFromElement: %d - end", handle); |
734 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getUsedFromElement: %d - end", handle); |
735 return handle; |
735 return handle; |
736 } |
736 } |
737 |
737 |
753 jint aNewChildElementHandle, |
753 jint aNewChildElementHandle, |
754 jint aReferenceElementHandle) |
754 jint aReferenceElementHandle) |
755 { |
755 { |
756 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _insertBefore - begin"); |
756 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _insertBefore - begin"); |
757 TInt err = KM2GNotOk; |
757 TInt err = KM2GNotOk; |
758 |
758 |
759 M2G_DO_LOCK |
759 M2G_DO_LOCK |
760 |
760 |
761 if (aSvgProxyHandle) |
761 if (aSvgProxyHandle) |
762 { |
762 { |
763 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
763 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
764 |
764 |
765 TRAP(err, aProxy->InsertBeforeL( |
765 TRAP(err, aProxy->InsertBeforeL( |
766 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
766 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
767 STATIC_CAST(TM2GSvgElementHandle, aNewChildElementHandle), |
767 STATIC_CAST(TM2GSvgElementHandle, aNewChildElementHandle), |
768 STATIC_CAST(TM2GSvgElementHandle, aReferenceElementHandle)); ); |
768 STATIC_CAST(TM2GSvgElementHandle, aReferenceElementHandle));); |
769 } |
769 } |
770 M2G_DO_UNLOCK(aJni) |
770 M2G_DO_UNLOCK(aJni) |
771 |
771 |
772 M2GGeneral::CheckErrorCode(aJni, err); |
772 M2GGeneral::CheckErrorCode(aJni, err); |
773 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _insertBefore - end"); |
773 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _insertBefore - end"); |
774 } |
774 } |
785 JNIEXPORT jint JNICALL |
785 JNIEXPORT jint JNICALL |
786 Java_com_nokia_microedition_m2g_M2GSVGElement__1isUsed( |
786 Java_com_nokia_microedition_m2g_M2GSVGElement__1isUsed( |
787 JNIEnv* aJni, |
787 JNIEnv* aJni, |
788 jclass, |
788 jclass, |
789 jint aSvgProxyHandle, |
789 jint aSvgProxyHandle, |
790 jint aElementHandle ) |
790 jint aElementHandle) |
791 { |
791 { |
792 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _isUsed - begin"); |
792 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _isUsed - begin"); |
793 TInt result = KM2GNotOk; |
793 TInt result = KM2GNotOk; |
794 TInt err = KM2GNotOk; |
794 TInt err = KM2GNotOk; |
795 |
795 |
796 M2G_DO_LOCK |
796 M2G_DO_LOCK |
797 if (aSvgProxyHandle) |
797 if (aSvgProxyHandle) |
798 { |
798 { |
799 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
799 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
800 TRAP(err, aProxy->IsUsedL(STATIC_CAST(TM2GSvgElementHandle, aElementHandle), result); ); |
800 TRAP(err, aProxy->IsUsedL(STATIC_CAST(TM2GSvgElementHandle, aElementHandle), result);); |
801 } |
801 } |
802 M2G_DO_UNLOCK(aJni) |
802 M2G_DO_UNLOCK(aJni) |
803 |
803 |
804 |
804 |
805 M2GGeneral::CheckErrorCode(aJni, err); |
805 M2GGeneral::CheckErrorCode(aJni, err); |
806 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _isUsed: %d - end", result); |
806 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _isUsed: %d - end", result); |
807 return result; |
807 return result; |
808 } |
808 } |
809 |
809 |
830 TInt handle = M2G_INVALID_HANDLE; |
830 TInt handle = M2G_INVALID_HANDLE; |
831 TInt err = KM2GNotOk; |
831 TInt err = KM2GNotOk; |
832 |
832 |
833 M2G_DO_LOCK |
833 M2G_DO_LOCK |
834 if (aSvgProxyHandle) |
834 if (aSvgProxyHandle) |
835 { |
835 { |
836 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
836 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
837 |
837 |
838 TRAP(err ,aProxy->RemoveChildL( |
838 TRAP(err ,aProxy->RemoveChildL( |
839 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
839 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
840 STATIC_CAST(TM2GSvgElementHandle, aChildElementHandle), handle); ); |
840 STATIC_CAST(TM2GSvgElementHandle, aChildElementHandle), handle);); |
841 } |
841 } |
842 M2G_DO_UNLOCK(aJni) |
842 M2G_DO_UNLOCK(aJni) |
843 |
843 |
844 M2GGeneral::CheckErrorCode(aJni, err); |
844 M2GGeneral::CheckErrorCode(aJni, err); |
845 |
845 |
846 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _removeChild: %d - end", handle); |
846 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _removeChild: %d - end", handle); |
847 return handle; |
847 return handle; |
848 } |
848 } |
874 color[ 2 ] = aBlue; |
874 color[ 2 ] = aBlue; |
875 TInt err = KM2GNotOk; |
875 TInt err = KM2GNotOk; |
876 |
876 |
877 M2G_DO_LOCK |
877 M2G_DO_LOCK |
878 if (aSvgProxyHandle) |
878 if (aSvgProxyHandle) |
879 { |
879 { |
880 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
880 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
881 |
881 |
882 TRAP(err, aProxy->SetColorTraitL( |
882 TRAP(err, aProxy->SetColorTraitL( |
883 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
883 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
884 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
884 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
885 color); ); |
885 color);); |
886 } |
886 } |
887 M2G_DO_UNLOCK(aJni) |
887 M2G_DO_UNLOCK(aJni) |
888 |
888 |
889 M2GGeneral::CheckErrorCode(aJni, err); |
889 M2GGeneral::CheckErrorCode(aJni, err); |
890 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _setColorTrait: %d - end", err); |
890 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _setColorTrait: %d - end", err); |
891 } |
891 } |
892 |
892 |
893 // ----------------------------------------------------------------------------- |
893 // ----------------------------------------------------------------------------- |
897 * Calls MM2GSVGProxy::SetEnumTraitL method. |
897 * Calls MM2GSVGProxy::SetEnumTraitL method. |
898 * @since Series S60 3.0 |
898 * @since Series S60 3.0 |
899 * @param aProxy Proxy instance. |
899 * @param aProxy Proxy instance. |
900 * @param aElementHandle Element pointer. |
900 * @param aElementHandle Element pointer. |
901 * @param aAttributeTypeId - |
901 * @param aAttributeTypeId - |
902 * @param aValue |
902 * @param aValue |
903 */ |
903 */ |
904 JNIEXPORT void JNICALL |
904 JNIEXPORT void JNICALL |
905 Java_com_nokia_microedition_m2g_M2GSVGElement__1setEnumTrait( |
905 Java_com_nokia_microedition_m2g_M2GSVGElement__1setEnumTrait( |
906 JNIEnv* aJni, |
906 JNIEnv* aJni, |
907 jclass, |
907 jclass, |
910 jshort aAttributeTypeId, |
910 jshort aAttributeTypeId, |
911 jshort aValue) |
911 jshort aValue) |
912 { |
912 { |
913 M2G_DEBUG_2("M2G_DEBUG: JNI ( M2GSVGElement ) _setEnumTrait: type=%d, value=%d - begin", aAttributeTypeId, aValue); |
913 M2G_DEBUG_2("M2G_DEBUG: JNI ( M2GSVGElement ) _setEnumTrait: type=%d, value=%d - begin", aAttributeTypeId, aValue); |
914 TInt err = KM2GNotOk; |
914 TInt err = KM2GNotOk; |
915 |
915 |
916 M2G_DO_LOCK |
916 M2G_DO_LOCK |
917 if (aSvgProxyHandle) |
917 if (aSvgProxyHandle) |
918 { |
918 { |
919 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
919 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
920 |
920 |
921 TRAP(err, aProxy->SetEnumTraitL( |
921 TRAP(err, aProxy->SetEnumTraitL( |
922 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
922 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
923 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
923 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
924 aValue); ); |
924 aValue);); |
925 } |
925 } |
926 M2G_DO_UNLOCK(aJni) |
926 M2G_DO_UNLOCK(aJni) |
927 |
927 |
928 M2GGeneral::CheckErrorCode(aJni, err); |
928 M2GGeneral::CheckErrorCode(aJni, err); |
929 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setEnumTrait - end"); |
929 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setEnumTrait - end"); |
930 } |
930 } |
948 jshort aAttributeTypeId, |
948 jshort aAttributeTypeId, |
949 jfloat aValue) |
949 jfloat aValue) |
950 { |
950 { |
951 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _setFloatTrait: %f - begin", aValue); |
951 M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _setFloatTrait: %f - begin", aValue); |
952 TInt err = KM2GNotOk; |
952 TInt err = KM2GNotOk; |
953 |
953 |
954 M2G_DO_LOCK |
954 M2G_DO_LOCK |
955 if (aSvgProxyHandle) |
955 if (aSvgProxyHandle) |
956 { |
956 { |
957 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
957 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
958 |
958 |
959 TRAP(err, aProxy->SetFloatTraitL( |
959 TRAP(err, aProxy->SetFloatTraitL( |
960 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
960 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
961 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
961 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
962 aValue); ); |
962 aValue);); |
963 } |
963 } |
964 M2G_DO_UNLOCK(aJni) |
964 M2G_DO_UNLOCK(aJni) |
965 |
965 |
966 M2GGeneral::CheckErrorCode(aJni, err); |
966 M2GGeneral::CheckErrorCode(aJni, err); |
967 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setFloatTrait: - end"); |
967 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setFloatTrait: - end"); |
968 } |
968 } |
997 { |
997 { |
998 matrix[ index ] = components[ index ]; |
998 matrix[ index ] = components[ index ]; |
999 } |
999 } |
1000 // Release data source |
1000 // Release data source |
1001 aJni->ReleaseFloatArrayElements(aMatrixComponents, components, JNI_ABORT); |
1001 aJni->ReleaseFloatArrayElements(aMatrixComponents, components, JNI_ABORT); |
1002 |
1002 |
1003 M2G_DO_LOCK |
1003 M2G_DO_LOCK |
1004 if (aSvgProxyHandle) |
1004 if (aSvgProxyHandle) |
1005 { |
1005 { |
1006 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1006 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1007 |
1007 |
1008 TRAP(err, aProxy->SetMatrixTraitL( |
1008 TRAP(err, aProxy->SetMatrixTraitL( |
1009 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1009 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1010 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1010 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1011 matrix); ); |
1011 matrix);); |
1012 } |
1012 } |
1013 M2G_DO_UNLOCK(aJni) |
1013 M2G_DO_UNLOCK(aJni) |
1014 |
1014 |
1015 M2GGeneral::CheckErrorCode(aJni, err); |
1015 M2GGeneral::CheckErrorCode(aJni, err); |
1016 M2G_DEBUG_6("JNI ( M2GSVGElement ) _setMatrixTrait: %f, %f, %f, %f, %f, %f - end", matrix[ 0 ], matrix[ 1 ], matrix[ 2 ], matrix[ 3 ], matrix[ 4 ], matrix[ 5 ]); |
1016 M2G_DEBUG_6("JNI ( M2GSVGElement ) _setMatrixTrait: %f, %f, %f, %f, %f, %f - end", matrix[ 0 ], matrix[ 1 ], matrix[ 2 ], matrix[ 3 ], matrix[ 4 ], matrix[ 5 ]); |
1017 } |
1017 } |
1018 // ----------------------------------------------------------------------------- |
1018 // ----------------------------------------------------------------------------- |
1019 // Java_com_nokia_microedition_m2g_M2GSVGElement::_setPathTrait |
1019 // Java_com_nokia_microedition_m2g_M2GSVGElement::_setPathTrait |
1035 jshort aAttributeTypeId, |
1035 jshort aAttributeTypeId, |
1036 jint aPathHandle) |
1036 jint aPathHandle) |
1037 { |
1037 { |
1038 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setPathTrait - begin"); |
1038 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setPathTrait - begin"); |
1039 TInt err = KM2GNotOk; |
1039 TInt err = KM2GNotOk; |
1040 |
1040 |
1041 M2G_DO_LOCK |
1041 M2G_DO_LOCK |
1042 if (aSvgProxyHandle) |
1042 if (aSvgProxyHandle) |
1043 { |
1043 { |
1044 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1044 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1045 |
1045 |
1046 TRAP(err,aProxy->SetPathTraitL( |
1046 TRAP(err,aProxy->SetPathTraitL( |
1047 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1047 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1048 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1048 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1049 STATIC_CAST(TM2GSvgPathHandle, aPathHandle)); ); |
1049 STATIC_CAST(TM2GSvgPathHandle, aPathHandle));); |
1050 } |
1050 } |
1051 M2G_DO_UNLOCK(aJni) |
1051 M2G_DO_UNLOCK(aJni) |
1052 |
1052 |
1053 M2GGeneral::CheckErrorCode(aJni, err); |
1053 M2GGeneral::CheckErrorCode(aJni, err); |
1054 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setPathTrait - end"); |
1054 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setPathTrait - end"); |
1055 } |
1055 } |
1081 rect[ 3 ] = aHeight; |
1081 rect[ 3 ] = aHeight; |
1082 TInt err = KM2GNotOk; |
1082 TInt err = KM2GNotOk; |
1083 |
1083 |
1084 M2G_DO_LOCK |
1084 M2G_DO_LOCK |
1085 if (aSvgProxyHandle) |
1085 if (aSvgProxyHandle) |
1086 { |
1086 { |
1087 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1087 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1088 |
1088 |
1089 TRAP(err, aProxy->SetRectTraitL( |
1089 TRAP(err, aProxy->SetRectTraitL( |
1090 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1090 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1091 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1091 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1092 rect); ); |
1092 rect);); |
1093 } |
1093 } |
1094 M2G_DO_UNLOCK(aJni) |
1094 M2G_DO_UNLOCK(aJni) |
1095 |
1095 |
1096 M2GGeneral::CheckErrorCode(aJni, err); |
1096 M2GGeneral::CheckErrorCode(aJni, err); |
1097 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRectTrait - end"); |
1097 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRectTrait - end"); |
1098 } |
1098 } |
1115 jint aElementHandle, |
1115 jint aElementHandle, |
1116 jshort aAttributeTypeId, |
1116 jshort aAttributeTypeId, |
1117 jstring aValue) |
1117 jstring aValue) |
1118 { |
1118 { |
1119 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setStringTrait - begin"); |
1119 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setStringTrait - begin"); |
1120 //RJString str(*aJni, aValue); |
1120 |
1121 JStringUtils str(*aJni, aValue); |
1121 JStringUtils str(*aJni, aValue); |
1122 TInt err = KM2GNotOk; |
1122 TInt err = KM2GNotOk; |
1123 |
1123 |
1124 M2G_DO_LOCK |
1124 M2G_DO_LOCK |
1125 if (aSvgProxyHandle) |
1125 if (aSvgProxyHandle) |
1126 { |
1126 { |
1127 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1127 MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle); |
1128 TPtrC16 lValue=STATIC_CAST(TPtrC16, str); |
1128 TPtrC16 lValue=STATIC_CAST(TPtrC16, str); |
1129 |
1129 |
1130 TRAP(err, aProxy->SetStringTraitL( |
1130 TRAP(err, aProxy->SetStringTraitL( |
1131 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1131 STATIC_CAST(TM2GSvgElementHandle, aElementHandle), |
1132 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1132 STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId), |
1133 lValue); ); |
1133 lValue);); |
1134 } |
1134 } |
1135 M2G_DO_UNLOCK(aJni) |
1135 M2G_DO_UNLOCK(aJni) |
1136 |
1136 |
1137 M2GGeneral::CheckErrorCode(aJni, err); |
1137 M2GGeneral::CheckErrorCode(aJni, err); |
1138 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setStringTrait - end"); |
1138 M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setStringTrait - end"); |
1139 } |
1139 } |
1140 |
1140 |
1141 M2G_NS_END |
1141 M2G_NS_END |