当前位置: 首页>>代码示例>>C++>>正文


C++ Theme::getWindowManager方法代码示例

本文整理汇总了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;
}
开发者ID:paa,项目名称:vlc,代码行数:45,代码来源:theme_loader.cpp

示例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();
}
开发者ID:0xheart0,项目名称:vlc,代码行数:43,代码来源:cmd_change_skin.cpp


注:本文中的Theme::getWindowManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。