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א_g ejא_ddde Zdejِ_ejejgejِ_dfdg Zڐeedhr"dejې_ejejgejې_didj Zee+ejݐ_ejejejee,ee+gejݐ_dkdl Zdejߐ_ee+gejߐ_dmdn Zejej_ee+gej_dodp Zdej_ee+ejgej_dqdr Zdej_ee+ejgej_dsdt Zdej_ee+eejeejgej_dudv Zdej_ee+ejejgej_dwdx Zdej_ee+eejeejgej_dydz Zdej_ee+ejejgej_d{d| Zdej_ee+eejeejgej_d}d~ Zeedrdej_ee+eejeejgej_dd ZeedrBejej_ee+gej_dd Zeedrdej_ee+ejgej_dd Zdej_ee+gej_dd Zdej_ee+gej_dd Zdej_ee+gej_dd Zdej_ee+gej_dd Zeedrdej_ee+gej_dd Z ee,ej_ee+gej_dd Zejej_ee+ejgej_dd ZeedrFdej_ee+ejejgej_dd Zi Zdej_ee+ejgej_dd Z	ejej
_ee+gej
_dd Zi Ze)e eej_ee+egej_dd Zi Ze)e eej_ee+egej_dd Zi Ze)e eej_ee+egej_dd Zi Ze)e eej_ee+egej_dd Zi Ze)e eej_ee+egej_dd Zi Ze)e eej_ee+egej_dd Zeedri Ze)e eej _ee+egej _dd Z!i Z"e)e" eej#_ee+egej#_dd Z$eedrpi Z%e)e% eej&_ee+egej&_dd Z'dej(_g ej(_dd Z)dej*_g ej*_dd Z+ejej,_ee+ejgej,_dd Z-dej._ee+ejejgej._dd Z/eedrlejej0_g ej0_dd Z1ejej2_ee+ejgej2_dd Z3ejej4_ee+ejgej4_dd Z5dej6_ee+eejeejgej6_dd Z7dej8_ee+ejejgej8_dÐdĄ Z9i Z:e)e: eej;_ee+egej;_dŐdƄ Z<i Z=e)e= eej>_ee+egej>_dǐdȄ Z?i Z@e)e@ eejA_ee+egejA_dɐdʄ ZBi ZCe)eC eejD_ee+egejD_dːd̄ ZEi ZFe)eF eejG_ee+egejG_d͐d΄ ZHi ZIe)eI eejJ_ee+egejJ_dϐdЄ ZKejejL_ejgejL_dѐd҄ ZMeejejN_ejeejgejN_dӐdԄ ZOeejPejQ_ejeejgejQ_dՐdք ZReed׃r6eejPejS_ejeejgejS_dؐdل ZTejejU_ejgejU_dڐdۄ ZVeed܃rejejW_ejgejW_dݐdބ ZXeed߃ r.eed r.i ZYdejZ_ejejgejZ_dd Z[ejej\_ejgej\_dd Z]eed rnejej^_ejgej^_dd Z_eed rejej`_ejee1gej`_dd Zadejb_ee+ejgejb_dd Zcejejd_ee+gejd_dd Zeejejf_g ejf_dd Zgdejh_ejgejh_dd Zidejj_ee+gejj_dd Zkee+ejl_g ejl_dd Zmdejn_ee+gejn_dd Zodejp_ejgejp_dd Zqejejr_ejgejr_dd Zsejejt_ejgejt_dd Zueed"ri Zve)ev eejw_ee+egejw_d d Zxeed#rFi Zye)ey eejz_ee+egejz_dd Z{eed#rejej|_g ej|_dd Z}eed#reejej~_eejgej~_d	d
 Zeed$r
ejej_g ej_dd Zeed$rDejej_g ej_dd Zeed$rdaeej_egej_dd Zeed$rejej_ejgej_dd Zeed%rejej_ejgej_dd Zeed%rLejej_ejejgej_dd Zeed%rejej_ejgej_dd Zeed %ree/ej_ee0ejejgej_d!d" Zeed#&r$ee/ej_ejgej_d$d% Zeed&&rddej_ee/gej_d'd( Zeed)&rdej_ee+ee/gej_d*d+ Zeed,'rejej_ejee+ejejgej_d-d. Zeed/'rPejej_ejejejgej_d0d1 Zeed2'rejej_ejejgej_d3d4 Zeed5'rdej_ee+ejee0gej_d6d7 Zeed8(r>dej_ee+ejejejejgej_d9d: Zeed;(rdej_ee+ejejgej_d<d= Zeed>)rdej_ee+eejeejeejeejgej_d?d@ ZeedA)rBdej_ee+gej_dBdC ZeedD)rdej_ee+gej_dEdF ZeedG)rdej_ee+ee,ejejejejejgej_dHdI ZeedJ*r&dej_ejgej_dKdL ZeedM*r\dej_g ej_dNdO ZeedP*rejej_ee,gej_dQdR ZeedS*rejej_ee,gej_dTdU ZeedV+r(ejej_ee+gej_dWdX ZeedY+rlejej_ee+gej_dZd[ Zeed\+rejej_ee,gej_d]d^ Zeed_+rejej_ee+gej_d`da Zeedb,r8ejej_ee+gej_dcdd Zeede,rrejej_g ej_dfdg Zeedh,rejej_ee,gej_didj Zeedk,rejejÐ_ee,gejÐ_dldm ZĐeedn-r>ejejŐ_ee+gejŐ_dodp ZƐeedq-rzdejǐ_ejgejǐ_drds ZȐeedt-rejejɐ_g ejɐ_dudv Zʐeedw-rejejː_ee+gejː_dxdy Z̐eedz.r<ejej͐_ee+gej͐_d{d| Zΐeed}.rvejejϐ_g ejϐ_d~d ZАeed.rejejѐ_ee,gejѐ_dd ZҐeed.rejejӐ_ee+gejӐ_dd ZԐeed/r8ejejՐ_g ejՐ_dd Z֐eed/r|ejejא_ee+gejא_dd Zؐeed/rejejِ_ee+gejِ_dd Zڐeed0r<ejejې_ee+eejeejeejeejgejې_dd Zܐeed0rejejݐ_ee+eejeejeejeejgejݐ_dd Zސeed0rejejߐ_ee+gejߐ_dd Zeed1rPdadadadej_eegej_dd Zeed1rdaeejejejZdej_egej_dd Zeed1rejej_g ej_dd Zeed2r(ejej_ejgej_dd Zeed2rlejej_ee+gej_dd Ze  dS (  z
Python bindings for GLFW.
    )print_function)division)unicode_literalsz'Florian Rhiem (florian.rhiem@gmail.com)z%Copyright (c) 2013-2024 Florian RhiemMITz2.10.2warnTN   )glfwz$Failed to load GLFW3 shared library.ZPYGLFW_PREVIEWF   c                 C   s
   |  dS )Nutf-8)encodes r   K/home/ghrups/robot-bench/.venv/lib/python3.9/site-packages/glfw/__init__.py<lambda>D       r   c                 C   s   |  |d S N)with_traceback	exception	tracebackr   r   r   _reraiseE   s    r   c                 C   s   | S r   r   r   r   r   r   r   H   r   c                 C   s   t d d S )Nz raise exception, None, traceback)execr   r   r   r   r   I   s    )FFIc                 C   s   | S r   r   Zptrr   r   r   r   Q   r   c                 C   s*   t | tjr&tttd| tjS | S )NZ	uintptr_t)
isinstanceffiZCDatactypescastintc_void_pr   r   r   r   _cffi_to_ctypes_void_pT   s    r!   c                       s"   e Zd ZdZd fdd	Z  ZS )	GLFWErrorz9
    Exception class used for reporting GLFW errors.
    Nc                    s   t t| | || _d S r   )superr"   __init__
error_code)selfmessager%   	__class__r   r   r$   ^   s    zGLFWError.__init__)N)__name__
__module____qualname____doc__r$   __classcell__r   r   r(   r   r"   Z   s   r"   c                   @   s   e Zd ZdZdejfgZdS )_GLFWwindowzD
    Wrapper for:
        typedef struct GLFWwindow GLFWwindow;
    dummyNr*   r+   r,   r-   r   c_int_fields_r   r   r   r   r/   f   s   r/   c                   @   s   e Zd ZdZdejfgZdS )_GLFWmonitorzF
    Wrapper for:
        typedef struct GLFWmonitor GLFWmonitor;
    r0   Nr1   r   r   r   r   r4   n   s   r4   c                   @   s   e Zd ZdZdejfdejfdejfdejfdejfdejfgZe	dg d	Z
e	d
ddgZe	dg dZdd Zdd Zdd ZdS )_GLFWvidmodezF
    Wrapper for:
        typedef struct GLFWvidmode GLFWvidmode;
    widthheightred_bits
green_bits	blue_bitsrefresh_rateGLFWvidmode)sizebitsr;   SizeBitsredgreenbluec                 C   s4   t j|  d| _d| _d| _d| _d| _d| _d S Nr   )	r   	Structurer$   r6   r7   r8   r9   r:   r;   r&   r   r   r   r$      s    z_GLFWvidmode.__init__c                 C   s,   |\}}| _ |\| _| _|\| _| _| _dS )1
        Wraps a nested python sequence.
        N)r;   r6   r7   r8   r9   r:   )r&   Z
video_moder=   r>   r   r   r   wrap   s    z_GLFWvidmode.wrapc                 C   s4   |  | j| j}| | j| j| j}| ||| jS )/
        Returns a GLFWvidmode object.
        )	r?   r6   r7   r@   r8   r9   r:   r<   r;   )r&   r=   r>   r   r   r   unwrap   s    z_GLFWvidmode.unwrapN)r*   r+   r,   r-   r   r2   c_uintr3   collections
namedtupler<   r?   r@   r$   rI   rK   r   r   r   r   r5   v   s    	r5   c                   @   sn   e Zd ZdZdeejfdeejfdeejfdejfgZe	
dg dZdd	 Zd
d Zdd ZdS )_GLFWgammarampzJ
    Wrapper for:
        typedef struct GLFWgammaramp GLFWgammaramp;
    rB   rC   rD   r=   GLFWgammaramprA   c                 C   s:   t j|  d | _d | _d | _d | _d | _d | _d| _	d S rE   )
r   rF   r$   rB   	red_arrayrC   green_arrayrD   
blue_arrayr=   rG   r   r   r   r$      s    z_GLFWgammaramp.__init__c           	      C   s  |\}}}t t|t|t|}tj| }t|| _| | _| | _| | _t	r~dd |D }dd |D }dd |D }t
| jD ]:}t|| | j|< t|| | j|< t|| | j|< qttj}t| j|| _t| j|| _t| j|| _dS )rH   c                 S   s   g | ]}|d  qS i  r   .0valuer   r   r   
<listcomp>   r   z'_GLFWgammaramp.wrap.<locals>.<listcomp>c                 S   s   g | ]}|d  qS rT   r   rU   r   r   r   rX      r   c                 S   s   g | ]}|d  qS rT   r   rU   r   r   r   rX      r   N)minlenr   c_ushortrL   r=   rQ   rR   rS   NORMALIZE_GAMMA_RAMPSranger   POINTERr   rB   rC   rD   )	r&   	gammaramprB   rC   rD   r=   
array_typeipointer_typer   r   r   rI      s&    

z_GLFWgammaramp.wrapc                    s    fddt  jD } fddt  jD } fddt  jD }trvdd |D }dd |D }dd |D } |||S )z1
        Returns a GLFWgammaramp object.
        c                    s   g | ]} j | qS r   )rB   rV   ra   rG   r   r   rX      r   z)_GLFWgammaramp.unwrap.<locals>.<listcomp>c                    s   g | ]} j | qS r   )rC   rc   rG   r   r   rX      r   c                    s   g | ]} j | qS r   )rD   rc   rG   r   r   rX      r   c                 S   s   g | ]}|d  qS g    @r   rU   r   r   r   rX      r   c                 S   s   g | ]}|d  qS rd   r   rU   r   r   r   rX      r   c                 S   s   g | ]}|d  qS rd   r   rU   r   r   r   rX      r   )r]   r=   r\   rP   )r&   rB   rC   rD   r   rG   r   rK      s    z_GLFWgammaramp.unwrapN)r*   r+   r,   r-   r   r^   r[   rL   r3   rM   rN   rP   r$   rI   rK   r   r   r   r   rO      s   
rO   c                   @   s   e Zd ZdZdejfgZdS )_GLFWcursorzD
    Wrapper for:
        typedef struct GLFWcursor GLFWcursor;
    r0   Nr1   r   r   r   r   re      s   re   c                   @   sZ   e Zd ZdZdejfdejfdeejfgZe	
dg dZdd Zd	d
 Zdd ZdS )
_GLFWimagezB
    Wrapper for:
        typedef struct GLFWimage GLFWimage;
    r6   r7   pixels	GLFWimage)r6   r7   rg   c                 C   s(   t j|  d| _d| _d | _d | _d S rE   )r   rF   r$   r6   r7   rg   pixels_arrayrG   r   r   r   r$      s
    z_GLFWimage.__init__c           	      C   s  t |drlt |drl|j\| _| _tjd | j| j  }| | _|d }t	|D ]\}}|| j|< qVnx|\| _| _}tjd | j | j }| | _t
| jD ]@}t
| jD ]0}t
dD ]"}|| | | | j| | |< qqqttj}t| j|| _dS )zE
        Wraps a nested python sequence or PIL/pillow Image.
        r=   convert   ZRGBAN)hasattrr=   r6   r7   r   c_ubyteri   rj   Zgetdata	enumerater]   r^   r   rg   )	r&   imager`   rg   ra   Zpixeljkrb   r   r   r   rI      s     $z_GLFWimage.wrapc                 C   s"   dd | j D }| | j| j|S )z-
        Returns a GLFWimage object.
        c                 S   s   g | ]}d d |D qS )c                 S   s   g | ]}d d |D qS )c                 S   s   g | ]}t |qS r   r   )rV   cr   r   r   rX     r   z;_GLFWimage.unwrap.<locals>.<listcomp>.<listcomp>.<listcomp>r   )rV   pr   r   r   rX     r   z0_GLFWimage.unwrap.<locals>.<listcomp>.<listcomp>r   )rV   lr   r   r   rX     r   z%_GLFWimage.unwrap.<locals>.<listcomp>)ri   rh   r6   r7   )r&   rg   r   r   r   rK     s    z_GLFWimage.unwrapN)r*   r+   r,   r-   r   r2   r^   rm   r3   rM   rN   rh   r$   rI   rK   r   r   r   r   rf      s   rf   c                   @   sT   e Zd ZdZdejd fdejd fgZe	dddgZ
dd Zd	d
 Zdd ZdS )_GLFWgamepadstatezP
    Wrapper for:
        typedef struct GLFWgamepadstate GLFWgamepadstate;
    buttons   axes   GLFWgamepadstatec                 C   s<   t j|  t jd dgd  | _t jd dgd  | _d S )Nrx   r   rz   )r   rF   r$   rm   rw   c_floatry   rG   r   r   r   r$   +  s    z_GLFWgamepadstate.__init__c                 C   sD   |\}}t dD ]}|| | j|< qt dD ]}|| | j|< q,dS )rH   rx   rz   N)r]   rw   ry   )r&   gamepad_staterw   ry   ra   r   r   r   rI   0  s
    z_GLFWgamepadstate.wrapc                 C   s,   dd | j D }dd | jD }| ||S )rJ   c                 S   s   g | ]}t |qS r   rr   )rV   buttonr   r   r   rX   >  r   z,_GLFWgamepadstate.unwrap.<locals>.<listcomp>c                 S   s   g | ]}t |qS r   )float)rV   Zaxisr   r   r   rX   ?  r   )rw   ry   r{   )r&   rw   ry   r   r   r   rK   :  s    z_GLFWgamepadstate.unwrapN)r*   r+   r,   r-   r   rm   r|   r3   rM   rN   r{   r$   rI   rK   r   r   r   r   rv     s   
rv      rk          '   ,   -   .   /   0   1   2   3   4   5   6   7   8   9   ;   =   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   [   \   ]   `            i  i  i  i  i  i  i  i  i	  i
  i  i  i  i  i  i  i  i  i"  i#  i$  i%  i&  i'  i(  i)  i*  i+  i,  i-  i.  i/  i0  i1  i2  i3  i4  i5  i6  i7  i8  i9  i:  i@  iA  iB  iC  iD  iE  iF  iG  iH  iI  iJ  iK  iL  iM  iN  iO  iP  iT  iU  iV  iW  iX  iY  iZ  i[  i\        rz      	   
               rx   i  i  i  i  i  i  i  i  i	  i
  i  i  i  i  i  i  i  i  i  i  i  i  i	  i
  i  i  i  i  i  i i i i i i i i i	 i
 i i i i i i i  i  i  i  i  i  i  i  i	  i
  i  i  i  i0 i0 i0 i@ i@ iP iP i` i  i  i i i  i  i0 i0 i0 i0 i0 i@ i@ i@ i@ iP iP i` i` i` i` i` i` i` i` i	` i
` ip ip ip ip ip ip ip i i i  i  i  i  i  i i i  i0 i   i  i  i  i  i  l        i0 c                    s   t   fdd}|S )Nc               	      sL   t d urd S z | i |W S  ttfy4    Y n   t a Y n0 d S r   )_exc_info_from_callbackKeyboardInterrupt
SystemExitsysexc_info)argskwargsfuncr   r   callback_wrapper  s    z7_callback_exception_decorator.<locals>.callback_wrapper)	functoolswraps)r   r   r   r   r   _callback_exception_decorator  s    r   c                  C   sl   dd } t tD ]}|dr| tt|_qt }|D ]0}|dr6|dr6|| fdd}|||< q6dS )	aQ  
    This function sets the errcheck attribute of all ctypes wrapped functions
    to evaluate the _exc_info_from_callback global variable and re-raise any
    exceptions that might have been raised in callbacks.
    It also modifies all callback types to automatically wrap the function
    using the _callback_exception_decorator.
    c                 W   s&   t d ur"t }d a t|d |d  | S )Nr   r	   )r   r   )resultr   excr   r   r   errcheck  s
    z#_prepare_errcheck.<locals>.errcheckr   Z_GLFWZfunc                 S   s   |t | S r   )r   )r   Z	cfunctyper   r   r   wrapper_cfunctype  s    z,_prepare_errcheck.<locals>.wrapper_cfunctypeN)dir_glfw
startswithgetattrr   globalsendswith)r   symbolZ_globalsr   r   r   r   _prepare_errcheck  s    
r   c                   @   s&   e Zd ZdZdefdefdefgZdS )_GLFWallocatorzJ
    Wrapper for:
        typedef struct GLFWallocator GLFWallocator;
    allocate
reallocate
deallocateN)r*   r+   r,   r-   _GLFWallocatefun_GLFWreallocatefun_GLFWdeallocatefunr3   r   r   r   r   r     s
   r   c                  C   s   t  } t }t|  |S )zU
    Initializes the GLFW library.

    Wrapper for:
        int glfwInit(void);
    )_getcwdr   glfwInitoschdir)cwdresr   r   r   init%  s    
r   c                  C   sF   t D ]} t|  D ]
}| |= qqtt D ]
}t|= q.t  dS )zZ
    Terminates the GLFW library.

    Wrapper for:
        void glfwTerminate(void);
    N)_callback_repositorieslistkeys_window_user_data_repositoryr   glfwTerminate)callback_repositorywindow_addrr   r   r   	terminate3  s    
r   glfwInitHintc                 C   s   t | | dS )z
        Sets the specified init hint to the desired value.

        Wrapper for:
            void glfwInitHint(int hint, int value);
        N)r   r   hintrW   r   r   r   	init_hintG  s    r   c                  C   sZ   t d} t | }t d}t |}t d}t |}t||| | j|j|jfS )z
    Retrieves the version of the GLFW library.

    Wrapper for:
        void glfwGetVersion(int* major, int* minor, int* rev);
    r   )r   r2   pointerr   glfwGetVersionrW   )Zmajor_valuemajorZminor_valueminorZ	rev_valuerevr   r   r   get_versionU  s    





r   c                   C   s   t  S )z
    Returns a string describing the compile-time configuration.

    Wrapper for:
        const char* glfwGetVersionString(void);
    )r   glfwGetVersionStringr   r   r   r   get_version_stringg  s    r   glfwGetErrorc                  C   s"   t jd  } t| }|| d fS )z
        Returns and clears the last error for the calling thread.

        Wrapper for:
            int glfwGetError(const char** description);
        r   r   )r   c_char_pr   r   )Zerror_descriptionr%   r   r   r   	get_errort  s    
r   c                 C   s   d| |f }t }t|trB| |v r,||  }nd|v r>|d }nd}|dv rXt|| dnF|dv rnt|t n0|dv rtd| n|dv rnt	d	| dS )
z
    Default error callback that raises GLFWError exceptions, issues GLFWError
    warnings or logs to the 'glfw' logger.
    Set an alternative error callback or set glfw.ERROR_REPORTING to False or
    'ignore' to disable this behavior.
    z(%d) %sN)raiser   T)r%   )r   warning)logr   )ignoreFz<Invalid value of ERROR_REPORTING while handling GLFW error:
)
ERROR_REPORTINGr   dictr"   warningsr   logging	getLoggerdebug
ValueError)r%   descriptionr'   Zerror_reportingr   r   r   _handle_glfw_errors  s"    	


r	  c                 C   sT   t }| du rt} t}nt| }| |fa |} t|  |durP|d tkrP|d S dS )zs
    Sets the error callback.

    Wrapper for:
        GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);
    Nr   )_error_callbackr	  _default_error_callback_GLFWerrorfunr   glfwSetErrorCallbackcbfunprevious_callbackc_cbfunr   r   r   set_error_callback  s    
r  c                     s:   t d} t | }t|  fddt| jD }|S )zx
    Returns the currently connected monitors.

    Wrapper for:
        GLFWmonitor** glfwGetMonitors(int* count);
    r   c                    s   g | ]} | qS r   r   rc   r   r   r   rX     r   z get_monitors.<locals>.<listcomp>)r   r2   r   r   glfwGetMonitorsr]   rW   )count_valuecountZmonitorsr   r  r   get_monitors  s
    


r  c                   C   s   t  S )zj
    Returns the primary monitor.

    Wrapper for:
        GLFWmonitor* glfwGetPrimaryMonitor(void);
    )r   glfwGetPrimaryMonitorr   r   r   r   get_primary_monitor  s    r  c                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
    Returns the position of the monitor's viewport on the virtual screen.

    Wrapper for:
        void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
    r   )r   r2   r   r   glfwGetMonitorPosrW   )monitor
xpos_valuexpos
ypos_valueyposr   r   r   get_monitor_pos  s    



r   glfwGetMonitorWorkareac           	      C   sv   t d}t |}t d}t |}t d}t |}t d}t |}t| |||| |j|j|j|jfS )z
        Retrives the work area of the monitor.

        Wrapper for:
            void glfwGetMonitorWorkarea(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
        r   )r   r2   r   r   r!  rW   )	r  r  r  r  r  width_valuer6   height_valuer7   r   r   r   get_monitor_workarea  s    







r$  c                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
    Returns the physical size of the monitor.

    Wrapper for:
        void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* height);
    r   )r   r2   r   r   glfwGetMonitorPhysicalSizerW   )r  r"  r6   r#  r7   r   r   r   get_monitor_physical_size  s    



r&  glfwGetMonitorContentScalec                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
        Retrieves the content scale for the specified monitor.

        Wrapper for:
            void glfwGetMonitorContentScale(GLFWmonitor* monitor, float* xscale, float* yscale);
        r   )r   r|   r   r   r'  rW   )r  xscale_valuexscaleyscale_valueyscaler   r   r   get_monitor_content_scale  s    



r,  c                 C   s
   t | S )z
    Returns the name of the specified monitor.

    Wrapper for:
        const char* glfwGetMonitorName(GLFWmonitor* monitor);
    )r   glfwGetMonitorNamer  r   r   r   get_monitor_name,  s    r/  glfwSetMonitorUserPointerglfwGetMonitorUserPointerc                 C   sl   d|f}t |tjs6d|f}ttt|tj}tt| ttjjj	}|t
|< t| | dS )aa  
        Sets the user pointer of the specified monitor. You may pass a normal
        python object into this function and it will be wrapped automatically.
        The object will be kept in existence until the pointer is set to
        something else.

        Wrapper for:
            void glfwSetMonitorUserPointer(int jid, void* pointer);
        FTN)r   r   r    r   r   	py_objectr^   c_longcontentsrW   _monitor_user_data_repositoryr   r0  )r  r   datamonitor_addrr   r   r   set_monitor_user_pointer=  s    
r8  c                 C   sL   t t | t t jjj}|tv rBt| }|d }|rB|d S t	| S )z
        Returns the user pointer of the specified monitor.

        Wrapper for:
            void* glfwGetMonitorUserPointer(int jid);
        r   r   )
r   r   r   r^   r3  r4  rW   r5  r   r1  )r  r7  r6  is_wrapped_py_objectr   r   r   get_monitor_user_pointerY  s    
r:  c                 C   sN   t }| du rd} t| }| |fa |} t|  |durJ|d dkrJ|d S dS )z
    Sets the monitor configuration callback.

    Wrapper for:
        GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);
    Nr   )_monitor_callback_GLFWmonitorfunr   glfwSetMonitorCallbackr  r   r   r   set_monitor_callbackn  s    
r>  c                    s<   t d}t |}t| |  fddt|jD }|S )z
    Returns the available video modes for the specified monitor.

    Wrapper for:
        const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
    r   c                    s   g | ]} |   qS r   )rK   rc   r  r   r   rX     r   z#get_video_modes.<locals>.<listcomp>)r   r2   r   r   glfwGetVideoModesr]   rW   )r  r  r  Z
videomodesr   r  r   get_video_modes  s
    

r@  c                 C   s   t | j}| S )z
    Returns the current mode of the specified monitor.

    Wrapper for:
        const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
    )r   glfwGetVideoModer4  rK   )r  Z	videomoder   r   r   get_video_mode  s    rB  c                 C   s   t | | dS )z
    Generates a gamma ramp and sets it for the specified monitor.

    Wrapper for:
        void glfwSetGamma(GLFWmonitor* monitor, float gamma);
    N)r   glfwSetGamma)r  gammar   r   r   	set_gamma  s    rE  c                 C   s   t | j}| S )z
    Retrieves the current gamma ramp for the specified monitor.

    Wrapper for:
        const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
    )r   glfwGetGammaRampr4  rK   )r  r_   r   r   r   get_gamma_ramp  s    rG  c                 C   s&   t  }|| t| t| dS )z
    Sets the current gamma ramp for the specified monitor.

    Wrapper for:
        void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
    N)rO   rI   r   glfwSetGammaRampr   r   )r  Zrampr_   r   r   r   set_gamma_ramp  s    
rI  c                   C   s   t   dS )zw
    Resets all window hints to their default values.

    Wrapper for:
        void glfwDefaultWindowHints(void);
    N)r   glfwDefaultWindowHintsr   r   r   r   default_window_hints  s    rK  c                 C   s   t | | dS )z
    Sets the specified window hint to the desired value.

    Wrapper for:
        void glfwWindowHint(int hint, int value);
    N)r   glfwWindowHintr   r   r   r   window_hint  s    rM  glfwWindowHintStringc                 C   s   t | t| dS )z
        Sets the specified window hint to the desired value.

        Wrapper for:
            void glfwWindowHintString(int hint, const char* value);
        N)r   rN  
_to_char_pr   r   r   r   window_hint_string  s    rP  c                 C   s   t | |t|||S )z
    Creates a window and its associated context.

    Wrapper for:
        GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
    )r   glfwCreateWindowrO  )r6   r7   titler  Zsharer   r   r   create_window  s    rS  c                 C   sR   t |  tt| ttjjj}t	D ]}||v r,||= q,|t
v rNt
|= dS )z~
    Destroys the specified window and its context.

    Wrapper for:
        void glfwDestroyWindow(GLFWwindow* window);
    N)r   glfwDestroyWindowr   r   r   r^   Zc_ulongr4  rW   r   r   )windowr   r   r   r   r   destroy_window  s    

rV  c                 C   s
   t | S )z
    Checks the close flag of the specified window.

    Wrapper for:
        int glfwWindowShouldClose(GLFWwindow* window);
    )r   glfwWindowShouldCloserU  r   r   r   window_should_close  s    rY  c                 C   s   t | | dS )z
    Sets the close flag of the specified window.

    Wrapper for:
        void glfwSetWindowShouldClose(GLFWwindow* window, int value);
    N)r   glfwSetWindowShouldClose)rU  rW   r   r   r   set_window_should_close  s    r[  c                 C   s   t | t| dS )z
    Sets the title of the specified window.

    Wrapper for:
        void glfwSetWindowTitle(GLFWwindow* window, const char* title);
    N)r   glfwSetWindowTitlerO  )rU  rR  r   r   r   set_window_title$  s    r]  c                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
    Retrieves the position of the client area of the specified window.

    Wrapper for:
        void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
    r   )r   r2   r   r   glfwGetWindowPosrW   rU  r  r  r  r  r   r   r   get_window_pos1  s    



r`  c                 C   s   t | || dS )z
    Sets the position of the client area of the specified window.

    Wrapper for:
        void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
    N)r   glfwSetWindowPosrU  r  r  r   r   r   set_window_posC  s    rc  c                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
    Retrieves the size of the client area of the specified window.

    Wrapper for:
        void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
    r   )r   r2   r   r   glfwGetWindowSizerW   rU  r"  r6   r#  r7   r   r   r   get_window_sizeP  s    



rf  c                 C   s   t | || dS )z
    Sets the size of the client area of the specified window.

    Wrapper for:
        void glfwSetWindowSize(GLFWwindow* window, int width, int height);
    N)r   glfwSetWindowSize)rU  r6   r7   r   r   r   set_window_sizeb  s    rh  c                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
    Retrieves the size of the framebuffer of the specified window.

    Wrapper for:
        void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);
    r   )r   r2   r   r   glfwGetFramebufferSizerW   re  r   r   r   get_framebuffer_sizeo  s    



rj  glfwGetWindowContentScalec                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
        Retrieves the content scale for the specified window.

        Wrapper for:
            void glfwGetWindowContentScale(GLFWwindow* window, float* xscale, float* yscale);
        r   )r   r|   r   r   rk  rW   )rU  r(  r)  r*  r+  r   r   r   get_window_content_scale  s    



rl  glfwGetWindowOpacityc                 C   s
   t | S )z
        Returns the opacity of the whole window.

        Wrapper for:
            float glfwGetWindowOpacity(GLFWwindow* window);
        )r   rm  rX  r   r   r   get_window_opacity  s    rn  glfwSetWindowOpacityc                 C   s   t |}t| | dS )z
        Sets the opacity of the whole window.

        Wrapper for:
            void glfwSetWindowOpacity(GLFWwindow* window, float opacity);
        N)r   r|   r   ro  )rU  Zopacityr   r   r   set_window_opacity  s    
rp  c                 C   s   t |  dS )zo
    Iconifies the specified window.

    Wrapper for:
        void glfwIconifyWindow(GLFWwindow* window);
    N)r   glfwIconifyWindowrX  r   r   r   iconify_window  s    rr  c                 C   s   t |  dS )zn
    Restores the specified window.

    Wrapper for:
        void glfwRestoreWindow(GLFWwindow* window);
    N)r   glfwRestoreWindowrX  r   r   r   restore_window  s    rt  c                 C   s   t |  dS )zp
    Makes the specified window visible.

    Wrapper for:
        void glfwShowWindow(GLFWwindow* window);
    N)r   glfwShowWindowrX  r   r   r   show_window  s    rv  c                 C   s   t |  dS )zh
    Hides the specified window.

    Wrapper for:
        void glfwHideWindow(GLFWwindow* window);
    N)r   glfwHideWindowrX  r   r   r   hide_window  s    rx  glfwRequestWindowAttentionc                 C   s   t |  dS )z
        Requests user attention to the specified window.

        Wrapper for:
            void glfwRequestWindowAttention(GLFWwindow* window);
        N)r   ry  rX  r   r   r   request_window_attention  s    rz  c                 C   s
   t | S )z
    Returns the monitor that the window uses for full screen mode.

    Wrapper for:
        GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
    )r   glfwGetWindowMonitorrX  r   r   r   get_window_monitor  s    r|  c                 C   s   t | |S )z
    Returns an attribute of the specified window.

    Wrapper for:
        int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
    )r   glfwGetWindowAttrib)rU  attribr   r   r   get_window_attrib  s    r  glfwSetWindowAttribc                 C   s   t | || dS )z
        Returns an attribute of the specified window.

        Wrapper for:
            void glfwSetWindowAttrib(GLFWwindow* window, int attrib, int value);
        N)r   r  )rU  r~  rW   r   r   r   set_window_attrib  s    r  c                 C   sl   d|f}t |tjs6d|f}ttt|tj}tt| ttjjj	}|t
|< t| | dS )ak  
    Sets the user pointer of the specified window. You may pass a normal python object into this function and it will
    be wrapped automatically. The object will be kept in existence until the pointer is set to something else or
    until the window is destroyed.

    Wrapper for:
        void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
    FTN)r   r   r    r   r   r2  r^   r3  r4  rW   r   r   glfwSetWindowUserPointer)rU  r   r6  r   r   r   r   set_window_user_pointer  s    

r  c                 C   sL   t t | t t jjj}|tv rBt| }|d }|rB|d S t	| S )z
    Returns the user pointer of the specified window.

    Wrapper for:
        void* glfwGetWindowUserPointer(GLFWwindow* window);
    r   r   )
r   r   r   r^   r3  r4  rW   r   r   glfwGetWindowUserPointer)rU  r   r6  r9  r   r   r   get_window_user_pointer*  s    
r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the position callback for the specified window.

    Wrapper for:
        GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   _window_pos_callback_repository_GLFWwindowposfunr   glfwSetWindowPosCallbackrU  r  r   r  r  r   r   r   set_window_pos_callbackA  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the size callback for the specified window.

    Wrapper for:
        GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW    _window_size_callback_repository_GLFWwindowsizefunr   glfwSetWindowSizeCallbackr  r   r   r   set_window_size_callback\  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the close callback for the specified window.

    Wrapper for:
        GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   !_window_close_callback_repository_GLFWwindowclosefunr   glfwSetWindowCloseCallbackr  r   r   r   set_window_close_callbackw  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the refresh callback for the specified window.

    Wrapper for:
        GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   #_window_refresh_callback_repository_GLFWwindowrefreshfunr   glfwSetWindowRefreshCallbackr  r   r   r   set_window_refresh_callback  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the focus callback for the specified window.

    Wrapper for:
        GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   !_window_focus_callback_repository_GLFWwindowfocusfunr   glfwSetWindowFocusCallbackr  r   r   r   set_window_focus_callback  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the iconify callback for the specified window.

    Wrapper for:
        GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   #_window_iconify_callback_repository_GLFWwindowiconifyfunr   glfwSetWindowIconifyCallbackr  r   r   r   set_window_iconify_callback  s    

r  glfwSetWindowMaximizeCallbackc                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
        Sets the maximize callback for the specified window.

        Wrapper for:
            GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun cbfun);
        Nr   )r   r   r   r^   r3  r4  rW   $_window_maximize_callback_repository_GLFWwindowmaximizefunr   r  r  r   r   r   set_window_maximize_callback  s     
r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the framebuffer resize callback for the specified window.

    Wrapper for:
        GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   %_framebuffer_size_callback_repository_GLFWframebuffersizefunr   glfwSetFramebufferSizeCallbackr  r   r   r   set_framebuffer_size_callback  s    

r  !glfwSetWindowContentScaleCallbackc                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
        Sets the window content scale callback for the specified window.

        Wrapper for:
            GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun cbfun);
        Nr   )r   r   r   r^   r3  r4  rW   )_window_content_scale_callback_repository_GLFWwindowcontentscalefunr   r  r  r   r   r   !set_window_content_scale_callback$  s     
r  c                   C   s   t   dS )z\
    Processes all pending events.

    Wrapper for:
        void glfwPollEvents(void);
    N)r   glfwPollEventsr   r   r   r   poll_events>  s    r  c                   C   s   t   dS )zq
    Waits until events are pending and processes them.

    Wrapper for:
        void glfwWaitEvents(void);
    N)r   glfwWaitEventsr   r   r   r   wait_eventsI  s    r  c                 C   s   t | |S )z
    Returns the value of an input option for the specified window.

    Wrapper for:
        int glfwGetInputMode(GLFWwindow* window, int mode);
    )r   glfwGetInputMode)rU  moder   r   r   get_input_modeU  s    r  c                 C   s   t | || dS )am  
    Sets an input option for the specified window.
    @param[in] window The window whose input mode to set.
    @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
    `GLFW_STICKY_MOUSE_BUTTONS`.
    @param[in] value The new value of the specified input mode.

    Wrapper for:
        void glfwSetInputMode(GLFWwindow* window, int mode, int value);
    N)r   glfwSetInputMode)rU  r  rW   r   r   r   set_input_modeb  s    r  glfwRawMouseMotionSupportedc                   C   s   t  dkS )z
        Returns whether raw mouse motion is supported.

        Wrapper for:
            int glfwRawMouseMotionSupported(void);
        r   )r   r  r   r   r   r   raw_mouse_motion_supporteds  s    r  c                 C   s   t | |S )z
    Returns the last reported state of a keyboard key for the specified
    window.

    Wrapper for:
        int glfwGetKey(GLFWwindow* window, int key);
    )r   
glfwGetKey)rU  keyr   r   r   get_key  s    r  c                 C   s   t | |S )z
    Returns the last reported state of a mouse button for the specified
    window.

    Wrapper for:
        int glfwGetMouseButton(GLFWwindow* window, int button);
    )r   glfwGetMouseButton)rU  r~   r   r   r   get_mouse_button  s    r  c                 C   sB   t d}t |}t d}t |}t| || |j|jfS )z
    Retrieves the last reported cursor position, relative to the client
    area of the window.

    Wrapper for:
        void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
    g        )r   c_doubler   r   glfwGetCursorPosrW   r_  r   r   r   get_cursor_pos  s    



r  c                 C   s   t | || dS )z
    Sets the position of the cursor, relative to the client area of the window.

    Wrapper for:
        void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
    N)r   glfwSetCursorPosrb  r   r   r   set_cursor_pos  s    r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the key callback.

    Wrapper for:
        GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   _key_callback_repository_GLFWkeyfunr   glfwSetKeyCallbackr  r   r   r   set_key_callback  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the Unicode character callback.

    Wrapper for:
        GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   _char_callback_repository_GLFWcharfunr   glfwSetCharCallbackr  r   r   r   set_char_callback  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the mouse button callback.

    Wrapper for:
        GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   !_mouse_button_callback_repository_GLFWmousebuttonfunr   glfwSetMouseButtonCallbackr  r   r   r   set_mouse_button_callback  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the cursor position callback.

    Wrapper for:
        GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   _cursor_pos_callback_repository_GLFWcursorposfunr   glfwSetCursorPosCallbackr  r   r   r   set_cursor_pos_callback  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the cursor enter/exit callback.

    Wrapper for:
        GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   !_cursor_enter_callback_repository_GLFWcursorenterfunr   glfwSetCursorEnterCallbackr  r   r   r   set_cursor_enter_callback(  s    

r  c                 C   s   t t | t t jjj}|tv r0t| }nd}|du r@d}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
    Sets the scroll callback.

    Wrapper for:
        GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);
    Nr   )r   r   r   r^   r3  r4  rW   _scroll_callback_repository_GLFWscrollfunr   glfwSetScrollCallbackr  r   r   r   set_scroll_callbackC  s    

r  c                 C   s
   t | S )zx
    Returns whether the specified joystick is present.

    Wrapper for:
        int glfwJoystickPresent(int joy);
    )r   glfwJoystickPresentjoyr   r   r   joystick_present[  s    r  c                 C   s*   t d}t |}t| |}||jfS )z
    Returns the values of all axes of the specified joystick.

    Wrapper for:
        const float* glfwGetJoystickAxes(int joy, int* count);
    r   )r   r2   r   r   glfwGetJoystickAxesrW   r  r  r  r   r   r   r   get_joystick_axesg  s    

r  c                 C   s*   t d}t |}t| |}||jfS )z
    Returns the state of all buttons of the specified joystick.

    Wrapper for:
        const unsigned char* glfwGetJoystickButtons(int joy, int* count);
    r   )r   r2   r   r   glfwGetJoystickButtonsrW   r  r   r   r   get_joystick_buttonsv  s    

r  glfwGetJoystickHatsc                 C   s*   t d}t |}t| |}||jfS )z
        Returns the state of all hats of the specified joystick.

        Wrapper for:
            const unsigned char* glfwGetJoystickButtons(int joy, int* count);
        r   )r   r2   r   r   r  rW   )joystick_idr  r  r   r   r   r   get_joystick_hats  s    

r  c                 C   s
   t | S )zy
    Returns the name of the specified joystick.

    Wrapper for:
        const char* glfwGetJoystickName(int joy);
    )r   glfwGetJoystickNamer  r   r   r   get_joystick_name  s    r  glfwGetJoystickGUIDc                 C   s
   t | S )z
        Returns the SDL compatible GUID of the specified joystick.

        Wrapper for:
            const char* glfwGetJoystickGUID(int jid);
        )r   r  r  r   r   r   get_joystick_guid  s    r  glfwSetJoystickUserPointerglfwGetJoystickUserPointerc                 C   sN   d|f}t |tjs6d|f}ttt|tj}|t| < t| | dS )ac  
        Sets the user pointer of the specified joystick. You may pass a normal
        python object into this function and it will be wrapped automatically.
        The object will be kept in existence until the pointer is set to
        something else.

        Wrapper for:
            void glfwSetJoystickUserPointer(int jid, void* pointer);
        FTN)	r   r   r    r   r   r2  _joystick_user_data_repositoryr   r  )r  r   r6  r   r   r   set_joystick_user_pointer  s    r  c                 C   s.   | t v r$t |  }|d }|r$|d S t| S )z
        Returns the user pointer of the specified joystick.

        Wrapper for:
            void* glfwGetJoystickUserPointer(int jid);
        r   r   )r  r   r  )r  r6  r9  r   r   r   get_joystick_user_pointer  s    r  glfwJoystickIsGamepadc                 C   s   t | dkS )z
        Returns whether the specified joystick has a gamepad mapping.

        Wrapper for:
            int glfwJoystickIsGamepad(int jid);
        r   )r   r  r  r   r   r   joystick_is_gamepad  s    r  glfwGetGamepadStatec                 C   s(   t  }t| t|tkr dS | S )z
        Retrieves the state of the specified joystick remapped as a gamepad.

        Wrapper for:
            int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
        N)rv   r   r  r   byrefFALSErK   )r  r}   r   r   r   get_gamepad_state  s    r  c                 C   s,   | durt jdtdd t| t| dS )z
    Sets the clipboard to the specified string.

    Wrapper for:
        void glfwSetClipboardString(GLFWwindow* window, const char* string);
    N<The window parameter to glfwSetClipboardString is deprecatedr	   
stacklevel)r  r   DeprecationWarningr   glfwSetClipboardStringrO  )rU  stringr   r   r   set_clipboard_string  s    r  c                 C   s"   | durt jdtdd t| S )z
    Retrieves the contents of the clipboard as a string.

    Wrapper for:
        const char* glfwGetClipboardString(GLFWwindow* window);
    Nr  r	   r  )r  r   r  r   glfwGetClipboardStringrX  r   r   r   get_clipboard_string	  s    r  c                   C   s   t  S )zb
    Returns the value of the GLFW timer.

    Wrapper for:
        double glfwGetTime(void);
    )r   glfwGetTimer   r   r   r   get_time	  s    r  c                 C   s   t |  dS )zW
    Sets the GLFW timer.

    Wrapper for:
        void glfwSetTime(double time);
    N)r   glfwSetTime)timer   r   r   set_time#	  s    r  c                 C   s   t |  dS )z
    Makes the context of the specified window current for the calling
    thread.

    Wrapper for:
        void glfwMakeContextCurrent(GLFWwindow* window);
    N)r   glfwMakeContextCurrentrX  r   r   r   make_context_current.	  s    r  c                   C   s   t  S )z
    Returns the window whose context is current on the calling thread.

    Wrapper for:
        GLFWwindow* glfwGetCurrentContext(void);
    )r   glfwGetCurrentContextr   r   r   r   get_current_context:	  s    r  c                 C   s   t |  dS )z
    Swaps the front and back buffers of the specified window.

    Wrapper for:
        void glfwSwapBuffers(GLFWwindow* window);
    N)r   glfwSwapBuffersrX  r   r   r   swap_buffersE	  s    r  c                 C   s   t |  dS )zx
    Sets the swap interval for the current context.

    Wrapper for:
        void glfwSwapInterval(int interval);
    N)r   glfwSwapInterval)intervalr   r   r   swap_intervalP	  s    r
  c                 C   s   t t| S )z
    Returns whether the specified extension is available.

    Wrapper for:
        int glfwExtensionSupported(const char* extension);
    )r   glfwExtensionSupportedrO  )	extensionr   r   r   extension_supported[	  s    r  c                 C   s   t t| S )z
    Returns the address of the specified function for the current
    context.

    Wrapper for:
        GLFWglproc glfwGetProcAddress(const char* procname);
    )r   glfwGetProcAddressrO  )procnamer   r   r   get_proc_addressf	  s    r  glfwSetDropCallbackc                 C   s   t t | t t jjj}|tv r0t| }nd}|du rBd}n|fdd}|}t|}||ft|< |}t	
| | |dur|d dkr|d S dS )z
        Sets the file drop callback.

        Wrapper for:
            GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
        Nr   c                    s$    fddt |D }|| | d S )Nc                    s   g | ]} |  d qS r
   decoderc   c_pathsr   r   rX   	  r   z9set_drop_callback.<locals>.cb_wrapper.<locals>.<listcomp>)r]   )rU  r  r  r  pathsr   r  r   
cb_wrapper	  s    z%set_drop_callback.<locals>.cb_wrapper)r   r   r   r^   r3  r4  rW    _window_drop_callback_repository_GLFWdropfunr   r  )rU  r  r   r  r  r  r   r   r   set_drop_callbackv	  s     

r  glfwSetCharModsCallbackc                 C   s   t jdtdd tt| ttjjj	}|t
v r@t
| }nd}|du rPd}t|}||ft
|< |}t| | |dur|d dkr|d S dS )z
        Sets the Unicode character with modifiers callback.

        Wrapper for:
            GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun);
        z<glfwSetCharModsCallback is scheduled for removal in GLFW 4.0r	   r  Nr   )r  r   r  r   r   r   r^   r3  r4  rW   %_window_char_mods_callback_repository_GLFWcharmodsfunr   r  r  r   r   r   set_char_mods_callback	  s    

r  glfwVulkanSupportedc                   C   s   t  dkS )z
        Returns whether the Vulkan loader has been found.

        Wrapper for:
            int glfwVulkanSupported(void);
        r   )r   r   r   r   r   r   vulkan_supported	  s    r!  !glfwGetRequiredInstanceExtensionsc                     s>   t d} t | }t| | j} fddt|D }|S )z
        Returns the Vulkan instance extensions required by GLFW.

        Wrapper for:
            const char** glfwGetRequiredInstanceExtensions(uint32_t* count);
        r   c                    s   g | ]} |  d qS r  r  rc   Zc_extensionsr   r   rX   	  r   z4get_required_instance_extensions.<locals>.<listcomp>)r   c_uint32r   r   r"  rW   r]   )r  r  
extensionsr   r#  r    get_required_instance_extensions	  s    


r&  glfwGetTimerValuec                   C   s   t t S )z
        Returns the current value of the raw timer.

        Wrapper for:
            uint64_t glfwGetTimerValue(void);
        )r   r   r'  r   r   r   r   get_timer_value	  s    r(  glfwGetTimerFrequencyc                   C   s   t t S )z
        Returns the frequency, in Hz, of the raw timer.

        Wrapper for:
            uint64_t glfwGetTimerFrequency(void);
        )r   r   r)  r   r   r   r   get_timer_frequency	  s    r*  glfwSetJoystickCallbackc                 C   sN   t }| du rd} t| }| |fa|} t|  |durJ|d dkrJ|d S dS )z
        Sets the error callback.

        Wrapper for:
            GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun);
        Nr   )r
  _GLFWjoystickfun_joystick_callbackr   r+  r  r   r   r   set_joystick_callback	  s    
r.  glfwUpdateGamepadMappingsc                 C   s   t t| S )z
        Adds the specified SDL_GameControllerDB gamepad mappings.

        Wrapper for:
            int glfwUpdateGamepadMappings(const char* string);
        )r   r/  rO  )r  r   r   r   update_gamepad_mappings	  s    r0  glfwGetGamepadNamec                 C   s   t | }|r|dS dS )z
        Returns the human-readable gamepad name for the specified joystick.

        Wrapper for:
            const char* glfwGetGamepadName(int jid);
        r
   N)r   r1  r  )r  Zgamepad_namer   r   r   get_gamepad_name
  s    

r2  glfwGetKeyNamec                 C   s   t | |}|r|dS dS )z
        Returns the localized name of the specified printable key.

        Wrapper for:
            const char* glfwGetKeyName(int key, int scancode);
        r
   N)r   r3  r  )r  ZscancodeZkey_namer   r   r   get_key_name
  s    
r4  glfwGetKeyScancodec                 C   s
   t | S )z
        Returns the platform-specific scancode of the specified key.

        Wrapper for:
            int glfwGetKeyScancode(int key);
        )r   r5  )r  r   r   r   get_key_scancode+
  s    r6  glfwCreateCursorc                 C   s$   t  }||  tt|||S )z
        Creates a custom cursor.

        Wrapper for:
            GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot);
        )rf   rI   r   r7  r   r   )ro   ZxhotZyhotZc_imager   r   r   create_cursor:
  s    
r8  glfwCreateStandardCursorc                 C   s
   t | S )z
        Creates a cursor with a standard shape.

        Wrapper for:
            GLFWcursor* glfwCreateStandardCursor(int shape);
        )r   r9  )shaper   r   r   create_standard_cursorH
  s    r;  glfwDestroyCursorc                 C   s   t |  dS )zr
        Destroys a cursor.

        Wrapper for:
            void glfwDestroyCursor(GLFWcursor* cursor);
        N)r   r<  )cursorr   r   r   destroy_cursorT
  s    r>  glfwSetCursorc                 C   s   t | | dS )z
        Sets the cursor for the window.

        Wrapper for:
            void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
        N)r   r?  )rU  r=  r   r   r   
set_cursora
  s    r@  glfwCreateWindowSurfacec                 C   s(   t | } t |}t |}t| |||S )z
        Creates a Vulkan surface for the specified window.

        Wrapper for:
            VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
        )r!   r   rA  )instancerU  	allocatorZsurfacer   r   r   create_window_surfacep
  s    rD  (glfwGetPhysicalDevicePresentationSupportc                 C   s   t | } t |}t| ||S )z
        Creates a Vulkan surface for the specified window.

        Wrapper for:
            int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
        )r!   r   rE  )rB  ZdeviceZqueuefamilyr   r   r   (get_physical_device_presentation_support
  s    rF  glfwGetInstanceProcAddressc                 C   s   t | } t| |S )z
        Returns the address of the specified Vulkan instance function.

        Wrapper for:
            GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname);
        )r!   r   rG  )rB  r  r   r   r   get_instance_proc_address
  s    rH  glfwSetWindowIconc                 C   sd   |dkr$t |drt|dkr$|g}t| }| }t|D ]\}}|| | q:t| || dS )z
        Sets the icon for the specified window.

        Wrapper for:
            void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images);
        r   __len__r   N)rl   rZ   rf   rn   rI   r   rI  )rU  r  Zimagesr`   Z_imagesra   ro   r   r   r   set_window_icon
  s    rK  glfwSetWindowSizeLimitsc                 C   s   t | |||| dS )z
        Sets the size limits of the specified window.

        Wrapper for:
            void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
        N)r   rL  )rU  ZminwidthZ	minheightZmaxwidthZ	maxheightr   r   r   set_window_size_limits
  s    	rM  glfwSetWindowAspectRatioc                 C   s   t | || dS )z
        Sets the aspect ratio of the specified window.

        Wrapper for:
            void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
        N)r   rN  )rU  Znumerdenomr   r   r   set_window_aspect_ratio
  s    rP  glfwGetWindowFrameSizec              	   C   sf   t d}t d}t d}t d}t| t |t |t |t | |j|j|j|jfS )z
        Retrieves the size of the frame of the window.

        Wrapper for:
            void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
        r   )r   r2   r   rQ  r   rW   )rU  lefttoprightbottomr   r   r   get_window_frame_size
  s    



rV  glfwMaximizeWindowc                 C   s   t |  dS )z
        Maximizes the specified window.

        Wrapper for:
            void glfwMaximizeWindow(GLFWwindow* window);
        N)r   rW  rX  r   r   r   maximize_window
  s    rX  glfwFocusWindowc                 C   s   t |  dS )z
        Brings the specified window to front and sets input focus.

        Wrapper for:
            void glfwFocusWindow(GLFWwindow* window);
        N)r   rY  rX  r   r   r   focus_window
  s    rZ  glfwSetWindowMonitorc              	   C   s   t | |||||| dS )z
        Sets the mode, monitor, video mode and placement of a window.

        Wrapper for:
            void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
        N)r   r[  )rU  r  r  r  r6   r7   r;   r   r   r   set_window_monitor
  s    
r\  glfwWaitEventsTimeoutc                 C   s   t |  dS )z
        Waits with timeout until events are queued and processes them.

        Wrapper for:
            void glfwWaitEventsTimeout(double timeout);
        N)r   r]  )timeoutr   r   r   wait_events_timeout  s    r_  glfwPostEmptyEventc                   C   s   t   dS )zw
        Posts an empty event to the event queue.

        Wrapper for:
            void glfwPostEmptyEvent();
        N)r   r`  r   r   r   r   post_empty_event$  s    ra  glfwGetWin32Adapterc                 C   s   t | }|r|dS dS )z
        Returns the adapter device name of the specified monitor.

        Wrapper for:
            const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
        r
   N)r   rb  r  )r  Zadapter_namer   r   r   get_win32_adapter1  s    

rc  glfwGetWin32Monitorc                 C   s   t | }|r|dS dS )z
        Returns the display device name of the specified monitor.

        Wrapper for:
            const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
        r
   N)r   rd  r  )r  Zmonitor_namer   r   r   get_win32_monitorA  s    

re  glfwGetWin32Windowc                 C   s
   t | S )z
        Returns the HWND of the specified window.

        Wrapper for:
            HWND glfwGetWin32Window(GLFWwindow* window);
        )r   rf  rX  r   r   r   get_win32_windowQ  s    rg  glfwGetWGLContextc                 C   s
   t | S )z
        Returns the HGLRC of the specified window.

        Wrapper for:
            HGLRC glfwGetWGLContext(GLFWwindow* window);
        )r   rh  rX  r   r   r   get_wgl_context^  s    ri  glfwGetCocoaMonitorc                 C   s
   t | S )z
        Returns the CGDirectDisplayID of the specified monitor.

        Wrapper for:
            CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
        )r   rj  r.  r   r   r   get_cocoa_monitork  s    rk  glfwGetCocoaWindowc                 C   s
   t | S )z
        Returns the NSWindow of the specified window.

        Wrapper for:
            id glfwGetCocoaWindow(GLFWwindow* window);
        )r   rl  rX  r   r   r   get_cocoa_windowx  s    rm  glfwGetNSGLContextc                 C   s
   t | S )z
        Returns the NSOpenGLContext of the specified window.

        Wrapper for:
            id glfwGetNSGLContext(GLFWwindow* window);
        )r   rn  rX  r   r   r   get_nsgl_context  s    ro  glfwGetX11Displayc                   C   s   t  S )zw
        Returns the Display used by GLFW.

        Wrapper for:
            Display* glfwGetX11Display(void);
        )r   rp  r   r   r   r   get_x11_display  s    rq  glfwGetX11Adapterc                 C   s
   t | S )z
        Returns the RRCrtc of the specified monitor.

        Wrapper for:
            RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
        )r   rr  r.  r   r   r   get_x11_adapter  s    rs  glfwGetX11Monitorc                 C   s
   t | S )z
        Returns the RROutput of the specified monitor.

        Wrapper for:
            RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
        )r   rt  r.  r   r   r   get_x11_monitor  s    ru  glfwGetX11Windowc                 C   s
   t | S )z
        Returns the Window of the specified window.

        Wrapper for:
            Window glfwGetX11Window(GLFWwindow* window);
        )r   rv  rX  r   r   r   get_x11_window  s    rw  glfwSetX11SelectionStringc                 C   s   |  d}t| dS )z
        Sets the current primary selection to the specified string.

        Wrapper for:
            void glfwSetX11SelectionString(const char* string);
        r
   N)r   r   rx  )r  Zbinary_stringr   r   r   set_x11_selection_string  s    
ry  glfwGetX11SelectionStringc                  C   s   t  } | r| dS dS )z
        Returns the contents of the current primary selection as a string.

        Wrapper for:
            const char* glfwGetX11SelectionString(void);
        r
   N)r   rz  r  )Zselection_stringr   r   r   get_x11_selection_string  s    
r{  glfwGetGLXContextc                 C   s
   t | S )z
        Returns the GLXContext of the specified window.

        Wrapper for:
            GLXContext glfwGetGLXContext(GLFWwindow* window);
        )r   r|  rX  r   r   r   get_glx_context  s    r}  glfwGetGLXWindowc                 C   s
   t | S )z
        Returns the GLXWindow of the specified window.

        Wrapper for:
            GLXWindow glfwGetGLXWindow(GLFWwindow* window);
        )r   r~  rX  r   r   r   get_glx_window  s    r  glfwGetWaylandDisplayc                   C   s   t  S )z
        Returns the struct wl_display* used by GLFW.

        Wrapper for:
            struct wl_display* glfwGetWaylandDisplay(void);
        )r   r  r   r   r   r   get_wayland_display  s    r  glfwGetWaylandMonitorc                 C   s
   t | S )z
        Returns the struct wl_output* of the specified monitor.

        Wrapper for:
            struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
        )r   r  r.  r   r   r   get_wayland_monitor  s    r  glfwGetWaylandWindowc                 C   s
   t | S )z
        Returns the main struct wl_surface* of the specified window.

        Wrapper for:
            struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
        )r   r  rX  r   r   r   get_wayland_window  s    r  glfwGetEGLDisplayc                   C   s   t  S )z|
        Returns the EGLDisplay used by GLFW.

        Wrapper for:
            EGLDisplay glfwGetEGLDisplay(void);
        )r   r  r   r   r   r   get_egl_display%  s    r  glfwGetEGLContextc                 C   s
   t | S )z
        Returns the EGLContext of the specified window.

        Wrapper for:
            EGLContext glfwGetEGLContext(GLFWwindow* window);
        )r   r  rX  r   r   r   get_egl_context2  s    r  glfwGetEGLSurfacec                 C   s
   t | S )z
        Returns the EGLSurface of the specified window.

        Wrapper for:
            EGLSurface glfwGetEGLSurface(GLFWwindow* window);
        )r   r  rX  r   r   r   get_egl_surface?  s    r  glfwGetOSMesaColorBufferc           
      C   s~   t d}t |}t d}t |}t d}t |}t d}t |}t| ||||}	|	sjdS |j|j|j|jfS )z
        Retrieves the color buffer associated with the specified window.

        Wrapper for:
            int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer);
        r   N)r   r2   r   r    r   r  rW   )
rU  r"  r6   r#  r7   Zformat_valueformatbuffer_valuebuffersuccessr   r   r   get_os_mesa_color_bufferL  s    







r  glfwGetOSMesaDepthBufferc           
      C   s~   t d}t |}t d}t |}t d}t |}t d}t |}t| ||||}	|	sjdS |j|j|j|jfS )z
        Retrieves the depth buffer associated with the specified window.

        Wrapper for:
            int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer);
        r   N)r   r2   r   r    r   r  rW   )
rU  r"  r6   r#  r7   Zbytes_per_value_valueZbytes_per_valuer  r  r  r   r   r   get_os_mesa_depth_bufferd  s    







r  glfwGetOSMesaContextc                 C   s
   t | S )z
        Returns the OSMesaContext of the specified window.

        Wrapper for:
            OSMesaContext glfwGetOSMesaContext(GLFWwindow* window);
        )r   r  rX  r   r   r   get_os_mesa_context|  s    r  glfwInitAllocatorc                 C   s   | du r(|du r(|du r(t td}nv| du r4d} t| }| |fa|du rPd}t|}||fa|du rld}t|}||fat }||_	||_
||_t |}t| dS )z
        Sets the init allocator to the desired value.

        Wrapper for:
            void glfwInitAllocator(const GLFWallocator* allocator);
        Nr   )r   r^   r   r   _allocate_callbackr   _reallocate_callbackr   _deallocate_callbackr   r   r   r  r   r  )r   r   r   Zallocator_ptrZ
c_allocateZc_reallocateZc_deallocaterC  r   r   r   init_allocator  s(    

r  glfwInitVulkanLoaderc                 C   s*   | du rd} t | }| |fat| dS )z
        Sets the desired Vulkan `vkGetInstanceProcAddr` function.

        Wrapper for:
            void glfwInitVulkanLoader(PFN_vkGetInstanceProcAddr loader);
        Nr   )_loader_callback_type_loader_callbackr   r  )loaderZc_loaderr   r   r   init_vulkan_loader  s
    r  glfwGetPlatformc                   C   s   t  S )zw
        Returns the currently selected platform.

        Wrapper for:
            int glfwGetPlatform(void);
        )r   r  r   r   r   r   get_platform  s    r  glfwPlatformSupportedc                 C   s
   t | S )z
        Returns whether the library includes support for the specified platform.

        Wrapper for:
            int glfwPlatformSupported(int platform);
        )r   r  )platformr   r   r   platform_supported  s    r  glfwGetWindowTitlec                 C   s   t | }|r|dS dS )z
        Returns the title of the specified window.

        Wrapper for:
            const char* glfwGetWindowTitle(GLFWwindow* window);
        r
   N)r   r  r  )rU  Zwindow_titler   r   r   get_window_title  s    

r  (  r-   
__future__r   r   r   
__author____copyright____license____version__r  r\   rM   r   r  r   r   r   r  libraryr   r   ImportErrorenvirongetZ_PREVIEWZglfw_previewboolZgetcwdur   AttributeErrorgetcwdversion_infor   rO  r   Zcffir   r!   r   UserWarningr"   r   rF   r/   r4   r5   rO   re   rf   rv   ZVERSION_MAJORZVERSION_MINORZVERSION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D_LEFTZGAMEPAD_BUTTON_LASTZGAMEPAD_BUTTON_CROSSZGAMEPAD_BUTTON_CIRCLEZGAMEPAD_BUTTON_SQUAREZGAMEPAD_BUTTON_TRIANGLEZGAMEPAD_AXIS_LEFT_XZGAMEPAD_AXIS_LEFT_YZGAMEPAD_AXIS_RIGHT_XZGAMEPAD_AXIS_RIGHT_YZGAMEPAD_AXIS_LEFT_TRIGGERZGAMEPAD_AXIS_RIGHT_TRIGGERZGAMEPAD_AXIS_LASTZNO_ERRORZNOT_INITIALIZEDZNO_CURRENT_CONTEXTZINVALID_ENUMZINVALID_VALUEZOUT_OF_MEMORYZAPI_UNAVAILABLEZVERSION_UNAVAILABLEZPLATFORM_ERRORZFORMAT_UNAVAILABLEZNO_WINDOW_CONTEXTZCURSOR_UNAVAILABLEZFEATURE_UNAVAILABLEZFEATURE_UNIMPLEMENTEDZPLATFORM_UNAVAILABLEZFOCUSEDZ	ICONIFIEDZ	RESIZABLEZVISIBLEZ	DECORATEDZAUTO_ICONIFYZFLOATINGZ	MAXIMIZEDZCENTER_CURSORZTRANSPARENT_FRAMEBUFFERZHOVEREDZFOCUS_ON_SHOWZMOUSE_PASSTHROUGHZ
POSITION_XZ
POSITION_YZRED_BITSZ
GREEN_BITSZ	BLUE_BITSZ
ALPHA_BITSZ
DEPTH_BITSZSTENCIL_BITSZACCUM_RED_BITSZACCUM_GREEN_BITSZACCUM_BLUE_BITSZACCUM_ALPHA_BITSZAUX_BUFFERSZSTEREOZSAMPLESZSRGB_CAPABLEZREFRESH_RATEZDOUBLEBUFFERZ
CLIENT_APIZCONTEXT_VERSION_MAJORZCONTEXT_VERSION_MINORZCONTEXT_REVISIONZCONTEXT_ROBUSTNESSZOPENGL_FORWARD_COMPATZOPENGL_DEBUG_CONTEXTZCONTEXT_DEBUGZOPENGL_PROFILEZCONTEXT_RELEASE_BEHAVIORZCONTEXT_NO_ERRORZCONTEXT_CREATION_APIZSCALE_TO_MONITORZSCALE_FRAMEBUFFERZCOCOA_RETINA_FRAMEBUFFERZCOCOA_FRAME_NAMEZCOCOA_GRAPHICS_SWITCHINGZX11_CLASS_NAMEZX11_INSTANCE_NAMEZWIN32_KEYBOARD_MENUZWIN32_SHOWDEFAULTZWAYLAND_APP_IDZNO_APIZ
OPENGL_APIZOPENGL_ES_APIZNO_ROBUSTNESSZNO_RESET_NOTIFICATIONZLOSE_CONTEXT_ON_RESETZOPENGL_ANY_PROFILEZOPENGL_CORE_PROFILEZOPENGL_COMPAT_PROFILEZCURSORZSTICKY_KEYSZSTICKY_MOUSE_BUTTONSZLOCK_KEY_MODSZRAW_MOUSE_MOTIONZCURSOR_NORMALZCURSOR_HIDDENZCURSOR_DISABLEDZCURSOR_CAPTUREDZANY_RELEASE_BEHAVIORZRELEASE_BEHAVIOR_FLUSHZRELEASE_BEHAVIOR_NONEZNATIVE_CONTEXT_APIZEGL_CONTEXT_APIZOSMESA_CONTEXT_APIZARROW_CURSORZIBEAM_CURSORZCROSSHAIR_CURSORZHAND_CURSORZPOINTING_HAND_CURSORZHRESIZE_CURSORZRESIZE_EW_CURSORZVRESIZE_CURSORZRESIZE_NS_CURSORZRESIZE_NWSE_CURSORZRESIZE_NESW_CURSORZRESIZE_ALL_CURSORZNOT_ALLOWED_CURSORZANGLE_PLATFORM_TYPE_NONEZANGLE_PLATFORM_TYPE_OPENGLZANGLE_PLATFORM_TYPE_OPENGLESZANGLE_PLATFORM_TYPE_D3D9ZANGLE_PLATFORM_TYPE_D3D11ZANGLE_PLATFORM_TYPE_VULKANZANGLE_PLATFORM_TYPE_METALZWAYLAND_PREFER_LIBDECORZWAYLAND_DISABLE_LIBDECORZ	CONNECTEDZDISCONNECTEDZJOYSTICK_HAT_BUTTONSZANGLE_PLATFORM_TYPEZPLATFORMZCOCOA_CHDIR_RESOURCESZCOCOA_MENUBARZX11_XCB_VULKAN_SURFACEZWAYLAND_LIBDECORZANY_PLATFORMZPLATFORM_WIN32ZPLATFORM_COCOAZPLATFORM_WAYLANDZPLATFORM_X11ZPLATFORM_NULLZANY_POSITIONZ	DONT_CAREZUNLIMITED_MOUSE_BUTTONSr   r   r   Z	CFUNCTYPEr2   r   r  r^   r  r  r  r  r  r  r  r  r|   r  r  r  r  r  r  r  r  r<  r  rL   r  r,  r    Zc_size_tr   r   r   r   r   restypeargtypesr   r   r   rl   r   r   r   r   r   r   r   r   r	  r  r
  r  r  r  r  r  r  r  r   r!  r$  r%  r&  r'  r,  r-  r/  r5  r0  r8  r1  r:  r;  r=  r>  r?  r@  rA  rB  rC  rE  rF  rG  rH  rI  rJ  rK  rL  rM  rN  rP  rQ  rS  rT  rV  rW  rY  rZ  r[  r\  r]  r^  r`  ra  rc  rd  rf  rg  rh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  r}  r  r  r  r   r  r  r  r  r  appendr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rm   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r  r  r  r  r  r  r  r  r   r!  r"  r$  r&  Zc_uint64r'  r(  r)  r*  r-  r+  r.  r/  r0  r1  r2  r3  r4  r5  r6  r7  r8  r9  r;  r<  r>  r?  r@  rA  rD  rE  rF  rG  rH  rI  rK  rL  rM  rN  rP  rQ  rV  rW  rX  rY  rZ  r[  r\  r]  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r|  r}  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   r   <module>   s	  	

	0>3$



















	




 



	


	




	
	
	

	

	



			

	













		
	







	





	
	 


		
				


		



		

	





	
		

	

















NN	 		