void Interface_GUIWindow::remove_list_item(void* kodiBase, void* handle, void* item) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow || !item) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (kodiBase='%p', handle='%p', " "item='%p') on addon '%s'", __FUNCTION__, kodiBase, handle, item, addon ? addon->ID().c_str() : "unknown"); return; } CFileItemPtr* pItem(static_cast<CFileItemPtr*>(item)); if (pItem->get() == nullptr) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - empty list item called on addon '%s'", __FUNCTION__, addon->ID().c_str()); return; } Interface_GUIGeneral::lock(); pAddonWindow->RemoveItem(pItem); Interface_GUIGeneral::unlock(); }
int Interface_GUIDialogContextMenu::open(void* kodiBase, const char *heading, const char *entries[], unsigned int size) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogContextMenu::%s - invalid data", __FUNCTION__); return -1; } CGUIDialogContextMenu* dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogContextMenu>(WINDOW_DIALOG_CONTEXT_MENU); if (!heading || !entries || !dialog) { CLog::Log(LOGERROR, "Interface_GUIDialogContextMenu::%s - invalid handler data (heading='%p', " "entries='%p', dialog='%p') on addon '%s'", __FUNCTION__, heading, static_cast<const void*>(entries), kodiBase, addon->ID().c_str()); return -1; } CContextButtons choices; for (unsigned int i = 0; i < size; ++i) choices.Add(i, entries[i]); return dialog->Show(choices); }
bool Interface_GUIWindow::do_modal(void* kodiBase, void* handle) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (handle='%p') on addon '%s'", __FUNCTION__, handle, addon ? addon->ID().c_str() : "unknown"); return false; } if (pAddonWindow->GetID() == g_windowManager.GetActiveWindow()) return true; if (pAddonWindow->m_oldWindowId != pAddonWindow->m_windowId && pAddonWindow->m_windowId != g_windowManager.GetActiveWindow()) pAddonWindow->m_oldWindowId = g_windowManager.GetActiveWindow(); Interface_GUIGeneral::lock(); if (pAddonWindow->IsDialog()) dynamic_cast<CGUIAddonWindowDialog*>(pAddonWindow)->Show(true, true); else g_windowManager.ActivateWindow(pAddonWindow->GetID()); Interface_GUIGeneral::unlock(); return true; }
//@{ bool Interface_GUIWindow::set_focus_id(void* kodiBase, void* handle, int control_id) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow) { CLog::Log( LOGERROR, "Interface_GUIWindow::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, kodiBase, handle, addon ? addon->ID().c_str() : "unknown"); return false; } if (!pAddonWindow->GetControl(control_id)) { CLog::Log(LOGERROR, "Interface_GUIWindow - %s: %s - Control does not exist in window", __FUNCTION__, addon->Name().c_str()); return false; } Interface_GUIGeneral::lock(); CGUIMessage msg(GUI_MSG_SETFOCUS, pAddonWindow->m_windowId, control_id); pAddonWindow->OnMessage(msg); Interface_GUIGeneral::unlock(); return true; }
int Interface_GUIDialogSelect::open(void* kodiBase, const char *heading, const char *entries[], unsigned int size, int selected, unsigned int autoclose) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogSelect::%s - invalid data", __FUNCTION__); return -1; } CGUIDialogSelect* dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogSelect>(WINDOW_DIALOG_SELECT); if (!heading || !entries || !dialog) { CLog::Log(LOGERROR, "Interface_GUIDialogSelect::%s - invalid handler data (heading='%p', entries='%p', " "dialog='%p') on addon '%s'", __FUNCTION__, heading, static_cast<const void*>(entries), static_cast<void*>(dialog), addon->ID().c_str()); return -1; } dialog->Reset(); dialog->SetHeading(CVariant{heading}); for (unsigned int i = 0; i < size; ++i) dialog->Add(entries[i]); if (selected > 0) dialog->SetSelected(selected); if (autoclose > 0) dialog->SetAutoClose(autoclose); dialog->Open(); return dialog->GetSelectedItem(); }
bool Interface_GUIDialogYesNo::show_and_get_input_single_text(void* kodiBase, const char* heading, const char* text, bool* canceled, const char* noLabel, const char* yesLabel) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogYesNo::%s - invalid data", __FUNCTION__); return false; } if (!heading || !text || !canceled || !noLabel || !yesLabel) { CLog::Log(LOGERROR, "Interface_GUIDialogYesNo::%s - invalid handler data (heading='%p', text='%p', " "canceled='%p', noLabel='%p', yesLabel='%p') on addon '%s'", __FUNCTION__, heading, text, canceled, noLabel, yesLabel, addon->ID().c_str()); return false; } DialogResponse result = HELPERS::ShowYesNoDialogText(heading, text, noLabel, yesLabel); *canceled = (result == DialogResponse::CANCELLED); return (result == DialogResponse::YES); }
bool Interface_GUIDialogYesNo::show_and_get_input_line_text(void* kodiBase, const char* heading, const char* line0, const char* line1, const char* line2, const char* noLabel, const char* yesLabel) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogYesNo::%s - invalid data", __FUNCTION__); return false; } if (!heading || !line0 || !line1 || !line2 || !noLabel || !yesLabel) { CLog::Log(LOGERROR, "Interface_GUIDialogYesNo::%s - invalid handler data (heading='%p', line0='%p', line1='%p', line2='%p', " "noLabel='%p', yesLabel='%p') on addon '%s'", __FUNCTION__, heading, line0, line1, line2, noLabel, yesLabel, addon->ID().c_str()); return false; } return HELPERS::ShowYesNoDialogLines(heading, line0, line1, line2, noLabel, yesLabel) == DialogResponse::YES; }
bool Interface_GUIDialogKeyboard::show_and_get_filter(void* kodiBase, const char* text_in, char** text_out, bool searching, unsigned int auto_close_ms) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid data", __FUNCTION__); return false; } if (!text_in || !text_out) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid handler data (text_in='%p', " "text_out='%p') on addon '%s'", __FUNCTION__, text_in, static_cast<void*>(text_out), addon->ID().c_str()); return false; } std::string str = text_in; bool bRet = CGUIKeyboardFactory::ShowAndGetFilter(str, searching, auto_close_ms); if (bRet) *text_out = strdup(str.c_str()); return bRet; }
bool Interface_GUIDialogKeyboard::show_and_get_input_with_head(void* kodiBase, const char* text_in, char** text_out, const char* heading, bool allow_empty_result, bool hidden_input, unsigned int auto_close_ms) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid data", __FUNCTION__); return false; } if (!text_in || !text_out || !heading) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid handler data (text_in='%p', " "text_out='%p', heading='%p') on addon '%s'", __FUNCTION__, text_in, static_cast<void*>(text_out), heading, addon->ID().c_str()); return false; } std::string str = text_in; bool bRet = CGUIKeyboardFactory::ShowAndGetInput(str, CVariant{heading}, allow_empty_result, hidden_input, auto_close_ms); if (bRet) *text_out = strdup(str.c_str()); return bRet; }
int Interface_GUIDialogKeyboard::show_and_verify_password(void* kodiBase, const char* password_in, char** password_out, const char* heading, int retries, unsigned int auto_close_ms) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid data", __FUNCTION__); return false; } if (!password_in || !password_out || !heading) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid handler data (password_in='%p', " "password_out='%p', heading='%p') on addon '%s'", __FUNCTION__, password_in, static_cast<void*>(password_out), heading, addon->ID().c_str()); return false; } std::string str = password_in; int iRet = CGUIKeyboardFactory::ShowAndVerifyPassword(str, heading, retries, auto_close_ms); if (iRet) *password_out = strdup(str.c_str()); return iRet; }
bool Interface_GUIDialogKeyboard::show_and_verify_new_password_with_head(void* kodiBase, char** password_out, const char* heading, bool allowEmpty, unsigned int auto_close_ms) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid data", __FUNCTION__); return false; } if (!password_out || !heading) { CLog::Log(LOGERROR, "Interface_GUIDialogKeyboard::%s - invalid handler data (password_out='%p', " "heading='%p') on addon '%s'", __FUNCTION__, static_cast<void*>(password_out), heading, addon->ID().c_str()); return false; } std::string str; bool bRet = CGUIKeyboardFactory::ShowAndVerifyNewPassword(str, heading, allowEmpty, auto_close_ms); if (bRet) *password_out = strdup(str.c_str()); return bRet; }
bool Interface_GUIDialogYesNo::show_and_get_input_line_button_text(void* kodiBase, const char* heading, const char* line0, const char* line1, const char* line2, bool* canceled, const char* noLabel, const char* yesLabel) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogYesNo::%s - invalid data", __FUNCTION__); return false; } if (!heading || !line0 || !line1 || !line2 || !canceled || !noLabel || !yesLabel) { CLog::Log(LOGERROR, "Interface_GUIDialogYesNo::%s - invalid handler data (heading='%p', line0='%p', " "line1='%p', line2='%p', " "canceled='%p', noLabel='%p', yesLabel='%p') on addon '%s'", __FUNCTION__, heading, line0, line1, line2, static_cast<const void*>(canceled), noLabel, yesLabel, addon->ID().c_str()); return false; } DialogResponse result = HELPERS::ShowYesNoDialogLines(heading, line0, line1, line2, noLabel, yesLabel); *canceled = (result == DialogResponse::CANCELLED); return (result == DialogResponse::YES); }
bool Interface_GUIWindow::close(void* kodiBase, void* handle) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (handle='%p') on addon '%s'", __FUNCTION__, handle, addon ? addon->ID().c_str() : "unknown"); return false; } pAddonWindow->PulseActionEvent(); Interface_GUIGeneral::lock(); // if it's a dialog, we have to close it a bit different if (pAddonWindow->IsDialog()) dynamic_cast<CGUIAddonWindowDialog*>(pAddonWindow)->Show(false); else g_windowManager.ActivateWindow(pAddonWindow->m_oldWindowId); pAddonWindow->m_oldWindowId = 0; Interface_GUIGeneral::unlock(); return true; }
void Interface_GUIWindow::set_callbacks(void* kodiBase, void* handle, void* clienthandle, bool (*CBOnInit)(void*), bool (*CBOnFocus)(void*, int), bool (*CBOnClick)(void*, int), bool (*CBOnAction)(void*, int), void (*CBGetContextButtons)(void* , int, gui_context_menu_pair*, unsigned int*), bool (*CBOnContextButton)(void*, int, unsigned int)) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow || !clienthandle) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (handle='%p', clienthandle='%p') on addon '%s'", __FUNCTION__, handle, clienthandle, addon ? addon->ID().c_str() : "unknown"); return; } Interface_GUIGeneral::lock(); pAddonWindow->m_clientHandle = clienthandle; pAddonWindow->CBOnInit = CBOnInit; pAddonWindow->CBOnClick = CBOnClick; pAddonWindow->CBOnFocus = CBOnFocus; pAddonWindow->CBOnAction = CBOnAction; pAddonWindow->CBGetContextButtons = CBGetContextButtons; pAddonWindow->CBOnContextButton = CBOnContextButton; Interface_GUIGeneral::unlock(); }
void* Interface_GUIWindow::get_list_item(void* kodiBase, void* handle, int list_position) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, addon, handle, addon ? addon->ID().c_str() : "unknown"); return nullptr; } Interface_GUIGeneral::lock(); CFileItemPtr* pItem(pAddonWindow->GetListItem(list_position)); if (pItem == nullptr || pItem->get() == nullptr) { CLog::Log(LOGERROR, "ADDON::Interface_GUIWindow - %s: %s - Index out of range", __FUNCTION__, addon->Name().c_str()); if (pItem) { delete pItem; pItem = nullptr; } } Interface_GUIGeneral::unlock(); return pItem; }
void Interface_GUIWindow::destroy(void* kodiBase, void* handle) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (handle='%p') on addon '%s'", __FUNCTION__, handle, addon ? addon->ID().c_str() : "unknown"); return; } Interface_GUIGeneral::lock(); CGUIWindow *pWindow = dynamic_cast<CGUIWindow*>(g_windowManager.GetWindow(pAddonWindow->GetID())); if (pWindow) { // first change to an existing window if (g_windowManager.GetActiveWindow() == pAddonWindow->GetID() && !g_application.m_bStop) { if(g_windowManager.GetWindow(pAddonWindow->m_oldWindowId)) g_windowManager.ActivateWindow(pAddonWindow->m_oldWindowId); else // old window does not exist anymore, switch to home g_windowManager.ActivateWindow(WINDOW_HOME); } // Free any window properties pAddonWindow->ClearProperties(); // free the window's resources and unload it (free all guicontrols) pAddonWindow->FreeResources(true); g_windowManager.Remove(pAddonWindow->GetID()); } delete pAddonWindow; Interface_GUIGeneral::unlock(); }
bool Interface_GUIDialogNumeric::show_and_get_number(void* kodiBase, const char* number_in, char** number_out, const char *heading, unsigned int auto_close_ms) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid data", __FUNCTION__); return false; } if (!number_in || !number_out || !heading) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid handler data (number_in='%p', " "number_out='%p', heading='%p') on addon '%s'", __FUNCTION__, number_in, static_cast<void*>(number_out), heading, addon->ID().c_str()); return false; } std::string str = number_in; bool bRet = CGUIDialogNumeric::ShowAndGetNumber(str, heading, auto_close_ms); if (bRet) *number_out = strdup(str.c_str()); return bRet; }
bool Interface_GUIDialogNumeric::show_and_verify_input(void* kodiBase, const char* verify_in, char** verify_out, const char* heading, bool verify_input) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid data", __FUNCTION__); return false; } if (!verify_in || !verify_out || !heading) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid handler data (verify_in='%p', " "verify_out='%p', heading='%p') on addon '%s'", __FUNCTION__, verify_in, static_cast<void*>(verify_out), heading, addon->ID().c_str()); return false; } std::string str = verify_in; if (CGUIDialogNumeric::ShowAndVerifyInput(str, heading, verify_input) == InputVerificationResult::SUCCESS) { *verify_out = strdup(str.c_str()); return true; } return false; }
bool Interface_GUIDialogNumeric::show_and_get_ip_address(void* kodiBase, const char* ip_address_in, char** ip_address_out, const char *heading) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid data", __FUNCTION__); return false; } if (!ip_address_in || !ip_address_out || !heading) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid handler data (ip_address_in='%p', " "ip_address_out='%p', heading='%p') on addon '%s'", __FUNCTION__, ip_address_in, static_cast<void*>(ip_address_out), heading, addon->ID().c_str()); return false; } std::string strIP = ip_address_in; bool bRet = CGUIDialogNumeric::ShowAndGetIPAddress(strIP, heading); if (bRet) *ip_address_out = strdup(strIP.c_str()); return bRet; }
bool Interface_GUIDialogNumeric::show_and_get_date(void* kodiBase, tm *date, const char *heading) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid data", __FUNCTION__); return false; } if (!date || !heading) { CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid handler data (date='%p', heading='%p') on " "addon '%s'", __FUNCTION__, static_cast<void*>(date), heading, addon->ID().c_str()); return false; } SYSTEMTIME systemTime; CDateTime dateTime(*date); dateTime.GetAsSystemTime(systemTime); if (CGUIDialogNumeric::ShowAndGetDate(systemTime, heading)) { dateTime = systemTime; dateTime.GetAsTm(*date); return true; } return false; }
bool Interface_GUIDialogSelect::open_multi_select(void* kodiBase, const char *heading, const char *entryIDs[], const char *entryNames[], bool entriesSelected[], unsigned int size, unsigned int autoclose) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); if (!addon) { CLog::Log(LOGERROR, "Interface_GUIDialogMultiSelect::%s - invalid data", __FUNCTION__); return false; } CGUIDialogSelect* dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogSelect>(WINDOW_DIALOG_SELECT); if (!heading || !entryIDs || !entryNames || !entriesSelected || !dialog) { CLog::Log(LOGERROR, "Interface_GUIDialogMultiSelect::%s - invalid handler data (heading='%p', " "entryIDs='%p', entryNames='%p', entriesSelected='%p', dialog='%p') on addon '%s'", __FUNCTION__, heading, static_cast<const void*>(entryIDs), static_cast<const void*>(entryNames), static_cast<void*>(entriesSelected), static_cast<void*>(dialog), addon->ID().c_str()); return false; } dialog->Reset(); dialog->SetMultiSelection(true); dialog->SetHeading(CVariant{heading}); std::vector<int> selectedIndexes; for (unsigned int i = 0; i < size; ++i) { dialog->Add(entryNames[i]); if (entriesSelected[i]) selectedIndexes.push_back(i); } dialog->SetSelected(selectedIndexes); if (autoclose > 0) dialog->SetAutoClose(autoclose); dialog->Open(); if (dialog->IsConfirmed()) { for (unsigned int i = 0; i < size; ++i) entriesSelected[i] = false; selectedIndexes = dialog->GetSelectedItems(); for (unsigned int i = 0; i < selectedIndexes.size(); ++i) { if (selectedIndexes[i]) entriesSelected[selectedIndexes[i]] = true; } } return true; }
void Interface_GUIControlImage::set_filename(void* kodiBase, void* handle, const char* filename, bool use_cache) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIImage* control = static_cast<CGUIImage*>(handle); if (!addon || !control || !filename) { CLog::Log(LOGERROR, "Interface_GUIControlImage::%s - invalid handler data (kodiBase='%p', handle='%p', filename='%p') on addon '%s'", __FUNCTION__, addon, control, filename, addon ? addon->ID().c_str() : "unknown"); return; } control->SetFileName(filename, false, use_cache); }
void Interface_GUIControlEdit::set_visible(void* kodiBase, void* handle, bool visible) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIEditControl* control = static_cast<CGUIEditControl*>(handle); if (!addon || !control) { CLog::Log(LOGERROR, "Interface_GUIControlEdit::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, kodiBase, handle, addon ? addon->ID().c_str() : "unknown"); return; } control->SetVisible(visible); }
void* Interface_GUIWindow::GetControl(void* kodiBase, void* handle, int control_id, const char* function, CGUIControl::GUICONTROLTYPES type, const std::string& typeName) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle); if (!addon || !pAddonWindow) { CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", function, addon, handle, addon ? addon->ID().c_str() : "unknown"); return nullptr; } return pAddonWindow->GetAddonControl(control_id, type, typeName); }
void Interface_GUIControlSettingsSlider::set_enabled(void* kodiBase, void* handle, bool enabled) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUISettingsSliderControl* control = static_cast<CGUISettingsSliderControl*>(handle); if (!addon || !control) { CLog::Log(LOGERROR, "Interface_GUIControlSettingsSlider::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, addon, control, addon ? addon->ID().c_str() : "unknown"); return; } control->SetEnabled(enabled); }
char* Interface_GUIControlEdit::get_text(void* kodiBase, void* handle) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIEditControl* control = static_cast<CGUIEditControl*>(handle); if (!addon || !control) { CLog::Log(LOGERROR, "Interface_GUIControlEdit::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, kodiBase, handle, addon ? addon->ID().c_str() : "unknown"); return nullptr; } return strdup(control->GetLabel2().c_str()); }
float Interface_GUIControlSettingsSlider::get_float_value(void* kodiBase, void* handle) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUISettingsSliderControl* control = static_cast<CGUISettingsSliderControl*>(handle); if (!addon || !control) { CLog::Log(LOGERROR, "Interface_GUIControlSettingsSlider::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, addon, control, addon ? addon->ID().c_str() : "unknown"); return 0.0f; } return control->GetFloatValue(); }
unsigned int Interface_GUIControlEdit::get_cursor_position(void* kodiBase, void* handle) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIEditControl* control = static_cast<CGUIEditControl*>(handle); if (!addon || !control) { CLog::Log(LOGERROR, "Interface_GUIControlEdit::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, kodiBase, handle, addon ? addon->ID().c_str() : "unknown"); return 0; } return control->GetCursorPosition(); }
void Interface_GUIControlImage::set_color_diffuse(void* kodiBase, void* handle, uint32_t colorDiffuse) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIImage* control = static_cast<CGUIImage*>(handle); if (!addon || !control) { CLog::Log(LOGERROR, "Interface_GUIControlImage::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'", __FUNCTION__, addon, control, addon ? addon->ID().c_str() : "unknown"); return; } control->SetColorDiffuse(CGUIInfoColor(colorDiffuse)); }
void Interface_GUIControlEdit::set_text(void* kodiBase, void* handle, const char* text) { CAddonDll* addon = static_cast<CAddonDll*>(kodiBase); CGUIEditControl* control = static_cast<CGUIEditControl*>(handle); if (!addon || !control || !text) { CLog::Log(LOGERROR, "Interface_GUIControlEdit::%s - invalid handler data (kodiBase='%p', handle='%p', text='%p') on addon '%s'", __FUNCTION__, kodiBase, handle, text, addon ? addon->ID().c_str() : "unknown"); return; } control->SetLabel2(text); }