From aaa221ecc4c9784cf88840a2c6bc78cab7a6dc0e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 10 Aug 2026 15:30:18 +0530 Subject: [PATCH] Update glfw.py header parsing Make it work with the autoformatted code --- glfw/glfw.py | 19 +- kitty/glfw-wrapper.h | 758 ++++++++++++++++++++++--------------------- 2 files changed, 402 insertions(+), 375 deletions(-) diff --git a/glfw/glfw.py b/glfw/glfw.py index 475f6ba4e..03713f1ef 100755 --- a/glfw/glfw.py +++ b/glfw/glfw.py @@ -29,11 +29,16 @@ class Arg: class Function: def __init__(self, declaration: str, check_fail: bool = True): self.check_fail = check_fail - m = re.match(r'(.+?)\s+(glfw[A-Z][a-zA-Z0-9]+)[(](.+)[)]$', declaration) - if m is None: + m = re.match(r'(.+?)\s+(\**glfw[A-Z][a-zA-Z0-9]+)[(](.+)[)]$', declaration) + if m is None: # ]]]]]}}))) raise SystemExit('Failed to parse ' + repr(declaration)) self.restype = m.group(1).strip() self.name = m.group(2) + if self.name.startswith('*'): + name = self.name.lstrip('*') + num_of_stars = len(self.name) - len(name) + self.name = name + self.restype += '*' * num_of_stars args = m.group(3).strip().split(',') args = [x.strip() for x in args] self.args = [] @@ -64,10 +69,10 @@ def generate_wrappers(glfw_header: str) -> None: src = f.read() functions = [] first = None - for m in re.finditer(r'^GLFWAPI\s+(.+[)]);\s*$', src, flags=re.MULTILINE): + for m in re.finditer(r'^GLFWAPI\s+(.+?\));\s*$', src, flags=re.MULTILINE | re.DOTALL): if first is None: first = m.start() - decl = m.group(1) + decl = m.group(1).replace('\n', ' ') if 'VkInstance' in decl: continue functions.append(Function(decl)) @@ -110,6 +115,7 @@ def generate_wrappers(glfw_header: str) -> None: unsigned long long glfwDBusUserNotify(const GLFWDBUSNotificationData *n, GLFWDBusnotificationcreatedfun callback, void *data) void glfwDBusSetUserNotificationHandler(GLFWDBusnotificationactivatedfun handler) int glfwSetX11LaunchCommand(GLFWwindow *handle, char **argv, int argc) + bool glfwWaylandCreateVirtualDevices(void) void glfwWaylandInjectMouseMotionAbsolute(unsigned int x, unsigned int y, unsigned int x_extent, unsigned int y_extent) void glfwWaylandInjectMouseButton(int button, int action) void glfwWaylandInjectKey(int key, int action, int mods) @@ -188,8 +194,13 @@ unload_glfw(void) { def main() -> None: + import subprocess + + af = os.path.abspath('autoformat') + os.chdir(os.path.dirname(os.path.abspath(__file__))) generate_wrappers('glfw3.h') + subprocess.check_call([af]) if __name__ == '__main__': diff --git a/kitty/glfw-wrapper.h b/kitty/glfw-wrapper.h index f899195be..5f7553a3c 100644 --- a/kitty/glfw-wrapper.h +++ b/kitty/glfw-wrapper.h @@ -21,21 +21,21 @@ * This is incremented when the API is changed in non-compatible ways. * @ingroup init */ -#define GLFW_VERSION_MAJOR 3 +#define GLFW_VERSION_MAJOR 3 /*! @brief The minor version number of the GLFW library. * * This is incremented when features are added to the API but it remains * backward-compatible. * @ingroup init */ -#define GLFW_VERSION_MINOR 4 +#define GLFW_VERSION_MINOR 4 /*! @brief The revision number of the GLFW library. * * This is incremented when a bug fix release is made that does not contain any * API changes. * @ingroup init */ -#define GLFW_VERSION_REVISION 0 +#define GLFW_VERSION_REVISION 0 /*! @} */ /*! @defgroup hat_state Joystick hat states @@ -45,15 +45,15 @@ * * @ingroup input * @{ */ -#define GLFW_HAT_CENTERED 0 -#define GLFW_HAT_UP 1 -#define GLFW_HAT_RIGHT 2 -#define GLFW_HAT_DOWN 4 -#define GLFW_HAT_LEFT 8 -#define GLFW_HAT_RIGHT_UP (GLFW_HAT_RIGHT | GLFW_HAT_UP) -#define GLFW_HAT_RIGHT_DOWN (GLFW_HAT_RIGHT | GLFW_HAT_DOWN) -#define GLFW_HAT_LEFT_UP (GLFW_HAT_LEFT | GLFW_HAT_UP) -#define GLFW_HAT_LEFT_DOWN (GLFW_HAT_LEFT | GLFW_HAT_DOWN) +#define GLFW_HAT_CENTERED 0 +#define GLFW_HAT_UP 1 +#define GLFW_HAT_RIGHT 2 +#define GLFW_HAT_DOWN 4 +#define GLFW_HAT_LEFT 8 +#define GLFW_HAT_RIGHT_UP (GLFW_HAT_RIGHT | GLFW_HAT_UP) +#define GLFW_HAT_RIGHT_DOWN (GLFW_HAT_RIGHT | GLFW_HAT_DOWN) +#define GLFW_HAT_LEFT_UP (GLFW_HAT_LEFT | GLFW_HAT_UP) +#define GLFW_HAT_LEFT_DOWN (GLFW_HAT_LEFT | GLFW_HAT_DOWN) /*! @} */ /*! @defgroup keys Keyboard keys @@ -82,119 +82,119 @@ /* start functional key names (auto generated by gen-key-constants.py do not edit) */ typedef enum { - GLFW_FKEY_FIRST = 0xe000u, - GLFW_FKEY_ESCAPE = 0xe000u, - GLFW_FKEY_ENTER = 0xe001u, - GLFW_FKEY_TAB = 0xe002u, - GLFW_FKEY_BACKSPACE = 0xe003u, - GLFW_FKEY_INSERT = 0xe004u, - GLFW_FKEY_DELETE = 0xe005u, - GLFW_FKEY_LEFT = 0xe006u, - GLFW_FKEY_RIGHT = 0xe007u, - GLFW_FKEY_UP = 0xe008u, - GLFW_FKEY_DOWN = 0xe009u, - GLFW_FKEY_PAGE_UP = 0xe00au, - GLFW_FKEY_PAGE_DOWN = 0xe00bu, - GLFW_FKEY_HOME = 0xe00cu, - GLFW_FKEY_END = 0xe00du, - GLFW_FKEY_CAPS_LOCK = 0xe00eu, - GLFW_FKEY_SCROLL_LOCK = 0xe00fu, - GLFW_FKEY_NUM_LOCK = 0xe010u, - GLFW_FKEY_PRINT_SCREEN = 0xe011u, - GLFW_FKEY_PAUSE = 0xe012u, - GLFW_FKEY_MENU = 0xe013u, - GLFW_FKEY_F1 = 0xe014u, - GLFW_FKEY_F2 = 0xe015u, - GLFW_FKEY_F3 = 0xe016u, - GLFW_FKEY_F4 = 0xe017u, - GLFW_FKEY_F5 = 0xe018u, - GLFW_FKEY_F6 = 0xe019u, - GLFW_FKEY_F7 = 0xe01au, - GLFW_FKEY_F8 = 0xe01bu, - GLFW_FKEY_F9 = 0xe01cu, - GLFW_FKEY_F10 = 0xe01du, - GLFW_FKEY_F11 = 0xe01eu, - GLFW_FKEY_F12 = 0xe01fu, - GLFW_FKEY_F13 = 0xe020u, - GLFW_FKEY_F14 = 0xe021u, - GLFW_FKEY_F15 = 0xe022u, - GLFW_FKEY_F16 = 0xe023u, - GLFW_FKEY_F17 = 0xe024u, - GLFW_FKEY_F18 = 0xe025u, - GLFW_FKEY_F19 = 0xe026u, - GLFW_FKEY_F20 = 0xe027u, - GLFW_FKEY_F21 = 0xe028u, - GLFW_FKEY_F22 = 0xe029u, - GLFW_FKEY_F23 = 0xe02au, - GLFW_FKEY_F24 = 0xe02bu, - GLFW_FKEY_F25 = 0xe02cu, - GLFW_FKEY_F26 = 0xe02du, - GLFW_FKEY_F27 = 0xe02eu, - GLFW_FKEY_F28 = 0xe02fu, - GLFW_FKEY_F29 = 0xe030u, - GLFW_FKEY_F30 = 0xe031u, - GLFW_FKEY_F31 = 0xe032u, - GLFW_FKEY_F32 = 0xe033u, - GLFW_FKEY_F33 = 0xe034u, - GLFW_FKEY_F34 = 0xe035u, - GLFW_FKEY_F35 = 0xe036u, - GLFW_FKEY_KP_0 = 0xe037u, - GLFW_FKEY_KP_1 = 0xe038u, - GLFW_FKEY_KP_2 = 0xe039u, - GLFW_FKEY_KP_3 = 0xe03au, - GLFW_FKEY_KP_4 = 0xe03bu, - GLFW_FKEY_KP_5 = 0xe03cu, - GLFW_FKEY_KP_6 = 0xe03du, - GLFW_FKEY_KP_7 = 0xe03eu, - GLFW_FKEY_KP_8 = 0xe03fu, - GLFW_FKEY_KP_9 = 0xe040u, - GLFW_FKEY_KP_DECIMAL = 0xe041u, - GLFW_FKEY_KP_DIVIDE = 0xe042u, - GLFW_FKEY_KP_MULTIPLY = 0xe043u, - GLFW_FKEY_KP_SUBTRACT = 0xe044u, - GLFW_FKEY_KP_ADD = 0xe045u, - GLFW_FKEY_KP_ENTER = 0xe046u, - GLFW_FKEY_KP_EQUAL = 0xe047u, - GLFW_FKEY_KP_SEPARATOR = 0xe048u, - GLFW_FKEY_KP_LEFT = 0xe049u, - GLFW_FKEY_KP_RIGHT = 0xe04au, - GLFW_FKEY_KP_UP = 0xe04bu, - GLFW_FKEY_KP_DOWN = 0xe04cu, - GLFW_FKEY_KP_PAGE_UP = 0xe04du, - GLFW_FKEY_KP_PAGE_DOWN = 0xe04eu, - GLFW_FKEY_KP_HOME = 0xe04fu, - GLFW_FKEY_KP_END = 0xe050u, - GLFW_FKEY_KP_INSERT = 0xe051u, - GLFW_FKEY_KP_DELETE = 0xe052u, - GLFW_FKEY_KP_BEGIN = 0xe053u, - GLFW_FKEY_MEDIA_PLAY = 0xe054u, - GLFW_FKEY_MEDIA_PAUSE = 0xe055u, - GLFW_FKEY_MEDIA_PLAY_PAUSE = 0xe056u, - GLFW_FKEY_MEDIA_REVERSE = 0xe057u, - GLFW_FKEY_MEDIA_STOP = 0xe058u, - GLFW_FKEY_MEDIA_FAST_FORWARD = 0xe059u, - GLFW_FKEY_MEDIA_REWIND = 0xe05au, - GLFW_FKEY_MEDIA_TRACK_NEXT = 0xe05bu, - GLFW_FKEY_MEDIA_TRACK_PREVIOUS = 0xe05cu, - GLFW_FKEY_MEDIA_RECORD = 0xe05du, - GLFW_FKEY_LOWER_VOLUME = 0xe05eu, - GLFW_FKEY_RAISE_VOLUME = 0xe05fu, - GLFW_FKEY_MUTE_VOLUME = 0xe060u, - GLFW_FKEY_LEFT_SHIFT = 0xe061u, - GLFW_FKEY_LEFT_CONTROL = 0xe062u, - GLFW_FKEY_LEFT_ALT = 0xe063u, - GLFW_FKEY_LEFT_SUPER = 0xe064u, - GLFW_FKEY_LEFT_HYPER = 0xe065u, - GLFW_FKEY_LEFT_META = 0xe066u, - GLFW_FKEY_RIGHT_SHIFT = 0xe067u, - GLFW_FKEY_RIGHT_CONTROL = 0xe068u, - GLFW_FKEY_RIGHT_ALT = 0xe069u, - GLFW_FKEY_RIGHT_SUPER = 0xe06au, - GLFW_FKEY_RIGHT_HYPER = 0xe06bu, - GLFW_FKEY_RIGHT_META = 0xe06cu, - GLFW_FKEY_ISO_LEVEL3_SHIFT = 0xe06du, - GLFW_FKEY_ISO_LEVEL5_SHIFT = 0xe06eu, - GLFW_FKEY_LAST = 0xe06eu + GLFW_FKEY_FIRST = 0xe000u, + GLFW_FKEY_ESCAPE = 0xe000u, + GLFW_FKEY_ENTER = 0xe001u, + GLFW_FKEY_TAB = 0xe002u, + GLFW_FKEY_BACKSPACE = 0xe003u, + GLFW_FKEY_INSERT = 0xe004u, + GLFW_FKEY_DELETE = 0xe005u, + GLFW_FKEY_LEFT = 0xe006u, + GLFW_FKEY_RIGHT = 0xe007u, + GLFW_FKEY_UP = 0xe008u, + GLFW_FKEY_DOWN = 0xe009u, + GLFW_FKEY_PAGE_UP = 0xe00au, + GLFW_FKEY_PAGE_DOWN = 0xe00bu, + GLFW_FKEY_HOME = 0xe00cu, + GLFW_FKEY_END = 0xe00du, + GLFW_FKEY_CAPS_LOCK = 0xe00eu, + GLFW_FKEY_SCROLL_LOCK = 0xe00fu, + GLFW_FKEY_NUM_LOCK = 0xe010u, + GLFW_FKEY_PRINT_SCREEN = 0xe011u, + GLFW_FKEY_PAUSE = 0xe012u, + GLFW_FKEY_MENU = 0xe013u, + GLFW_FKEY_F1 = 0xe014u, + GLFW_FKEY_F2 = 0xe015u, + GLFW_FKEY_F3 = 0xe016u, + GLFW_FKEY_F4 = 0xe017u, + GLFW_FKEY_F5 = 0xe018u, + GLFW_FKEY_F6 = 0xe019u, + GLFW_FKEY_F7 = 0xe01au, + GLFW_FKEY_F8 = 0xe01bu, + GLFW_FKEY_F9 = 0xe01cu, + GLFW_FKEY_F10 = 0xe01du, + GLFW_FKEY_F11 = 0xe01eu, + GLFW_FKEY_F12 = 0xe01fu, + GLFW_FKEY_F13 = 0xe020u, + GLFW_FKEY_F14 = 0xe021u, + GLFW_FKEY_F15 = 0xe022u, + GLFW_FKEY_F16 = 0xe023u, + GLFW_FKEY_F17 = 0xe024u, + GLFW_FKEY_F18 = 0xe025u, + GLFW_FKEY_F19 = 0xe026u, + GLFW_FKEY_F20 = 0xe027u, + GLFW_FKEY_F21 = 0xe028u, + GLFW_FKEY_F22 = 0xe029u, + GLFW_FKEY_F23 = 0xe02au, + GLFW_FKEY_F24 = 0xe02bu, + GLFW_FKEY_F25 = 0xe02cu, + GLFW_FKEY_F26 = 0xe02du, + GLFW_FKEY_F27 = 0xe02eu, + GLFW_FKEY_F28 = 0xe02fu, + GLFW_FKEY_F29 = 0xe030u, + GLFW_FKEY_F30 = 0xe031u, + GLFW_FKEY_F31 = 0xe032u, + GLFW_FKEY_F32 = 0xe033u, + GLFW_FKEY_F33 = 0xe034u, + GLFW_FKEY_F34 = 0xe035u, + GLFW_FKEY_F35 = 0xe036u, + GLFW_FKEY_KP_0 = 0xe037u, + GLFW_FKEY_KP_1 = 0xe038u, + GLFW_FKEY_KP_2 = 0xe039u, + GLFW_FKEY_KP_3 = 0xe03au, + GLFW_FKEY_KP_4 = 0xe03bu, + GLFW_FKEY_KP_5 = 0xe03cu, + GLFW_FKEY_KP_6 = 0xe03du, + GLFW_FKEY_KP_7 = 0xe03eu, + GLFW_FKEY_KP_8 = 0xe03fu, + GLFW_FKEY_KP_9 = 0xe040u, + GLFW_FKEY_KP_DECIMAL = 0xe041u, + GLFW_FKEY_KP_DIVIDE = 0xe042u, + GLFW_FKEY_KP_MULTIPLY = 0xe043u, + GLFW_FKEY_KP_SUBTRACT = 0xe044u, + GLFW_FKEY_KP_ADD = 0xe045u, + GLFW_FKEY_KP_ENTER = 0xe046u, + GLFW_FKEY_KP_EQUAL = 0xe047u, + GLFW_FKEY_KP_SEPARATOR = 0xe048u, + GLFW_FKEY_KP_LEFT = 0xe049u, + GLFW_FKEY_KP_RIGHT = 0xe04au, + GLFW_FKEY_KP_UP = 0xe04bu, + GLFW_FKEY_KP_DOWN = 0xe04cu, + GLFW_FKEY_KP_PAGE_UP = 0xe04du, + GLFW_FKEY_KP_PAGE_DOWN = 0xe04eu, + GLFW_FKEY_KP_HOME = 0xe04fu, + GLFW_FKEY_KP_END = 0xe050u, + GLFW_FKEY_KP_INSERT = 0xe051u, + GLFW_FKEY_KP_DELETE = 0xe052u, + GLFW_FKEY_KP_BEGIN = 0xe053u, + GLFW_FKEY_MEDIA_PLAY = 0xe054u, + GLFW_FKEY_MEDIA_PAUSE = 0xe055u, + GLFW_FKEY_MEDIA_PLAY_PAUSE = 0xe056u, + GLFW_FKEY_MEDIA_REVERSE = 0xe057u, + GLFW_FKEY_MEDIA_STOP = 0xe058u, + GLFW_FKEY_MEDIA_FAST_FORWARD = 0xe059u, + GLFW_FKEY_MEDIA_REWIND = 0xe05au, + GLFW_FKEY_MEDIA_TRACK_NEXT = 0xe05bu, + GLFW_FKEY_MEDIA_TRACK_PREVIOUS = 0xe05cu, + GLFW_FKEY_MEDIA_RECORD = 0xe05du, + GLFW_FKEY_LOWER_VOLUME = 0xe05eu, + GLFW_FKEY_RAISE_VOLUME = 0xe05fu, + GLFW_FKEY_MUTE_VOLUME = 0xe060u, + GLFW_FKEY_LEFT_SHIFT = 0xe061u, + GLFW_FKEY_LEFT_CONTROL = 0xe062u, + GLFW_FKEY_LEFT_ALT = 0xe063u, + GLFW_FKEY_LEFT_SUPER = 0xe064u, + GLFW_FKEY_LEFT_HYPER = 0xe065u, + GLFW_FKEY_LEFT_META = 0xe066u, + GLFW_FKEY_RIGHT_SHIFT = 0xe067u, + GLFW_FKEY_RIGHT_CONTROL = 0xe068u, + GLFW_FKEY_RIGHT_ALT = 0xe069u, + GLFW_FKEY_RIGHT_SUPER = 0xe06au, + GLFW_FKEY_RIGHT_HYPER = 0xe06bu, + GLFW_FKEY_RIGHT_META = 0xe06cu, + GLFW_FKEY_ISO_LEVEL3_SHIFT = 0xe06du, + GLFW_FKEY_ISO_LEVEL5_SHIFT = 0xe06eu, + GLFW_FKEY_LAST = 0xe06eu } GLFWFunctionKey; /* end functional key names */ @@ -212,46 +212,46 @@ typedef enum { * * If this bit is set one or more Shift keys were held down. */ -#define GLFW_MOD_SHIFT 0x0001 +#define GLFW_MOD_SHIFT 0x0001 /*! @brief If this bit is set one or more Alt keys were held down. * * If this bit is set one or more Alt keys were held down. */ -#define GLFW_MOD_ALT 0x0002 +#define GLFW_MOD_ALT 0x0002 /*! @brief If this bit is set one or more Alt keys were held down. * * If this bit is set one or more Alt keys were held down. */ -#define GLFW_MOD_CONTROL 0x0004 +#define GLFW_MOD_CONTROL 0x0004 /*! @brief If this bit is set one or more Super keys were held down. * * If this bit is set one or more Super keys were held down. */ -#define GLFW_MOD_SUPER 0x0008 +#define GLFW_MOD_SUPER 0x0008 /*! @brief If this bit is set one or more Hyper keys were held down. * * If this bit is set one or more Hyper keys were held down. */ -#define GLFW_MOD_HYPER 0x0010 +#define GLFW_MOD_HYPER 0x0010 /*! @brief If this bit is set one or more Meta keys were held down. * * If this bit is set one or more Meta keys were held down. */ -#define GLFW_MOD_META 0x0020 +#define GLFW_MOD_META 0x0020 /*! @brief If this bit is set the Caps Lock key is enabled. * * If this bit is set the Caps Lock key is enabled and the @ref * GLFW_LOCK_KEY_MODS input mode is set. */ -#define GLFW_MOD_CAPS_LOCK 0x0040 +#define GLFW_MOD_CAPS_LOCK 0x0040 /*! @brief If this bit is set the Num Lock key is enabled. * * If this bit is set the Num Lock key is enabled and the @ref * GLFW_LOCK_KEY_MODS input mode is set. */ -#define GLFW_MOD_NUM_LOCK 0x0080 -#define GLFW_MOD_LAST GLFW_MOD_NUM_LOCK -#define GLFW_LOCK_MASK (GLFW_MOD_NUM_LOCK | GLFW_MOD_CAPS_LOCK) +#define GLFW_MOD_NUM_LOCK 0x0080 +#define GLFW_MOD_LAST GLFW_MOD_NUM_LOCK +#define GLFW_LOCK_MASK (GLFW_MOD_NUM_LOCK | GLFW_MOD_CAPS_LOCK) /*! @} */ @@ -278,11 +278,7 @@ typedef enum GLFWMouseButton { } GLFWMouseButton; /*! @} */ -typedef enum GLFWColorScheme { - GLFW_COLOR_SCHEME_NO_PREFERENCE = 0, - GLFW_COLOR_SCHEME_DARK = 1, - GLFW_COLOR_SCHEME_LIGHT = 2 -} GLFWColorScheme; +typedef enum GLFWColorScheme { GLFW_COLOR_SCHEME_NO_PREFERENCE = 0, GLFW_COLOR_SCHEME_DARK = 1, GLFW_COLOR_SCHEME_LIGHT = 2 } GLFWColorScheme; typedef enum GLFWMomentumType { GLFW_NO_MOMENTUM_DATA = 0, @@ -301,8 +297,10 @@ typedef enum GLFWOffsetType { } GLFWOffsetType; typedef struct GLFWScrollEvent { - double x_offset, y_offset; // offsets are scaled by the window scale for HIGHRES - struct { double x, y; } unscaled; // unscaled offsets, aka logical pixels + double x_offset, y_offset; // offsets are scaled by the window scale for HIGHRES + struct { + double x, y; + } unscaled; // unscaled offsets, aka logical pixels GLFWMomentumType momentum_type; GLFWOffsetType offset_type; int keyboard_modifiers; @@ -315,23 +313,23 @@ typedef struct GLFWScrollEvent { * * @ingroup input * @{ */ -#define GLFW_JOYSTICK_1 0 -#define GLFW_JOYSTICK_2 1 -#define GLFW_JOYSTICK_3 2 -#define GLFW_JOYSTICK_4 3 -#define GLFW_JOYSTICK_5 4 -#define GLFW_JOYSTICK_6 5 -#define GLFW_JOYSTICK_7 6 -#define GLFW_JOYSTICK_8 7 -#define GLFW_JOYSTICK_9 8 -#define GLFW_JOYSTICK_10 9 -#define GLFW_JOYSTICK_11 10 -#define GLFW_JOYSTICK_12 11 -#define GLFW_JOYSTICK_13 12 -#define GLFW_JOYSTICK_14 13 -#define GLFW_JOYSTICK_15 14 -#define GLFW_JOYSTICK_16 15 -#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 +#define GLFW_JOYSTICK_1 0 +#define GLFW_JOYSTICK_2 1 +#define GLFW_JOYSTICK_3 2 +#define GLFW_JOYSTICK_4 3 +#define GLFW_JOYSTICK_5 4 +#define GLFW_JOYSTICK_6 5 +#define GLFW_JOYSTICK_7 6 +#define GLFW_JOYSTICK_8 7 +#define GLFW_JOYSTICK_9 8 +#define GLFW_JOYSTICK_10 9 +#define GLFW_JOYSTICK_11 10 +#define GLFW_JOYSTICK_12 11 +#define GLFW_JOYSTICK_13 12 +#define GLFW_JOYSTICK_14 13 +#define GLFW_JOYSTICK_15 14 +#define GLFW_JOYSTICK_16 15 +#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 /*! @} */ /*! @defgroup gamepad_buttons Gamepad buttons @@ -341,27 +339,27 @@ typedef struct GLFWScrollEvent { * * @ingroup input * @{ */ -#define GLFW_GAMEPAD_BUTTON_A 0 -#define GLFW_GAMEPAD_BUTTON_B 1 -#define GLFW_GAMEPAD_BUTTON_X 2 -#define GLFW_GAMEPAD_BUTTON_Y 3 -#define GLFW_GAMEPAD_BUTTON_LEFT_BUMPER 4 -#define GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER 5 -#define GLFW_GAMEPAD_BUTTON_BACK 6 -#define GLFW_GAMEPAD_BUTTON_START 7 -#define GLFW_GAMEPAD_BUTTON_GUIDE 8 -#define GLFW_GAMEPAD_BUTTON_LEFT_THUMB 9 -#define GLFW_GAMEPAD_BUTTON_RIGHT_THUMB 10 -#define GLFW_GAMEPAD_BUTTON_DPAD_UP 11 -#define GLFW_GAMEPAD_BUTTON_DPAD_RIGHT 12 -#define GLFW_GAMEPAD_BUTTON_DPAD_DOWN 13 -#define GLFW_GAMEPAD_BUTTON_DPAD_LEFT 14 -#define GLFW_GAMEPAD_BUTTON_LAST GLFW_GAMEPAD_BUTTON_DPAD_LEFT +#define GLFW_GAMEPAD_BUTTON_A 0 +#define GLFW_GAMEPAD_BUTTON_B 1 +#define GLFW_GAMEPAD_BUTTON_X 2 +#define GLFW_GAMEPAD_BUTTON_Y 3 +#define GLFW_GAMEPAD_BUTTON_LEFT_BUMPER 4 +#define GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER 5 +#define GLFW_GAMEPAD_BUTTON_BACK 6 +#define GLFW_GAMEPAD_BUTTON_START 7 +#define GLFW_GAMEPAD_BUTTON_GUIDE 8 +#define GLFW_GAMEPAD_BUTTON_LEFT_THUMB 9 +#define GLFW_GAMEPAD_BUTTON_RIGHT_THUMB 10 +#define GLFW_GAMEPAD_BUTTON_DPAD_UP 11 +#define GLFW_GAMEPAD_BUTTON_DPAD_RIGHT 12 +#define GLFW_GAMEPAD_BUTTON_DPAD_DOWN 13 +#define GLFW_GAMEPAD_BUTTON_DPAD_LEFT 14 +#define GLFW_GAMEPAD_BUTTON_LAST GLFW_GAMEPAD_BUTTON_DPAD_LEFT -#define GLFW_GAMEPAD_BUTTON_CROSS GLFW_GAMEPAD_BUTTON_A -#define GLFW_GAMEPAD_BUTTON_CIRCLE GLFW_GAMEPAD_BUTTON_B -#define GLFW_GAMEPAD_BUTTON_SQUARE GLFW_GAMEPAD_BUTTON_X -#define GLFW_GAMEPAD_BUTTON_TRIANGLE GLFW_GAMEPAD_BUTTON_Y +#define GLFW_GAMEPAD_BUTTON_CROSS GLFW_GAMEPAD_BUTTON_A +#define GLFW_GAMEPAD_BUTTON_CIRCLE GLFW_GAMEPAD_BUTTON_B +#define GLFW_GAMEPAD_BUTTON_SQUARE GLFW_GAMEPAD_BUTTON_X +#define GLFW_GAMEPAD_BUTTON_TRIANGLE GLFW_GAMEPAD_BUTTON_Y /*! @} */ /*! @defgroup gamepad_axes Gamepad axes @@ -371,13 +369,13 @@ typedef struct GLFWScrollEvent { * * @ingroup input * @{ */ -#define GLFW_GAMEPAD_AXIS_LEFT_X 0 -#define GLFW_GAMEPAD_AXIS_LEFT_Y 1 -#define GLFW_GAMEPAD_AXIS_RIGHT_X 2 -#define GLFW_GAMEPAD_AXIS_RIGHT_Y 3 -#define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER 4 +#define GLFW_GAMEPAD_AXIS_LEFT_X 0 +#define GLFW_GAMEPAD_AXIS_LEFT_Y 1 +#define GLFW_GAMEPAD_AXIS_RIGHT_X 2 +#define GLFW_GAMEPAD_AXIS_RIGHT_Y 3 +#define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER 4 #define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER 5 -#define GLFW_GAMEPAD_AXIS_LAST GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER +#define GLFW_GAMEPAD_AXIS_LAST GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER /*! @} */ /*! @defgroup errors Error codes @@ -393,7 +391,7 @@ typedef struct GLFWScrollEvent { * * @analysis Yay. */ -#define GLFW_NO_ERROR 0 +#define GLFW_NO_ERROR 0 /*! @brief GLFW has not been initialized. * * This occurs if a GLFW function was called that must not be called unless the @@ -402,7 +400,7 @@ typedef struct GLFWScrollEvent { * @analysis Application programmer error. Initialize GLFW before calling any * function that requires initialization. */ -#define GLFW_NOT_INITIALIZED 0x00010001 +#define GLFW_NOT_INITIALIZED 0x00010001 /*! @brief No context is current for this thread. * * This occurs if a GLFW function was called that needs and operates on the @@ -412,7 +410,7 @@ typedef struct GLFWScrollEvent { * @analysis Application programmer error. Ensure a context is current before * calling functions that require a current context. */ -#define GLFW_NO_CURRENT_CONTEXT 0x00010002 +#define GLFW_NO_CURRENT_CONTEXT 0x00010002 /*! @brief One of the arguments to the function was an invalid enum value. * * One of the arguments to the function was an invalid enum value, for example @@ -420,7 +418,7 @@ typedef struct GLFWScrollEvent { * * @analysis Application programmer error. Fix the offending call. */ -#define GLFW_INVALID_ENUM 0x00010003 +#define GLFW_INVALID_ENUM 0x00010003 /*! @brief One of the arguments to the function was an invalid value. * * One of the arguments to the function was an invalid value, for example @@ -431,7 +429,7 @@ typedef struct GLFWScrollEvent { * * @analysis Application programmer error. Fix the offending call. */ -#define GLFW_INVALID_VALUE 0x00010004 +#define GLFW_INVALID_VALUE 0x00010004 /*! @brief A memory allocation failed. * * A memory allocation failed. @@ -439,7 +437,7 @@ typedef struct GLFWScrollEvent { * @analysis A bug in GLFW or the underlying operating system. Report the bug * to our [issue tracker](https://github.com/glfw/glfw/issues). */ -#define GLFW_OUT_OF_MEMORY 0x00010005 +#define GLFW_OUT_OF_MEMORY 0x00010005 /*! @brief GLFW could not find support for the requested API on the system. * * GLFW could not find support for the requested API on the system. @@ -455,7 +453,7 @@ typedef struct GLFWScrollEvent { * EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary * driver. Older graphics drivers do not support Vulkan. */ -#define GLFW_API_UNAVAILABLE 0x00010006 +#define GLFW_API_UNAVAILABLE 0x00010006 /*! @brief The requested OpenGL or OpenGL ES version is not available. * * The requested OpenGL or OpenGL ES version (including any requested context @@ -472,7 +470,7 @@ typedef struct GLFWScrollEvent { * not @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions * will exist. */ -#define GLFW_VERSION_UNAVAILABLE 0x00010007 +#define GLFW_VERSION_UNAVAILABLE 0x00010007 /*! @brief A platform-specific error occurred that does not match any of the * more specific categories. * @@ -483,7 +481,7 @@ typedef struct GLFWScrollEvent { * system or its drivers, or a lack of required resources. Report the issue to * our [issue tracker](https://github.com/glfw/glfw/issues). */ -#define GLFW_PLATFORM_ERROR 0x00010008 +#define GLFW_PLATFORM_ERROR 0x00010008 /*! @brief The requested format is not supported or available. * * If emitted during window creation, the requested pixel format is not @@ -502,7 +500,7 @@ typedef struct GLFWScrollEvent { * If emitted when querying the clipboard, ignore the error or report it to * the user, as appropriate. */ -#define GLFW_FORMAT_UNAVAILABLE 0x00010009 +#define GLFW_FORMAT_UNAVAILABLE 0x00010009 /*! @brief The specified window does not have an OpenGL or OpenGL ES context. * * A window that does not have an OpenGL or OpenGL ES context was passed to @@ -510,7 +508,7 @@ typedef struct GLFWScrollEvent { * * @analysis Application programmer error. Fix the offending call. */ -#define GLFW_NO_WINDOW_CONTEXT 0x0001000A +#define GLFW_NO_WINDOW_CONTEXT 0x0001000A /*! @brief The requested feature is not provided by the platform. * * The requested feature is not provided by the platform, so GLFW is unable to @@ -524,7 +522,7 @@ typedef struct GLFWScrollEvent { * A function call that emits this error has no effect other than the error and * updating any existing out parameters. */ -#define GLFW_FEATURE_UNAVAILABLE 0x0001000C +#define GLFW_FEATURE_UNAVAILABLE 0x0001000C /*! @brief The requested feature is not implemented for the platform. * * The requested feature has not yet been implemented in GLFW for this platform. @@ -537,7 +535,7 @@ typedef struct GLFWScrollEvent { * A function call that emits this error has no effect other than the error and * updating any existing out parameters. */ -#define GLFW_FEATURE_UNIMPLEMENTED 0x0001000D +#define GLFW_FEATURE_UNIMPLEMENTED 0x0001000D /*! @} */ /*! @addtogroup window @@ -547,53 +545,53 @@ typedef struct GLFWScrollEvent { * Input focus [window hint](@ref GLFW_FOCUSED_hint) or * [window attribute](@ref GLFW_FOCUSED_attrib). */ -#define GLFW_FOCUSED 0x00020001 +#define GLFW_FOCUSED 0x00020001 /*! @brief Window iconification window attribute * * Window iconification [window attribute](@ref GLFW_ICONIFIED_attrib). */ -#define GLFW_ICONIFIED 0x00020002 +#define GLFW_ICONIFIED 0x00020002 /*! @brief Window resize-ability window hint and attribute * * Window resize-ability [window hint](@ref GLFW_RESIZABLE_hint) and * [window attribute](@ref GLFW_RESIZABLE_attrib). */ -#define GLFW_RESIZABLE 0x00020003 +#define GLFW_RESIZABLE 0x00020003 /*! @brief Window visibility window hint and attribute * * Window visibility [window hint](@ref GLFW_VISIBLE_hint) and * [window attribute](@ref GLFW_VISIBLE_attrib). */ -#define GLFW_VISIBLE 0x00020004 +#define GLFW_VISIBLE 0x00020004 /*! @brief Window decoration window hint and attribute * * Window decoration [window hint](@ref GLFW_DECORATED_hint) and * [window attribute](@ref GLFW_DECORATED_attrib). */ -#define GLFW_DECORATED 0x00020005 +#define GLFW_DECORATED 0x00020005 /*! @brief Window auto-iconification window hint and attribute * * Window auto-iconification [window hint](@ref GLFW_AUTO_ICONIFY_hint) and * [window attribute](@ref GLFW_AUTO_ICONIFY_attrib). */ -#define GLFW_AUTO_ICONIFY 0x00020006 +#define GLFW_AUTO_ICONIFY 0x00020006 /*! @brief Window decoration window hint and attribute * * Window decoration [window hint](@ref GLFW_FLOATING_hint) and * [window attribute](@ref GLFW_FLOATING_attrib). */ -#define GLFW_FLOATING 0x00020007 +#define GLFW_FLOATING 0x00020007 /*! @brief Window maximization window hint and attribute * * Window maximization [window hint](@ref GLFW_MAXIMIZED_hint) and * [window attribute](@ref GLFW_MAXIMIZED_attrib). */ -#define GLFW_MAXIMIZED 0x00020008 +#define GLFW_MAXIMIZED 0x00020008 /*! @brief Cursor centering window hint * * Cursor centering [window hint](@ref GLFW_CENTER_CURSOR_hint). */ -#define GLFW_CENTER_CURSOR 0x00020009 +#define GLFW_CENTER_CURSOR 0x00020009 /*! @brief Window framebuffer transparency hint and attribute * * Window framebuffer transparency @@ -605,160 +603,160 @@ typedef struct GLFWScrollEvent { * * Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib). */ -#define GLFW_HOVERED 0x0002000B +#define GLFW_HOVERED 0x0002000B /*! @brief Input focus on calling show window hint and attribute * * Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or * [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib). */ -#define GLFW_FOCUS_ON_SHOW 0x0002000C +#define GLFW_FOCUS_ON_SHOW 0x0002000C /*! @brief Mouse input transparency window hint and attribute * * Mouse input transparency [window hint](@ref GLFW_MOUSE_PASSTHROUGH_hint) or * [window attribute](@ref GLFW_MOUSE_PASSTHROUGH_attrib). */ -#define GLFW_MOUSE_PASSTHROUGH 0x0002000D +#define GLFW_MOUSE_PASSTHROUGH 0x0002000D /*! @brief Occlusion window attribute * * Occlusion [window attribute](@ref GLFW_OCCLUDED_attrib). */ -#define GLFW_OCCLUDED 0x0002000E +#define GLFW_OCCLUDED 0x0002000E /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_RED_BITS). */ -#define GLFW_RED_BITS 0x00021001 +#define GLFW_RED_BITS 0x00021001 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_GREEN_BITS). */ -#define GLFW_GREEN_BITS 0x00021002 +#define GLFW_GREEN_BITS 0x00021002 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_BLUE_BITS). */ -#define GLFW_BLUE_BITS 0x00021003 +#define GLFW_BLUE_BITS 0x00021003 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_ALPHA_BITS). */ -#define GLFW_ALPHA_BITS 0x00021004 +#define GLFW_ALPHA_BITS 0x00021004 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_DEPTH_BITS). */ -#define GLFW_DEPTH_BITS 0x00021005 +#define GLFW_DEPTH_BITS 0x00021005 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_STENCIL_BITS). */ -#define GLFW_STENCIL_BITS 0x00021006 +#define GLFW_STENCIL_BITS 0x00021006 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_ACCUM_RED_BITS). */ -#define GLFW_ACCUM_RED_BITS 0x00021007 +#define GLFW_ACCUM_RED_BITS 0x00021007 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_ACCUM_GREEN_BITS). */ -#define GLFW_ACCUM_GREEN_BITS 0x00021008 +#define GLFW_ACCUM_GREEN_BITS 0x00021008 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_ACCUM_BLUE_BITS). */ -#define GLFW_ACCUM_BLUE_BITS 0x00021009 +#define GLFW_ACCUM_BLUE_BITS 0x00021009 /*! @brief Framebuffer bit depth hint. * * Framebuffer bit depth [hint](@ref GLFW_ACCUM_ALPHA_BITS). */ -#define GLFW_ACCUM_ALPHA_BITS 0x0002100A +#define GLFW_ACCUM_ALPHA_BITS 0x0002100A /*! @brief Framebuffer auxiliary buffer hint. * * Framebuffer auxiliary buffer [hint](@ref GLFW_AUX_BUFFERS). */ -#define GLFW_AUX_BUFFERS 0x0002100B +#define GLFW_AUX_BUFFERS 0x0002100B /*! @brief OpenGL stereoscopic rendering hint. * * OpenGL stereoscopic rendering [hint](@ref GLFW_STEREO). */ -#define GLFW_STEREO 0x0002100C +#define GLFW_STEREO 0x0002100C /*! @brief Framebuffer MSAA samples hint. * * Framebuffer MSAA samples [hint](@ref GLFW_SAMPLES). */ -#define GLFW_SAMPLES 0x0002100D +#define GLFW_SAMPLES 0x0002100D /*! @brief Framebuffer sRGB hint. * * Framebuffer sRGB [hint](@ref GLFW_SRGB_CAPABLE). */ -#define GLFW_SRGB_CAPABLE 0x0002100E +#define GLFW_SRGB_CAPABLE 0x0002100E /*! @brief Monitor refresh rate hint. * * Monitor refresh rate [hint](@ref GLFW_REFRESH_RATE). */ -#define GLFW_REFRESH_RATE 0x0002100F +#define GLFW_REFRESH_RATE 0x0002100F /*! @brief Framebuffer double buffering hint. * * Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER). */ -#define GLFW_DOUBLEBUFFER 0x00021010 +#define GLFW_DOUBLEBUFFER 0x00021010 /*! @brief Context client API hint and attribute. * * Context client API [hint](@ref GLFW_CLIENT_API_hint) and * [attribute](@ref GLFW_CLIENT_API_attrib). */ -#define GLFW_CLIENT_API 0x00022001 +#define GLFW_CLIENT_API 0x00022001 /*! @brief Context client API major version hint and attribute. * * Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint) * and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib). */ -#define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 +#define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 /*! @brief Context client API minor version hint and attribute. * * Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint) * and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib). */ -#define GLFW_CONTEXT_VERSION_MINOR 0x00022003 +#define GLFW_CONTEXT_VERSION_MINOR 0x00022003 /*! @brief Context client API revision number hint and attribute. * * Context client API revision number * [attribute](@ref GLFW_CONTEXT_REVISION_attrib). */ -#define GLFW_CONTEXT_REVISION 0x00022004 +#define GLFW_CONTEXT_REVISION 0x00022004 /*! @brief Context robustness hint and attribute. * * Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint) * and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib). */ -#define GLFW_CONTEXT_ROBUSTNESS 0x00022005 +#define GLFW_CONTEXT_ROBUSTNESS 0x00022005 /*! @brief OpenGL forward-compatibility hint and attribute. * * OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) * and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib). */ -#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 +#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 /*! @brief Debug mode context hint and attribute. * * Debug mode context [hint](@ref GLFW_CONTEXT_DEBUG_hint) and * [attribute](@ref GLFW_CONTEXT_DEBUG_attrib). */ -#define GLFW_CONTEXT_DEBUG 0x00022007 +#define GLFW_CONTEXT_DEBUG 0x00022007 /*! @brief Legacy name for compatibility. * * This is an alias for compatibility with earlier versions. */ -#define GLFW_OPENGL_DEBUG_CONTEXT GLFW_CONTEXT_DEBUG +#define GLFW_OPENGL_DEBUG_CONTEXT GLFW_CONTEXT_DEBUG /*! @brief OpenGL profile hint and attribute. * * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and * [attribute](@ref GLFW_OPENGL_PROFILE_attrib). */ -#define GLFW_OPENGL_PROFILE 0x00022008 +#define GLFW_OPENGL_PROFILE 0x00022008 /*! @brief Context flush-on-release hint and attribute. * * Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and @@ -770,17 +768,17 @@ typedef struct GLFWScrollEvent { * Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and * [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib). */ -#define GLFW_CONTEXT_NO_ERROR 0x0002200A +#define GLFW_CONTEXT_NO_ERROR 0x0002200A /*! @brief Context creation API hint and attribute. * * Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and * [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib). */ -#define GLFW_CONTEXT_CREATION_API 0x0002200B +#define GLFW_CONTEXT_CREATION_API 0x0002200B /*! @brief Window content area scaling window * [window hint](@ref GLFW_SCALE_TO_MONITOR). */ -#define GLFW_SCALE_TO_MONITOR 0x0002200C +#define GLFW_SCALE_TO_MONITOR 0x0002200C /*! @brief macOS specific * [window hint](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint). */ @@ -788,7 +786,7 @@ typedef struct GLFWScrollEvent { /*! @brief macOS specific * [window hint](@ref GLFW_COCOA_FRAME_NAME_hint). */ -#define GLFW_COCOA_FRAME_NAME 0x00023002 +#define GLFW_COCOA_FRAME_NAME 0x00023002 /*! @brief macOS specific * [window hint](@ref GLFW_COCOA_GRAPHICS_SWITCHING_hint). */ @@ -805,59 +803,59 @@ typedef enum { /*! @brief Blur Radius. On macOS the actual radius is used. On Linux it is treated as a bool. * [window hint](@ref GLFW_BLUR_RADIUS). */ -#define GLFW_BLUR_RADIUS 0x0002305 +#define GLFW_BLUR_RADIUS 0x0002305 /*! @brief X11 specific * [window hint](@ref GLFW_X11_CLASS_NAME_hint). */ -#define GLFW_X11_CLASS_NAME 0x00024001 +#define GLFW_X11_CLASS_NAME 0x00024001 /*! @brief X11 specific * [window hint](@ref GLFW_X11_CLASS_NAME_hint). */ -#define GLFW_X11_INSTANCE_NAME 0x00024002 +#define GLFW_X11_INSTANCE_NAME 0x00024002 -#define GLFW_WAYLAND_APP_ID 0x00025001 -#define GLFW_WAYLAND_BGCOLOR 0x00025002 -#define GLFW_WAYLAND_WINDOW_TAG 0x00025003 +#define GLFW_WAYLAND_APP_ID 0x00025001 +#define GLFW_WAYLAND_BGCOLOR 0x00025002 +#define GLFW_WAYLAND_WINDOW_TAG 0x00025003 /*! @} */ -#define GLFW_NO_API 0 -#define GLFW_OPENGL_API 0x00030001 -#define GLFW_OPENGL_ES_API 0x00030002 +#define GLFW_NO_API 0 +#define GLFW_OPENGL_API 0x00030001 +#define GLFW_OPENGL_ES_API 0x00030002 -#define GLFW_NO_ROBUSTNESS 0 -#define GLFW_NO_RESET_NOTIFICATION 0x00031001 -#define GLFW_LOSE_CONTEXT_ON_RESET 0x00031002 +#define GLFW_NO_ROBUSTNESS 0 +#define GLFW_NO_RESET_NOTIFICATION 0x00031001 +#define GLFW_LOSE_CONTEXT_ON_RESET 0x00031002 -#define GLFW_OPENGL_ANY_PROFILE 0 -#define GLFW_OPENGL_CORE_PROFILE 0x00032001 -#define GLFW_OPENGL_COMPAT_PROFILE 0x00032002 +#define GLFW_OPENGL_ANY_PROFILE 0 +#define GLFW_OPENGL_CORE_PROFILE 0x00032001 +#define GLFW_OPENGL_COMPAT_PROFILE 0x00032002 -#define GLFW_CURSOR 0x00033001 -#define GLFW_STICKY_KEYS 0x00033002 -#define GLFW_STICKY_MOUSE_BUTTONS 0x00033003 -#define GLFW_LOCK_KEY_MODS 0x00033004 -#define GLFW_RAW_MOUSE_MOTION 0x00033005 +#define GLFW_CURSOR 0x00033001 +#define GLFW_STICKY_KEYS 0x00033002 +#define GLFW_STICKY_MOUSE_BUTTONS 0x00033003 +#define GLFW_LOCK_KEY_MODS 0x00033004 +#define GLFW_RAW_MOUSE_MOTION 0x00033005 -#define GLFW_CURSOR_NORMAL 0x00034001 -#define GLFW_CURSOR_HIDDEN 0x00034002 -#define GLFW_CURSOR_DISABLED 0x00034003 +#define GLFW_CURSOR_NORMAL 0x00034001 +#define GLFW_CURSOR_HIDDEN 0x00034002 +#define GLFW_CURSOR_DISABLED 0x00034003 -#define GLFW_ANY_RELEASE_BEHAVIOR 0 +#define GLFW_ANY_RELEASE_BEHAVIOR 0 #define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001 -#define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 +#define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 -#define GLFW_NATIVE_CONTEXT_API 0x00036001 -#define GLFW_EGL_CONTEXT_API 0x00036002 -#define GLFW_OSMESA_CONTEXT_API 0x00036003 +#define GLFW_NATIVE_CONTEXT_API 0x00036001 +#define GLFW_EGL_CONTEXT_API 0x00036002 +#define GLFW_OSMESA_CONTEXT_API 0x00036003 -#define GLFW_ANGLE_PLATFORM_TYPE_NONE 0x00037001 -#define GLFW_ANGLE_PLATFORM_TYPE_OPENGL 0x00037002 +#define GLFW_ANGLE_PLATFORM_TYPE_NONE 0x00037001 +#define GLFW_ANGLE_PLATFORM_TYPE_OPENGL 0x00037002 #define GLFW_ANGLE_PLATFORM_TYPE_OPENGLES 0x00037003 -#define GLFW_ANGLE_PLATFORM_TYPE_D3D9 0x00037004 -#define GLFW_ANGLE_PLATFORM_TYPE_D3D11 0x00037005 -#define GLFW_ANGLE_PLATFORM_TYPE_VULKAN 0x00037007 -#define GLFW_ANGLE_PLATFORM_TYPE_METAL 0x00037008 +#define GLFW_ANGLE_PLATFORM_TYPE_D3D9 0x00037004 +#define GLFW_ANGLE_PLATFORM_TYPE_D3D11 0x00037005 +#define GLFW_ANGLE_PLATFORM_TYPE_VULKAN 0x00037007 +#define GLFW_ANGLE_PLATFORM_TYPE_METAL 0x00037008 /*! @defgroup shapes Standard cursor shapes * @brief Standard system cursor shapes. @@ -868,7 +866,7 @@ typedef enum { * @{ */ typedef enum { -/* start mouse cursor shapes (auto generated by gen-key-constants.py do not edit) */ + /* start mouse cursor shapes (auto generated by gen-key-constants.py do not edit) */ GLFW_DEFAULT_CURSOR, GLFW_TEXT_CURSOR, GLFW_POINTER_CURSOR, @@ -900,12 +898,12 @@ typedef enum { GLFW_GRAB_CURSOR, GLFW_GRABBING_CURSOR, GLFW_INVALID_CURSOR, -/* end mouse cursor shapes */ + /* end mouse cursor shapes */ } GLFWCursorShape; /*! @} */ -#define GLFW_CONNECTED 0x00040001 -#define GLFW_DISCONNECTED 0x00040002 +#define GLFW_CONNECTED 0x00040001 +#define GLFW_DISCONNECTED 0x00040002 /*! @addtogroup init * @{ */ @@ -913,28 +911,28 @@ typedef enum { * * Joystick hat buttons [init hint](@ref GLFW_JOYSTICK_HAT_BUTTONS). */ -#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001 +#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001 /*! @brief ANGLE rendering backend init hint. * * ANGLE rendering backend [init hint](@ref GLFW_ANGLE_PLATFORM_TYPE_hint). */ -#define GLFW_ANGLE_PLATFORM_TYPE 0x00050002 -#define GLFW_DEBUG_KEYBOARD 0x00050003 -#define GLFW_DEBUG_RENDERING 0x00050004 +#define GLFW_ANGLE_PLATFORM_TYPE 0x00050002 +#define GLFW_DEBUG_KEYBOARD 0x00050003 +#define GLFW_DEBUG_RENDERING 0x00050004 /*! @brief macOS specific init hint. * * macOS specific [init hint](@ref GLFW_COCOA_CHDIR_RESOURCES_hint). */ -#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001 +#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001 /*! @brief macOS specific init hint. * * macOS specific [init hint](@ref GLFW_COCOA_MENUBAR_hint). */ -#define GLFW_COCOA_MENUBAR 0x00051002 -#define GLFW_WAYLAND_IME 0x00051003 +#define GLFW_COCOA_MENUBAR 0x00051002 +#define GLFW_WAYLAND_IME 0x00051003 /*! @} */ -#define GLFW_DONT_CARE -1 +#define GLFW_DONT_CARE -1 /************************************************************************* @@ -1019,11 +1017,7 @@ typedef struct GLFWcursor GLFWcursor; * * @ingroup input */ -typedef enum { - GLFW_RELEASE = 0, - GLFW_PRESS = 1, - GLFW_REPEAT = 2 -} GLFWKeyAction; +typedef enum { GLFW_RELEASE = 0, GLFW_PRESS = 1, GLFW_REPEAT = 2 } GLFWKeyAction; typedef enum { GLFW_IME_NONE, @@ -1032,10 +1026,7 @@ typedef enum { GLFW_IME_WAYLAND_DONE_EVENT, } GLFWIMEState; -typedef enum { - GLFW_IME_UPDATE_FOCUS = 1, - GLFW_IME_UPDATE_CURSOR_POSITION = 2 -} GLFWIMEUpdateType; +typedef enum { GLFW_IME_UPDATE_FOCUS = 1, GLFW_IME_UPDATE_CURSOR_POSITION = 2 } GLFWIMEUpdateType; typedef struct GLFWIMEUpdateEvent { GLFWIMEUpdateType type; @@ -1047,8 +1038,7 @@ typedef struct GLFWIMEUpdateEvent { } GLFWIMEUpdateEvent; -typedef struct GLFWkeyevent -{ +typedef struct GLFWkeyevent { // The [keyboard key](@ref keys) that was pressed or released. uint32_t key, shifted_key, alternate_key; @@ -1081,7 +1071,7 @@ typedef enum { GLFW_LAYER_SHELL_NONE, GLFW_LAYER_SHELL_BACKGROUND, GLFW_LAYER_SH typedef enum { GLFW_EDGE_TOP, GLFW_EDGE_BOTTOM, GLFW_EDGE_LEFT, GLFW_EDGE_RIGHT, GLFW_EDGE_CENTER, GLFW_EDGE_NONE, GLFW_EDGE_CENTER_SIZED } GLFWEdge; -typedef enum { GLFW_FOCUS_NOT_ALLOWED, GLFW_FOCUS_EXCLUSIVE, GLFW_FOCUS_ON_DEMAND} GLFWFocusPolicy; +typedef enum { GLFW_FOCUS_NOT_ALLOWED, GLFW_FOCUS_EXCLUSIVE, GLFW_FOCUS_ON_DEMAND } GLFWFocusPolicy; typedef struct GLFWLayerShellConfig { GLFWLayerShellType type; @@ -1098,17 +1088,33 @@ typedef struct GLFWLayerShellConfig { int requested_top_margin, requested_left_margin, requested_bottom_margin, requested_right_margin; int requested_exclusive_zone, hide_on_focus_loss; unsigned override_exclusive_zone; - void (*size_callback)(GLFWwindow *window, float xscale, float yscale, unsigned *cell_width, unsigned *cell_height, double *left_edge_spacing, double *top_edge_spacing, double *right_edge_spacing, double *bottom_edge_spacing); - struct { float xscale, yscale; } expected; + void (*size_callback)( + GLFWwindow *window, + float xscale, + float yscale, + unsigned *cell_width, + unsigned *cell_height, + double *left_edge_spacing, + double *top_edge_spacing, + double *right_edge_spacing, + double *bottom_edge_spacing); struct { - float background_opacity; int background_blur, color_space, use_physical_screen_frame; + float xscale, yscale; + } expected; + struct { + float background_opacity; + int background_blur, color_space, use_physical_screen_frame; char ns_window_layer[128]; } related; } GLFWLayerShellConfig; typedef struct GLFWDBUSNotificationData { - const char *app_name, *icon, *summary, *body, *category, **actions; size_t num_actions; - int32_t timeout; uint8_t urgency; uint32_t replaces; int muted; + const char *app_name, *icon, *summary, *body, *category, **actions; + size_t num_actions; + int32_t timeout; + uint8_t urgency; + uint32_t replaces; + int muted; } GLFWDBUSNotificationData; typedef enum { GLFW_DROP_ENTER, GLFW_DROP_MOVE, GLFW_DROP_LEAVE, GLFW_DROP_DROP, GLFW_DROP_STATUS_UPDATE, GLFW_DROP_DATA_AVAILABLE } GLFWDropEventType; @@ -1120,7 +1126,7 @@ typedef enum { GLFW_DROP_ENTER, GLFW_DROP_MOVE, GLFW_DROP_LEAVE, GLFW_DROP_DROP, * @ingroup input */ typedef enum { - GLFW_DRAG_OPERATION_NONE = 0, // no operation, drop was not accepted + GLFW_DRAG_OPERATION_NONE = 0, // no operation, drop was not accepted /*! Move the dragged data to the destination. */ GLFW_DRAG_OPERATION_MOVE = 1, /*! Copy the dragged data to the destination. */ @@ -1132,16 +1138,20 @@ typedef enum { typedef struct GLFWDropEvent { GLFWDropEventType type; - const char **mimes; size_t num_mimes; + const char **mimes; + size_t num_mimes; // Positions are only valid for GLFW_DROP_ENTER and GLFW_DROP_MOVE. // They are in window co-ordinates same as for mouse events double xpos, ypos; - struct { GLFWDragOperationType preferred; int allowed, source_actions; } operation; - bool from_self; // Only valid upto GLFW_DROP_DROP - ssize_t (*read_data)(GLFWwindow *w, struct GLFWDropEvent* ev, char *buffer, size_t sz); // Only valid for GLFW_DROP_DATA_AVAILABLE - void (*finish_drop)(GLFWwindow *w, GLFWDragOperationType op); // Only valid for GLFW_DROP_DROP and GLFW_DROP_DATA_AVAILABLE + struct { + GLFWDragOperationType preferred; + int allowed, source_actions; + } operation; + bool from_self; // Only valid upto GLFW_DROP_DROP + ssize_t (*read_data)(GLFWwindow *w, struct GLFWDropEvent *ev, char *buffer, size_t sz); // Only valid for GLFW_DROP_DATA_AVAILABLE + void (*finish_drop)(GLFWwindow *w, GLFWDragOperationType op); // Only valid for GLFW_DROP_DROP and GLFW_DROP_DATA_AVAILABLE } GLFWDropEvent; -typedef void (* GLFWdropeventfun)(GLFWwindow*, GLFWDropEvent *event); +typedef void (*GLFWdropeventfun)(GLFWwindow *, GLFWDropEvent *event); /*! @brief The function pointer type for error callbacks. @@ -1166,7 +1176,7 @@ typedef void (* GLFWdropeventfun)(GLFWwindow*, GLFWDropEvent *event); * * @ingroup init */ -typedef void (* GLFWerrorfun)(int,const char*); +typedef void (*GLFWerrorfun)(int, const char *); /*! @brief The function pointer type for window position callbacks. * @@ -1189,7 +1199,7 @@ typedef void (* GLFWerrorfun)(int,const char*); * * @ingroup window */ -typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); +typedef void (*GLFWwindowposfun)(GLFWwindow *, int, int); /*! @brief The function pointer type for window size callbacks. * @@ -1211,7 +1221,7 @@ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); * * @ingroup window */ -typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); +typedef void (*GLFWwindowsizefun)(GLFWwindow *, int, int); /*! @brief The function pointer type for window close callbacks. * @@ -1231,7 +1241,7 @@ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); * * @ingroup window */ -typedef void (* GLFWwindowclosefun)(GLFWwindow*); +typedef void (*GLFWwindowclosefun)(GLFWwindow *); /*! @brief The function pointer type for application close callbacks. * @@ -1247,7 +1257,7 @@ typedef void (* GLFWwindowclosefun)(GLFWwindow*); * * @ingroup window */ -typedef void (* GLFWapplicationclosefun)(int); +typedef void (*GLFWapplicationclosefun)(int); /*! @brief The function pointer type for system color theme change callbacks. @@ -1264,7 +1274,7 @@ typedef void (* GLFWapplicationclosefun)(int); * * @ingroup window */ -typedef void (* GLFWsystemcolorthemechangefun)(GLFWColorScheme, bool); +typedef void (*GLFWsystemcolorthemechangefun)(GLFWColorScheme, bool); /*! @brief The function pointer type for window content refresh callbacks. @@ -1285,7 +1295,7 @@ typedef void (* GLFWsystemcolorthemechangefun)(GLFWColorScheme, bool); * * @ingroup window */ -typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); +typedef void (*GLFWwindowrefreshfun)(GLFWwindow *); /*! @brief The function pointer type for window focus callbacks. * @@ -1306,7 +1316,7 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); * * @ingroup window */ -typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); +typedef void (*GLFWwindowfocusfun)(GLFWwindow *, int); /*! @brief The function signature for window occlusion callbacks. * @@ -1323,7 +1333,7 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); * * @ingroup window */ -typedef void (* GLFWwindowocclusionfun)(GLFWwindow*, bool); +typedef void (*GLFWwindowocclusionfun)(GLFWwindow *, bool); /*! @brief The function pointer type for window iconify callbacks. @@ -1345,7 +1355,7 @@ typedef void (* GLFWwindowocclusionfun)(GLFWwindow*, bool); * * @ingroup window */ -typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); +typedef void (*GLFWwindowiconifyfun)(GLFWwindow *, int); /*! @brief The function pointer type for window maximize callbacks. * @@ -1366,7 +1376,7 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); * * @ingroup window */ -typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); +typedef void (*GLFWwindowmaximizefun)(GLFWwindow *, int); /*! @brief The function pointer type for framebuffer size callbacks. * @@ -1387,7 +1397,7 @@ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); * * @ingroup window */ -typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); +typedef void (*GLFWframebuffersizefun)(GLFWwindow *, int, int); /*! @brief The function pointer type for window content scale callbacks. * @@ -1408,7 +1418,7 @@ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); * * @ingroup window */ -typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); +typedef void (*GLFWwindowcontentscalefun)(GLFWwindow *, float, float); /*! @brief The function pointer type for mouse button callbacks. * @@ -1434,7 +1444,7 @@ typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); * * @ingroup input */ -typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); +typedef void (*GLFWmousebuttonfun)(GLFWwindow *, int, int, int); /*! @brief The function pointer type for cursor position callbacks. * @@ -1457,7 +1467,7 @@ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); * * @ingroup input */ -typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); +typedef void (*GLFWcursorposfun)(GLFWwindow *, double, double); /*! @brief The function pointer type for cursor enter/leave callbacks. * @@ -1478,7 +1488,7 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); * * @ingroup input */ -typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); +typedef void (*GLFWcursorenterfun)(GLFWwindow *, int); /*! @brief The function pointer type for scroll callbacks. * @@ -1508,7 +1518,7 @@ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); * * @ingroup input */ -typedef void (* GLFWscrollfun)(GLFWwindow*,const GLFWScrollEvent*); +typedef void (*GLFWscrollfun)(GLFWwindow *, const GLFWScrollEvent *); /*! @brief The function pointer type for key callbacks. * @@ -1540,15 +1550,15 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,const GLFWScrollEvent*); * * @ingroup input */ -typedef void (* GLFWkeyboardfun)(GLFWwindow*, GLFWkeyevent*); +typedef void (*GLFWkeyboardfun)(GLFWwindow *, GLFWkeyevent *); typedef enum { - GLFW_DRAG_DATA_REQUEST, // request data for specified mime type + GLFW_DRAG_DATA_REQUEST, // request data for specified mime type GLFW_DRAG_CANCELLED, GLFW_DRAG_FINSHED, - GLFW_DRAG_ACCEPTED, // mimetype was accepted or NULL if drag was accepted but no mime type specified - GLFW_DRAG_ACTION_CHANGED, // action was changed 0 or GLFWDragOperationType - GLFW_DRAG_DROPPED, // drop was performed but no data transferred yet + GLFW_DRAG_ACCEPTED, // mimetype was accepted or NULL if drag was accepted but no mime type specified + GLFW_DRAG_ACTION_CHANGED, // action was changed 0 or GLFWDragOperationType + GLFW_DRAG_DROPPED, // drop was performed but no data transferred yet } GLFWDragEventType; typedef struct GLFWDragSourceItem { @@ -1557,7 +1567,7 @@ typedef struct GLFWDragSourceItem { const char *optional_data; size_t data_size; bool is_remote_client; - int type; // used for file promises type of entry 0 = regular, 1 = symlink, 2 = directory + int type; // used for file promises type of entry 0 = regular, 1 = symlink, 2 = directory } GLFWDragSourceItem; typedef struct GLFWDragEvent { @@ -1568,13 +1578,14 @@ typedef struct GLFWDragEvent { // called with the data pointer unchanged. The application is now free // to delete the data, as needed. const char *mime_type; - const char *data; size_t data_sz; - int err_num; // POSIX error code indicating failure fetching data - GLFWDragOperationType action; // can be 0 indicating no action - bool drop_maybe_a_cancel; // Happens on wayland compositors that dont implement top-level drag + const char *data; + size_t data_sz; + int err_num; // POSIX error code indicating failure fetching data + GLFWDragOperationType action; // can be 0 indicating no action + bool drop_maybe_a_cancel; // Happens on wayland compositors that dont implement top-level drag } GLFWDragEvent; -typedef void (* GLFWdragsourcefun)(GLFWwindow* window, GLFWDragEvent *ev); +typedef void (*GLFWdragsourcefun)(GLFWwindow *window, GLFWDragEvent *ev); /*! @brief The function pointer type for drag event callbacks. * @@ -1612,9 +1623,9 @@ typedef void (* GLFWdragsourcefun)(GLFWwindow* window, GLFWDragEvent *ev); * * @ingroup input */ -typedef int (* GLFWdragfun)(GLFWwindow*, GLFWDragEventType event, double xpos, double ypos, const char** mime_types, int* mime_count); +typedef int (*GLFWdragfun)(GLFWwindow *, GLFWDragEventType event, double xpos, double ypos, const char **mime_types, int *mime_count); -typedef void (* GLFWliveresizefun)(GLFWwindow*, bool); +typedef void (*GLFWliveresizefun)(GLFWwindow *, bool); /*! @brief The function pointer type for monitor configuration callbacks. * @@ -1635,7 +1646,7 @@ typedef void (* GLFWliveresizefun)(GLFWwindow*, bool); * * @ingroup monitor */ -typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); +typedef void (*GLFWmonitorfun)(GLFWmonitor *, int); /*! @brief The function pointer type for joystick configuration callbacks. * @@ -1656,29 +1667,38 @@ typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); * * @ingroup input */ -typedef void (* GLFWjoystickfun)(int,int); +typedef void (*GLFWjoystickfun)(int, int); -typedef void (* GLFWuserdatafun)(unsigned long long, void*); -typedef void (* GLFWtickcallback)(void*); -typedef void (* GLFWactivationcallback)(GLFWwindow *window, const char *token, void *data); -typedef void (* GLFWwaylandinitialsizefun)(GLFWwindow *window, float xscale, float yscale, int *width, int *height); -typedef bool (* GLFWdrawtextfun)(GLFWwindow *window, const char *text, uint32_t fg, uint32_t bg, uint8_t *output_buf, size_t width, size_t height, float x_offset, float y_offset, size_t right_margin, bool is_single_glyph); -typedef char* (* GLFWcurrentselectionfun)(void); -typedef bool (* GLFWhascurrentselectionfun)(void); -typedef void (* GLFWclipboarddatafreefun)(void* data); +typedef void (*GLFWuserdatafun)(unsigned long long, void *); +typedef void (*GLFWtickcallback)(void *); +typedef void (*GLFWactivationcallback)(GLFWwindow *window, const char *token, void *data); +typedef void (*GLFWwaylandinitialsizefun)(GLFWwindow *window, float xscale, float yscale, int *width, int *height); +typedef bool (*GLFWdrawtextfun)( + GLFWwindow *window, + const char *text, + uint32_t fg, + uint32_t bg, + uint8_t *output_buf, + size_t width, + size_t height, + float x_offset, + float y_offset, + size_t right_margin, + bool is_single_glyph); +typedef char *(*GLFWcurrentselectionfun)(void); +typedef bool (*GLFWhascurrentselectionfun)(void); +typedef void (*GLFWclipboarddatafreefun)(void *data); typedef struct GLFWDataChunk { const char *data; size_t sz; GLFWclipboarddatafreefun free; void *iter, *free_data; } GLFWDataChunk; -typedef enum { - GLFW_CLIPBOARD, GLFW_PRIMARY_SELECTION -} GLFWClipboardType; -typedef GLFWDataChunk (* GLFWclipboarditerfun)(const char *mime_type, void *iter, GLFWClipboardType ctype); -typedef bool (* GLFWclipboardwritedatafun)(void *object, const char *data, size_t sz); -typedef bool (* GLFWimecursorpositionfun)(GLFWwindow *window, GLFWIMEUpdateEvent *ev); -typedef void (* GLFWclipboardlostfun )(GLFWClipboardType); +typedef enum { GLFW_CLIPBOARD, GLFW_PRIMARY_SELECTION } GLFWClipboardType; +typedef GLFWDataChunk (*GLFWclipboarditerfun)(const char *mime_type, void *iter, GLFWClipboardType ctype); +typedef bool (*GLFWclipboardwritedatafun)(void *object, const char *data, size_t sz); +typedef bool (*GLFWimecursorpositionfun)(GLFWwindow *window, GLFWIMEUpdateEvent *ev); +typedef void (*GLFWclipboardlostfun)(GLFWClipboardType); /*! @brief Video mode type. * @@ -1693,8 +1713,7 @@ typedef void (* GLFWclipboardlostfun )(GLFWClipboardType); * * @ingroup monitor */ -typedef struct GLFWvidmode -{ +typedef struct GLFWvidmode { /*! The width, in screen coordinates, of the video mode. */ int width; @@ -1727,17 +1746,16 @@ typedef struct GLFWvidmode * * @ingroup monitor */ -typedef struct GLFWgammaramp -{ +typedef struct GLFWgammaramp { /*! An array of value describing the response of the red channel. */ - unsigned short* red; + unsigned short *red; /*! An array of value describing the response of the green channel. */ - unsigned short* green; + unsigned short *green; /*! An array of value describing the response of the blue channel. */ - unsigned short* blue; + unsigned short *blue; /*! The number of elements in each array. */ unsigned int size; @@ -1756,8 +1774,7 @@ typedef struct GLFWgammaramp * * @ingroup window */ -typedef struct GLFWimage -{ +typedef struct GLFWimage { /*! The width, in pixels, of this image. */ int width; @@ -1766,7 +1783,7 @@ typedef struct GLFWimage int height; /*! The pixel data of this image, arranged left-to-right, top-to-bottom. */ - const unsigned char* pixels; + const unsigned char *pixels; } GLFWimage; /*! @brief Gamepad input state @@ -1780,8 +1797,7 @@ typedef struct GLFWimage * * @ingroup input */ -typedef struct GLFWgamepadstate -{ +typedef struct GLFWgamepadstate { /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS` * or `GLFW_RELEASE`. */ @@ -1852,7 +1868,7 @@ typedef void (*glfwStopMainLoop_func)(void); GFW_EXTERN glfwStopMainLoop_func glfwStopMainLoop_impl; #define glfwStopMainLoop glfwStopMainLoop_impl -typedef unsigned long long (*glfwAddTimer_func)(monotonic_t, bool, GLFWuserdatafun, void *, GLFWuserdatafun); +typedef unsigned long long (*glfwAddTimer_func)(monotonic_t, bool, GLFWuserdatafun, void*, GLFWuserdatafun); GFW_EXTERN glfwAddTimer_func glfwAddTimer_impl; #define glfwAddTimer glfwAddTimer_impl @@ -2372,7 +2388,7 @@ typedef int (*glfwGetGamepadState_func)(int, GLFWgamepadstate*); GFW_EXTERN glfwGetGamepadState_func glfwGetGamepadState_impl; #define glfwGetGamepadState glfwGetGamepadState_impl -typedef void (*glfwSetClipboardDataTypes_func)(GLFWClipboardType, const char* const*, size_t, GLFWclipboarditerfun); +typedef void (*glfwSetClipboardDataTypes_func)(GLFWClipboardType, const char *const*, size_t, GLFWclipboarditerfun); GFW_EXTERN glfwSetClipboardDataTypes_func glfwSetClipboardDataTypes_impl; #define glfwSetClipboardDataTypes glfwSetClipboardDataTypes_impl