javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/control/BaseDisplay.java
changeset 26 dc7c549001d5
parent 23 98ccebc37403
child 47 f40128debb5d
--- a/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/control/BaseDisplay.java	Fri May 14 15:47:24 2010 +0300
+++ b/javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/control/BaseDisplay.java	Thu May 27 12:49:31 2010 +0300
@@ -21,134 +21,151 @@
 import org.eclipse.swt.widgets.*;
 import javax.microedition.lcdui.*;
 import org.eclipse.swt.graphics.Rectangle;
-
+import com.nokia.mj.impl.utils.Logger;
+import com.nokia.microedition.media.control.VideoItem;
 
 public abstract class BaseDisplay
 {
-	// represents native side of display and initialized by derived class
-	protected int nativeDisplayHandle;
-	protected org.eclipse.swt.widgets.Control eswtCanvasControl;
-	private Rectangle rect;
-	private int[] rectDimension = new int[ 4 ];
-	public BaseDisplay()
+    // represents native side of display and initialized by derived class
+    protected int nativeDisplayHandle;
+    protected org.eclipse.swt.widgets.Control eswtCanvasControl;
+    private Rectangle rect;
+    private int[] rectDimension = new int[ 4 ];
+    public BaseDisplay()
+    {
+        rect = new Rectangle(0,0,0,0);
+    }
+    /*  protected void setESWTControl()
+        {
+            eswtCanvasControl =
+        }
+        */
+    public void GetCallbackInUiThread(int aPlaceHolder)
     {
-    	rect = new Rectangle(0,0,0,0);
-   	}
-/*	protected void setESWTControl()
-	{
-		eswtCanvasControl =
-	}
-	*/
- 	public void GetCallbackInUiThread(int placeholder)
-	{
-		System.out.println("inside BaseDisplay : GetCallbackInUiThread +");
-		final int val = placeholder;
-		try{
-			final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
-			disp.syncExec(new Runnable() {
-			 public void run() {
-			  			  _nativeMethodCallInUiThread(nativeDisplayHandle , val);
-	 			             }
-						 });
-		   }
-		 catch(Exception e)
-		 {
-			System.out.println("inside BaseDisplay : GetCallbackInUiThread....exception is " + e.toString());
-		 }
-		System.out.println("inside BaseDisplay : GetCallbackInUiThread -");
-	}
-	
-	public void setContentBound()
-	{
-		System.out.println("inside BaseDisplay : setContentBound +");
-		try{
+        Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"_+inside BaseDisplay : GetCallbackInUiThread");
+        final int val = aPlaceHolder;
+        Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"_+inside BaseDisplay : GetCallbackInUiThread - aPlaceHolder = "+aPlaceHolder+"nativeDisplayHandle = "+nativeDisplayHandle);
+        try
+        {
+            final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
+            Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"_+inside BaseDisplay : GetCallbackInUiThread - got eswtdisplay");
+            disp.syncExec(new Runnable()
+            {
+                public void run()
+                {
+                    Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"_+inside BaseDisplay - before __nativeMethodCallInUiThread");
+                    _nativeMethodCallInUiThread(nativeDisplayHandle , val);
+                }
+            });
+        }
+        catch (Exception e)
+        {
+            Logger.LOG(Logger.EJavaMMAPI,Logger.EInfo,"inside BaseDisplay : GetCallbackInUiThread....exception is " + e.toString());
+        }
 
-			final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
-			disp.syncExec(new Runnable() {
-			 public void run() {
-			  eswtCanvasControl.setBounds(rect);
-			      }
-						 });
-		   }
-		 catch(Exception e)
-		 {
-			System.out.println("inside BaseDisplay : setContentBound....exception is  " + e.toString());
-		 }
-		 System.out.println("inside BaseDisplay : setContentBound -");
-	}
+    }
+
+    public void setContentBound()
+    {
+        System.out.println("inside BaseDisplay : setContentBound +");
+        try
+        {
+
+            final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
+            disp.syncExec(new Runnable()
+            {
+                public void run()
+                {
+                    eswtCanvasControl.setBounds(rect);
+                }
+            });
+        }
+        catch (Exception e)
+        {
+            System.out.println("inside BaseDisplay : setContentBound....exception is  " + e.toString());
+        }
+        System.out.println("inside BaseDisplay : setContentBound -");
+    }
 
 
-	public void removeContentBound()
-	{
-		System.out.println("inside BaseDisplay : removeContentBound +");
-		try{
+    public void removeContentBound()
+    {
+        System.out.println("inside BaseDisplay : removeContentBound +");
+        try
+        {
 
-			final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
-			disp.syncExec(new Runnable() {
-			 public void run() {
-			 	Rectangle emptyRect = new Rectangle(0,0,0,0);
-			  eswtCanvasControl.setBounds(emptyRect);
-			      }
-						 });
-		   }
-		 catch(Exception e)
-		 {
-			System.out.println("inside BaseDisplay : removeContentBound....exception is  " + e.toString());
-		 }
-		 System.out.println("inside BaseDisplay : removeContentBound -");
-	}
-	
-	public void redrawControl()
-	{
-		System.out.println("inside BaseDisplay : redrawControl +");
-		try{
+            final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
+            disp.syncExec(new Runnable()
+            {
+                public void run()
+                {
+                    Rectangle emptyRect = new Rectangle(0,0,0,0);
+                    eswtCanvasControl.setBounds(emptyRect);
+                }
+            });
+        }
+        catch (Exception e)
+        {
+            System.out.println("inside BaseDisplay : removeContentBound....exception is  " + e.toString());
+        }
+        System.out.println("inside BaseDisplay : removeContentBound -");
+    }
+
+    public void redrawControl()
+    {
+        System.out.println("inside BaseDisplay : redrawControl +");
+        try
+        {
 
-			final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
-			disp.syncExec(new Runnable() {
-			 public void run() {
-			 				// redraw entire bounds of receiver
-			 			  eswtCanvasControl.redraw();
-			      }
-						 });
-		   }
-		 catch(Exception e)
-		 {
-			System.out.println("inside BaseDisplay : redrawControl....exception is  " + e.toString());
-		 }
-		 System.out.println("inside BaseDisplay : redrawControl -");
-	}
-		/* called from native to reset the java side rect
-	 Before the call of this function array is updated from native side
-	 which can be used to refresh the UI screen rect and/or 
-	 set/remove bound rect
-	*/
-	public void setRect()
-	{
-		
-			rect.x = rectDimension[0];
-			rect.y = rectDimension[1];
-			rect.width = rectDimension[2];
-			rect.height = rectDimension[3];
-			
-		System.out.println("BaseDisplay : setRect rect is reset with values: x =" + rect.x +"y ="+ rect.y +"width ="+rect.width+"height = "+ rect.height);	
-			
-	}
+            final org.eclipse.swt.widgets.Display disp = com.nokia.mj.impl.nokialcdui.LCDUIInvoker.getEswtDisplay();
+            disp.syncExec(new Runnable()
+            {
+                public void run()
+                {
+                    // redraw entire bounds of receiver
+                    eswtCanvasControl.redraw();
+                }
+            });
+        }
+        catch (Exception e)
+        {
+            System.out.println("inside BaseDisplay : redrawControl....exception is  " + e.toString());
+        }
+        System.out.println("inside BaseDisplay : redrawControl -");
+    }
+    /* called from native to reset the java side rect
+       Before the call of this function array is updated from native side
+       which can be used to refresh the UI screen rect and/or
+       set/remove bound rect
+      */
+    public void setRect()
+    {
 
-	// abstract functions implemented by concrete class
-	protected abstract void setDisplaySize(int aWidth, int aHeight);
-	protected abstract void setDisplayFullScreen(final boolean aFullScreenMode);
-	protected abstract void setDisplayLocation(int aX, int aY);
-	protected abstract void setVisible(boolean aVisible);
-	protected abstract int getDisplayHeight();
-	protected abstract int getDisplayWidth();
-	protected abstract int getDisplayX();
-	protected abstract int getDisplayY();
-	protected abstract int getSourceWidth();
-	protected abstract int getSourceHeight();
-	protected abstract void getBoundRect();
-	protected abstract void setWindowResources();
-	protected abstract void setNativeHandle(int handle);
+        rect.x = rectDimension[0];
+        rect.y = rectDimension[1];
+        rect.width = rectDimension[2];
+        rect.height = rectDimension[3];
+
+        System.out.println("BaseDisplay : setRect rect is reset with values: x =" + rect.x +"y ="+ rect.y +"width ="+rect.width+"height = "+ rect.height);
+
+    }
+
+    // abstract functions implemented by concrete class
+    protected abstract void setDisplaySize(int aWidth, int aHeight);
+    protected abstract void setDisplayFullScreen(final boolean aFullScreenMode);
+    protected abstract void setDisplayLocation(int aX, int aY);
+    protected abstract void setVisible(boolean aVisible);
+    protected abstract int getDisplayHeight();
+    protected abstract int getDisplayWidth();
+    protected abstract int getDisplayX();
+    protected abstract int getDisplayY();
+    protected abstract int getSourceWidth();
+    protected abstract int getSourceHeight();
+    protected abstract void getBoundRect();
+    protected abstract void setWindowResources(VideoItem aVideoItem);
+    protected abstract void setNativeHandle(int handle);
+    public abstract void setContainerVisibilityToNative(final boolean active);
     // Native methods
-	 private native void _nativeMethodCallInUiThread(int nativeDisplayHandle , int placeholder);
+    private native void _nativeMethodCallInUiThread(int nativeDisplayHandle , int placeholder);
 
 }