* Create a new python callbacks instance, and set callbacks in the configuration * @param config the configuration to set the callbacks in */
| 70 | * @param config the configuration to set the callbacks in |
| 71 | */ |
| 72 | CCecPythonCallbacks(libcec_configuration* config) : |
| 73 | m_configuration(config) |
| 74 | { |
| 75 | assert(!!config); |
| 76 | assert(!!m_configuration); |
| 77 | |
| 78 | config->callbacks = new ICECCallbacks; |
| 79 | if (!config->callbacks) |
| 80 | throw std::bad_alloc(); |
| 81 | |
| 82 | for (size_t ptr = 0; ptr < NB_PYTHON_CB; ++ptr) |
| 83 | m_callbacks[ptr] = NULL; |
| 84 | |
| 85 | m_configuration->callbacks->logMessage = CBCecLogMessage; |
| 86 | m_configuration->callbacks->keyPress = CBCecKeyPress; |
| 87 | m_configuration->callbacks->commandReceived = CBCecCommand; |
| 88 | m_configuration->callbacks->configurationChanged = CBCecConfigurationChanged; |
| 89 | m_configuration->callbacks->alert = CBCecAlert; |
| 90 | m_configuration->callbacks->menuStateChanged = CBCecMenuStateChanged; |
| 91 | m_configuration->callbacks->sourceActivated = CBCecSourceActivated; |
| 92 | m_configuration->callbacks->commandHandler = CBCecCommandHandler; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Unreferences all python callbacks, and deletes the callbacks |
nothing calls this directly
no outgoing calls
no test coverage detected