Atlas - x11_platform.h
Home / ext / glfw / src Lines: 1 | Size: 44819 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1//======================================================================== 2// GLFW 3.5 X11 - www.glfw.org 3//------------------------------------------------------------------------ 4// Copyright (c) 2002-2006 Marcus Geelnard 5// Copyright (c) 2006-2019 Camilla Löwy <[email protected]> 6// 7// This software is provided 'as-is', without any express or implied 8// warranty. In no event will the authors be held liable for any damages 9// arising from the use of this software. 10// 11// Permission is granted to anyone to use this software for any purpose, 12// including commercial applications, and to alter it and redistribute it 13// freely, subject to the following restrictions: 14// 15// 1. The origin of this software must not be misrepresented; you must not 16// claim that you wrote the original software. If you use this software 17// in a product, an acknowledgment in the product documentation would 18// be appreciated but is not required. 19// 20// 2. Altered source versions must be plainly marked as such, and must not 21// be misrepresented as being the original software. 22// 23// 3. This notice may not be removed or altered from any source 24// distribution. 25// 26//======================================================================== 27 28#include <unistd.h> 29#include <signal.h> 30#include <stdint.h> 31 32#include <X11/Xlib.h> 33#include <X11/keysym.h> 34#include <X11/Xatom.h> 35#include <X11/Xresource.h> 36#include <X11/Xcursor/Xcursor.h> 37 38// The XRandR extension provides mode setting and gamma control 39#include <X11/extensions/Xrandr.h> 40 41// The Xkb extension provides improved keyboard support 42#include <X11/XKBlib.h> 43 44// The Xinerama extension provides legacy monitor indices 45#include <X11/extensions/Xinerama.h> 46 47// The XInput extension provides raw mouse motion input 48#include <X11/extensions/XInput2.h> 49 50// The Shape extension provides custom window shapes 51#include <X11/extensions/shape.h> 52 53#define GLX_VENDOR 1 54#define GLX_RGBA_BIT 0x00000001 55#define GLX_WINDOW_BIT 0x00000001 56#define GLX_DRAWABLE_TYPE 0x8010 57#define GLX_RENDER_TYPE 0x8011 58#define GLX_RGBA_TYPE 0x8014 59#define GLX_DOUBLEBUFFER 5 60#define GLX_STEREO 6 61#define GLX_AUX_BUFFERS 7 62#define GLX_RED_SIZE 8 63#define GLX_GREEN_SIZE 9 64#define GLX_BLUE_SIZE 10 65#define GLX_ALPHA_SIZE 11 66#define GLX_DEPTH_SIZE 12 67#define GLX_STENCIL_SIZE 13 68#define GLX_ACCUM_RED_SIZE 14 69#define GLX_ACCUM_GREEN_SIZE 15 70#define GLX_ACCUM_BLUE_SIZE 16 71#define GLX_ACCUM_ALPHA_SIZE 17 72#define GLX_SAMPLES 0x186a1 73#define GLX_VISUAL_ID 0x800b 74 75#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20b2 76#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 77#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 78#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 79#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 80#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 81#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 82#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 83#define GLX_CONTEXT_FLAGS_ARB 0x2094 84#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 85#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 86#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 87#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 88#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 89#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 90#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 91#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 92#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB 0x31b3 93 94typedef XID GLXWindow; 95typedef XID GLXDrawable; 96typedef struct __GLXFBConfig* GLXFBConfig; 97typedef struct __GLXcontext* GLXContext; 98typedef void (*__GLXextproc)(void); 99 100typedef XClassHint* (* PFN_XAllocClassHint)(void); 101typedef XSizeHints* (* PFN_XAllocSizeHints)(void); 102typedef XWMHints* (* PFN_XAllocWMHints)(void); 103typedef int (* PFN_XChangeProperty)(Display*,Window,Atom,Atom,int,int,const unsigned char*,int); 104typedef int (* PFN_XChangeWindowAttributes)(Display*,Window,unsigned long,XSetWindowAttributes*); 105typedef Bool (* PFN_XCheckIfEvent)(Display*,XEvent*,Bool(*)(Display*,XEvent*,XPointer),XPointer); 106typedef Bool (* PFN_XCheckTypedWindowEvent)(Display*,Window,int,XEvent*); 107typedef int (* PFN_XCloseDisplay)(Display*); 108typedef Status (* PFN_XCloseIM)(XIM); 109typedef int (* PFN_XConvertSelection)(Display*,Atom,Atom,Atom,Window,Time); 110typedef Colormap (* PFN_XCreateColormap)(Display*,Window,Visual*,int); 111typedef Cursor (* PFN_XCreateFontCursor)(Display*,unsigned int); 112typedef XIC (* PFN_XCreateIC)(XIM,...); 113typedef Region (* PFN_XCreateRegion)(void); 114typedef Window (* PFN_XCreateWindow)(Display*,Window,int,int,unsigned int,unsigned int,unsigned int,int,unsigned int,Visual*,unsigned long,XSetWindowAttributes*); 115typedef int (* PFN_XDefineCursor)(Display*,Window,Cursor); 116typedef int (* PFN_XDeleteContext)(Display*,XID,XContext); 117typedef int (* PFN_XDeleteProperty)(Display*,Window,Atom); 118typedef void (* PFN_XDestroyIC)(XIC); 119typedef int (* PFN_XDestroyRegion)(Region); 120typedef int (* PFN_XDestroyWindow)(Display*,Window); 121typedef int (* PFN_XDisplayKeycodes)(Display*,int*,int*); 122typedef int (* PFN_XEventsQueued)(Display*,int); 123typedef Bool (* PFN_XFilterEvent)(XEvent*,Window); 124typedef int (* PFN_XFindContext)(Display*,XID,XContext,XPointer*); 125typedef int (* PFN_XFlush)(Display*); 126typedef int (* PFN_XFree)(void*); 127typedef int (* PFN_XFreeColormap)(Display*,Colormap); 128typedef int (* PFN_XFreeCursor)(Display*,Cursor); 129typedef void (* PFN_XFreeEventData)(Display*,XGenericEventCookie*); 130typedef int (* PFN_XGetErrorText)(Display*,int,char*,int); 131typedef Bool (* PFN_XGetEventData)(Display*,XGenericEventCookie*); 132typedef char* (* PFN_XGetICValues)(XIC,...); 133typedef char* (* PFN_XGetIMValues)(XIM,...); 134typedef int (* PFN_XGetInputFocus)(Display*,Window*,int*); 135typedef KeySym* (* PFN_XGetKeyboardMapping)(Display*,KeyCode,int,int*); 136typedef int (* PFN_XGetScreenSaver)(Display*,int*,int*,int*,int*); 137typedef Window (* PFN_XGetSelectionOwner)(Display*,Atom); 138typedef XVisualInfo* (* PFN_XGetVisualInfo)(Display*,long,XVisualInfo*,int*); 139typedef Status (* PFN_XGetWMNormalHints)(Display*,Window,XSizeHints*,long*); 140typedef Status (* PFN_XGetWindowAttributes)(Display*,Window,XWindowAttributes*); 141typedef int (* PFN_XGetWindowProperty)(Display*,Window,Atom,long,long,Bool,Atom,Atom*,int*,unsigned long*,unsigned long*,unsigned char**); 142typedef int (* PFN_XGrabPointer)(Display*,Window,Bool,unsigned int,int,int,Window,Cursor,Time); 143typedef Status (* PFN_XIconifyWindow)(Display*,Window,int); 144typedef Status (* PFN_XInitThreads)(void); 145typedef Atom (* PFN_XInternAtom)(Display*,const char*,Bool); 146typedef int (* PFN_XLookupString)(XKeyEvent*,char*,int,KeySym*,XComposeStatus*); 147typedef int (* PFN_XMapRaised)(Display*,Window); 148typedef int (* PFN_XMapWindow)(Display*,Window); 149typedef int (* PFN_XMoveResizeWindow)(Display*,Window,int,int,unsigned int,unsigned int); 150typedef int (* PFN_XMoveWindow)(Display*,Window,int,int); 151typedef int (* PFN_XNextEvent)(Display*,XEvent*); 152typedef Display* (* PFN_XOpenDisplay)(const char*); 153typedef XIM (* PFN_XOpenIM)(Display*,XrmDatabase*,char*,char*); 154typedef int (* PFN_XPeekEvent)(Display*,XEvent*); 155typedef int (* PFN_XPending)(Display*); 156typedef Bool (* PFN_XQueryExtension)(Display*,const char*,int*,int*,int*); 157typedef Bool (* PFN_XQueryPointer)(Display*,Window,Window*,Window*,int*,int*,int*,int*,unsigned int*); 158typedef int (* PFN_XRaiseWindow)(Display*,Window); 159typedef Bool (* PFN_XRegisterIMInstantiateCallback)(Display*,void*,char*,char*,XIDProc,XPointer); 160typedef int (* PFN_XResizeWindow)(Display*,Window,unsigned int,unsigned int); 161typedef char* (* PFN_XResourceManagerString)(Display*); 162typedef int (* PFN_XSaveContext)(Display*,XID,XContext,const char*); 163typedef int (* PFN_XSelectInput)(Display*,Window,long); 164typedef Status (* PFN_XSendEvent)(Display*,Window,Bool,long,XEvent*); 165typedef int (* PFN_XSetClassHint)(Display*,Window,XClassHint*); 166typedef XErrorHandler (* PFN_XSetErrorHandler)(XErrorHandler); 167typedef void (* PFN_XSetICFocus)(XIC); 168typedef char* (* PFN_XSetIMValues)(XIM,...); 169typedef int (* PFN_XSetInputFocus)(Display*,Window,int,Time); 170typedef char* (* PFN_XSetLocaleModifiers)(const char*); 171typedef int (* PFN_XSetScreenSaver)(Display*,int,int,int,int); 172typedef int (* PFN_XSetSelectionOwner)(Display*,Atom,Window,Time); 173typedef int (* PFN_XSetWMHints)(Display*,Window,XWMHints*); 174typedef void (* PFN_XSetWMNormalHints)(Display*,Window,XSizeHints*); 175typedef Status (* PFN_XSetWMProtocols)(Display*,Window,Atom*,int); 176typedef Bool (* PFN_XSupportsLocale)(void); 177typedef int (* PFN_XSync)(Display*,Bool); 178typedef Bool (* PFN_XTranslateCoordinates)(Display*,Window,Window,int,int,int*,int*,Window*); 179typedef int (* PFN_XUndefineCursor)(Display*,Window); 180typedef int (* PFN_XUngrabPointer)(Display*,Time); 181typedef int (* PFN_XUnmapWindow)(Display*,Window); 182typedef void (* PFN_XUnsetICFocus)(XIC); 183typedef VisualID (* PFN_XVisualIDFromVisual)(Visual*); 184typedef int (* PFN_XWarpPointer)(Display*,Window,Window,int,int,unsigned int,unsigned int,int,int); 185typedef void (* PFN_XkbFreeKeyboard)(XkbDescPtr,unsigned int,Bool); 186typedef void (* PFN_XkbFreeNames)(XkbDescPtr,unsigned int,Bool); 187typedef XkbDescPtr (* PFN_XkbGetMap)(Display*,unsigned int,unsigned int); 188typedef Status (* PFN_XkbGetNames)(Display*,unsigned int,XkbDescPtr); 189typedef Status (* PFN_XkbGetState)(Display*,unsigned int,XkbStatePtr); 190typedef KeySym (* PFN_XkbKeycodeToKeysym)(Display*,KeyCode,int,int); 191typedef Bool (* PFN_XkbQueryExtension)(Display*,int*,int*,int*,int*,int*); 192typedef Bool (* PFN_XkbSelectEventDetails)(Display*,unsigned int,unsigned int,unsigned long,unsigned long); 193typedef Bool (* PFN_XkbSetDetectableAutoRepeat)(Display*,Bool,Bool*); 194typedef void (* PFN_XrmDestroyDatabase)(XrmDatabase); 195typedef Bool (* PFN_XrmGetResource)(XrmDatabase,const char*,const char*,char**,XrmValue*); 196typedef XrmDatabase (* PFN_XrmGetStringDatabase)(const char*); 197typedef void (* PFN_XrmInitialize)(void); 198typedef XrmQuark (* PFN_XrmUniqueQuark)(void); 199typedef Bool (* PFN_XUnregisterIMInstantiateCallback)(Display*,void*,char*,char*,XIDProc,XPointer); 200typedef int (* PFN_Xutf8LookupString)(XIC,XKeyPressedEvent*,char*,int,KeySym*,Status*); 201typedef void (* PFN_Xutf8SetWMProperties)(Display*,Window,const char*,const char*,char**,int,XSizeHints*,XWMHints*,XClassHint*); 202#define XAllocClassHint _glfw.x11.xlib.AllocClassHint 203#define XAllocSizeHints _glfw.x11.xlib.AllocSizeHints 204#define XAllocWMHints _glfw.x11.xlib.AllocWMHints 205#define XChangeProperty _glfw.x11.xlib.ChangeProperty 206#define XChangeWindowAttributes _glfw.x11.xlib.ChangeWindowAttributes 207#define XCheckIfEvent _glfw.x11.xlib.CheckIfEvent 208#define XCheckTypedWindowEvent _glfw.x11.xlib.CheckTypedWindowEvent 209#define XCloseDisplay _glfw.x11.xlib.CloseDisplay 210#define XCloseIM _glfw.x11.xlib.CloseIM 211#define XConvertSelection _glfw.x11.xlib.ConvertSelection 212#define XCreateColormap _glfw.x11.xlib.CreateColormap 213#define XCreateFontCursor _glfw.x11.xlib.CreateFontCursor 214#define XCreateIC _glfw.x11.xlib.CreateIC 215#define XCreateRegion _glfw.x11.xlib.CreateRegion 216#define XCreateWindow _glfw.x11.xlib.CreateWindow 217#define XDefineCursor _glfw.x11.xlib.DefineCursor 218#define XDeleteContext _glfw.x11.xlib.DeleteContext 219#define XDeleteProperty _glfw.x11.xlib.DeleteProperty 220#define XDestroyIC _glfw.x11.xlib.DestroyIC 221#define XDestroyRegion _glfw.x11.xlib.DestroyRegion 222#define XDestroyWindow _glfw.x11.xlib.DestroyWindow 223#define XDisplayKeycodes _glfw.x11.xlib.DisplayKeycodes 224#define XEventsQueued _glfw.x11.xlib.EventsQueued 225#define XFilterEvent _glfw.x11.xlib.FilterEvent 226#define XFindContext _glfw.x11.xlib.FindContext 227#define XFlush _glfw.x11.xlib.Flush 228#define XFree _glfw.x11.xlib.Free 229#define XFreeColormap _glfw.x11.xlib.FreeColormap 230#define XFreeCursor _glfw.x11.xlib.FreeCursor 231#define XFreeEventData _glfw.x11.xlib.FreeEventData 232#define XGetErrorText _glfw.x11.xlib.GetErrorText 233#define XGetEventData _glfw.x11.xlib.GetEventData 234#define XGetICValues _glfw.x11.xlib.GetICValues 235#define XGetIMValues _glfw.x11.xlib.GetIMValues 236#define XGetInputFocus _glfw.x11.xlib.GetInputFocus 237#define XGetKeyboardMapping _glfw.x11.xlib.GetKeyboardMapping 238#define XGetScreenSaver _glfw.x11.xlib.GetScreenSaver 239#define XGetSelectionOwner _glfw.x11.xlib.GetSelectionOwner 240#define XGetVisualInfo _glfw.x11.xlib.GetVisualInfo 241#define XGetWMNormalHints _glfw.x11.xlib.GetWMNormalHints 242#define XGetWindowAttributes _glfw.x11.xlib.GetWindowAttributes 243#define XGetWindowProperty _glfw.x11.xlib.GetWindowProperty 244#define XGrabPointer _glfw.x11.xlib.GrabPointer 245#define XIconifyWindow _glfw.x11.xlib.IconifyWindow 246#define XInternAtom _glfw.x11.xlib.InternAtom 247#define XLookupString _glfw.x11.xlib.LookupString 248#define XMapRaised _glfw.x11.xlib.MapRaised 249#define XMapWindow _glfw.x11.xlib.MapWindow 250#define XMoveResizeWindow _glfw.x11.xlib.MoveResizeWindow 251#define XMoveWindow _glfw.x11.xlib.MoveWindow 252#define XNextEvent _glfw.x11.xlib.NextEvent 253#define XOpenIM _glfw.x11.xlib.OpenIM 254#define XPeekEvent _glfw.x11.xlib.PeekEvent 255#define XPending _glfw.x11.xlib.Pending 256#define XQueryExtension _glfw.x11.xlib.QueryExtension 257#define XQueryPointer _glfw.x11.xlib.QueryPointer 258#define XRaiseWindow _glfw.x11.xlib.RaiseWindow 259#define XRegisterIMInstantiateCallback _glfw.x11.xlib.RegisterIMInstantiateCallback 260#define XResizeWindow _glfw.x11.xlib.ResizeWindow 261#define XResourceManagerString _glfw.x11.xlib.ResourceManagerString 262#define XSaveContext _glfw.x11.xlib.SaveContext 263#define XSelectInput _glfw.x11.xlib.SelectInput 264#define XSendEvent _glfw.x11.xlib.SendEvent 265#define XSetClassHint _glfw.x11.xlib.SetClassHint 266#define XSetErrorHandler _glfw.x11.xlib.SetErrorHandler 267#define XSetICFocus _glfw.x11.xlib.SetICFocus 268#define XSetIMValues _glfw.x11.xlib.SetIMValues 269#define XSetInputFocus _glfw.x11.xlib.SetInputFocus 270#define XSetLocaleModifiers _glfw.x11.xlib.SetLocaleModifiers 271#define XSetScreenSaver _glfw.x11.xlib.SetScreenSaver 272#define XSetSelectionOwner _glfw.x11.xlib.SetSelectionOwner 273#define XSetWMHints _glfw.x11.xlib.SetWMHints 274#define XSetWMNormalHints _glfw.x11.xlib.SetWMNormalHints 275#define XSetWMProtocols _glfw.x11.xlib.SetWMProtocols 276#define XSupportsLocale _glfw.x11.xlib.SupportsLocale 277#define XSync _glfw.x11.xlib.Sync 278#define XTranslateCoordinates _glfw.x11.xlib.TranslateCoordinates 279#define XUndefineCursor _glfw.x11.xlib.UndefineCursor 280#define XUngrabPointer _glfw.x11.xlib.UngrabPointer 281#define XUnmapWindow _glfw.x11.xlib.UnmapWindow 282#define XUnsetICFocus _glfw.x11.xlib.UnsetICFocus 283#define XVisualIDFromVisual _glfw.x11.xlib.VisualIDFromVisual 284#define XWarpPointer _glfw.x11.xlib.WarpPointer 285#define XkbFreeKeyboard _glfw.x11.xkb.FreeKeyboard 286#define XkbFreeNames _glfw.x11.xkb.FreeNames 287#define XkbGetMap _glfw.x11.xkb.GetMap 288#define XkbGetNames _glfw.x11.xkb.GetNames 289#define XkbGetState _glfw.x11.xkb.GetState 290#define XkbKeycodeToKeysym _glfw.x11.xkb.KeycodeToKeysym 291#define XkbQueryExtension _glfw.x11.xkb.QueryExtension 292#define XkbSelectEventDetails _glfw.x11.xkb.SelectEventDetails 293#define XkbSetDetectableAutoRepeat _glfw.x11.xkb.SetDetectableAutoRepeat 294#define XrmDestroyDatabase _glfw.x11.xrm.DestroyDatabase 295#define XrmGetResource _glfw.x11.xrm.GetResource 296#define XrmGetStringDatabase _glfw.x11.xrm.GetStringDatabase 297#define XrmUniqueQuark _glfw.x11.xrm.UniqueQuark 298#define XUnregisterIMInstantiateCallback _glfw.x11.xlib.UnregisterIMInstantiateCallback 299#define Xutf8LookupString _glfw.x11.xlib.utf8LookupString 300#define Xutf8SetWMProperties _glfw.x11.xlib.utf8SetWMProperties 301 302typedef XRRCrtcGamma* (* PFN_XRRAllocGamma)(int); 303typedef void (* PFN_XRRFreeCrtcInfo)(XRRCrtcInfo*); 304typedef void (* PFN_XRRFreeGamma)(XRRCrtcGamma*); 305typedef void (* PFN_XRRFreeOutputInfo)(XRROutputInfo*); 306typedef void (* PFN_XRRFreeScreenResources)(XRRScreenResources*); 307typedef XRRCrtcGamma* (* PFN_XRRGetCrtcGamma)(Display*,RRCrtc); 308typedef int (* PFN_XRRGetCrtcGammaSize)(Display*,RRCrtc); 309typedef XRRCrtcInfo* (* PFN_XRRGetCrtcInfo) (Display*,XRRScreenResources*,RRCrtc); 310typedef XRROutputInfo* (* PFN_XRRGetOutputInfo)(Display*,XRRScreenResources*,RROutput); 311typedef RROutput (* PFN_XRRGetOutputPrimary)(Display*,Window); 312typedef XRRScreenResources* (* PFN_XRRGetScreenResourcesCurrent)(Display*,Window); 313typedef Bool (* PFN_XRRQueryExtension)(Display*,int*,int*); 314typedef Status (* PFN_XRRQueryVersion)(Display*,int*,int*); 315typedef void (* PFN_XRRSelectInput)(Display*,Window,int); 316typedef Status (* PFN_XRRSetCrtcConfig)(Display*,XRRScreenResources*,RRCrtc,Time,int,int,RRMode,Rotation,RROutput*,int); 317typedef void (* PFN_XRRSetCrtcGamma)(Display*,RRCrtc,XRRCrtcGamma*); 318typedef int (* PFN_XRRUpdateConfiguration)(XEvent*); 319#define XRRAllocGamma _glfw.x11.randr.AllocGamma 320#define XRRFreeCrtcInfo _glfw.x11.randr.FreeCrtcInfo 321#define XRRFreeGamma _glfw.x11.randr.FreeGamma 322#define XRRFreeOutputInfo _glfw.x11.randr.FreeOutputInfo 323#define XRRFreeScreenResources _glfw.x11.randr.FreeScreenResources 324#define XRRGetCrtcGamma _glfw.x11.randr.GetCrtcGamma 325#define XRRGetCrtcGammaSize _glfw.x11.randr.GetCrtcGammaSize 326#define XRRGetCrtcInfo _glfw.x11.randr.GetCrtcInfo 327#define XRRGetOutputInfo _glfw.x11.randr.GetOutputInfo 328#define XRRGetOutputPrimary _glfw.x11.randr.GetOutputPrimary 329#define XRRGetScreenResourcesCurrent _glfw.x11.randr.GetScreenResourcesCurrent 330#define XRRQueryExtension _glfw.x11.randr.QueryExtension 331#define XRRQueryVersion _glfw.x11.randr.QueryVersion 332#define XRRSelectInput _glfw.x11.randr.SelectInput 333#define XRRSetCrtcConfig _glfw.x11.randr.SetCrtcConfig 334#define XRRSetCrtcGamma _glfw.x11.randr.SetCrtcGamma 335#define XRRUpdateConfiguration _glfw.x11.randr.UpdateConfiguration 336 337typedef XcursorImage* (* PFN_XcursorImageCreate)(int,int); 338typedef void (* PFN_XcursorImageDestroy)(XcursorImage*); 339typedef Cursor (* PFN_XcursorImageLoadCursor)(Display*,const XcursorImage*); 340typedef char* (* PFN_XcursorGetTheme)(Display*); 341typedef int (* PFN_XcursorGetDefaultSize)(Display*); 342typedef XcursorImage* (* PFN_XcursorLibraryLoadImage)(const char*,const char*,int); 343#define XcursorImageCreate _glfw.x11.xcursor.ImageCreate 344#define XcursorImageDestroy _glfw.x11.xcursor.ImageDestroy 345#define XcursorImageLoadCursor _glfw.x11.xcursor.ImageLoadCursor 346#define XcursorGetTheme _glfw.x11.xcursor.GetTheme 347#define XcursorGetDefaultSize _glfw.x11.xcursor.GetDefaultSize 348#define XcursorLibraryLoadImage _glfw.x11.xcursor.LibraryLoadImage 349 350typedef Bool (* PFN_XineramaIsActive)(Display*); 351typedef Bool (* PFN_XineramaQueryExtension)(Display*,int*,int*); 352typedef XineramaScreenInfo* (* PFN_XineramaQueryScreens)(Display*,int*); 353#define XineramaIsActive _glfw.x11.xinerama.IsActive 354#define XineramaQueryExtension _glfw.x11.xinerama.QueryExtension 355#define XineramaQueryScreens _glfw.x11.xinerama.QueryScreens 356 357typedef XID xcb_window_t; 358typedef XID xcb_visualid_t; 359typedef struct xcb_connection_t xcb_connection_t; 360typedef xcb_connection_t* (* PFN_XGetXCBConnection)(Display*); 361#define XGetXCBConnection _glfw.x11.x11xcb.GetXCBConnection 362 363typedef Bool (* PFN_XF86VidModeQueryExtension)(Display*,int*,int*); 364typedef Bool (* PFN_XF86VidModeGetGammaRamp)(Display*,int,int,unsigned short*,unsigned short*,unsigned short*); 365typedef Bool (* PFN_XF86VidModeSetGammaRamp)(Display*,int,int,unsigned short*,unsigned short*,unsigned short*); 366typedef Bool (* PFN_XF86VidModeGetGammaRampSize)(Display*,int,int*); 367#define XF86VidModeQueryExtension _glfw.x11.vidmode.QueryExtension 368#define XF86VidModeGetGammaRamp _glfw.x11.vidmode.GetGammaRamp 369#define XF86VidModeSetGammaRamp _glfw.x11.vidmode.SetGammaRamp 370#define XF86VidModeGetGammaRampSize _glfw.x11.vidmode.GetGammaRampSize 371 372typedef Status (* PFN_XIQueryVersion)(Display*,int*,int*); 373typedef int (* PFN_XISelectEvents)(Display*,Window,XIEventMask*,int); 374#define XIQueryVersion _glfw.x11.xi.QueryVersion 375#define XISelectEvents _glfw.x11.xi.SelectEvents 376 377typedef Bool (* PFN_XRenderQueryExtension)(Display*,int*,int*); 378typedef Status (* PFN_XRenderQueryVersion)(Display*dpy,int*,int*); 379typedef XRenderPictFormat* (* PFN_XRenderFindVisualFormat)(Display*,Visual const*); 380#define XRenderQueryExtension _glfw.x11.xrender.QueryExtension 381#define XRenderQueryVersion _glfw.x11.xrender.QueryVersion 382#define XRenderFindVisualFormat _glfw.x11.xrender.FindVisualFormat 383 384typedef Bool (* PFN_XShapeQueryExtension)(Display*,int*,int*); 385typedef Status (* PFN_XShapeQueryVersion)(Display*dpy,int*,int*); 386typedef void (* PFN_XShapeCombineRegion)(Display*,Window,int,int,int,Region,int); 387typedef void (* PFN_XShapeCombineMask)(Display*,Window,int,int,int,Pixmap,int); 388 389#define XShapeQueryExtension _glfw.x11.xshape.QueryExtension 390#define XShapeQueryVersion _glfw.x11.xshape.QueryVersion 391#define XShapeCombineRegion _glfw.x11.xshape.ShapeCombineRegion 392#define XShapeCombineMask _glfw.x11.xshape.ShapeCombineMask 393 394typedef int (*PFNGLXGETFBCONFIGATTRIBPROC)(Display*,GLXFBConfig,int,int*); 395typedef const char* (*PFNGLXGETCLIENTSTRINGPROC)(Display*,int); 396typedef Bool (*PFNGLXQUERYEXTENSIONPROC)(Display*,int*,int*); 397typedef Bool (*PFNGLXQUERYVERSIONPROC)(Display*,int*,int*); 398typedef void (*PFNGLXDESTROYCONTEXTPROC)(Display*,GLXContext); 399typedef Bool (*PFNGLXMAKECURRENTPROC)(Display*,GLXDrawable,GLXContext); 400typedef void (*PFNGLXSWAPBUFFERSPROC)(Display*,GLXDrawable); 401typedef const char* (*PFNGLXQUERYEXTENSIONSSTRINGPROC)(Display*,int); 402typedef GLXFBConfig* (*PFNGLXGETFBCONFIGSPROC)(Display*,int,int*); 403typedef GLXContext (*PFNGLXCREATENEWCONTEXTPROC)(Display*,GLXFBConfig,int,GLXContext,Bool); 404typedef __GLXextproc (* PFNGLXGETPROCADDRESSPROC)(const GLubyte *procName); 405typedef void (*PFNGLXSWAPINTERVALEXTPROC)(Display*,GLXDrawable,int); 406typedef XVisualInfo* (*PFNGLXGETVISUALFROMFBCONFIGPROC)(Display*,GLXFBConfig); 407typedef GLXWindow (*PFNGLXCREATEWINDOWPROC)(Display*,GLXFBConfig,Window,const int*); 408typedef void (*PFNGLXDESTROYWINDOWPROC)(Display*,GLXWindow); 409 410typedef int (*PFNGLXSWAPINTERVALMESAPROC)(int); 411typedef int (*PFNGLXSWAPINTERVALSGIPROC)(int); 412typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display*,GLXFBConfig,GLXContext,Bool,const int*); 413 414// libGL.so function pointer typedefs 415#define glXGetFBConfigs _glfw.glx.GetFBConfigs 416#define glXGetFBConfigAttrib _glfw.glx.GetFBConfigAttrib 417#define glXGetClientString _glfw.glx.GetClientString 418#define glXQueryExtension _glfw.glx.QueryExtension 419#define glXQueryVersion _glfw.glx.QueryVersion 420#define glXDestroyContext _glfw.glx.DestroyContext 421#define glXMakeCurrent _glfw.glx.MakeCurrent 422#define glXSwapBuffers _glfw.glx.SwapBuffers 423#define glXQueryExtensionsString _glfw.glx.QueryExtensionsString 424#define glXCreateNewContext _glfw.glx.CreateNewContext 425#define glXGetVisualFromFBConfig _glfw.glx.GetVisualFromFBConfig 426#define glXCreateWindow _glfw.glx.CreateWindow 427#define glXDestroyWindow _glfw.glx.DestroyWindow 428 429typedef VkFlags VkXlibSurfaceCreateFlagsKHR; 430typedef VkFlags VkXcbSurfaceCreateFlagsKHR; 431 432typedef struct VkXlibSurfaceCreateInfoKHR 433{ 434 VkStructureType sType; 435 const void* pNext; 436 VkXlibSurfaceCreateFlagsKHR flags; 437 Display* dpy; 438 Window window; 439} VkXlibSurfaceCreateInfoKHR; 440 441typedef struct VkXcbSurfaceCreateInfoKHR 442{ 443 VkStructureType sType; 444 const void* pNext; 445 VkXcbSurfaceCreateFlagsKHR flags; 446 xcb_connection_t* connection; 447 xcb_window_t window; 448} VkXcbSurfaceCreateInfoKHR; 449 450typedef VkResult (APIENTRY *PFN_vkCreateXlibSurfaceKHR)(VkInstance,const VkXlibSurfaceCreateInfoKHR*,const VkAllocationCallbacks*,VkSurfaceKHR*); 451typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice,uint32_t,Display*,VisualID); 452typedef VkResult (APIENTRY *PFN_vkCreateXcbSurfaceKHR)(VkInstance,const VkXcbSurfaceCreateInfoKHR*,const VkAllocationCallbacks*,VkSurfaceKHR*); 453typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice,uint32_t,xcb_connection_t*,xcb_visualid_t); 454 455#define GLFW_X11_WINDOW_STATE _GLFWwindowX11 x11; 456#define GLFW_X11_LIBRARY_WINDOW_STATE _GLFWlibraryX11 x11; 457#define GLFW_X11_MONITOR_STATE _GLFWmonitorX11 x11; 458#define GLFW_X11_CURSOR_STATE _GLFWcursorX11 x11; 459 460#define GLFW_GLX_CONTEXT_STATE _GLFWcontextGLX glx; 461#define GLFW_GLX_LIBRARY_CONTEXT_STATE _GLFWlibraryGLX glx; 462 463#define GLFW_INVALID_CODEPOINT 0xffffffffu 464 465// GLX-specific per-context data 466// 467typedef struct _GLFWcontextGLX 468{ 469 GLXContext handle; 470 GLXWindow window; 471 GLXFBConfig fbconfig; 472} _GLFWcontextGLX; 473 474// GLX-specific global data 475// 476typedef struct _GLFWlibraryGLX 477{ 478 int major, minor; 479 int eventBase; 480 int errorBase; 481 482 void* handle; 483 484 // GLX 1.3 functions 485 PFNGLXGETFBCONFIGSPROC GetFBConfigs; 486 PFNGLXGETFBCONFIGATTRIBPROC GetFBConfigAttrib; 487 PFNGLXGETCLIENTSTRINGPROC GetClientString; 488 PFNGLXQUERYEXTENSIONPROC QueryExtension; 489 PFNGLXQUERYVERSIONPROC QueryVersion; 490 PFNGLXDESTROYCONTEXTPROC DestroyContext; 491 PFNGLXMAKECURRENTPROC MakeCurrent; 492 PFNGLXSWAPBUFFERSPROC SwapBuffers; 493 PFNGLXQUERYEXTENSIONSSTRINGPROC QueryExtensionsString; 494 PFNGLXCREATENEWCONTEXTPROC CreateNewContext; 495 PFNGLXGETVISUALFROMFBCONFIGPROC GetVisualFromFBConfig; 496 PFNGLXCREATEWINDOWPROC CreateWindow; 497 PFNGLXDESTROYWINDOWPROC DestroyWindow; 498 499 // GLX 1.4 and extension functions 500 PFNGLXGETPROCADDRESSPROC GetProcAddress; 501 PFNGLXGETPROCADDRESSPROC GetProcAddressARB; 502 PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI; 503 PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT; 504 PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA; 505 PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB; 506 GLFWbool SGI_swap_control; 507 GLFWbool EXT_swap_control; 508 GLFWbool MESA_swap_control; 509 GLFWbool ARB_multisample; 510 GLFWbool ARB_framebuffer_sRGB; 511 GLFWbool EXT_framebuffer_sRGB; 512 GLFWbool ARB_create_context; 513 GLFWbool ARB_create_context_profile; 514 GLFWbool ARB_create_context_robustness; 515 GLFWbool EXT_create_context_es2_profile; 516 GLFWbool ARB_create_context_no_error; 517 GLFWbool ARB_context_flush_control; 518} _GLFWlibraryGLX; 519 520// X11-specific per-window data 521// 522typedef struct _GLFWwindowX11 523{ 524 Colormap colormap; 525 Window handle; 526 Window parent; 527 XIC ic; 528 529 GLFWbool overrideRedirect; 530 GLFWbool iconified; 531 GLFWbool maximized; 532 533 // Whether the visual supports framebuffer transparency 534 GLFWbool transparent; 535 536 // Cached position and size used to filter out duplicate events 537 int width, height; 538 int xpos, ypos; 539 540 // The last received cursor position, regardless of source 541 int lastCursorPosX, lastCursorPosY; 542 // The last position the cursor was warped to by GLFW 543 int warpCursorPosX, warpCursorPosY; 544 545 // The time of the last KeyPress event per keycode, for discarding 546 // duplicate key events generated for some keys by ibus 547 Time keyPressTimes[256]; 548} _GLFWwindowX11; 549 550// X11-specific global data 551// 552typedef struct _GLFWlibraryX11 553{ 554 Display* display; 555 int screen; 556 Window root; 557 558 // System content scale 559 float contentScaleX, contentScaleY; 560 // Helper window for IPC 561 Window helperWindowHandle; 562 // Invisible cursor for hidden cursor mode 563 Cursor hiddenCursorHandle; 564 // Context for mapping window XIDs to _GLFWwindow pointers 565 XContext context; 566 // XIM input method 567 XIM im; 568 // The previous X error handler, to be restored later 569 XErrorHandler errorHandler; 570 // Most recent error code received by X error handler 571 int errorCode; 572 // Primary selection string (while the primary selection is owned) 573 char* primarySelectionString; 574 // Clipboard string (while the selection is owned) 575 char* clipboardString; 576 // Key name string 577 char keynames[GLFW_KEY_LAST + 1][5]; 578 // X11 keycode to GLFW key LUT 579 short int keycodes[256]; 580 // GLFW key to X11 keycode LUT 581 short int scancodes[GLFW_KEY_LAST + 1]; 582 // Where to place the cursor when re-enabled 583 double restoreCursorPosX, restoreCursorPosY; 584 // The window whose disabled cursor mode is active 585 _GLFWwindow* disabledCursorWindow; 586 int emptyEventPipe[2]; 587 588 // Window manager atoms 589 Atom NET_SUPPORTED; 590 Atom NET_SUPPORTING_WM_CHECK; 591 Atom WM_PROTOCOLS; 592 Atom WM_STATE; 593 Atom WM_DELETE_WINDOW; 594 Atom NET_WM_NAME; 595 Atom NET_WM_ICON_NAME; 596 Atom NET_WM_ICON; 597 Atom NET_WM_PID; 598 Atom NET_WM_PING; 599 Atom NET_WM_WINDOW_TYPE; 600 Atom NET_WM_WINDOW_TYPE_NORMAL; 601 Atom NET_WM_STATE; 602 Atom NET_WM_STATE_ABOVE; 603 Atom NET_WM_STATE_FULLSCREEN; 604 Atom NET_WM_STATE_MAXIMIZED_VERT; 605 Atom NET_WM_STATE_MAXIMIZED_HORZ; 606 Atom NET_WM_STATE_DEMANDS_ATTENTION; 607 Atom NET_WM_BYPASS_COMPOSITOR; 608 Atom NET_WM_FULLSCREEN_MONITORS; 609 Atom NET_WM_WINDOW_OPACITY; 610 Atom NET_WM_CM_Sx; 611 Atom NET_WORKAREA; 612 Atom NET_CURRENT_DESKTOP; 613 Atom NET_ACTIVE_WINDOW; 614 Atom NET_FRAME_EXTENTS; 615 Atom NET_REQUEST_FRAME_EXTENTS; 616 Atom MOTIF_WM_HINTS; 617 618 // Xdnd (drag and drop) atoms 619 Atom XdndAware; 620 Atom XdndEnter; 621 Atom XdndPosition; 622 Atom XdndStatus; 623 Atom XdndActionCopy; 624 Atom XdndDrop; 625 Atom XdndFinished; 626 Atom XdndSelection; 627 Atom XdndTypeList; 628 Atom text_uri_list; 629 630 // Selection (clipboard) atoms 631 Atom TARGETS; 632 Atom MULTIPLE; 633 Atom INCR; 634 Atom CLIPBOARD; 635 Atom PRIMARY; 636 Atom CLIPBOARD_MANAGER; 637 Atom SAVE_TARGETS; 638 Atom NULL_; 639 Atom UTF8_STRING; 640 Atom COMPOUND_STRING; 641 Atom ATOM_PAIR; 642 Atom GLFW_SELECTION; 643 644 struct { 645 void* handle; 646 GLFWbool utf8; 647 PFN_XAllocClassHint AllocClassHint; 648 PFN_XAllocSizeHints AllocSizeHints; 649 PFN_XAllocWMHints AllocWMHints; 650 PFN_XChangeProperty ChangeProperty; 651 PFN_XChangeWindowAttributes ChangeWindowAttributes; 652 PFN_XCheckIfEvent CheckIfEvent; 653 PFN_XCheckTypedWindowEvent CheckTypedWindowEvent; 654 PFN_XCloseDisplay CloseDisplay; 655 PFN_XCloseIM CloseIM; 656 PFN_XConvertSelection ConvertSelection; 657 PFN_XCreateColormap CreateColormap; 658 PFN_XCreateFontCursor CreateFontCursor; 659 PFN_XCreateIC CreateIC; 660 PFN_XCreateRegion CreateRegion; 661 PFN_XCreateWindow CreateWindow; 662 PFN_XDefineCursor DefineCursor; 663 PFN_XDeleteContext DeleteContext; 664 PFN_XDeleteProperty DeleteProperty; 665 PFN_XDestroyIC DestroyIC; 666 PFN_XDestroyRegion DestroyRegion; 667 PFN_XDestroyWindow DestroyWindow; 668 PFN_XDisplayKeycodes DisplayKeycodes; 669 PFN_XEventsQueued EventsQueued; 670 PFN_XFilterEvent FilterEvent; 671 PFN_XFindContext FindContext; 672 PFN_XFlush Flush; 673 PFN_XFree Free; 674 PFN_XFreeColormap FreeColormap; 675 PFN_XFreeCursor FreeCursor; 676 PFN_XFreeEventData FreeEventData; 677 PFN_XGetErrorText GetErrorText; 678 PFN_XGetEventData GetEventData; 679 PFN_XGetICValues GetICValues; 680 PFN_XGetIMValues GetIMValues; 681 PFN_XGetInputFocus GetInputFocus; 682 PFN_XGetKeyboardMapping GetKeyboardMapping; 683 PFN_XGetScreenSaver GetScreenSaver; 684 PFN_XGetSelectionOwner GetSelectionOwner; 685 PFN_XGetVisualInfo GetVisualInfo; 686 PFN_XGetWMNormalHints GetWMNormalHints; 687 PFN_XGetWindowAttributes GetWindowAttributes; 688 PFN_XGetWindowProperty GetWindowProperty; 689 PFN_XGrabPointer GrabPointer; 690 PFN_XIconifyWindow IconifyWindow; 691 PFN_XInternAtom InternAtom; 692 PFN_XLookupString LookupString; 693 PFN_XMapRaised MapRaised; 694 PFN_XMapWindow MapWindow; 695 PFN_XMoveResizeWindow MoveResizeWindow; 696 PFN_XMoveWindow MoveWindow; 697 PFN_XNextEvent NextEvent; 698 PFN_XOpenIM OpenIM; 699 PFN_XPeekEvent PeekEvent; 700 PFN_XPending Pending; 701 PFN_XQueryExtension QueryExtension; 702 PFN_XQueryPointer QueryPointer; 703 PFN_XRaiseWindow RaiseWindow; 704 PFN_XRegisterIMInstantiateCallback RegisterIMInstantiateCallback; 705 PFN_XResizeWindow ResizeWindow; 706 PFN_XResourceManagerString ResourceManagerString; 707 PFN_XSaveContext SaveContext; 708 PFN_XSelectInput SelectInput; 709 PFN_XSendEvent SendEvent; 710 PFN_XSetClassHint SetClassHint; 711 PFN_XSetErrorHandler SetErrorHandler; 712 PFN_XSetICFocus SetICFocus; 713 PFN_XSetIMValues SetIMValues; 714 PFN_XSetInputFocus SetInputFocus; 715 PFN_XSetLocaleModifiers SetLocaleModifiers; 716 PFN_XSetScreenSaver SetScreenSaver; 717 PFN_XSetSelectionOwner SetSelectionOwner; 718 PFN_XSetWMHints SetWMHints; 719 PFN_XSetWMNormalHints SetWMNormalHints; 720 PFN_XSetWMProtocols SetWMProtocols; 721 PFN_XSupportsLocale SupportsLocale; 722 PFN_XSync Sync; 723 PFN_XTranslateCoordinates TranslateCoordinates; 724 PFN_XUndefineCursor UndefineCursor; 725 PFN_XUngrabPointer UngrabPointer; 726 PFN_XUnmapWindow UnmapWindow; 727 PFN_XUnsetICFocus UnsetICFocus; 728 PFN_XVisualIDFromVisual VisualIDFromVisual; 729 PFN_XWarpPointer WarpPointer; 730 PFN_XUnregisterIMInstantiateCallback UnregisterIMInstantiateCallback; 731 PFN_Xutf8LookupString utf8LookupString; 732 PFN_Xutf8SetWMProperties utf8SetWMProperties; 733 } xlib; 734 735 struct { 736 PFN_XrmDestroyDatabase DestroyDatabase; 737 PFN_XrmGetResource GetResource; 738 PFN_XrmGetStringDatabase GetStringDatabase; 739 PFN_XrmUniqueQuark UniqueQuark; 740 } xrm; 741 742 struct { 743 GLFWbool available; 744 void* handle; 745 int eventBase; 746 int errorBase; 747 int major; 748 int minor; 749 GLFWbool gammaBroken; 750 GLFWbool monitorBroken; 751 PFN_XRRAllocGamma AllocGamma; 752 PFN_XRRFreeCrtcInfo FreeCrtcInfo; 753 PFN_XRRFreeGamma FreeGamma; 754 PFN_XRRFreeOutputInfo FreeOutputInfo; 755 PFN_XRRFreeScreenResources FreeScreenResources; 756 PFN_XRRGetCrtcGamma GetCrtcGamma; 757 PFN_XRRGetCrtcGammaSize GetCrtcGammaSize; 758 PFN_XRRGetCrtcInfo GetCrtcInfo; 759 PFN_XRRGetOutputInfo GetOutputInfo; 760 PFN_XRRGetOutputPrimary GetOutputPrimary; 761 PFN_XRRGetScreenResourcesCurrent GetScreenResourcesCurrent; 762 PFN_XRRQueryExtension QueryExtension; 763 PFN_XRRQueryVersion QueryVersion; 764 PFN_XRRSelectInput SelectInput; 765 PFN_XRRSetCrtcConfig SetCrtcConfig; 766 PFN_XRRSetCrtcGamma SetCrtcGamma; 767 PFN_XRRUpdateConfiguration UpdateConfiguration; 768 } randr; 769 770 struct { 771 GLFWbool available; 772 GLFWbool detectable; 773 int majorOpcode; 774 int eventBase; 775 int errorBase; 776 int major; 777 int minor; 778 unsigned int group; 779 PFN_XkbFreeKeyboard FreeKeyboard; 780 PFN_XkbFreeNames FreeNames; 781 PFN_XkbGetMap GetMap; 782 PFN_XkbGetNames GetNames; 783 PFN_XkbGetState GetState; 784 PFN_XkbKeycodeToKeysym KeycodeToKeysym; 785 PFN_XkbQueryExtension QueryExtension; 786 PFN_XkbSelectEventDetails SelectEventDetails; 787 PFN_XkbSetDetectableAutoRepeat SetDetectableAutoRepeat; 788 } xkb; 789 790 struct { 791 int count; 792 int timeout; 793 int interval; 794 int blanking; 795 int exposure; 796 } saver; 797 798 struct { 799 int version; 800 Window source; 801 Atom format; 802 } xdnd; 803 804 struct { 805 void* handle; 806 PFN_XcursorImageCreate ImageCreate; 807 PFN_XcursorImageDestroy ImageDestroy; 808 PFN_XcursorImageLoadCursor ImageLoadCursor; 809 PFN_XcursorGetTheme GetTheme; 810 PFN_XcursorGetDefaultSize GetDefaultSize; 811 PFN_XcursorLibraryLoadImage LibraryLoadImage; 812 } xcursor; 813 814 struct { 815 GLFWbool available; 816 void* handle; 817 int major; 818 int minor; 819 PFN_XineramaIsActive IsActive; 820 PFN_XineramaQueryExtension QueryExtension; 821 PFN_XineramaQueryScreens QueryScreens; 822 } xinerama; 823 824 struct { 825 void* handle; 826 PFN_XGetXCBConnection GetXCBConnection; 827 } x11xcb; 828 829 struct { 830 GLFWbool available; 831 void* handle; 832 int eventBase; 833 int errorBase; 834 PFN_XF86VidModeQueryExtension QueryExtension; 835 PFN_XF86VidModeGetGammaRamp GetGammaRamp; 836 PFN_XF86VidModeSetGammaRamp SetGammaRamp; 837 PFN_XF86VidModeGetGammaRampSize GetGammaRampSize; 838 } vidmode; 839 840 struct { 841 GLFWbool available; 842 void* handle; 843 int majorOpcode; 844 int eventBase; 845 int errorBase; 846 int major; 847 int minor; 848 PFN_XIQueryVersion QueryVersion; 849 PFN_XISelectEvents SelectEvents; 850 } xi; 851 852 struct { 853 GLFWbool available; 854 void* handle; 855 int major; 856 int minor; 857 int eventBase; 858 int errorBase; 859 PFN_XRenderQueryExtension QueryExtension; 860 PFN_XRenderQueryVersion QueryVersion; 861 PFN_XRenderFindVisualFormat FindVisualFormat; 862 } xrender; 863 864 struct { 865 GLFWbool available; 866 void* handle; 867 int major; 868 int minor; 869 int eventBase; 870 int errorBase; 871 PFN_XShapeQueryExtension QueryExtension; 872 PFN_XShapeCombineRegion ShapeCombineRegion; 873 PFN_XShapeQueryVersion QueryVersion; 874 PFN_XShapeCombineMask ShapeCombineMask; 875 } xshape; 876} _GLFWlibraryX11; 877 878// X11-specific per-monitor data 879// 880typedef struct _GLFWmonitorX11 881{ 882 RROutput output; 883 RRCrtc crtc; 884 RRMode oldMode; 885 886 // Index of corresponding Xinerama screen, 887 // for EWMH full screen window placement 888 int index; 889} _GLFWmonitorX11; 890 891// X11-specific per-cursor data 892// 893typedef struct _GLFWcursorX11 894{ 895 Cursor handle; 896} _GLFWcursorX11; 897 898 899GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform); 900int _glfwInitX11(void); 901void _glfwTerminateX11(void); 902 903GLFWbool _glfwCreateWindowX11(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); 904void _glfwDestroyWindowX11(_GLFWwindow* window); 905void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title); 906void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images); 907void _glfwGetWindowPosX11(_GLFWwindow* window, int* xpos, int* ypos); 908void _glfwSetWindowPosX11(_GLFWwindow* window, int xpos, int ypos); 909void _glfwGetWindowSizeX11(_GLFWwindow* window, int* width, int* height); 910void _glfwSetWindowSizeX11(_GLFWwindow* window, int width, int height); 911void _glfwSetWindowSizeLimitsX11(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); 912void _glfwSetWindowAspectRatioX11(_GLFWwindow* window, int numer, int denom); 913void _glfwGetFramebufferSizeX11(_GLFWwindow* window, int* width, int* height); 914void _glfwGetWindowFrameSizeX11(_GLFWwindow* window, int* left, int* top, int* right, int* bottom); 915void _glfwGetWindowContentScaleX11(_GLFWwindow* window, float* xscale, float* yscale); 916void _glfwIconifyWindowX11(_GLFWwindow* window); 917void _glfwRestoreWindowX11(_GLFWwindow* window); 918void _glfwMaximizeWindowX11(_GLFWwindow* window); 919void _glfwShowWindowX11(_GLFWwindow* window); 920void _glfwHideWindowX11(_GLFWwindow* window); 921void _glfwRequestWindowAttentionX11(_GLFWwindow* window); 922void _glfwFocusWindowX11(_GLFWwindow* window); 923void _glfwSetWindowMonitorX11(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); 924GLFWbool _glfwWindowFocusedX11(_GLFWwindow* window); 925GLFWbool _glfwWindowIconifiedX11(_GLFWwindow* window); 926GLFWbool _glfwWindowVisibleX11(_GLFWwindow* window); 927GLFWbool _glfwWindowMaximizedX11(_GLFWwindow* window); 928GLFWbool _glfwWindowHoveredX11(_GLFWwindow* window); 929GLFWbool _glfwFramebufferTransparentX11(_GLFWwindow* window); 930void _glfwSetWindowResizableX11(_GLFWwindow* window, GLFWbool enabled); 931void _glfwSetWindowDecoratedX11(_GLFWwindow* window, GLFWbool enabled); 932void _glfwSetWindowFloatingX11(_GLFWwindow* window, GLFWbool enabled); 933float _glfwGetWindowOpacityX11(_GLFWwindow* window); 934void _glfwSetWindowOpacityX11(_GLFWwindow* window, float opacity); 935void _glfwSetWindowMousePassthroughX11(_GLFWwindow* window, GLFWbool enabled); 936 937void _glfwSetRawMouseMotionX11(_GLFWwindow *window, GLFWbool enabled); 938GLFWbool _glfwRawMouseMotionSupportedX11(void); 939 940void _glfwPollEventsX11(void); 941void _glfwWaitEventsX11(void); 942void _glfwWaitEventsTimeoutX11(double timeout); 943void _glfwPostEmptyEventX11(void); 944 945void _glfwGetCursorPosX11(_GLFWwindow* window, double* xpos, double* ypos); 946void _glfwSetCursorPosX11(_GLFWwindow* window, double xpos, double ypos); 947void _glfwSetCursorModeX11(_GLFWwindow* window, int mode); 948const char* _glfwGetScancodeNameX11(int scancode); 949int _glfwGetKeyScancodeX11(int key); 950GLFWbool _glfwCreateCursorX11(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot); 951GLFWbool _glfwCreateStandardCursorX11(_GLFWcursor* cursor, int shape); 952void _glfwDestroyCursorX11(_GLFWcursor* cursor); 953void _glfwSetCursorX11(_GLFWwindow* window, _GLFWcursor* cursor); 954void _glfwSetClipboardStringX11(const char* string); 955const char* _glfwGetClipboardStringX11(void); 956 957EGLenum _glfwGetEGLPlatformX11(EGLint** attribs); 958EGLNativeDisplayType _glfwGetEGLNativeDisplayX11(void); 959EGLNativeWindowType _glfwGetEGLNativeWindowX11(_GLFWwindow* window); 960 961void _glfwGetRequiredInstanceExtensionsX11(char** extensions); 962GLFWbool _glfwGetPhysicalDevicePresentationSupportX11(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); 963VkResult _glfwCreateWindowSurfaceX11(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); 964 965void _glfwFreeMonitorX11(_GLFWmonitor* monitor); 966void _glfwGetMonitorPosX11(_GLFWmonitor* monitor, int* xpos, int* ypos); 967void _glfwGetMonitorContentScaleX11(_GLFWmonitor* monitor, float* xscale, float* yscale); 968void _glfwGetMonitorWorkareaX11(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height); 969GLFWvidmode* _glfwGetVideoModesX11(_GLFWmonitor* monitor, int* count); 970GLFWbool _glfwGetVideoModeX11(_GLFWmonitor* monitor, GLFWvidmode* mode); 971GLFWbool _glfwGetGammaRampX11(_GLFWmonitor* monitor, GLFWgammaramp* ramp); 972void _glfwSetGammaRampX11(_GLFWmonitor* monitor, const GLFWgammaramp* ramp); 973 974void _glfwPollMonitorsX11(void); 975void _glfwSetVideoModeX11(_GLFWmonitor* monitor, const GLFWvidmode* desired); 976void _glfwRestoreVideoModeX11(_GLFWmonitor* monitor); 977 978Cursor _glfwCreateNativeCursorX11(const GLFWimage* image, int xhot, int yhot); 979 980unsigned long _glfwGetWindowPropertyX11(Window window, 981 Atom property, 982 Atom type, 983 unsigned char** value); 984GLFWbool _glfwIsVisualTransparentX11(Visual* visual); 985 986uint32_t _glfwKeySym2UnicodeX11(unsigned int keysym); 987 988void _glfwGrabErrorHandlerX11(void); 989void _glfwReleaseErrorHandlerX11(void); 990void _glfwInputErrorX11(int error, const char* message); 991 992void _glfwPushSelectionToManagerX11(void); 993void _glfwCreateInputContextX11(_GLFWwindow* window); 994 995GLFWbool _glfwInitGLX(void); 996void _glfwTerminateGLX(void); 997GLFWbool _glfwCreateContextGLX(_GLFWwindow* window, 998 const _GLFWctxconfig* ctxconfig, 999 const _GLFWfbconfig* fbconfig); 1000void _glfwDestroyContextGLX(_GLFWwindow* window); 1001GLFWbool _glfwChooseVisualGLX(const _GLFWwndconfig* wndconfig, 1002 const _GLFWctxconfig* ctxconfig, 1003 const _GLFWfbconfig* fbconfig, 1004 Visual** visual, int* depth); 1005 1006[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.