本文整理汇总了C++中Theme::getWindowManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Theme::getWindowManager方法的具体用法?C++ Theme::getWindowManager怎么用?C++ Theme::getWindowManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Theme
的用法示例。
在下文中一共展示了Theme::getWindowManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
bool ThemeLoader::load( const string &fileName )
{
string path = getFilePath( fileName );
//Before all, let's see if the file is present
struct stat p_stat;
if( vlc_stat( path.c_str(), &p_stat ) )
return false;
// First, we try to un-targz the file, and if it fails we hope it's a XML
// file...
#if defined( HAVE_ZLIB_H )
if( ! extract( sToLocale( fileName ) ) && ! parse( path, fileName ) )
return false;
#else
if( ! parse( path, fileName ) )
return false;
#endif
Theme *pNewTheme = getIntf()->p_sys->p_theme;
if( !pNewTheme )
{
return false;
}
// Check if the skin to load is in the config file, to load its config
char *skin_last = config_GetPsz( getIntf(), "skins2-last" );
if( skin_last != NULL && fileName == (string)skin_last )
{
// Restore the theme configuration
getIntf()->p_sys->p_theme->loadConfig();
// Used to anchor the windows at the beginning
pNewTheme->getWindowManager().stopMove();
}
else
{
config_PutPsz( getIntf(), "skins2-last", fileName.c_str() );
// Show the windows
pNewTheme->getWindowManager().showAll( true );
}
free( skin_last );
return true;
}
示例2: execute
void CmdChangeSkin::execute()
{
// Save the old theme to restore it in case of problem
Theme *pOldTheme = getIntf()->p_sys->p_theme;
if( pOldTheme )
{
pOldTheme->getWindowManager().saveVisibility();
pOldTheme->getWindowManager().hideAll();
}
VoutManager::instance( getIntf() )->saveVoutConfig();
ThemeLoader loader( getIntf() );
if( loader.load( m_file ) )
{
// Everything went well
msg_Info( getIntf(), "new theme successfully loaded (%s)",
m_file.c_str() );
delete pOldTheme;
// restore vout config
VoutManager::instance( getIntf() )->restoreVoutConfig( true );
}
else if( pOldTheme )
{
msg_Warn( getIntf(), "a problem occurred when loading the new theme,"
" restoring the previous one" );
getIntf()->p_sys->p_theme = pOldTheme;
VoutManager::instance( getIntf() )->restoreVoutConfig( false );
pOldTheme->getWindowManager().restoreVisibility();
}
else
{
msg_Err( getIntf(), "cannot load the theme, aborting" );
// Quit
CmdQuit cmd( getIntf() );
cmd.execute();
}
// update the repository
ThemeRepository::instance( getIntf() )->updateRepository();
}