javauis/m2g_akn/src/jni/M2GScalableGraphics.cpp
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     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 "CM2GEventSource.h"
       
    20 #include "com_nokia_microedition_m2g_M2GScalableGraphics.h"
       
    21 #include "CM2GRenderContext.h"
       
    22 #include "MM2GSVGProxy.h" // TM2GRenderRect
       
    23 #include <methodwrappers.h>
       
    24 
       
    25 M2G_NS_START
       
    26 
       
    27 // EXTERNAL DATA STRUCTURES
       
    28 
       
    29 // EXTERNAL FUNCTION PROTOTYPES
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // LOCAL CONSTANTS AND MACROS
       
    36 
       
    37 // MODULE DATA STRUCTURES
       
    38 
       
    39 // LOCAL FUNCTION PROTOTYPES
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 // ================================ FUNCTIONS ==================================
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // Java_com_nokia_microedition_m2g_M2GScalableGraphics::_bind
       
    49 // -----------------------------------------------------------------------------
       
    50 /**
       
    51  * Calls MM2GRenderContext::BindL method.
       
    52  * @since Series S60 3.0
       
    53  * @param aRenderContextHandle Render context handle.
       
    54  * @param aTargetHandle Target graphics handle
       
    55  * @throws exception if not ok
       
    56  */
       
    57 LOCAL_C void DoBindL(TInt aRenderContextHandle, TInt aTargetHandle, TBool aUiToolkit)
       
    58 {
       
    59     MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
    60     rc->BindL(aTargetHandle, aUiToolkit);
       
    61 }
       
    62 
       
    63 /**
       
    64  * JNI method
       
    65  */
       
    66 JNIEXPORT jint JNICALL
       
    67 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1bind(
       
    68     JNIEnv* aJni,
       
    69     jobject,
       
    70     jint aEventSourceHandle,
       
    71     jint aRenderContextHandle,
       
    72     jint aTargetHandle,
       
    73     jboolean aUiToolkit)
       
    74 {
       
    75     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _bind - begin");
       
    76     TInt err = KM2GNotOk;
       
    77     if (aUiToolkit)  // If the current toolkit is eSWT.
       
    78     {
       
    79         MSwtClient* client = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
       
    80         if (client && aRenderContextHandle)
       
    81         {
       
    82             typedef void (MM2GRenderContext::*pBindL)(TInt&, TInt);
       
    83             pBindL DoBindL = &MM2GRenderContext::BindL;
       
    84             MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
    85             TMethodWrapper2<MM2GRenderContext, TInt& ,TInt > DoBind(
       
    86                 *rc,
       
    87                 DoBindL,
       
    88                 aTargetHandle,
       
    89                 aUiToolkit);
       
    90             err = client->Execute(DoBind);
       
    91         }
       
    92     }
       
    93     else
       
    94     {
       
    95         TInt aUiToolkit = 0; // The current toolkit is LCDUI
       
    96         CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
       
    97 
       
    98         if (eventSource && aRenderContextHandle)
       
    99         {
       
   100 
       
   101             err = eventSource->ExecuteTrap(
       
   102                       &DoBindL,
       
   103                       aRenderContextHandle,
       
   104                       aTargetHandle,
       
   105                       aUiToolkit);
       
   106         }
       
   107     }
       
   108     M2GGeneral::CheckErrorCode(aJni, err);
       
   109 
       
   110     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _bind: %d - end", err);
       
   111     return err;
       
   112 }
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // Java_com_nokia_microedition_m2g_M2GScalableGraphics::_createRenderContext
       
   116 // -----------------------------------------------------------------------------
       
   117 /**
       
   118  * Calls MM2GRenderContext::NewL method.
       
   119  * @since Series S60 3.0
       
   120  * @param aSvgProxyHandle Proxy instance.
       
   121  * @param aHandle Render context handle.
       
   122  * @throws exception if not ok
       
   123  */
       
   124 LOCAL_C void DoCreateRenderContextL(TInt* aHandle, MM2GSVGProxy* aSvgProxyHandle)
       
   125 {
       
   126     MM2GRenderContext* handle = CM2GRenderContext::NewL(aSvgProxyHandle);
       
   127     *aHandle = JavaMakeHandle(handle);
       
   128 }
       
   129 
       
   130 /**
       
   131  * JNI method
       
   132  */
       
   133 JNIEXPORT jint JNICALL
       
   134 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1createRenderContext(
       
   135     JNIEnv* aJni,
       
   136     jobject,
       
   137     jint aEventSourceHandle,
       
   138     jint aSvgProxyHandle,
       
   139     jboolean aUiToolkit)
       
   140 {
       
   141     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _createRenderContext - begin");
       
   142     TInt handle = M2G_INVALID_HANDLE;
       
   143     TInt  err = KM2GNotOk;
       
   144     if (aUiToolkit)  // If the current toolkit is eSWT.
       
   145     {
       
   146         MSwtClient* client = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
       
   147         if (client && aSvgProxyHandle)
       
   148         {
       
   149             typedef void (*pDoCreateRenderContextL)(TInt*,MM2GSVGProxy*);
       
   150             pDoCreateRenderContextL lDoCreateRenderContextL = DoCreateRenderContextL;
       
   151             TSwtM2gMethodWrapper2<TInt,MM2GSVGProxy> DoCreateRenderContext(
       
   152                 lDoCreateRenderContextL,
       
   153                 &handle,
       
   154                 JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle)
       
   155             );
       
   156             err = client->Execute(DoCreateRenderContext);
       
   157         }
       
   158     }
       
   159     else
       
   160     {
       
   161         CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
       
   162 
       
   163         if (eventSource && aSvgProxyHandle)
       
   164         {
       
   165             err =   eventSource->ExecuteTrap(
       
   166                         &DoCreateRenderContextL,
       
   167                         &handle,
       
   168                         JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle));
       
   169         }
       
   170     }
       
   171     handle = M2GGeneral::CheckErrorCodeAndHandle(
       
   172                  aJni, err, handle, err);
       
   173 
       
   174     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _createRenderContext: %d - end", handle);
       
   175     return handle;
       
   176 }
       
   177 
       
   178 // -----------------------------------------------------------------------------
       
   179 // Java_com_nokia_microedition_m2g_M2GScalableGraphics::_deleteRenderContext
       
   180 // -----------------------------------------------------------------------------
       
   181 /**
       
   182  * Deletes the object
       
   183  * @since Series S60 3.0
       
   184  * @param aRenderContextHandle Render context handle
       
   185  */
       
   186 LOCAL_C void DoDeleteRenderContext(TInt aRenderContextHandle)
       
   187 {
       
   188     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) DoDeleteRenderContext");
       
   189     MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   190     delete rc;
       
   191 }
       
   192 /**
       
   193  * Class: com_nokia_microedition_m2g_M2GScalableGraphics
       
   194  * Method: deleteRenderContext
       
   195  * Signature:
       
   196  */
       
   197 JNIEXPORT void JNICALL
       
   198 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1deleteRenderContext(
       
   199     JNIEnv*,
       
   200     jobject,
       
   201     jint aEventSourceHandle,
       
   202     jint aRenderContextHandle,
       
   203     jboolean aUIToolkit)
       
   204 {
       
   205     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _deleteRenderContext - begin");
       
   206     // TInt err = KM2GNotOk;
       
   207     if (aUIToolkit)  // If the current toolkit is eSWT.
       
   208     {
       
   209         MSwtClient* client  = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
       
   210         if (client && aRenderContextHandle)
       
   211         {
       
   212             typedef void (*pDoDeleteRenderContext)(TInt aRenderContextHandle);
       
   213             pDoDeleteRenderContext lDoDeleteRenderContext = DoDeleteRenderContext;
       
   214             _TSwtM2gMethodWrapper1<TInt> DoDeleteRenderContext(
       
   215                 lDoDeleteRenderContext,
       
   216                 aRenderContextHandle
       
   217             );
       
   218             /*err = */
       
   219             client->Execute(DoDeleteRenderContext);
       
   220         }
       
   221     }
       
   222     else
       
   223     {
       
   224         CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
       
   225         if (eventSource && aRenderContextHandle)
       
   226         {
       
   227             eventSource->ExecuteV(
       
   228                 &DoDeleteRenderContext,
       
   229                 aRenderContextHandle);
       
   230         }
       
   231     }
       
   232     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _deleteRenderContext - end");
       
   233 }
       
   234 
       
   235 // -----------------------------------------------------------------------------
       
   236 // Java_com_nokia_microedition_m2g_M2GScalableGraphics::_release
       
   237 // -----------------------------------------------------------------------------
       
   238 /**
       
   239  * Calls MM2GRenderContext::ReleaseL method.
       
   240  * @since Series S60 3.0
       
   241  * @param aRenderContextHandle Context handle
       
   242  * @return KM2GOk if ok
       
   243  */
       
   244 LOCAL_C void DoReleaseL(TInt aRenderContextHandle)
       
   245 {
       
   246     MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   247     rc->ReleaseL();
       
   248 }
       
   249 
       
   250 /**
       
   251  * JNI method
       
   252  */
       
   253 JNIEXPORT jint JNICALL
       
   254 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1release(
       
   255     JNIEnv* aJni,
       
   256     jobject,
       
   257     jint aEventSourceHandle,
       
   258     jint aRenderContextHandle,
       
   259     jboolean aUIToolkit)
       
   260 {
       
   261     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _release - begin");
       
   262     CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
       
   263     TInt err = KM2GNotOk;
       
   264     if (aUIToolkit)  // If the current toolkit is eSWT.
       
   265     {
       
   266         MSwtClient* client  = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
       
   267         if (client && aRenderContextHandle)
       
   268         {
       
   269             typedef void (MM2GRenderContext::*pReleaseL)();
       
   270             pReleaseL ReleaseL = &MM2GRenderContext::ReleaseL;
       
   271             MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   272             TMethodWrapper0<MM2GRenderContext> Release(
       
   273                 *rc,
       
   274                 ReleaseL
       
   275             );
       
   276             err = client->Execute(Release);
       
   277         }
       
   278     }
       
   279     else
       
   280     {
       
   281         if (eventSource && aRenderContextHandle)
       
   282         {
       
   283             err = eventSource->ExecuteTrap(
       
   284                       &DoReleaseL,
       
   285                       aRenderContextHandle);
       
   286         }
       
   287     }
       
   288     M2GGeneral::CheckErrorCode(aJni, err);
       
   289 
       
   290     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _release: %d - end", err);
       
   291     return err;
       
   292 }
       
   293 
       
   294 // -----------------------------------------------------------------------------
       
   295 // Java_com_nokia_microedition_m2g_M2GScalableGraphics::_render
       
   296 // -----------------------------------------------------------------------------
       
   297 /**
       
   298  * Calls MM2GRenderContext::RenderL method.
       
   299  * @since Series S60 3.0
       
   300  * @param aRenderContextHandle Context handle
       
   301  * @param aDocumentHandle Document handle.
       
   302  * @param aSvgW Svg width.
       
   303  * @param aSvgH Svg heigth.
       
   304  * @param aCurrentTime Current time.
       
   305  * @throws Exception if not ok
       
   306  */
       
   307 LOCAL_C void DoRenderL(
       
   308     TInt aRenderContextHandle,
       
   309     TInt aDocumentHandle,
       
   310     TM2GRenderRect* aRr,
       
   311     TInt aSvgW,
       
   312     TInt aSvgH,
       
   313     float* aCurrentTime
       
   314 )
       
   315 {
       
   316     MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   317 
       
   318     rc->RenderLCDUIL(aDocumentHandle, *aCurrentTime, aSvgW, aSvgH, *aRr);
       
   319 }
       
   320 
       
   321 /**
       
   322  * JNI method
       
   323  */
       
   324 JNIEXPORT jint JNICALL
       
   325 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1renderLCDUI(
       
   326     JNIEnv* aJni,
       
   327     jobject,
       
   328     jint aEventSourceHandle,
       
   329     jint aRenderContextHandle,
       
   330     jint aDocumentHandle,
       
   331     jint aX, jint aY,
       
   332     jint aClipX, jint aClipY, jint aClipW, jint aClipH,
       
   333     jint aSvgW, jint aSvgH,
       
   334     jfloat aCurrentTime)
       
   335 {
       
   336     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render, time:%f - begin", aCurrentTime);
       
   337 
       
   338     TM2GRenderRect rr(aX, aY, aClipX, aClipY, aClipW, aClipH);
       
   339 
       
   340     TInt err = KM2GNotOk;
       
   341 
       
   342     CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
       
   343     if (eventSource && aRenderContextHandle && aDocumentHandle)
       
   344     {
       
   345 
       
   346         err = eventSource->ExecuteTrap(&DoRenderL,
       
   347                                        aRenderContextHandle,
       
   348                                        aDocumentHandle,
       
   349                                        &rr,
       
   350                                        aSvgW,
       
   351                                        aSvgH,
       
   352                                        &aCurrentTime);
       
   353     }
       
   354 
       
   355     M2GGeneral::CheckErrorCode(aJni, err);
       
   356 
       
   357     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render: %d - end", err);
       
   358 
       
   359     return err;
       
   360 }
       
   361 JNIEXPORT jintArray JNICALL
       
   362 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1renderESWT(
       
   363     JNIEnv* aJni,
       
   364     jobject,
       
   365     jint aEventSourceHandle,
       
   366     jint aRenderContextHandle,
       
   367     jint aDocumentHandle,
       
   368     jint aX, jint aY,
       
   369     jint aClipX, jint aClipY, jint aClipW, jint aClipH,
       
   370     jint aSvgW, jint aSvgH,
       
   371     jfloat aCurrentTime,
       
   372     jint aUseNativeClear
       
   373 )
       
   374 {
       
   375     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render, time:%f - begin", aCurrentTime);
       
   376     TM2GRenderRect rr(aX, aY, aClipX, aClipY, aClipW, aClipH);
       
   377     // TInt err = KM2GNotOk;
       
   378     jintArray returnDataJava = aJni->NewIntArray(10);
       
   379     MSwtClient* client  = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
       
   380     if (client && aRenderContextHandle && aDocumentHandle)
       
   381     {
       
   382         MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   383         typedef void (MM2GRenderContext::*pRenderESWTL)(
       
   384             TM2GSvgDocumentHandle&,
       
   385             const TReal32,
       
   386             TInt aSvgW,
       
   387             TInt aSvgH,
       
   388             TM2GRenderRect&,
       
   389             MSwtClient*,
       
   390             TBool,
       
   391             TInt*);
       
   392         pRenderESWTL RenderESWTL = &MM2GRenderContext::RenderESWTL;
       
   393         TInt returnData[10];
       
   394         TMethodWrapper8<MM2GRenderContext,
       
   395         TInt&,const TReal32,TInt,TInt,
       
   396         TM2GRenderRect&,MSwtClient*,TBool,TInt*> RenderESWT(
       
   397             *rc,
       
   398             RenderESWTL,
       
   399             aDocumentHandle,
       
   400             aCurrentTime,
       
   401             aSvgW,
       
   402             aSvgH,
       
   403             rr,
       
   404             client,
       
   405             aUseNativeClear,
       
   406             returnData
       
   407         );
       
   408         /*err = */
       
   409         client->Execute(RenderESWT);
       
   410         if (returnDataJava != NULL)
       
   411             aJni->SetIntArrayRegion(returnDataJava, 0, 10, const_cast<TInt*>(returnData));
       
   412     }
       
   413     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render: %d - end", err);
       
   414     return returnDataJava;
       
   415 }
       
   416 
       
   417 // -----------------------------------------------------------------------------
       
   418 // Java_com_nokia_microedition_m2g_M2GScalableGraphics::_setRenderingQuality
       
   419 // -----------------------------------------------------------------------------
       
   420 /**
       
   421  * Calls MM2GRenderContext::SetRenderingQuality method.
       
   422  * @since Series S60 3.0
       
   423  * @param aRenderContextHandle Context handle
       
   424  * @param aMode
       
   425  * @throws Exception if not ok
       
   426  */
       
   427 LOCAL_C void DoSetRenderingQualityL(
       
   428     TInt aRenderContextHandle, TInt aMode)
       
   429 {
       
   430     MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   431     rc->SetRenderingQualityL(aMode);
       
   432 }
       
   433 
       
   434 /**
       
   435  * JNI method
       
   436  */
       
   437 JNIEXPORT void JNICALL
       
   438 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1setRenderingQuality(
       
   439     JNIEnv* aJni,
       
   440     jobject,
       
   441     jint aEventSourceHandle,
       
   442     jint aRenderContextHandle, jint aMode, jboolean aUiToolkit)
       
   443 {
       
   444     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setRenderingQuality - begin");
       
   445     TInt err = KM2GNotOk;
       
   446     if (aUiToolkit)  // If the current Ui Toolkit is eSWT.
       
   447     {
       
   448         MSwtClient* client  = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
       
   449         if (client && aRenderContextHandle)
       
   450         {
       
   451             typedef void (MM2GRenderContext::*pSetRenderingQualityL)(TInt);
       
   452             pSetRenderingQualityL SetRenderingQualityL = &MM2GRenderContext::SetRenderingQualityL;
       
   453             MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   454             TMethodWrapper1<MM2GRenderContext,TInt> SetRenderingQuality(
       
   455                 *rc,
       
   456                 SetRenderingQualityL,
       
   457                 aMode);
       
   458             err = client->Execute(SetRenderingQuality);
       
   459         }
       
   460     }
       
   461     else
       
   462     {
       
   463         CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
       
   464         if (eventSource && aRenderContextHandle)
       
   465         {
       
   466             err = eventSource->ExecuteTrap(
       
   467                       &DoSetRenderingQualityL,
       
   468                       aRenderContextHandle, aMode);
       
   469         }
       
   470     }
       
   471     M2GGeneral::CheckErrorCode(aJni, err);
       
   472 
       
   473     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setRenderingQuality - end");
       
   474 }
       
   475 
       
   476 // -----------------------------------------------------------------------------
       
   477 // Java_com_nokia_microedition_m2g_M2GScalableGraphics::_setTransparency
       
   478 // -----------------------------------------------------------------------------
       
   479 /**
       
   480  * Calls MM2GRenderContext::SetTransparency method.
       
   481  * @since Series S60 3.0
       
   482  * @param aRenderContextHandle Context handle
       
   483  * @param aAplha -
       
   484  */
       
   485 LOCAL_C void DoSetTransparencyL(
       
   486     TInt aRenderContextHandle,
       
   487     TReal32* aAlpha)
       
   488 {
       
   489     MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   490     rc->SetTransparency(*aAlpha);
       
   491 }
       
   492 
       
   493 /**
       
   494  * JNI method
       
   495  */
       
   496 JNIEXPORT void JNICALL
       
   497 Java_com_nokia_microedition_m2g_M2GScalableGraphics__1setTransparency(
       
   498     JNIEnv* aJni,
       
   499     jobject,
       
   500     jint aEventSourceHandle,
       
   501     jint aRenderContextHandle,
       
   502     jfloat aAlpha,
       
   503     jboolean aUiToolkit)
       
   504 {
       
   505     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setTransparency - begin");
       
   506     TInt err = KM2GNotOk;
       
   507     if (aUiToolkit)  // If the current Ui Toolkit is eSWT.
       
   508     {
       
   509         MSwtClient* client  = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
       
   510         if (client && aRenderContextHandle)
       
   511         {
       
   512             typedef void (MM2GRenderContext::*pSetTransparency)(TReal32);
       
   513             pSetTransparency lSetTransparency = &MM2GRenderContext::SetTransparency;
       
   514             MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
       
   515             TMethodWrapper1<MM2GRenderContext,TReal32> SetTransparency(
       
   516                 *rc,
       
   517                 lSetTransparency,
       
   518                 aAlpha);
       
   519             err = client->Execute(SetTransparency);
       
   520         }
       
   521     }
       
   522     else
       
   523     {
       
   524         CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
       
   525         if (eventSource && aRenderContextHandle)
       
   526         {
       
   527             err = eventSource->ExecuteTrap(
       
   528                       &DoSetTransparencyL,
       
   529                       aRenderContextHandle,
       
   530                       REINTERPRET_CAST(TReal32*, &aAlpha));
       
   531         }
       
   532     }
       
   533     M2GGeneral::CheckErrorCode(aJni, err);
       
   534 
       
   535     M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setTransparency - end");
       
   536 }
       
   537 
       
   538 M2G_NS_END
       
   539 
       
   540 
       
   541