ó
(Ş/Kc           @   sŞ   d  Z  d d l m Z d Z Z e j r\ y d d l m Z m Z Wq\ e k
 rX Z	 q\ Xn  e d k r d e
 f d     YZ n  e d k rŚ d e
 f d     YZ n  d S(	   s)   Late-bound base-class (with acceleration)i˙˙˙˙(   t   acceleratesupport(   t   LateBindt   CurryR   c           B   s8   e  Z d  Z d Z d   Z d   Z d   Z d   Z RS(   s¸   Provides a __call__ which dispatches to self._finalCall

        When called without self._finalCall() makes a call to
        self.finalise() and then calls self._finalCall()
        c         C   s   | |  _  d S(   s.   Set our finalCall to the callable object givenN(   t
   _finalCall(   t   selft	   finalCall(    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyt   setFinalCall   s    c         C   s"   |  j  s |  j   |  _  n  |  j  S(   s,   Retrieve and/or bind and retrieve final call(   R   t   finalise(   R   (    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyt   getFinalCall   s    	c         C   s   d S(   s`   Finalise our target to our final callable object

            return final callable
            N(    (   R   (    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyR      s    c         O   sb   y |  j  | |   SWnG t t f k
 r] } |  j  d k rM |  j   |  _  n  |  j  | |   SXd S(   sú   Call self._finalCall, calling finalise() first if not already called

            There's actually *no* reason to unpack and repack the arguments,
            but unfortunately I don't know of a Cython syntax to specify
            that.
            N(   R   t	   TypeErrort   AttributeErrort   NoneR   (   R   t   argst   namedt   err(    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyt   __call__!   s    N(	   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   (    (    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyR   
   s   			R   c           B   s,   e  Z d  Z d Z d Z d   Z d   Z RS(   sŻ   Provides a simple Curry which can bind (only) the first element

        This is used by lazywrapper, which explains the weird naming
        of the two attributes...
        c         C   s   | |  _  | |  _ d S(   s1   Stores self.wrapperFunction and self.baseFunctionN(   t   baseFunctiont   wrapperFunction(   R   R   R   (    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyt   __init__7   s    	c         O   s   |  j  |  j | |  S(   sA   returns self.wrapperFunction( self.baseFunction, *args, **named )(   R   R   (   R   R   R   (    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyR   ;   s    N(   R   R   R   R   R   R   R   R   (    (    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyR   /   s
   	N(   R   t   OpenGLR    R   R   R   t   ACCELERATE_AVAILABLEt   OpenGL_accelerate.latebindt   ImportErrorR   t   object(    (    (    s0   C:\Python27\Lib\site-packages\OpenGL\latebind.pyt   <module>   s   
	$