1 #include "logger.h" |
|
2 #include "com_nokia_microedition_media_control_MMACanvasDisplay.h" |
|
3 #include "cmmacanvasdisplay.h" |
|
4 #include "qwidget.h" |
|
5 #include "cmmasurfacewindow.h" |
|
6 |
|
7 |
|
8 /* |
|
9 * Class: com_nokia_microedition_media_control_mmacanvasdisplay |
|
10 * Method: _setVisible |
|
11 * Signature: (IIZ)I |
|
12 */ |
|
13 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1setVisible |
|
14 (JNIEnv *, jobject, jint nativeDisplayHandle, jboolean isVisible) |
|
15 { |
|
16 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setVisible +"); |
|
17 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
18 TBool visible = (TBool)isVisible; |
|
19 display ->SetVisible(visible); |
|
20 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setVisible -"); |
|
21 } |
|
22 |
|
23 LOCAL_C void LocalSetContainerVisible(CMMADisplay* display,TBool visible) |
|
24 { |
|
25 display ->SetContainerVisibility(visible); |
|
26 } |
|
27 |
|
28 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1setContainerVisible |
|
29 (JNIEnv *, jobject,jint aEventSourceHandle, jint nativeDisplayHandle, jboolean isActive) |
|
30 { |
|
31 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setContainerVisible +"); |
|
32 MMAFunctionServer* eventSource = reinterpret_cast<MMAFunctionServer *>(aEventSourceHandle); |
|
33 // need to call in Function server thread context because CMMADisplay's JNI pointer |
|
34 // is valid in that thread context only. |
|
35 |
|
36 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
37 TBool visible = (TBool)isActive; |
|
38 |
|
39 TInt error = eventSource->ExecuteTrap(&LocalSetContainerVisible, |
|
40 display, |
|
41 visible); |
|
42 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setContainerVisible -"); |
|
43 } |
|
44 |
|
45 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1setFullScreenMode |
|
46 (JNIEnv *, jobject, jint nativeDisplayHandle, jboolean isFullScreen) |
|
47 { |
|
48 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setFullScreenMode +"); |
|
49 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
50 TBool mode = (TBool)isFullScreen; |
|
51 display ->SetFullScreenL(mode); |
|
52 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setFullScreenMode -"); |
|
53 } |
|
54 |
|
55 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1setWindowToNative |
|
56 (JNIEnv *, jobject,jint nativeDisplayHandle, jint qtWidgetHandle) |
|
57 { |
|
58 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setWindowToNative + "); |
|
59 QWidget *widget = reinterpret_cast<QWidget*>(qtWidgetHandle); |
|
60 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
61 display->SetWindowResources(widget); |
|
62 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setWindowToNative - "); |
|
63 } |
|
64 |
|
65 |
|
66 /* |
|
67 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1nativeDummy |
|
68 (JNIEnv *, jobject,) |
|
69 { |
|
70 */ |
|
71 |
|
72 LOCAL_C void LocalSourceSizeChanged(CMMADisplay* display,TInt width,TInt height) |
|
73 { |
|
74 display->SourceSizeChanged(width,height); |
|
75 } |
|
76 |
|
77 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1setNativeWindowSize |
|
78 (JNIEnv *, jobject,jint nativeDisplayHandle, jint aEventSourceHandle, jint eswtControlwidth,jint eswtControlheight) |
|
79 { |
|
80 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setNativeWindowSize + "); |
|
81 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
82 TInt width = eswtControlwidth; |
|
83 TInt height = eswtControlheight; |
|
84 MMAFunctionServer* eventSource = reinterpret_cast<MMAFunctionServer *>(aEventSourceHandle); |
|
85 // need to call in Function server thread context because CMMADisplay's JNI pointer |
|
86 // is valid in that thread context only. |
|
87 TInt error = eventSource->ExecuteTrap(&LocalSourceSizeChanged, |
|
88 display, |
|
89 width, |
|
90 height); |
|
91 |
|
92 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : setNativeWindowSize - "); |
|
93 } |
|
94 |
|
95 LOCAL_C void LocalSetDisplayPosition(CMMADisplay* display,TInt uiX,TInt uiY,TInt vcX,TInt vcY) |
|
96 { |
|
97 display->SetDisplayPosition(uiX,uiY,vcX,vcY); |
|
98 } |
|
99 |
|
100 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1setPosition |
|
101 (JNIEnv *, jobject,jint nativeDisplayHandle,jint aEventSourceHandle,jint uiX,jint uiY,jint vcX,jint vcY) |
|
102 { |
|
103 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : _setPosition + "); |
|
104 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
105 TInt uiControlLocationX = uiX; |
|
106 TInt uiControlLocationY = uiY; |
|
107 TInt videoControlLocationX = vcX; |
|
108 TInt videoControlLocationY = vcY; |
|
109 MMAFunctionServer* eventSource = reinterpret_cast<MMAFunctionServer *>(aEventSourceHandle); |
|
110 // need to call in Function server thread context because CMMADisplay's JNI pointer |
|
111 // is valid in that thread context only. |
|
112 TInt error = eventSource->ExecuteTrap(&LocalSetDisplayPosition, |
|
113 display, |
|
114 uiControlLocationX, |
|
115 uiControlLocationY, |
|
116 videoControlLocationX, |
|
117 videoControlLocationY); |
|
118 |
|
119 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : _setPosition - "); |
|
120 } |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 LOCAL_C void LocalSetDisplaySize(CMMADisplay* display,TInt vcX,TInt vcY) |
|
126 { |
|
127 LOG2(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : LocalSetDisplaySize vcX = %d,vcY=%d ",vcX,vcY); |
|
128 TSize size(vcX,vcY); |
|
129 display->SetDisplaySizeL(size); |
|
130 } |
|
131 |
|
132 JNIEXPORT void JNICALL Java_com_nokia_microedition_media_control_MMACanvasDisplay__1setDisplaySize |
|
133 (JNIEnv *, jobject,jint nativeDisplayHandle,jint aEventSourceHandle,jint width,jint height) |
|
134 { |
|
135 LOG2(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : _setDisplaySize + width = %d,height = %d",width,height); |
|
136 CMMADisplay* display = reinterpret_cast<CMMADisplay*>(nativeDisplayHandle); |
|
137 TInt vc_width = width; |
|
138 TInt vc_height = height; |
|
139 MMAFunctionServer* eventSource = reinterpret_cast<MMAFunctionServer *>(aEventSourceHandle); |
|
140 // need to call in Function server thread context because CMMADisplay's JNI pointer |
|
141 // is valid in that thread context only. |
|
142 LOG2(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : _setDisplaySize + vc_width = %d,vc_height = %d",vc_width,vc_height); |
|
143 TInt error = eventSource->ExecuteTrap(&LocalSetDisplaySize, |
|
144 display, |
|
145 vc_width, |
|
146 vc_height); |
|
147 |
|
148 LOG(EJavaMMAPI,EInfo,"JNI_canvasdisplay.cpp : _setDisplaySize - "); |
|
149 } |
|