
    3j`'                       S r SSKrSSKrSSKJrJr  SSKJrJrJ	r	  SSKJ
r
  SSKJr  SSKJrJr  SSKJr  SS	KJrJr  SS
KJr  SSKJr  \R.                  " S5      r\(       d   eSr\R4                  (       a   SSKJr  SSKJrJrJrJ r J!r!  \(       d  \(       d  \R                  S5        SrS r%S r&S\&l'         " S S\5      r " S S\(5      r!S r)g! \" a  r#\RI                  S5         Sr#C#NdSr#C#ff = f)zEThe wrapping code for providing natural ctypes-based OpenGL interface    N)platformerror)STORE_POINTERSERROR_ON_COPYSIZE_1_ARRAY_UNPACK)
converters)DefaultCConverter)returnCArgumentreturnPyArgument)LateBind)arrayhelpersarraydatatype)NULL)acceleratesupportzOpenGL.wrapper)WrapperCArgCalculatorPyArgCalculatorCArgumentCalculatorMultiReturnz\OpenGL_accelerate seems to be installed, but unable to import expected wrapper entry points!zYou've specified (not STORE_POINTERS) yet ERROR_ON_COPY is False, this would cause segfaults, so (not STORE_POINTERS) is being ignoredTc                 F    [        U [        5      (       d  [        U 5      $ U $ )z$Convert to a list if not already one)
isinstancelist)os    H/home/wildlama/miniconda3/lib/python3.13/site-packages/OpenGL/wrapper.pyasListr   )   s    aAwH    c                     U $ N )incomingfunction	argumentss      r   none_or_passr#   0   s    Or   c                      ^  \ rS rSrSrSrS rS rS r\r	U 4S jr
S rS	 rS
SS\S4S jrS r\(       d  SS jrOSS jr\4S jrS r\4S jr\4S jr\4S jrS rS rS rSrU =r$ )r   7   a  Wrapper around a ctypes cFunction object providing SWIG-like hooks

Attributes:

    wrappedOperation -- base operation, normally a ctypes function
        with data-types and error-checking specified
    pyConverters -- converters for incoming Python arguments,
        provide 1:1 mapping to incoming Python arguments, can
        suppress an argument from the argument-set as well
            see setPyConverter
    pyConverterNames -- caching/storage of the argument names
        for the Python converters
    cConverters -- converters for incoming C-level arguments
        produce Python-level objects in 1:1 mapping to ctypes
        arguments from pyConverters results
            see setCConverter
    cResolvers -- converters turning Python-level objects into
        ctypes-compatible data-types
            see setCResolver

Generic Attributes:

    {ARG1}_LOOKUP_{ARG2} -- lookup dictionaries to provide sizes for
        ARG1 output value from the value of ARG2, provided for
        documentation/reference
    {ARG1}_FROM_{ARG2} -- lookup functions to provide sizes for ARG1
        output value from the value of ARG2, provided for
        documentation/reference
)	wrappedOperation__file__pyConverterspyConverterNamescConverters
cResolversstoreValuesreturnValues
_finalCallc                 R    [        U[        5      (       a  UR                  nXl        g)z0Initialise the wrapper, storing wrappedOperationN)r   r   r&   )selfr&   s     r   __init__Wrapper.__init__b   s"    &00/@@ 0r   c                 P    US:w  a  [        U R                  U5      $ [        U5      e)z1Delegate attribute lookup to our wrappedOperationr&   )getattrr&   AttributeError)r0   keys     r   __getattr__Wrapper.__getattr__h   s)    $$400#66S!!r   c                 ,    [        U R                  5      $ )z#Is this function/wrapper available?)boolr&   )r0   s    r   __nonzero__Wrapper.__nonzero__n   s    D))**r   c                 v   > XR                   ;   a  [        [        U ]  X5        g[	        U R
                  X5      $ )z1Forward attribute setting to our wrappedOperationN)localPropertiessuperr   __setattr__setattrr&   )r0   r6   value	__class__s      r   r@   Wrapper.__setattr__t   s1    &&&'4,S8400#==r   c                     [        U SS5      nUc  U R                  R                  n [        U5      R	                  U5      $ ! [
        [        4 a    [        SU< SU< 35      ef = f)z<Return the Python-argument index for the given argument namer)   NNo argument  in argument list )r4   r&   argNamesr   index
ValueError
IndexErrorKeyErrorr0   argNamerH   s      r   
pyArgIndexWrapper.pyArgIndex{   sl    4!3T:,,55H	(#))'22J' 	<CXN 	s   A $A&c                     U R                   R                  n [        U5      R                  U5      $ ! [        [
        4 a    [        SU< SU< 35      ef = f)z7Return the C-argument index for the given argument namerF   rG   )r&   rH   r   rI   rJ   rK   rL   rM   s      r   	cArgIndexWrapper.cArgIndex   sW    ((11	(#))'22J' 	<CXN 	s	   2 $A)   NFc                    Uc  U R                  U5      nU R                  R                  U   n[        US5      (       dH  U[        R
                  :X  a	  SSKJn  UnO+[        SU< SU R                  R                  < SU< 35      eUcD  [        US5      (       a   eU(       a  [        R                  n	O[        R                  n	U	" UUUS9n
O[        U[        5      (       a   [        X< S	U< 3U5        UR                   nO[        X< S
U< 3U5        [        US5      (       d   eU(       a  [        R"                  n	O[        R$                  n	U	" UUUUS9n
U(       a  U
R&                  nO[        R(                  " U5      nU(       a  U R+                  U[,        5        OU R+                  U5        U R/                  UU
5      R1                  U5      $ )a  Set the given argName to be an output array

size -- either a tuple compatible with arrayType.zeros or
    a function taking pname to produce such a value.
arrayType -- array data-type used to generate the output
    array using the zeros class method...
pnameArg -- optional argument passed into size function, that
    is, the name of the argument whose *value* will be passed
    to the size function, often the name of an input argument
    to be "sized" to match the output argument.
asArrayr   )GLubyteArrayz3Should only have array types for output parameters  on z is __call__)namesize	arrayType_LOOKUP__FROM_)rZ   	specifierlookupr\   )rR   r&   argtypeshasattrctypesc_void_pOpenGL.arraysrW   	TypeError__name__r   OutputOrInputOutputr   dictrA   __getitem__SizedOutputOrInputSizedOutputoldStyleReturnr
   setPyConverterr#   setCConvertersetReturnValues)r0   outArgr[   pnameArgr\   rn   orPassInrI   rW   clsconvreturnObjects               r   	setOutputWrapper.setOutput   s   ( NN6*E--66u=I9i00/: ,I# # 11::%	  tZ0000 .. ''#D $%%A4H''fh?F4,,,, 33 ,,"#	D ..L%55f=L5'!!
 /,
'	(r   c                 V    U R                  U5      nU R                  R                  U   $ )z:Retrieve the defined data-type for the given outArg (name))rR   r&   ra   )r0   rr   rI   s      r   	typeOfArgWrapper.typeOfArg   s'    v&$$--e44r   c                    U R                  U5      n[        US5      (       d  U[        R                  :X  af  U R	                  U[
        R                  " [        R                  R                  5      5        U R                  U[
        R                  " U5      5        U $ [        US5      (       a  [        UR                  S5      (       a  U $ [        SU< 35      eUb'  U R	                  U[        R                  " X25      5        O&U R	                  U[        R                   " U5      5        U R                  U[
        R                  " U5      5        U $ )  Decorate function with vector-handling code for a single argument

if OpenGL.ERROR_ON_COPY is False, then we return the
named argument, converting to the passed array type,
optionally checking that the array matches size.

if OpenGL.ERROR_ON_COPY is True, then we will dramatically
simplify this function, only wrapping if size is True, i.e.
only wrapping if we intend to do a size check on the array.
rV   _type_z8Should only have array types for output parameters: got )r{   rb   rc   rd   ro   r   CallFuncPyConverterr   ArrayDatatyperV   rp   getPyArgsNamer   rf   r   asArrayTypeSizeasArrayTyper0   rN   r[   r\   s       r   setInputArraySizeWrapper.setInputArraySize   s    w/I9i00/''"66)77?? &&w
0H0H0QRKY11g$$h7 7
  K#$'  ##\99)J ##G\-E-Ei-PQw
(@(@(IJKr   c                     Ubn  U R                  U5      n[        US5      (       aL  U R                  U[        R                  " X25      5        U R                  U[        R                  " U5      5        U $ )r~   rV   )r{   rb   ro   r   r   rp   r   r   r   s       r   r   r     se      NN73	9i00''!=!=i!N &&w
0H0H0QRKr   c           	         [        U S5      (       dL  S/[        U R                  R                  5      -  U l        [        U R                  R                  5      U l         [        U R                  5      R                  U5      nU[        L a  U R                  U	 U R                  U	 U $ X R                  U'   U $ ! [         a6    [        SU< SU R                  R                  < SU R                  < 35      ef = f)a  Set Python-argument converter for given argument

argName -- the argument name which will be coerced to a usable internal
    format using the function provided.
function -- None (indicating a simple copy), NULL (default) to eliminate
    the argument from the Python argument-list, or a callable object with
    the signature:

        converter(arg, wrappedOperation, args)

    where arg is the particular argument on which the convert is working,
    wrappedOperation is the underlying wrapper, and args is the set of
    original Python arguments to the function.

Note that you need exactly the same number of pyConverters as Python
arguments.
r(   NNo argument named z left in pyConverters for : )rb   lenr&   rH   r(   r   r)   r   rI   rJ   r5   rg   r   r0   rN   r!   is       r   ro   Wrapper.setPyConverter)  s    $ t^,,!%T-B-B-K-K)L LD$()>)>)G)G$HD!
	t,,-33G<A t!!!$%%a(  $,a   	  ))22))	 	s   $B8 8A C8c                 d   [        U S5      (       d(  S/[        U R                  R                  5      -  U l         [        U R                  R                  [        5      (       d.  [        U R                  R                  5      U R                  l        [        U R                  R                  5      R                  U5      nU R                  U   b  [        SU< SU R                  < 35      eX R                  U'   U $ ! [         a(    [        SU< SU R                  R                  < 35      ef = f)aK  Set C-argument converter for a given argument

argName -- the argument name whose C-compatible representation will
    be calculated with the passed function.
function -- None (indicating a simple copy), a non-callable object to
    be copied into the result-list itself, or a callable object with
    the signature:

        converter( pyArgs, index, wrappedOperation )

    where pyArgs is the set of passed Python arguments, with the
    pyConverters already applied, index is the index of the C argument
    and wrappedOperation is the underlying function.

C-argument converters are your chance to expand/contract a Python
argument list (pyArgs) to match the number of arguments expected by
the ctypes baseOperation.  You can't have a "null" C-argument converter,
as *something* has to be passed to the C-level function in the
parameter.
r*   Nr    left in cConverters: z%Double wrapping of output parameter: rX   )rb   r   r&   rH   r*   r   r   r   rI   rJ   r5   RuntimeErrorrg   r   s       r   rp   Wrapper.setCConverterP  s	   * t]++ $vD,A,A,J,J(KKD	d33<<dCC15d6K6K6T6T1U%%.t,,556<<WEA A*DMM+  '  	  ))22 	s   BC= =2D/c                 :   [        U S5      (       d(  S/[        U R                  R                  5      -  U l         [        U R                  R                  [        5      (       d.  [        U R                  R                  5      U R                  l        [        U R                  R                  5      R                  U5      nU[        L a  U R                  U	 U $ X R                  U'   U $ ! [         a(    [        SU< SU R                  R                  < 35      ef = f)z-Set C-argument converter for a given argumentr+   Nr   r   )rb   r   r&   rH   r+   r   r   r   rI   rJ   r5   r   r   s       r   setCResolverWrapper.setCResolver{  s    t\**#fs4+@+@+I+I'JJDO	d33<<dCC15d6K6K6T6T1U%%.t,,556<<WEA t"  "*OOA  	  ))22 	s   BC( (2Dc                 |    U[         L d  [        (       a  [        (       d   U ?U $ Xl        U $ ! [         a     U $ f = f)z;Set the storage-of-arguments function for the whole wrapper)r   r   r   r,   	Exceptionr0   r!   s     r   setStoreValuesWrapper.setStoreValues  sL    t}}^^$
   (	   	s   - 
;;c                 &   U[         L a   U ?U $ [        U S5      (       aZ  [	        U R                  [
        5      (       a  U R                  R                  U5        U $ [        U R                  U5      U l         U $ Xl        U $ ! [         a     U $ f = f)z8Set the return-of-results function for the whole wrapperr-   )r   r-   r   rb   r   r   appendr   s     r   rq   Wrapper.setReturnValues  s    t%  t^,,d//==%%,,X6
  )4D4E4Ex(PD%  %-!   s   B 
BBc                    S HM  n[        XS5      nUc  M  [        U5       H*  u  p4[        US5      (       d  M   UR                  U 5        M,     MO     [        U S	5      (       at  [        U R                  5       H[  u  p6[        U[        S5      [        45      (       d  M'  [        U R                  U R                  U   5      5      U R                  U'   M]     S
 H3  n[        XS5      n[        US5      (       d  M"  UR                  U 5        M5     U R                  5       nU(       d  [        SU < 35      eU R                  U5        U$ ! [         a/  n[
        R                  " SU< SU< SU < SU< SU< 3
5      eSnAff = f)z@Finalise our various elements into simple index-based operations)r(   r*   r+   NfinalisezError finalising item z in z for z (z): r*   )r,   r-   z Missing finalised call type for )r4   	enumeraterb   r   r   r   Errorr*   r   typer	   rO   rH   finaliseCallr   setFinalCall)r0   	attributerB   r   itemerr	convertercallFunctions           r   r   Wrapper.finalise  sY   FIDT2E (/GAtZ00 MM$/  0 G$ 4'' )$*:*: ;i$t*6G)HII*;a(89+D$$Q' !<

I 4D1DtZ((d#
 ((*4QRR l+G  ) 
"'++ %&$-$($($'!"	# 	
s   E
F*E??Fc           
        ^ ^^^	^
^^^^^^^ [        T SS5      n[        T SS5      m[        T SS5      nT R                  m[        T SS5      m[        T SS5      mU(       av  [        (       a  [        T U5      mO`[	        U5       VVs/ s H  u  p4X4USL 4PM     snnm[        U Vs/ s H  n[        USS5      (       a  M  UPM     sn5      mUUU U4S	 jmOSmT(       aL  [        (       a  [        T T5      m
O6[	        T5       VVs/ s H  u  p4X4[        US
5      4PM     snnmUU 4S jm
OSm
U(       a2  [        (       a  [        U5      mO[        [	        U5      5      m	U	4S jmOSm[        (       a  [        TTT
TTTS9$ U(       Ga%  T(       a  U(       aH  T(       a"  T(       a  U
UUUU UU4S jnU$ U
UUU UU4S jnU$ T(       a  U
UUUU U4S jnU$ U
UUU4S jnU$ T(       a   T(       a  U
UUU UU4S jnU$ U
UU UU4S jnU$ T(       a  U
UUU U4S jnU$ U
UU4S jnU$ U(       aD  T(       a   T(       a  UUUU UU4S jnU$ UUU UU4S jnU$ T(       a  UUUU U4S jnU$ UUU4S jnU$ T(       a  T(       a  UUU UU4S jnU$ UU UU4S jnU$ T(       a  UUU U4S jnU$ UU4S jnU$ T(       a  U(       aE  T(       a   T(       a  UUUU UU4S jnU$ UUU UU4S jnU$ T(       a  UUUU U4S  jnU$ UUU U4S! jnU$ T(       a  T(       a  UUU UU4S" jnU$ UU UU4S# jnU$ T(       a  UUU U4S$ jnU$ UU U4S% jnU$ U(       a@  T(       a  T(       a  UUU UU4S& jnU$ UU UU4S' jnU$ T(       a  UUU U4S( jnU$ UU4S) jnU$ T(       a  T(       a  UU UU4S* jnU$ U UU4S+ jnU$ T(       a
  UU U4S, jnU$ U4S- jnU$ s  snnf s  snf s  snnf ).a  Produce specialised versions of call for finalised wrapper object

This returns a version of __call__ that only does that work which is
required by the particular wrapper object

This is essentially a huge set of expanded nested functions, very
inelegant...
r(   Nr*   r+   r,   r-   optionalFc              3     >#    T[        U 5      :  aJ  [        TR                  < ST< SSR                  TR                  5      < S[        U 5      < SU < 3	5      eT H$  u  pnU(       a  X   v   M   U" X   TU 5      v   M&     g ! [
         a  n[        v    S nAMA  S nAf[         a-  n[        US5      (       a  U=R                  U4-  sl	        e S nAff = f7f)N
 requires  arguments (, ), received r   args)
r   rJ   rg   joinr)   rK   r   r   rb   r   )	r   rI   r   isNoner   pyConverters_lengthpyConverters_mappedr0   r&   s	        r   calculate_pyArgs.Wrapper.finaliseCall.<locals>.calculate_pyArgs  s     *SY6( !1 9 9 3 $		$*?*? @ #D	 $	 	 5H0&!"&+-&&/T4&H H 5H $. +&*

#, &#*3#7#7$'HH$<H %&s<   A1C5BC
CB C C-(CCCrY   c              3      >#    T H  u  pnU(       a   U" XT5      v   M  Uv   M!     g ! [          a3  n[        US5      (       a  U=R                  SU-  U UT4-  sl        e S nAff = f7f)Nr   Failure in cConverter %r)r   rb   r   )pyArgsrI   r   canCallr   cConverters_mappedr0   s        r   calculate_cArgs-Wrapper.finaliseCall.<locals>.calculate_cArgs  sy     5G1'"
&&/t&D D #,O 6H $- &#*3#7#7$'HH(F)(T(.(-(,	1& %&H !&&s$   A**A*
A'.A""A''A*c              3      >#    T H  u  pUc  X   v   M   U" X   5      v   M     g ! [          a  nU=R                  U4-  sl        e S nAff = f7fr   )r   r   )cArgsr   r   r   cResolvers_mappeds       r   calculate_cArguments2Wrapper.finaliseCall.<locals>.calculate_cArguments7  sU     (9$,"'(N&&/&9 9 ): $- & #YL 8 %&s$   A(A
AA		AA)r   r   r   r,   r-   c                  R  > [        T" U 5      5      n[        T" U5      5      n[        T" U5      5      n T" U6 nT" UT
UU5        T	" UT
UU5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = f$Wrapper with all possible operationsNtuplerc   ArgumentErrorr   r   GLErrorr   r   )r   r   r   
cArgumentsresultr   r   r   r   r-   r0   r,   r&   s         r   wrapperCall)Wrapper.finaliseCall.<locals>.wrapperCallT  s    )./?/E)F(-of.E(F-23G3N-O
!.-=z-JF !,$*$($*$)	!" (4$*$($*$)	(" !" (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s#   A B&%A<<B&B!!B&c                  @  > [        T" U 5      5      n[        T" U5      5      n[        T" U5      5      n T" U6 nT
" UT	UU5        U$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = f"Wrapper with all save returnValuesNr   )r   r   r   r   r   r   r   r   r   r0   r,   r&   s         r   r   r   s  s    )./?/E)F(-of.E(F-23G3N-O
!.-=z-JF !,$*$($*$)	!" (. (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s#   A BA33B
BBc                  <  > [        T" U 5      5      n[        T" U5      5      n[        T" U5      5      n T" U6 nT	" UT
UU5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = f!Wrapper with all save storeValuesNr   )r   r   r   r   r   r   r   r   r   r-   r0   r&   s         r   r   r     s    )./?/E)F(-of.E(F-23G3N-O
!.-=z-JF (4$*$($*$)	(" !" (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s#   A BA11BBBc                  *  > [        T" U 5      5      n[        T" U5      5      n[        T" U5      5      n T	" U6 nU$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = f2Wrapper with all save returnValues and storeValuesNr   )
r   r   r   r   r   r   r   r   r   r&   s
         r   r   r     s    )./?/E)F(-of.E(F-23G3N-O
!.-=z-JF (. (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s!   = BA((B?BBc                  4  > [        T" U 5      5      n[        T" U5      5      nUn T" U6 nT
" UT	UU5        T" UT	UU5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r   r   r-   r0   r,   r&   s         r   r   r     s    )./?/E)F(-of.E(F-2
!.-=z-JF !,$*$($*$)	!" (4$*$($*$)	(" !" (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.#   A BA--BBBc                  "  > [        T" U 5      5      n[        T" U5      5      nUn T
" U6 nT	" UTUU5        U$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r   r   r0   r,   r&   s         r   r   r     s    )./?/E)F(-of.E(F-2
!.-=z-JF !,$*$($*$)	!" (. (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.!   9 BA$$B;B		Bc                    > [        T" U 5      5      n[        T" U5      5      nUn T
" U6 nT" UT	UU5      $ ! [        R                   a  nUR                  U4-   Ul        e SnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r   r   r-   r0   r&   s         r   r   r     s    )./?/E)F(-of.E(F-2
!.-=z-JF (4$*$($*$)	(" !" (.';'; !*/2xx:-/GCH$)',}} !.05I17J*-I!.s!   7 BA!!B8BBc                  
  > [        T" U 5      5      n[        T" U5      5      nUn T" U6 nU$ ! [        R                   a  nUR                  U4-   Ul        e SnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )	r   r   r   r   r   r   r   r   r&   s	         r   r   r     s    )./?/E)F(-of.E(F-2
!.-=z-JF (. (.';'; !*/2xx:-/GCH$)',}} !.05I17J*-I!.s!   . BAB/A==Bc                  4  > [        T" U 5      5      nUn[        T" U5      5      n T" U6 nT
" UT	UU5        T" UT	UU5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r   r   r-   r0   r,   r&   s         r   r   r   %  s    )./?/E)F(.-23G3N-O
!.-=z-JF !,$*$($*$)	!" (4$*$($*$)	(" !" (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.r   c                  "  > [        T" U 5      5      nUn[        T" U5      5      n T
" U6 nT	" UTUU5        U$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r   r   r0   r,   r&   s         r   r   r   D  s    )./?/E)F(.-23G3N-O
!.-=z-JF !,$*$($*$)	!" (. (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.r   c                    > [        T" U 5      5      nUn[        T" U5      5      n T
" U6 nT" UT	UU5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r   r   r-   r0   r&   s         r   r   r   _  s    )./?/E)F(.-23G3N-O
!.-=z-JF (4$*$($*$)	(" !" (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s!   7 BA""B9BBc                    > [        T" U 5      5      nUn[        T" U5      5      n T" U6 nU$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX%l        Xl        UeSnAff = fr   r   )	r   r   r   r   r   r   r   r   r&   s	         r   r   r   w  s    )./?/E)F(.-23G3N-O
!.-=z-JF (. (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s!   . BAB0A>>Bc                    > [        T" U 5      5      nUn T	" U6 nT" UTUU5        T" UTUU5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX$l        Xl        UeSnAff = fr   r   )
r   r   r   r   r   r   r-   r0   r,   r&   s
        r   r   r     s    )./?/E)F-3
!.-=z-JF !,$*$($*$.	!" (4$*$($*$.	(" !" (.';'; !./2xx:-/GCH*-I',}} !.0:I17J*-I!.!   1 BAB3BBc                     > [        T" U 5      5      nUn T" U6 nT" UTUU5        U$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX$l        Xl        UeSnAff = fr   r   )	r   r   r   r   r   r   r0   r,   r&   s	        r   r   r     s    )./?/E)F-3
!.-=z-JF !,$*$($*$.	!" (. (.';'; !./2xx:-/GCH*-I',}} !.0:I17J*-I!.    ( A=AA=*A88A=c                     > [        T" U 5      5      nUn T" U6 nT" UTUU5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX$l        Xl        UeSnAff = fr   r   )	r   r   r   r   r   r   r-   r0   r&   s	        r   r   r     s    )./?/E)F-3
!.-=z-JF (4$*$($*$.	(" !" (.';'; !./2xx:-/GCH*-I',}} !.0:I17J*-I!.    & A;AA;(A66A;c                     > [        T" U 5      5      nUn T" U6 nU$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nX$l        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r&   s        r   r   r     sy    )./?/E)F-3
!.-=z-JF (. (.';'; !./2xx:-/GCH*-I',}} !.0:I17J*-I!.     A2AA2A--A2c                  6  > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT5      5        MD     [        T	" U5      5      n T" U6 nT" UTUU5        T
" UTUU5      $ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l
        Xl        UeSnAff = fr   rY   r   r   Nr   rb   r   r   r   r   rc   r   r   r   r   r   )r   r   r   rI   r   r   r   r   r*   r   r-   r0   r,   r&   s           r   r   r     s7   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .33G3N-O
!.-=z-JF !,$*$($*$)	!" (4$*$($*$)	(" !"5 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   B)C 
C -B;;C DC..DDDc                  $  > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT
5      5        MD     [        T	" U5      5      n T" U6 nT" UT
UU5        U$ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l
        Xl        UeSnAff = fr   rY   r   r   Nr   )r   r   r   rI   r   r   r   r   r*   r   r0   r,   r&   s           r   r   r   "  s#   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .33G3N-O
!.-=z-JF !,$*$($*$)	!" (.5 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   A;)B: ;
B7-B22B7:DC%%D<D

Dc                     > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT5      5        MD     [        T	" U5      5      n T" U6 nT
" UTUU5      $ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l
        Xl        UeSnAff = fr   rY   r   r   Nr   )r   r   r   rI   r   r   r   r   r*   r   r-   r0   r&   s           r   r   r   M  s!   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .33G3N-O
!.-=z-JF (4$*$($*$)	(" !"' 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   A9)B8 9
B5-B00B58DC##D:DDc                    > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT
5      5        MD     [        T	" U5      5      n T" U6 nU$ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l
        Xl        UeSnAff = fr   rY   r   r   Nr   )r   r   r   rI   r   r   r   r   r*   r   r0   r&   s           r   r   r   u  s   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .33G3N-O
!.-=z-JF (.' 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   A0)B/ 0
B,:-B''B,/DCD1C??Dc                    > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT
5      5        MD     Un T" U6 nT" UT
UU5        T	" UT
UU5      $ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [
        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l	        Xl
        UeSnAff = fr   r   rb   r   r   r   rc   r   r   r   r   r   )r   r   r   rI   r   r   r   r   r*   r-   r0   r,   r&   s           r   r   r     s,   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .3
!.-=z-JF !,$*$($*$)	!" (4$*$($*$)	(" !"5 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   A5B4 5
B1?-B,,B14D	CD	6DD	c                    > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT	5      5        MD     Un T" U6 nT
" UT	UU5        U$ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [
        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l	        Xl
        UeSnAff = fr   r   )r   r   r   rI   r   r   r   r   r*   r0   r,   r&   s           r   r   r     s   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .3
!.-=z-JF !,$*$($*$)	!" (.5 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   A,B+ ,
B(6-B##B(+D ?CD -C;;D c                    > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT
5      5        MD     Un T" U6 nT	" UT
UU5      $ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [
        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l	        Xl
        UeSnAff = fr   r   )r   r   r   rI   r   r   r   r   r*   r-   r0   r&   s           r   r   r     s   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .3
!.-=z-JF (4$*$($*$)	(" !"' 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   A*B) *
B&4-B!!B&)C>=CC>+C99C>c                    > U n/ n[        T5       HB  u  p4[        US5      (       d  UR                  U5        M)   UR                  U" XT	5      5        MD     Un T
" U6 nU$ ! [         a2  n[        US5      (       a  U=R                  SU-  UU4-  sl        e SnAff = f! [
        R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nX%l	        Xl
        UeSnAff = fr   r   )r   r   r   rI   r   r   r   r   r*   r0   r&   s           r   r   r     s   )-(*8A+8N$4E+29j+I+I(-Y(?
)2,1LL6RV9W,X 9O  .3
!.-=z-JF (.' 09 )2/6sF/C/C034R7@5B4:49	=2 12 -2)2 (.';'; !./2xx:-/GCH*-I',}} !.05I17J*-I!.s;   A!B  !
B+-BB C54CC5"C00C5c                    > U n[        T" U5      5      n T	" U6 nT" UTU U5        T" UTU U5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nXl        Xl        UeSnAff = fr   r   )
r   r   r   r   r   r   r-   r0   r,   r&   s
        r   r   r   D  s    (,-23G3N-O
!.-=z-JF !,$*$($($)	!" (4$*$($($)	(" !" (.';'; !./2xx:-/GCH*-I',}} !.05I15J*-I!.r   c                     > U n[        T" U5      5      n T" U6 nT" UTU U5        U$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nXl        Xl        UeSnAff = fr   r   )	r   r   r   r   r   r   r0   r,   r&   s	        r   r   r   b  s    (,-23G3N-O
!.-=z-JF !,$*$($($)	!" (. (.';'; !./2xx:-/GCH*-I',}} !.05I15J*-I!.r   c                     > U n[        T" U5      5      n T" U6 nT" UTU U5      $ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nXl        Xl        UeSnAff = fr   r   )	r   r   r   r   r   r   r-   r0   r&   s	        r   r   r   |  s    (,-23G3N-O
!.-=z-JF (4$*$($($)	(" !" (.';'; !./2xx:-/GCH*-I',}} !.05I15J*-I!.r   c                     > U n[        T" U5      5      n T" U6 nU$ ! [        R                   a  nUR                  U4-   Ul        UeSnAf[        R
                   a  nXl        Xl        UeSnAff = fr   r   )r   r   r   r   r   r   r&   s        r   r   r     sy    (,-23G3N-O
!.-=z-JF (. (.';'; !./2xx:-/GCH*-I',}} !.05I15J*-I!.r   c                     > U n T" U6 nT" UTU U5        T" UTU U5      $ ! [         R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nXl        Xl        UeSnAff = fr   rc   r   r   r   r   r   r   )r   r   r   r   r-   r0   r,   r&   s       r   r   r     s    -1
!.-=z-JF !,$*$($($.	!" (4$*$($($.	(" !" (.';'; !./2xx:-/GCH*-I',}} !.0:I15J*-I!.s      A5AA5"A00A5c                     > U n T" U6 nT" UTU U5        U$ ! [         R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nXl        Xl        UeSnAff = fr   r   )r   r   r   r   r0   r,   r&   s       r   r   r     s    -1
!.-=z-JF !,$*$($($.	!" (. (.';'; !./2xx:-/GCH*-I',}} !.0:I15J*-I!.s     A,AA,A''A,c                     > U n T" U6 nT" UTU U5      $ ! [         R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nXl        Xl        UeSnAff = fr   r   )r   r   r   r   r-   r0   r&   s       r   r   r     s}    -1
!.-=z-JF (4$*$($($.	(" !" (.';'; !./2xx:-/GCH*-I',}} !.0:I15J*-I!.s     A*A  A*A%%A*c                     > U n T" U6 nU$ ! [         R                   a  nUR                  U4-   Ul        UeSnAf[        R                   a  nXl        Xl        UeSnAff = fr   r   )r   r   r   r   r&   s       r   r   r     si    -1
!.-=z-JF (. (.';'; !./2xx:-/GCH*-I',}} !.0:I15J*-I!.s    A!7A!AA!)
r4   r&   cWrapperr   r   r   r   rb   r   r   )r0   r(   r+   r   r   pr   r*   r   r   r   r   r   r   r   r-   r,   r&   s   `      @@@@@@@@@@@r   r   Wrapper.finaliseCall  s$    t^T:dM48T<6
00dM48t^T:x#2 $  +4L*A'*A I$57*A'# '* ,R1GAz54QQR'#& &4  $x"0{"C +4K*@&*@ 79j#AB*@&"
,$ #Ox'::'F$$(:)>$?!	& $( 8 !1 /%9')  "'" "8 $/.. .. $/.'" "* $/.. .  $/. #'" "8 $/.. .. $/.'" "* $/..  $/. "'" "8 $/.. .. $/.'" "* $/..  $/. #'" "6 $/.. ., $/.'" "( $/.. $/. "'*" *"X $/.%. %.N $/.'#" #"J $/.. .@ $/. #'*" *"X $/.%. %.N $/.'#" #"J $/..@ $/. "'" "6 $/.. ., $/.'" "( $/.. $/. #'" "4 $/..* $/.'"& $/.. $/.a '
 SD&s   O&O OOc                    [        U SS5      nU(       a  [        U5      [        U5      :w  a]  [        U R                  R                  < S[        U5      < SSR                  U R                  5      < S[        U5      < SU< 3	5      e/ n[        X!5       H3  u  pEUc  UR                  U5        M  UR                  U" XPU5      5        M5     OUn[        U SS5      nU(       aT  / n[        U5       HB  u  p[        US	5      (       d  UR                  U5        M)   UR                  U" X8U 5      5        MD     OUn[        U SS5      n
U
(       aD  / n[        X5       H2  u  pLUc  UR                  U5        M  UR                  U" U5      5        M4     OUn U R                  " U6 n[        U SS5      nUb  U" UU UU5        [        U SS5      nUb  U" UU UU5      $ U$ ! [         a3  n	[        U	S
5      (       a  U	=R                  SU-  UUU 4-  sl        e Sn	A	ff = f! [        R                   a  n	U	R                  U4-   U	l        U	eSn	A	f[        R                    a  n	Xyl        X9l        U	eSn	A	ff = f)zBExpand arguments, call the function, store values and check errorsr(   Nr   r   r   r   r   r*   rY   r   r   r+   r,   r-   )r4   r   rJ   r&   rg   r   r)   zipr   r   rb   r   r   rc   r   r   r   r   r   )r0   r   r(   r   r   argr*   r   rI   r   r+   r   rB   r   r,   r-   s                   r   _unspecialised__call__Wrapper._unspecialised__call__  sm   t^T:< CI-  --66L)		$"7"78D		 	 F"%l"9	$MM#&MM)Ct"<=	 #: FdM48E$-k$: y*55LL+
Yvd%CD %;  ET<6
J$'
$: 	$%%e,%%i&67	 %; J	**J7F dM48"	 t^T:#	  Ma % "3//HH >) L & % $	) H . ## 	xx:-/CHI}} 	IJI	s<   GH 
H'.HHI21II2I--I2)r*   r+   r)   r(   r-   r,   r&   r   )rg   
__module____qualname____firstlineno____doc__r>   r1   r7   r;   __bool__r@   rO   rR   r   rx   r{   r   r   r   ro   rp   r   r   rq   r   r   r	  __static_attributes____classcell__)rC   s   @r   r   r   7   s    <
O1"+ H>
 *M(^5
 )	Z	* 04 %N)V .2 , '+ 	 (, ", ^f/^!P Pr   r   c                   &    \ rS rSrS rS rS rSrg)r   i^  c                 $    [        U5      U l        g r   )r   children)r0   r  s     r   r1   MultiReturn.__init___  s    Xr   c                 :    U R                   R                  U5        g r   )r  r   )r0   childs     r   r   MultiReturn.appendb  s    U#r   c                     / nU R                    H  n UR                  U" U0 UD65        M     U$ ! [         a  nU=R                  XAU4-  sl        e S nAff = fr   )r  r   r   r   )r0   r   namedr   r  r   s         r   rY   MultiReturn.__call__e  s_    ]]EeT3U34 #   U%00s   0
AAA)r  N)rg   r  r  r  r1   r   rY   r  r   r   r   r   r   ^  s    '$r   r   c                     [        U [        5      (       a  U $ U R                  SS.n[        U R                  [        4U5      n[        U S5      (       a  U R                  Ul        U" U 5      nU$ )ah  Create a Wrapper sub-class instance for the given wrappedOperation

The purpose of this function is to create a subclass of Wrapper which
has the __doc__ and __name__ of the wrappedOperation so that the instance of
the wrapper will show up as <functionname instance @ address> by default,
and will have the docstring available naturally in pydoc and the like.
)r&   )r  	__slots__r  )r   r   r  r   rg   rb   r  )r&   rj   ru   instances       r   wrapperr  p  so     "G,,#++*D ((7*d
;C..)44#$HOr   )*r  rc   loggingOpenGLr   r   OpenGL._configflagsr   r   r   r   OpenGL.convertersr	   r
   r   OpenGL.latebindr   re   r   r   OpenGL._nullr   r   	getLogger_logr  ACCELERATE_AVAILABLEOpenGL_accelerate.latebindOpenGL_accelerate.wrapperr   r   r   r   r   ImportErrorr   warningr   r#   r   objectr  r   r   r   <module>r.     s    K  " R R  / ? $ 5  $)*x))
7	
 	
 

 Y	
   dh dN1& $i2  
n	
 	

s   :C C7C22C7