From 052c587dd5c3381fb36fe169ea76de7c4dccb520 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 13 Dec 2012 01:56:33 +0100 Subject: [PATCH] Shortened monitor-related tokens. --- include/GL/glfw3.h | 12 ++++++------ src/monitor.c | 9 ++++----- tests/events.c | 6 +++--- tests/modes.c | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index 9b51fbb2..a5cbc452 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -689,21 +689,21 @@ extern "C" { /*! @brief The physical width, in mm, of the monitor. * @ingroup monitor */ -#define GLFW_MONITOR_PHYSICAL_WIDTH 0x00060001 +#define GLFW_MONITOR_WIDTH_MM 0x00060001 /*! @brief The physical height, in mm, of the monitor. * @ingroup monitor */ -#define GLFW_MONITOR_PHYSICAL_HEIGHT 0x00060002 +#define GLFW_MONITOR_HEIGHT_MM 0x00060002 /*! @brief The x-coordinate of the upper-left corner of the monitor on the * virtual desktop. * @ingroup monitor */ -#define GLFW_MONITOR_POS_X 0x00060003 +#define GLFW_MONITOR_POS_X 0x00060003 /*! @brief The y-coordinate of the upper-left corner of the monitor on the * virtual desktop. * @ingroup monitor */ -#define GLFW_MONITOR_POS_Y 0x00060004 +#define GLFW_MONITOR_POS_Y 0x00060004 /* @} */ /*! @name Monitor events @@ -711,11 +711,11 @@ extern "C" { /*! @brief The monitor was connected. * @ingroup monitor */ -#define GLFW_MONITOR_CONNECTED 0x00061000 +#define GLFW_CONNECTED 0x00061000 /*! @brief The monitor was disconnected. * @ingroup monitor */ -#define GLFW_MONITOR_DISCONNECTED 0x00061001 +#define GLFW_DISCONNECTED 0x00061001 /* @} */ /************************************************************************* diff --git a/src/monitor.c b/src/monitor.c index 1f19bf7d..0ae667f1 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -150,7 +150,7 @@ void _glfwInputMonitorChange(void) if (j == _glfwLibrary.monitorCount) { // This monitor was not connected before - _glfwLibrary.monitorCallback(monitors[i], GLFW_MONITOR_CONNECTED); + _glfwLibrary.monitorCallback(monitors[i], GLFW_CONNECTED); } } @@ -162,8 +162,7 @@ void _glfwInputMonitorChange(void) continue; // This monitor is no longer connected - _glfwLibrary.monitorCallback(_glfwLibrary.monitors[i], - GLFW_MONITOR_DISCONNECTED); + _glfwLibrary.monitorCallback(_glfwLibrary.monitors[i], GLFW_DISCONNECTED); for (window = _glfwLibrary.windowListHead; window; window = window->next) { @@ -314,9 +313,9 @@ GLFWAPI int glfwGetMonitorParam(GLFWmonitor handle, int param) switch (param) { - case GLFW_MONITOR_PHYSICAL_WIDTH: + case GLFW_MONITOR_WIDTH_MM: return monitor->physicalWidth; - case GLFW_MONITOR_PHYSICAL_HEIGHT: + case GLFW_MONITOR_HEIGHT_MM: return monitor->physicalHeight; case GLFW_MONITOR_POS_X: return monitor->positionX; diff --git a/tests/events.c b/tests/events.c index e812ef33..aca2e793 100644 --- a/tests/events.c +++ b/tests/events.c @@ -339,7 +339,7 @@ static void char_callback(GLFWwindow window, int character) void monitor_callback(GLFWmonitor monitor, int event) { - if (event == GLFW_MONITOR_CONNECTED) + if (event == GLFW_CONNECTED) { GLFWvidmode mode; glfwGetVideoMode(monitor, &mode); @@ -351,8 +351,8 @@ void monitor_callback(GLFWmonitor monitor, int event) mode.width, mode.height, glfwGetMonitorParam(monitor, GLFW_MONITOR_POS_X), glfwGetMonitorParam(monitor, GLFW_MONITOR_POS_Y), - glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_WIDTH), - glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_HEIGHT)); + glfwGetMonitorParam(monitor, GLFW_MONITOR_WIDTH_MM), + glfwGetMonitorParam(monitor, GLFW_MONITOR_HEIGHT_MM)); } else { diff --git a/tests/modes.c b/tests/modes.c index d8121425..8a260eaf 100644 --- a/tests/modes.c +++ b/tests/modes.c @@ -104,8 +104,8 @@ static void list_modes(GLFWmonitor monitor) glfwGetMonitorParam(monitor, GLFW_MONITOR_POS_X), glfwGetMonitorParam(monitor, GLFW_MONITOR_POS_Y)); - widthMM = glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_WIDTH); - heightMM = glfwGetMonitorParam(monitor, GLFW_MONITOR_PHYSICAL_HEIGHT); + widthMM = glfwGetMonitorParam(monitor, GLFW_MONITOR_WIDTH_MM); + heightMM = glfwGetMonitorParam(monitor, GLFW_MONITOR_HEIGHT_MM); dpi = (int) ((float) mode.width * 25.4f / (float) widthMM); printf("Physical size: %i x %i mm (%i dpi)\n", widthMM, heightMM, dpi);