VirtualBox

Changeset 46020 in vbox


Ignore:
Timestamp:
May 13, 2013 3:09:16 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85687
Message:

FE/Qt: 6749: Removing obsolete SDL support code.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r46017 r46020  
    6060          InvalidRenderMode
    6161        , QImageMode
    62         , SDLMode
    6362        , Quartz2DMode
    6463    };
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r46016 r46020  
    200200#elif (defined (Q_WS_WIN32) || defined (Q_WS_PM) || defined (Q_WS_X11)) && defined (VBOX_GUI_USE_QIMAGE)
    201201    mode = QImageMode;
    202 #elif defined (Q_WS_X11) && defined (VBOX_GUI_USE_SDL)
    203     mode = SDLMode;
    204202#elif defined (VBOX_GUI_USE_QIMAGE)
    205203    mode = QImageMode;
     
    211209    {
    212210        if (0) ;
    213 #if defined (VBOX_GUI_USE_QIMAGE)
     211#ifdef VBOX_GUI_USE_QIMAGE
    214212        else if (::strcmp (aModeStr, "image") == 0)
    215213            mode = QImageMode;
    216 #endif
    217 #if defined (VBOX_GUI_USE_SDL)
    218         else if (::strcmp (aModeStr, "sdl") == 0)
    219             mode = SDLMode;
    220 #endif
    221 #if defined (VBOX_GUI_USE_QUARTZ2D)
     214#endif /* VBOX_GUI_USE_QIMAGE */
     215#ifdef VBOX_GUI_USE_QUARTZ2D
    222216        else if (::strcmp (aModeStr, "quartz2d") == 0)
    223217            mode = Quartz2DMode;
    224 #endif
     218#endif /* VBOX_GUI_USE_QUARTZ2D */
    225219    }
    226220
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r46005 r46020  
    223223{
    224224    QString mode = "", dflt = "";
    225 #ifdef VBOX_GUI_USE_SDL
    226     mode += "sdl";
    227 #endif
    228225#ifdef VBOX_GUI_USE_QIMAGE
    229226    if (!mode.isEmpty())
    230227        mode += "|";
    231228    mode += "image";
    232 #endif
     229#endif /* VBOX_GUI_USE_QIMAGE */
    233230#ifdef VBOX_GUI_USE_QUARTZ2D
    234231    if (!mode.isEmpty())
    235232        mode += "|";
    236233    mode += "quartz2d";
    237 #endif
     234#endif /* VBOX_GUI_USE_QUARTZ2D */
    238235#if defined (Q_WS_MAC) && defined (VBOX_GUI_USE_QUARTZ2D)
    239236    dflt = "quartz2d";
    240 #elif (defined (Q_WS_WIN32) || defined (Q_WS_PM) || defined(Q_WS_X11)) && defined (VBOX_GUI_USE_QIMAGE)
     237#elif (defined (Q_WS_WIN) || defined(Q_WS_X11)) && defined (VBOX_GUI_USE_QIMAGE)
    241238    dflt = "image";
    242 #elif defined (Q_WS_X11) && defined (VBOX_GUI_USE_SDL)
    243     dflt = "sdl";
    244239#else
    245240    dflt = "image";
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r46017 r46020  
    3737#include "UIFrameBufferQImage.h"
    3838#include "UIFrameBufferQuartz2D.h"
    39 #include "UIFrameBufferSDL.h"
    4039#include "VBoxFBOverlay.h"
    4140#include "UISession.h"
     
    333332        }
    334333#endif /* VBOX_GUI_USE_QIMAGE */
    335 
    336 #ifdef VBOX_GUI_USE_SDL
    337         case SDLMode:
    338         {
    339             /* Indicate that we are doing all drawing stuff ourself: */
    340             // TODO_NEW_CORE
    341             viewport()->setAttribute(Qt::WA_PaintOnScreen);
    342 # ifdef Q_WS_X11
    343             /* This is somehow necessary to prevent strange X11 warnings on i386 and segfaults on x86_64: */
    344             XFlush(QX11Info::display());
    345 # endif /* Q_WS_X11 */
    346             UIFrameBuffer* pFrameBuffer = uisession()->frameBuffer(screenId());
    347             if (pFrameBuffer)
    348                 pFrameBuffer->setView(this);
    349             else
    350             {
    351 # if defined(VBOX_WITH_VIDEOHWACCEL) && defined(DEBUG_misha) /* not tested yet */
    352                 if (m_fAccelerate2DVideo)
    353                 {
    354                     /** these two additional template args is a workaround to
    355                      * this [VBox|UI] duplication
    356                      * @todo: they are to be removed once VBox stuff is gone */
    357                     pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &session(), (uint32_t)screenId());
    358                 }
    359                 else
    360                     pFrameBuffer = new UIFrameBufferSDL(this);
    361 # else /* VBOX_WITH_VIDEOHWACCEL */
    362                 pFrameBuffer = new UIFrameBufferSDL(this);
    363 # endif /* !VBOX_WITH_VIDEOHWACCEL */
    364                 uisession()->setFrameBuffer(screenId(), pFrameBuffer);
    365             }
    366             m_pFrameBuffer = pFrameBuffer;
    367             /* Disable scrollbars because we cannot correctly draw in a scrolled window using SDL: */
    368             horizontalScrollBar()->setEnabled(false);
    369             verticalScrollBar()->setEnabled(false);
    370             break;
    371         }
    372 #endif /* VBOX_GUI_USE_SDL */
    373334
    374335#ifdef VBOX_GUI_USE_QUARTZ2D
     
    401362        }
    402363#endif /* VBOX_GUI_USE_QUARTZ2D */
     364
    403365        default:
    404366            AssertReleaseMsgFailed(("Render mode must be valid: %d\n", vboxGlobal().vmRenderMode()));
     
    536498#ifdef VBOX_GUI_USE_QIMAGE
    537499            || vboxGlobal().vmRenderMode() == QImageMode
    538 #endif
    539 #ifdef VBOX_GUI_USE_SDL
    540             || vboxGlobal().vmRenderMode() == SDLMode
    541 #endif
     500#endif /* VBOX_GUI_USE_QIMAGE */
    542501#ifdef VBOX_GUI_USE_QUARTZ2D
    543502            || vboxGlobal().vmRenderMode() == Quartz2DMode
    544 #endif
     503#endif /* VBOX_GUI_USE_QUARTZ2D */
    545504#ifdef VBOX_WITH_VIDEOHWACCEL
    546505            || m_fAccelerate2DVideo
    547 #endif
     506#endif /* VBOX_WITH_VIDEOHWACCEL */
    548507           )
    549508        {
     
    908867        /* Perform machine-view resize: */
    909868        resize(pResizeEvent->width(), pResizeEvent->height());
    910 
    911         /* May be we have to restrict minimum size? */
    912         maybeRestrictMinimumSize();
    913869
    914870        /* Let our toplevel widget calculate its sizeHint properly: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r46016 r46020  
    170170     * host screen. */
    171171    virtual QSize calculateMaxGuestSize() const = 0;
    172     virtual void maybeRestrictMinimumSize() = 0;
    173172    virtual void updateSliders();
    174173    QPoint viewportToContents(const QPoint &vp) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r45333 r46020  
    775775    else /* !uisession()->isMouseCaptured() */
    776776    {
    777 #if 0 // TODO: Move that to fullscreen event-handler:
    778         if (vboxGlobal().vmRenderMode() != SDLMode)
    779         {
    780             /* try to automatically scroll the guest canvas if the
    781              * mouse is on the screen border */
    782             /// @todo (r=dmik) better use a timer for autoscroll
    783             QRect scrGeo = QApplication::desktop()->screenGeometry (this);
    784             int iDx = 0, iDy = 0;
    785             if (scrGeo.width() < contentsWidth())
    786             {
    787                 if (scrGeo.left() == globalPos.x()) iDx = -1;
    788                 if (scrGeo.right() == globalPos.x()) iDx = +1;
    789             }
    790             if (scrGeo.height() < contentsHeight())
    791             {
    792                 if (scrGeo.top() == globalPos.y()) iDy = -1;
    793                 if (scrGeo.bottom() == globalPos.y()) iDy = +1;
    794             }
    795             if (iDx || iDy)
    796                 scrollBy(iDx, iDy);
    797         }
    798 #endif
    799 
    800777        if (uisession()->isMouseSupportsAbsolute() && uisession()->isMouseIntegrated())
    801778        {
     
    803780            int iVw = m_views[uScreenId]->visibleWidth(), iVh = m_views[uScreenId]->visibleHeight();
    804781
    805             if (vboxGlobal().vmRenderMode() != SDLMode)
    806             {
    807                 /* Try to automatically scroll the guest canvas if the
    808                  * mouse goes outside its visible part: */
    809                 int iDx = 0;
    810                 if (relativePos.x() > iVw) iDx = relativePos.x() - iVw;
    811                 else if (relativePos.x() < 0) iDx = relativePos.x();
    812                 int iDy = 0;
    813                 if (relativePos.y() > iVh) iDy = relativePos.y() - iVh;
    814                 else if (relativePos.y() < 0) iDy = relativePos.y();
    815                 if (iDx != 0 || iDy != 0) m_views[uScreenId]->scrollBy(iDx, iDy);
    816             }
     782            /* Try to automatically scroll the guest canvas if the
     783             * mouse goes outside its visible part: */
     784            int iDx = 0;
     785            if (relativePos.x() > iVw) iDx = relativePos.x() - iVw;
     786            else if (relativePos.x() < 0) iDx = relativePos.x();
     787            int iDy = 0;
     788            if (relativePos.y() > iVh) iDy = relativePos.y() - iVh;
     789            else if (relativePos.y() < 0) iDy = relativePos.y();
     790            if (iDx != 0 || iDy != 0) m_views[uScreenId]->scrollBy(iDx, iDy);
    817791
    818792            /* Get mouse-pointer location: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp

    r44952 r46020  
    6363void UIMachineViewFullscreen::sltAdditionsStateChanged()
    6464{
    65     /* Check if we should restrict minimum size: */
    66     maybeRestrictMinimumSize();
    67 
    6865    /* Check if we should resize guest to fullscreen */
    6966    if ((int)frameBuffer()->width() != workingArea().size().width() ||
     
    150147        m_bIsGuestAutoresizeEnabled = fEnabled;
    151148
    152         maybeRestrictMinimumSize();
    153 
    154149        if (uisession()->isGuestSupportsGraphics())
    155150            sltPerformGuestResize();
     
    175170}
    176171
    177 void UIMachineViewFullscreen::maybeRestrictMinimumSize()
    178 {
    179     /* Sets the minimum size restriction depending on the auto-resize feature state and the current rendering mode.
    180      * Currently, the restriction is set only in SDL mode and only when the auto-resize feature is inactive.
    181      * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.
    182      * In all other modes, or when auto-resize is in force, this function does nothing. */
    183     if (vboxGlobal().vmRenderMode() == SDLMode)
    184     {
    185         if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)
    186             setMinimumSize(sizeHint());
    187         else
    188             setMinimumSize(0, 0);
    189     }
    190 }
    191 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r44529 r46020  
    6868    QRect workingArea() const;
    6969    QSize calculateMaxGuestSize() const;
    70     void maybeRestrictMinimumSize();
    7170
    7271    /* Private variables: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp

    r46005 r46020  
    6565void UIMachineViewNormal::sltAdditionsStateChanged()
    6666{
    67     /* Check if we should restrict minimum size: */
    68     maybeRestrictMinimumSize();
    69 
    7067    /* Resend the last resize hint if there was a fullscreen or
    7168     * seamless transition previously.  If we were not in graphical
     
    205202        m_bIsGuestAutoresizeEnabled = fEnabled;
    206203
    207         maybeRestrictMinimumSize();
    208 
    209204        if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics())
    210205            sltPerformGuestResize();
     
    245240            availableGeo = dwt->availableGeometry(pTopLevelWidget->pos());
    246241
    247         frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo, vboxGlobal().vmRenderMode() != SDLMode /* can resize? */);
     242        frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo);
    248243    }
    249244
     
    286281}
    287282
    288 void UIMachineViewNormal::maybeRestrictMinimumSize()
    289 {
    290     /* Sets the minimum size restriction depending on the auto-resize feature state and the current rendering mode.
    291      * Currently, the restriction is set only in SDL mode and only when the auto-resize feature is inactive.
    292      * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.
    293      * In all other modes, or when auto-resize is in force, this function does nothing. */
    294     if (vboxGlobal().vmRenderMode() == SDLMode)
    295     {
    296         if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)
    297             setMinimumSize(sizeHint());
    298         else
    299             setMinimumSize(0, 0);
    300     }
    301 }
    302 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h

    r44529 r46020  
    8080    QRect workingArea() const;
    8181    QSize calculateMaxGuestSize() const;
    82     void maybeRestrictMinimumSize();
    8382
    8483    /* Private members: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h

    r44529 r46020  
    6969    QRect workingArea() const;
    7070    QSize calculateMaxGuestSize() const;
    71     void maybeRestrictMinimumSize() {}
    7271    void updateSliders();
    7372
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h

    r44529 r46020  
    7171    QRect workingArea() const;
    7272    QSize calculateMaxGuestSize() const;
    73     void maybeRestrictMinimumSize() {}
    7473
    7574    /* Private variables: */
Note: See TracChangeset for help on using the changeset viewer.

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