VirtualBox

Changeset 98451 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 2, 2023 3:47:01 PM (23 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: Cleanup for UISession stuff across whole the Runtime UI; Removing where it's possible.

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

Legend:

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

    r98432 r98451  
    10851085}
    10861086
    1087 UISession *UIKeyboardHandler::uisession() const
    1088 {
    1089     return machineLogic()->uisession();
    1090 }
    1091 
    10921087UIMachine *UIKeyboardHandler::uimachine() const
    10931088{
     
    10951090}
    10961091
    1097 CKeyboard& UIKeyboardHandler::keyboard() const
    1098 {
    1099     return uisession()->keyboard();
     1092CKeyboard &UIKeyboardHandler::keyboard() const
     1093{
     1094    return machineLogic()->uisession()->keyboard();
    11001095}
    11011096
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h

    r98378 r98451  
    5555class UIMachineView;
    5656class UIMachineWindow;
    57 class UISession;
    5857class CKeyboard;
    5958#ifdef VBOX_WS_WIN
     
    148147    UIMachineLogic *machineLogic() const { return m_pMachineLogic; }
    149148    UIActionPool *actionPool() const;
    150     UISession *uisession() const;
    151149    UIMachine *uimachine() const;
    152150
    153151    /** Returns the console's keyboard reference. */
    154     CKeyboard& keyboard() const;
     152    CKeyboard &keyboard() const;
    155153
    156154    /* Event handler for registered machine-view(s): */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98450 r98451  
    527527{
    528528    /* Create new machine-logic: */
    529     UIMachineLogic *pMachineLogic = UIMachineLogic::create(this, uisession(), visualState);
     529    UIMachineLogic *pMachineLogic = UIMachineLogic::create(this, visualState);
    530530
    531531    /* First we have to check if the selected machine-logic is available at all.
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r98450 r98451  
    156156/* static */
    157157UIMachineLogic *UIMachineLogic::create(UIMachine *pMachine,
    158                                        UISession *pSession,
    159158                                       UIVisualStateType enmVisualStateType)
    160159{
    161160    AssertPtrReturn(pMachine, 0);
    162     AssertPtrReturn(pSession, 0);
    163161
    164162    UIMachineLogic *pLogic = 0;
     
    166164    {
    167165        case UIVisualStateType_Normal:
    168             pLogic = new UIMachineLogicNormal(pMachine, pSession);
     166            pLogic = new UIMachineLogicNormal(pMachine);
    169167            break;
    170168        case UIVisualStateType_Fullscreen:
    171             pLogic = new UIMachineLogicFullscreen(pMachine, pSession);
     169            pLogic = new UIMachineLogicFullscreen(pMachine);
    172170            break;
    173171        case UIVisualStateType_Seamless:
    174             pLogic = new UIMachineLogicSeamless(pMachine, pSession);
     172            pLogic = new UIMachineLogicSeamless(pMachine);
    175173            break;
    176174        case UIVisualStateType_Scale:
    177             pLogic = new UIMachineLogicScale(pMachine, pSession);
     175            pLogic = new UIMachineLogicScale(pMachine);
    178176            break;
    179177        case UIVisualStateType_Invalid:
     
    274272    sltAdditionsStateChanged();
    275273    sltMouseCapabilityChanged();
     274}
     275
     276UISession *UIMachineLogic::uisession() const
     277{
     278    return uimachine()->uisession();
    276279}
    277280
     
    755758}
    756759
    757 UIMachineLogic::UIMachineLogic(UIMachine *pMachine, UISession *pSession)
     760UIMachineLogic::UIMachineLogic(UIMachine *pMachine)
    758761    : QIWithRetranslateUI3<QObject>(pMachine)
    759762    , m_pMachine(pMachine)
    760     , m_pSession(pSession)
    761763    , m_pKeyboardHandler(0)
    762764    , m_pMouseHandler(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r98426 r98451  
    9393      * @param  pSession            Brings the session this logic is created for.
    9494      * @param  enmVisualStateType  Brings the visual state type of logic to be created. */
    95     static UIMachineLogic *create(UIMachine *pMachine, UISession *pSession, UIVisualStateType enmVisualStateType);
     95    static UIMachineLogic *create(UIMachine *pMachine, UIVisualStateType enmVisualStateType);
    9696    /** Factory function to destroy passed @a pLogic. */
    9797    static void destroy(UIMachineLogic *pLogic);
     
    115115    UIMachine *uimachine() const { return m_pMachine; }
    116116    /** Returns session UI reference.  */
    117     UISession *uisession() const { return m_pSession; }
    118 
     117    UISession *uisession() const;
    119118    /** Returns action-pool reference.  */
    120119    UIActionPool *actionPool() const;
     
    208207protected:
    209208
    210     /** Constructs a logic passing @a pMachine and @a pSession to the base-class.
    211       * @param  pMachine  Brings the machine this logic belongs to.
    212       * @param  pSession  Brings the session this logic is created for. */
    213     UIMachineLogic(UIMachine *pMachine, UISession *pSession);
     209    /** Constructs a logic passing @a pMachine to the base-class.
     210      * @param  pMachine  Brings the machine this logic belongs to. */
     211    UIMachineLogic(UIMachine *pMachine);
    214212    /* Destructs the logic. */
    215213    virtual ~UIMachineLogic() RT_OVERRIDE;
     
    415413    /* Private variables: */
    416414    UIMachine *m_pMachine;
    417     UISession *m_pSession;
    418415    UIKeyboardHandler *m_pKeyboardHandler;
    419416    UIMouseHandler *m_pMouseHandler;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r98432 r98451  
    548548}
    549549
    550 UISession *UIMouseHandler::uisession() const
    551 {
    552     return machineLogic()->uisession();
    553 }
    554 
    555550UIMachine *UIMouseHandler::uimachine() const
    556551{
     
    558553}
    559554
    560 CDisplay& UIMouseHandler::display() const
    561 {
    562     return uisession()->display();
    563 }
    564 
    565 CMouse& UIMouseHandler::mouse() const
    566 {
    567     return uisession()->mouse();
     555CDisplay &UIMouseHandler::display() const
     556{
     557    return machineLogic()->uisession()->display();
     558}
     559
     560CMouse &UIMouseHandler::mouse() const
     561{
     562    return machineLogic()->uisession()->mouse();
    568563}
    569564
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h

    r98378 r98451  
    4949class UIMachineView;
    5050class UIMachineWindow;
    51 class UISession;
    5251class CDisplay;
    5352class CMouse;
     
    109108    /* Getters: */
    110109    UIMachineLogic *machineLogic() const { return m_pMachineLogic; }
    111     UISession *uisession() const;
    112110    UIMachine *uimachine() const;
    113111
    114112    /** Returns the console's display reference. */
    115     CDisplay& display() const;
     113    CDisplay &display() const;
    116114    /** Returns the console's mouse reference. */
    117     CMouse& mouse() const;
     115    CMouse &mouse() const;
    118116
    119117    /* Event handler for registered machine-view(s): */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp

    r98450 r98451  
    155155        /* We have to try to enable disabled guest-screens if any: */
    156156        int cGuestScreensToEnable = qMin(cExcessiveHostScreens, cDisabledGuestScreens);
    157         UISession *pSession = m_pMachineLogic->uisession();
    158157        for (int iGuestScreenIndex = 0; iGuestScreenIndex < cGuestScreensToEnable; ++iGuestScreenIndex)
    159158        {
     
    163162            /* Try to get previous guest-screen arguments: */
    164163            int iGuestScreen = m_disabledGuestScreens[iGuestScreenIndex];
    165             if (UIFrameBuffer *pFrameBuffer = pSession->frameBuffer(iGuestScreen))
     164            if (UIFrameBuffer *pFrameBuffer = m_pMachineLogic->uisession()->frameBuffer(iGuestScreen))
    166165            {
    167166                if (pFrameBuffer->width() > 0)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r98450 r98451  
    5454
    5555
    56 UIMachineLogicFullscreen::UIMachineLogicFullscreen(UIMachine *pMachine, UISession *pSession)
    57     : UIMachineLogic(pMachine, pSession)
     56UIMachineLogicFullscreen::UIMachineLogicFullscreen(UIMachine *pMachine)
     57    : UIMachineLogic(pMachine)
    5858    , m_pPopupMenu(0)
    5959#ifdef VBOX_WS_MAC
     
    777777            const int iWantedHostScreenIndex = hostScreenForGuestScreen((int)uScreenID);
    778778            const int iCurrentHostScreenIndex = UIDesktopWidgetWatchdog::screenNumber(pMachineWindow);
    779             const QSize frameBufferSize((int)uisession()->frameBuffer(uScreenID)->width(), (int)uisession()->frameBuffer(uScreenID)->height());
     779            const UIFrameBuffer *pFrameBuffer = uisession()->frameBuffer(uScreenID);
     780            const QSize frameBufferSize(pFrameBuffer->width(), pFrameBuffer->height());
    780781            const QSize screenSize = gpDesktop->screenGeometry(iWantedHostScreenIndex).size();
    781782
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

    r98375 r98451  
    6060
    6161    /** Constructs a logic passing @a pMachine and @a pSession to the base-class.
    62       * @param  pMachine  Brings the machine this logic belongs to.
    63       * @param  pSession  Brings the session this logic is created for. */
    64     UIMachineLogicFullscreen(UIMachine *pMachine, UISession *pSession);
     62      * @param  pMachine  Brings the machine this logic belongs to. */
     63    UIMachineLogicFullscreen(UIMachine *pMachine);
    6564    /** Destructs the logic. */
    6665    virtual ~UIMachineLogicFullscreen() RT_OVERRIDE;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r98450 r98451  
    4242#include "UIMenuBarEditorWindow.h"
    4343#include "UIMessageCenter.h"
    44 #include "UISession.h"
    4544#include "UIStatusBarEditorWindow.h"
    4645#ifndef VBOX_WS_MAC
     
    5655
    5756
    58 UIMachineLogicNormal::UIMachineLogicNormal(UIMachine *pMachine, UISession *pSession)
    59     : UIMachineLogic(pMachine, pSession)
     57UIMachineLogicNormal::UIMachineLogicNormal(UIMachine *pMachine)
     58    : UIMachineLogic(pMachine)
    6059#ifndef VBOX_WS_MAC
    6160    , m_pPopupMenu(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h

    r98375 r98451  
    4343
    4444    /** Constructs a logic passing @a pMachine and @a pSession to the base-class.
    45       * @param  pMachine  Brings the machine this logic belongs to.
    46       * @param  pSession  Brings the session this logic is created for. */
    47     UIMachineLogicNormal(UIMachine *pMachine, UISession *pSession);
     45      * @param  pMachine  Brings the machine this logic belongs to. */
     46    UIMachineLogicNormal(UIMachine *pMachine);
    4847
    4948    /** Returns visual state type. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.cpp

    r98419 r98451  
    5050
    5151
    52 UIMachineLogicScale::UIMachineLogicScale(UIMachine *pMachine, UISession *pSession)
    53     : UIMachineLogic(pMachine, pSession)
     52UIMachineLogicScale::UIMachineLogicScale(UIMachine *pMachine)
     53    : UIMachineLogic(pMachine)
    5454#ifndef VBOX_WS_MAC
    5555    , m_pPopupMenu(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.h

    r98375 r98451  
    4343
    4444    /** Constructs a logic passing @a pMachine and @a pSession to the base-class.
    45       * @param  pMachine  Brings the machine this logic belongs to.
    46       * @param  pSession  Brings the session this logic is created for. */
    47     UIMachineLogicScale(UIMachine *pMachine, UISession *pSession);
     45      * @param  pMachine  Brings the machine this logic belongs to. */
     46    UIMachineLogicScale(UIMachine *pMachine);
    4847
    4948    /** Returns visual state type. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r98450 r98451  
    3939#include "UIMessageCenter.h"
    4040#include "UIMultiScreenLayout.h"
    41 #include "UISession.h"
    4241#include "UIShortcutPool.h"
    4342#ifndef VBOX_WS_MAC
     
    5150
    5251
    53 UIMachineLogicSeamless::UIMachineLogicSeamless(UIMachine *pMachine, UISession *pSession)
    54     : UIMachineLogic(pMachine, pSession)
     52UIMachineLogicSeamless::UIMachineLogicSeamless(UIMachine *pMachine)
     53    : UIMachineLogic(pMachine)
    5554#ifndef VBOX_WS_MAC
    5655    , m_pPopupMenu(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h

    r98375 r98451  
    4646
    4747    /** Constructs a logic passing @a pMachine and @a pSession to the base-class.
    48       * @param  pMachine  Brings the machine this logic belongs to.
    49       * @param  pSession  Brings the session this logic is created for. */
    50     UIMachineLogicSeamless(UIMachine *pMachine, UISession *pSession);
     48      * @param  pMachine  Brings the machine this logic belongs to. */
     49    UIMachineLogicSeamless(UIMachine *pMachine);
    5150    /** Destructs the logic. */
    5251    virtual ~UIMachineLogicSeamless() RT_OVERRIDE;
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