本文整理汇总了C++中CGUIWindow类的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindow类的具体用法?C++ CGUIWindow怎么用?C++ CGUIWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CGUIWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindow
void CGUIWindowManager::RenderPass() const
{
CGUIWindow* pWindow = GetWindow(GetActiveWindow());
if (pWindow)
{
pWindow->ClearBackground();
pWindow->DoRender();
}
// we render the dialogs based on their render order.
vector<CGUIWindow *> renderList = m_activeDialogs;
stable_sort(renderList.begin(), renderList.end(), RenderOrderSortFunction);
for (iDialog it = renderList.begin(); it != renderList.end(); ++it)
{
if ((*it)->IsDialogRunning())
(*it)->DoRender();
}
}
示例2: CloseDialog
/*! \brief Close a dialog.
* \param params The parameters.
* \details params[0] = "all" to close all dialogs, or dialog name.
* params[1] = "true" to force close (skip animations) (optional).
*/
static int CloseDialog(const std::vector<std::string>& params)
{
bool bForce = false;
if (params.size() > 1 && StringUtils::EqualsNoCase(params[1], "true"))
bForce = true;
if (StringUtils::EqualsNoCase(params[0], "all"))
{
g_windowManager.CloseDialogs(bForce);
}
else
{
int id = CButtonTranslator::TranslateWindow(params[0]);
CGUIWindow *window = (CGUIWindow *)g_windowManager.GetWindow(id);
if (window && window->IsDialog())
((CGUIDialog *)window)->Close(bForce);
}
return 0;
}
示例3: lock
bool CGUIWindowManager::HasModalDialog() const
{
// If the screen saver is active, don't tell anyone that there
// are any dialogs open, so the window will get the events and
// not the dialogs
if (g_application.GetInSlideshowScreensaver())
return false;
CSingleLock lock(g_graphicsContext);
for (ciDialog it = m_activeDialogs.begin(); it != m_activeDialogs.end(); ++it)
{
CGUIWindow *window = *it;
if (window->IsModalDialog())
{ // have a modal window
if (!window->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
return true;
}
}
return false;
}
示例4: GetWindow
bool CGUIWindowManager::IsColorBufferActive()
{
CGUIWindow* pWindow = GetWindow(GetActiveWindow());
if(!pWindow)
return false;
if(pWindow->HasDynamicContents())
return false;
if(pWindow->IsAnimating())
return false;
int mode3d = MODE_3D_NONE;
#ifdef HAS_EMBEDDED
mode3d = g_guiSettings.GetInt("videoscreen.mode3d");
#endif
if(mode3d != MODE_3D_NONE)
return false;
// find the window with the lowest render order
vector<CGUIWindow *> renderList = m_activeDialogs;
stable_sort(renderList.begin(), renderList.end(), RenderOrderSortFunction);
// iterate through all dialogs. If the dialog enable color buffer return true;
for (iDialog it = renderList.begin(); it != renderList.end(); ++it)
{
if ((*it)->IsDialogRunning())
{
if ((*it)->IsAnimating())
{
return false;
}
else if((*it)->HasColorBufferActive())
return true;
}
}
return false;
}
示例5: assert
void CGUIWindowManager::Render()
{
assert(g_application.IsCurrentThread());
CSingleLock lock(g_graphicsContext);
CGUIWindow* pWindow = GetWindow(GetActiveWindow());
if (pWindow)
{
pWindow->ClearBackground();
pWindow->Render();
}
// we render the dialogs based on their render order.
vector<CGUIWindow *> renderList = m_activeDialogs;
stable_sort(renderList.begin(), renderList.end(), RenderOrderSortFunction);
for (iDialog it = renderList.begin(); it != renderList.end(); ++it)
{
if ((*it)->IsDialogRunning())
(*it)->Render();
}
}
示例6: ActivateWindow
static int ActivateWindow(const std::vector<std::string>& params2)
{
std::vector<std::string> params(params2);
// get the parameters
std::string strWindow;
if (params.size())
{
strWindow = params[0];
params.erase(params.begin());
}
// confirm the window destination is valid prior to switching
int iWindow = CWindowTranslator::TranslateWindow(strWindow);
if (iWindow != WINDOW_INVALID)
{
// compare the given directory param with the current active directory
bool bIsSameStartFolder = true;
if (!params.empty())
{
CGUIWindow *activeWindow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow(CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow());
if (activeWindow && activeWindow->IsMediaWindow())
bIsSameStartFolder = static_cast<CGUIMediaWindow*>(activeWindow)->IsSameStartFolder(params[0]);
}
// activate window only if window and path differ from the current active window
if (iWindow != CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() || !bIsSameStartFolder)
{
g_application.WakeUpScreenSaverAndDPMS();
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(iWindow, params, Replace);
return 0;
}
}
else
{
CLog::Log(LOGERROR, "Activate/ReplaceWindow called with invalid destination window: %s", strWindow.c_str());
return false;
}
return 1;
}
示例7: assert
void CGUIWindowManager::Process(unsigned int currentTime)
{
assert(g_application.IsCurrentThread());
CSingleLock lock(g_graphicsContext);
CDirtyRegionList dirtyregions;
CGUIWindow* pWindow = GetWindow(GetActiveWindow());
if (pWindow)
pWindow->DoProcess(currentTime, dirtyregions);
// process all dialogs - visibility may change etc.
for (WindowMap::iterator it = m_mapWindows.begin(); it != m_mapWindows.end(); ++it)
{
CGUIWindow *pWindow = (*it).second;
if (pWindow && pWindow->IsDialog())
pWindow->DoProcess(currentTime, dirtyregions);
}
for (CDirtyRegionList::iterator itr = dirtyregions.begin(); itr != dirtyregions.end(); ++itr)
m_tracker.MarkDirtyRegion(*itr);
}
示例8: lock
void CGUIWindowManager::UnloadNotOnDemandWindows()
{
/*
参数:
1、
返回:
1、
说明:
1、
*/
CSingleLock lock(g_graphicsContext);
for (WindowMap::iterator it = m_mapWindows.begin(); it != m_mapWindows.end(); it++)
{
CGUIWindow *pWindow = (*it).second;
if (!pWindow->GetLoadOnDemand())
{
pWindow->FreeResources(true);
}
}
}
示例9: Slideshow
static int Slideshow(const std::vector<std::string>& params)
{
std::string beginSlidePath;
// leave RecursiveSlideShow command as-is
unsigned int flags = 0;
if (Recursive)
flags |= 1;
// SlideShow(dir[,recursive][,[not]random][,pause][,beginslide="/path/to/start/slide.jpg"])
// the beginslide value need be escaped (for '"' or '\' in it, by backslash)
// and then quoted, or not. See CUtil::SplitParams()
else
{
for (unsigned int i = 1 ; i < params.size() ; i++)
{
if (StringUtils::EqualsNoCase(params[i], "recursive"))
flags |= 1;
else if (StringUtils::EqualsNoCase(params[i], "random")) // set fullscreen or windowed
flags |= 2;
else if (StringUtils::EqualsNoCase(params[i], "notrandom"))
flags |= 4;
else if (StringUtils::EqualsNoCase(params[i], "pause"))
flags |= 8;
else if (StringUtils::StartsWithNoCase(params[i], "beginslide="))
beginSlidePath = params[i].substr(11);
}
}
CGUIMessage msg(GUI_MSG_START_SLIDESHOW, 0, 0, flags);
std::vector<std::string> strParams;
strParams.push_back(params[0]);
strParams.push_back(beginSlidePath);
msg.SetStringParams(strParams);
CGUIWindow *pWindow = CServiceBroker::GetGUI()->GetWindowManager().GetWindow(WINDOW_SLIDESHOW);
if (pWindow)
pWindow->OnMessage(msg);
return 0;
}
示例10: switch
bool CGUIDialogPictureInfo::OnAction(const CAction& action)
{
switch (action.GetID())
{
// if we're running from slideshow mode, drop the "next picture" and "previous picture" actions through.
case ACTION_NEXT_PICTURE:
case ACTION_PREV_PICTURE:
case ACTION_PLAYER_PLAY:
case ACTION_PAUSE:
if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW)
{
CGUIWindow* pWindow = g_windowManager.GetWindow(WINDOW_SLIDESHOW);
return pWindow->OnAction(action);
}
break;
case ACTION_SHOW_INFO:
Close();
return true;
};
return CGUIDialog::OnAction(action);
}
示例11: switch
bool CGUIDialog::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_WINDOW_DEINIT:
{
CGUIWindow *pWindow = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
if (pWindow)
g_windowManager.ShowOverlay(pWindow->GetOverlayState());
CGUIWindow::OnMessage(message);
return true;
}
case GUI_MSG_WINDOW_INIT:
{
CGUIWindow::OnMessage(message);
m_showStartTime = 0;
return true;
}
}
return CGUIWindow::OnMessage(message);
}
示例12: OnMoveToBack
void CMyPicture::OnMoveToBack()
{
//Se selecciona un elemento
std::string name_window = CORE->GetGUIManager()->GetCurrentWindow();
CGUIWindow *window = CORE->GetGUIManager()->GetWindow(name_window);
CGuiElement *element = NULL;
//Mira sobre qué elemento está el mouse
uint16 count = window->GetNumElements();
for( uint16 i = count; i > 0; --i)
{
element = window->GetElementById(i-1);
Vect2i mousePosition;
CORE->GetInputManager()->GetPosition(IDV_MOUSE, mousePosition);
element->CalculatePosMouse(mousePosition);
if( element->IsInside() )
{
//Está adentro
window->MoveElementToBack(element);
break;
}
}
}
示例13: GetWindow
void CGUIWindowManager::DumpTextureUse()
{
/*
参数:
1、
返回:
1、
说明:
1、
*/
CGUIWindow* pWindow = GetWindow(GetActiveWindow());
if (pWindow)
pWindow->DumpTextureUse();
CSingleLock lock(g_graphicsContext);
for (iDialog it = m_activeDialogs.begin(); it != m_activeDialogs.end(); ++it)
{
if ((*it)->IsDialogRunning())
(*it)->DumpTextureUse();
}
}
示例14: assert
void CGUIWindowManager::FrameMove()
{
/*
参数:
1、
返回:
1、
说明:
1、
*/
assert(g_application.IsCurrentThread());
CSingleLock lock(g_graphicsContext);
if(m_iNested == 0)
{
// delete any windows queued for deletion
for(iDialog it = m_deleteWindows.begin(); it != m_deleteWindows.end(); it++)
{
// Free any window resources
(*it)->FreeResources(true);
delete *it;
}
m_deleteWindows.clear();
}
CGUIWindow* pWindow = GetWindow(GetActiveWindow());
if (pWindow)
pWindow->FrameMove();
// update any dialogs - we take a copy of the vector as some dialogs may close themselves
// during this call
vector<CGUIWindow *> dialogs = m_activeDialogs;
for (iDialog it = dialogs.begin(); it != dialogs.end(); ++it)
(*it)->FrameMove();
}
示例15: lock
bool CGUIWindowManager::OnAction(const CAction &action)
{
CSingleLock lock(g_graphicsContext);
unsigned int topMost = m_activeDialogs.size();
while (topMost)
{
CGUIWindow *dialog = m_activeDialogs[--topMost];
lock.Leave();
if (dialog->IsModalDialog())
{ // we have the topmost modal dialog
if (!dialog->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
{
bool fallThrough = (dialog->GetID() == WINDOW_DIALOG_FULLSCREEN_INFO);
if (dialog->OnAction(action))
return true;
// dialog didn't want the action - we'd normally return false
// but for some dialogs we want to drop the actions through
if (fallThrough)
break;
return false;
}
return true; // do nothing with the action until the anim is finished
}
// music or video overlay are handled as a special case, as they're modeless, but we allow
// clicking on them with the mouse.
if (action.IsMouse() && (dialog->GetID() == WINDOW_DIALOG_VIDEO_OVERLAY ||
dialog->GetID() == WINDOW_DIALOG_MUSIC_OVERLAY))
{
if (dialog->OnAction(action))
return true;
}
lock.Enter();
if (topMost > m_activeDialogs.size())
topMost = m_activeDialogs.size();
}
lock.Leave();
CGUIWindow* window = GetWindow(GetActiveWindow());
if (window)
return window->OnAction(action);
return false;
}