VirtualBox

Changeset 7610 in vbox for trunk


Ignore:
Timestamp:
Mar 27, 2008 10:48:00 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
29110
Message:

FE/Qt: Dropped refresh timer rendering mode.

Location:
trunk/src/VBox/Frontends
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r7177 r7610  
    299299ifneq ($(BUILD_TYPE),release)
    300300 # non-release builds has some extra features.
    301  VirtualBox_DEFS         += VBOX_GUI_USE_REFRESH_TIMER
    302301 VirtualBox_DEFS.win     += VBOX_GUI_USE_DDRAW
    303302 VirtualBox_DEFS.linux   += VBOX_GUI_USE_QIMAGE
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h

    r7512 r7610  
    167167
    168168    void viewportPaintEvent( QPaintEvent * );
    169 #ifdef VBOX_GUI_USE_REFRESH_TIMER
    170     void timerEvent( QTimerEvent * );
    171 #endif
    172169
    173170    void captureKbd (bool aCapture, bool aEmitSignal = true);
     
    263260#endif
    264261
    265 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    266     QPixmap pm;
    267     int tid;        /**< Timer id */
    268 #endif
    269 
    270262    VBoxFrameBuffer *mFrameBuf;
    271263    CConsoleCallback mCallback;
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h

    r7335 r7610  
    5656  #if defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
    5757    #undef VBOX_GUI_USE_EXT_FRAMEBUFFER
    58   #endif
    59   #if !defined (VBOX_GUI_USE_REFRESH_TIMER)
    60     #define VBOX_GUI_USE_REFRESH_TIMER
    6158  #endif
    6259#endif
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r6794 r7610  
    124124    QRegion mReg;
    125125};
    126 
    127 /////////////////////////////////////////////////////////////////////////////
    128 
    129 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    130 
    131 /**
    132  *  Copies the current VM video buffer contents to the pixmap referenced
    133  *  by the argument. The return value indicates whether the
    134  *  buffer has been updated since the last call to this method or not.
    135  *
    136  *  The copy operation is atomic (guarded by a mutex).
    137  *
    138  *  This method is intentionally inlined for faster execution and should be
    139  *  called only by VBoxConsoleView members.
    140  *
    141  *  @return true if the pixmap is updated, and false otherwise.
    142  */
    143 inline bool display_to_pixmap( const CConsole &c, QPixmap &pm )
    144 {
    145     CDisplay display = c.GetDisplay();
    146 
    147     uint8_t *addr = (uint8_t *) display.LockFramebuffer();
    148     AssertMsg (addr, ("The buffer address must not be null"));
    149 
    150     bool rc = pm.convertFromImage (QImage (addr,
    151                                            display.GetWidth(), display.GetHeight(),
    152                                            display.GetBitsPerPixel(),
    153                                            0, 0, QImage::LittleEndian));
    154     AssertMsg (rc, ("convertFromImage() must always return true"));
    155 
    156     display.UnlockFramebuffer();
    157 
    158     return rc;
    159 }
    160 
    161 #endif
    162126
    163127/////////////////////////////////////////////////////////////////////////////
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r7512 r7610  
    8989# include <VBox/err.h>
    9090#endif /* defined (Q_WS_MAC) */
    91 
    92 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    93 enum { UPDATE_FREQ = 1000 / 60 }; // a-la 60Hz
    94 #endif
    9591
    9692#if defined (Q_WS_WIN32)
     
    672668    Assert (!display.isNull());
    673669
    674 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    675     tid = 0;
    676 #endif
    677670    mFrameBuf = 0;
    678671
     
    681674    switch (mode)
    682675    {
    683 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    684         case VBoxDefs::TimerMode:
    685             display.SetupInternalFramebuffer (32);
    686             tid = startTimer (UPDATE_FREQ);
    687             break;
    688 #endif
    689676#if defined (VBOX_GUI_USE_QIMAGE)
    690677        case VBoxDefs::QImageMode:
     
    795782#endif
    796783
    797 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    798     if (tid)
    799         killTimer (tid);
    800 #endif
    801784    if (mFrameBuf)
    802785    {
     
    822805QSize VBoxConsoleView::sizeHint() const
    823806{
    824 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    825     if (mode == VBoxDefs::TimerMode)
    826     {
    827         CDisplay display = mConsole.GetDisplay();
    828         return QSize (display.GetWidth() + frameWidth() * 2,
    829                       display.GetHeight() + frameWidth() * 2);
    830     }
    831     else
    832 #endif
    833     {
    834         return QSize (mFrameBuf->width() + frameWidth() * 2,
    835                       mFrameBuf->height() + frameWidth() * 2);
    836     }
     807    return QSize (mFrameBuf->width() + frameWidth() * 2,
     808                  mFrameBuf->height() + frameWidth() * 2);
    837809}
    838810
     
    29102882void VBoxConsoleView::doRefresh()
    29112883{
    2912 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    2913     if (mode == VBoxDefs::TimerMode)
    2914     {
    2915         FRAMEBUF_DEBUG_START (xxx);
    2916         QSize last_sz = pm.size();
    2917         bool rc = display_to_pixmap (mConsole, pm);
    2918         if (rc)
    2919         {
    2920             if (pm.size() != last_sz)
    2921             {
    2922                 int pw = pm.width(), ph = pm.height();
    2923                 resizeContents (pw, ph);
    2924                 updateGeometry();
    2925                 setMaximumSize (sizeHint());
    2926                 /* let our toplevel widget calculate its sizeHint properly */
    2927                 QApplication::sendPostedEvents (0, QEvent::LayoutHint);
    2928                 normalizeGeometry();
     2884    repaintContents (false);
     2885}
     2886
     2887void VBoxConsoleView::viewportPaintEvent (QPaintEvent *pe)
     2888{
     2889    if (mPausedShot.isNull())
     2890    {
     2891        /* delegate the paint function to the VBoxFrameBuffer interface */
     2892        mFrameBuf->paintEvent (pe);
     2893#ifdef Q_WS_MAC
     2894        /* Update the dock icon if we are in the running state */
     2895        if (isRunning())
     2896        {
     2897# if defined (VBOX_GUI_USE_QUARTZ2D)
     2898            if (mode == VBoxDefs::Quartz2DMode)
     2899            {
     2900                /* If the render mode is Quartz2D we could use the
     2901                 * CGImageRef of the framebuffer for the dock icon creation.
     2902                 * This saves some conversion time. */
     2903                CGImageRef ir =
     2904                    static_cast <VBoxQuartz2DFrameBuffer *> (mFrameBuf)->imageRef();
     2905                ::DarwinUpdateDockPreview (ir, mVirtualBoxLogo);
    29292906            }
    29302907            else
    2931             {
    2932                 /* the alternative is to update, so we will be repainted
    2933                  * on the next event loop iteration. currently disabled.
    2934                  * updateContents(); */
    2935                 repaintContents (false);
    2936             }
    2937         }
    2938         if (rc)
    2939             FRAMEBUF_DEBUG_STOP (xxx, pm.width(), pm.height());
    2940     }
    2941     else
    2942 #endif
    2943         repaintContents (false);
    2944 }
    2945 
    2946 void VBoxConsoleView::viewportPaintEvent (QPaintEvent *pe)
    2947 {
    2948 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    2949     if (mode == VBoxDefs::TimerMode)
    2950     {
    2951         if (!pm.isNull())
    2952         {
    2953             /* draw a part of vbuf */
    2954             const QRect &r = pe->rect();
    2955             ::bitBlt (viewport(), r.x(), r.y(),
    2956                       &pm, r.x() + contentsX(), r.y() + contentsY(),
    2957                       r.width(), r.height(),
    2958                       CopyROP, TRUE);
    2959         }
    2960         else
    2961         {
    2962             viewport()->erase (pe->rect());
    2963         }
    2964     }
    2965     else
    2966 #endif
    2967     {
    2968         if (mPausedShot.isNull())
    2969         {
    2970             /* delegate the paint function to the VBoxFrameBuffer interface */
    2971             mFrameBuf->paintEvent (pe);
     2908# endif
     2909                ::DarwinUpdateDockPreview (mFrameBuf, mVirtualBoxLogo);
     2910        }
     2911#endif
     2912        return;
     2913    }
     2914
     2915    /* we have a snapshot for the paused state */
     2916    QRect r = pe->rect().intersect (viewport()->rect());
     2917    QPainter pnt (viewport());
     2918    pnt.drawPixmap (r.x(), r.y(), mPausedShot,
     2919                    r.x() + contentsX(), r.y() + contentsY(),
     2920                    r.width(), r.height());
     2921
    29722922#ifdef Q_WS_MAC
    2973             /* Update the dock icon if we are in the running state */
    2974             if (isRunning())
    2975             {
    2976 # if defined (VBOX_GUI_USE_QUARTZ2D)
    2977                 if (mode == VBoxDefs::Quartz2DMode)
    2978                 {
    2979                     /* If the render mode is Quartz2D we could use the
    2980                      * CGImageRef of the framebuffer for the dock icon creation.
    2981                      * This saves some conversion time. */
    2982                     CGImageRef ir =
    2983                         static_cast <VBoxQuartz2DFrameBuffer *> (mFrameBuf)->imageRef();
    2984                     ::DarwinUpdateDockPreview (ir, mVirtualBoxLogo);
    2985                 }
    2986                 else
    2987 # endif
    2988                     ::DarwinUpdateDockPreview (mFrameBuf, mVirtualBoxLogo);
    2989             }
    2990 #endif
    2991             return;
    2992         }
    2993 
    2994         /* we have a snapshot for the paused state */
    2995         QRect r = pe->rect().intersect (viewport()->rect());
    2996         QPainter pnt (viewport());
    2997         pnt.drawPixmap (r.x(), r.y(), mPausedShot,
    2998                         r.x() + contentsX(), r.y() + contentsY(),
    2999                         r.width(), r.height());
    3000 
    3001 #ifdef Q_WS_MAC
    3002         ::DarwinUpdateDockPreview (DarwinQPixmapToCGImage (&mPausedShot),
    3003                                    mVirtualBoxLogo,
    3004                                    mMainWnd->dockImageState());
    3005 #endif
    3006     }
    3007 }
    3008 
    3009 #ifdef VBOX_GUI_USE_REFRESH_TIMER
    3010 void VBoxConsoleView::timerEvent( QTimerEvent * )
    3011 {
    3012     doRefresh();
    3013 }
    3014 #endif
     2923    ::DarwinUpdateDockPreview (DarwinQPixmapToCGImage (&mPausedShot),
     2924                               mVirtualBoxLogo,
     2925                               mMainWnd->dockImageState());
     2926#endif
     2927}
    30152928
    30162929/**
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r7608 r7610  
    695695    {
    696696        if (0) ;
    697 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    698         else if (::strcmp (aModeStr, "timer") == 0)
    699             mode = VBoxDefs::TimerMode;
    700 #endif
    701697#if defined (VBOX_GUI_USE_QIMAGE)
    702698        else if (::strcmp (aModeStr, "image") == 0)
  • trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk

    r7594 r7610  
    552552ifneq ($(BUILD_TYPE),release)
    553553 # non-release builds has some extra features.
    554  VirtualBox_DEFS         += VBOX_GUI_USE_REFRESH_TIMER
    555554 VirtualBox_DEFS.win     += VBOX_GUI_USE_DDRAW
    556555 VirtualBox_DEFS.linux   += VBOX_GUI_USE_QIMAGE
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h

    r7590 r7610  
    105105    int visibleWidth() const { return horizontalScrollBar()->pageStep(); }
    106106    int visibleHeight() const { return verticalScrollBar()->pageStep(); }
    107     void scrollBy (int dx, int dy) 
    108     { 
     107    void scrollBy (int dx, int dy)
     108    {
    109109        horizontalScrollBar()->setValue (horizontalScrollBar()->value() + dx);
    110110        verticalScrollBar()->setValue (verticalScrollBar()->value() + dy);
     
    112112    QPoint viewportToContents ( const QPoint & vp ) const
    113113    {
    114         return QPoint (vp.x() + contentsX(), 
     114        return QPoint (vp.x() + contentsX(),
    115115                       vp.y() + contentsY());
    116116    }
     
    185185    void resizeEvent (QResizeEvent *);
    186186    void paintEvent (QPaintEvent *);
    187 #ifdef VBOX_GUI_USE_REFRESH_TIMER
    188     void timerEvent( QTimerEvent * );
    189 #endif
    190187
    191188    void captureKbd (bool aCapture, bool aEmitSignal = true);
     
    280277#endif
    281278
    282 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    283     QPixmap pm;
    284     int tid;        /**< Timer id */
    285 #endif
    286 
    287279    VBoxFrameBuffer *mFrameBuf;
    288280    CConsoleCallback mCallback;
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h

    r7435 r7610  
    5656  #if defined (VBOX_GUI_USE_EXT_FRAMEBUFFER)
    5757    #undef VBOX_GUI_USE_EXT_FRAMEBUFFER
    58   #endif
    59   #if !defined (VBOX_GUI_USE_REFRESH_TIMER)
    60     #define VBOX_GUI_USE_REFRESH_TIMER
    6158  #endif
    6259#endif
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxFrameBuffer.h

    r7407 r7610  
    124124    QRegion mReg;
    125125};
    126 
    127 /////////////////////////////////////////////////////////////////////////////
    128 
    129 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    130 
    131 /**
    132  *  Copies the current VM video buffer contents to the pixmap referenced
    133  *  by the argument. The return value indicates whether the
    134  *  buffer has been updated since the last call to this method or not.
    135  *
    136  *  The copy operation is atomic (guarded by a mutex).
    137  *
    138  *  This method is intentionally inlined for faster execution and should be
    139  *  called only by VBoxConsoleView members.
    140  *
    141  *  @return true if the pixmap is updated, and false otherwise.
    142  */
    143 inline bool display_to_pixmap( const CConsole &c, QPixmap &pm )
    144 {
    145     CDisplay display = c.GetDisplay();
    146 
    147     uint8_t *addr = (uint8_t *) display.LockFramebuffer();
    148     AssertMsg (addr, ("The buffer address must not be null"));
    149 
    150     QImage::Format format = QImage::Format_Invalid;
    151     switch (display.GetBitsPerPixel())
    152     {
    153         /* 32-, 8- and 1-bpp are the only depths suported by QImage */
    154         case 32:
    155             format = QImage::Format_RGB32;
    156             break;
    157         case 8:
    158             format = QImage::Format_Indexed8;
    159             break;
    160         case 1:
    161             format = QImage::Format_Mono;
    162             break;
    163     }
    164 
    165     bool rc = false;
    166     if(format != QImage::Format_Invalid)
    167     {
    168         pm = QPixmap::fromImage (QImage (addr,
    169                                          display.GetWidth(), display.GetHeight(),
    170                                          format));
    171         rc = !pm.isNull();
    172         AssertMsg (rc, ("convertFromImage() must always return true"));
    173     }
    174 
    175     display.UnlockFramebuffer();
    176 
    177     return rc;
    178 }
    179 
    180 #endif
    181126
    182127/////////////////////////////////////////////////////////////////////////////
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp

    r7590 r7610  
    8383#endif /* defined (Q_WS_MAC) */
    8484
    85 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    86 enum { UPDATE_FREQ = 1000 / 60 }; // a-la 60Hz
    87 #endif
    88 
    8985#if defined (Q_WS_WIN32)
    9086
     
    581577        setAttribute (Qt::WA_OpaquePaintEvent);
    582578    }
    583     virtual QPaintEngine * paintEngine() const 
    584     { 
     579    virtual QPaintEngine * paintEngine() const
     580    {
    585581        if (testAttribute (Qt::WA_PaintOnScreen))
    586             return NULL; 
    587         else 
     582            return NULL;
     583        else
    588584            return QWidget::paintEngine();
    589     } 
     585    }
    590586};
    591587
     
    681677    Assert (!display.isNull());
    682678
    683 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    684     tid = 0;
    685 #endif
    686679    mFrameBuf = 0;
    687680
     
    690683    switch (mode)
    691684    {
    692 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    693         case VBoxDefs::TimerMode:
    694             display.SetupInternalFramebuffer (32);
    695             tid = startTimer (UPDATE_FREQ);
    696             break;
    697 #endif
    698685#if defined (VBOX_GUI_USE_QIMAGE)
    699686        case VBoxDefs::QImageMode:
     
    703690#if defined (VBOX_GUI_USE_SDL)
    704691        case VBoxDefs::SDLMode:
    705             /* Indicate that we are doing all 
     692            /* Indicate that we are doing all
    706693             * drawing stuff ourself */
    707694            pViewport->setAttribute (Qt::WA_PaintOnScreen);
     
    809796#endif
    810797
    811 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    812     if (tid)
    813         killTimer (tid);
    814 #endif
    815798    if (mFrameBuf)
    816799    {
     
    836819QSize VBoxConsoleView::sizeHint() const
    837820{
    838 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    839     if (mode == VBoxDefs::TimerMode)
    840     {
    841         CDisplay display = mConsole.GetDisplay();
    842         return QSize (display.GetWidth() + frameWidth() * 2,
    843                       display.GetHeight() + frameWidth() * 2);
    844     }
    845     else
    846 #endif
    847     {
    848         return QSize (mFrameBuf->width() + frameWidth() * 2,
    849                       mFrameBuf->height() + frameWidth() * 2);
    850     }
     821    return QSize (mFrameBuf->width() + frameWidth() * 2,
     822                  mFrameBuf->height() + frameWidth() * 2);
    851823}
    852824
     
    10761048
    10771049                if (mToggleFSModeTimer->isActive())
    1078                     mToggleFSModeTimer->stop(); 
     1050                    mToggleFSModeTimer->stop();
    10791051
    10801052                /* do frame buffer dependent resize */
     
    29172889void VBoxConsoleView::doRefresh()
    29182890{
    2919 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    2920     if (mode == VBoxDefs::TimerMode)
    2921     {
    2922         FRAMEBUF_DEBUG_START (xxx);
    2923         QSize last_sz = pm.size();
    2924         bool rc = display_to_pixmap (mConsole, pm);
    2925         if (rc)
    2926         {
    2927             if (pm.size() != last_sz)
    2928             {
    2929                 int pw = pm.width(), ph = pm.height();
    2930                 viewport()->resize (pw, ph);
    2931                 updateGeometry();
    2932                 setMaximumSize (sizeHint());
    2933                 /* let our toplevel widget calculate its sizeHint properly */
    2934                 QApplication::sendPostedEvents (0, QEvent::LayoutRequest);
    2935                 normalizeGeometry();
     2891    viewport()->repaint();
     2892}
     2893
     2894void VBoxConsoleView::resizeEvent (QResizeEvent *)
     2895{
     2896    updateSliders();
     2897}
     2898
     2899void VBoxConsoleView::paintEvent (QPaintEvent *pe)
     2900{
     2901    if (mPausedShot.isNull())
     2902    {
     2903        /* delegate the paint function to the VBoxFrameBuffer interface */
     2904        mFrameBuf->paintEvent (pe);
     2905#ifdef Q_WS_MAC
     2906        /* Update the dock icon if we are in the running state */
     2907        if (isRunning())
     2908        {
     2909# if defined (VBOX_GUI_USE_QUARTZ2D)
     2910            if (mode == VBoxDefs::Quartz2DMode)
     2911            {
     2912                /* If the render mode is Quartz2D we could use the
     2913                 * CGImageRef of the framebuffer for the dock icon creation.
     2914                 * This saves some conversion time. */
     2915                CGImageRef ir =
     2916                    static_cast <VBoxQuartz2DFrameBuffer *> (mFrameBuf)->imageRef();
     2917                ::DarwinUpdateDockPreview (ir, mVirtualBoxLogo);
    29362918            }
    29372919            else
    2938             {
    2939                 /* the alternative is to update, so we will be repainted
    2940                  * on the next event loop iteration. currently disabled.
    2941                  * updateContents(); */
    2942                 viewport()->repaint();
    2943             }
    2944         }
    2945         if (rc)
    2946             FRAMEBUF_DEBUG_STOP (xxx, pm.width(), pm.height());
    2947     }
    2948     else
    2949 #endif
    2950         viewport()->repaint();
    2951 }
    2952 
    2953 void VBoxConsoleView::resizeEvent (QResizeEvent *)
    2954 {
    2955     updateSliders();
    2956 }
    2957 
    2958 void VBoxConsoleView::paintEvent (QPaintEvent *pe)
    2959 {
    2960 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    2961 #warning "port me: Is this needed anymore?"
    2962 //    if (mode == VBoxDefs::TimerMode)
    2963 //    {
    2964 //        if (!pm.isNull())
    2965 //        {
    2966 //            /* draw a part of vbuf */
    2967 //            const QRect &r = pe->rect();
    2968 //            ::bitBlt (viewport(), r.x(), r.y(),
    2969 //                      &pm, r.x() + contentsX(), r.y() + contentsY(),
    2970 //                      r.width(), r.height(),
    2971 //                      CopyROP, TRUE);
    2972 //        }
    2973 //        else
    2974 //        {
    2975 //            viewport()->erase (pe->rect());
    2976 //        }
    2977 //    }
    2978 //    else
    2979 #endif
    2980     {
    2981         if (mPausedShot.isNull())
    2982         {
    2983             /* delegate the paint function to the VBoxFrameBuffer interface */
    2984             mFrameBuf->paintEvent (pe);
     2920# endif
     2921                ::DarwinUpdateDockPreview (mFrameBuf, mVirtualBoxLogo);
     2922        }
     2923#endif
     2924        return;
     2925    }
     2926
     2927    /* we have a snapshot for the paused state */
     2928    QRect r = pe->rect().intersect (viewport()->rect());
     2929    QPainter pnt (viewport());
     2930    pnt.drawPixmap (r.x(), r.y(), mPausedShot,
     2931                    r.x() + contentsX(), r.y() + contentsY(),
     2932                    r.width(), r.height());
     2933
    29852934#ifdef Q_WS_MAC
    2986             /* Update the dock icon if we are in the running state */
    2987             if (isRunning())
    2988             {
    2989 # if defined (VBOX_GUI_USE_QUARTZ2D)
    2990                 if (mode == VBoxDefs::Quartz2DMode)
    2991                 {
    2992                     /* If the render mode is Quartz2D we could use the
    2993                      * CGImageRef of the framebuffer for the dock icon creation.
    2994                      * This saves some conversion time. */
    2995                     CGImageRef ir =
    2996                         static_cast <VBoxQuartz2DFrameBuffer *> (mFrameBuf)->imageRef();
    2997                     ::DarwinUpdateDockPreview (ir, mVirtualBoxLogo);
    2998                 }
    2999                 else
    3000 # endif
    3001                     ::DarwinUpdateDockPreview (mFrameBuf, mVirtualBoxLogo);
    3002             }
    3003 #endif
    3004             return;
    3005         }
    3006 
    3007         /* we have a snapshot for the paused state */
    3008         QRect r = pe->rect().intersect (viewport()->rect());
    3009         QPainter pnt (viewport());
    3010         pnt.drawPixmap (r.x(), r.y(), mPausedShot,
    3011                         r.x() + contentsX(), r.y() + contentsY(),
    3012                         r.width(), r.height());
    3013 
    3014 #ifdef Q_WS_MAC
    3015         ::DarwinUpdateDockPreview (DarwinQPixmapToCGImage (&mPausedShot),
    3016                                    mVirtualBoxLogo,
    3017                                    mMainWnd->dockImageState());
    3018 #endif
    3019     }
    3020 }
    3021 
    3022 #ifdef VBOX_GUI_USE_REFRESH_TIMER
    3023 void VBoxConsoleView::timerEvent( QTimerEvent * )
    3024 {
    3025     doRefresh();
    3026 }
    3027 #endif
     2935    ::DarwinUpdateDockPreview (DarwinQPixmapToCGImage (&mPausedShot),
     2936                               mVirtualBoxLogo,
     2937                               mMainWnd->dockImageState());
     2938#endif
     2939}
    30282940
    30292941/**
     
    36053517    setDesktopGeometry(0, 0);
    36063518}
    3607  
     3519
    36083520/**
    36093521 * Set the maximum size allowed for the guest desktop to the available area
     
    36493561        h = str.section (',', 1, 1).toInt (&ok);
    36503562    QRect screen = QApplication::desktop()->screenGeometry (this);
    3651     if (ok && w <= screen.width() && h <= screen.height()) 
     3563    if (ok && w <= screen.width() && h <= screen.height())
    36523564    {
    36533565        LogFlowFunc (("Will suggest %d x %d\n", w, h));
     
    36783590}
    36793591
    3680 int VBoxConsoleView::contentsWidth() const 
    3681 { 
    3682     return mFrameBuf->width(); 
    3683 }
    3684 
    3685 int VBoxConsoleView::contentsHeight() const 
    3686 { 
    3687     return mFrameBuf->height(); 
     3592int VBoxConsoleView::contentsWidth() const
     3593{
     3594    return mFrameBuf->width();
     3595}
     3596
     3597int VBoxConsoleView::contentsHeight() const
     3598{
     3599    return mFrameBuf->height();
    36883600}
    36893601
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r7608 r7610  
    706706    {
    707707        if (0) ;
    708 #if defined (VBOX_GUI_USE_REFRESH_TIMER)
    709         else if (::strcmp (aModeStr, "timer") == 0)
    710             mode = VBoxDefs::TimerMode;
    711 #endif
    712708#if defined (VBOX_GUI_USE_QIMAGE)
    713709        else if (::strcmp (aModeStr, "image") == 0)
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