20 import javax.microedition.media.Player; |
20 import javax.microedition.media.Player; |
21 import javax.microedition.media.MediaException; |
21 import javax.microedition.media.MediaException; |
22 import javax.microedition.lcdui.Canvas; |
22 import javax.microedition.lcdui.Canvas; |
23 import javax.microedition.lcdui.Display; |
23 import javax.microedition.lcdui.Display; |
24 import javax.microedition.midlet.MIDlet; |
24 import javax.microedition.midlet.MIDlet; |
|
25 import javax.microedition.lcdui.Item; |
25 import com.nokia.microedition.media.NativeError; |
26 import com.nokia.microedition.media.NativeError; |
26 |
27 |
27 //import com.symbian.midp.runtime.MIDletExecutor; |
28 //import com.symbian.midp.runtime.MIDletExecutor; |
28 import com.nokia.mj.impl.media.PlayerPermission; |
29 import com.nokia.mj.impl.media.PlayerPermission; |
29 import com.nokia.mj.impl.rt.support.ApplicationUtils; |
30 import com.nokia.mj.impl.rt.support.ApplicationUtils; |
105 // Needed for getting native handle from lcdui components |
107 // Needed for getting native handle from lcdui components |
106 //com.symbian.midp.runtime.ToolkitInvoker iToolkitInvoker; |
108 //com.symbian.midp.runtime.ToolkitInvoker iToolkitInvoker; |
107 |
109 |
108 private VideoItem iVideoItem; |
110 private VideoItem iVideoItem; |
109 private Canvas iVideoCanvas; |
111 private Canvas iVideoCanvas; |
110 |
112 private Item iItem ; |
111 BaseDisplay display; |
113 |
|
114 BaseDisplay iDisplay; |
112 // private MIDletInstance iMIDletInstance; |
115 // private MIDletInstance iMIDletInstance; |
113 |
116 |
114 // error code used asynchronous native calls |
117 // error code used asynchronous native calls |
115 private int iError; |
118 private int iError; |
116 |
119 |
117 // used in asynchronous getSnapshot method |
120 // used in asynchronous getSnapshot method |
118 private byte[] iImageData; |
121 private byte[] iImageData; |
119 private int iToolkitHandle = 0; |
|
120 |
122 |
121 // toolkit, stored as object as we don't have access to Toolkit class. |
123 // toolkit, stored as object as we don't have access to Toolkit class. |
122 private Object iToolkit; |
124 private Object iToolkit; |
123 // for midlet foreground statelistening |
125 // for midlet foreground statelistening |
124 //ToolkitInvoker iTlkitInvoker; |
126 //ToolkitInvoker iTlkitInvoker; |
159 public void setHandles(Player aPlayer, int aEventSource, int aControlHandle) |
161 public void setHandles(Player aPlayer, int aEventSource, int aControlHandle) |
160 { |
162 { |
161 iPlayer = aPlayer; |
163 iPlayer = aPlayer; |
162 iEventSource = aEventSource; |
164 iEventSource = aEventSource; |
163 iControlHandle = aControlHandle; |
165 iControlHandle = aControlHandle; |
164 iToolkitHandle = 0; // TODO: remove once implementation is done. |
|
165 int error = _construct(iControlHandle, |
166 int error = _construct(iControlHandle, |
166 aEventSource, |
167 aEventSource); |
167 iToolkitHandle); |
|
168 |
168 |
169 NativeError.check(error); |
169 NativeError.check(error); |
170 } |
170 } |
171 |
171 |
172 /** |
172 /** |
173 * from Interface VideoControl |
173 * from Interface VideoControl |
174 * |
174 * |
175 */ |
175 */ |
176 public void setDisplaySize(int aWidth, int aHeight) throws MediaException |
176 public void setDisplaySize(int aWidth, int aHeight) throws MediaException |
177 { |
177 { |
178 // checkState(); |
178 checkState(); |
179 |
|
180 if (iStatus == NOT_INITIALIZED) |
179 if (iStatus == NOT_INITIALIZED) |
181 { |
180 { |
182 throw new IllegalStateException( |
181 throw new IllegalStateException( |
183 "VideoControl.initDisplayMode() not called yet"); |
182 "VideoControl.initDisplayMode() not called yet"); |
184 } |
183 } |
188 "Width and height must be positive"); |
187 "Width and height must be positive"); |
189 } |
188 } |
190 |
189 |
191 |
190 |
192 |
191 |
193 System.out.println("before display.setDisplaySize()"); |
192 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"inside setDisplaySize()"); |
194 |
193 |
195 |
194 |
196 //canvasdisplay.setDisplaySize( aWidth, aHeight); |
195 //canvasdisplay.setDisplaySize( aWidth, aHeight); |
197 display.setDisplaySize( aWidth, aHeight); |
196 iDisplay.setDisplaySize(aWidth, aHeight); |
198 |
197 |
199 System.out.println("after display.setDisplaySize()"); |
|
200 /* |
198 /* |
201 int ret = setDisplayProperty(aWidth, aHeight, SET_DISPLAY_SIZE); |
199 int ret = setDisplayProperty(aWidth, aHeight, SET_DISPLAY_SIZE); |
202 if (ret < 0) |
200 if (ret < 0) |
203 { |
201 { |
204 throw new MediaException("setDisplaySize() failed, SymbianOS error: " |
202 throw new MediaException("setDisplaySize() failed, SymbianOS error: " |
240 { |
238 { |
241 throw new MediaException(); |
239 throw new MediaException(); |
242 } |
240 } |
243 |
241 |
244 */ |
242 */ |
245 System.out.println("inside setDisplayFullScreen()"); |
243 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"inside setDisplayFullScreen()"); |
246 //canvasdisplay.setDisplayFullScreen( aFullScreenMode); |
244 //canvasdisplay.setDisplayFullScreen( aFullScreenMode); |
247 display.setDisplayFullScreen( aFullScreenMode); |
245 iDisplay.setDisplayFullScreen(aFullScreenMode); |
248 |
246 |
249 |
247 |
250 } |
248 } |
251 |
249 |
252 /** |
250 /** |
253 * from Interface VideoControl |
251 * from Interface VideoControl |
254 * |
252 * |
255 */ |
253 */ |
256 public void setDisplayLocation(int aX, int aY) |
254 public void setDisplayLocation(int aX, int aY) |
257 { |
255 { |
258 // checkState(); |
256 // checkState(); |
259 System.out.println("VideoControl.java :: setDisplayLocation x, y = " + aX + ","+ aY); |
257 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"VideoControl.java :: setDisplayLocation x, y = " + aX + ","+ aY); |
260 if (iStatus == USE_GUI_PRIMITIVE) |
258 if (iStatus == USE_GUI_PRIMITIVE) |
261 { |
259 { |
262 // In USE_GUI_PRIMITIVE mode, this call will be ignored. |
260 // In USE_GUI_PRIMITIVE mode, this call will be ignored. |
263 return; |
261 return; |
264 } |
262 } |
265 if (iStatus != USE_DIRECT_VIDEO) |
263 if (iStatus != USE_DIRECT_VIDEO) |
266 { |
264 { |
267 // This method only works when the USE_DIRECT_VIDEO mode is set. |
265 // This method only works when the USE_DIRECT_VIDEO mode is set. |
268 throw new IllegalStateException(); |
266 throw new IllegalStateException(); |
269 } |
267 } |
270 /* |
268 /* |
271 // cannot fail -> ignore return value |
269 // cannot fail -> ignore return value |
272 setDisplayProperty(aX, aY, SET_DISPLAY_LOCATION); |
270 setDisplayProperty(aX, aY, SET_DISPLAY_LOCATION); |
273 */ |
271 */ |
274 |
272 |
275 System.out.println("inside setDisplayLocation()"); |
273 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"inside setDisplayLocation()"); |
276 //canvasdisplay.setDisplayLocation( aX , aY); |
274 //canvasdisplay.setDisplayLocation( aX , aY); |
277 display.setDisplayLocation( aX , aY); |
275 iDisplay.setDisplayLocation(aX , aY); |
278 |
276 |
279 } |
277 } |
280 |
278 |
281 /** |
279 /** |
282 * from Interface VideoControl |
280 * from Interface VideoControl |
283 * |
281 * |
284 */ |
282 */ |
285 public void setVisible(boolean aVisible) |
283 public void setVisible(boolean aVisible) |
286 { |
284 { |
287 // checkState(); |
285 // checkState(); |
288 if (iStatus == NOT_INITIALIZED) |
286 if (iStatus == NOT_INITIALIZED) |
289 { |
287 { |
290 throw new IllegalStateException( |
288 throw new IllegalStateException( |
291 "VideoControl.initDisplayMode() not called yet"); |
289 "VideoControl.initDisplayMode() not called yet"); |
292 } |
290 } |
303 // cannot fail -> ignore return value |
301 // cannot fail -> ignore return value |
304 setDisplayProperty(SET_DISPLAY_VISIBLE_FALSE); |
302 setDisplayProperty(SET_DISPLAY_VISIBLE_FALSE); |
305 } |
303 } |
306 */ |
304 */ |
307 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
305 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
308 " before display.setVisible()"); |
306 " before iDisplay.setVisible()"); |
309 System.out.println("inside setVisible()"); |
307 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"inside setVisible()"); |
310 if(aVisible) |
308 // canvasdisplay.setVisible( aVisible ); |
311 { |
309 iDisplay.setVisible(aVisible); |
312 // set the Midlet BG/FG status to native |
|
313 updateForeground(); |
|
314 } |
|
315 display.setVisible( aVisible ); |
|
316 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
310 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
317 "after display.setVisible()"); |
311 "after iDisplay.setVisible()"); |
318 |
312 |
319 |
313 |
320 |
314 |
321 } |
315 } |
322 |
316 |
323 /** |
317 /** |
324 * from Interface VideoControl |
318 * from Interface VideoControl |
325 * |
319 * |
326 */ |
320 */ |
327 public int getDisplayWidth() |
321 public int getDisplayWidth() |
328 {/* |
322 { |
|
323 /* |
|
324 checkState(); |
|
325 if (iStatus == NOT_INITIALIZED) |
|
326 { |
|
327 throw new IllegalStateException( |
|
328 "VideoControl.initDisplayMode() not called yet"); |
|
329 } |
|
330 int width = getControlProperty(PROPERTY_DISPLAY_WIDTH); |
|
331 return width; |
|
332 */ |
|
333 //return canvasdisplay.getDisplayWidth( ); |
|
334 return iDisplay.getDisplayWidth(); |
|
335 } |
|
336 |
|
337 /** |
|
338 * from Interface VideoControl |
|
339 * |
|
340 */ |
|
341 public int getDisplayHeight() |
|
342 { |
|
343 /* checkState(); |
|
344 if (iStatus == NOT_INITIALIZED) |
|
345 { |
|
346 throw new IllegalStateException( |
|
347 "VideoControl.initDisplayMode() not called yet"); |
|
348 } |
|
349 int height = getControlProperty(PROPERTY_DISPLAY_HEIGHT); |
|
350 return height; |
|
351 |
|
352 */ |
|
353 return iDisplay.getDisplayHeight(); |
|
354 } |
|
355 |
|
356 /** |
|
357 * from Interface VideoControl |
|
358 * |
|
359 */ |
|
360 public int getDisplayX() |
|
361 { |
|
362 /* checkState(); |
|
363 if (iStatus == NOT_INITIALIZED) |
|
364 { |
|
365 return UNDEFINED_RETURN_VALUE; |
|
366 } |
|
367 int x = getControlProperty(PROPERTY_DISPLAY_X); |
|
368 return x; |
|
369 */ |
|
370 return iDisplay.getDisplayX(); |
|
371 } |
|
372 |
|
373 /** |
|
374 * from Interface VideoControl |
|
375 * |
|
376 */ |
|
377 public int getDisplayY() |
|
378 { |
|
379 /* |
329 checkState(); |
380 checkState(); |
330 if (iStatus == NOT_INITIALIZED) |
381 if (iStatus == NOT_INITIALIZED) |
331 { |
382 { |
332 throw new IllegalStateException( |
|
333 "VideoControl.initDisplayMode() not called yet"); |
|
334 } |
|
335 int width = getControlProperty(PROPERTY_DISPLAY_WIDTH); |
|
336 return width; |
|
337 */ |
|
338 //return canvasdisplay.getDisplayWidth( ); |
|
339 return display.getDisplayWidth( ); |
|
340 } |
|
341 |
|
342 /** |
|
343 * from Interface VideoControl |
|
344 * |
|
345 */ |
|
346 public int getDisplayHeight() |
|
347 { |
|
348 /* checkState(); |
|
349 if (iStatus == NOT_INITIALIZED) |
|
350 { |
|
351 throw new IllegalStateException( |
|
352 "VideoControl.initDisplayMode() not called yet"); |
|
353 } |
|
354 int height = getControlProperty(PROPERTY_DISPLAY_HEIGHT); |
|
355 return height; |
|
356 |
|
357 */ |
|
358 return display.getDisplayHeight( ); |
|
359 } |
|
360 |
|
361 /** |
|
362 * from Interface VideoControl |
|
363 * |
|
364 */ |
|
365 public int getDisplayX() |
|
366 { |
|
367 /* checkState(); |
|
368 if (iStatus == NOT_INITIALIZED) |
|
369 { |
|
370 return UNDEFINED_RETURN_VALUE; |
|
371 } |
|
372 int x = getControlProperty(PROPERTY_DISPLAY_X); |
|
373 return x; |
|
374 */ |
|
375 return display.getDisplayX( ); |
|
376 } |
|
377 |
|
378 /** |
|
379 * from Interface VideoControl |
|
380 * |
|
381 */ |
|
382 public int getDisplayY() |
|
383 { |
|
384 /* |
|
385 checkState(); |
|
386 if (iStatus == NOT_INITIALIZED) |
|
387 { |
|
388 return UNDEFINED_RETURN_VALUE; |
383 return UNDEFINED_RETURN_VALUE; |
389 } |
384 } |
390 int y = getControlProperty(PROPERTY_DISPLAY_Y); |
385 int y = getControlProperty(PROPERTY_DISPLAY_Y); |
391 return y; |
386 return y; |
392 |
387 |
393 */ |
388 */ |
394 return display.getDisplayY( ); |
389 return iDisplay.getDisplayY(); |
395 } |
390 } |
396 |
391 |
397 /** |
392 /** |
398 * from Interface VideoControl |
393 * from Interface VideoControl |
399 * |
394 * |
400 */ |
395 */ |
401 public int getSourceWidth() |
396 public int getSourceWidth() |
402 { |
397 { |
403 /* checkState(); |
398 /* checkState(); |
404 int width = getControlProperty(PROPERTY_SOURCE_WIDTH); |
399 int width = getControlProperty(PROPERTY_SOURCE_WIDTH); |
405 if (width <= 0) |
400 if (width <= 0) |
406 { |
401 { |
407 width = 1; |
402 width = 1; |
408 } |
403 } |
409 return width; |
404 return width; |
410 |
405 |
411 */ |
406 */ |
412 return display.getSourceWidth( ); |
407 return iDisplay.getSourceWidth(); |
413 } |
408 } |
414 |
409 |
415 /** |
410 /** |
416 * from Interface VideoControl |
411 * from Interface VideoControl |
417 * |
412 * |
514 { |
509 { |
515 guiObject = initDynamicDisplayMode(aArg); |
510 guiObject = initDynamicDisplayMode(aArg); |
516 } |
511 } |
517 } |
512 } |
518 |
513 |
|
514 //iItem = (Item)aArg; |
|
515 |
|
516 if (iVideoItem == null) |
|
517 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
|
518 "VideoControl : iVideoItem is null"); |
|
519 iDisplay = new ItemDisplay(iEventSource , iVideoItem); |
|
520 |
|
521 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
|
522 "VideoControl : creation of ItemDisplay"); |
|
523 |
|
524 int handle = initNativeDisplay(iVideoItem, iDisplay, true); |
|
525 // here actual listener is added to iDisplay |
|
526 iDisplay.setNativeHandle(handle); |
|
527 iVideoItem.setNativeHandle(handle); |
|
528 // Window resource initialization is done to the native video player |
|
529 //iDisplay.setWindowResources(); |
|
530 |
|
531 |
519 iStatus = USE_GUI_PRIMITIVE; |
532 iStatus = USE_GUI_PRIMITIVE; |
520 return guiObject; |
533 return guiObject; |
521 } |
534 } |
522 else if (aMode == USE_DIRECT_VIDEO) |
535 else if (aMode == USE_DIRECT_VIDEO) |
523 { |
536 { |
533 { |
546 { |
534 throw new java.lang.IllegalArgumentException( |
547 throw new java.lang.IllegalArgumentException( |
535 "For USE_DIRECT_VIDEO mode argument should not be null"); |
548 "For USE_DIRECT_VIDEO mode argument should not be null"); |
536 } |
549 } |
537 iVideoCanvas = (Canvas)aArg; |
550 iVideoCanvas = (Canvas)aArg; |
538 // MMAPI UI 3.x req. |
551 // MMAPI UI 3.x req. |
539 |
552 |
540 display = new MMACanvasDisplay(iEventSource , iVideoCanvas); |
553 iDisplay = new MMACanvasDisplay(iEventSource , iVideoCanvas); |
541 |
554 |
542 System.out.println("VideoControl.java: after eswt control got from canvas has added observer"); |
555 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"VideoControl.java: after eswt control got from canvas has added observer"); |
543 |
556 |
544 int handle = initNativeDisplay(iVideoCanvas, display); |
557 int handle = initNativeDisplay(iVideoCanvas, iDisplay, false); |
545 // here actual listener is added to display |
558 // here actual listener is added to iDisplay |
546 display.setNativeHandle(handle); |
559 iDisplay.setNativeHandle(handle); |
547 // Window resource initialization is done to the native video player |
560 // Window resource initialization is done to the native video player |
548 display.setWindowResources(); |
561 iDisplay.setWindowResources(null); |
549 iStatus = USE_DIRECT_VIDEO; |
562 iStatus = USE_DIRECT_VIDEO; |
550 |
563 |
551 /*( try |
564 /*( try |
552 { |
565 { |
553 this.setVisible(false); |
566 this.setVisible(false); |
554 } |
567 } |
555 |
568 |
556 catch (IllegalStateException ex) { } |
569 catch (IllegalStateException ex) { } |
557 */ |
570 */ |
558 return null; |
571 return null; |
559 } |
572 } |
560 else |
573 else |
561 { |
574 { |
562 // java.lang.IllegalArgumentException - Thrown if the mode is invalid. |
575 // java.lang.IllegalArgumentException - Thrown if the mode is invalid. |
563 throw new java.lang.IllegalArgumentException( |
576 throw new java.lang.IllegalArgumentException( |
564 "Mode not supported or invalid, " + |
577 "Mode not supported or invalid, " + |
565 "valid modes are USE_DIRECT_VIDEO and USE_GUI_PRIMITIVE"); |
578 "valid modes are USE_DIRECT_VIDEO and USE_GUI_PRIMITIVE"); |
566 } |
579 } |
567 } |
580 } |
568 |
581 |
569 /** |
582 /** |
570 * Called from java for early initialization of native handle to java peer |
583 * Called from java for early initialization of native handle to java peer |
571 * Because it will be used to make a jni call |
584 * Because it will be used to make a jni call |
572 */ |
585 */ |
573 public void setNativeDisplayHandleToJavaPeer(int handle) |
586 public void setNativeDisplayHandleToJavaPeer(int handle) |
574 { |
587 { |
575 System.out.println("VideoControl.java: setNativeDisplayHandleToJavaPeer handle =" + handle); |
588 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"VideoControl.java: setNativeDisplayHandleToJavaPeer handle =" + handle); |
576 display.setNativeHandle(handle); |
589 iDisplay.setNativeHandle(handle); |
577 } |
590 } |
578 |
591 |
579 /** |
592 /** |
580 * Initializes native display. |
593 * Initializes native display. |
581 * |
594 * |
582 */ |
595 */ |
583 private int initNativeDisplay(Object aGuiObject, Object mmadisplay) |
596 private int initNativeDisplay(Object aGuiObject, Object mmadisplay, boolean aGuiType) |
584 { |
597 { |
585 int handle = _initDisplayMode(iControlHandle, |
598 int handle = _initDisplayMode(iControlHandle, |
586 iEventSource, |
599 iEventSource, |
587 mmadisplay, |
600 mmadisplay, |
588 aGuiObject); |
601 aGuiObject, |
|
602 aGuiType); |
589 NativeError.check(handle); |
603 NativeError.check(handle); |
590 return handle; |
604 return handle; |
591 } |
605 } |
592 |
606 |
593 /** |
607 /** |
693 |
707 |
694 Object guiObject = guiFactory.initDisplayMode(); |
708 Object guiObject = guiFactory.initDisplayMode(); |
695 // initNativeDisplay return handle MMMADirectContainer, 0 parameter |
709 // initNativeDisplay return handle MMMADirectContainer, 0 parameter |
696 // indicates that dynamic display will be used |
710 // indicates that dynamic display will be used |
697 // MMAPI UI 3.x req. |
711 // MMAPI UI 3.x req. |
698 // guiFactory.setContentHandle(initNativeDisplay(guiObject, 0)); |
712 // guiFactory.setContentHandle(initNativeDisplay(guiObject, 0)); |
699 return guiObject; |
713 return guiObject; |
700 } |
714 } |
701 |
715 |
702 /** |
716 /** |
703 * Initializes LCDUI display mode. |
717 * Initializes LCDUI display mode. |
704 * @return LCDUI Item |
718 * @return LCDUI Item |
705 */ |
719 */ |
706 private Object initLCDUI() |
720 private Object initLCDUI() |
707 { |
721 { |
708 iVideoItem = new VideoItem(iEventSource); |
722 Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"+ VideoControl.java : initLCDUI() "); |
|
723 iVideoItem = new VideoItem(iEventSource,iPlayer); |
709 iPlayer.addPlayerListener(iVideoItem); |
724 iPlayer.addPlayerListener(iVideoItem); |
710 |
725 |
711 // MMAPI UI 3.x req. |
726 // MMAPI UI 3.x req. |
712 // int handle = initNativeDisplay(iVideoItem, |
727 // int handle = initNativeDisplay(iVideoItem, |
713 // 1 /*iToolkitInvoker.itemGetHandle(iVideoItem)*/); |
728 // 1 /*iToolkitInvoker.itemGetHandle(iVideoItem)*/); |
714 |
729 |
715 // iVideoItem.setNativeHandle(handle); |
730 // iVideoItem.setNativeHandle(handle); |
716 |
731 |
717 iStatus = USE_GUI_PRIMITIVE; |
732 iStatus = USE_GUI_PRIMITIVE; |
718 return iVideoItem; |
733 return iVideoItem; |
719 } |
734 } |
720 |
735 |
788 } |
803 } |
789 return guiObject; |
804 return guiObject; |
790 } |
805 } |
791 |
806 |
792 |
807 |
793 // private int updateForeground() // MMAPI UI 3.x changes |
808 // private int updateForeground() // MMAPI UI 3.x changes |
794 private void updateForeground() |
809 private void updateForeground() |
795 { |
810 { |
796 |
811 |
797 int isFG = 1; |
812 int isFG = 1; |
798 /* |
813 /* |
799 // Check whether display is initialized |
814 // Check whether display is initialized |
800 checkState(); |
815 checkState(); |
801 if (iStatus == NOT_INITIALIZED) |
816 if (iStatus == NOT_INITIALIZED) |
802 { |
817 { |
803 return visible; |
818 return visible; |
804 } |
819 } |
805 |
820 |
806 iMIDletInstance = MIDletExecutor.getCurrentMIDlet(); |
821 iMIDletInstance = MIDletExecutor.getCurrentMIDlet(); |
807 MIDlet midlet = iMIDletInstance.getMIDlet(); |
822 MIDlet midlet = iMIDletInstance.getMIDlet(); |
808 //Displayable displayable; |
823 //Displayable displayable; |
809 if (midlet == null) |
824 if (midlet == null) |
810 { |
825 { |
811 return visible; |
826 return visible; |
812 } |
827 } |
|
828 else |
|
829 { |
|
830 Displayable displayable = Display.getDisplay(midlet).getCurrent(); |
|
831 |
|
832 if (displayable != null && displayable.isShown()) |
|
833 { |
|
834 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
|
835 "VideoControl.updateForeground isShown() = 1"); |
|
836 // visible |
|
837 } |
|
838 else |
|
839 { |
|
840 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
|
841 "VideoControl.updateForeground isShown() = 0"); |
|
842 // not visible |
|
843 visible = 0; |
|
844 } |
|
845 |
|
846 // Set the foreground state |
|
847 _setForeground(iControlHandle, |
|
848 iEventSource, |
|
849 visible); |
|
850 } |
|
851 |
|
852 return visible; |
|
853 */ |
|
854 |
|
855 // MMAPI UI 3.x req. |
|
856 // Get the midlet position BG/FG |
|
857 boolean visible = ManagerImpl.getInstance().isForground(); |
|
858 if (visible) |
|
859 isFG = 1; |
813 else |
860 else |
814 { |
861 isFG = 0; |
815 Displayable displayable = Display.getDisplay(midlet).getCurrent(); |
|
816 |
|
817 if (displayable != null && displayable.isShown()) |
|
818 { |
|
819 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
|
820 "VideoControl.updateForeground isShown() = 1"); |
|
821 // visible |
|
822 } |
|
823 else |
|
824 { |
|
825 Logger.LOG(Logger.EJavaMMAPI, Logger.EInfo, |
|
826 "VideoControl.updateForeground isShown() = 0"); |
|
827 // not visible |
|
828 visible = 0; |
|
829 } |
|
830 |
|
831 // Set the foreground state |
|
832 _setForeground(iControlHandle, |
|
833 iEventSource, |
|
834 visible); |
|
835 } |
|
836 |
|
837 return visible; |
|
838 */ |
|
839 |
|
840 // MMAPI UI 3.x req. |
|
841 // Get the midlet position BG/FG |
|
842 boolean visible = ManagerImpl.getInstance().isForground(); |
|
843 if(visible) |
|
844 isFG = 1; |
|
845 else |
|
846 isFG = 0; |
|
847 |
862 |
848 _setForeground(iControlHandle, |
863 _setForeground(iControlHandle, |
849 iEventSource, |
864 iEventSource, |
850 isFG); |
865 isFG); |
851 // return visible; |
866 // return visible; |
852 } |
867 } |
853 |
868 |
854 private native int _construct(int aControlHandle, |
869 private native int _construct(int aControlHandle, |
855 int aEventSourceHandle, |
870 int aEventSourceHandle); |
856 int aToolkitHandle); |
|
857 |
871 |
858 private native int _getControlProperty(int aControlHandle, |
872 private native int _getControlProperty(int aControlHandle, |
859 int aEventSourceHandle, |
873 int aEventSourceHandle, |
860 int aPropertyType); |
874 int aPropertyType); |
861 |
875 |