|
kodi
|
This class supplies the python specific functionality for plugging into the API. More...
#include <LanguageHook.h>


Public Member Functions | |
| PythonLanguageHook (PyInterpreterState *interp) | |
| void | DelayedCallOpen () override |
| If the scripting language needs special handling for calls that block or are delayed in any other means, this should be overloaded. More... | |
| void | DelayedCallClose () override |
| If the scripting language needs special handling for calls that block or are delayed in any other means, this should be overloaded. More... | |
| void | MakePendingCalls () override |
| XBMCAddon::CallbackHandler * | GetCallbackHandler () override |
| PythonCallbackHandler expects to be instantiated PER AddonClass instance that is to be used as a callback. More... | |
| String | GetAddonId () override |
| 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. More... | |
| String | GetAddonVersion () override |
| long | GetInvokerId () override |
| void | RegisterPlayerCallback (IPlayerCallback *player) override |
| void | UnregisterPlayerCallback (IPlayerCallback *player) override |
| void | RegisterMonitorCallback (XBMCAddon::xbmc::Monitor *monitor) override |
| void | UnregisterMonitorCallback (XBMCAddon::xbmc::Monitor *monitor) override |
| bool | WaitForEvent (CEvent &hEvent, unsigned int milliseconds) override |
| void | RegisterAddonClassInstance (AddonClass *obj) |
| void | UnregisterAddonClassInstance (AddonClass *obj) |
| bool | HasRegisteredAddonClassInstance (AddonClass *obj) |
| bool | HasRegisteredAddonClasses () |
| std::set< AddonClass * > & | GetRegisteredAddonClasses () |
| void | UnregisterMe () |
| void | RegisterMe () |
Public Member Functions inherited from XBMCAddon::LanguageHook | |
| virtual void | Constructing (AddonClass *beingConstructed) |
| This is a callback method that can be overridden to receive a callback when an AddonClass that has this language hook is on is being constructed. More... | |
| virtual void | Destructing (AddonClass *beingDestructed) |
| This is a callback method that can be overridden to receive a callback when an AddonClass that has this language hook is on is being destructed. More... | |
Public Member Functions inherited from XBMCAddon::AddonClass | |
| const char * | GetClassname () const |
| LanguageHook * | GetLanguageHook () |
| bool | isDeallocating () |
| This method should be called while holding a Synchronize on the object. More... | |
| void | Release () const |
| void | Acquire () const |
Static Public Member Functions | |
| static AddonClass::Ref< PythonLanguageHook > | GetIfExists (PyInterpreterState *interp) |
| static bool | IsAddonClassInstanceRegistered (AddonClass *obj) |
Static Public Member Functions inherited from XBMCAddon::LanguageHook | |
| static void | SetLanguageHook (LanguageHook *languageHook) |
| static LanguageHook * | GetLanguageHook () |
| static void | ClearLanguageHook () |
Static Public Member Functions inherited from XBMCAddon::AddonClass | |
| static short | getNumAddonClasses () |
Additional Inherited Members | |
Protected Member Functions inherited from XBMCAddon::AddonClass | |
| virtual void | deallocating () |
| This method is meant to be called from the destructor of the lowest level class. More... | |
Static Protected Member Functions inherited from XBMCAddon::AddonClass | |
| static short | getNextClassIndex () |
| This is meant to be called during static initialization and so isn't synchronized. | |
Protected Attributes inherited from XBMCAddon::AddonClass | |
| 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.
|
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 |
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.
1.8.13