Internal header cleanup.

This commit is contained in:
Camilla Berglund 2014-09-02 19:42:43 +02:00
parent c85294e0b2
commit f8d80a936f
17 changed files with 113 additions and 229 deletions

View File

@ -54,14 +54,8 @@ typedef void* id;
#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorNS ns #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorNS ns
//======================================================================== // Cocoa-specific per-window data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific window structure
//------------------------------------------------------------------------
typedef struct _GLFWwindowNS typedef struct _GLFWwindowNS
{ {
id object; id object;
@ -69,12 +63,12 @@ typedef struct _GLFWwindowNS
id view; id view;
unsigned int modifierFlags; unsigned int modifierFlags;
int cursorInside; int cursorInside;
} _GLFWwindowNS; } _GLFWwindowNS;
//------------------------------------------------------------------------ // Cocoa-specific global data
// Platform-specific library global data for Cocoa //
//------------------------------------------------------------------------
typedef struct _GLFWlibraryNS typedef struct _GLFWlibraryNS
{ {
CGEventSourceRef eventSource; CGEventSourceRef eventSource;
@ -87,9 +81,8 @@ typedef struct _GLFWlibraryNS
} _GLFWlibraryNS; } _GLFWlibraryNS;
//------------------------------------------------------------------------ // Cocoa-specific per-monitor data
// Platform-specific monitor structure //
//------------------------------------------------------------------------
typedef struct _GLFWmonitorNS typedef struct _GLFWmonitorNS
{ {
CGDirectDisplayID displayID; CGDirectDisplayID displayID;
@ -99,33 +92,27 @@ typedef struct _GLFWmonitorNS
} _GLFWmonitorNS; } _GLFWmonitorNS;
//------------------------------------------------------------------------ // Cocoa-specific per-cursor data
// Platform-specific cursor structure //
//------------------------------------------------------------------------
typedef struct _GLFWcursorNS typedef struct _GLFWcursorNS
{ {
id object; id object;
} _GLFWcursorNS; } _GLFWcursorNS;
//------------------------------------------------------------------------ // Cocoa-specific global timer data
// Platform-specific time structure //
//------------------------------------------------------------------------
typedef struct _GLFWtimeNS typedef struct _GLFWtimeNS
{ {
double base; double base;
double resolution; double resolution;
} _GLFWtimeNS; } _GLFWtimeNS;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
// Time
void _glfwInitTimer(void); void _glfwInitTimer(void);
// Fullscreen
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired); GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor); void _glfwRestoreVideoMode(_GLFWmonitor* monitor);

View File

@ -45,13 +45,8 @@
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryEGL egl #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryEGL egl
//======================================================================== // EGL-specific per-context data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific OpenGL context structure
//------------------------------------------------------------------------
typedef struct _GLFWcontextEGL typedef struct _GLFWcontextEGL
{ {
EGLConfig config; EGLConfig config;
@ -61,12 +56,12 @@ typedef struct _GLFWcontextEGL
#if defined(_GLFW_X11) #if defined(_GLFW_X11)
XVisualInfo* visual; XVisualInfo* visual;
#endif #endif
} _GLFWcontextEGL; } _GLFWcontextEGL;
//------------------------------------------------------------------------ // EGL-specific global data
// Platform-specific library global data for EGL //
//------------------------------------------------------------------------
typedef struct _GLFWlibraryEGL typedef struct _GLFWlibraryEGL
{ {
EGLDisplay display; EGLDisplay display;
@ -77,10 +72,6 @@ typedef struct _GLFWlibraryEGL
} _GLFWlibraryEGL; } _GLFWlibraryEGL;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
int _glfwInitContextAPI(void); int _glfwInitContextAPI(void);
void _glfwTerminateContextAPI(void); void _glfwTerminateContextAPI(void);
int _glfwCreateContext(_GLFWwindow* window, int _glfwCreateContext(_GLFWwindow* window,

View File

@ -66,27 +66,22 @@ typedef int (*PFNGLXSWAPINTERVALMESAPROC)(int);
#endif #endif
//======================================================================== // GLX-specific per-context data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific OpenGL context structure
//------------------------------------------------------------------------
typedef struct _GLFWcontextGLX typedef struct _GLFWcontextGLX
{ {
GLXContext context; // OpenGL rendering context // Rendering context
XVisualInfo* visual; // Visual for selected GLXFBConfig GLXContext context;
// Visual of selected GLXFBConfig
XVisualInfo* visual;
} _GLFWcontextGLX; } _GLFWcontextGLX;
//------------------------------------------------------------------------ // GLX-specific global data
// Platform-specific library global data for GLX //
//------------------------------------------------------------------------
typedef struct _GLFWlibraryGLX typedef struct _GLFWlibraryGLX
{ {
// Server-side GLX version
int versionMajor, versionMinor; int versionMajor, versionMinor;
int eventBase; int eventBase;
int errorBase; int errorBase;
@ -108,15 +103,13 @@ typedef struct _GLFWlibraryGLX
GLboolean ARB_context_flush_control; GLboolean ARB_context_flush_control;
#if defined(_GLFW_DLOPEN_LIBGL) #if defined(_GLFW_DLOPEN_LIBGL)
void* libGL; // dlopen handle for libGL.so // dlopen handle for libGL.so (for glfwGetProcAddress)
void* libGL;
#endif #endif
} _GLFWlibraryGLX; } _GLFWlibraryGLX;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
int _glfwInitContextAPI(void); int _glfwInitContextAPI(void);
void _glfwTerminateContextAPI(void); void _glfwTerminateContextAPI(void);
int _glfwCreateContext(_GLFWwindow* window, int _glfwCreateContext(_GLFWwindow* window,

View File

@ -135,7 +135,7 @@ typedef struct _GLFWcursor _GLFWcursor;
//======================================================================== //========================================================================
// Internal types // Platform-independent structures
//======================================================================== //========================================================================
/*! @brief Window configuration. /*! @brief Window configuration.
@ -298,7 +298,6 @@ struct _GLFWmonitor
/*! @brief Cursor structure /*! @brief Cursor structure
*/ */
struct _GLFWcursor struct _GLFWcursor
{ {
_GLFWcursor* next; _GLFWcursor* next;
@ -628,6 +627,7 @@ void _glfwPlatformDestroyCursor(_GLFWcursor* cursor);
*/ */
void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor); void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor);
//======================================================================== //========================================================================
// Event API functions // Event API functions
//======================================================================== //========================================================================

View File

@ -36,13 +36,8 @@
_GLFWjoystickIOKit iokit_js[GLFW_JOYSTICK_LAST + 1] _GLFWjoystickIOKit iokit_js[GLFW_JOYSTICK_LAST + 1]
//======================================================================== // IOKit-specific per-joystick data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific joystick structure
//------------------------------------------------------------------------
typedef struct _GLFWjoystickIOKit typedef struct _GLFWjoystickIOKit
{ {
int present; int present;
@ -56,13 +51,10 @@ typedef struct _GLFWjoystickIOKit
float* axes; float* axes;
unsigned char* buttons; unsigned char* buttons;
} _GLFWjoystickIOKit; } _GLFWjoystickIOKit;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
void _glfwInitJoysticks(void); void _glfwInitJoysticks(void);
void _glfwTerminateJoysticks(void); void _glfwTerminateJoysticks(void);

View File

@ -31,13 +31,8 @@
_GLFWjoystickLinux linux_js[GLFW_JOYSTICK_LAST + 1] _GLFWjoystickLinux linux_js[GLFW_JOYSTICK_LAST + 1]
//======================================================================== // Linux-specific per-joystick data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific joystick structure
//------------------------------------------------------------------------
typedef struct _GLFWjoystickLinux typedef struct _GLFWjoystickLinux
{ {
int present; int present;
@ -50,10 +45,6 @@ typedef struct _GLFWjoystickLinux
} _GLFWjoystickLinux; } _GLFWjoystickLinux;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
void _glfwInitJoysticks(void); void _glfwInitJoysticks(void);
void _glfwTerminateJoysticks(void); void _glfwTerminateJoysticks(void);

View File

@ -32,35 +32,26 @@
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl
//======================================================================== // NSGL-specific per-context data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific OpenGL context structure
//------------------------------------------------------------------------
typedef struct _GLFWcontextNSGL typedef struct _GLFWcontextNSGL
{ {
id pixelFormat; id pixelFormat;
id context; id context;
} _GLFWcontextNSGL; } _GLFWcontextNSGL;
//------------------------------------------------------------------------ // NSGL-specific global data
// Platform-specific library global data for NSGL //
//------------------------------------------------------------------------
typedef struct _GLFWlibraryNSGL typedef struct _GLFWlibraryNSGL
{ {
// dlopen handle for dynamically loading OpenGL extension entry points // dlopen handle for OpenGL.framework (for glfwGetProcAddress)
void* framework; void* framework;
} _GLFWlibraryNSGL; } _GLFWlibraryNSGL;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
int _glfwInitContextAPI(void); int _glfwInitContextAPI(void);
void _glfwTerminateContextAPI(void); void _glfwTerminateContextAPI(void);
int _glfwCreateContext(_GLFWwindow* window, int _glfwCreateContext(_GLFWwindow* window,

View File

@ -32,6 +32,9 @@
#include <stdint.h> #include <stdint.h>
// POSIX-specific global timer data
//
typedef struct _GLFWtimePOSIX typedef struct _GLFWtimePOSIX
{ {
GLboolean monotonic; GLboolean monotonic;
@ -40,6 +43,7 @@ typedef struct _GLFWtimePOSIX
} _GLFWtimePOSIX; } _GLFWtimePOSIX;
void _glfwInitTimer(void); void _glfwInitTimer(void);
#endif // _posix_time_h_ #endif // _posix_time_h_

View File

@ -33,10 +33,8 @@
#define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsPOSIX posix_tls #define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsPOSIX posix_tls
//======================================================================== // POSIX-specific global TLS data
// GLFW platform specific types //
//========================================================================
typedef struct _GLFWtlsPOSIX typedef struct _GLFWtlsPOSIX
{ {
pthread_key_t context; pthread_key_t context;
@ -44,10 +42,6 @@ typedef struct _GLFWtlsPOSIX
} _GLFWtlsPOSIX; } _GLFWtlsPOSIX;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
int _glfwInitTLS(void); int _glfwInitTLS(void);
void _glfwTerminateTLS(void); void _glfwTerminateTLS(void);
void _glfwSetCurrentContext(_GLFWwindow* context); void _glfwSetCurrentContext(_GLFWwindow* context);

View File

@ -38,20 +38,14 @@
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl
//======================================================================== // WGL-specific per-context data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific OpenGL context structure
//------------------------------------------------------------------------
typedef struct _GLFWcontextWGL typedef struct _GLFWcontextWGL
{ {
// Platform specific window resources
HDC dc; // Private GDI device context HDC dc; // Private GDI device context
HGLRC context; // Permanent rendering context HGLRC context; // Permanent rendering context
// Platform specific extensions (context specific) // WGL extensions (context specific)
PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT; PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT;
PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB; PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB;
PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT; PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT;
@ -66,15 +60,15 @@ typedef struct _GLFWcontextWGL
GLboolean EXT_create_context_es2_profile; GLboolean EXT_create_context_es2_profile;
GLboolean ARB_create_context_robustness; GLboolean ARB_create_context_robustness;
GLboolean ARB_context_flush_control; GLboolean ARB_context_flush_control;
} _GLFWcontextWGL; } _GLFWcontextWGL;
//------------------------------------------------------------------------ // WGL-specific global data
// Platform-specific library global data for WGL //
//------------------------------------------------------------------------
typedef struct _GLFWlibraryWGL typedef struct _GLFWlibraryWGL
{ {
// opengl32.dll // opengl32.dll (for glfwGetProcAddress)
struct { struct {
HINSTANCE instance; HINSTANCE instance;
} opengl32; } opengl32;
@ -82,10 +76,6 @@ typedef struct _GLFWlibraryWGL
} _GLFWlibraryWGL; } _GLFWlibraryWGL;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
int _glfwInitContextAPI(void); int _glfwInitContextAPI(void);
void _glfwTerminateContextAPI(void); void _glfwTerminateContextAPI(void);
int _glfwCreateContext(_GLFWwindow* window, int _glfwCreateContext(_GLFWwindow* window,

View File

@ -72,9 +72,7 @@
#endif #endif
//======================================================================== // HACK: Define macros that some older windows.h variants don't
// Hack: Define things that some windows.h variants don't
//========================================================================
#ifndef WM_MOUSEHWHEEL #ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E #define WM_MOUSEHWHEEL 0x020E
@ -105,10 +103,6 @@ typedef struct tagCHANGEFILTERSTRUCT
#endif /*Windows 7*/ #endif /*Windows 7*/
//========================================================================
// DLLs that are loaded at glfwInit()
//========================================================================
// winmm.dll function pointer typedefs // winmm.dll function pointer typedefs
typedef MMRESULT (WINAPI * JOYGETDEVCAPS_T)(UINT,LPJOYCAPS,UINT); typedef MMRESULT (WINAPI * JOYGETDEVCAPS_T)(UINT,LPJOYCAPS,UINT);
typedef MMRESULT (WINAPI * JOYGETPOS_T)(UINT,LPJOYINFO); typedef MMRESULT (WINAPI * JOYGETPOS_T)(UINT,LPJOYINFO);
@ -156,32 +150,24 @@ typedef HRESULT (WINAPI * DWMISCOMPOSITIONENABLED_T)(BOOL*);
#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorWin32 win32 #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorWin32 win32
//======================================================================== // Win32-specific per-window data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific window structure
//------------------------------------------------------------------------
typedef struct _GLFWwindowWin32 typedef struct _GLFWwindowWin32
{ {
// Platform specific window resources HWND handle;
HWND handle; // Window handle DWORD dwStyle;
DWORD dwStyle; // Window styles used for window creation DWORD dwExStyle;
DWORD dwExStyle; // --"--
// Various platform specific internal variables
GLboolean cursorCentered; GLboolean cursorCentered;
GLboolean cursorInside; GLboolean cursorInside;
GLboolean cursorHidden; GLboolean cursorHidden;
int oldCursorX, oldCursorY; int oldCursorX, oldCursorY;
} _GLFWwindowWin32; } _GLFWwindowWin32;
//------------------------------------------------------------------------ // Win32-specific global data
// Platform-specific library global data for Win32 //
//------------------------------------------------------------------------
typedef struct _GLFWlibraryWin32 typedef struct _GLFWlibraryWin32
{ {
DWORD foregroundLockTimeout; DWORD foregroundLockTimeout;
@ -209,13 +195,11 @@ typedef struct _GLFWlibraryWin32
DWMISCOMPOSITIONENABLED_T DwmIsCompositionEnabled; DWMISCOMPOSITIONENABLED_T DwmIsCompositionEnabled;
} dwmapi; } dwmapi;
} _GLFWlibraryWin32; } _GLFWlibraryWin32;
//------------------------------------------------------------------------ // Win32-specific per-monitor data
// Platform-specific monitor structure //
//------------------------------------------------------------------------
typedef struct _GLFWmonitorWin32 typedef struct _GLFWmonitorWin32
{ {
// This size matches the static size of DISPLAY_DEVICE.DeviceName // This size matches the static size of DISPLAY_DEVICE.DeviceName
@ -225,18 +209,17 @@ typedef struct _GLFWmonitorWin32
} _GLFWmonitorWin32; } _GLFWmonitorWin32;
//------------------------------------------------------------------------ // Win32-specific per-cursor data
// Platform-specific cursor structure //
//------------------------------------------------------------------------
typedef struct _GLFWcursorWin32 typedef struct _GLFWcursorWin32
{ {
HCURSOR handle; HCURSOR handle;
} _GLFWcursorWin32; } _GLFWcursorWin32;
//------------------------------------------------------------------------ // Win32-specific global timer data
// Platform-specific time structure //
//------------------------------------------------------------------------
typedef struct _GLFWtimeWin32 typedef struct _GLFWtimeWin32
{ {
GLboolean hasPC; GLboolean hasPC;
@ -246,27 +229,17 @@ typedef struct _GLFWtimeWin32
} _GLFWtimeWin32; } _GLFWtimeWin32;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
// Window class
GLboolean _glfwRegisterWindowClass(void); GLboolean _glfwRegisterWindowClass(void);
void _glfwUnregisterWindowClass(void); void _glfwUnregisterWindowClass(void);
// Desktop compositing
BOOL _glfwIsCompositionEnabled(void); BOOL _glfwIsCompositionEnabled(void);
// Wide strings
WCHAR* _glfwCreateWideStringFromUTF8(const char* source); WCHAR* _glfwCreateWideStringFromUTF8(const char* source);
char* _glfwCreateUTF8FromWideString(const WCHAR* source); char* _glfwCreateUTF8FromWideString(const WCHAR* source);
// Time
void _glfwInitTimer(void); void _glfwInitTimer(void);
// Fullscreen support
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired); GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor); void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
#endif // _win32_platform_h_ #endif // _win32_platform_h_

View File

@ -31,10 +31,8 @@
#define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsWin32 win32_tls #define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsWin32 win32_tls
//======================================================================== // Win32-specific global TLS data
// GLFW platform specific types //
//========================================================================
typedef struct _GLFWtlsWin32 typedef struct _GLFWtlsWin32
{ {
GLboolean allocated; GLboolean allocated;
@ -43,10 +41,6 @@ typedef struct _GLFWtlsWin32
} _GLFWtlsWin32; } _GLFWtlsWin32;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
int _glfwInitTLS(void); int _glfwInitTLS(void);
void _glfwTerminateTLS(void); void _glfwTerminateTLS(void);
void _glfwSetCurrentContext(_GLFWwindow* context); void _glfwSetCurrentContext(_GLFWwindow* context);

View File

@ -31,13 +31,8 @@
_GLFWjoystickWinMM winmm_js[GLFW_JOYSTICK_LAST + 1] _GLFWjoystickWinMM winmm_js[GLFW_JOYSTICK_LAST + 1]
//======================================================================== // WinMM-specific per-joystick data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific joystick structure
//------------------------------------------------------------------------
typedef struct _GLFWjoystickWinMM typedef struct _GLFWjoystickWinMM
{ {
float axes[6]; float axes[6];
@ -46,10 +41,6 @@ typedef struct _GLFWjoystickWinMM
} _GLFWjoystickWinMM; } _GLFWjoystickWinMM;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
void _glfwInitJoysticks(void); void _glfwInitJoysticks(void);
void _glfwTerminateJoysticks(void); void _glfwTerminateJoysticks(void);

View File

@ -50,8 +50,13 @@
#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorWayland wl #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorWayland wl
// Wayland-specific video mode data
//
typedef struct _GLFWvidmodeWayland _GLFWvidmodeWayland; typedef struct _GLFWvidmodeWayland _GLFWvidmodeWayland;
// Wayland-specific per-window data
//
typedef struct _GLFWwindowWayland typedef struct _GLFWwindowWayland
{ {
int width, height; int width, height;
@ -61,8 +66,12 @@ typedef struct _GLFWwindowWayland
struct wl_shell_surface* shell_surface; struct wl_shell_surface* shell_surface;
EGLSurface egl_surface; EGLSurface egl_surface;
struct wl_callback* callback; struct wl_callback* callback;
} _GLFWwindowWayland; } _GLFWwindowWayland;
// Wayland-specific global data
//
typedef struct _GLFWlibraryWayland typedef struct _GLFWlibraryWayland
{ {
struct wl_display* display; struct wl_display* display;
@ -90,8 +99,12 @@ typedef struct _GLFWlibraryWayland
_GLFWwindow* pointerFocus; _GLFWwindow* pointerFocus;
_GLFWwindow* keyboardFocus; _GLFWwindow* keyboardFocus;
} _GLFWlibraryWayland; } _GLFWlibraryWayland;
// Wayland-specific per-monitor data
//
typedef struct _GLFWmonitorWayland typedef struct _GLFWmonitorWayland
{ {
struct wl_output* output; struct wl_output* output;
@ -103,18 +116,19 @@ typedef struct _GLFWmonitorWayland
int x; int x;
int y; int y;
} _GLFWmonitorWayland; } _GLFWmonitorWayland;
// Wayland-specific per-cursor data
//
typedef struct _GLFWcursorWayland typedef struct _GLFWcursorWayland
{ {
int dummy; int dummy;
} _GLFWcursorWayland; } _GLFWcursorWayland;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
void _glfwAddOutput(uint32_t name, uint32_t version); void _glfwAddOutput(uint32_t name, uint32_t version);
#endif // _wayland_platform_h_ #endif // _wayland_platform_h_

View File

@ -618,7 +618,7 @@ static int errorHandler(Display *display, XErrorEvent* event)
////// GLFW internal API ////// ////// GLFW internal API //////
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Install the X error handler // Sets the X error handler callback
// //
void _glfwGrabXErrorHandler(void) void _glfwGrabXErrorHandler(void)
{ {
@ -626,7 +626,7 @@ void _glfwGrabXErrorHandler(void)
XSetErrorHandler(errorHandler); XSetErrorHandler(errorHandler);
} }
// Remove the X error handler // Clears the X error handler callback
// //
void _glfwReleaseXErrorHandler(void) void _glfwReleaseXErrorHandler(void)
{ {
@ -635,7 +635,7 @@ void _glfwReleaseXErrorHandler(void)
XSetErrorHandler(NULL); XSetErrorHandler(NULL);
} }
// Report X error // Reports the specified error, appending information about the last X error
// //
void _glfwInputXError(int error, const char* message) void _glfwInputXError(int error, const char* message)
{ {
@ -646,7 +646,7 @@ void _glfwInputXError(int error, const char* message)
_glfwInputError(error, "%s: %s", message, buffer); _glfwInputError(error, "%s: %s", message, buffer);
} }
// Create a cursor object // Creates a native cursor object from the specified image and hotspot
// //
Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot)
{ {

View File

@ -72,22 +72,14 @@
#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorX11 x11 #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorX11 x11
//======================================================================== // X11-specific per-window data
// GLFW platform specific types //
//========================================================================
//------------------------------------------------------------------------
// Platform-specific window structure
//------------------------------------------------------------------------
typedef struct _GLFWwindowX11 typedef struct _GLFWwindowX11
{ {
// Platform specific window resources Colormap colormap;
Colormap colormap; // Window colormap Window handle;
Window handle; // Window handle
// Various platform specific internal variables GLboolean overrideRedirect;
GLboolean overrideRedirect; // True if window is OverrideRedirect
// Cached position and size used to filter out duplicate events // Cached position and size used to filter out duplicate events
int width, height; int width, height;
@ -101,9 +93,8 @@ typedef struct _GLFWwindowX11
} _GLFWwindowX11; } _GLFWwindowX11;
//------------------------------------------------------------------------ // X11-specific global data
// Platform-specific library global data for X11 //
//------------------------------------------------------------------------
typedef struct _GLFWlibraryX11 typedef struct _GLFWlibraryX11
{ {
Display* display; Display* display;
@ -214,9 +205,8 @@ typedef struct _GLFWlibraryX11
} _GLFWlibraryX11; } _GLFWlibraryX11;
//------------------------------------------------------------------------ // X11-specific per-monitor data
// Platform-specific monitor structure //
//------------------------------------------------------------------------
typedef struct _GLFWmonitorX11 typedef struct _GLFWmonitorX11
{ {
RROutput output; RROutput output;
@ -226,41 +216,30 @@ typedef struct _GLFWmonitorX11
} _GLFWmonitorX11; } _GLFWmonitorX11;
//------------------------------------------------------------------------ // X11-specific per-cursor data
// Platform-specific cursor structure //
//------------------------------------------------------------------------
typedef struct _GLFWcursorX11 typedef struct _GLFWcursorX11
{ {
Cursor handle; Cursor handle;
} _GLFWcursorX11; } _GLFWcursorX11;
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
// Gamma
void _glfwInitGammaRamp(void);
// Fullscreen support
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired); GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor); void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
// Clipboard handling
void _glfwHandleSelectionClear(XEvent* event); void _glfwHandleSelectionClear(XEvent* event);
void _glfwHandleSelectionRequest(XEvent* event); void _glfwHandleSelectionRequest(XEvent* event);
void _glfwPushSelectionToManager(_GLFWwindow* window); void _glfwPushSelectionToManager(_GLFWwindow* window);
Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot); Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
// Window support
_GLFWwindow* _glfwFindWindowByHandle(Window handle); _GLFWwindow* _glfwFindWindowByHandle(Window handle);
unsigned long _glfwGetWindowProperty(Window window, unsigned long _glfwGetWindowProperty(Window window,
Atom property, Atom property,
Atom type, Atom type,
unsigned char** value); unsigned char** value);
// X11 error handler
void _glfwGrabXErrorHandler(void); void _glfwGrabXErrorHandler(void);
void _glfwReleaseXErrorHandler(void); void _glfwReleaseXErrorHandler(void);
void _glfwInputXError(int error, const char* message); void _glfwInputXError(int error, const char* message);

View File

@ -27,7 +27,7 @@
#ifndef _xkb_unicode_h_ #ifndef _xkb_unicode_h_
#define _xkb_unicode_h_ #define _xkb_unicode_h_
// Unicode support
long _glfwKeySym2Unicode(unsigned int keysym); long _glfwKeySym2Unicode(unsigned int keysym);
#endif // _xkb_unicode_h_ #endif // _xkb_unicode_h_