com.github.moaxcp.x11client.protocol.xproto.CursorError Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of x11-client Show documentation
Show all versions of x11-client Show documentation
An x11 client implemented in java
package com.github.moaxcp.x11client.protocol.xproto;
import com.github.moaxcp.x11client.protocol.X11Input;
import com.github.moaxcp.x11client.protocol.X11Output;
import com.github.moaxcp.x11client.protocol.XError;
import java.io.IOException;
import java.lang.Override;
import lombok.Builder;
import lombok.Value;
@Value
@Builder
public class CursorError implements XError {
public static final byte CODE = 2;
private short sequenceNumber;
private int badValue;
private short minorOpcode;
private byte majorOpcode;
@Override
public byte getCode() {
return CODE;
}
public static CursorError readCursorError(X11Input in) throws IOException {
short sequenceNumber = in.readCard16();
int badValue = in.readCard32();
short minorOpcode = in.readCard16();
byte majorOpcode = in.readCard8();
in.readPad(1);
in.readPad(20);
CursorError.CursorErrorBuilder javaBuilder = CursorError.builder();
javaBuilder.sequenceNumber(sequenceNumber);
javaBuilder.badValue(badValue);
javaBuilder.minorOpcode(minorOpcode);
javaBuilder.majorOpcode(majorOpcode);
return javaBuilder.build();
}
@Override
public void write(X11Output out) throws IOException {
out.writeCard8(getResponseCode());
out.writeCard8(CODE);
out.writeCard16(sequenceNumber);
out.writeCard32(badValue);
out.writeCard16(minorOpcode);
out.writeCard8(majorOpcode);
out.writePad(1);
out.writePad(20);
}
@Override
public int getSize() {
return 32;
}
public static class CursorErrorBuilder {
public int getSize() {
return 32;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy