Search in sources :

Example 1 with CopyRectOrder

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;
}
Also used : CopyRectOrder(common.CopyRectOrder) ByteBuffer(streamer.ByteBuffer)

Example 2 with CopyRectOrder

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();
}
Also used : BitmapOrder(common.BitmapOrder) Order(streamer.Order) CopyRectOrder(common.CopyRectOrder) OrderType(common.OrderType)

Aggregations

CopyRectOrder (common.CopyRectOrder)2 BitmapOrder (common.BitmapOrder)1 OrderType (common.OrderType)1 ByteBuffer (streamer.ByteBuffer)1 Order (streamer.Order)1