use of common.CopyRectOrder in project cloudstack by apache.
the class VncMessageHandler method handleCopyRect.
private boolean handleCopyRect(ByteBuffer buf, Link link, int x, int y, int width, int height) {
// We need 4 bytes with coordinates of source rectangle
if (!cap(buf, 4, UNLIMITED, link, true))
return false;
CopyRectOrder order = new CopyRectOrder();
order.srcX = buf.readUnsignedShort();
order.srcY = buf.readUnsignedShort();
order.x = x;
order.y = y;
order.width = width;
order.height = height;
if (verbose)
System.out.println("[" + this + "] INFO: Copy rect. X: " + x + ", y: " + y + ", width: " + width + ", height: " + height + ", srcX: " + order.srcX + ", srcY: " + order.srcY + ".");
pushDataToPad(PIXEL_ADAPTER_PAD, new ByteBuffer(order));
return true;
}
use of common.CopyRectOrder in project cloudstack by apache.
the class AwtCanvasAdapter method handleData.
@Override
public void handleData(ByteBuffer buf, Link link) {
if (verbose)
System.out.println("[" + this + "] INFO: Data received: " + buf + ".");
Order order = buf.getOrder();
switch((OrderType) order.type) {
case BITMAP_UPDATE:
handleBitmap((BitmapOrder) order, buf);
break;
case COPY_RECT:
handleCopyRect((CopyRectOrder) order, buf);
break;
default:
throw new RuntimeException("Order is not implemented: " + buf + ".");
}
buf.unref();
}
Aggregations