OpenGL.converters
index
/home/mcfletch/pylive/OpenGL/converters.py

Implementations for common converter types

 
Modules
       
OpenGL.acceleratesupport
ctypes
logging

 
Classes
       
object
Converter
CConverter
StringLengths
PyConverter
ReturnValues

 
class CConverter(Converter)
    Converter sub-class for use in Wrapper.cConverters
 
This class just defines the interface for a cConverter-style
Converter object
 
 
Method resolution order:
CConverter
Converter
object

Methods defined here:
__call__(self, pyArgs, index, baseOperation)
Calculate C-compatible Python object from Python arguments
 
pyArgs -- set of Python argument objects converted by 
    pyConverters from the incoming arguments 
index -- our index in baseOperation.cConverters
baseOperation -- the Wrapper object which we are supporting

Methods inherited from Converter:
__init__(self, *args, **named)
Store arguments in attributes
 
*args -- mapped to self.argNames in order to set attributes
**named -- mapped to self.argNames by name to set attributes
finalise(self, wrapper)
Look up our indices (where appropriate)

Data descriptors inherited from Converter:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from Converter:
argNames = ()
indexLookups = ()

 
class Converter(object)
    Base class for Converter types
 
Converter objects are callable objects used with the 
OpenGL.wrapper.Wrapper class to simplify the wrapping
of functions by collecting commonly used functionality
into a reusable function.
 
Each Converter has two (class) attributes:
 
    argNames -- list of argument names for initialisation
    indexLookups -- set of (indexname, argName,methodName) values 
        to lookup on wrapper.  These allow us to use argument-name
        references to refer to which arguments to use when 
        processing (prevents the need to revise pointers when 
        we change the API for a function).
 
Converters can be any of the Wrapper API helper functions,
so the callable interface can vary among Converter classes.
 
  Methods defined here:
__init__(self, *args, **named)
Store arguments in attributes
 
*args -- mapped to self.argNames in order to set attributes
**named -- mapped to self.argNames by name to set attributes
finalise(self, wrapper)
Look up our indices (where appropriate)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
argNames = ()
indexLookups = ()

 
class PyConverter(Converter)
    Converter sub-class for use in Wrapper.pyConverters
 
This class just defines the interface for a pyConverter-style
Converter object
 
 
Method resolution order:
PyConverter
Converter
object

Methods defined here:
__call__(self, incoming, function, arguments)
Convert incoming argument into compatable data-types
 
incoming -- the Python argument for this parameter
function -- the wrapper.Wrapper class we are supporting
arguments -- the complete set of arguments passed to the 
    function

Methods inherited from Converter:
__init__(self, *args, **named)
Store arguments in attributes
 
*args -- mapped to self.argNames in order to set attributes
**named -- mapped to self.argNames by name to set attributes
finalise(self, wrapper)
Look up our indices (where appropriate)

Data descriptors inherited from Converter:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from Converter:
argNames = ()
indexLookups = ()

 
class ReturnValues(Converter)
    Converter sub-class for use as Wrapper.returnValues
 
This class just defines the interface for a returnValues-style
Converter object
 
 
Method resolution order:
ReturnValues
Converter
object

Methods defined here:
__call__(self, result, baseOperation, pyArgs, cArgs)
Return a final value to the caller
 
result -- the raw ctypes result value 
baseOperation -- the Wrapper object which we are supporting
pyArgs -- the set of Python arguments produced by pyConverters
cArgs -- the set of C-compatible arguments produced by CConverter
 
return the Python object for the final result

Methods inherited from Converter:
__init__(self, *args, **named)
Store arguments in attributes
 
*args -- mapped to self.argNames in order to set attributes
**named -- mapped to self.argNames by name to set attributes
finalise(self, wrapper)
Look up our indices (where appropriate)

Data descriptors inherited from Converter:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from Converter:
argNames = ()
indexLookups = ()

 
class StringLengths(CConverter)
    CConverter for processing array-of-pointers-to-strings data-type
 
Converter is a CConverter for the array-of-lengths for a
array-of-pointers-to-strings data-type used to pass a set
of code fragments to the GLSL compiler.
 
Provides also:
 
    stringArray -- PyConverter callable ensuring list-of-strings 
        format for the python argument
        
    stringArrayForC -- CResolver converting the array to 
        POINTER(c_char_p) format for passing to C
        
    totalCount -- CConverter callable giving count of string 
        pointers (that is, length of the pointer array)
 
 
Method resolution order:
StringLengths
CConverter
Converter
object

Methods defined here:
__call__(self, pyArgs, index, baseOperation)
Get array of length integers for string contents
stringArray(self, arg, baseOperation, args)
Create basic array-of-strings object from pyArg
stringArrayForC(self, strings)
Create a ctypes pointer to char-pointer set
totalCount(self, pyArgs, index, baseOperation)
Get array of length integers for string contents

Data and other attributes defined here:
argNames = ('name',)
indexLookups = [('index', 'name', 'pyArgIndex')]

Methods inherited from Converter:
__init__(self, *args, **named)
Store arguments in attributes
 
*args -- mapped to self.argNames in order to set attributes
**named -- mapped to self.argNames by name to set attributes
finalise(self, wrapper)
Look up our indices (where appropriate)

Data descriptors inherited from Converter:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        __file__ = '/home/mcfletch/pylive/OpenGL/converters.pyc'
__name__ = 'OpenGL.converters'
__package__ = 'OpenGL'
log = <logging.Logger instance at 0x21c9560>