aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-28 05:17:14 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-28 05:17:52 +0200
commit4e0dc2bed9493b2ae8b380e757da3a07757c3f78 (patch)
tree7dfd09268ae32e5acd0358c8bfd13b53f1587c26
parentadd LIBGAMMA_CONNECTOR_TYPE_COUNT, LIBGAMMA_SUBPIXEL_ORDER_COUNT and LIBGAMMA_CRTC_INFO_COUNT (diff)
downloadlibgamma-4e0dc2bed9493b2ae8b380e757da3a07757c3f78.tar.gz
libgamma-4e0dc2bed9493b2ae8b380e757da3a07757c3f78.tar.bz2
libgamma-4e0dc2bed9493b2ae8b380e757da3a07757c3f78.tar.xz
namespace some definitions
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rwxr-xr-xconfigure32
-rw-r--r--src/edid.c2
-rw-r--r--src/fake-quartz-cg.c6
-rw-r--r--src/fake-quartz-cg.h4
-rw-r--r--src/fake-w32-gdi.c6
-rw-r--r--src/fake-w32-gdi.h4
-rw-r--r--src/gamma-dummy.c4
-rw-r--r--src/gamma-dummy.h4
-rw-r--r--src/gamma-linux-drm.c60
-rw-r--r--src/gamma-linux-drm.h4
-rw-r--r--src/gamma-quartz-cg.c40
-rw-r--r--src/gamma-quartz-cg.h4
-rw-r--r--src/gamma-w32-gdi.c40
-rw-r--r--src/gamma-w32-gdi.h4
-rw-r--r--src/gamma-x-randr.c56
-rw-r--r--src/gamma-x-randr.h4
-rw-r--r--src/gamma-x-vidmode.c34
-rw-r--r--src/gamma-x-vidmode.h4
-rw-r--r--src/libgamma-facade.c498
-rw-r--r--src/libgamma-facade.h4
-rw-r--r--src/libgamma-method.c2
-rw-r--r--src/libgamma-method.h44
-rw-r--r--test/test.c20
23 files changed, 440 insertions, 440 deletions
diff --git a/configure b/configure
index dcb613d..87c0786 100755
--- a/configure
+++ b/configure
@@ -103,55 +103,55 @@ if [ ${enable_debug} = 1 ]; then
fi
if [ ${enable_dummy} = 1 ]; then
echo 'LIBOBJ += gamma-dummy' >&3
- echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_DUMMY' >&3
- echo '#define HAVE_GAMMA_METHOD_DUMMY' >&4
+ echo 'DEFINITIONS += -DHAVE_LIBGAMMA_METHOD_DUMMY' >&3
+ echo '#define HAVE_LIBGAMMA_METHOD_DUMMY' >&4
have_dummy='Yes'
fi
if [ ${enable_randr} = 1 ]; then
echo 'LIBOBJ += gamma-x-randr' >&3
- echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_X_RANDR' >&3
+ echo 'DEFINITIONS += -DHAVE_LIBGAMMA_METHOD_X_RANDR' >&3
echo 'LIBS_LD += $$(pkg-config --libs xcb xcb-randr)' >&3
echo 'LIBS_C += $$(pkg-config --cflags xcb xcb-randr)' >&3
- echo '#define HAVE_GAMMA_METHOD_X_RANDR' >&4
+ echo '#define HAVE_LIBGAMMA_METHOD_X_RANDR' >&4
have_randr='Yes'
fi
if [ ${enable_vidmode} = 1 ]; then
echo 'LIBOBJ += gamma-x-vidmode' >&3
- echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_X_VIDMODE' >&3
+ echo 'DEFINITIONS += -DHAVE_LIBGAMMA_METHOD_X_VIDMODE' >&3
echo 'LIBS_LD += $$(pkg-config --libs x11 xxf86vm)' >&3
echo 'LIBS_C += $$(pkg-config --cflags x11 xxf86vm)' >&3
- echo '#define HAVE_GAMMA_METHOD_X_VIDMODE' >&4
+ echo '#define HAVE_LIBGAMMA_METHOD_X_VIDMODE' >&4
have_vidmode='Yes'
fi
if [ ${enable_drm} = 1 ]; then
echo 'LIBOBJ += gamma-linux-drm' >&3
- echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_LINUX_DRM' >&3
+ echo 'DEFINITIONS += -DHAVE_LIBGAMMA_METHOD_LINUX_DRM' >&3
echo 'LIBS_LD += $$(pkg-config --libs libdrm)' >&3
echo 'LIBS_C += $$(pkg-config --cflags libdrm)' >&3
- echo '#define HAVE_GAMMA_METHOD_LINUX_DRM' >&4
+ echo '#define HAVE_LIBGAMMA_METHOD_LINUX_DRM' >&4
have_drm='Yes'
fi
if [ ${enable_w32gdi} = 1 ]; then
echo 'LIBOBJ += gamma-w32-gdi' >&3
- echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_W32_GDI' >&3
- echo '#define HAVE_GAMMA_METHOD_W32_GDI' >&4
+ echo 'DEFINITIONS += -DHAVE_LIBGAMMA_METHOD_W32_GDI' >&3
+ echo '#define HAVE_LIBGAMMA_METHOD_W32_GDI' >&4
have_w32gdi='Yes'
fi
if [ ${enable_quartz} = 1 ]; then
echo 'LIBOBJ += gamma-quartz-cg' >&3
- echo 'DEFINITIONS += -DHAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&3
+ echo 'DEFINITIONS += -DHAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&3
if [ ${fake_w32gdi} = 0 ]; then
F_ApplicationServices="/System/Library/Frameworks/ApplicationServices.framework"
I_ApplicationServices="${F_ApplicationServices}/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers"
echo "LIBS_LD += -I${I_ApplicationServices} -F${F_ApplicationServices} -framework ApplicationServices" >&3
fi
- echo '#define HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&4
+ echo '#define HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&4
have_quartz='Yes'
fi
if [ ${fake_w32gdi} = 1 ]; then
echo 'LIBOBJ += fake-w32-gdi' >&3
- echo 'DEFINITIONS += -DFAKE_GAMMA_METHOD_W32_GDI' >&3
- echo '#define FAKE_GAMMA_METHOD_W32_GDI' >&4
+ echo 'DEFINITIONS += -DFAKE_LIBGAMMA_METHOD_W32_GDI' >&3
+ echo '#define FAKE_LIBGAMMA_METHOD_W32_GDI' >&4
if [ ${enable_randr} = 1 ]; then
have_w32gdi='Yes, fake via the RandR protocol for X'
else
@@ -160,8 +160,8 @@ if [ ${fake_w32gdi} = 1 ]; then
fi
if [ ${fake_quartz} = 1 ]; then
echo 'LIBOBJ += fake-quartz-cg' >&3
- echo 'DEFINITIONS += -DFAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&3
- echo '#define FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&4
+ echo 'DEFINITIONS += -DFAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&3
+ echo '#define FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS' >&4
if [ ${enable_randr} = 1 ]; then
have_quartz='Yes, fake via the RandR protocol for X'
else
diff --git a/src/edid.c b/src/edid.c
index cee2fef..76867c7 100644
--- a/src/edid.c
+++ b/src/edid.c
@@ -53,7 +53,7 @@ int libgamma_parse_edid(libgamma_crtc_information_t* restrict this, int32_t fiel
this->width_mm_edid = (size_t)(this->edid[21]) * 10;
this->height_mm_edid = (size_t)(this->edid[22]) * 10;
- if ((fields & CRTC_INFO_GAMMA) && (error == 0))
+ if ((fields & LIBGAMMA_CRTC_INFO_GAMMA) && (error == 0))
{
if (this->edid[23] == 0xFF)
this->gamma_error = LIBGAMMA_GAMMA_NOT_SPECIFIED;
diff --git a/src/fake-quartz-cg.c b/src/fake-quartz-cg.c
index c5c18d8..f599dbb 100644
--- a/src/fake-quartz-cg.c
+++ b/src/fake-quartz-cg.c
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-# error Compiling fake-quartz-cg.c without FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+#ifndef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+# error Compiling fake-quartz-cg.c without FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
#endif
/* This file very sloppily translates Mac OS X Quartz calls to X RandR calls.
@@ -33,7 +33,7 @@
#include <string.h>
-#ifndef HAVE_GAMMA_METHOD_X_RANDR
+#ifndef HAVE_LIBGAMMA_METHOD_X_RANDR
CGError CGGetOnlineDisplayList(uint32_t max_size,
CGDirectDisplayID* restrict displays_out, uint32_t* restrict count_out)
diff --git a/src/fake-quartz-cg.h b/src/fake-quartz-cg.h
index 268347c..8f995ea 100644
--- a/src/fake-quartz-cg.h
+++ b/src/fake-quartz-cg.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_FAKE_QUARTZ_CG_H
#define LIBGAMMA_FAKE_QUARTZ_CG_H
-#ifndef FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-# error Including fake-quartz-cg.h without FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+#ifndef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+# error Including fake-quartz-cg.h without FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
#endif
diff --git a/src/fake-w32-gdi.c b/src/fake-w32-gdi.c
index 65e191d..541b3c8 100644
--- a/src/fake-w32-gdi.c
+++ b/src/fake-w32-gdi.c
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef HAVE_GAMMA_METHOD_W32_GDI
-# error Compiling fake-w32-gdi.c without FAKE_GAMMA_METHOD_W32_GDI
+#ifndef HAVE_LIBGAMMA_METHOD_W32_GDI
+# error Compiling fake-w32-gdi.c without FAKE_LIBGAMMA_METHOD_W32_GDI
#endif
/* This file very sloppily translates Windows GDI calls to X RandR calls.
@@ -33,7 +33,7 @@
#include <string.h>
-#ifndef HAVE_GAMMA_METHOD_X_RANDR
+#ifndef HAVE_LIBGAMMA_METHOD_X_RANDR
/* http://msdn.microsoft.com/en-us/library/windows/desktop/dd144871(v=vs.85).aspx */
HDC GetDC(HWND hWnd)
diff --git a/src/fake-w32-gdi.h b/src/fake-w32-gdi.h
index 3d3b412..1995847 100644
--- a/src/fake-w32-gdi.h
+++ b/src/fake-w32-gdi.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_FAKE_W32_GDI_H
#define LIBGAMMA_FAKE_W32_GDI_H
-#ifndef FAKE_GAMMA_METHOD_W32_GDI
-# error Including fake-w32-gdi.h without FAKE_GAMMA_METHOD_W32_GDI
+#ifndef FAKE_LIBGAMMA_METHOD_W32_GDI
+# error Including fake-w32-gdi.h without FAKE_LIBGAMMA_METHOD_W32_GDI
#endif
diff --git a/src/gamma-dummy.c b/src/gamma-dummy.c
index 03f7f33..e508b4a 100644
--- a/src/gamma-dummy.c
+++ b/src/gamma-dummy.c
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef HAVE_GAMMA_METHOD_DUMMY
-# error Compiling gamma-dummy.c without HAVE_GAMMA_METHOD_DUMMY
+#ifndef HAVE_LIBGAMMA_METHOD_DUMMY
+# error Compiling gamma-dummy.c without HAVE_LIBGAMMA_METHOD_DUMMY
#endif
#include "gamma-dummy.h"
diff --git a/src/gamma-dummy.h b/src/gamma-dummy.h
index bbdda5c..342d119 100644
--- a/src/gamma-dummy.h
+++ b/src/gamma-dummy.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_GAMMA_DUMMY_H
#define LIBGAMMA_GAMMA_DUMMY_H
-#ifndef HAVE_GAMMA_METHOD_DUMMY
-# error Including gamma-dummy.h without HAVE_GAMMA_METHOD_DUMMY
+#ifndef HAVE_LIBGAMMA_METHOD_DUMMY
+# error Including gamma-dummy.h without HAVE_LIBGAMMA_METHOD_DUMMY
#endif
diff --git a/src/gamma-linux-drm.c b/src/gamma-linux-drm.c
index 32e3568..52bfa3b 100644
--- a/src/gamma-linux-drm.c
+++ b/src/gamma-linux-drm.c
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef HAVE_GAMMA_METHOD_LINUX_DRM
-# error Compiling gamma-linux-drm.c without HAVE_GAMMA_METHOD_LINUX_DRM
+#ifndef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+# error Compiling gamma-linux-drm.c without HAVE_LIBGAMMA_METHOD_LINUX_DRM
#endif
#define _GNU_SOURCE
@@ -88,18 +88,18 @@ typedef struct libgamma_drm_card_data
*/
void libgamma_linux_drm_method_capabilities(libgamma_method_capabilities_t* restrict this)
{
- this->crtc_information = CRTC_INFO_EDID
- | CRTC_INFO_WIDTH_MM
- | CRTC_INFO_HEIGHT_MM
- | CRTC_INFO_WIDTH_MM_EDID
- | CRTC_INFO_HEIGHT_MM_EDID
- | CRTC_INFO_GAMMA_SIZE
- | CRTC_INFO_GAMMA_DEPTH
- | CRTC_INFO_SUBPIXEL_ORDER
- | CRTC_INFO_ACTIVE
- | CRTC_INFO_CONNECTOR_NAME
- | CRTC_INFO_CONNECTOR_TYPE
- | CRTC_INFO_GAMMA;
+ this->crtc_information = LIBGAMMA_CRTC_INFO_EDID
+ | LIBGAMMA_CRTC_INFO_WIDTH_MM
+ | LIBGAMMA_CRTC_INFO_HEIGHT_MM
+ | LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID
+ | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID
+ | LIBGAMMA_CRTC_INFO_GAMMA_SIZE
+ | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH
+ | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER
+ | LIBGAMMA_CRTC_INFO_ACTIVE
+ | LIBGAMMA_CRTC_INFO_CONNECTOR_NAME
+ | LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE
+ | LIBGAMMA_CRTC_INFO_GAMMA;
this->default_site_known = 1;
this->multiple_sites = 0;
this->multiple_partitions = 1;
@@ -489,15 +489,15 @@ static int read_connector_data(libgamma_crtc_state_t* restrict crtc, libgamma_cr
const char* restrict connector_name_base = NULL;
/* Get some information that does not require too much work. */
- if ((fields & (CRTC_INFO_WIDTH_MM | CRTC_INFO_HEIGHT_MM | CRTC_INFO_CONNECTOR_TYPE |
- CRTC_INFO_ACTIVE | CRTC_INFO_SUBPIXEL_ORDER)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM | LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE |
+ LIBGAMMA_CRTC_INFO_ACTIVE | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)))
{
/* Get whether or not a monitor is plugged in. */
out->active = connector->connection == DRM_MODE_CONNECTED;
out->active_error = connector->connection == DRM_MODE_UNKNOWNCONNECTION ? LIBGAMMA_STATE_UNKNOWN : 0;
if (out->active == 0)
{
- if ((fields & (CRTC_INFO_WIDTH_MM | CRTC_INFO_HEIGHT_MM | CRTC_INFO_SUBPIXEL_ORDER)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)))
out->width_mm_error = out->height_mm_error = out->subpixel_order_error = LIBGAMMA_NOT_CONNECTED;
goto not_connected;
}
@@ -562,7 +562,7 @@ static int read_connector_data(libgamma_crtc_state_t* restrict crtc, libgamma_cr
}
/* Get the connector's name. */
- if ((fields & CRTC_INFO_CONNECTOR_NAME) && (out->connector_name_error == 0))
+ if ((fields & LIBGAMMA_CRTC_INFO_CONNECTOR_NAME) && (out->connector_name_error == 0))
{
libgamma_drm_card_data_t* restrict card = crtc->partition->data;
uint32_t type = connector->connector_type;
@@ -655,18 +655,18 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t* restric
memset(this, 0, sizeof(libgamma_crtc_information_t));
/* We need to free the EDID after us if it is not explicitly requested. */
- free_edid = (fields & CRTC_INFO_EDID) == 0;
+ free_edid = (fields & LIBGAMMA_CRTC_INFO_EDID) == 0;
/* Figure out what fields we need to get the data for to get the data for other fields. */
- if ((fields & (CRTC_INFO_WIDTH_MM_EDID | CRTC_INFO_HEIGHT_MM_EDID | CRTC_INFO_GAMMA)))
- fields |= CRTC_INFO_EDID;
- if ((fields & CRTC_INFO_CONNECTOR_NAME))
- fields |= CRTC_INFO_CONNECTOR_TYPE;
- if (CRTC_INFO_EDID | CRTC_INFO_WIDTH_MM | CRTC_INFO_HEIGHT_MM | CRTC_INFO_SUBPIXEL_ORDER)
- fields |= CRTC_INFO_ACTIVE;
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID | LIBGAMMA_CRTC_INFO_GAMMA)))
+ fields |= LIBGAMMA_CRTC_INFO_EDID;
+ if ((fields & LIBGAMMA_CRTC_INFO_CONNECTOR_NAME))
+ fields |= LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE;
+ if (LIBGAMMA_CRTC_INFO_EDID | LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)
+ fields |= LIBGAMMA_CRTC_INFO_ACTIVE;
/* Figure out whether we require the connector to get all information we want. */
- require_connector = fields & (CRTC_INFO_ACTIVE | CRTC_INFO_CONNECTOR_TYPE);
+ require_connector = fields & (LIBGAMMA_CRTC_INFO_ACTIVE | LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE);
if (require_connector == 0)
goto cont;
@@ -680,7 +680,7 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t* restric
goto cont;
}
e |= read_connector_data(crtc, this, connector, fields);
- if ((fields & CRTC_INFO_EDID) == 0)
+ if ((fields & LIBGAMMA_CRTC_INFO_EDID) == 0)
goto cont;
if (this->active_error || (this->active == 0))
{
@@ -695,12 +695,12 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t* restric
this->gamma_error = this->width_mm_edid_error = this->height_mm_edid_error = this->edid_error;
goto cont;
}
- if ((fields & (CRTC_INFO_WIDTH_MM_EDID | CRTC_INFO_HEIGHT_MM_EDID | CRTC_INFO_GAMMA)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID | LIBGAMMA_CRTC_INFO_GAMMA)))
e |= libgamma_parse_edid(this, fields);
cont:
- e |= (fields & CRTC_INFO_GAMMA_SIZE) ? get_gamma_ramp_size(this, crtc) : 0;
+ e |= (fields & LIBGAMMA_CRTC_INFO_GAMMA_SIZE) ? get_gamma_ramp_size(this, crtc) : 0;
this->gamma_depth = 16;
- e |= this->gamma_support_error = _E(CRTC_INFO_GAMMA_SUPPORT);
+ e |= this->gamma_support_error = _E(LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT);
/* Free the EDID after us. */
if (free_edid)
diff --git a/src/gamma-linux-drm.h b/src/gamma-linux-drm.h
index 24b789e..3d244aa 100644
--- a/src/gamma-linux-drm.h
+++ b/src/gamma-linux-drm.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_GAMMA_LINUX_DRM_H
#define LIBGAMMA_GAMMA_LINUX_DRM_H
-#ifndef HAVE_GAMMA_METHOD_LINUX_DRM
-# error Including gamma-linux-drm.h without HAVE_GAMMA_METHOD_LINUX_DRM
+#ifndef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+# error Including gamma-linux-drm.h without HAVE_LIBGAMMA_METHOD_LINUX_DRM
#endif
diff --git a/src/gamma-quartz-cg.c b/src/gamma-quartz-cg.c
index 05f76bf..3832ca5 100644
--- a/src/gamma-quartz-cg.c
+++ b/src/gamma-quartz-cg.c
@@ -15,15 +15,15 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-# error Compiling gamma-quartz-cg.c without HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+#ifndef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+# error Compiling gamma-quartz-cg.c without HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
#endif
#include "gamma-quartz-cg.h"
#include "libgamma-error.h"
-#ifdef FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+#ifdef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
# include "fake-quartz-cg.h"
#else
# include <CoreGraphics/CGDirectDisplay.h>
@@ -41,8 +41,8 @@
*/
void libgamma_quartz_cg_method_capabilities(libgamma_method_capabilities_t* restrict this)
{
- this->crtc_information = CRTC_INFO_GAMMA_SIZE
- | CRTC_INFO_GAMMA_DEPTH;
+ this->crtc_information = LIBGAMMA_CRTC_INFO_GAMMA_SIZE
+ | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH;
this->default_site_known = 1;
this->multiple_sites = 0;
this->multiple_partitions = 0;
@@ -54,9 +54,9 @@ void libgamma_quartz_cg_method_capabilities(libgamma_method_capabilities_t* rest
this->identical_gamma_sizes = 1;
this->fixed_gamma_size = 0;
this->fixed_gamma_depth = 1;
-#ifdef FAKE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+#ifdef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
this->fake = 1;
-# ifdef HAVE_GAMMA_METHOD_X_RANDR
+# ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
this->real = 1;
# else
this->real = 0;
@@ -259,16 +259,16 @@ int libgamma_quartz_cg_crtc_restore(libgamma_crtc_state_t* restrict this)
int libgamma_quartz_cg_get_crtc_information(libgamma_crtc_information_t* restrict this,
libgamma_crtc_state_t* restrict crtc, int32_t fields)
{
-#define SUPPORTED_FIELDS (CRTC_INFO_GAMMA_SIZE | CRTC_INFO_GAMMA_DEPTH)
+#define SUPPORTED_FIELDS (LIBGAMMA_CRTC_INFO_GAMMA_SIZE | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH)
#define _E(FIELD) ((fields & FIELD) ? LIBGAMMA_CRTC_INFO_NOT_SUPPORTED : 0)
- this->edid_error = _E(CRTC_INFO_EDID);
- this->width_mm_error = _E(CRTC_INFO_WIDTH_MM);
- this->height_mm_error = _E(CRTC_INFO_HEIGHT_MM);
- this->width_mm_edid_error = _E(CRTC_INFO_WIDTH_MM_EDID);
- this->height_mm_edid_error = _E(CRTC_INFO_HEIGHT_MM_EDID);
- if ((fields & CRTC_INFO_GAMMA_SIZE))
+ this->edid_error = _E(LIBGAMMA_CRTC_INFO_EDID);
+ this->width_mm_error = _E(LIBGAMMA_CRTC_INFO_WIDTH_MM);
+ this->height_mm_error = _E(LIBGAMMA_CRTC_INFO_HEIGHT_MM);
+ this->width_mm_edid_error = _E(LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID);
+ this->height_mm_edid_error = _E(LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID);
+ if ((fields & LIBGAMMA_CRTC_INFO_GAMMA_SIZE))
{
CGDirectDisplayID* crtcs = crtc->partition->data;
CGDirectDisplayID crtc_id = crtcs[crtc->crtc];
@@ -282,12 +282,12 @@ int libgamma_quartz_cg_get_crtc_information(libgamma_crtc_information_t* restric
this->gamma_size_error = 0;
this->gamma_depth = -1;
this->gamma_depth_error = 0;
- this->gamma_support_error = _E(CRTC_INFO_GAMMA_SUPPORT);
- this->subpixel_order_error = _E(CRTC_INFO_SUBPIXEL_ORDER);
- this->active_error = _E(CRTC_INFO_ACTIVE);
- this->connector_name_error = _E(CRTC_INFO_CONNECTOR_NAME);
- this->connector_type_error = _E(CRTC_INFO_CONNECTOR_TYPE);
- this->gamma_error = _E(CRTC_INFO_GAMMA);
+ this->gamma_support_error = _E(LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT);
+ this->subpixel_order_error = _E(LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER);
+ this->active_error = _E(LIBGAMMA_CRTC_INFO_ACTIVE);
+ this->connector_name_error = _E(LIBGAMMA_CRTC_INFO_CONNECTOR_NAME);
+ this->connector_type_error = _E(LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE);
+ this->gamma_error = _E(LIBGAMMA_CRTC_INFO_GAMMA);
#undef _E
diff --git a/src/gamma-quartz-cg.h b/src/gamma-quartz-cg.h
index 058c36d..90f5244 100644
--- a/src/gamma-quartz-cg.h
+++ b/src/gamma-quartz-cg.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_GAMMA_QUARTZ_CG_H
#define LIBGAMMA_GAMMA_QUARTZ_CG_H
-#ifndef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-# error Including gamma-quartz-cg.h without HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+#ifndef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+# error Including gamma-quartz-cg.h without HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
#endif
diff --git a/src/gamma-w32-gdi.c b/src/gamma-w32-gdi.c
index a4c438a..f8c00ee 100644
--- a/src/gamma-w32-gdi.c
+++ b/src/gamma-w32-gdi.c
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef HAVE_GAMMA_METHOD_W32_GDI
-# error Compiling gamma-w32-gdi.c without HAVE_GAMMA_METHOD_W32_GDI
+#ifndef HAVE_LIBGAMMA_METHOD_W32_GDI
+# error Compiling gamma-w32-gdi.c without HAVE_LIBGAMMA_METHOD_W32_GDI
#endif
#include "gamma-w32-gdi.h"
@@ -26,7 +26,7 @@
#ifndef WINVER
# define WINVER 0x0500
#endif
-#ifdef FAKE_GAMMA_METHOD_W32_GDI
+#ifdef FAKE_LIBGAMMA_METHOD_W32_GDI
# include "fake-w32-gdi.h"
#else
# include <windows.h>
@@ -45,9 +45,9 @@
*/
void libgamma_w32_gdi_method_capabilities(libgamma_method_capabilities_t* restrict this)
{
- this->crtc_information = CRTC_INFO_GAMMA_SIZE
- | CRTC_INFO_GAMMA_DEPTH
- | CRTC_INFO_GAMMA_SUPPORT;
+ this->crtc_information = LIBGAMMA_CRTC_INFO_GAMMA_SIZE
+ | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH
+ | LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT;
this->default_site_known = 1;
this->multiple_sites = 0;
this->multiple_partitions = 0;
@@ -59,9 +59,9 @@ void libgamma_w32_gdi_method_capabilities(libgamma_method_capabilities_t* restri
this->identical_gamma_sizes = 1;
this->fixed_gamma_size = 1;
this->fixed_gamma_depth = 1;
-#ifdef FAKE_GAMMA_METHOD_W32_GDI
+#ifdef FAKE_LIBGAMMA_METHOD_W32_GDI
this->fake = 1;
-# ifdef HAVE_GAMMA_METHOD_X_RANDR
+# ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
this->real = 1;
# else
this->real = 0;
@@ -254,29 +254,29 @@ int libgamma_w32_gdi_crtc_restore(libgamma_crtc_state_t* restrict this)
int libgamma_w32_gdi_get_crtc_information(libgamma_crtc_information_t* restrict this,
libgamma_crtc_state_t* restrict crtc, int32_t fields)
{
-#define KNOWN_FIELDS (CRTC_INFO_GAMMA_SIZE | CRTC_INFO_GAMMA_DEPTH | CRTC_INFO_GAMMA_SUPPORT)
+#define KNOWN_FIELDS (LIBGAMMA_CRTC_INFO_GAMMA_SIZE | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH | LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT)
#define _E(FIELD) ((fields & FIELD) ? LIBGAMMA_CRTC_INFO_NOT_SUPPORTED : 0)
- this->edid_error = _E(CRTC_INFO_EDID);
- this->width_mm_error = _E(CRTC_INFO_WIDTH_MM);
- this->height_mm_error = _E(CRTC_INFO_HEIGHT_MM);
- this->width_mm_edid_error = _E(CRTC_INFO_WIDTH_MM_EDID);
- this->height_mm_edid_error = _E(CRTC_INFO_HEIGHT_MM_EDID);
+ this->edid_error = _E(LIBGAMMA_CRTC_INFO_EDID);
+ this->width_mm_error = _E(LIBGAMMA_CRTC_INFO_WIDTH_MM);
+ this->height_mm_error = _E(LIBGAMMA_CRTC_INFO_HEIGHT_MM);
+ this->width_mm_edid_error = _E(LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID);
+ this->height_mm_edid_error = _E(LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID);
this->red_gamma_size = GAMMA_RAMP_SIZE;
this->green_gamma_size = GAMMA_RAMP_SIZE;
this->blue_gamma_size = GAMMA_RAMP_SIZE;
this->gamma_size_error = 0;
this->gamma_depth = 16;
this->gamma_depth_error = 0;
- if ((fields & CRTC_INFO_GAMMA_SUPPORT))
+ if ((fields & LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT))
this->gamma_support = GetDeviceCaps(crtc->data, COLORMGMTCAPS) == CM_GAMMA_RAMP;
this->gamma_support_error = 0;
- this->subpixel_order_error = _E(CRTC_INFO_SUBPIXEL_ORDER);
- this->active_error = _E(CRTC_INFO_ACTIVE);
- this->connector_name_error = _E(CRTC_INFO_CONNECTOR_NAME);
- this->connector_type_error = _E(CRTC_INFO_CONNECTOR_TYPE);
- this->gamma_error = _E(CRTC_INFO_GAMMA);
+ this->subpixel_order_error = _E(LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER);
+ this->active_error = _E(LIBGAMMA_CRTC_INFO_ACTIVE);
+ this->connector_name_error = _E(LIBGAMMA_CRTC_INFO_CONNECTOR_NAME);
+ this->connector_type_error = _E(LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE);
+ this->gamma_error = _E(LIBGAMMA_CRTC_INFO_GAMMA);
#undef _E
diff --git a/src/gamma-w32-gdi.h b/src/gamma-w32-gdi.h
index ad75a47..0e17720 100644
--- a/src/gamma-w32-gdi.h
+++ b/src/gamma-w32-gdi.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_GAMMA_W32_GDI_H
#define LIBGAMMA_GAMMA_W32_GDI_H
-#ifndef HAVE_GAMMA_METHOD_W32_GDI
-# error Including gamma-w32-gdi.h without HAVE_GAMMA_METHOD_W32_GDI
+#ifndef HAVE_LIBGAMMA_METHOD_W32_GDI
+# error Including gamma-w32-gdi.h without HAVE_LIBGAMMA_METHOD_W32_GDI
#endif
diff --git a/src/gamma-x-randr.c b/src/gamma-x-randr.c
index f97d431..9870f6b 100644
--- a/src/gamma-x-randr.c
+++ b/src/gamma-x-randr.c
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef HAVE_GAMMA_METHOD_X_RANDR
-# error Compiling gamma-x-randr.c without HAVE_GAMMA_METHOD_X_RANDR
+#ifndef HAVE_LIBGAMMA_METHOD_X_RANDR
+# error Compiling gamma-x-randr.c without HAVE_LIBGAMMA_METHOD_X_RANDR
#endif
#include "gamma-x-randr.h"
@@ -132,17 +132,17 @@ static int translate_error(int error_code, int default_error, int return_errno)
void libgamma_x_randr_method_capabilities(libgamma_method_capabilities_t* restrict this)
{
char* display = getenv("DISPLAY");
- this->crtc_information = CRTC_INFO_EDID
- | CRTC_INFO_WIDTH_MM
- | CRTC_INFO_HEIGHT_MM
- | CRTC_INFO_WIDTH_MM_EDID
- | CRTC_INFO_HEIGHT_MM_EDID
- | CRTC_INFO_GAMMA_SIZE
- | CRTC_INFO_GAMMA_DEPTH
- | CRTC_INFO_SUBPIXEL_ORDER
- | CRTC_INFO_CONNECTOR_NAME
- | CRTC_INFO_CONNECTOR_TYPE
- | CRTC_INFO_GAMMA;
+ this->crtc_information = LIBGAMMA_CRTC_INFO_EDID
+ | LIBGAMMA_CRTC_INFO_WIDTH_MM
+ | LIBGAMMA_CRTC_INFO_HEIGHT_MM
+ | LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID
+ | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID
+ | LIBGAMMA_CRTC_INFO_GAMMA_SIZE
+ | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH
+ | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER
+ | LIBGAMMA_CRTC_INFO_CONNECTOR_NAME
+ | LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE
+ | LIBGAMMA_CRTC_INFO_GAMMA;
this->default_site_known = (display && *display) ? 1 : 0;
this->multiple_sites = 1;
this->multiple_partitions = 1;
@@ -755,18 +755,18 @@ int libgamma_x_randr_get_crtc_information(libgamma_crtc_information_t* restrict
memset(this, 0, sizeof(libgamma_crtc_information_t));
/* We need to free the EDID after us if it is not explicitly requested. */
- free_edid = (fields & CRTC_INFO_EDID) == 0;
+ free_edid = (fields & LIBGAMMA_CRTC_INFO_EDID) == 0;
/* Figure out what fields we need to get the data for to get the data for other fields. */
- if ((fields & (CRTC_INFO_WIDTH_MM_EDID | CRTC_INFO_HEIGHT_MM_EDID | CRTC_INFO_GAMMA)))
- fields |= CRTC_INFO_EDID;
- if ((fields & CRTC_INFO_CONNECTOR_TYPE))
- fields |= CRTC_INFO_CONNECTOR_NAME;
- if ((fields & (CRTC_INFO_WIDTH_MM | CRTC_INFO_HEIGHT_MM | CRTC_INFO_SUBPIXEL_ORDER)))
- fields |= CRTC_INFO_ACTIVE;
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID | LIBGAMMA_CRTC_INFO_GAMMA)))
+ fields |= LIBGAMMA_CRTC_INFO_EDID;
+ if ((fields & LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE))
+ fields |= LIBGAMMA_CRTC_INFO_CONNECTOR_NAME;
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)))
+ fields |= LIBGAMMA_CRTC_INFO_ACTIVE;
/* Jump if the output information is not required. */
- if ((fields & (CRTC_INFO_ACTIVE | CRTC_INFO_CONNECTOR_NAME)) == 0)
+ if ((fields & (LIBGAMMA_CRTC_INFO_ACTIVE | LIBGAMMA_CRTC_INFO_CONNECTOR_NAME)) == 0)
goto cont;
/* Get connector and connector information. */
@@ -800,14 +800,14 @@ int libgamma_x_randr_get_crtc_information(libgamma_crtc_information_t* restrict
}
e |= get_output_name(this, output_info);
- if ((fields & CRTC_INFO_CONNECTOR_TYPE))
+ if ((fields & LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE))
e |= get_connector_type(this);
e |= read_output_data(this, output_info);
- if ((fields & (CRTC_INFO_WIDTH_MM | CRTC_INFO_HEIGHT_MM)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM)))
e |= this->width_mm_error | this->height_mm_error;
- e |= (fields & CRTC_INFO_SUBPIXEL_ORDER) ? this->subpixel_order_error : 0;
+ e |= (fields & LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER) ? this->subpixel_order_error : 0;
- if ((fields & CRTC_INFO_EDID) == 0)
+ if ((fields & LIBGAMMA_CRTC_INFO_EDID) == 0)
goto cont;
if (this->active == 0)
{
@@ -821,13 +821,13 @@ int libgamma_x_randr_get_crtc_information(libgamma_crtc_information_t* restrict
this->gamma_error = this->width_mm_edid_error = this->height_mm_edid_error = this->edid_error;
goto cont;
}
- if ((fields & (CRTC_INFO_WIDTH_MM_EDID | CRTC_INFO_HEIGHT_MM_EDID | CRTC_INFO_GAMMA)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID | LIBGAMMA_CRTC_INFO_GAMMA)))
e |= libgamma_parse_edid(this, fields);
cont:
- e |= (fields & CRTC_INFO_GAMMA_SIZE) ? get_gamma_ramp_size(this, crtc) : 0;
+ e |= (fields & LIBGAMMA_CRTC_INFO_GAMMA_SIZE) ? get_gamma_ramp_size(this, crtc) : 0;
this->gamma_depth = 16;
- e |= this->gamma_support_error = _E(CRTC_INFO_GAMMA_SUPPORT);
+ e |= this->gamma_support_error = _E(LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT);
/* Free the EDID after us. */
if (free_edid)
diff --git a/src/gamma-x-randr.h b/src/gamma-x-randr.h
index cceac81..dc1ecdc 100644
--- a/src/gamma-x-randr.h
+++ b/src/gamma-x-randr.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_GAMMA_X_RANDR_H
#define LIBGAMMA_GAMMA_X_RANDR_H
-#ifndef HAVE_GAMMA_METHOD_X_RANDR
-# error Including gamma-x-randr.h without HAVE_GAMMA_METHOD_X_RANDR
+#ifndef HAVE_LIBGAMMA_METHOD_X_RANDR
+# error Including gamma-x-randr.h without HAVE_LIBGAMMA_METHOD_X_RANDR
#endif
diff --git a/src/gamma-x-vidmode.c b/src/gamma-x-vidmode.c
index 29e954e..a73f36f 100644
--- a/src/gamma-x-vidmode.c
+++ b/src/gamma-x-vidmode.c
@@ -15,8 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef HAVE_GAMMA_METHOD_X_VIDMODE
-# error Compiling gamma-x-vidmode.c without HAVE_GAMMA_METHOD_X_VIDMODE
+#ifndef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+# error Compiling gamma-x-vidmode.c without HAVE_LIBGAMMA_METHOD_X_VIDMODE
#endif
#include "gamma-x-vidmode.h"
@@ -38,8 +38,8 @@
void libgamma_x_vidmode_method_capabilities(libgamma_method_capabilities_t* restrict this)
{
char* restrict display = getenv("DISPLAY");
- this->crtc_information = CRTC_INFO_GAMMA_SIZE
- | CRTC_INFO_GAMMA_DEPTH;
+ this->crtc_information = LIBGAMMA_CRTC_INFO_GAMMA_SIZE
+ | LIBGAMMA_CRTC_INFO_GAMMA_DEPTH;
this->default_site_known = (display && *display);
this->multiple_sites = 1;
this->multiple_partitions = 1;
@@ -213,13 +213,13 @@ int libgamma_x_vidmode_get_crtc_information(libgamma_crtc_information_t* restric
{
#define _E(FIELD) ((fields & FIELD) ? LIBGAMMA_CRTC_INFO_NOT_SUPPORTED : 0)
- this->edid_error = _E(CRTC_INFO_EDID);
- this->width_mm_error = _E(CRTC_INFO_WIDTH_MM);
- this->height_mm_error = _E(CRTC_INFO_HEIGHT_MM);
- this->width_mm_edid_error = _E(CRTC_INFO_WIDTH_MM_EDID);
- this->height_mm_edid_error = _E(CRTC_INFO_HEIGHT_MM_EDID);
+ this->edid_error = _E(LIBGAMMA_CRTC_INFO_EDID);
+ this->width_mm_error = _E(LIBGAMMA_CRTC_INFO_WIDTH_MM);
+ this->height_mm_error = _E(LIBGAMMA_CRTC_INFO_HEIGHT_MM);
+ this->width_mm_edid_error = _E(LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID);
+ this->height_mm_edid_error = _E(LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID);
this->gamma_size_error = 0;
- if ((fields & CRTC_INFO_GAMMA_SUPPORT))
+ if ((fields & LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT))
{
Display* restrict connection = crtc->partition->site->data;
int stops;
@@ -232,16 +232,16 @@ int libgamma_x_vidmode_get_crtc_information(libgamma_crtc_information_t* restric
}
this->gamma_depth = 16;
this->gamma_depth_error = 0;
- this->gamma_support_error = _E(CRTC_INFO_GAMMA_SUPPORT);
- this->subpixel_order_error = _E(CRTC_INFO_SUBPIXEL_ORDER);
- this->active_error = _E(CRTC_INFO_ACTIVE);
- this->connector_name_error = _E(CRTC_INFO_CONNECTOR_NAME);
- this->connector_type_error = _E(CRTC_INFO_CONNECTOR_TYPE);
- this->gamma_error = _E(CRTC_INFO_GAMMA);
+ this->gamma_support_error = _E(LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT);
+ this->subpixel_order_error = _E(LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER);
+ this->active_error = _E(LIBGAMMA_CRTC_INFO_ACTIVE);
+ this->connector_name_error = _E(LIBGAMMA_CRTC_INFO_CONNECTOR_NAME);
+ this->connector_type_error = _E(LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE);
+ this->gamma_error = _E(LIBGAMMA_CRTC_INFO_GAMMA);
#undef _E
- return (fields & ~(CRTC_INFO_GAMMA_DEPTH | CRTC_INFO_GAMMA_SIZE)) ? -1 : this->gamma_size_error;
+ return (fields & ~(LIBGAMMA_CRTC_INFO_GAMMA_DEPTH | LIBGAMMA_CRTC_INFO_GAMMA_SIZE)) ? -1 : this->gamma_size_error;
}
diff --git a/src/gamma-x-vidmode.h b/src/gamma-x-vidmode.h
index 52376cc..8378726 100644
--- a/src/gamma-x-vidmode.h
+++ b/src/gamma-x-vidmode.h
@@ -18,8 +18,8 @@
#ifndef LIBGAMMA_GAMMA_X_VIDMODE_H
#define LIBGAMMA_GAMMA_X_VIDMODE_H
-#ifndef HAVE_GAMMA_METHOD_X_VIDMODE
-# error Including gamma-x-vidmode.h without HAVE_GAMMA_METHOD_X_VIDMODE
+#ifndef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+# error Including gamma-x-vidmode.h without HAVE_LIBGAMMA_METHOD_X_VIDMODE
#endif
diff --git a/src/libgamma-facade.c b/src/libgamma-facade.c
index 3f199a1..ef5d369 100644
--- a/src/libgamma-facade.c
+++ b/src/libgamma-facade.c
@@ -20,40 +20,40 @@
#include "libgamma-error.h"
#include "libgamma-method.h"
#include "gamma-helper.h"
-#ifdef HAVE_GAMMA_METHOD_DUMMY
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
# include "gamma-dummy.h"
-# ifndef HAVE_GAMMA_METHODS
-# define HAVE_GAMMA_METHODS
+# ifndef HAVE_LIBGAMMA_METHODS
+# define HAVE_LIBGAMMA_METHODS
# endif
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
# include "gamma-x-randr.h"
-# ifndef HAVE_GAMMA_METHODS
-# define HAVE_GAMMA_METHODS
+# ifndef HAVE_LIBGAMMA_METHODS
+# define HAVE_LIBGAMMA_METHODS
# endif
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
# include "gamma-x-vidmode.h"
-# ifndef HAVE_GAMMA_METHODS
-# define HAVE_GAMMA_METHODS
+# ifndef HAVE_LIBGAMMA_METHODS
+# define HAVE_LIBGAMMA_METHODS
# endif
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
# include "gamma-linux-drm.h"
-# ifndef HAVE_GAMMA_METHODS
-# define HAVE_GAMMA_METHODS
+# ifndef HAVE_LIBGAMMA_METHODS
+# define HAVE_LIBGAMMA_METHODS
# endif
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
# include "gamma-w32-gdi.h"
-# ifndef HAVE_GAMMA_METHODS
-# define HAVE_GAMMA_METHODS
+# ifndef HAVE_LIBGAMMA_METHODS
+# define HAVE_LIBGAMMA_METHODS
# endif
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
# include "gamma-quartz-cg.h"
-# ifndef HAVE_GAMMA_METHODS
-# define HAVE_GAMMA_METHODS
+# ifndef HAVE_LIBGAMMA_METHODS
+# define HAVE_LIBGAMMA_METHODS
# endif
#endif
@@ -65,20 +65,20 @@
#include <errno.h>
-#ifndef HAVE_GAMMA_METHODS
-# define HAVE_NO_GAMMA_METHODS
+#ifndef HAVE_LIBGAMMA_METHODS
+# define HAVE_NO_LIBGAMMA_METHODS
#endif
-#ifdef HAVE_NO_GAMMA_METHODS
+#ifdef HAVE_NO_LIBGAMMA_METHODS
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
#endif
-#ifdef HAVE_GAMMA_METHODS
-# ifdef HAVE_GAMMA_METHOD_LINUX_DRM
+#ifdef HAVE_LIBGAMMA_METHODS
+# ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
/**
* Test whether a file descriptor refers to a VT.
*
@@ -130,14 +130,14 @@ static int libgamma_list_method_test(int method, int operation)
case 1: /* Methods that the environment suggests will work, including fake. */
if (caps.real == 0)
return 0;
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- if (method == GAMMA_METHOD_LINUX_DRM)
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ if (method == LIBGAMMA_METHOD_LINUX_DRM)
return libgamma_is_vt_proper(STDIN_FILENO) ||
libgamma_is_vt_proper(STDOUT_FILENO) ||
libgamma_is_vt_proper(STDERR_FILENO);
#endif
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- if (method == GAMMA_METHOD_DUMMY)
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ if (method == LIBGAMMA_METHOD_DUMMY)
return 0;
#endif
return caps.default_site_known;
@@ -158,8 +158,8 @@ static int libgamma_list_method_test(int method, int operation)
/**
* List available adjustment methods by their order of preference based on the environment.
*
- * @param methods Output array of methods, should be able to hold `GAMMA_METHOD_COUNT` elements
- * @param buf_size The number of elements that fits in `methods`, it should be `GAMMA_METHOD_COUNT`,
+ * @param methods Output array of methods, should be able to hold `LIBGAMMA_METHOD_COUNT` elements
+ * @param buf_size The number of elements that fits in `methods`, it should be `LIBGAMMA_METHOD_COUNT`,
* This is used to avoid writing outside the output buffer if this library adds new
* adjustment methods without the users of the library recompiling.
* @param operation Allowed values:
@@ -174,36 +174,36 @@ static int libgamma_list_method_test(int method, int operation)
*/
size_t libgamma_list_methods(int* restrict methods, size_t buf_size, int operation)
{
-#ifdef HAVE_NO_GAMMA_METHODS
+#ifdef HAVE_NO_LIBGAMMA_METHODS
(void) methods;
(void) operation;
return 0;
#else
size_t n = 0;
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- if (libgamma_list_method_test(GAMMA_METHOD_X_RANDR, operation) && (n++ < buf_size))
- methods[n - 1] = GAMMA_METHOD_X_RANDR;
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ if (libgamma_list_method_test(LIBGAMMA_METHOD_X_RANDR, operation) && (n++ < buf_size))
+ methods[n - 1] = LIBGAMMA_METHOD_X_RANDR;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- if (libgamma_list_method_test(GAMMA_METHOD_X_VIDMODE, operation) && (n++ < buf_size))
- methods[n - 1] = GAMMA_METHOD_X_VIDMODE;
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ if (libgamma_list_method_test(LIBGAMMA_METHOD_X_VIDMODE, operation) && (n++ < buf_size))
+ methods[n - 1] = LIBGAMMA_METHOD_X_VIDMODE;
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- if (libgamma_list_method_test(GAMMA_METHOD_LINUX_DRM, operation) && (n++ < buf_size))
- methods[n - 1] = GAMMA_METHOD_LINUX_DRM;
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ if (libgamma_list_method_test(LIBGAMMA_METHOD_LINUX_DRM, operation) && (n++ < buf_size))
+ methods[n - 1] = LIBGAMMA_METHOD_LINUX_DRM;
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- if (libgamma_list_method_test(GAMMA_METHOD_W32_GDI, operation) && (n++ < buf_size))
- methods[n - 1] = GAMMA_METHOD_W32_GDI;
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ if (libgamma_list_method_test(LIBGAMMA_METHOD_W32_GDI, operation) && (n++ < buf_size))
+ methods[n - 1] = LIBGAMMA_METHOD_W32_GDI;
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- if (libgamma_list_method_test(GAMMA_METHOD_QUARTZ_CORE_GRAPHICS, operation) && (n++ < buf_size))
- methods[n - 1] = GAMMA_METHOD_QUARTZ_CORE_GRAPHICS;
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ if (libgamma_list_method_test(LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS, operation) && (n++ < buf_size))
+ methods[n - 1] = LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS;
#endif
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- if (libgamma_list_method_test(GAMMA_METHOD_DUMMY, operation) && (n++ < buf_size))
- methods[n - 1] = GAMMA_METHOD_DUMMY;
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ if (libgamma_list_method_test(LIBGAMMA_METHOD_DUMMY, operation) && (n++ < buf_size))
+ methods[n - 1] = LIBGAMMA_METHOD_DUMMY;
#endif
return n;
@@ -223,33 +223,33 @@ void libgamma_method_capabilities(libgamma_method_capabilities_t* restrict this,
switch (method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
libgamma_dummy_method_capabilities(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
libgamma_x_randr_method_capabilities(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
libgamma_x_vidmode_method_capabilities(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
libgamma_linux_drm_method_capabilities(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
libgamma_w32_gdi_method_capabilities(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
libgamma_quartz_cg_method_capabilities(this);
break;
#endif
@@ -299,13 +299,13 @@ const char* libgamma_method_default_site_variable(int method)
{
switch (method)
{
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return "DISPLAY";
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return "DISPLAY";
#endif
@@ -338,28 +338,28 @@ int libgamma_site_initialise(libgamma_site_state_t* restrict this,
switch (method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_site_initialise(this, site);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_site_initialise(this, site);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_site_initialise(this, site);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_site_initialise(this, site);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_site_initialise(this, site);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_site_initialise(this, site);
#endif
@@ -378,33 +378,33 @@ void libgamma_site_destroy(libgamma_site_state_t* restrict this)
{
switch (this->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
libgamma_dummy_site_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
libgamma_x_randr_site_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
libgamma_x_vidmode_site_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
libgamma_linux_drm_site_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
libgamma_w32_gdi_site_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
libgamma_quartz_cg_site_destroy(this);
break;
#endif
@@ -442,28 +442,28 @@ int libgamma_site_restore(libgamma_site_state_t* restrict this)
{
switch (this->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_site_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_site_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_site_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_site_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_site_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_site_restore(this);
#endif
@@ -491,28 +491,28 @@ int libgamma_partition_initialise(libgamma_partition_state_t* restrict this,
switch (site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_partition_initialise(this, site, partition);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_partition_initialise(this, site, partition);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_partition_initialise(this, site, partition);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_partition_initialise(this, site, partition);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_partition_initialise(this, site, partition);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_partition_initialise(this, site, partition);
#endif
@@ -531,33 +531,33 @@ void libgamma_partition_destroy(libgamma_partition_state_t* restrict this)
{
switch (this->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
libgamma_dummy_partition_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
libgamma_x_randr_partition_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
libgamma_x_vidmode_partition_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
libgamma_linux_drm_partition_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
libgamma_w32_gdi_partition_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
libgamma_quartz_cg_partition_destroy(this);
break;
#endif
@@ -594,28 +594,28 @@ int libgamma_partition_restore(libgamma_partition_state_t* restrict this)
{
switch (this->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_partition_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_partition_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_partition_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_partition_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_partition_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_partition_restore(this);
#endif
@@ -643,28 +643,28 @@ int libgamma_crtc_initialise(libgamma_crtc_state_t* restrict this,
switch (partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_initialise(this, partition, crtc);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_crtc_initialise(this, partition, crtc);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_crtc_initialise(this, partition, crtc);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_crtc_initialise(this, partition, crtc);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_crtc_initialise(this, partition, crtc);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_crtc_initialise(this, partition, crtc);
#endif
@@ -683,33 +683,33 @@ void libgamma_crtc_destroy(libgamma_crtc_state_t* restrict this)
{
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
libgamma_dummy_crtc_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
libgamma_x_randr_crtc_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
libgamma_x_vidmode_crtc_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
libgamma_linux_drm_crtc_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
libgamma_w32_gdi_crtc_destroy(this);
break;
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
libgamma_quartz_cg_crtc_destroy(this);
break;
#endif
@@ -746,28 +746,28 @@ int libgamma_crtc_restore(libgamma_crtc_state_t* restrict this)
{
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_crtc_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_crtc_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_crtc_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_crtc_restore(this);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_crtc_restore(this);
#endif
@@ -789,7 +789,7 @@ int libgamma_crtc_restore(libgamma_crtc_state_t* restrict this)
int libgamma_get_crtc_information(libgamma_crtc_information_t* restrict this,
libgamma_crtc_state_t* restrict crtc, int32_t fields)
{
-#ifdef HAVE_NO_GAMMA_METHODS
+#ifdef HAVE_NO_LIBGAMMA_METHODS
(void) fields;
#endif
@@ -798,28 +798,28 @@ int libgamma_get_crtc_information(libgamma_crtc_information_t* restrict this,
switch (crtc->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_get_crtc_information(this, crtc, fields);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_get_crtc_information(this, crtc, fields);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_get_crtc_information(this, crtc, fields);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_get_crtc_information(this, crtc, fields);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_get_crtc_information(this, crtc, fields);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_get_crtc_information(this, crtc, fields);
#endif
@@ -968,34 +968,34 @@ unsigned char* libgamma_unhex_edid(const char* restrict edid)
int libgamma_crtc_get_gamma_ramps(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_t* restrict ramps)
{
-#ifdef HAVE_NO_GAMMA_METHODS
+#ifdef HAVE_NO_LIBGAMMA_METHODS
(void) ramps;
#endif
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_get_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_crtc_get_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_crtc_get_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_crtc_get_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_crtc_get_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
{
libgamma_gamma_ramps_any_t ramps_;
ramps_.bits16 = *ramps;
@@ -1021,34 +1021,34 @@ int libgamma_crtc_get_gamma_ramps(libgamma_crtc_state_t* restrict this,
int libgamma_crtc_set_gamma_ramps(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_t ramps)
{
-#ifdef HAVE_NO_GAMMA_METHODS
+#ifdef HAVE_NO_LIBGAMMA_METHODS
(void) ramps;
#endif
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_set_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_RANDR
- case GAMMA_METHOD_X_RANDR:
+#ifdef HAVE_LIBGAMMA_METHOD_X_RANDR
+ case LIBGAMMA_METHOD_X_RANDR:
return libgamma_x_randr_crtc_set_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_X_VIDMODE
- case GAMMA_METHOD_X_VIDMODE:
+#ifdef HAVE_LIBGAMMA_METHOD_X_VIDMODE
+ case LIBGAMMA_METHOD_X_VIDMODE:
return libgamma_x_vidmode_crtc_set_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
- case GAMMA_METHOD_LINUX_DRM:
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
+ case LIBGAMMA_METHOD_LINUX_DRM:
return libgamma_linux_drm_crtc_set_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_W32_GDI
- case GAMMA_METHOD_W32_GDI:
+#ifdef HAVE_LIBGAMMA_METHOD_W32_GDI
+ case LIBGAMMA_METHOD_W32_GDI:
return libgamma_w32_gdi_crtc_set_gamma_ramps(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
{
libgamma_gamma_ramps_any_t ramps_;
ramps_.bits16 = ramps;
@@ -1078,12 +1078,12 @@ int libgamma_crtc_get_gamma_ramps32(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_any_t ramps_;
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_get_gamma_ramps32(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
ramps_.bits32 = *ramps;
return libgamma_translated_ramp_get(this, &ramps_, 32, -1,
libgamma_crtc_get_gamma_ramps);
@@ -1111,12 +1111,12 @@ int libgamma_crtc_set_gamma_ramps32(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_any_t ramps_;
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_set_gamma_ramps32(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
ramps_.bits32 = ramps;
return libgamma_translated_ramp_set(this, ramps_, 32, -1,
libgamma_crtc_set_gamma_ramps);
@@ -1145,12 +1145,12 @@ int libgamma_crtc_get_gamma_ramps64(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_any_t ramps_;
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_get_gamma_ramps64(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
ramps_.bits64 = *ramps;
return libgamma_translated_ramp_get(this, &ramps_, 64, -1,
libgamma_crtc_get_gamma_ramps);
@@ -1178,12 +1178,12 @@ int libgamma_crtc_set_gamma_ramps64(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_any_t ramps_;
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_set_gamma_ramps64(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
ramps_.bits64 = ramps;
return libgamma_translated_ramp_set(this, ramps_, 64, -1,
libgamma_crtc_set_gamma_ramps);
@@ -1212,12 +1212,12 @@ int libgamma_crtc_get_gamma_rampsf(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_any_t ramps_;
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_get_gamma_rampsf(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_crtc_get_gamma_rampsf(this, ramps);
#endif
@@ -1242,12 +1242,12 @@ int libgamma_crtc_set_gamma_rampsf(libgamma_crtc_state_t* restrict this,
{
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_set_gamma_rampsf(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
return libgamma_quartz_cg_crtc_set_gamma_rampsf(this, ramps);
#endif
@@ -1277,12 +1277,12 @@ int libgamma_crtc_get_gamma_rampsd(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_any_t ramps_;
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_get_gamma_rampsd(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
ramps_.float_double = *ramps;
return libgamma_translated_ramp_get(this, &ramps_, -2, -1,
libgamma_crtc_get_gamma_ramps);
@@ -1310,12 +1310,12 @@ int libgamma_crtc_set_gamma_rampsd(libgamma_crtc_state_t* restrict this,
libgamma_gamma_ramps_any_t ramps_;
switch (this->partition->site->method)
{
-#ifdef HAVE_GAMMA_METHOD_DUMMY
- case GAMMA_METHOD_DUMMY:
+#ifdef HAVE_LIBGAMMA_METHOD_DUMMY
+ case LIBGAMMA_METHOD_DUMMY:
return libgamma_dummy_crtc_set_gamma_rampsd(this, ramps);
#endif
-#ifdef HAVE_GAMMA_METHOD_QUARTZ_CORE_GRAPHICS
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
+#ifdef HAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS:
ramps_.float_double = ramps;
return libgamma_translated_ramp_set(this, ramps_, -2, -1,
libgamma_crtc_set_gamma_ramps);
@@ -1350,7 +1350,7 @@ int libgamma_crtc_set_gamma_ramps_f(libgamma_crtc_state_t* restrict this,
size_t i, n;
int e;
- if (libgamma_get_crtc_information(&info, this, CRTC_INFO_GAMMA_SIZE))
+ if (libgamma_get_crtc_information(&info, this, LIBGAMMA_CRTC_INFO_GAMMA_SIZE))
{
e = info.gamma_size_error;
if (e < 0)
@@ -1403,7 +1403,7 @@ int libgamma_crtc_set_gamma_ramps32_f(libgamma_crtc_state_t* restrict this,
size_t i, n;
int e;
- if (libgamma_get_crtc_information(&info, this, CRTC_INFO_GAMMA_SIZE))
+ if (libgamma_get_crtc_information(&info, this, LIBGAMMA_CRTC_INFO_GAMMA_SIZE))
{
e = info.gamma_size_error;
if (e < 0)
@@ -1456,7 +1456,7 @@ int libgamma_crtc_set_gamma_ramps64_f(libgamma_crtc_state_t* restrict this,
size_t i, n;
int e;
- if (libgamma_get_crtc_information(&info, this, CRTC_INFO_GAMMA_SIZE))
+ if (libgamma_get_crtc_information(&info, this, LIBGAMMA_CRTC_INFO_GAMMA_SIZE))
{
e = info.gamma_size_error;
if (e < 0)
@@ -1509,7 +1509,7 @@ int libgamma_crtc_set_gamma_rampsf_f(libgamma_crtc_state_t* restrict this,
size_t i, n;
int e;
- if (libgamma_get_crtc_information(&info, this, CRTC_INFO_GAMMA_SIZE))
+ if (libgamma_get_crtc_information(&info, this, LIBGAMMA_CRTC_INFO_GAMMA_SIZE))
{
e = info.gamma_size_error;
if (e < 0)
@@ -1562,7 +1562,7 @@ int libgamma_crtc_set_gamma_rampsd_f(libgamma_crtc_state_t* restrict this,
size_t i, n;
int e;
- if (libgamma_get_crtc_information(&info, this, CRTC_INFO_GAMMA_SIZE))
+ if (libgamma_get_crtc_information(&info, this, LIBGAMMA_CRTC_INFO_GAMMA_SIZE))
{
e = info.gamma_size_error;
if (e < 0)
@@ -1596,7 +1596,7 @@ int libgamma_crtc_set_gamma_rampsd_f(libgamma_crtc_state_t* restrict this,
-#ifdef HAVE_NO_GAMMA_METHODS
+#ifdef HAVE_NO_LIBGAMMA_METHODS
# pragma GCC diagnostic pop
#endif
diff --git a/src/libgamma-facade.h b/src/libgamma-facade.h
index 8f17a04..db5075b 100644
--- a/src/libgamma-facade.h
+++ b/src/libgamma-facade.h
@@ -76,8 +76,8 @@ typedef double libgamma_gamma_rampsd_fun(double encoding);
/**
* List available adjustment methods by their order of preference based on the environment.
*
- * @param methods Output array of methods, should be able to hold `GAMMA_METHOD_COUNT` elements
- * @param buf_size The number of elements that fits in `methods`, it should be `GAMMA_METHOD_COUNT`,
+ * @param methods Output array of methods, should be able to hold `LIBGAMMA_METHOD_COUNT` elements
+ * @param buf_size The number of elements that fits in `methods`, it should be `LIBGAMMA_METHOD_COUNT`,
* This is used to avoid writing outside the output buffer if this library adds new
* adjustment methods without the users of the library recompiling.
* @param operation Allowed values:
diff --git a/src/libgamma-method.c b/src/libgamma-method.c
index 67be316..4c81549 100644
--- a/src/libgamma-method.c
+++ b/src/libgamma-method.c
@@ -233,7 +233,7 @@ void libgamma_gamma_rampsf_free(libgamma_gamma_rampsf_t* restrict this)
int libgamma_gamma_rampsd_initialise(libgamma_gamma_rampsd_t* restrict this)
{
size_t n = this->red_size + this->green_size + this->blue_size;
-#ifdef HAVE_GAMMA_METHOD_LINUX_DRM
+#ifdef HAVE_LIBGAMMA_METHOD_LINUX_DRM
/* Valgrind complains about us reading uninitialize memory if we just use malloc. */
this->red = calloc(n, sizeof(double));
#else
diff --git a/src/libgamma-method.h b/src/libgamma-method.h
index 901cfe0..4b79e30 100644
--- a/src/libgamma-method.h
+++ b/src/libgamma-method.h
@@ -33,13 +33,13 @@
* This method can be configured and is useful for
* testing your program's ability to handle errors.
*/
-#define GAMMA_METHOD_DUMMY 0
+#define LIBGAMMA_METHOD_DUMMY 0
/**
* The identifier for the adjustment method with
* uses the RandR protocol under the X display server.
*/
-#define GAMMA_METHOD_X_RANDR 1
+#define LIBGAMMA_METHOD_X_RANDR 1
/**
* The identifier for the adjustment method with
@@ -49,7 +49,7 @@
* supported by RandR, however it can only control the
* primary CRTC per screen (partition).
*/
-#define GAMMA_METHOD_X_VIDMODE 2
+#define LIBGAMMA_METHOD_X_VIDMODE 2
/**
* The identifier for the Direct Rendering Manager
@@ -62,7 +62,7 @@
* started while this is running, but it can be
* started while a display server is running.
*/
-#define GAMMA_METHOD_LINUX_DRM 3
+#define LIBGAMMA_METHOD_LINUX_DRM 3
/**
* The identifier for the Graphics Device Interface
@@ -70,7 +70,7 @@
* This method is not well tested; it can be compiled
* to be available under X.org using a translation layer.
*/
-#define GAMMA_METHOD_W32_GDI 4
+#define LIBGAMMA_METHOD_W32_GDI 4
/**
* The identifier for the Core Graphics adjustment
@@ -79,7 +79,7 @@
* This method is not well tested; it can be compiled
* to be available under X.org using a translation layer.
*/
-#define GAMMA_METHOD_QUARTZ_CORE_GRAPHICS 5
+#define LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS 5
/**
@@ -87,14 +87,14 @@
* nor any index before it may actually be supported
* as it could have been disabled at compile-time
*/
-#define GAMMA_METHOD_MAX 5
+#define LIBGAMMA_METHOD_MAX 5
/**
* The number adjustment methods provided by this library.
* Note however that this includes adjstment methods that
* have been removed at compile-time.
*/
-#define GAMMA_METHOD_COUNT (GAMMA_METHOD_MAX + 1)
+#define LIBGAMMA_METHOD_COUNT (LIBGAMMA_METHOD_MAX + 1)
@@ -388,84 +388,84 @@ typedef enum libgamma_subpixel_order
* For a `libgamma_crtc_information_t` fill in the
* values for `edid` and `edid_length` and report errors to `edid_error`.
*/
-#define CRTC_INFO_EDID (1 << 0)
+#define LIBGAMMA_CRTC_INFO_EDID (1 << 0)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `width_mm` and report errors to `width_mm_error`.
*/
-#define CRTC_INFO_WIDTH_MM (1 << 1)
+#define LIBGAMMA_CRTC_INFO_WIDTH_MM (1 << 1)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `height_mm` and report errors to `height_mm_error`.
*/
-#define CRTC_INFO_HEIGHT_MM (1 << 2)
+#define LIBGAMMA_CRTC_INFO_HEIGHT_MM (1 << 2)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `width_mm_edid` and report errors to `width_mm_edid_error`.
*/
-#define CRTC_INFO_WIDTH_MM_EDID (1 << 3)
+#define LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID (1 << 3)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `height_mm_edid` and report errors to `height_mm_edid_error`.
*/
-#define CRTC_INFO_HEIGHT_MM_EDID (1 << 4)
+#define LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID (1 << 4)
/**
* For a `libgamma_crtc_information_t` fill in the
* values for `red_gamma_size`, `green_gamma_size` and `blue_gamma_size`.
* and report errors to `gamma_size_error`
*/
-#define CRTC_INFO_GAMMA_SIZE (1 << 5)
+#define LIBGAMMA_CRTC_INFO_GAMMA_SIZE (1 << 5)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `gamma_depth` and report errors to `gamma_depth_error`.
*/
-#define CRTC_INFO_GAMMA_DEPTH (1 << 6)
+#define LIBGAMMA_CRTC_INFO_GAMMA_DEPTH (1 << 6)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `gamma_support` and report errors to `gamma_support_error`.
*/
-#define CRTC_INFO_GAMMA_SUPPORT (1 << 7)
+#define LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT (1 << 7)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `subpixel_order` and report errors to `subpixel_order_error`.
*/
-#define CRTC_INFO_SUBPIXEL_ORDER (1 << 8)
+#define LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER (1 << 8)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `active` and report errors to `active_error`.
*/
-#define CRTC_INFO_ACTIVE (1 << 9)
+#define LIBGAMMA_CRTC_INFO_ACTIVE (1 << 9)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `connector_name` and report errors to `connector_name_error`.
*/
-#define CRTC_INFO_CONNECTOR_NAME (1 << 10)
+#define LIBGAMMA_CRTC_INFO_CONNECTOR_NAME (1 << 10)
/**
* For a `libgamma_crtc_information_t` fill in the
* value for `connector_type` and report errors to `connector_type_error`.
*/
-#define CRTC_INFO_CONNECTOR_TYPE (1 << 11)
+#define LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE (1 << 11)
/**
* For a `libgamma_crtc_information_t` fill in the
* values for `gamma_red`, `gamma_green` and `gamma_blue`
* and report errors to `connector_type_error`.
*/
-#define CRTC_INFO_GAMMA (1 << 12)
+#define LIBGAMMA_CRTC_INFO_GAMMA (1 << 12)
/**
- * The number of `CRTC_INFO_*` values defined.
+ * The number of `LIBGAMMA_CRTC_INFO_*` values defined.
*/
#define LIBGAMMA_CRTC_INFO_COUNT = 13
diff --git a/test/test.c b/test/test.c
index 65a65b6..43541d0 100644
--- a/test/test.c
+++ b/test/test.c
@@ -25,14 +25,14 @@ static const char* method_name(int method)
{
switch (method)
{
- case GAMMA_METHOD_DUMMY: return "dummy";
- case GAMMA_METHOD_X_RANDR: return "RandR X extension";
- case GAMMA_METHOD_X_VIDMODE: return "VidMode X extension";
- case GAMMA_METHOD_LINUX_DRM: return "Linux DRM";
- case GAMMA_METHOD_W32_GDI: return "Windows GDI";
- case GAMMA_METHOD_QUARTZ_CORE_GRAPHICS: return "Quartz using Core Graphics";
+ case LIBGAMMA_METHOD_DUMMY: return "dummy";
+ case LIBGAMMA_METHOD_X_RANDR: return "RandR X extension";
+ case LIBGAMMA_METHOD_X_VIDMODE: return "VidMode X extension";
+ case LIBGAMMA_METHOD_LINUX_DRM: return "Linux DRM";
+ case LIBGAMMA_METHOD_W32_GDI: return "Windows GDI";
+ case LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS: return "Quartz using Core Graphics";
default:
-#if GAMMA_METHOD_COUNT != 6
+#if LIBGAMMA_METHOD_COUNT != 6
# warning List of adjustment methods is out of date
#endif
return "(unknown)";
@@ -42,11 +42,11 @@ static const char* method_name(int method)
int main(void)
{
- int* methods = malloc(GAMMA_METHOD_COUNT * sizeof(int));
- size_t n = libgamma_list_methods(methods, GAMMA_METHOD_COUNT, 0);
+ int* methods = malloc(LIBGAMMA_METHOD_COUNT * sizeof(int));
+ size_t n = libgamma_list_methods(methods, LIBGAMMA_METHOD_COUNT, 0);
size_t i;
- if (n > GAMMA_METHOD_COUNT)
+ if (n > LIBGAMMA_METHOD_COUNT)
{
printf("Warning: you should to recompile the program, libgamma has been updated.\n");
methods = realloc(methods, n * sizeof(int));