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