From 11d850fb5faa6fd130912dfea9eef4336acc7649 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 17 Jul 2024 23:35:32 +0200 Subject: Update for libgamma 0.7.4 and fix bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libgamma/AdjustmentMethod.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libgamma') diff --git a/libgamma/AdjustmentMethod.java b/libgamma/AdjustmentMethod.java index 7d53090..4c87658 100644 --- a/libgamma/AdjustmentMethod.java +++ b/libgamma/AdjustmentMethod.java @@ -147,9 +147,12 @@ public enum AdjustmentMethod * * @return The capabilities of the adjustment method */ - public AdjustmentMethodCapabilities get_capabilities() + public AdjustmentMethodCapabilities get_capabilities() throws LibgammaException { - return new AdjustmentMethodCapabilities(libgamma_method_capabilities(this.value)); + long[] r = libgamma_method_capabilities(this.value); + if (r[1] != 0) + throw new LibgammaException((int)(r[1])); + return new AdjustmentMethodCapabilities(r[0]); } @@ -202,9 +205,10 @@ public enum AdjustmentMethod * Return the capabilities of an adjustment method * * @param method The adjustment method (display server and protocol) - * @return Input parameter to the constructor of {@link AdjustmentMethodCapabilities} + * @return Element 0: Input parameter to the constructor of {@link AdjustmentMethodCapabilities} + * Eleemnt 1: Error code, zero on success */ - private static native long libgamma_method_capabilities(int method); + private static native long[] libgamma_method_capabilities(int method); /** * Return the default site for an adjustment method -- cgit v1.2.3-70-g09d2