![]() |
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <LanguageHook.h>
Static Public Member Functions | |
static AddonClass::Ref< PythonLanguageHook > | GetIfExists (PyInterpreterState *interp) |
static bool | IsAddonClassInstanceRegistered (AddonClass *obj) |
![]() | |
static void | SetLanguageHook (LanguageHook *languageHook) |
static LanguageHook * | GetLanguageHook () |
static void | ClearLanguageHook () |
![]() | |
static short | getNumAddonClasses () |
Additional Inherited Members | |
![]() | |
LanguageHook ()=default | |
![]() | |
virtual void | deallocating () |
![]() | |
static short | getNextClassIndex () |
![]() | |
LanguageHook * | languageHook |
This class supplies the python specific functionality for plugging into the API. It's got a static only implementation and uses the singleton pattern for access.
|
inlineexplicit |
|
override |
|
overridevirtual |
If the scripting language needs special handling for calls that block or are delayed in any other means, this should be overloaded.
In Python when control is passed to a native method that blocks, you need to allow other threads in Python to run by using Py_BEGIN_ALLOW_THREADS. When that delayed method ends you need to restore the Python thread state using Py_END_ALLOW_THREADS. This is the place to put that functionality
Reimplemented from XBMCAddon::LanguageHook.
|
overridevirtual |
If the scripting language needs special handling for calls that block or are delayed in any other means, this should be overloaded.
In Python when control is passed to a native method that blocks, you need to allow other threads in Python to run by using Py_BEGIN_ALLOW_THREADS. This is the place to put that functionality
Reimplemented from XBMCAddon::LanguageHook.
|
overridevirtual |
This method should be done a different way but since the only other way I can think to do it requires an InheritableThreadLocal C++ equivalent, I'm going to defer to this technique for now.
Currently (for python) the scripting language has the Addon id injected into it as a global variable. Therefore the only way to retrieve it is to use scripting language specific calls. So until I figure out a better way to do this, this is how I need to retrieve it.
Reimplemented from XBMCAddon::LanguageHook.
|
overridevirtual |
Reimplemented from XBMCAddon::LanguageHook.
|
overridevirtual |
PythonCallbackHandler expects to be instantiated PER AddonClass instance that is to be used as a callback. This is why this cannot be instantiated once.
There is an expectation that this method is called from the Python thread that instantiated an AddonClass that has the potential for a callback.
See RetardedAsyncCallbackHandler for more details. See PythonCallbackHandler for more details See PythonCallbackHandler::PythonCallbackHandler for more details
Reimplemented from XBMCAddon::LanguageHook.
|
static |
|
overridevirtual |
Reimplemented from XBMCAddon::LanguageHook.
|
inline |
|
inline |
bool XBMCAddon::Python::PythonLanguageHook::HasRegisteredAddonClassInstance | ( | AddonClass * | obj | ) |
|
static |
|
overridevirtual |
Reimplemented from XBMCAddon::LanguageHook.
void XBMCAddon::Python::PythonLanguageHook::RegisterAddonClassInstance | ( | AddonClass * | obj | ) |
void XBMCAddon::Python::PythonLanguageHook::RegisterMe | ( | ) |
|
overridevirtual |
Implements XBMCAddon::LanguageHook.
|
overridevirtual |
Implements XBMCAddon::LanguageHook.
void XBMCAddon::Python::PythonLanguageHook::UnregisterAddonClassInstance | ( | AddonClass * | obj | ) |
void XBMCAddon::Python::PythonLanguageHook::UnregisterMe | ( | ) |
|
overridevirtual |
Implements XBMCAddon::LanguageHook.
|
overridevirtual |
Implements XBMCAddon::LanguageHook.
|
overridevirtual |
Implements XBMCAddon::LanguageHook.