Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Classes | |
class | Director |
struct | PyHolder |
class | PyObjectDecrementor |
struct | PythonCompare |
class | PythonToCppException |
struct | TypeInfo |
Variables | |
std::map< std::type_index, const TypeInfo * > | typeInfoLookup |
void PythonBindings::cleanForDealloc | ( | XBMCAddon::AddonClass * | c | ) |
This method is a helper for the generated API. It's called prior to any API class destructor being dealloc-ed from the generated code from Python
void PythonBindings::cleanForDealloc | ( | XBMCAddon::xbmcgui::Window * | c | ) |
This method is a helper for the generated API. It's called prior to any API class destructor being dealloc-ed from the generated code from Python
There is a Catch-22 in the destruction of a Window. 'dispose' needs to be called on destruction but cannot be called from the destructor. This overrides the default cleanForDealloc to resolve that.
XBMCAddon::AddonClass * PythonBindings::doretrieveApiInstance | ( | const PyHolder * | pythonObj, |
const TypeInfo * | typeInfo, | ||
const char * | expectedType, | ||
const char * | methodNamespacePrefix, | ||
const char * | methodNameForErrorString ) |
const TypeInfo * PythonBindings::getTypeInfoForInstance | ( | XBMCAddon::AddonClass * | obj | ) |
bool PythonBindings::isParameterRightType | ( | const char * | passedType, |
const char * | expectedType, | ||
const char * | methodNamespacePrefix, | ||
bool | tryReverse ) |
|
inline |
This method allows for conversion of the native api Type to the Python type.
When this form of the call is used then the python type constructed will be the type given by the class metadata in the AddonClass instance 'api'.
This is just a helper inline to call the other makePythonInstance with NULL as the pythonType.
PyObject * PythonBindings::makePythonInstance | ( | XBMCAddon::AddonClass * | api, |
PyTypeObject * | pytype, | ||
bool | incrementRefCount ) |
This method allows for conversion of the native api Type to the Python type.
When this form of the call is used (and pytype isn't NULL) then the passed type is used in the instance. This is for classes that extend API classes in python. The type passed may not be the same type that's stored in the class metadata of the AddonClass of which 'api' is an instance, it can be a subclass in python.
if pytype is NULL then the type is inferred using the class metadata stored in the AddonClass instance 'api'.
This method allows for conversion of the native api Type to the Python type.
When this form of the call is used (and pythonType isn't NULL) then the passed type is used in the instance. This is for classes that extend API classes in python. The type passed may not be the same type that's stored in the class metadata of the AddonClass of which 'api' is an instance, it can be a subclass in python.
if pythonType is NULL then the type is inferred using the class metadata stored in the AddonClass instance 'api'.
void PythonBindings::prepareForReturn | ( | XBMCAddon::AddonClass * | c | ) |
This method is a helper for the generated API. It's called prior to any API class constructor being returned from the generated code to Python
void PythonBindings::PyXBMCGetUnicodeString | ( | std::string & | buf, |
PyObject * | pObject, | ||
bool | coerceToString = false, | ||
const char * | pos = "unknown", | ||
const char * | methodname = "unknown" ) |
This call will convert the python object passed to a string. The object passed must be a python str or unicode object unless coerceToString is true. If coerceToString is true then the type must be castable to a string using the python call str(pObject).
This method will handle a 'None' that's passed in. If 'None' is passed then the resulting buf will contain the value of XBMCAddon::emptyString (which is simply a std::string instantiated with the default constructor.
|
inline |
This method retrieves the pointer from the PyHolder. The return value should be cast to the appropriate type.
Since the calls to this are generated there's no NULL pointer checks
This method will return NULL if either the pythonObj is NULL or the pythonObj is Py_None.
|
inline |
This method retrieves the pointer from the PyHolder. The return value should be cast to the appropriate type.
Since the calls to this are generated there's no NULL pointer checks
std::map<std::type_index, const TypeInfo*> PythonBindings::typeInfoLookup |