ScrapExplorer - x11_platform.h

Home / ext / glfw / src Lines: 1 | Size: 44771 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#include "xkb_unicode.h" 456#include "posix_poll.h" 457 458#define GLFW_X11_WINDOW_STATE _GLFWwindowX11 x11; 459#define GLFW_X11_LIBRARY_WINDOW_STATE _GLFWlibraryX11 x11; 460#define GLFW_X11_MONITOR_STATE _GLFWmonitorX11 x11; 461#define GLFW_X11_CURSOR_STATE _GLFWcursorX11 x11; 462 463#define GLFW_GLX_CONTEXT_STATE _GLFWcontextGLX glx; 464#define GLFW_GLX_LIBRARY_CONTEXT_STATE _GLFWlibraryGLX glx; 465 466 467// GLX-specific per-context data 468// 469typedef struct _GLFWcontextGLX 470{ 471 GLXContext handle; 472 GLXWindow window; 473 GLXFBConfig fbconfig; 474} _GLFWcontextGLX; 475 476// GLX-specific global data 477// 478typedef struct _GLFWlibraryGLX 479{ 480 int major, minor; 481 int eventBase; 482 int errorBase; 483 484 void* handle; 485 486 // GLX 1.3 functions 487 PFNGLXGETFBCONFIGSPROC GetFBConfigs; 488 PFNGLXGETFBCONFIGATTRIBPROC GetFBConfigAttrib; 489 PFNGLXGETCLIENTSTRINGPROC GetClientString; 490 PFNGLXQUERYEXTENSIONPROC QueryExtension; 491 PFNGLXQUERYVERSIONPROC QueryVersion; 492 PFNGLXDESTROYCONTEXTPROC DestroyContext; 493 PFNGLXMAKECURRENTPROC MakeCurrent; 494 PFNGLXSWAPBUFFERSPROC SwapBuffers; 495 PFNGLXQUERYEXTENSIONSSTRINGPROC QueryExtensionsString; 496 PFNGLXCREATENEWCONTEXTPROC CreateNewContext; 497 PFNGLXGETVISUALFROMFBCONFIGPROC GetVisualFromFBConfig; 498 PFNGLXCREATEWINDOWPROC CreateWindow; 499 PFNGLXDESTROYWINDOWPROC DestroyWindow; 500 501 // GLX 1.4 and extension functions 502 PFNGLXGETPROCADDRESSPROC GetProcAddress; 503 PFNGLXGETPROCADDRESSPROC GetProcAddressARB; 504 PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI; 505 PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT; 506 PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA; 507 PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB; 508 GLFWbool SGI_swap_control; 509 GLFWbool EXT_swap_control; 510 GLFWbool MESA_swap_control; 511 GLFWbool ARB_multisample; 512 GLFWbool ARB_framebuffer_sRGB; 513 GLFWbool EXT_framebuffer_sRGB; 514 GLFWbool ARB_create_context; 515 GLFWbool ARB_create_context_profile; 516 GLFWbool ARB_create_context_robustness; 517 GLFWbool EXT_create_context_es2_profile; 518 GLFWbool ARB_create_context_no_error; 519 GLFWbool ARB_context_flush_control; 520} _GLFWlibraryGLX; 521 522// X11-specific per-window data 523// 524typedef struct _GLFWwindowX11 525{ 526 Colormap colormap; 527 Window handle; 528 Window parent; 529 XIC ic; 530 531 GLFWbool overrideRedirect; 532 GLFWbool iconified; 533 GLFWbool maximized; 534 535 // Whether the visual supports framebuffer transparency 536 GLFWbool transparent; 537 538 // Cached position and size used to filter out duplicate events 539 int width, height; 540 int xpos, ypos; 541 542 // The last received cursor position, regardless of source 543 int lastCursorPosX, lastCursorPosY; 544 // The last position the cursor was warped to by GLFW 545 int warpCursorPosX, warpCursorPosY; 546 547 // The time of the last KeyPress event per keycode, for discarding 548 // duplicate key events generated for some keys by ibus 549 Time keyPressTimes[256]; 550} _GLFWwindowX11; 551 552// X11-specific global data 553// 554typedef struct _GLFWlibraryX11 555{ 556 Display* display; 557 int screen; 558 Window root; 559 560 // System content scale 561 float contentScaleX, contentScaleY; 562 // Helper window for IPC 563 Window helperWindowHandle; 564 // Invisible cursor for hidden cursor mode 565 Cursor hiddenCursorHandle; 566 // Context for mapping window XIDs to _GLFWwindow pointers 567 XContext context; 568 // XIM input method 569 XIM im; 570 // The previous X error handler, to be restored later 571 XErrorHandler errorHandler; 572 // Most recent error code received by X error handler 573 int errorCode; 574 // Primary selection string (while the primary selection is owned) 575 char* primarySelectionString; 576 // Clipboard string (while the selection is owned) 577 char* clipboardString; 578 // Key name string 579 char keynames[GLFW_KEY_LAST + 1][5]; 580 // X11 keycode to GLFW key LUT 581 short int keycodes[256]; 582 // GLFW key to X11 keycode LUT 583 short int scancodes[GLFW_KEY_LAST + 1]; 584 // Where to place the cursor when re-enabled 585 double restoreCursorPosX, restoreCursorPosY; 586 // The window whose disabled cursor mode is active 587 _GLFWwindow* disabledCursorWindow; 588 int emptyEventPipe[2]; 589 590 // Window manager atoms 591 Atom NET_SUPPORTED; 592 Atom NET_SUPPORTING_WM_CHECK; 593 Atom WM_PROTOCOLS; 594 Atom WM_STATE; 595 Atom WM_DELETE_WINDOW; 596 Atom NET_WM_NAME; 597 Atom NET_WM_ICON_NAME; 598 Atom NET_WM_ICON; 599 Atom NET_WM_PID; 600 Atom NET_WM_PING; 601 Atom NET_WM_WINDOW_TYPE; 602 Atom NET_WM_WINDOW_TYPE_NORMAL; 603 Atom NET_WM_STATE; 604 Atom NET_WM_STATE_ABOVE; 605 Atom NET_WM_STATE_FULLSCREEN; 606 Atom NET_WM_STATE_MAXIMIZED_VERT; 607 Atom NET_WM_STATE_MAXIMIZED_HORZ; 608 Atom NET_WM_STATE_DEMANDS_ATTENTION; 609 Atom NET_WM_BYPASS_COMPOSITOR; 610 Atom NET_WM_FULLSCREEN_MONITORS; 611 Atom NET_WM_WINDOW_OPACITY; 612 Atom NET_WM_CM_Sx; 613 Atom NET_WORKAREA; 614 Atom NET_CURRENT_DESKTOP; 615 Atom NET_ACTIVE_WINDOW; 616 Atom NET_FRAME_EXTENTS; 617 Atom NET_REQUEST_FRAME_EXTENTS; 618 Atom MOTIF_WM_HINTS; 619 620 // Xdnd (drag and drop) atoms 621 Atom XdndAware; 622 Atom XdndEnter; 623 Atom XdndPosition; 624 Atom XdndStatus; 625 Atom XdndActionCopy; 626 Atom XdndDrop; 627 Atom XdndFinished; 628 Atom XdndSelection; 629 Atom XdndTypeList; 630 Atom text_uri_list; 631 632 // Selection (clipboard) atoms 633 Atom TARGETS; 634 Atom MULTIPLE; 635 Atom INCR; 636 Atom CLIPBOARD; 637 Atom PRIMARY; 638 Atom CLIPBOARD_MANAGER; 639 Atom SAVE_TARGETS; 640 Atom NULL_; 641 Atom UTF8_STRING; 642 Atom COMPOUND_STRING; 643 Atom ATOM_PAIR; 644 Atom GLFW_SELECTION; 645 646 struct { 647 void* handle; 648 GLFWbool utf8; 649 PFN_XAllocClassHint AllocClassHint; 650 PFN_XAllocSizeHints AllocSizeHints; 651 PFN_XAllocWMHints AllocWMHints; 652 PFN_XChangeProperty ChangeProperty; 653 PFN_XChangeWindowAttributes ChangeWindowAttributes; 654 PFN_XCheckIfEvent CheckIfEvent; 655 PFN_XCheckTypedWindowEvent CheckTypedWindowEvent; 656 PFN_XCloseDisplay CloseDisplay; 657 PFN_XCloseIM CloseIM; 658 PFN_XConvertSelection ConvertSelection; 659 PFN_XCreateColormap CreateColormap; 660 PFN_XCreateFontCursor CreateFontCursor; 661 PFN_XCreateIC CreateIC; 662 PFN_XCreateRegion CreateRegion; 663 PFN_XCreateWindow CreateWindow; 664 PFN_XDefineCursor DefineCursor; 665 PFN_XDeleteContext DeleteContext; 666 PFN_XDeleteProperty DeleteProperty; 667 PFN_XDestroyIC DestroyIC; 668 PFN_XDestroyRegion DestroyRegion; 669 PFN_XDestroyWindow DestroyWindow; 670 PFN_XDisplayKeycodes DisplayKeycodes; 671 PFN_XEventsQueued EventsQueued; 672 PFN_XFilterEvent FilterEvent; 673 PFN_XFindContext FindContext; 674 PFN_XFlush Flush; 675 PFN_XFree Free; 676 PFN_XFreeColormap FreeColormap; 677 PFN_XFreeCursor FreeCursor; 678 PFN_XFreeEventData FreeEventData; 679 PFN_XGetErrorText GetErrorText; 680 PFN_XGetEventData GetEventData; 681 PFN_XGetICValues GetICValues; 682 PFN_XGetIMValues GetIMValues; 683 PFN_XGetInputFocus GetInputFocus; 684 PFN_XGetKeyboardMapping GetKeyboardMapping; 685 PFN_XGetScreenSaver GetScreenSaver; 686 PFN_XGetSelectionOwner GetSelectionOwner; 687 PFN_XGetVisualInfo GetVisualInfo; 688 PFN_XGetWMNormalHints GetWMNormalHints; 689 PFN_XGetWindowAttributes GetWindowAttributes; 690 PFN_XGetWindowProperty GetWindowProperty; 691 PFN_XGrabPointer GrabPointer; 692 PFN_XIconifyWindow IconifyWindow; 693 PFN_XInternAtom InternAtom; 694 PFN_XLookupString LookupString; 695 PFN_XMapRaised MapRaised; 696 PFN_XMapWindow MapWindow; 697 PFN_XMoveResizeWindow MoveResizeWindow; 698 PFN_XMoveWindow MoveWindow; 699 PFN_XNextEvent NextEvent; 700 PFN_XOpenIM OpenIM; 701 PFN_XPeekEvent PeekEvent; 702 PFN_XPending Pending; 703 PFN_XQueryExtension QueryExtension; 704 PFN_XQueryPointer QueryPointer; 705 PFN_XRaiseWindow RaiseWindow; 706 PFN_XRegisterIMInstantiateCallback RegisterIMInstantiateCallback; 707 PFN_XResizeWindow ResizeWindow; 708 PFN_XResourceManagerString ResourceManagerString; 709 PFN_XSaveContext SaveContext; 710 PFN_XSelectInput SelectInput; 711 PFN_XSendEvent SendEvent; 712 PFN_XSetClassHint SetClassHint; 713 PFN_XSetErrorHandler SetErrorHandler; 714 PFN_XSetICFocus SetICFocus; 715 PFN_XSetIMValues SetIMValues; 716 PFN_XSetInputFocus SetInputFocus; 717 PFN_XSetLocaleModifiers SetLocaleModifiers; 718 PFN_XSetScreenSaver SetScreenSaver; 719 PFN_XSetSelectionOwner SetSelectionOwner; 720 PFN_XSetWMHints SetWMHints; 721 PFN_XSetWMNormalHints SetWMNormalHints; 722 PFN_XSetWMProtocols SetWMProtocols; 723 PFN_XSupportsLocale SupportsLocale; 724 PFN_XSync Sync; 725 PFN_XTranslateCoordinates TranslateCoordinates; 726 PFN_XUndefineCursor UndefineCursor; 727 PFN_XUngrabPointer UngrabPointer; 728 PFN_XUnmapWindow UnmapWindow; 729 PFN_XUnsetICFocus UnsetICFocus; 730 PFN_XVisualIDFromVisual VisualIDFromVisual; 731 PFN_XWarpPointer WarpPointer; 732 PFN_XUnregisterIMInstantiateCallback UnregisterIMInstantiateCallback; 733 PFN_Xutf8LookupString utf8LookupString; 734 PFN_Xutf8SetWMProperties utf8SetWMProperties; 735 } xlib; 736 737 struct { 738 PFN_XrmDestroyDatabase DestroyDatabase; 739 PFN_XrmGetResource GetResource; 740 PFN_XrmGetStringDatabase GetStringDatabase; 741 PFN_XrmUniqueQuark UniqueQuark; 742 } xrm; 743 744 struct { 745 GLFWbool available; 746 void* handle; 747 int eventBase; 748 int errorBase; 749 int major; 750 int minor; 751 GLFWbool gammaBroken; 752 GLFWbool monitorBroken; 753 PFN_XRRAllocGamma AllocGamma; 754 PFN_XRRFreeCrtcInfo FreeCrtcInfo; 755 PFN_XRRFreeGamma FreeGamma; 756 PFN_XRRFreeOutputInfo FreeOutputInfo; 757 PFN_XRRFreeScreenResources FreeScreenResources; 758 PFN_XRRGetCrtcGamma GetCrtcGamma; 759 PFN_XRRGetCrtcGammaSize GetCrtcGammaSize; 760 PFN_XRRGetCrtcInfo GetCrtcInfo; 761 PFN_XRRGetOutputInfo GetOutputInfo; 762 PFN_XRRGetOutputPrimary GetOutputPrimary; 763 PFN_XRRGetScreenResourcesCurrent GetScreenResourcesCurrent; 764 PFN_XRRQueryExtension QueryExtension; 765 PFN_XRRQueryVersion QueryVersion; 766 PFN_XRRSelectInput SelectInput; 767 PFN_XRRSetCrtcConfig SetCrtcConfig; 768 PFN_XRRSetCrtcGamma SetCrtcGamma; 769 PFN_XRRUpdateConfiguration UpdateConfiguration; 770 } randr; 771 772 struct { 773 GLFWbool available; 774 GLFWbool detectable; 775 int majorOpcode; 776 int eventBase; 777 int errorBase; 778 int major; 779 int minor; 780 unsigned int group; 781 PFN_XkbFreeKeyboard FreeKeyboard; 782 PFN_XkbFreeNames FreeNames; 783 PFN_XkbGetMap GetMap; 784 PFN_XkbGetNames GetNames; 785 PFN_XkbGetState GetState; 786 PFN_XkbKeycodeToKeysym KeycodeToKeysym; 787 PFN_XkbQueryExtension QueryExtension; 788 PFN_XkbSelectEventDetails SelectEventDetails; 789 PFN_XkbSetDetectableAutoRepeat SetDetectableAutoRepeat; 790 } xkb; 791 792 struct { 793 int count; 794 int timeout; 795 int interval; 796 int blanking; 797 int exposure; 798 } saver; 799 800 struct { 801 int version; 802 Window source; 803 Atom format; 804 } xdnd; 805 806 struct { 807 void* handle; 808 PFN_XcursorImageCreate ImageCreate; 809 PFN_XcursorImageDestroy ImageDestroy; 810 PFN_XcursorImageLoadCursor ImageLoadCursor; 811 PFN_XcursorGetTheme GetTheme; 812 PFN_XcursorGetDefaultSize GetDefaultSize; 813 PFN_XcursorLibraryLoadImage LibraryLoadImage; 814 } xcursor; 815 816 struct { 817 GLFWbool available; 818 void* handle; 819 int major; 820 int minor; 821 PFN_XineramaIsActive IsActive; 822 PFN_XineramaQueryExtension QueryExtension; 823 PFN_XineramaQueryScreens QueryScreens; 824 } xinerama; 825 826 struct { 827 void* handle; 828 PFN_XGetXCBConnection GetXCBConnection; 829 } x11xcb; 830 831 struct { 832 GLFWbool available; 833 void* handle; 834 int eventBase; 835 int errorBase; 836 PFN_XF86VidModeQueryExtension QueryExtension; 837 PFN_XF86VidModeGetGammaRamp GetGammaRamp; 838 PFN_XF86VidModeSetGammaRamp SetGammaRamp; 839 PFN_XF86VidModeGetGammaRampSize GetGammaRampSize; 840 } vidmode; 841 842 struct { 843 GLFWbool available; 844 void* handle; 845 int majorOpcode; 846 int eventBase; 847 int errorBase; 848 int major; 849 int minor; 850 PFN_XIQueryVersion QueryVersion; 851 PFN_XISelectEvents SelectEvents; 852 } xi; 853 854 struct { 855 GLFWbool available; 856 void* handle; 857 int major; 858 int minor; 859 int eventBase; 860 int errorBase; 861 PFN_XRenderQueryExtension QueryExtension; 862 PFN_XRenderQueryVersion QueryVersion; 863 PFN_XRenderFindVisualFormat FindVisualFormat; 864 } xrender; 865 866 struct { 867 GLFWbool available; 868 void* handle; 869 int major; 870 int minor; 871 int eventBase; 872 int errorBase; 873 PFN_XShapeQueryExtension QueryExtension; 874 PFN_XShapeCombineRegion ShapeCombineRegion; 875 PFN_XShapeQueryVersion QueryVersion; 876 PFN_XShapeCombineMask ShapeCombineMask; 877 } xshape; 878} _GLFWlibraryX11; 879 880// X11-specific per-monitor data 881// 882typedef struct _GLFWmonitorX11 883{ 884 RROutput output; 885 RRCrtc crtc; 886 RRMode oldMode; 887 888 // Index of corresponding Xinerama screen, 889 // for EWMH full screen window placement 890 int index; 891} _GLFWmonitorX11; 892 893// X11-specific per-cursor data 894// 895typedef struct _GLFWcursorX11 896{ 897 Cursor handle; 898} _GLFWcursorX11; 899 900 901GLFWbool _glfwConnectX11(int platformID, _GLFWplatform* platform); 902int _glfwInitX11(void); 903void _glfwTerminateX11(void); 904 905GLFWbool _glfwCreateWindowX11(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); 906void _glfwDestroyWindowX11(_GLFWwindow* window); 907void _glfwSetWindowTitleX11(_GLFWwindow* window, const char* title); 908void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* images); 909void _glfwGetWindowPosX11(_GLFWwindow* window, int* xpos, int* ypos); 910void _glfwSetWindowPosX11(_GLFWwindow* window, int xpos, int ypos); 911void _glfwGetWindowSizeX11(_GLFWwindow* window, int* width, int* height); 912void _glfwSetWindowSizeX11(_GLFWwindow* window, int width, int height); 913void _glfwSetWindowSizeLimitsX11(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); 914void _glfwSetWindowAspectRatioX11(_GLFWwindow* window, int numer, int denom); 915void _glfwGetFramebufferSizeX11(_GLFWwindow* window, int* width, int* height); 916void _glfwGetWindowFrameSizeX11(_GLFWwindow* window, int* left, int* top, int* right, int* bottom); 917void _glfwGetWindowContentScaleX11(_GLFWwindow* window, float* xscale, float* yscale); 918void _glfwIconifyWindowX11(_GLFWwindow* window); 919void _glfwRestoreWindowX11(_GLFWwindow* window); 920void _glfwMaximizeWindowX11(_GLFWwindow* window); 921void _glfwShowWindowX11(_GLFWwindow* window); 922void _glfwHideWindowX11(_GLFWwindow* window); 923void _glfwRequestWindowAttentionX11(_GLFWwindow* window); 924void _glfwFocusWindowX11(_GLFWwindow* window); 925void _glfwSetWindowMonitorX11(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); 926GLFWbool _glfwWindowFocusedX11(_GLFWwindow* window); 927GLFWbool _glfwWindowIconifiedX11(_GLFWwindow* window); 928GLFWbool _glfwWindowVisibleX11(_GLFWwindow* window); 929GLFWbool _glfwWindowMaximizedX11(_GLFWwindow* window); 930GLFWbool _glfwWindowHoveredX11(_GLFWwindow* window); 931GLFWbool _glfwFramebufferTransparentX11(_GLFWwindow* window); 932void _glfwSetWindowResizableX11(_GLFWwindow* window, GLFWbool enabled); 933void _glfwSetWindowDecoratedX11(_GLFWwindow* window, GLFWbool enabled); 934void _glfwSetWindowFloatingX11(_GLFWwindow* window, GLFWbool enabled); 935float _glfwGetWindowOpacityX11(_GLFWwindow* window); 936void _glfwSetWindowOpacityX11(_GLFWwindow* window, float opacity); 937void _glfwSetWindowMousePassthroughX11(_GLFWwindow* window, GLFWbool enabled); 938 939void _glfwSetRawMouseMotionX11(_GLFWwindow *window, GLFWbool enabled); 940GLFWbool _glfwRawMouseMotionSupportedX11(void); 941 942void _glfwPollEventsX11(void); 943void _glfwWaitEventsX11(void); 944void _glfwWaitEventsTimeoutX11(double timeout); 945void _glfwPostEmptyEventX11(void); 946 947void _glfwGetCursorPosX11(_GLFWwindow* window, double* xpos, double* ypos); 948void _glfwSetCursorPosX11(_GLFWwindow* window, double xpos, double ypos); 949void _glfwSetCursorModeX11(_GLFWwindow* window, int mode); 950const char* _glfwGetScancodeNameX11(int scancode); 951int _glfwGetKeyScancodeX11(int key); 952GLFWbool _glfwCreateCursorX11(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot); 953GLFWbool _glfwCreateStandardCursorX11(_GLFWcursor* cursor, int shape); 954void _glfwDestroyCursorX11(_GLFWcursor* cursor); 955void _glfwSetCursorX11(_GLFWwindow* window, _GLFWcursor* cursor); 956void _glfwSetClipboardStringX11(const char* string); 957const char* _glfwGetClipboardStringX11(void); 958 959EGLenum _glfwGetEGLPlatformX11(EGLint** attribs); 960EGLNativeDisplayType _glfwGetEGLNativeDisplayX11(void); 961EGLNativeWindowType _glfwGetEGLNativeWindowX11(_GLFWwindow* window); 962 963void _glfwGetRequiredInstanceExtensionsX11(char** extensions); 964GLFWbool _glfwGetPhysicalDevicePresentationSupportX11(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); 965VkResult _glfwCreateWindowSurfaceX11(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); 966 967void _glfwFreeMonitorX11(_GLFWmonitor* monitor); 968void _glfwGetMonitorPosX11(_GLFWmonitor* monitor, int* xpos, int* ypos); 969void _glfwGetMonitorContentScaleX11(_GLFWmonitor* monitor, float* xscale, float* yscale); 970void _glfwGetMonitorWorkareaX11(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height); 971GLFWvidmode* _glfwGetVideoModesX11(_GLFWmonitor* monitor, int* count); 972GLFWbool _glfwGetVideoModeX11(_GLFWmonitor* monitor, GLFWvidmode* mode); 973GLFWbool _glfwGetGammaRampX11(_GLFWmonitor* monitor, GLFWgammaramp* ramp); 974void _glfwSetGammaRampX11(_GLFWmonitor* monitor, const GLFWgammaramp* ramp); 975 976void _glfwPollMonitorsX11(void); 977void _glfwSetVideoModeX11(_GLFWmonitor* monitor, const GLFWvidmode* desired); 978void _glfwRestoreVideoModeX11(_GLFWmonitor* monitor); 979 980Cursor _glfwCreateNativeCursorX11(const GLFWimage* image, int xhot, int yhot); 981 982unsigned long _glfwGetWindowPropertyX11(Window window, 983 Atom property, 984 Atom type, 985 unsigned char** value); 986GLFWbool _glfwIsVisualTransparentX11(Visual* visual); 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.