From 972dc59b6fb1af69c79fd7c0d1ed1342e2f0c9b3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 5 Sep 2014 04:25:24 +0200 Subject: m + add toString for classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libgamma/CRTCInformation.java | 54 +++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 5 deletions(-) (limited to 'src/libgamma/CRTCInformation.java') diff --git a/src/libgamma/CRTCInformation.java b/src/libgamma/CRTCInformation.java index 1093357..532e984 100644 --- a/src/libgamma/CRTCInformation.java +++ b/src/libgamma/CRTCInformation.java @@ -203,11 +203,11 @@ public class CRTCInformation this.gamma_size_error = make_error(ints[12]); this.gamma_depth = (short)(ints[13]); this.gamma_depth_error = make_error(ints[14]); - this.gamma_support = ints[15]; + this.gamma_support = ints[15] != 0; this.gamma_support_error = make_error(ints[16]); this.subpixel_order = SubpixelOrder.VALUES[ints[17]]; this.subpixel_order_error = make_error(ints[18]); - this.active = ints[19]; + this.active = ints[19] != 0; this.active_error = make_error(ints[20]); this.connector_name_error = make_error(ints[21]); this.connector_type = ConnectorType.VALUES[ints[22]]; @@ -371,9 +371,9 @@ public class CRTCInformation /** - * Non-zero gamma ramp adjustments are supported. + * Whether gamma ramp adjustments are supported. */ - public final int gamma_support; + public final boolean gamma_support; /** * Error that occurred when fetching the value for @@ -399,7 +399,7 @@ public class CRTCInformation /** * Whether there is a monitors connected to the CRTC. */ - public final int active; + public final boolean active; /** * Error that occurred when fetching the value for @@ -481,6 +481,50 @@ public class CRTCInformation public final boolean has_error; + /** + * {@inheritDoc} + */ + public String toString() + { + String depth_str = Integer.toString(this.gamma_depth); + if (this.gamma_depth == -1) depth_str = "float"; + if (this.gamma_depth == -1) depth_str = "double"; + + return ""; + } + + /** * Convert a raw representation of an EDID to a lowercase hexadecimal representation. -- cgit v1.2.3-70-g09d2