本文整理汇总了C++中CAddonDll::ID方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDll::ID方法的具体用法?C++ CAddonDll::ID怎么用?C++ CAddonDll::ID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddonDll
的用法示例。
在下文中一共展示了CAddonDll::ID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remove_list_item
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();
}
示例2: open
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);
}
示例3: do_modal
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;
}
示例4: 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__, 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;
}
示例5: open
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();
}
示例6: show_and_get_input_single_text
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);
}
示例7: show_and_get_input_line_text
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;
}
示例8: 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, 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;
}
示例9: 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, 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;
}
示例10: show_and_verify_password
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;
}
示例11: 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__, 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;
}
示例12: show_and_get_input_line_button_text
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);
}
示例13: close
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;
}
示例14: set_callbacks
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();
}
示例15: get_list_item
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;
}