aboutsummaryrefslogtreecommitdiffstats
path: root/src/libgamma
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-09-04 06:14:41 +0200
committerMattias Andrée <maandree@operamail.com>2014-09-04 06:14:41 +0200
commitaf1bc54c34ceac22febcd819fc17ea64f8c7cbc7 (patch)
treefa3323109dbc70d8e2529ce6d8e709992723cd94 /src/libgamma
parentadd AdjustmentMethod (diff)
downloadjlibgamma-af1bc54c34ceac22febcd819fc17ea64f8c7cbc7.tar.gz
jlibgamma-af1bc54c34ceac22febcd819fc17ea64f8c7cbc7.tar.bz2
jlibgamma-af1bc54c34ceac22febcd819fc17ea64f8c7cbc7.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/libgamma/AdjustmentMethod.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libgamma/AdjustmentMethod.java b/src/libgamma/AdjustmentMethod.java
index c8efb40..7326076 100644
--- a/src/libgamma/AdjustmentMethod.java
+++ b/src/libgamma/AdjustmentMethod.java
@@ -93,6 +93,14 @@ public enum AdjustmentMethod
*/
public static final int COUNT = MAX + 1;
+ /**
+ * Adjustment methods by their numerical values.
+ */
+ public static AdjustmentMethod[] VALUES =
+ {
+ DUMMY, X_RANDR, X_VIDMODE, LINUX_DRM, W32_GDI, QUARTZ_CORE_GRAPHICS
+ };
+
/**
@@ -164,13 +172,7 @@ public enum AdjustmentMethod
int[] methods = libgamma_list_methods(operation);
AdjustmentMethod[] rc = new AdjustmentMethod[methods.length];
for (int i = 0; i < methods.length; i++)
- { if (methods[i] == DUMMY.value) rc[i] = DUMMY;
- else if (methods[i] == X_RANDR.value) rc[i] = X_RANDR;
- else if (methods[i] == X_VIDMODE.value) rc[i] = X_VIDMODE;
- else if (methods[i] == LINUX_DRM.value) rc[i] = LINUX_DRM;
- else if (methods[i] == W32_GDI.value) rc[i] = W32_GDI;
- else if (methods[i] == QUARTZ_CORE_GRAPHICS.value) rc[i] = QUARTZ_CORE_GRAPHICS;
- }
+ rc[i] = VALUES[methods[i]];
return rc;
}