本文整理汇总了C++中CAddonDll类的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDll类的具体用法?C++ CAddonDll怎么用?C++ CAddonDll使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CAddonDll类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetLabel
void Interface_GUIControlButton::SetLabel(void* kodiBase, void* handle, const char *label)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (!addon)
{
CLog::Log(LOGERROR, "ADDON::Interface_GUIControlButton::%s - invalid data", __FUNCTION__);
return;
}
if (handle)
static_cast<CGUIButtonControl *>(handle)->SetLabel(label);
else
CLog::Log(LOGERROR, "ADDON::Interface_GUIControlButton::%s - invalid handler data on addon '%s'", __FUNCTION__, addon->ID().c_str());
}
示例2: show_and_verify_new_password_with_head
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__, 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;
}
示例3: show_and_get_filter
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, 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;
}
示例4: get_focus_id
int Interface_GUIWindow::get_focus_id(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 (kodiBase='%p', handle='%p') on addon '%s'",
__FUNCTION__, kodiBase, handle, addon ? addon->ID().c_str() : "unknown");
return -1;
}
Interface_GUIGeneral::lock();
int control_id = pAddonWindow->GetFocusedControlID();
Interface_GUIGeneral::unlock();
if (control_id == -1)
CLog::Log(LOGERROR, "Interface_GUIWindow - %s: %s - No control in this window has focus",
__FUNCTION__, addon->Name().c_str());
return control_id;
}
示例5: get_setting_int
bool CAddonDll::get_setting_int(void* kodiBase, const char* id, int* value)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (addon == nullptr || id == nullptr || value == nullptr)
{
CLog::Log(LOGERROR, "kodi::General::%s - invalid data (addon='%p', id='%p', value='%p')",
__FUNCTION__, kodiBase, static_cast<const void*>(id), static_cast<void*>(value));
return false;
}
if (!addon->ReloadSettings())
{
CLog::Log(LOGERROR, "kodi::General::%s - could't get settings for add-on '%s'", __FUNCTION__, addon->Name().c_str());
return false;
}
auto setting = addon->GetSettings()->GetSetting(id);
if (setting == nullptr)
{
CLog::Log(LOGERROR, "kodi::General::%s - can't find setting '%s' in '%s'", __FUNCTION__, id, addon->Name().c_str());
return false;
}
if (setting->GetType() != SettingType::Integer && setting->GetType() != SettingType::Number)
{
CLog::Log(LOGERROR, "kodi::General::%s - setting '%s' is not a integer in '%s'", __FUNCTION__, id, addon->Name().c_str());
return false;
}
if (setting->GetType() == SettingType::Integer)
*value = std::static_pointer_cast<CSettingInt>(setting)->GetValue();
else
*value = static_cast<int>(std::static_pointer_cast<CSettingNumber>(setting)->GetValue());
return true;
}
示例6: set_setting_string
bool CAddonDll::set_setting_string(void* kodiBase, const char* id, const char* value)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (addon == nullptr || id == nullptr || value == nullptr)
{
CLog::Log(LOGERROR, "kodi::General::%s - invalid data (addon='%p', id='%p', value='%p')",
__FUNCTION__, kodiBase, static_cast<const void*>(id), static_cast<const void*>(value));
return false;
}
if (addon->UpdateSettingInActiveDialog(id, value))
return true;
if (!addon->UpdateSettingString(id, value))
{
CLog::Log(LOGERROR, "kodi::General::%s - invalid setting type", __FUNCTION__);
return false;
}
addon->SaveSettings();
return true;
}
示例7: set_focus_id
//@{
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__, addon, pAddonWindow, 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;
}
示例8: show_and_get_input_with_head
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, 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;
}
示例9: get_temp_path
char* Interface_General::get_temp_path(void* kodiBase)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (addon == nullptr)
{
CLog::Log(LOGERROR, "Interface_General::%s - called with empty kodi instance pointer", __FUNCTION__);
return nullptr;
}
const std::string tempPath = URIUtils::AddFileToFolder(CServiceBroker::GetBinaryAddonManager().GetTempAddonBasePath(), addon->ID());
if (!XFILE::CDirectory::Exists(tempPath))
XFILE::CDirectory::Create(tempPath);
return strdup(CSpecialProtocol::TranslatePath(tempPath).c_str());
}
示例10: show_and_get_seconds
bool Interface_GUIDialogNumeric::show_and_get_seconds(void* kodiBase, const char* time_in, char** time_out, const char *heading)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (!addon)
{
CLog::Log(LOGERROR, "Interface_GUIDialogNumeric::%s - invalid data", __FUNCTION__);
return false;
}
if (!time_in || !time_out || !heading)
{
CLog::Log(LOGERROR,
"Interface_GUIDialogNumeric::%s - invalid handler data (time_in='%p', time_out='%p', "
"heading='%p') on addon '%s'",
__FUNCTION__, time_in, static_cast<void*>(time_out), heading, addon->ID().c_str());
return false;
}
std::string str = time_in;
bool bRet = CGUIDialogNumeric::ShowAndGetSeconds(str, heading);
if (bRet)
*time_out = strdup(str.c_str());
return bRet;
}
示例11: show
bool Interface_GUIWindow::show(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->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();
else
g_windowManager.ActivateWindow(pAddonWindow->GetID());
Interface_GUIGeneral::unlock();
return true;
}
示例12: show_and_get_new_password
bool Interface_GUIDialogKeyboard::show_and_get_new_password(void* kodiBase, const char* password_in, char** password_out, 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)
{
CLog::Log(LOGERROR,
"Interface_GUIDialogKeyboard::%s - invalid handler data (password_in='%p', "
"password_out='%p') on addon '%s'",
__FUNCTION__, password_in, static_cast<void*>(password_out), addon->ID().c_str());
return false;
}
std::string str = password_in;
bool bRet = CGUIKeyboardFactory::ShowAndGetNewPassword(str, auto_close_ms);
if (bRet)
*password_out = strdup(str.c_str());
return bRet;
}
示例13: set_line
void Interface_GUIDialogProgress::set_line(void* kodiBase, void* handle, unsigned int line, const char* text)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (!addon)
{
CLog::Log(LOGERROR, "Interface_GUIDialogProgress::%s - invalid data", __FUNCTION__);
return;
}
if (!handle || !text)
{
CLog::Log(LOGERROR, "Interface_GUIDialogProgress::%s - invalid handler data (handle='%p', text='%p') on addon '%s'", __FUNCTION__, handle, text, addon->ID().c_str());
return;
}
static_cast<CGUIDialogProgress*>(handle)->SetLine(line, text);
}
示例14: open
void Interface_GUIDialogProgress::open(void* kodiBase, void* handle)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (!addon)
{
CLog::Log(LOGERROR, "Interface_GUIDialogProgress::%s - invalid data", __FUNCTION__);
return;
}
if (!handle)
{
CLog::Log(LOGERROR, "Interface_GUIDialogProgress::%s - invalid handler data (handle='%p') on addon '%s'", __FUNCTION__, handle, addon->ID().c_str());
return;
}
static_cast<CGUIDialogProgress*>(handle)->Open();
}
示例15: set_heading
void Interface_GUIDialogProgress::set_heading(void* kodiBase, void* handle, const char* heading)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (!addon)
{
CLog::Log(LOGERROR, "Interface_GUIDialogProgress::%s - invalid data", __FUNCTION__);
return;
}
if (!handle || !heading)
{
CLog::Log(LOGERROR, "Interface_GUIDialogProgress::%s - invalid handler data (handle='%p', heading='%p') on addon '%s'", __FUNCTION__, handle, heading, addon->ID().c_str());
return;
}
static_cast<CGUIDialogProgress*>(handle)->SetHeading(heading);
}