// Path: jrdp/core/src/main/java/com/jrdp/core/remote/rdp/Cursor.java
// public class Cursor
// {
// 	private int [] img;
// 	private short width;
// 	private short height;
// 	private short hotspotX;
// 	private short hotspotY;
// 	
// 	public Cursor(int[] img, short width, short height, short hotspotX, short hotspotY)
// 	{
// 		this.img = img;
// 		this.width = width;
// 		this.height = height;
// 		this.hotspotX = hotspotX;
// 		this.hotspotY = hotspotY;
// 	}
// 	
// 	public int[] getCursorBitmap()
// 	{
// 		return img;
// 	}
// 	
// 	public short getWidth()
// 	{
// 		return width;
// 	}
// 	
// 	public short getHeight()
// 	{
// 		return height;
// 	}
// 	
// 	public short getHotspotX()
// 	{
// 		return hotspotX;
// 	}
// 	
// 	public short getHotspotY()
// 	{
// 		return hotspotY;
// 	}
// }
// 
// Path: jrdp/core/src/main/java/com/jrdp/core/remote/rdp/RemoteDesktopApplication.java
// public interface RemoteDesktopApplication
// {
// 	public void onScreenDimensionsChanged(int width, int height);
// 	public void onRemoteDimensionsChanged(int width, int height);
// 	public void onCursorChanged(int deltaX, int deltaY);
// 	public void onCursorSet(int x, int y);
// 	public void onCursorLeftClick();
// 	public void onSpecialKeyboardKey(short key);
// 	public void onKeyboardKey(char key);
// 	public void onRequestRemoteViewRefresh();
// 	public void requestDisconnect(boolean askUser);
// }


import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.os.Handler;
import com.jrdp.core.remote.rdp.Cursor;
import com.jrdp.core.remote.rdp.RemoteDesktopApplication;
	
	@Override
	public void draw(Canvas canvas)
	{
		super.draw(canvas);
		if(showCursor && cursor != null)
		{
			canvas.drawBitmap(cursor.getCursorBitmap(), 0, cursor.getWidth(), cursorX - cursor.getHotspotX(), 
					cursorY - cursor.getHotspotY(), cursor.getWidth(), cursor.getHeight(), true, null);
		}
	}
	
	@Override
	public void setCanvas(int[] img, int width, int height, int x, int y,
			int clippingWidth, int clippingHeight)
	{
		getBitmap().setPixels(img, 0, width, x, y, clippingWidth, clippingHeight);
		invalidate();
	}

	@Override
	public void setCanvasBottomUp(int[] img, int width, int height, int x,
			int y, int clippingWidth, int clippingHeight)
	{
		getBitmap().setPixels(img, width * (clippingHeight - 1), 
				-width, x, y, clippingWidth, clippingHeight);
		invalidate();
	}

	@Override
// Path: jrdp/core/src/main/java/com/jrdp/core/remote/rdp/Cursor.java
// public class Cursor
// {
// 	private int [] img;
// 	private short width;
// 	private short height;
// 	private short hotspotX;
// 	private short hotspotY;
// 	
// 	public Cursor(int[] img, short width, short height, short hotspotX, short hotspotY)
// 	{
// 		this.img = img;
// 		this.width = width;
// 		this.height = height;
// 		this.hotspotX = hotspotX;
// 		this.hotspotY = hotspotY;
// 	}
// 	
// 	public int[] getCursorBitmap()
// 	{
// 		return img;
// 	}
// 	
// 	public short getWidth()
// 	{
// 		return width;
// 	}
// 	
// 	public short getHeight()
// 	{
// 		return height;
// 	}
// 	
// 	public short getHotspotX()
// 	{
// 		return hotspotX;
// 	}
// 	
// 	public short getHotspotY()
// 	{
// 		return hotspotY;
// 	}
// }
// 
// Path: jrdp/core/src/main/java/com/jrdp/core/remote/rdp/RemoteDesktopApplication.java
// public interface RemoteDesktopApplication
// {
// 	public void onScreenDimensionsChanged(int width, int height);
// 	public void onRemoteDimensionsChanged(int width, int height);
// 	public void onCursorChanged(int deltaX, int deltaY);
// 	public void onCursorSet(int x, int y);
// 	public void onCursorLeftClick();
// 	public void onSpecialKeyboardKey(short key);
// 	public void onKeyboardKey(char key);
// 	public void onRequestRemoteViewRefresh();
// 	public void requestDisconnect(boolean askUser);
// }


// Path: jrdp/android/src/main/java/com/jrdp/client/android/AndroidCanvas.java
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.os.Handler;
import com.jrdp.core.remote.rdp.Cursor;
import com.jrdp.core.remote.rdp.RemoteDesktopApplication;

	
	@Override
	public void draw(Canvas canvas)
	{
		super.draw(canvas);
		if(showCursor && cursor != null)
		{
			canvas.drawBitmap(cursor.getCursorBitmap(), 0, cursor.getWidth(), cursorX - cursor.getHotspotX(), 
					cursorY - cursor.getHotspotY(), cursor.getWidth(), cursor.getHeight(), true, null);
		}
	}
	
	@Override
	public void setCanvas(int[] img, int width, int height, int x, int y,
			int clippingWidth, int clippingHeight)
	{
		getBitmap().setPixels(img, 0, width, x, y, clippingWidth, clippingHeight);
		invalidate();
	}

	@Override
	public void setCanvasBottomUp(int[] img, int width, int height, int x,
			int y, int clippingWidth, int clippingHeight)
	{
		getBitmap().setPixels(img, width * (clippingHeight - 1), 
				-width, x, y, clippingWidth, clippingHeight);
		invalidate();
	}

	@Override
	public void setCursor(Cursor cursor) {