|
1 /* |
|
2 * Copyright (c) 2010 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 in UI thread context |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "org_eclipse_swt_widgets_ESWTProxyControl.h" |
|
19 #include "logger.h" |
|
20 //#include "cmmadcdisplay.h" |
|
21 #include "cmmadisplay.h" |
|
22 |
|
23 JNIEXPORT jintArray JNICALL Java_org_eclipse_swt_widgets_ESWTProxyControl__1getSourceSize |
|
24 (JNIEnv *aJni, jobject, jint nativeDisplayHandle) |
|
25 { |
|
26 LOG(EJavaMMAPI,EInfo,"JNI_eswtproxycontrol.cpp : getSourceSize +"); |
|
27 LOG1(EJavaMMAPI,EInfo,"JNI_eswtproxycontrol.cpp : getSourceSize nativeDisplayHandle = %d", nativeDisplayHandle); |
|
28 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
29 TSize sourceRect = display->SourceSize(); |
|
30 jint sourceWidth = sourceRect.iWidth; |
|
31 jint sourceHeight = sourceRect.iHeight; |
|
32 |
|
33 jintArray sourceSize = aJni->NewIntArray(2); |
|
34 aJni->SetIntArrayRegion(sourceSize,0,1,&sourceWidth); |
|
35 aJni->SetIntArrayRegion(sourceSize,1,1,&sourceHeight); |
|
36 LOG(EJavaMMAPI,EInfo,"JNI_eswtproxycontrol.cpp : getSourceSize -"); |
|
37 return sourceSize; |
|
38 } |