VirtualBox

Changeset 30347 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 21, 2010 5:44:06 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: New running VM core: no need to pass render-mode everywhere as its available through vboxGlobal().

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r30291 r30347  
    110110
    111111UIMachineView* UIMachineView::create(  UIMachineWindow *pMachineWindow
    112                                      , VBoxDefs::RenderMode renderMode
    113112#ifdef VBOX_WITH_VIDEOHWACCEL
    114113                                     , bool bAccelerate2DVideo
     
    122121        case UIVisualStateType_Normal:
    123122            view = new UIMachineViewNormal(  pMachineWindow
    124                                            , renderMode
    125123#ifdef VBOX_WITH_VIDEOHWACCEL
    126124                                           , bAccelerate2DVideo
     
    130128        case UIVisualStateType_Fullscreen:
    131129            view = new UIMachineViewFullscreen(  pMachineWindow
    132                                                , renderMode
    133130#ifdef VBOX_WITH_VIDEOHWACCEL
    134131                                               , bAccelerate2DVideo
     
    138135        case UIVisualStateType_Seamless:
    139136            view = new UIMachineViewSeamless(  pMachineWindow
    140                                              , renderMode
    141137#ifdef VBOX_WITH_VIDEOHWACCEL
    142138                                             , bAccelerate2DVideo
     
    196192
    197193UIMachineView::UIMachineView(  UIMachineWindow *pMachineWindow
    198                              , VBoxDefs::RenderMode renderMode
    199194#ifdef VBOX_WITH_VIDEOHWACCEL
    200195                             , bool bAccelerate2DVideo
     
    205200    : QAbstractScrollArea(pMachineWindow->machineWindow())
    206201    , m_pMachineWindow(pMachineWindow)
    207     , m_mode(renderMode)
    208202    , m_uScreenId(uScreenId)
    209203    , m_globalSettings(vboxGlobal().settings())
     
    464458#ifdef VBOX_GUI_USE_QGLFB
    465459    QWidget *pViewport;
    466     switch (mode())
     460    switch (vboxGlobal().vmRenderMode())
    467461    {
    468462        case VBoxDefs::QGLMode:
     
    481475    m_pFrameBuffer = NULL;
    482476
    483     switch (mode())
     477    switch (vboxGlobal().vmRenderMode())
    484478    {
    485479#ifdef VBOX_GUI_USE_QIMAGE
     
    590584#endif /* VBOX_GUI_USE_QUARTZ2D */
    591585        default:
    592             AssertReleaseMsgFailed(("Render mode must be valid: %d\n", mode()));
    593             LogRel(("Invalid render mode: %d\n", mode()));
     586            AssertReleaseMsgFailed(("Render mode must be valid: %d\n", vboxGlobal().vmRenderMode()));
     587            LogRel(("Invalid render mode: %d\n", vboxGlobal().vmRenderMode()));
    594588            qApp->exit(1);
    595589            break;
     
    11611155        case KMachineState_TeleportingPausedVM:
    11621156        {
    1163             if (mode() != VBoxDefs::TimerMode &&  m_pFrameBuffer &&
     1157            if (vboxGlobal().vmRenderMode() != VBoxDefs::TimerMode &&  m_pFrameBuffer &&
    11641158                (state != KMachineState_TeleportingPausedVM || m_previousState != KMachineState_Teleporting))
    11651159            {
     
    11981192                || m_previousState == KMachineState_Restoring)
    11991193            {
    1200                 if (mode() != VBoxDefs::TimerMode && m_pFrameBuffer)
     1194                if (vboxGlobal().vmRenderMode() != VBoxDefs::TimerMode && m_pFrameBuffer)
    12011195                {
    12021196                    /* Reset the pixmap to free memory: */
     
    17101704    {
    17111705#if 0 // TODO: Move that to fullscreen event-hjadler:
    1712         if (mode() != VBoxDefs::SDLMode)
     1706        if (vboxGlobal().vmRenderMode() != VBoxDefs::SDLMode)
    17131707        {
    17141708            /* try to automatically scroll the guest canvas if the
     
    17371731            int vw = visibleWidth(), vh = visibleHeight();
    17381732
    1739             if (mode() != VBoxDefs::SDLMode)
     1733            if (vboxGlobal().vmRenderMode() != VBoxDefs::SDLMode)
    17401734            {
    17411735                /* Try to automatically scroll the guest canvas if the
     
    18331827
    18341828#ifdef VBOX_GUI_USE_QUARTZ2D
    1835     if (mode() == VBoxDefs::Quartz2DMode && m_pFrameBuffer)
     1829    if (vboxGlobal().vmRenderMode() == VBoxDefs::Quartz2DMode && m_pFrameBuffer)
    18361830    {
    18371831        m_pFrameBuffer->paintEvent(pPaintEvent);
     
    26782672    {
    26792673# ifdef VBOX_GUI_USE_QUARTZ2D
    2680         if (mode() == VBoxDefs::Quartz2DMode)
     2674        if (vboxGlobal().vmRenderMode() == VBoxDefs::Quartz2DMode)
    26812675        {
    26822676            /* If the render mode is Quartz2D we could use the CGImageRef
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r29816 r30347  
    5050    /* Factory function to create required view sub-child: */
    5151    static UIMachineView* create(  UIMachineWindow *pMachineWindow
    52                                  , VBoxDefs::RenderMode renderMode
    5352#ifdef VBOX_WITH_VIDEOHWACCEL
    5453                                 , bool bAccelerate2DVideo
     
    8382    /* Machine view constructor/destructor: */
    8483    UIMachineView(  UIMachineWindow *pMachineWindow
    85                   , VBoxDefs::RenderMode renderMode
    8684#ifdef VBOX_WITH_VIDEOHWACCEL
    8785                  , bool bAccelerate2DVideo
     
    10098    int visibleWidth() const;
    10199    int visibleHeight() const;
    102     VBoxDefs::RenderMode mode() const { return m_mode; }
    103100    ulong screenId() const { return m_uScreenId; }
    104101    UIFrameBuffer* frameBuffer() const { return m_pFrameBuffer; }
     
    217214    /* Private members: */
    218215    UIMachineWindow *m_pMachineWindow;
    219     VBoxDefs::RenderMode m_mode;
    220216    ulong m_uScreenId;
    221217    const VBoxGlobalSettings &m_globalSettings;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r30291 r30347  
    3131
    3232/* Local includes */
     33#include "VBoxGlobal.h"
    3334#include "UISession.h"
    3435#include "UIActionsPool.h"
     
    4041
    4142UIMachineViewFullscreen::UIMachineViewFullscreen(  UIMachineWindow *pMachineWindow
    42                                                  , VBoxDefs::RenderMode renderMode
    4343#ifdef VBOX_WITH_VIDEOHWACCEL
    4444                                                 , bool bAccelerate2DVideo
     
    4646                                                 , ulong uMonitor)
    4747    : UIMachineView(  pMachineWindow
    48                     , renderMode
    4948#ifdef VBOX_WITH_VIDEOHWACCEL
    5049                    , bAccelerate2DVideo
     
    379378     * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.
    380379     * In all other modes, or when auto-resize is in force, this function does nothing. */
    381     if (mode() == VBoxDefs::SDLMode)
     380    if (vboxGlobal().vmRenderMode() == VBoxDefs::SDLMode)
    382381    {
    383382        if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r28800 r30347  
    2929protected:
    3030
    31     /* Normal machine view constructor/destructor: */
     31    /* Fullscreen machine-view constructor/destructor: */
    3232    UIMachineViewFullscreen(  UIMachineWindow *pMachineWindow
    33                             , VBoxDefs::RenderMode renderMode
    3433#ifdef VBOX_WITH_VIDEOHWACCEL
    3534                            , bool bAccelerate2DVideo
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r30213 r30347  
    213213
    214214    m_pMachineView = UIMachineView::create(  this
    215                                            , vboxGlobal().vmRenderMode()
    216215#ifdef VBOX_WITH_VIDEOHWACCEL
    217216                                           , bAccelerate2DVideo
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r30291 r30347  
    3636
    3737UIMachineViewNormal::UIMachineViewNormal(  UIMachineWindow *pMachineWindow
    38                                          , VBoxDefs::RenderMode renderMode
    3938#ifdef VBOX_WITH_VIDEOHWACCEL
    4039                                         , bool bAccelerate2DVideo
     
    4241                                         , ulong uMonitor)
    4342    : UIMachineView(  pMachineWindow
    44                     , renderMode
    4543#ifdef VBOX_WITH_VIDEOHWACCEL
    4644                    , bAccelerate2DVideo
     
    420418            availableGeo = dwt->availableGeometry(pTopLevelWidget->pos());
    421419
    422         frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo, mode() != VBoxDefs::SDLMode /* can resize? */);
     420        frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo, vboxGlobal().vmRenderMode() != VBoxDefs::SDLMode /* can resize? */);
    423421    }
    424422
     
    464462     * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.
    465463     * In all other modes, or when auto-resize is in force, this function does nothing. */
    466     if (mode() == VBoxDefs::SDLMode)
     464    if (vboxGlobal().vmRenderMode() == VBoxDefs::SDLMode)
    467465    {
    468466        if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h

    r30291 r30347  
    2929protected:
    3030
    31     /* Normal machine view constructor/destructor: */
     31    /* Normal machine-view constructor/destructor: */
    3232    UIMachineViewNormal(  UIMachineWindow *pMachineWindow
    33                         , VBoxDefs::RenderMode renderMode
    3433#ifdef VBOX_WITH_VIDEOHWACCEL
    3534                        , bool bAccelerate2DVideo
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r30213 r30347  
    473473
    474474    m_pMachineView = UIMachineView::create(  this
    475                                            , vboxGlobal().vmRenderMode()
    476475#ifdef VBOX_WITH_VIDEOHWACCEL
    477476                                           , bAccelerate2DVideo
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp

    r30291 r30347  
    4040
    4141UIMachineViewSeamless::UIMachineViewSeamless(  UIMachineWindow *pMachineWindow
    42                                              , VBoxDefs::RenderMode renderMode
    4342#ifdef VBOX_WITH_VIDEOHWACCEL
    4443                                             , bool bAccelerate2DVideo
     
    4645                                             , ulong uMonitor)
    4746    : UIMachineView(  pMachineWindow
    48                     , renderMode
    4947#ifdef VBOX_WITH_VIDEOHWACCEL
    5048                    , bAccelerate2DVideo
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h

    r28800 r30347  
    2929protected:
    3030
    31     /* Seamless machine view constructor/destructor: */
     31    /* Seamless machine-view constructor/destructor: */
    3232    UIMachineViewSeamless(  UIMachineWindow *pMachineWindow
    33                           , VBoxDefs::RenderMode renderMode
    3433#ifdef VBOX_WITH_VIDEOHWACCEL
    3534                          , bool bAccelerate2DVideo
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r30213 r30347  
    264264
    265265    m_pMachineView = UIMachineView::create(  this
    266                                            , vboxGlobal().vmRenderMode()
    267266#ifdef VBOX_WITH_VIDEOHWACCEL
    268267                                           , bAccelerate2DVideo
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette