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


C++ OSFactory类代码示例

本文整理汇总了C++中OSFactory的典型用法代码示例。如果您正苦于以下问题:C++ OSFactory类的具体用法?C++ OSFactory怎么用?C++ OSFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OSFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void Tooltip::CmdShow::execute()
{
    if( m_pParent->m_pImage )
    {
        if( m_pParent->m_xPos == -1 )
        {
            // Get the mouse coordinates and the image size
            OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() );
            int x, y;
            pOsFactory->getMousePos( x, y );
            int scrWidth = pOsFactory->getScreenWidth();
            int scrHeight = pOsFactory->getScreenHeight();
            int w = m_pParent->m_pImage->getWidth();
            int h = m_pParent->m_pImage->getHeight();

            // Compute the position of the tooltip
            x -= (w / 2 + 4);
            y += (h + 5);
            if( x + w > scrWidth )
                x -= (x + w - scrWidth);
            else if( x < 0 )
                x = 0;
            if( y + h > scrHeight )
                y -= (2 * h + 20);

            m_pParent->m_xPos = x;
            m_pParent->m_yPos = y;
        }

        // Show the tooltip window
        m_pParent->m_pOsTooltip->show( m_pParent->m_xPos, m_pParent->m_yPos,
                                   *(m_pParent->m_pImage) );
    }
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:34,代码来源:tooltip.cpp

示例2: CtrlGeneric

CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
                        const GenericBitmap &rBmpOver,
                        const GenericBitmap &rBmpDown, CmdGeneric &rCommand,
                        const UString &rTooltip, const UString &rHelp,
                        VarBool *pVisible ):
    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
    m_rCommand( rCommand ), m_tooltip( rTooltip ),
    m_cmdUpOverDownOver( this, &transUpOverDownOver ),
    m_cmdDownOverUpOver( this, &transDownOverUpOver ),
    m_cmdDownOverDown( this, &transDownOverDown ),
    m_cmdDownDownOver( this, &transDownDownOver ),
    m_cmdUpOverUp( this, &transUpOverUp ),
    m_cmdUpUpOver( this, &transUpUpOver ),
    m_cmdDownUp( this, &transDownUp ),
    m_cmdUpHidden( this, &transUpHidden ),
    m_cmdHiddenUp( this, &transHiddenUp )
{
    // Build the images of the button
    OSFactory *pOsFactory = OSFactory::instance( pIntf );
    m_pImgUp = pOsFactory->createOSGraphics( rBmpUp.getWidth(),
                                             rBmpUp.getHeight() );
    m_pImgUp->drawBitmap( rBmpUp, 0, 0 );
    m_pImgDown = pOsFactory->createOSGraphics( rBmpDown.getWidth(),
                                               rBmpDown.getHeight() );
    m_pImgDown->drawBitmap( rBmpDown, 0, 0 );
    m_pImgOver = pOsFactory->createOSGraphics( rBmpOver.getWidth(),
                                               rBmpOver.getHeight() );
    m_pImgOver->drawBitmap( rBmpOver, 0, 0 );

    // States
    m_fsm.addState( "up" );
    m_fsm.addState( "down" );
    m_fsm.addState( "upOver" );
    m_fsm.addState( "downOver" );
    m_fsm.addState( "hidden" );

    // Transitions
    m_fsm.addTransition( "upOver", "mouse:left:down", "downOver",
                         &m_cmdUpOverDownOver );
    m_fsm.addTransition( "upOver", "mouse:left:dblclick", "downOver",
                         &m_cmdUpOverDownOver );
    m_fsm.addTransition( "downOver", "mouse:left:up", "upOver",
                         &m_cmdDownOverUpOver );
    m_fsm.addTransition( "downOver", "leave", "down", &m_cmdDownOverDown );
    m_fsm.addTransition( "down", "enter", "downOver", &m_cmdDownDownOver );
    m_fsm.addTransition( "upOver", "leave", "up", &m_cmdUpOverUp );
    m_fsm.addTransition( "up", "enter", "upOver", &m_cmdUpUpOver );
    m_fsm.addTransition( "down", "mouse:left:up", "up", &m_cmdDownUp );
    // XXX: It would be easy to use a "ANY" initial state to handle these
    // four lines in only one. But till now it isn't worthwhile...
    m_fsm.addTransition( "up", "special:hide", "hidden", &m_cmdUpHidden );
    m_fsm.addTransition( "down", "special:hide", "hidden", &m_cmdUpHidden );
    m_fsm.addTransition( "upOver", "special:hide", "hidden", &m_cmdUpHidden );
    m_fsm.addTransition( "downOver", "special:hide", "hidden", &m_cmdUpHidden );
    m_fsm.addTransition( "hidden", "special:show", "up", &m_cmdHiddenUp );

    // Initial state
    m_fsm.setState( "up" );
    m_pImg = m_pImgUp;
}
开发者ID:forthyen,项目名称:SDesk,代码行数:60,代码来源:ctrl_button.cpp

示例3: SkinObject

GenericWindow::GenericWindow( intf_thread_t *pIntf, int left, int top,
                              bool dragDrop, bool playOnDrop,
                              GenericWindow *pParent, WindowType_t type ):
    SkinObject( pIntf ), m_type( type ), m_left( left ), m_top( top ),
    m_width( 0 ), m_height( 0 ), m_pVarVisible( NULL )
{
    // Get the OSFactory
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );

    // Get the parent OSWindow, if any
    OSWindow *pOSParent = NULL;
    if( pParent )
    {
        pOSParent = pParent->m_pOsWindow;
    }

    // Create an OSWindow to handle OS specific processing
    m_pOsWindow = pOsFactory->createOSWindow( *this, dragDrop, playOnDrop,
                                              pOSParent, type );

    // Create the visibility variable and register it in the manager
    m_pVarVisible = new VarBoolImpl( pIntf );
    VarManager::instance( pIntf )->registerVar( VariablePtr( m_pVarVisible ) );

    // Observe the visibility variable
    m_pVarVisible->addObserver( this );
}
开发者ID:mstorsjo,项目名称:vlc,代码行数:27,代码来源:generic_window.cpp

示例4: CtrlGeneric

CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf,
                                    const GenericBitmap &rBmpSeq, int numImg,
                                    VarPercent &rVariable, float minAngle,
                                    float maxAngle, const UString &rHelp,
                                    VarBool *pVisible ):
    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_numImg( numImg ),
    m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ),
    m_cmdUpDown( this ), m_cmdDownUp( this ),
    m_cmdMove( this )
{
    // Build the images of the sequence
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );
    m_pImgSeq = pOsFactory->createOSGraphics( rBmpSeq.getWidth(),
                                              rBmpSeq.getHeight() );
    m_pImgSeq->drawBitmap( rBmpSeq, 0, 0 );

    m_width = rBmpSeq.getWidth();
    m_height = rBmpSeq.getHeight() / numImg;

    // States
    m_fsm.addState( "up" );
    m_fsm.addState( "down" );

    // Transitions
    m_fsm.addTransition( "up", "mouse:left:down", "down", &m_cmdUpDown );
    m_fsm.addTransition( "down", "mouse:left:up", "up", &m_cmdDownUp );
    m_fsm.addTransition( "down", "motion", "down", &m_cmdMove );

    // Initial state
    m_fsm.setState( "up" );

    // Observe the variable
    m_rVariable.addObserver( this );
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:34,代码来源:ctrl_radialslider.cpp

示例5: SkinObject

ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
{
    vlc_value_t val, text;

    // Create a variable to add items in wxwindows popup menu
    var_Create( pIntf, "intf-skins", VLC_VAR_STRING |
                VLC_VAR_HASCHOICE | VLC_VAR_ISCOMMAND );
    text.psz_string = _("Select skin");
    var_Change( pIntf, "intf-skins", VLC_VAR_SETTEXT, &text, NULL );

    // Scan vlt files in the resource path
    OSFactory *pOsFactory = OSFactory::instance( pIntf );
    list<string> resPath = pOsFactory->getResourcePath();
    list<string>::const_iterator it;
    for( it = resPath.begin(); it != resPath.end(); it++ )
    {
        parseDirectory( *it );
    }

    // Set the callback
    var_AddCallback( pIntf, "intf-skins", changeSkin, this );


    // variable for opening a dialog box to change skins
    var_Create( pIntf, "intf-skins-interactive", VLC_VAR_VOID |
                VLC_VAR_ISCOMMAND );
    text.psz_string = _("Open skin ...");
    var_Change( pIntf, "intf-skins-interactive", VLC_VAR_SETTEXT, &text, NULL );

    // Set the callback
    var_AddCallback( pIntf, "intf-skins-interactive", changeSkin, this );

}
开发者ID:Kafay,项目名称:vlc,代码行数:33,代码来源:theme_repository.cpp

示例6: getIntf

void SkinParser::getRefDimensions( int &rWidth, int &rHeight, bool toScreen )
{
    if( toScreen )
    {
        OSFactory *pOsFactory = OSFactory::instance( getIntf() );
        rWidth = pOsFactory->getScreenWidth();
        rHeight = pOsFactory->getScreenHeight();
        return;
    }

    string panelId = m_panelStack.back();
    if( panelId != "none" )
    {
        list<BuilderData::Panel>::const_iterator it;
        for( it = m_pData->m_listPanel.begin();
             it != m_pData->m_listPanel.end(); ++it )
        {
            if( it->m_id == panelId )
            {
                rWidth = it->m_width;
                rHeight = it->m_height;
                return;
            }
        }
    }
    else
    {
        const BuilderData::Layout layout = m_pData->m_listLayout.back();
        rWidth = layout.m_width;
        rHeight = layout.m_height;
        return;
    }
    msg_Err( getIntf(), "failure to retrieve parent panel or layout" );
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:34,代码来源:skin_parser.cpp

示例7: var_InheritInteger

void VoutManager::configureFullscreen( VoutWindow& rWindow )
{
    int numScr = var_InheritInteger( getIntf(), "qt-fullscreen-screennumber" );
    int x0 = m_pVoutMainWindow->getTop();
    int y0 = m_pVoutMainWindow->getLeft();

    int x, y, w, h;
    if( numScr >= 0 )
    {
        // select screen requested by user
        OSFactory *pOsFactory = OSFactory::instance( getIntf() );
        pOsFactory->getMonitorInfo( numScr, &x, &y, &w, &h );
    }
    else
    {
        // select screen where display is already occurring
        rWindow.getMonitorInfo( &x, &y, &w, &h );
    }

    if( x != x0 || y != y0 )
    {
        // move and resize fullscreen
        m_pVoutMainWindow->move( x, y );
        m_pVoutMainWindow->resize( w, h );

        // ensure the fs controller is also moved
        if( m_pFscWindow )
        {
            m_pFscWindow->moveTo( x, y, w, h );
        }
    }
}
开发者ID:Aakash-729,项目名称:vlc,代码行数:32,代码来源:vout_manager.cpp

示例8: getIntf

void CmdExitLoop::execute()
{
    // Get the instance of OSFactory
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );

    // Exit the main OS loop
    pOsFactory->getOSLoop()->exit();
}
开发者ID:371816210,项目名称:vlc_vlc,代码行数:8,代码来源:cmd_quit.cpp

示例9: msg_Dbg

void VoutManager::hideMouseWnd( vout_window_t *pWnd, bool hide )
{
    msg_Dbg( pWnd, "hide mouse (%i) received from vout thread", hide );
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );
    if( hide )
        pOsFactory->changeCursor( OSFactory::kNoCursor );
    else
        pOsFactory->changeCursor( OSFactory::kDefaultArrow );
}
开发者ID:mstorsjo,项目名称:vlc,代码行数:9,代码来源:vout_manager.cpp

示例10: SkinObject

Popup::Popup( intf_thread_t *pIntf, WindowManager &rWindowManager )
    : SkinObject( pIntf ), m_rWindowManager( rWindowManager )
{
    // Get the OSFactory
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );

    // Create an OSPopup to handle OS specific processing
    m_pOsPopup = pOsFactory->createOSPopup();
}
开发者ID:qdk0901,项目名称:vlc,代码行数:9,代码来源:popup.cpp

示例11: CtrlGeneric

CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
                                    const GenericBitmap &rBmpUp,
                                    const GenericBitmap &rBmpOver,
                                    const GenericBitmap &rBmpDown,
                                    const Bezier &rCurve,
                                    VarPercent &rVariable,
                                    VarBool *pVisible,
                                    const UString &rTooltip,
                                    const UString &rHelp ):
    CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
    m_rVariable( rVariable ), m_tooltip( rTooltip ),
    m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ),
    m_cmdOverDown( this, &transOverDown ),
    m_cmdDownOver( this, &transDownOver ), m_cmdOverUp( this, &transOverUp ),
    m_cmdUpOver( this, &transUpOver ), m_cmdMove( this, &transMove ),
    m_cmdScroll( this, &transScroll ),
    m_lastPercentage( 0 ), m_xOffset( 0 ), m_yOffset( 0 ),
    m_pEvt( NULL ), m_rCurve( rCurve )
{
    // Build the images of the cursor
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );
    m_pImgUp = pOsFactory->createOSGraphics( rBmpUp.getWidth(),
               rBmpUp.getHeight() );
    m_pImgUp->drawBitmap( rBmpUp, 0, 0 );
    m_pImgDown = pOsFactory->createOSGraphics( rBmpDown.getWidth(),
                 rBmpDown.getHeight() );
    m_pImgDown->drawBitmap( rBmpDown, 0, 0 );
    m_pImgOver = pOsFactory->createOSGraphics( rBmpOver.getWidth(),
                 rBmpOver.getHeight() );
    m_pImgOver->drawBitmap( rBmpOver, 0, 0 );

    // States
    m_fsm.addState( "up" );
    m_fsm.addState( "over" );
    m_fsm.addState( "down" );

    // Transitions
    m_fsm.addTransition( "over", "mouse:left:down", "down",
                         &m_cmdOverDown );
    m_fsm.addTransition( "down", "mouse:left:up", "over",
                         &m_cmdDownOver );
    m_fsm.addTransition( "over", "leave", "up", &m_cmdOverUp );
    m_fsm.addTransition( "up", "enter", "over", &m_cmdUpOver );
    m_fsm.addTransition( "down", "motion", "down", &m_cmdMove );
    m_fsm.addTransition( "over", "scroll", "over", &m_cmdScroll );

    // Initial state
    m_fsm.setState( "up" );
    m_pImg = m_pImgUp;

    // Observe the position variable
    m_rVariable.addObserver( this );

    // Initial position of the cursor
    m_lastPercentage = m_rVariable.get();
}
开发者ID:sdelmas,项目名称:SDesk,代码行数:56,代码来源:ctrl_slider.cpp

示例12: SkinObject

Tooltip::Tooltip( intf_thread_t *pIntf, const GenericFont &rFont, int delay ):
    SkinObject( pIntf ), m_rFont( rFont ), m_delay( delay ), m_pImage( NULL ),
    m_xPos( -1 ), m_yPos( -1 ), m_cmdShow( this )
{
    OSFactory *pOsFactory = OSFactory::instance( pIntf );
    m_pTimer = pOsFactory->createOSTimer( m_cmdShow );
    m_pOsTooltip = pOsFactory->createOSTooltip();

    // Observe the tooltip text variable
    VarManager::instance( pIntf )->getTooltipText().addObserver( this );
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:11,代码来源:tooltip.cpp

示例13: CtrlFlat

CtrlImage::CtrlImage( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
                      CmdGeneric &rCommand, resize_t resizeMethod,
                      const UString &rHelp, VarBool *pVisible ):
    CtrlFlat( pIntf, rHelp, pVisible ), m_rBitmap( rBitmap ),
    m_rCommand( rCommand ), m_resizeMethod( resizeMethod )
{
    OSFactory *pOsFactory = OSFactory::instance( pIntf );
    // Create an initial unscaled image in the buffer
    m_pImage = pOsFactory->createOSGraphics( rBitmap.getWidth(),
                                             rBitmap.getHeight() );
    m_pImage->drawBitmap( m_rBitmap );
}
开发者ID:FLYKingdom,项目名称:vlc,代码行数:12,代码来源:ctrl_image.cpp

示例14: getIntf

string ThemeLoader::fixDirSeparators( const string &rPath )
{
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );
    const string &sep = pOsFactory->getDirSeparator();
    string::size_type p = rPath.find( "/", 0 );
    string newPath = rPath;
    while( p != string::npos )
    {
        newPath = newPath.replace( p, 1, sep );
        p = newPath.find( "/", p + 1 );
    }
    return newPath;
}
开发者ID:paa,项目名称:vlc,代码行数:13,代码来源:theme_loader.cpp

示例15: SkinObject

AsyncQueue::AsyncQueue( intf_thread_t *pIntf ): SkinObject( pIntf ),
    m_cmdFlush( this )
{
    // Initialize the mutex
    vlc_mutex_init( &m_lock );

    // Create a timer
    OSFactory *pOsFactory = OSFactory::instance( pIntf );
    m_pTimer = pOsFactory->createOSTimer( m_cmdFlush );

    // Flush the queue every 10 ms
    m_pTimer->start( 10, false );
}
开发者ID:mstorsjo,项目名称:vlc,代码行数:13,代码来源:async_queue.cpp


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