From 2ee717bf2e8af6c56fd188d7ad78d74643500808 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 4 Sep 2014 22:16:29 +0200 Subject: preparation for automatic loading of the library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libgamma/AdjustmentMethod.java | 10 ++++++ src/libgamma/AdjustmentMethodCapabilities.java | 10 ++++++ src/libgamma/CRTC.java | 10 ++++++ src/libgamma/CRTCInformation.java | 10 ++++++ src/libgamma/ConnectorType.java | 11 +++++++ src/libgamma/GammaRamps.java | 10 ++++++ src/libgamma/Libgamma.java | 45 ++++++++++++++++++++++++++ src/libgamma/LibgammaException.java | 10 ++++++ src/libgamma/Partition.java | 10 ++++++ src/libgamma/Ramp.java | 10 ++++++ src/libgamma/Ramp16.java | 10 ++++++ src/libgamma/Rampd.java | 10 ++++++ src/libgamma/Site.java | 10 ++++++ src/libgamma/SubpixelOrder.java | 11 +++++++ 14 files changed, 177 insertions(+) create mode 100644 src/libgamma/Libgamma.java (limited to 'src/libgamma') diff --git a/src/libgamma/AdjustmentMethod.java b/src/libgamma/AdjustmentMethod.java index 7b98377..7805533 100644 --- a/src/libgamma/AdjustmentMethod.java +++ b/src/libgamma/AdjustmentMethod.java @@ -79,6 +79,16 @@ public enum AdjustmentMethod ; + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * The index of the last gamma method, neither it * nor any index before it may actually be supported diff --git a/src/libgamma/AdjustmentMethodCapabilities.java b/src/libgamma/AdjustmentMethodCapabilities.java index 167a081..4d8f353 100644 --- a/src/libgamma/AdjustmentMethodCapabilities.java +++ b/src/libgamma/AdjustmentMethodCapabilities.java @@ -23,6 +23,16 @@ package libgamma; */ public class AdjustmentMethodCapabilities { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/CRTC.java b/src/libgamma/CRTC.java index 77d7014..8fc1ec9 100644 --- a/src/libgamma/CRTC.java +++ b/src/libgamma/CRTC.java @@ -27,6 +27,16 @@ package libgamma; */ public class CRTC { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/CRTCInformation.java b/src/libgamma/CRTCInformation.java index 9da17f7..1093357 100644 --- a/src/libgamma/CRTCInformation.java +++ b/src/libgamma/CRTCInformation.java @@ -23,6 +23,16 @@ package libgamma; */ public class CRTCInformation { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * For a {@link CRTCInformation} fill in the values for {@link #edid} * and {@link #edid_length} and report errors to {@link #edid_error}. diff --git a/src/libgamma/ConnectorType.java b/src/libgamma/ConnectorType.java index 29e2dc4..cdb737c 100644 --- a/src/libgamma/ConnectorType.java +++ b/src/libgamma/ConnectorType.java @@ -127,6 +127,17 @@ public enum ConnectorType ; + + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Subpixel orders by their numerical values. */ diff --git a/src/libgamma/GammaRamps.java b/src/libgamma/GammaRamps.java index edbd490..895ea2e 100644 --- a/src/libgamma/GammaRamps.java +++ b/src/libgamma/GammaRamps.java @@ -34,6 +34,16 @@ package libgamma; */ public class GammaRamps { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/Libgamma.java b/src/libgamma/Libgamma.java new file mode 100644 index 0000000..66e9999 --- /dev/null +++ b/src/libgamma/Libgamma.java @@ -0,0 +1,45 @@ +/** + * jlibgamma — Display server abstraction layer for gamma ramp and Java + * Copyright © 2014 Mattias Andrée (maandree@member.fsf.org) + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this library. If not, see . + */ +package libgamma; + + +/** + * Library initialisation class. + */ +class Libgamma +{ + /** + * Initialise the library. + */ + static void initialise() + { + if (Libgamma.initialised) + return; + Libgamma.initialised = true; + + /* TODO load the library */ + } + + + /** + * Whether {@link #initialise} has been invoked. + */ + private static boolean initialised = false; + +} + diff --git a/src/libgamma/LibgammaException.java b/src/libgamma/LibgammaException.java index 8e623f2..79c41e8 100644 --- a/src/libgamma/LibgammaException.java +++ b/src/libgamma/LibgammaException.java @@ -31,6 +31,16 @@ package libgamma; @SuppressWarnings("serial") public class LibgammaException extends Exception { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * This error code is never used. It is only provided * so you know its error code if you plan to iterate diff --git a/src/libgamma/Partition.java b/src/libgamma/Partition.java index 407c2d6..e5022a8 100644 --- a/src/libgamma/Partition.java +++ b/src/libgamma/Partition.java @@ -32,6 +32,16 @@ package libgamma; */ public class Partition { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/Ramp.java b/src/libgamma/Ramp.java index a916e67..e3e7ec3 100644 --- a/src/libgamma/Ramp.java +++ b/src/libgamma/Ramp.java @@ -23,6 +23,16 @@ package libgamma; */ public abstract class Ramp { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/Ramp16.java b/src/libgamma/Ramp16.java index 9582286..cbf7ff0 100644 --- a/src/libgamma/Ramp16.java +++ b/src/libgamma/Ramp16.java @@ -23,6 +23,16 @@ package libgamma; */ public class Ramp16 extends Ramp { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/Rampd.java b/src/libgamma/Rampd.java index 9a7cf14..7f34eb4 100644 --- a/src/libgamma/Rampd.java +++ b/src/libgamma/Rampd.java @@ -23,6 +23,16 @@ package libgamma; */ public class Rampd extends Ramp { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/Site.java b/src/libgamma/Site.java index 9555656..7f52fa5 100644 --- a/src/libgamma/Site.java +++ b/src/libgamma/Site.java @@ -29,6 +29,16 @@ package libgamma; */ public class Site { + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Constructor. * diff --git a/src/libgamma/SubpixelOrder.java b/src/libgamma/SubpixelOrder.java index 1a74db7..9cc9efd 100644 --- a/src/libgamma/SubpixelOrder.java +++ b/src/libgamma/SubpixelOrder.java @@ -57,6 +57,17 @@ public enum SubpixelOrder ; + + /** + * Type initialiser. + */ + static + { + Libgamma.initialise(); + } + + + /** * Subpixel orders by their numerical values. */ -- cgit v1.2.3-70-g09d2