VirtualBox

Changeset 98378 in vbox


Ignore:
Timestamp:
Feb 1, 2023 12:34:07 PM (20 months ago)
Author:
vboxsync
Message:

Merging r155200 and r155201 from gui4 branch: FE/Qt: Runtime UI: Pass UIMachine to machine-view, keyboard and mouse handlers; A bit of cleanup for UIMachine prepare/cleanup cascade.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3:79645-79692
        21 /branches/dsen/gui4:155183-155185,155187,155198
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201
        2222/trunk/src:92342,154921
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2/src/VBox:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3/src/VBox:79645-79692
        21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198
         21/branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201
  • trunk/src/VBox/Frontends

    • Property svn:mergeinfo
      •  

        old new  
        1616/branches/dsen/gui2/src/VBox/Frontends:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        1717/branches/dsen/gui3/src/VBox/Frontends:79645-79692
        18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198
         18/branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r98103 r98378  
    4646
    4747/* GUI includes: */
     48#include "UIActionPool.h"
    4849#include "UICommon.h"
    4950#include "UIExtraDataManager.h"
     51#include "UIHostComboEditor.h"
     52#include "UIKeyboardHandlerFullscreen.h"
     53#include "UIKeyboardHandlerNormal.h"
     54#include "UIKeyboardHandlerScale.h"
     55#include "UIKeyboardHandlerSeamless.h"
     56#include "UIMachine.h"
     57#include "UIMachineLogic.h"
     58#include "UIMachineView.h"
     59#include "UIMachineWindow.h"
    5060#include "UIMessageCenter.h"
    51 #include "UIActionPool.h"
    52 #include "UISession.h"
    53 #include "UIMachineLogic.h"
    54 #include "UIMachineWindow.h"
    55 #include "UIMachineView.h"
    56 #include "UIHostComboEditor.h"
    57 #include "UIKeyboardHandlerNormal.h"
    58 #include "UIKeyboardHandlerFullscreen.h"
    59 #include "UIKeyboardHandlerSeamless.h"
    60 #include "UIKeyboardHandlerScale.h"
    6161#include "UIMouseHandler.h"
    6262#include "UINotificationCenter.h"
     63#include "UISession.h"
    6364#ifdef VBOX_WS_MAC
    6465# include "UICocoaApplication.h"
     
    10791080}
    10801081
    1081 /* Machine-logic getter: */
    1082 UIMachineLogic* UIKeyboardHandler::machineLogic() const
    1083 {
    1084     return m_pMachineLogic;
    1085 }
    1086 
    1087 /* Action-pool getter: */
    1088 UIActionPool* UIKeyboardHandler::actionPool() const
     1082UIActionPool *UIKeyboardHandler::actionPool() const
    10891083{
    10901084    return machineLogic()->actionPool();
    10911085}
    10921086
    1093 /* UI Session getter: */
    1094 UISession* UIKeyboardHandler::uisession() const
     1087UISession *UIKeyboardHandler::uisession() const
    10951088{
    10961089    return machineLogic()->uisession();
     1090}
     1091
     1092UIMachine *UIKeyboardHandler::uimachine() const
     1093{
     1094    return machineLogic()->uimachine();
    10971095}
    10981096
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h

    r98103 r98378  
    5151class QWidget;
    5252class UIActionPool;
     53class UIMachine;
     54class UIMachineLogic;
     55class UIMachineView;
     56class UIMachineWindow;
    5357class UISession;
    54 class UIMachineLogic;
    55 class UIMachineWindow;
    56 class UIMachineView;
    5758class CKeyboard;
    5859#ifdef VBOX_WS_WIN
     
    145146
    146147    /* Common getters: */
    147     UIMachineLogic* machineLogic() const;
    148     UIActionPool* actionPool() const;
    149     UISession* uisession() const;
     148    UIMachineLogic *machineLogic() const { return m_pMachineLogic; }
     149    UIActionPool *actionPool() const;
     150    UISession *uisession() const;
     151    UIMachine *uimachine() const;
    150152
    151153    /** Returns the console's keyboard reference. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98376 r98378  
    234234bool UIMachine::prepare()
    235235{
    236     /* Try to prepare session UI: */
    237     if (!prepareSession())
     236    /* Try to create session UI: */
     237    if (!UISession::create(m_pSession, this))
    238238        return false;
     239
     240    /* Make sure session UI created: */
     241    AssertReturn(m_pSession, false);
    239242
    240243    /* Cache media data early if necessary: */
    241244    if (uiCommon().agressiveCaching())
    242     {
    243         AssertReturn(m_pSession, false);
    244245        uiCommon().enumerateMedia(m_pSession->machineMedia());
    245     }
    246246
    247247    /* Prepare stuff: */
     
    250250
    251251    /* Load settings: */
    252     loadSessionSettings();
     252    loadSettings();
    253253
    254254    /* Try to initialize session UI: */
    255255    if (!uisession()->initialize())
    256         return false;
    257 
    258     /* True by default: */
    259     return true;
    260 }
    261 
    262 bool UIMachine::prepareSession()
    263 {
    264     /* Try to create session UI: */
    265     if (!UISession::create(m_pSession, this))
    266256        return false;
    267257
     
    326316}
    327317
    328 void UIMachine::loadSessionSettings()
     318void UIMachine::loadSettings()
    329319{
    330320    /* Load extra-data settings: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98376 r98378  
    117117    /** Prepare routine. */
    118118    bool prepare();
    119     /** Prepare routine: Session stuff. */
    120     bool prepareSession();
    121     /** Prepares machine-window icon. */
     119    /** Prepare routine: Machine-window icon. */
    122120    void prepareMachineWindowIcon();
    123121    /** Prepare routine: Machine-logic stuff. */
    124122    void prepareMachineLogic();
    125123
    126     /* Settings stuff: */
    127     void loadSessionSettings();
     124    /** Performs settings loading. */
     125    void loadSettings();
    128126
    129127    /** Cleanup routine: Machine-logic stuff. */
     
    160158        /** Holds the cached machine-window icon. */
    161159        QIcon *m_pMachineWindowIcon;
     160
    162161#ifndef VBOX_WS_MAC
    163162        /** Holds redefined machine-window name postfix. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r98103 r98378  
    3939#include "UIDesktopWidgetWatchdog.h"
    4040#include "UIExtraDataManager.h"
     41#include "UIMachine.h"
    4142#include "UIMessageCenter.h"
    4243#include "UISession.h"
     
    259260    /* Update console's display viewport and 3D overlay: */
    260261    updateViewport();
     262}
     263
     264UIMachine *UIMachineView::uimachine() const
     265{
     266    return machineWindow()->uimachine();
    261267}
    262268
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r98103 r98378  
    6161/* Forward declarations: */
    6262class UIActionPool;
    63 class UISession;
     63class UIMachine;
    6464class UIMachineLogic;
    6565class UIMachineWindow;
    6666class UINativeEventFilter;
     67class UISession;
    6768class CConsole;
    6869class CDisplay;
     
    112113    ulong screenId() const { return m_uScreenId; }
    113114
     115    /** Returns the machine UI reference. */
     116    UIMachine *uimachine() const;
    114117    /** Returns the session UI reference. */
    115118    UISession *uisession() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp

    r98103 r98378  
    3636#include "UIDesktopWidgetWatchdog.h"
    3737#include "UIExtraDataManager.h"
     38#include "UIFrameBuffer.h"
     39#include "UIKeyboardHandler.h"
     40#include "UIMachine.h"
     41#include "UIMachineLogic.h"
     42#include "UIMachineView.h"
     43#include "UIMachineWindow.h"
    3844#include "UIMessageCenter.h"
     45#include "UIMouseHandler.h"
    3946#include "UINotificationCenter.h"
    4047#include "UISession.h"
    41 #include "UIMachineLogic.h"
    42 #include "UIMachineWindow.h"
    43 #include "UIMachineView.h"
    44 #include "UIKeyboardHandler.h"
    45 #include "UIMouseHandler.h"
    46 #include "UIFrameBuffer.h"
    4748#ifdef VBOX_WS_MAC
    4849# include "VBoxUtils-darwin.h"
     
    548549}
    549550
    550 /* Machine-logic getter: */
    551 UIMachineLogic* UIMouseHandler::machineLogic() const
    552 {
    553     return m_pMachineLogic;
    554 }
    555 
    556 /* UI Session getter: */
    557 UISession* UIMouseHandler::uisession() const
     551UISession *UIMouseHandler::uisession() const
    558552{
    559553    return machineLogic()->uisession();
     554}
     555
     556UIMachine *UIMouseHandler::uimachine() const
     557{
     558    return machineLogic()->uimachine();
    560559}
    561560
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h

    r98103 r98378  
    4545class QTouchEvent;
    4646class QWidget;
     47class UIMachine;
     48class UIMachineLogic;
     49class UIMachineView;
     50class UIMachineWindow;
    4751class UISession;
    48 class UIMachineLogic;
    49 class UIMachineWindow;
    50 class UIMachineView;
    5152class CDisplay;
    5253class CMouse;
     
    107108
    108109    /* Getters: */
    109     UIMachineLogic* machineLogic() const;
    110     UISession* uisession() const;
     110    UIMachineLogic *machineLogic() const { return m_pMachineLogic; }
     111    UISession *uisession() const;
     112    UIMachine *uimachine() const;
    111113
    112114    /** Returns the console's display reference. */
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