VirtualBox

Changeset 8902

Show
Ignore:
Timestamp:
05/16/08 17:32:30 (8 months ago)
Author:
vboxsync
Message:

FE/Qt: Keep style.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h

    r8894 r8902  
    102102    void setIgnoreMainwndResize (bool aYes) { mIgnoreMainwndResize = aYes; } 
    103103 
    104     QRect getDesktopGeometry(); 
     104    QRect desktopGeometry(); 
    105105 
    106106    bool isAutoresizeGuestActive(); 
     
    199199private: 
    200200 
    201     enum meDesktopGeo { 
    202         invalid = 0, fixed, automatic, any, unchanged 
     201    enum DesktopGeo 
     202    { 
     203        DesktopGeo_Invalid = 0, DesktopGeo_Fixed, 
     204        DesktopGeo_Automatic, DesktopGeo_Any, DesktopGeo_Unchanged 
    203205    }; 
    204     void setDesktopGeometry(meDesktopGeo type, int width, int height); 
    205     void setDesktopGeoHint(int width, int height); 
     206 
     207    void setDesktopGeometry (DesktopGeo aGeo, int aWidth, int aHeight); 
     208    void setDesktopGeoHint (int aWidth, int aHeight); 
    206209    void maybeRestrictMinimumSize(); 
    207210 
     
    290293    CGImageRef mVirtualBoxLogo; 
    291294#endif 
    292     meDesktopGeo mDesktopGeoType
     295    DesktopGeo mDesktopGeo
    293296    QRect mDesktopGeometry; 
    294297    QRect mLastSizeHint; 
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r8894 r8902  
    646646    , mVirtualBoxLogo (NULL) 
    647647#endif 
    648     , mDesktopGeoType(invalid) 
     648    , mDesktopGeo (DesktopGeo_Invalid) 
    649649{ 
    650650    Assert (!mConsole.isNull() && 
     
    771771 
    772772    QString desktopGeometry = vboxGlobal().settings() 
    773                                   .publicProperty("GUI/MaxGuestResolution"); 
    774     if (   (QString::null == desktopGeometry) 
    775         || ("auto" == desktopGeometry) 
    776        ) 
    777         setDesktopGeometry(automatic, 0, 0); 
    778     else if ("any" == desktopGeometry) 
    779         setDesktopGeometry(any, 0, 0); 
     773                                  .publicProperty ("GUI/MaxGuestResolution"); 
     774    if ((desktopGeometry == QString::null) || 
     775        (desktopGeometry == "auto")) 
     776        setDesktopGeometry (DesktopGeo_Automatic, 0, 0); 
     777    else if (desktopGeometry == "any") 
     778        setDesktopGeometry (DesktopGeo_Any, 0, 0); 
    780779    else 
    781780    { 
    782         int width = desktopGeometry.section(',', 0, 0).toInt(); 
    783         int height = desktopGeometry.section(',', 1, 1).toInt(); 
    784         setDesktopGeometry(fixed, width, height); 
    785     } 
    786     connect (QApplication::desktop(), SIGNAL(workAreaResized(int)), 
    787              this, SLOT(doResizeDesktop(int))); 
     781        int width = desktopGeometry.section (',', 0, 0).toInt(); 
     782        int height = desktopGeometry.section (',', 1, 1).toInt(); 
     783        setDesktopGeometry (DesktopGeo_Fixed, width, height); 
     784    } 
     785    connect (QApplication::desktop(), SIGNAL (workAreaResized (int)), 
     786             this, SLOT (doResizeDesktop (int))); 
    788787 
    789788#if defined (VBOX_GUI_DEBUG) && defined (VBOX_GUI_FRAMEBUF_STAT) 
     
    22852284 * @returns the geometry.  An empty rectangle means unrestricted. 
    22862285 */ 
    2287 QRect VBoxConsoleView::getDesktopGeometry() 
     2286QRect VBoxConsoleView::desktopGeometry() 
    22882287{ 
    22892288    QRect rc; 
    2290     switch (mDesktopGeoType) 
    2291     { 
    2292     case fixed: 
    2293     case automatic: 
    2294         rc = QRect (0, 0, RT_MAX(mDesktopGeometry.width(), mLastSizeHint.width()), 
    2295                     RT_MAX(mDesktopGeometry.height(), mLastSizeHint.height())); 
    2296         break; 
    2297     case any: 
    2298         rc = QRect (0, 0, 0, 0); 
    2299         break; 
    2300     default: 
    2301         AssertMsgFailed (("Bad geometry type %d\n", mDesktopGeoType)); 
     2289    switch (mDesktopGeo) 
     2290    { 
     2291        case DesktopGeo_Fixed: 
     2292        case DesktopGeo_Automatic: 
     2293            rc = QRect (0, 0, 
     2294                        RT_MAX (mDesktopGeometry.width(), mLastSizeHint.width()), 
     2295                        RT_MAX (mDesktopGeometry.height(), mLastSizeHint.height())); 
     2296            break; 
     2297        case DesktopGeo_Any: 
     2298            rc = QRect (0, 0, 0, 0); 
     2299            break; 
     2300        default: 
     2301            AssertMsgFailed (("Bad geometry type %d\n", mDesktopGeo)); 
    23022302    } 
    23032303    return rc; 
     
    35643564 
    35653565        /* Increase the desktop geometry if needed */ 
    3566         setDesktopGeoHint(sz.width(), sz.height()); 
     3566        setDesktopGeoHint (sz.width(), sz.height()); 
    35673567 
    35683568        if (mAutoresizeGuest) 
     
    35743574{ 
    35753575    /* If the desktop geometry is set automatically, this will update it. */ 
    3576     setDesktopGeometry(unchanged, 0, 0); 
     3576    setDesktopGeometry (DesktopGeo_Unchanged, 0, 0); 
    35773577} 
    35783578 
     
    35833583 * way, or to the specified lower bound, whichever is greater. 
    35843584 * 
    3585  * @param fixed   Are the parameters a fixed geometry size or a lower bound? 
    3586  * @param width   The maximum width for the guest screen (fixed geometry) 
    3587  *                or a lower bound for the maximum 
    3588  * @param height  The maximum height for the guest screen (fixed geometry) 
     3585 * @param aWidth  The maximum width for the guest screen (fixed geometry) or a 
     3586 *                lower bound for the maximum 
     3587 * @param aHeight The maximum height for the guest screen (fixed geometry) 
    35893588 *                or a lower bound for the maximum 
    35903589 */ 
    3591 void VBoxConsoleView::setDesktopGeoHint(int width, int height) 
    3592 { 
    3593     LogFlowThisFunc(("width=%d, height=%d\n", width, height)); 
    3594     mLastSizeHint = QRect (0, 0, width, height); 
     3590void VBoxConsoleView::setDesktopGeoHint (int aWidth, int aHeight) 
     3591{ 
     3592    LogFlowThisFunc (("aWidth=%d, aHeight=%d\n", aWidth, aHeight)); 
     3593    mLastSizeHint = QRect (0, 0, aWidth, aHeight); 
    35953594} 
    35963595 
     
    36003599 * a hint from the host will always override these restrictions. 
    36013600 * 
    3602  * @param type    Values: fixed - the guest has a fixed maximum framebuffer size 
    3603  *                        automatic - we recalculate the maximum size ourselves 
    3604  *                        any - any size is allowed 
    3605  * @param width   The maximum width for the guest screen or zero for no change 
     3601 * @param aGeo    Values: fixed - the guest has a fixed maximum framebuffer 
     3602 *                        size automatic - we recalculate the maximum size 
     3603 *                        ourselves any - any size is allowed 
     3604 * @param aWidth  The maximum width for the guest screen or zero for no change 
    36063605 *                (only used for fixed geometry) 
    3607  * @param height The maximum height for the guest screen or zero for no change 
     3606 * @param aHeight The maximum height for the guest screen or zero for no change 
    36083607 *                (only used for fixed geometry) 
    36093608 */ 
    3610 void VBoxConsoleView::setDesktopGeometry(meDesktopGeo type, int width, int height) 
    3611 
    3612     LogFlowThisFunc (("type = %s, width=%d, height=%d\n", 
    3613                       (fixed == type ? "fixed" 
    3614                            : (automatic == type ? "automatic" 
    3615                                  : (any == type ? "any" 
    3616                                        : (unchanged == type ? "unchanged" : "invalid") 
    3617                                    ) 
    3618                              ) 
    3619                       ), width, height 
    3620                     )); 
    3621     Assert((type != unchanged) || (mDesktopGeoType != invalid)); 
    3622     if (unchanged == type) 
    3623         type = mDesktopGeoType; 
    3624     switch (type) 
    3625     { 
    3626     case fixed: 
    3627         mDesktopGeoType = fixed; 
    3628         if ((0 != width ) && (0 != height)) 
    3629             mDesktopGeometry = QRect (0, 0, width, height); 
    3630         setDesktopGeoHint (0, 0); 
    3631         break; 
    3632     case automatic: 
    3633     { 
    3634         mDesktopGeoType = automatic; 
    3635         QRect desktop = QApplication::desktop()->screenGeometry (this); 
    3636         mDesktopGeometry = QRect(0, 0, desktop.width() - 100, desktop.height() - 100); 
    3637         LogFlowThisFunc(("Setting %d, %d\n", desktop.width() - 100, desktop.height() - 100)); 
    3638         setDesktopGeoHint (0, 0); 
    3639         break; 
    3640     } 
    3641     case any: 
    3642         mDesktopGeoType = any; 
    3643         mDesktopGeometry = QRect (0, 0, 0, 0); 
    3644         break; 
    3645     default: 
    3646         AssertMsgFailed(("Invalid desktop geometry type %d\n", type)); 
    3647         mDesktopGeoType = invalid; 
     3609void VBoxConsoleView::setDesktopGeometry (DesktopGeo aGeo, int aWidth, int aHeight) 
     3610
     3611    LogFlowThisFunc (("aGeo=%s, aWidth=%d, aHeight=%d\n", 
     3612                      (aGeo == DesktopGeo_Fixed ? "Fixed" : 
     3613                       aGeo == DesktopGeo_Automatic ? "Automatic" : 
     3614                       aGeo == DesktopGeo_Any ? "Any" : 
     3615                       aGeo == DesktopGeo_Unchanged ? "Unchanged" : "Invalid"), 
     3616                      aWidth, aHeight)); 
     3617    Assert ((aGeo != DesktopGeo_Unchanged) || (mDesktopGeo != DesktopGeo_Invalid)); 
     3618    if (DesktopGeo_Unchanged == aGeo) 
     3619        aGeo = mDesktopGeo; 
     3620    switch (aGeo) 
     3621    { 
     3622        case DesktopGeo_Fixed: 
     3623            mDesktopGeo = DesktopGeo_Fixed; 
     3624            if (aWidth != 0 && aHeight != 0) 
     3625                mDesktopGeometry = QRect (0, 0, aWidth, aHeight); 
     3626            setDesktopGeoHint (0, 0); 
     3627            break; 
     3628        case DesktopGeo_Automatic: 
     3629        { 
     3630            mDesktopGeo = DesktopGeo_Automatic; 
     3631            QRect desktop = QApplication::desktop()->screenGeometry (this); 
     3632            mDesktopGeometry = QRect (0, 0, desktop.width() - 100, desktop.height() - 100); 
     3633            LogFlowThisFunc (("Setting %d, %d\n", desktop.width() - 100, desktop.height() - 100)); 
     3634            setDesktopGeoHint (0, 0); 
     3635            break; 
     3636        } 
     3637        case DesktopGeo_Any: 
     3638            mDesktopGeo = DesktopGeo_Any; 
     3639            mDesktopGeometry = QRect (0, 0, 0, 0); 
     3640            break; 
     3641        default: 
     3642            AssertMsgFailed(("Invalid desktop geometry type %d\n", aGeo)); 
     3643            mDesktopGeo = DesktopGeo_Invalid; 
    36483644    } 
    36493645} 
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp

    r8888 r8902  
    205205        return E_POINTER; 
    206206    *aSupported = TRUE; 
    207     QRect screen = mView->getDesktopGeometry(); 
     207    QRect screen = mView->desktopGeometry(); 
    208208    if (   (screen.width() != 0) 
    209209        && (aWidth > (ULONG) screen.width()) 
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h

    r8888 r8902  
    9999    void setIgnoreMainwndResize (bool aYes) { mIgnoreMainwndResize = aYes; } 
    100100 
    101     QRect getDesktopGeometry(); 
     101    QRect desktopGeometry(); 
    102102 
    103103    /* todo: This are some support functions for the qt4 port. Maybe we get rid 
     
    215215private: 
    216216 
    217     enum meDesktopGeo { 
    218         invalid = 0, fixed, automatic, any, unchanged 
     217    enum DesktopGeo 
     218    { 
     219        DesktopGeo_Invalid = 0, DesktopGeo_Fixed, 
     220        DesktopGeo_Automatic, DesktopGeo_Any, DesktopGeo_Unchanged 
    219221    }; 
    220     void setDesktopGeometry(meDesktopGeo type, int width, int height); 
    221     void setDesktopGeoHint(int width, int height); 
     222 
     223    void setDesktopGeometry (DesktopGeo aGeo, int aWidth, int aHeight); 
     224    void setDesktopGeoHint (int aWidth, int aHeight); 
    222225    void maybeRestrictMinimumSize(); 
    223226 
     
    305308    CGImageRef mVirtualBoxLogo; 
    306309#endif 
    307     meDesktopGeo mDesktopGeoType
     310    DesktopGeo mDesktopGeo
    308311    QRect mDesktopGeometry; 
    309312    QRect mLastSizeHint; 
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp

    r8893 r8902  
    667667    , mVirtualBoxLogo (NULL) 
    668668#endif 
    669     , mDesktopGeoType(invalid) 
     669    , mDesktopGeo (DesktopGeo_Invalid) 
    670670{ 
    671671    Assert (!mConsole.isNull() && 
     
    800800 
    801801    QString desktopGeometry = vboxGlobal().settings() 
    802                                   .publicProperty("GUI/MaxGuestResolution"); 
    803     if (   (QString::null == desktopGeometry) 
    804         || ("auto" == desktopGeometry) 
    805        ) 
    806         setDesktopGeometry(automatic, 0, 0); 
    807     else if ("any" == desktopGeometry) 
    808         setDesktopGeometry(any, 0, 0); 
     802                                  .publicProperty ("GUI/MaxGuestResolution"); 
     803    if ((desktopGeometry == QString::null) || 
     804        (desktopGeometry == "auto")) 
     805        setDesktopGeometry (DesktopGeo_Automatic, 0, 0); 
     806    else if (desktopGeometry == "any") 
     807        setDesktopGeometry (DesktopGeo_Any, 0, 0); 
    809808    else 
    810809    { 
    811         int width = desktopGeometry.section(',', 0, 0).toInt(); 
    812         int height = desktopGeometry.section(',', 1, 1).toInt(); 
    813         setDesktopGeometry(fixed, width, height); 
    814     } 
    815     connect (QApplication::desktop(), SIGNAL(workAreaResized(int)), 
    816              this, SLOT(doResizeDesktop(int))); 
     810        int width = desktopGeometry.section (',', 0, 0).toInt(); 
     811        int height = desktopGeometry.section (',', 1, 1).toInt(); 
     812        setDesktopGeometry (DesktopGeo_Fixed, width, height); 
     813    } 
     814    connect (QApplication::desktop(), SIGNAL (workAreaResized (int)), 
     815             this, SLOT (doResizeDesktop (int))); 
    817816 
    818817#if defined (VBOX_GUI_DEBUG) && defined (VBOX_GUI_FRAMEBUF_STAT) 
     
    23162315 * @returns the geometry.  An empty rectangle means unrestricted. 
    23172316 */ 
    2318 QRect VBoxConsoleView::getDesktopGeometry() 
     2317QRect VBoxConsoleView::desktopGeometry() 
    23192318{ 
    23202319    QRect rc; 
    2321     switch (mDesktopGeoType) 
    2322     { 
    2323     case fixed: 
    2324     case automatic: 
    2325         rc = QRect (0, 0, RT_MAX(mDesktopGeometry.width(), mLastSizeHint.width()), 
    2326                     RT_MAX(mDesktopGeometry.height(), mLastSizeHint.height())); 
    2327         break; 
    2328     case any: 
    2329         rc = QRect (0, 0, 0, 0); 
    2330         break; 
    2331     default: 
    2332         AssertMsgFailed (("Bad geometry type %d\n", mDesktopGeoType)); 
     2320    switch (mDesktopGeo) 
     2321    { 
     2322        case DesktopGeo_Fixed: 
     2323        case DesktopGeo_Automatic: 
     2324            rc = QRect (0, 0, 
     2325                        RT_MAX (mDesktopGeometry.width(), mLastSizeHint.width()), 
     2326                        RT_MAX (mDesktopGeometry.height(), mLastSizeHint.height())); 
     2327            break; 
     2328        case DesktopGeo_Any: 
     2329            rc = QRect (0, 0, 0, 0); 
     2330            break; 
     2331        default: 
     2332            AssertMsgFailed (("Bad geometry type %d\n", mDesktopGeo)); 
    23332333    } 
    23342334    return rc; 
     
    35823582 
    35833583        /* Increase the desktop geometry if needed */ 
    3584         setDesktopGeoHint(sz.width(), sz.height()); 
     3584        setDesktopGeoHint (sz.width(), sz.height()); 
    35853585 
    35863586        if (mAutoresizeGuest) 
     
    35923592{ 
    35933593    /* If the desktop geometry is set automatically, this will update it. */ 
    3594     setDesktopGeometry(unchanged, 0, 0); 
     3594    setDesktopGeometry (DesktopGeo_Unchanged, 0, 0); 
    35953595} 
    35963596 
     
    36013601 * way, or to the specified lower bound, whichever is greater. 
    36023602 * 
    3603  * @param fixed   Are the parameters a fixed geometry size or a lower bound? 
    3604  * @param width   The maximum width for the guest screen (fixed geometry) 
    3605  *                or a lower bound for the maximum 
    3606  * @param height  The maximum height for the guest screen (fixed geometry) 
     3603 * @param aWidth  The maximum width for the guest screen (fixed geometry) or a 
     3604 *                lower bound for the maximum 
     3605 * @param aHeight The maximum height for the guest screen (fixed geometry) 
    36073606 *                or a lower bound for the maximum 
    36083607 */ 
    3609 void VBoxConsoleView::setDesktopGeoHint(int width, int height) 
    3610 { 
    3611     LogFlowThisFunc(("width=%d, height=%d\n", width, height)); 
    3612     mLastSizeHint = QRect (0, 0, width, height); 
     3608void VBoxConsoleView::setDesktopGeoHint (int aWidth, int aHeight) 
     3609{ 
     3610    LogFlowThisFunc (("aWidth=%d, aHeight=%d\n", aWidth, aHeight)); 
     3611    mLastSizeHint = QRect (0, 0, aWidth, aHeight); 
    36133612} 
    36143613 
     
    36183617 * a hint from the host will always override these restrictions. 
    36193618 * 
    3620  * @param type    Values: fixed - the guest has a fixed maximum framebuffer size 
    3621  *                        automatic - we recalculate the maximum size ourselves 
    3622  *                        any - any size is allowed 
    3623  * @param width   The maximum width for the guest screen or zero for no change 
     3619 * @param aGeo    Values: fixed - the guest has a fixed maximum framebuffer 
     3620 *                        size automatic - we recalculate the maximum size 
     3621 *                        ourselves any - any size is allowed 
     3622 * @param aWidth  The maximum width for the guest screen or zero for no change 
    36243623 *                (only used for fixed geometry) 
    3625  * @param height The maximum height for the guest screen or zero for no change 
     3624 * @param aHeight The maximum height for the guest screen or zero for no change 
    36263625 *                (only used for fixed geometry) 
    36273626 */ 
    3628 void VBoxConsoleView::setDesktopGeometry(meDesktopGeo type, int width, int height) 
    3629 
    3630     LogFlowThisFunc (("type = %s, width=%d, height=%d\n", 
    3631                       (fixed == type ? "fixed" 
    3632                            : (automatic == type ? "automatic" 
    3633                                  : (any == type ? "any" 
    3634                                        : (unchanged == type ? "unchanged" : "invalid") 
    3635                                    ) 
    3636                              ) 
    3637                       ), width, height 
    3638                     )); 
    3639     Assert((type != unchanged) || (mDesktopGeoType != invalid)); 
    3640     if (unchanged == type) 
    3641         type = mDesktopGeoType; 
    3642     switch (type) 
    3643     { 
    3644     case fixed: 
    3645         mDesktopGeoType = fixed; 
    3646         if ((0 != width ) && (0 != height)) 
    3647             mDesktopGeometry = QRect (0, 0, width, height); 
    3648         setDesktopGeoHint (0, 0); 
    3649         break; 
    3650     case automatic: 
    3651     { 
    3652         mDesktopGeoType = automatic; 
    3653         QRect desktop = QApplication::desktop()->screenGeometry (this); 
    3654         mDesktopGeometry = QRect(0, 0, desktop.width() - 100, desktop.height() - 100); 
    3655         LogFlowThisFunc(("Setting %d, %d\n", desktop.width() - 100, desktop.height() - 100)); 
    3656         setDesktopGeoHint (0, 0); 
    3657         break; 
    3658     } 
    3659     case any: 
    3660         mDesktopGeoType = any; 
    3661         mDesktopGeometry = QRect (0, 0, 0, 0); 
    3662         break; 
    3663     default: 
    3664         AssertMsgFailed(("Invalid desktop geometry type %d\n", type)); 
    3665         mDesktopGeoType = invalid; 
     3627void VBoxConsoleView::setDesktopGeometry (DesktopGeo aGeo, int aWidth, int aHeight) 
     3628
     3629    LogFlowThisFunc (("aGeo=%s, aWidth=%d, aHeight=%d\n", 
     3630                      (aGeo == DesktopGeo_Fixed ? "Fixed" : 
     3631                       aGeo == DesktopGeo_Automatic ? "Automatic" : 
     3632                       aGeo == DesktopGeo_Any ? "Any" : 
     3633                       aGeo == DesktopGeo_Unchanged ? "Unchanged" : "Invalid"), 
     3634                      aWidth, aHeight)); 
     3635    Assert ((aGeo != DesktopGeo_Unchanged) || (mDesktopGeo != DesktopGeo_Invalid)); 
     3636    if (DesktopGeo_Unchanged == aGeo) 
     3637        aGeo = mDesktopGeo; 
     3638    switch (aGeo) 
     3639    { 
     3640        case DesktopGeo_Fixed: 
     3641            mDesktopGeo = DesktopGeo_Fixed; 
     3642            if (aWidth != 0 && aHeight != 0) 
     3643                mDesktopGeometry = QRect (0, 0, aWidth, aHeight); 
     3644            setDesktopGeoHint (0, 0); 
     3645            break; 
     3646        case DesktopGeo_Automatic: 
     3647        { 
     3648            mDesktopGeo = DesktopGeo_Automatic; 
     3649            QRect desktop = QApplication::desktop()->screenGeometry (this); 
     3650            mDesktopGeometry = QRect (0, 0, desktop.width() - 100, desktop.height() - 100); 
     3651            LogFlowThisFunc (("Setting %d, %d\n", desktop.width() - 100, desktop.height() - 100)); 
     3652            setDesktopGeoHint (0, 0); 
     3653            break; 
     3654        } 
     3655        case DesktopGeo_Any: 
     3656            mDesktopGeo = DesktopGeo_Any; 
     3657            mDesktopGeometry = QRect (0, 0, 0, 0); 
     3658            break; 
     3659        default: 
     3660            AssertMsgFailed(("Invalid desktop geometry type %d\n", aGeo)); 
     3661            mDesktopGeo = DesktopGeo_Invalid; 
    36663662    } 
    36673663} 
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFrameBuffer.cpp

    r8888 r8902  
    206206        return E_POINTER; 
    207207    *aSupported = TRUE; 
    208     QRect screen = mView->getDesktopGeometry(); 
     208    QRect screen = mView->desktopGeometry(); 
    209209    if (   (screen.width() != 0) 
    210210        && (aWidth > (ULONG) screen.width()) 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy