com.github.moaxcp.x11client.protocol.xproto.Segment 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.XStruct;
import java.io.IOException;
import java.lang.Override;
import lombok.Builder;
import lombok.Value;
@Value
@Builder
public class Segment implements XStruct {
private short x1;
private short y1;
private short x2;
private short y2;
public static Segment readSegment(X11Input in) throws IOException {
short x1 = in.readInt16();
short y1 = in.readInt16();
short x2 = in.readInt16();
short y2 = in.readInt16();
Segment.SegmentBuilder javaBuilder = Segment.builder();
javaBuilder.x1(x1);
javaBuilder.y1(y1);
javaBuilder.x2(x2);
javaBuilder.y2(y2);
return javaBuilder.build();
}
@Override
public void write(X11Output out) throws IOException {
out.writeInt16(x1);
out.writeInt16(y1);
out.writeInt16(x2);
out.writeInt16(y2);
}
@Override
public int getSize() {
return 8;
}
public static class SegmentBuilder {
public int getSize() {
return 8;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy