<s> '''<STR_LIT>''' <EOL> from __future__ import print_function <EOL> from __future__ import division <EOL> from __future__ import unicode_literals <EOL> __author__ = '<STR_LIT>' <EOL> __copyright__ = '<STR_LIT>' <EOL> __license__ = '<STR_LIT>' <EOL> __version__ = '<STR_LIT>' <EOL> import ctypes <EOL> import os <EOL> import glob <EOL> import sys <EOL> import subprocess <EOL> import textwrap <EOL> try : <EOL> _getcwd = os . getcwdu <EOL> except AttributeError : <EOL> _getcwd = os . getcwd <EOL> if sys . version_info . major > <NUM_LIT:2> : <EOL> _to_char_p = lambda s : s . encode ( '<STR_LIT:utf-8>' ) <EOL> else : <EOL> _to_char_p = lambda s : s <EOL> def _find_library_candidates ( library_names , <EOL> library_file_extensions , <EOL> library_search_paths ) : <EOL> '''<STR_LIT>''' <EOL> candidates = set ( ) <EOL> for library_name in library_names : <EOL> for search_path in library_search_paths : <EOL> glob_query = os . path . join ( search_path , '<STR_LIT:*>' + library_name + '<STR_LIT:*>' ) <EOL> for filename in glob . iglob ( glob_query ) : <EOL> filename = os . path . realpath ( filename ) <EOL> if filename in candidates : <EOL> continue <EOL> basename = os . path . basename ( filename ) <EOL> if basename . startswith ( '<STR_LIT>' + library_name ) : <EOL> basename_end = basename [ len ( '<STR_LIT>' + library_name ) : ] <EOL> elif basename . startswith ( library_name ) : <EOL> basename_end = basename [ len ( library_name ) : ] <EOL> else : <EOL> continue <EOL> for file_extension in library_file_extensions : <EOL> if basename_end . startswith ( file_extension ) : <EOL> if basename_end [ len ( file_extension ) : ] [ : <NUM_LIT:1> ] in ( '<STR_LIT>' , '<STR_LIT:.>' ) : <EOL> candidates . add ( filename ) <EOL> if basename_end . endswith ( file_extension ) : <EOL> basename_middle = basename_end [ : - len ( file_extension ) ] <EOL> if all ( c in '<STR_LIT>' for c in basename_middle ) : <EOL> candidates . add ( filename ) <EOL> return candidates <EOL> def _load_library ( ) : <EOL> '''<STR_LIT>''' <EOL> osp = os . path <EOL> if sys . platform . startswith ( "<STR_LIT>" ) : <EOL> libfile = osp . abspath ( osp . join ( osp . dirname ( __file__ ) , "<STR_LIT>" ) ) <EOL> elif sys . platform . startswith ( "<STR_LIT>" ) : <EOL> libfile = osp . abspath ( osp . join ( osp . dirname ( __file__ ) , "<STR_LIT>" ) ) <EOL> elif sys . platform . startswith ( "<STR_LIT>" ) : <EOL> libfile = osp . abspath ( osp . join ( osp . dirname ( __file__ ) , "<STR_LIT>" ) ) <EOL> else : <EOL> raise RuntimeError ( "<STR_LIT>" % sys . platform ) <EOL> return ctypes . CDLL ( libfile ) <EOL> def _glfw_get_version ( filename ) : <EOL> '''<STR_LIT>''' <EOL> version_checker_source = """<STR_LIT>""" <EOL> args = [ sys . executable , '<STR_LIT:-c>' , textwrap . dedent ( version_checker_source ) ] <EOL> process = subprocess . Popen ( args , universal_newlines = True , <EOL> stdin = subprocess . PIPE , stdout = subprocess . PIPE ) <EOL> out = process . communicate ( _to_char_p ( filename ) ) [ <NUM_LIT:0> ] <EOL> out = out . strip ( ) <EOL> if out : <EOL> return eval ( out ) <EOL> else : <EOL> return None <EOL> _glfw = _load_library ( ) <EOL> if _glfw is None : <EOL> raise ImportError ( "<STR_LIT>" ) <EOL> _callback_repositories = [ ] <EOL> class _GLFWwindow ( ctypes . Structure ) : <EOL> '''<STR_LIT>''' <EOL> _fields_ = [ ( "<STR_LIT>" , ctypes . c_int ) ] <EOL> class _GLFWmonitor ( ctypes . Structure ) : <EOL> '''<STR_LIT>''' <EOL> _fields_ = [ ( "<STR_LIT>" , ctypes . c_int ) ] <EOL> class _GLFWvidmode ( ctypes . Structure ) : <EOL> '''<STR_LIT>''' <EOL> _fields_ = [ ( "<STR_LIT:width>" , ctypes . c_int ) , <EOL> ( "<STR_LIT>" , ctypes . c_int ) , <EOL> ( "<STR_LIT>" , ctypes . c_int ) , <EOL> ( "<STR_LIT>" , ctypes . c_int ) , <EOL> ( "<STR_LIT>" , ctypes . c_int ) , <EOL> ( "<STR_LIT>" , ctypes . c_uint ) ] <EOL> def __init__ ( self ) : <EOL> ctypes . Structure . __init__ ( self ) <EOL> self . width = <NUM_LIT:0> <EOL> self . height = <NUM_LIT:0> <EOL> self . red_bits = <NUM_LIT:0> <EOL> self . green_bits = <NUM_LIT:0> <EOL> self . blue_bits = <NUM_LIT:0> <EOL> self . refresh_rate = <NUM_LIT:0> <EOL> def wrap ( self , video_mode ) : <EOL> '''<STR_LIT>''' <EOL> size , bits , self . refresh_rate = video_mode <EOL> self . width , self . height = size <EOL> self . red_bits , self . green_bits , self . blue_bits = bits <EOL> def unwrap ( self ) : <EOL> '''<STR_LIT>''' <EOL> size = self . width , self . height <EOL> bits = self . red_bits , self . green_bits , self . blue_bits <EOL> return size , bits , self . refresh_rate <EOL> class _GLFWgammaramp ( ctypes . Structure ) : <EOL> '''<STR_LIT>''' <EOL> _fields_ = [ ( "<STR_LIT>" , ctypes . POINTER ( ctypes . c_ushort ) ) , <EOL> ( "<STR_LIT>" , ctypes . POINTER ( ctypes . c_ushort ) ) , <EOL> ( "<STR_LIT>" , ctypes . POINTER ( ctypes . c_ushort ) ) , <EOL> ( "<STR_LIT:size>" , ctypes . c_uint ) ] <EOL> def __init__ ( self ) : <EOL> ctypes . Structure . __init__ ( self ) <EOL> self . red = None <EOL> self . red_array = None <EOL> self . green = None <EOL> self . green_array = None <EOL> self . blue = None <EOL> self . blue_array = None <EOL> self . size = <NUM_LIT:0> <EOL> def wrap ( self , gammaramp ) : <EOL> '''<STR_LIT>''' <EOL> red , green , blue = gammaramp <EOL> size = min ( len ( red ) , len ( green ) , len ( blue ) ) <EOL> array_type = ctypes . c_ushort * size <EOL> self . size = ctypes . c_uint ( size ) <EOL> self . red_array = array_type ( ) <EOL> self . green_array = array_type ( ) <EOL> self . blue_array = array_type ( ) <EOL> for i in range ( self . size ) : <EOL> self . red_array [ i ] = int ( red [ i ] * <NUM_LIT> ) <EOL> self . green_array [ i ] = int ( green [ i ] * <NUM_LIT> ) <EOL> self . blue_array [ i ] = int ( blue [ i ] * <NUM_LIT> ) <EOL> pointer_type = ctypes . POINTER ( ctypes . c_ushort ) <EOL> self . red = ctypes . cast ( self . red_array , pointer_type ) <EOL> self . green = ctypes . cast ( self . green_array , pointer_type ) <EOL> self . blue = ctypes . cast ( self . blue_array , pointer_type ) <EOL> def unwrap ( self ) : <EOL> '''<STR_LIT>''' <EOL> red = [ self . red [ i ] / <NUM_LIT> for i in range ( self . size ) ] <EOL> green = [ self . green [ i ] / <NUM_LIT> for i in range ( self . size ) ] <EOL> blue = [ self . blue [ i ] / <NUM_LIT> for i in range ( self . size ) ] <EOL> return red , green , blue <EOL> VERSION_MAJOR = <NUM_LIT:3> <EOL> VERSION_MINOR = <NUM_LIT:0> <EOL> VERSION_REVISION = <NUM_LIT:3> <EOL> RELEASE = <NUM_LIT:0> <EOL> PRESS = <NUM_LIT:1> <EOL> REPEAT = <NUM_LIT:2> <EOL> KEY_UNKNOWN = - <NUM_LIT:1> <EOL> KEY_SPACE = <NUM_LIT:32> <EOL> KEY_APOSTROPHE = <NUM_LIT> <EOL> KEY_COMMA = <NUM_LIT> <EOL> KEY_MINUS = <NUM_LIT> <EOL> KEY_PERIOD = <NUM_LIT> <EOL> KEY_SLASH = <NUM_LIT> <EOL> KEY_0 = <NUM_LIT> <EOL> KEY_1 = <NUM_LIT> <EOL> KEY_2 = <NUM_LIT:50> <EOL> KEY_3 = <NUM_LIT> <EOL> KEY_4 = <NUM_LIT> <EOL> KEY_5 = <NUM_LIT> <EOL> KEY_6 = <NUM_LIT> <EOL> KEY_7 = <NUM_LIT> <EOL> KEY_8 = <NUM_LIT> <EOL> KEY_9 = <NUM_LIT> <EOL> KEY_SEMICOLON = <NUM_LIT> <EOL> KEY_EQUAL = <NUM_LIT> <EOL> KEY_A = <NUM_LIT> <EOL> KEY_B = <NUM_LIT> <EOL> KEY_C = <NUM_LIT> <EOL> KEY_D = <NUM_LIT> <EOL> KEY_E = <NUM_LIT> <EOL> KEY_F = <NUM_LIT> <EOL> KEY_G = <NUM_LIT> <EOL> KEY_H = <NUM_LIT> <EOL> KEY_I = <NUM_LIT> <EOL> KEY_J = <NUM_LIT> <EOL> KEY_K = <NUM_LIT> <EOL> KEY_L = <NUM_LIT> <EOL> KEY_M = <NUM_LIT> <EOL> KEY_N = <NUM_LIT> <EOL> KEY_O = <NUM_LIT> <EOL> KEY_P = <NUM_LIT> <EOL> KEY_Q = <NUM_LIT> <EOL> KEY_R = <NUM_LIT> <EOL> KEY_S = <NUM_LIT> <EOL> KEY_T = <NUM_LIT> <EOL> KEY_U = <NUM_LIT> <EOL> KEY_V = <NUM_LIT> <EOL> KEY_W = <NUM_LIT> <EOL> KEY_X = <NUM_LIT> <EOL> KEY_Y = <NUM_LIT> <EOL> KEY_Z = <NUM_LIT> <EOL> KEY_LEFT_BRACKET = <NUM_LIT> <EOL> KEY_BACKSLASH = <NUM_LIT> <EOL> KEY_RIGHT_BRACKET = <NUM_LIT> <EOL> KEY_GRAVE_ACCENT = <NUM_LIT> <EOL> KEY_WORLD_1 = <NUM_LIT> <EOL> KEY_WORLD_2 = <NUM_LIT> <EOL> KEY_ESCAPE = <NUM_LIT> <EOL> KEY_ENTER = <NUM_LIT> <EOL> KEY_TAB = <NUM_LIT> <EOL> KEY_BACKSPACE = <NUM_LIT> <EOL> KEY_INSERT = <NUM_LIT> <EOL> KEY_DELETE = <NUM_LIT> <EOL> KEY_RIGHT = <NUM_LIT> <EOL> KEY_LEFT = <NUM_LIT> <EOL> KEY_DOWN = <NUM_LIT> <EOL> KEY_UP = <NUM_LIT> <EOL> KEY_PAGE_UP = <NUM_LIT> <EOL> KEY_PAGE_DOWN = <NUM_LIT> <EOL> KEY_HOME = <NUM_LIT> <EOL> KEY_END = <NUM_LIT> <EOL> KEY_CAPS_LOCK = <NUM_LIT> <EOL> KEY_SCROLL_LOCK = <NUM_LIT> <EOL> KEY_NUM_LOCK = <NUM_LIT> <EOL> KEY_PRINT_SCREEN = <NUM_LIT> <EOL> KEY_PAUSE = <NUM_LIT> <EOL> KEY_F1 = <NUM_LIT> <EOL> KEY_F2 = <NUM_LIT> <EOL> KEY_F3 = <NUM_LIT> <EOL> KEY_F4 = <NUM_LIT> <EOL> KEY_F5 = <NUM_LIT> <EOL> KEY_F6 = <NUM_LIT> <EOL> KEY_F7 = <NUM_LIT> <EOL> KEY_F8 = <NUM_LIT> <EOL> KEY_F9 = <NUM_LIT> <EOL> KEY_F10 = <NUM_LIT> <EOL> KEY_F11 = <NUM_LIT> <EOL> KEY_F12 = <NUM_LIT> <EOL> KEY_F13 = <NUM_LIT> <EOL> KEY_F14 = <NUM_LIT> <EOL> KEY_F15 = <NUM_LIT> <EOL> KEY_F16 = <NUM_LIT> <EOL> KEY_F17 = <NUM_LIT> <EOL> KEY_F18 = <NUM_LIT> <EOL> KEY_F19 = <NUM_LIT> <EOL> KEY_F20 = <NUM_LIT> <EOL> KEY_F21 = <NUM_LIT> <EOL> KEY_F22 = <NUM_LIT> <EOL> KEY_F23 = <NUM_LIT> <EOL> KEY_F24 = <NUM_LIT> <EOL> KEY_F25 = <NUM_LIT> <EOL> KEY_KP_0 = <NUM_LIT> <EOL> KEY_KP_1 = <NUM_LIT> <EOL> KEY_KP_2 = <NUM_LIT> <EOL> KEY_KP_3 = <NUM_LIT> <EOL> KEY_KP_4 = <NUM_LIT> <EOL> KEY_KP_5 = <NUM_LIT> <EOL> KEY_KP_6 = <NUM_LIT> <EOL> KEY_KP_7 = <NUM_LIT> <EOL> KEY_KP_8 = <NUM_LIT> <EOL> KEY_KP_9 = <NUM_LIT> <EOL> KEY_KP_DECIMAL = <NUM_LIT> <EOL> KEY_KP_DIVIDE = <NUM_LIT> <EOL> KEY_KP_MULTIPLY = <NUM_LIT> <EOL> KEY_KP_SUBTRACT = <NUM_LIT> <EOL> KEY_KP_ADD = <NUM_LIT> <EOL> KEY_KP_ENTER = <NUM_LIT> <EOL> KEY_KP_EQUAL = <NUM_LIT> <EOL> KEY_LEFT_SHIFT = <NUM_LIT> <EOL> KEY_LEFT_CONTROL = <NUM_LIT> <EOL> KEY_LEFT_ALT = <NUM_LIT> <EOL> KEY_LEFT_SUPER = <NUM_LIT> <EOL> KEY_RIGHT_SHIFT = <NUM_LIT> <EOL> KEY_RIGHT_CONTROL = <NUM_LIT> <EOL> KEY_RIGHT_ALT = <NUM_LIT> <EOL> KEY_RIGHT_SUPER = <NUM_LIT> <EOL> KEY_MENU = <NUM_LIT> <EOL> KEY_LAST = KEY_MENU <EOL> MOD_SHIFT = <NUM_LIT> <EOL> MOD_CONTROL = <NUM_LIT> <EOL> MOD_ALT = <NUM_LIT> <EOL> MOD_SUPER = <NUM_LIT> <EOL> MOUSE_BUTTON_1 = <NUM_LIT:0> <EOL> MOUSE_BUTTON_2 = <NUM_LIT:1> <EOL> MOUSE_BUTTON_3 = <NUM_LIT:2> <EOL> MOUSE_BUTTON_4 = <NUM_LIT:3> <EOL> MOUSE_BUTTON_5 = <NUM_LIT:4> <EOL> MOUSE_BUTTON_6 = <NUM_LIT:5> <EOL> MOUSE_BUTTON_7 = <NUM_LIT:6> <EOL> MOUSE_BUTTON_8 = <NUM_LIT:7> <EOL> MOUSE_BUTTON_LAST = MOUSE_BUTTON_8 <EOL> MOUSE_BUTTON_LEFT = MOUSE_BUTTON_1 <EOL> MOUSE_BUTTON_RIGHT = MOUSE_BUTTON_2 <EOL> MOUSE_BUTTON_MIDDLE = MOUSE_BUTTON_3 <EOL> JOYSTICK_1 = <NUM_LIT:0> <EOL> JOYSTICK_2 = <NUM_LIT:1> <EOL> JOYSTICK_3 = <NUM_LIT:2> <EOL> JOYSTICK_4 = <NUM_LIT:3> <EOL> JOYSTICK_5 = <NUM_LIT:4> <EOL> JOYSTICK_6 = <NUM_LIT:5> <EOL> JOYSTICK_7 = <NUM_LIT:6> <EOL> JOYSTICK_8 = <NUM_LIT:7> <EOL> JOYSTICK_9 = <NUM_LIT:8> <EOL> JOYSTICK_10 = <NUM_LIT:9> <EOL> JOYSTICK_11 = <NUM_LIT:10> <EOL> JOYSTICK_12 = <NUM_LIT:11> <EOL> JOYSTICK_13 = <NUM_LIT:12> <EOL> JOYSTICK_14 = <NUM_LIT> <EOL> JOYSTICK_15 = <NUM_LIT> <EOL> JOYSTICK_16 = <NUM_LIT:15> <EOL> JOYSTICK_LAST = JOYSTICK_16 <EOL> NOT_INITIALIZED = <NUM_LIT> <EOL> NO_CURRENT_CONTEXT = <NUM_LIT> <EOL> INVALID_ENUM = <NUM_LIT> <EOL> INVALID_VALUE = <NUM_LIT> <EOL> OUT_OF_MEMORY = <NUM_LIT> <EOL> API_UNAVAILABLE = <NUM_LIT> <EOL> VERSION_UNAVAILABLE = <NUM_LIT> <EOL> PLATFORM_ERROR = <NUM_LIT> <EOL> FORMAT_UNAVAILABLE = <NUM_LIT> <EOL> FOCUSED = <NUM_LIT> <EOL> ICONIFIED = <NUM_LIT> <EOL> RESIZABLE = <NUM_LIT> <EOL> VISIBLE = <NUM_LIT> <EOL> DECORATED = <NUM_LIT> <EOL> RED_BITS = <NUM_LIT> <EOL> GREEN_BITS = <NUM_LIT> <EOL> BLUE_BITS = <NUM_LIT> <EOL> ALPHA_BITS = <NUM_LIT> <EOL> DEPTH_BITS = <NUM_LIT> <EOL> STENCIL_BITS = <NUM_LIT> <EOL> ACCUM_RED_BITS = <NUM_LIT> <EOL> ACCUM_GREEN_BITS = <NUM_LIT> <EOL> ACCUM_BLUE_BITS = <NUM_LIT> <EOL> ACCUM_ALPHA_BITS = <NUM_LIT> <EOL> AUX_BUFFERS = <NUM_LIT> <EOL> STEREO = <NUM_LIT> <EOL> SAMPLES = <NUM_LIT> <EOL> SRGB_CAPABLE = <NUM_LIT> <EOL> REFRESH_RATE = <NUM_LIT> <EOL> CLIENT_API = <NUM_LIT> <EOL> CONTEXT_VERSION_MAJOR = <NUM_LIT> <EOL> CONTEXT_VERSION_MINOR = <NUM_LIT> <EOL> CONTEXT_REVISION = <NUM_LIT> <EOL> CONTEXT_ROBUSTNESS = <NUM_LIT> <EOL> OPENGL_FORWARD_COMPAT = <NUM_LIT> <EOL> OPENGL_DEBUG_CONTEXT = <NUM_LIT> <EOL> OPENGL_PROFILE = <NUM_LIT> <EOL> OPENGL_API = <NUM_LIT> <EOL> OPENGL_ES_API = <NUM_LIT> <EOL> NO_ROBUSTNESS = <NUM_LIT:0> <EOL> NO_RESET_NOTIFICATION = <NUM_LIT> <EOL> LOSE_CONTEXT_ON_RESET = <NUM_LIT> <EOL> OPENGL_ANY_PROFILE = <NUM_LIT:0> <EOL> OPENGL_CORE_PROFILE = <NUM_LIT> <EOL> OPENGL_COMPAT_PROFILE = <NUM_LIT> <EOL> CURSOR = <NUM_LIT> <EOL> STICKY_KEYS = <NUM_LIT> <EOL> STICKY_MOUSE_BUTTONS = <NUM_LIT> <EOL> CURSOR_NORMAL = <NUM_LIT> <EOL> CURSOR_HIDDEN = <NUM_LIT> <EOL> CURSOR_DISABLED = <NUM_LIT> <EOL> CONNECTED = <NUM_LIT> <EOL> DISCONNECTED = <NUM_LIT> <EOL> _GLFWerrorfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . c_int , <EOL> ctypes . c_char_p ) <EOL> _GLFWwindowposfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int ) <EOL> _GLFWwindowsizefun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int ) <EOL> _GLFWwindowclosefun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) ) <EOL> _GLFWwindowrefreshfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) ) <EOL> _GLFWwindowfocusfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ) <EOL> _GLFWwindowiconifyfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ) <EOL> _GLFWframebuffersizefun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int ) <EOL> _GLFWmousebuttonfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int , <EOL> ctypes . c_int ) <EOL> _GLFWcursorposfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_double , <EOL> ctypes . c_double ) <EOL> _GLFWcursorenterfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ) <EOL> _GLFWscrollfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_double , <EOL> ctypes . c_double ) <EOL> _GLFWkeyfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int , <EOL> ctypes . c_int , <EOL> ctypes . c_int ) <EOL> _GLFWcharfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ) <EOL> _GLFWmonitorfun = ctypes . CFUNCTYPE ( None , <EOL> ctypes . POINTER ( _GLFWmonitor ) , <EOL> ctypes . c_int ) <EOL> _glfw . glfwInit . restype = ctypes . c_int <EOL> _glfw . glfwInit . argtypes = [ ] <EOL> def init ( ) : <EOL> '''<STR_LIT>''' <EOL> cwd = _getcwd ( ) <EOL> res = _glfw . glfwInit ( ) <EOL> os . chdir ( cwd ) <EOL> return res <EOL> _glfw . glfwTerminate . restype = None <EOL> _glfw . glfwTerminate . argtypes = [ ] <EOL> def terminate ( ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwTerminate ( ) <EOL> _glfw . glfwGetVersion . restype = None <EOL> _glfw . glfwGetVersion . argtypes = [ ctypes . POINTER ( ctypes . c_int ) , <EOL> ctypes . POINTER ( ctypes . c_int ) , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_version ( ) : <EOL> '''<STR_LIT>''' <EOL> major_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> major = ctypes . pointer ( major_value ) <EOL> minor_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> minor = ctypes . pointer ( minor_value ) <EOL> rev_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> rev = ctypes . pointer ( rev_value ) <EOL> _glfw . glfwGetVersion ( major , minor , rev ) <EOL> return major_value . value , minor_value . value , rev_value . value <EOL> _glfw . glfwGetVersionString . restype = ctypes . c_char_p <EOL> _glfw . glfwGetVersionString . argtypes = [ ] <EOL> def get_version_string ( ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetVersionString ( ) <EOL> _error_callback = None <EOL> _glfw . glfwSetErrorCallback . restype = _GLFWerrorfun <EOL> _glfw . glfwSetErrorCallback . argtypes = [ _GLFWerrorfun ] <EOL> def set_error_callback ( cbfun ) : <EOL> '''<STR_LIT>''' <EOL> global _error_callback <EOL> previous_callback = _error_callback <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWerrorfun ( cbfun ) <EOL> _error_callback = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetErrorCallback ( cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _glfw . glfwGetMonitors . restype = ctypes . POINTER ( ctypes . POINTER ( _GLFWmonitor ) ) <EOL> _glfw . glfwGetMonitors . argtypes = [ ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_monitors ( ) : <EOL> '''<STR_LIT>''' <EOL> count_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> count = ctypes . pointer ( count_value ) <EOL> result = _glfw . glfwGetMonitors ( count ) <EOL> monitors = [ result [ i ] for i in range ( count_value . value ) ] <EOL> return monitors <EOL> _glfw . glfwGetPrimaryMonitor . restype = ctypes . POINTER ( _GLFWmonitor ) <EOL> _glfw . glfwGetPrimaryMonitor . argtypes = [ ] <EOL> def get_primary_monitor ( ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetPrimaryMonitor ( ) <EOL> _glfw . glfwGetMonitorPos . restype = None <EOL> _glfw . glfwGetMonitorPos . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) , <EOL> ctypes . POINTER ( ctypes . c_int ) , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_monitor_pos ( monitor ) : <EOL> '''<STR_LIT>''' <EOL> xpos_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> xpos = ctypes . pointer ( xpos_value ) <EOL> ypos_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> ypos = ctypes . pointer ( ypos_value ) <EOL> _glfw . glfwGetMonitorPos ( monitor , xpos , ypos ) <EOL> return xpos_value . value , ypos_value . value <EOL> _glfw . glfwGetMonitorPhysicalSize . restype = None <EOL> _glfw . glfwGetMonitorPhysicalSize . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) , <EOL> ctypes . POINTER ( ctypes . c_int ) , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_monitor_physical_size ( monitor ) : <EOL> '''<STR_LIT>''' <EOL> width_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> width = ctypes . pointer ( width_value ) <EOL> height_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> height = ctypes . pointer ( height_value ) <EOL> _glfw . glfwGetMonitorPhysicalSize ( monitor , width , height ) <EOL> return width_value . value , height_value . value <EOL> _glfw . glfwGetMonitorName . restype = ctypes . c_char_p <EOL> _glfw . glfwGetMonitorName . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) ] <EOL> def get_monitor_name ( monitor ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetMonitorName ( monitor ) <EOL> _monitor_callback = None <EOL> _glfw . glfwSetMonitorCallback . restype = _GLFWmonitorfun <EOL> _glfw . glfwSetMonitorCallback . argtypes = [ _GLFWmonitorfun ] <EOL> def set_monitor_callback ( cbfun ) : <EOL> '''<STR_LIT>''' <EOL> global _monitor_callback <EOL> previous_callback = _monitor_callback <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWmonitorfun ( cbfun ) <EOL> _monitor_callback = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetMonitorCallback ( cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _glfw . glfwGetVideoModes . restype = ctypes . POINTER ( _GLFWvidmode ) <EOL> _glfw . glfwGetVideoModes . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_video_modes ( monitor ) : <EOL> '''<STR_LIT>''' <EOL> count_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> count = ctypes . pointer ( count_value ) <EOL> result = _glfw . glfwGetVideoModes ( monitor , count ) <EOL> videomodes = [ result [ i ] . unwrap ( ) for i in range ( count_value . value ) ] <EOL> return videomodes <EOL> _glfw . glfwGetVideoMode . restype = ctypes . POINTER ( _GLFWvidmode ) <EOL> _glfw . glfwGetVideoMode . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) ] <EOL> def get_video_mode ( monitor ) : <EOL> '''<STR_LIT>''' <EOL> videomode = _glfw . glfwGetVideoMode ( monitor ) . contents <EOL> return videomode . unwrap ( ) <EOL> _glfw . glfwSetGamma . restype = None <EOL> _glfw . glfwSetGamma . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) , <EOL> ctypes . c_float ] <EOL> def set_gamma ( monitor , gamma ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetGamma ( monitor , gamma ) <EOL> _glfw . glfwGetGammaRamp . restype = ctypes . POINTER ( _GLFWgammaramp ) <EOL> _glfw . glfwGetGammaRamp . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) ] <EOL> def get_gamma_ramp ( monitor ) : <EOL> '''<STR_LIT>''' <EOL> gammaramp = _glfw . glfwGetGammaRamp ( monitor ) . contents <EOL> return gammaramp . unwrap ( ) <EOL> _glfw . glfwSetGammaRamp . restype = None <EOL> _glfw . glfwSetGammaRamp . argtypes = [ ctypes . POINTER ( _GLFWmonitor ) , <EOL> ctypes . POINTER ( _GLFWgammaramp ) ] <EOL> def set_gamma_ramp ( monitor , ramp ) : <EOL> '''<STR_LIT>''' <EOL> gammaramp = _GLFWgammaramp ( ) <EOL> gammaramp . wrap ( ramp ) <EOL> _glfw . glfwSetGammaRamp ( monitor , ctypes . pointer ( gammaramp ) ) <EOL> _glfw . glfwDefaultWindowHints . restype = None <EOL> _glfw . glfwDefaultWindowHints . argtypes = [ ] <EOL> def default_window_hints ( ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwDefaultWindowHints ( ) <EOL> _glfw . glfwWindowHint . restype = None <EOL> _glfw . glfwWindowHint . argtypes = [ ctypes . c_int , <EOL> ctypes . c_int ] <EOL> def window_hint ( target , hint ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwWindowHint ( target , hint ) <EOL> _glfw . glfwCreateWindow . restype = ctypes . POINTER ( _GLFWwindow ) <EOL> _glfw . glfwCreateWindow . argtypes = [ ctypes . c_int , <EOL> ctypes . c_int , <EOL> ctypes . c_char_p , <EOL> ctypes . POINTER ( _GLFWmonitor ) , <EOL> ctypes . POINTER ( _GLFWwindow ) ] <EOL> def create_window ( width , height , title , monitor , share ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwCreateWindow ( width , height , _to_char_p ( title ) , <EOL> monitor , share ) <EOL> _glfw . glfwDestroyWindow . restype = None <EOL> _glfw . glfwDestroyWindow . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def destroy_window ( window ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwDestroyWindow ( window ) <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_ulong ) ) . contents . value <EOL> for callback_repository in _callback_repositories : <EOL> del callback_repository [ window_addr ] <EOL> _glfw . glfwWindowShouldClose . restype = ctypes . c_int <EOL> _glfw . glfwWindowShouldClose . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def window_should_close ( window ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwWindowShouldClose ( window ) <EOL> _glfw . glfwSetWindowShouldClose . restype = None <EOL> _glfw . glfwSetWindowShouldClose . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ] <EOL> def set_window_should_close ( window , value ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetWindowShouldClose ( window , value ) <EOL> _glfw . glfwSetWindowTitle . restype = None <EOL> _glfw . glfwSetWindowTitle . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_char_p ] <EOL> def set_window_title ( window , title ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetWindowTitle ( window , _to_char_p ( title ) ) <EOL> _glfw . glfwGetWindowPos . restype = None <EOL> _glfw . glfwGetWindowPos . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . POINTER ( ctypes . c_int ) , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_window_pos ( window ) : <EOL> '''<STR_LIT>''' <EOL> xpos_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> xpos = ctypes . pointer ( xpos_value ) <EOL> ypos_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> ypos = ctypes . pointer ( ypos_value ) <EOL> _glfw . glfwGetWindowPos ( window , xpos , ypos ) <EOL> return xpos_value . value , ypos_value . value <EOL> _glfw . glfwSetWindowPos . restype = None <EOL> _glfw . glfwSetWindowPos . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int ] <EOL> def set_window_pos ( window , xpos , ypos ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetWindowPos ( window , xpos , ypos ) <EOL> _glfw . glfwGetWindowSize . restype = None <EOL> _glfw . glfwGetWindowSize . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . POINTER ( ctypes . c_int ) , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_window_size ( window ) : <EOL> '''<STR_LIT>''' <EOL> width_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> width = ctypes . pointer ( width_value ) <EOL> height_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> height = ctypes . pointer ( height_value ) <EOL> _glfw . glfwGetWindowSize ( window , width , height ) <EOL> return width_value . value , height_value . value <EOL> _glfw . glfwSetWindowSize . restype = None <EOL> _glfw . glfwSetWindowSize . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int ] <EOL> def set_window_size ( window , width , height ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetWindowSize ( window , width , height ) <EOL> _glfw . glfwGetFramebufferSize . restype = None <EOL> _glfw . glfwGetFramebufferSize . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . POINTER ( ctypes . c_int ) , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_framebuffer_size ( window ) : <EOL> '''<STR_LIT>''' <EOL> width_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> width = ctypes . pointer ( width_value ) <EOL> height_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> height = ctypes . pointer ( height_value ) <EOL> _glfw . glfwGetFramebufferSize ( window , width , height ) <EOL> return width_value . value , height_value . value <EOL> _glfw . glfwIconifyWindow . restype = None <EOL> _glfw . glfwIconifyWindow . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def iconify_window ( window ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwIconifyWindow ( window ) <EOL> _glfw . glfwRestoreWindow . restype = None <EOL> _glfw . glfwRestoreWindow . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def restore_window ( window ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwRestoreWindow ( window ) <EOL> _glfw . glfwShowWindow . restype = None <EOL> _glfw . glfwShowWindow . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def show_window ( window ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwShowWindow ( window ) <EOL> _glfw . glfwHideWindow . restype = None <EOL> _glfw . glfwHideWindow . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def hide_window ( window ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwHideWindow ( window ) <EOL> _glfw . glfwGetWindowMonitor . restype = ctypes . POINTER ( _GLFWmonitor ) <EOL> _glfw . glfwGetWindowMonitor . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def get_window_monitor ( window ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetWindowMonitor ( window ) <EOL> _glfw . glfwGetWindowAttrib . restype = ctypes . c_int <EOL> _glfw . glfwGetWindowAttrib . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ] <EOL> def get_window_attrib ( window , attrib ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetWindowAttrib ( window , attrib ) <EOL> _glfw . glfwSetWindowUserPointer . restype = None <EOL> _glfw . glfwSetWindowUserPointer . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_void_p ] <EOL> def set_window_user_pointer ( window , pointer ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetWindowUserPointer ( window , pointer ) <EOL> _glfw . glfwGetWindowUserPointer . restype = ctypes . c_void_p <EOL> _glfw . glfwGetWindowUserPointer . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def get_window_user_pointer ( window ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetWindowUserPointer ( window ) <EOL> _window_pos_callback_repository = { } <EOL> _callback_repositories . append ( _window_pos_callback_repository ) <EOL> _glfw . glfwSetWindowPosCallback . restype = _GLFWwindowposfun <EOL> _glfw . glfwSetWindowPosCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWwindowposfun ] <EOL> def set_window_pos_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _window_pos_callback_repository : <EOL> previous_callback = _window_pos_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWwindowposfun ( cbfun ) <EOL> _window_pos_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetWindowPosCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _window_size_callback_repository = { } <EOL> _callback_repositories . append ( _window_size_callback_repository ) <EOL> _glfw . glfwSetWindowSizeCallback . restype = _GLFWwindowsizefun <EOL> _glfw . glfwSetWindowSizeCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWwindowsizefun ] <EOL> def set_window_size_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _window_size_callback_repository : <EOL> previous_callback = _window_size_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWwindowsizefun ( cbfun ) <EOL> _window_size_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetWindowSizeCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _window_close_callback_repository = { } <EOL> _callback_repositories . append ( _window_close_callback_repository ) <EOL> _glfw . glfwSetWindowCloseCallback . restype = _GLFWwindowclosefun <EOL> _glfw . glfwSetWindowCloseCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWwindowclosefun ] <EOL> def set_window_close_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _window_close_callback_repository : <EOL> previous_callback = _window_close_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWwindowclosefun ( cbfun ) <EOL> _window_close_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetWindowCloseCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _window_refresh_callback_repository = { } <EOL> _callback_repositories . append ( _window_refresh_callback_repository ) <EOL> _glfw . glfwSetWindowRefreshCallback . restype = _GLFWwindowrefreshfun <EOL> _glfw . glfwSetWindowRefreshCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWwindowrefreshfun ] <EOL> def set_window_refresh_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _window_refresh_callback_repository : <EOL> previous_callback = _window_refresh_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWwindowrefreshfun ( cbfun ) <EOL> _window_refresh_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetWindowRefreshCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _window_focus_callback_repository = { } <EOL> _callback_repositories . append ( _window_focus_callback_repository ) <EOL> _glfw . glfwSetWindowFocusCallback . restype = _GLFWwindowfocusfun <EOL> _glfw . glfwSetWindowFocusCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWwindowfocusfun ] <EOL> def set_window_focus_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _window_focus_callback_repository : <EOL> previous_callback = _window_focus_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWwindowfocusfun ( cbfun ) <EOL> _window_focus_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetWindowFocusCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _window_iconify_callback_repository = { } <EOL> _callback_repositories . append ( _window_iconify_callback_repository ) <EOL> _glfw . glfwSetWindowIconifyCallback . restype = _GLFWwindowiconifyfun <EOL> _glfw . glfwSetWindowIconifyCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWwindowiconifyfun ] <EOL> def set_window_iconify_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _window_iconify_callback_repository : <EOL> previous_callback = _window_iconify_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWwindowiconifyfun ( cbfun ) <EOL> _window_iconify_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetWindowIconifyCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _framebuffer_size_callback_repository = { } <EOL> _callback_repositories . append ( _framebuffer_size_callback_repository ) <EOL> _glfw . glfwSetFramebufferSizeCallback . restype = _GLFWframebuffersizefun <EOL> _glfw . glfwSetFramebufferSizeCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWframebuffersizefun ] <EOL> def set_framebuffer_size_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _framebuffer_size_callback_repository : <EOL> previous_callback = _framebuffer_size_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWframebuffersizefun ( cbfun ) <EOL> _framebuffer_size_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetFramebufferSizeCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _glfw . glfwPollEvents . restype = None <EOL> _glfw . glfwPollEvents . argtypes = [ ] <EOL> def poll_events ( ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwPollEvents ( ) <EOL> _glfw . glfwWaitEvents . restype = None <EOL> _glfw . glfwWaitEvents . argtypes = [ ] <EOL> def wait_events ( ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwWaitEvents ( ) <EOL> _glfw . glfwGetInputMode . restype = ctypes . c_int <EOL> _glfw . glfwGetInputMode . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ] <EOL> def get_input_mode ( window , mode ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetInputMode ( window , mode ) <EOL> _glfw . glfwSetInputMode . restype = None <EOL> _glfw . glfwSetInputMode . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int , <EOL> ctypes . c_int ] <EOL> def set_input_mode ( window , mode , value ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetInputMode ( window , mode , value ) <EOL> _glfw . glfwGetKey . restype = ctypes . c_int <EOL> _glfw . glfwGetKey . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ] <EOL> def get_key ( window , key ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetKey ( window , key ) <EOL> _glfw . glfwGetMouseButton . restype = ctypes . c_int <EOL> _glfw . glfwGetMouseButton . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_int ] <EOL> def get_mouse_button ( window , button ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetMouseButton ( window , button ) <EOL> _glfw . glfwGetCursorPos . restype = None <EOL> _glfw . glfwGetCursorPos . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . POINTER ( ctypes . c_double ) , <EOL> ctypes . POINTER ( ctypes . c_double ) ] <EOL> def get_cursor_pos ( window ) : <EOL> '''<STR_LIT>''' <EOL> xpos_value = ctypes . c_double ( <NUM_LIT:0.0> ) <EOL> xpos = ctypes . pointer ( xpos_value ) <EOL> ypos_value = ctypes . c_double ( <NUM_LIT:0.0> ) <EOL> ypos = ctypes . pointer ( ypos_value ) <EOL> _glfw . glfwGetCursorPos ( window , xpos , ypos ) <EOL> return xpos_value . value , ypos_value . value <EOL> _glfw . glfwSetCursorPos . restype = None <EOL> _glfw . glfwSetCursorPos . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_double , <EOL> ctypes . c_double ] <EOL> def set_cursor_pos ( window , xpos , ypos ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetCursorPos ( window , xpos , ypos ) <EOL> _key_callback_repository = { } <EOL> _callback_repositories . append ( _key_callback_repository ) <EOL> _glfw . glfwSetKeyCallback . restype = _GLFWkeyfun <EOL> _glfw . glfwSetKeyCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWkeyfun ] <EOL> def set_key_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _key_callback_repository : <EOL> previous_callback = _key_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWkeyfun ( cbfun ) <EOL> _key_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetKeyCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _char_callback_repository = { } <EOL> _callback_repositories . append ( _char_callback_repository ) <EOL> _glfw . glfwSetCharCallback . restype = _GLFWcharfun <EOL> _glfw . glfwSetCharCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWcharfun ] <EOL> def set_char_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _char_callback_repository : <EOL> previous_callback = _char_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWcharfun ( cbfun ) <EOL> _char_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetCharCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _mouse_button_callback_repository = { } <EOL> _callback_repositories . append ( _mouse_button_callback_repository ) <EOL> _glfw . glfwSetMouseButtonCallback . restype = _GLFWmousebuttonfun <EOL> _glfw . glfwSetMouseButtonCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWmousebuttonfun ] <EOL> def set_mouse_button_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _mouse_button_callback_repository : <EOL> previous_callback = _mouse_button_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWmousebuttonfun ( cbfun ) <EOL> _mouse_button_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetMouseButtonCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _cursor_pos_callback_repository = { } <EOL> _callback_repositories . append ( _cursor_pos_callback_repository ) <EOL> _glfw . glfwSetCursorPosCallback . restype = _GLFWcursorposfun <EOL> _glfw . glfwSetCursorPosCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWcursorposfun ] <EOL> def set_cursor_pos_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _cursor_pos_callback_repository : <EOL> previous_callback = _cursor_pos_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWcursorposfun ( cbfun ) <EOL> _cursor_pos_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetCursorPosCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _cursor_enter_callback_repository = { } <EOL> _callback_repositories . append ( _cursor_enter_callback_repository ) <EOL> _glfw . glfwSetCursorEnterCallback . restype = _GLFWcursorenterfun <EOL> _glfw . glfwSetCursorEnterCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWcursorenterfun ] <EOL> def set_cursor_enter_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _cursor_enter_callback_repository : <EOL> previous_callback = _cursor_enter_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWcursorenterfun ( cbfun ) <EOL> _cursor_enter_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetCursorEnterCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _scroll_callback_repository = { } <EOL> _callback_repositories . append ( _scroll_callback_repository ) <EOL> _glfw . glfwSetScrollCallback . restype = _GLFWscrollfun <EOL> _glfw . glfwSetScrollCallback . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> _GLFWscrollfun ] <EOL> def set_scroll_callback ( window , cbfun ) : <EOL> '''<STR_LIT>''' <EOL> window_addr = ctypes . cast ( ctypes . pointer ( window ) , <EOL> ctypes . POINTER ( ctypes . c_long ) ) . contents . value <EOL> if window_addr in _scroll_callback_repository : <EOL> previous_callback = _scroll_callback_repository [ window_addr ] <EOL> else : <EOL> previous_callback = None <EOL> if cbfun is None : <EOL> cbfun = <NUM_LIT:0> <EOL> c_cbfun = _GLFWscrollfun ( cbfun ) <EOL> _scroll_callback_repository [ window_addr ] = ( cbfun , c_cbfun ) <EOL> cbfun = c_cbfun <EOL> _glfw . glfwSetScrollCallback ( window , cbfun ) <EOL> if previous_callback is not None and previous_callback [ <NUM_LIT:0> ] != <NUM_LIT:0> : <EOL> return previous_callback [ <NUM_LIT:0> ] <EOL> _glfw . glfwJoystickPresent . restype = ctypes . c_int <EOL> _glfw . glfwJoystickPresent . argtypes = [ ctypes . c_int ] <EOL> def joystick_present ( joy ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwJoystickPresent ( joy ) <EOL> _glfw . glfwGetJoystickAxes . restype = ctypes . POINTER ( ctypes . c_float ) <EOL> _glfw . glfwGetJoystickAxes . argtypes = [ ctypes . c_int , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_joystick_axes ( joy ) : <EOL> '''<STR_LIT>''' <EOL> count_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> count = ctypes . pointer ( count_value ) <EOL> result = _glfw . glfwGetJoystickAxes ( joy , count ) <EOL> return result , count_value . value <EOL> _glfw . glfwGetJoystickButtons . restype = ctypes . POINTER ( ctypes . c_ubyte ) <EOL> _glfw . glfwGetJoystickButtons . argtypes = [ ctypes . c_int , <EOL> ctypes . POINTER ( ctypes . c_int ) ] <EOL> def get_joystick_buttons ( joy ) : <EOL> '''<STR_LIT>''' <EOL> count_value = ctypes . c_int ( <NUM_LIT:0> ) <EOL> count = ctypes . pointer ( count_value ) <EOL> result = _glfw . glfwGetJoystickButtons ( joy , count ) <EOL> return result , count_value . value <EOL> _glfw . glfwGetJoystickName . restype = ctypes . c_char_p <EOL> _glfw . glfwGetJoystickName . argtypes = [ ctypes . c_int ] <EOL> def get_joystick_name ( joy ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetJoystickName ( joy ) <EOL> _glfw . glfwSetClipboardString . restype = None <EOL> _glfw . glfwSetClipboardString . argtypes = [ ctypes . POINTER ( _GLFWwindow ) , <EOL> ctypes . c_char_p ] <EOL> def set_clipboard_string ( window , string ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetClipboardString ( window , _to_char_p ( string ) ) <EOL> _glfw . glfwGetClipboardString . restype = ctypes . c_char_p <EOL> _glfw . glfwGetClipboardString . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def get_clipboard_string ( window ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetClipboardString ( window ) <EOL> _glfw . glfwGetTime . restype = ctypes . c_double <EOL> _glfw . glfwGetTime . argtypes = [ ] <EOL> def get_time ( ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetTime ( ) <EOL> _glfw . glfwSetTime . restype = None <EOL> _glfw . glfwSetTime . argtypes = [ ctypes . c_double ] <EOL> def set_time ( time ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSetTime ( time ) <EOL> _glfw . glfwMakeContextCurrent . restype = None <EOL> _glfw . glfwMakeContextCurrent . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def make_context_current ( window ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwMakeContextCurrent ( window ) <EOL> _glfw . glfwGetCurrentContext . restype = ctypes . POINTER ( _GLFWwindow ) <EOL> _glfw . glfwGetCurrentContext . argtypes = [ ] <EOL> def get_current_context ( ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetCurrentContext ( ) <EOL> _glfw . glfwSwapBuffers . restype = None <EOL> _glfw . glfwSwapBuffers . argtypes = [ ctypes . POINTER ( _GLFWwindow ) ] <EOL> def swap_buffers ( window ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSwapBuffers ( window ) <EOL> _glfw . glfwSwapInterval . restype = None <EOL> _glfw . glfwSwapInterval . argtypes = [ ctypes . c_int ] <EOL> def swap_interval ( interval ) : <EOL> '''<STR_LIT>''' <EOL> _glfw . glfwSwapInterval ( interval ) <EOL> _glfw . glfwExtensionSupported . restype = ctypes . c_int <EOL> _glfw . glfwExtensionSupported . argtypes = [ ctypes . c_char_p ] <EOL> def extension_supported ( extension ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwExtensionSupported ( _to_char_p ( extension ) ) <EOL> _glfw . glfwGetProcAddress . restype = ctypes . c_void_p <EOL> _glfw . glfwGetProcAddress . argtypes = [ ctypes . c_char_p ] <EOL> def get_proc_address ( procname ) : <EOL> '''<STR_LIT>''' <EOL> return _glfw . glfwGetProcAddress ( _to_char_p ( procname ) ) </s>
