VirtualBox

Changeset 98039 in vbox


Ignore:
Timestamp:
Jan 10, 2023 4:09:45 PM (23 months ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Get rid of friend classes, part #2 (mode implementations).

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

Legend:

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

    r96407 r98039  
    8282    return UIKeyboardHandler::eventFilter(pWatchedObject, pEvent);
    8383}
    84 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIKeyboardHandlerFullscreen.h

    r96407 r98039  
    4141    Q_OBJECT;
    4242
    43 protected:
     43public:
    4444
    4545    /** Fullscreen keyboard-handler constructor. */
     
    5252    /** General event-filter. */
    5353    bool eventFilter(QObject *pWatched, QEvent *pEvent);
    54 
    55     /* Friend class: */
    56     friend class UIKeyboardHandler;
    5754};
    5855
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r97682 r98039  
    7070}
    7171
     72int UIMachineLogicFullscreen::hostScreenForGuestScreen(int iScreenId) const
     73{
     74    return m_pScreenLayout->hostScreenForGuestScreen(iScreenId);
     75}
     76
     77bool UIMachineLogicFullscreen::hasHostScreenForGuestScreen(int iScreenId) const
     78{
     79    return m_pScreenLayout->hasHostScreenForGuestScreen(iScreenId);
     80}
     81
    7282bool UIMachineLogicFullscreen::checkAvailability()
    7383{
     
    128138        pMachineWindow->showInNecessaryMode();
    129139#endif /* !VBOX_WS_MAC */
    130 }
    131 
    132 int UIMachineLogicFullscreen::hostScreenForGuestScreen(int iScreenId) const
    133 {
    134     return m_pScreenLayout->hostScreenForGuestScreen(iScreenId);
    135 }
    136 
    137 bool UIMachineLogicFullscreen::hasHostScreenForGuestScreen(int iScreenId) const
    138 {
    139     return m_pScreenLayout->hasHostScreenForGuestScreen(iScreenId);
    140140}
    141141
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

    r96407 r98039  
    4343class UIMultiScreenLayout;
    4444
    45 /* Fullscreen machine logic implementation: */
     45/** UIMachineLogic subclass used as full-screen machine logic implementation. */
    4646class UIMachineLogicFullscreen : public UIMachineLogic
    4747{
     
    5757#endif /* RT_OS_DARWIN */
    5858
    59 #ifdef VBOX_WS_MAC
    6059public:
    6160
     61    /** Constructs full-screen logic passing @a pParent to the base-class.
     62      * @param  pSession  Brings the session UI reference. */
     63    UIMachineLogicFullscreen(QObject *pParent, UISession *pSession);
     64    /** Destructs full-screen logic. */
     65    virtual ~UIMachineLogicFullscreen() RT_OVERRIDE;
     66
     67    /** Returns an index of host-screen for guest-screen with @a iScreenId specified. */
     68    int hostScreenForGuestScreen(int iScreenId) const;
     69    /** Returns whether there is a host-screen for guest-screen with @a iScreenId specified. */
     70    bool hasHostScreenForGuestScreen(int iScreenId) const;
     71
     72#ifdef VBOX_WS_MAC
    6273    /** Returns whether screens have separate spaces. */
    6374    bool screensHaveSeparateSpaces() const { return m_fScreensHaveSeparateSpaces; }
     
    6576
    6677protected:
    67 
    68     /* Constructor/destructor: */
    69     UIMachineLogicFullscreen(QObject *pParent, UISession *pSession);
    70     ~UIMachineLogicFullscreen();
    7178
    7279    /* Check if this logic is available: */
     
    7885    /** Adjusts machine-window geometry if necessary for 'Fullscreen'. */
    7986    virtual void adjustMachineWindowsGeometry();
    80 
    81     /* Helpers: Multi-screen stuff: */
    82     int hostScreenForGuestScreen(int iScreenId) const;
    83     bool hasHostScreenForGuestScreen(int iScreenId) const;
    8487
    8588private slots:
     
    172175    QSet<UIMachineWindow*> m_invalidFullscreenMachineWindows;
    173176#endif /* VBOX_WS_MAC */
    174 
    175     /* Friend classes: */
    176     friend class UIMachineLogic;
    177     friend class UIMachineWindowFullscreen;
    178     friend class UIMachineViewFullscreen;
    179177};
    180178
    181179#endif /* !FEQT_INCLUDED_SRC_runtime_fullscreen_UIMachineLogicFullscreen_h */
    182 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h

    r97975 r98039  
    3232#endif
    3333
    34 /* Local includes */
     34/* GUI includes: */
    3535#include "UIMachineView.h"
    3636
     37/** UIMachineView subclass used as full-screen machine view implementation. */
    3738class UIMachineViewFullscreen : public UIMachineView
    3839{
    3940    Q_OBJECT;
    4041
    41 protected:
     42public:
    4243
    4344    /* Fullscreen machine-view constructor: */
     
    8081    /* Private variables: */
    8182    bool m_fGuestAutoresizeEnabled : 1;
    82 
    83     /* Friend classes: */
    84     friend class UIMachineView;
    8583};
    8684
    8785#endif /* !FEQT_INCLUDED_SRC_runtime_fullscreen_UIMachineViewFullscreen_h */
    88 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h

    r96407 r98039  
    4040#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    4141
    42 /** UIMachineWindow reimplementation,
    43   * providing GUI with machine-window for the full-screen mode. */
     42/** UIMachineWindow subclass used as full-screen machine window implementation. */
    4443class UIMachineWindowFullscreen : public UIMachineWindow
    4544{
     
    6059#endif /* RT_OS_DARWIN */
    6160
    62 protected:
     61public:
    6362
    6463    /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
    6564    UIMachineWindowFullscreen(UIMachineLogic *pMachineLogic, ulong uScreenId);
     65
     66protected:
    6667
    6768#ifdef VBOX_WS_MAC
     
    159160    bool m_fIsMinimized;
    160161#endif
    161 
    162     /** Factory support. */
    163     friend class UIMachineWindow;
    164162};
    165163
    166164#endif /* !FEQT_INCLUDED_SRC_runtime_fullscreen_UIMachineWindowFullscreen_h */
    167 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIKeyboardHandlerNormal.cpp

    r96407 r98039  
    123123}
    124124#endif /* !VBOX_WS_MAC */
    125 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIKeyboardHandlerNormal.h

    r96407 r98039  
    4141    Q_OBJECT;
    4242
    43 protected:
     43public:
    4444
    4545    /** Normal keyboard-handler constructor. */
     
    5454    bool eventFilter(QObject *pWatched, QEvent *pEvent);
    5555#endif /* !VBOX_WS_MAC */
    56 
    57     /* Friend class: */
    58     friend class UIKeyboardHandler;
    5956};
    6057
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.h

    r96407 r98039  
    3232#endif
    3333
    34 /* Local includes: */
     34/* GUI includes: */
    3535#include "UIMachineLogic.h"
    3636
    37 /* Normal machine logic implementation: */
     37/** UIMachineLogic subclass used as normal machine logic implementation. */
    3838class UIMachineLogicNormal : public UIMachineLogic
    3939{
    4040    Q_OBJECT;
    4141
     42public:
     43
     44    /** Constructs normal logic passing @a pParent to the base-class.
     45      * @param  pSession  Brings the session UI reference. */
     46    UIMachineLogicNormal(QObject *pParent, UISession *pSession);
     47
    4248protected:
    43 
    44     /* Constructor: */
    45     UIMachineLogicNormal(QObject *pParent, UISession *pSession);
    4649
    4750    /* Check if this logic is available: */
     
    101104    QMenu *m_pPopupMenu;
    102105#endif /* !VBOX_WS_MAC */
    103 
    104     /* Friend classes: */
    105     friend class UIMachineLogic;
    106106};
    107107
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h

    r97975 r98039  
    3232#endif
    3333
    34 /* Local includes */
     34/* GUI includes: */
    3535#include "UIMachineView.h"
    3636
     37/** UIMachineView subclass used as normal machine view implementation. */
    3738class UIMachineViewNormal : public UIMachineView
    3839{
    3940    Q_OBJECT;
    4041
    41 protected:
     42public:
    4243
    4344    /* Normal machine-view constructor: */
     
    8485    /* Private members: */
    8586    bool m_fGuestAutoresizeEnabled : 1;
    86 
    87     /* Friend classes: */
    88     friend class UIMachineView;
    8987};
    9088
    9189#endif /* !FEQT_INCLUDED_SRC_runtime_normal_UIMachineViewNormal_h */
    92 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r96407 r98039  
    4040class UIAction;
    4141
    42 /** UIMachineWindow reimplementation,
    43   * providing GUI with machine-window for the normal mode. */
     42/** UIMachineWindow subclass used as normal machine window implementation. */
    4443class UIMachineWindowNormal : public UIMachineWindow
    4544{
     
    5150    void sigGeometryChange(const QRect &rect);
    5251
    53 protected:
     52public:
    5453
    5554    /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
     
    156155    /** Holds the geometry save timer ID. */
    157156    int  m_iGeometrySaveTimerId;
    158 
    159     /** Factory support. */
    160     friend class UIMachineWindow;
    161157};
    162158
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIKeyboardHandlerScale.cpp

    r96407 r98039  
    9090}
    9191#endif /* !VBOX_WS_MAC */
    92 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIKeyboardHandlerScale.h

    r96407 r98039  
    4141    Q_OBJECT;
    4242
    43 protected:
     43public:
    4444
    4545    /** Scale keyboard-handler constructor. */
     
    5454    bool eventFilter(QObject *pWatched, QEvent *pEvent);
    5555#endif /* !VBOX_WS_MAC */
    56 
    57     /* Friend class: */
    58     friend class UIKeyboardHandler;
    5956};
    6057
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineLogicScale.h

    r96407 r98039  
    3232#endif
    3333
    34 /* Local includes: */
     34/* GUI includes: */
    3535#include "UIMachineLogic.h"
    3636
    37 /* Scale machine logic implementation: */
     37/** UIMachineLogic subclass used as scaled machine logic implementation. */
    3838class UIMachineLogicScale : public UIMachineLogic
    3939{
    4040    Q_OBJECT;
    4141
     42public:
     43
     44    /** Constructs scaled logic passing @a pParent to the base-class.
     45      * @param  pSession  Brings the session UI reference. */
     46    UIMachineLogicScale(QObject *pParent, UISession *pSession);
     47
    4248protected:
    43 
    44     /* Constructor: */
    45     UIMachineLogicScale(QObject *pParent, UISession *pSession);
    4649
    4750    /* Check if this logic is available: */
     
    8386    QMenu *m_pPopupMenu;
    8487#endif /* !RT_OS_DARWIN */
    85 
    86     /* Friend classes: */
    87     friend class UIMachineLogic;
    8888};
    8989
    9090#endif /* !FEQT_INCLUDED_SRC_runtime_scale_UIMachineLogicScale_h */
    91 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp

    r97977 r98039  
    227227        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    228228}
    229 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h

    r96407 r98039  
    3232#endif
    3333
    34 /* Local includes */
     34/* GUI includes: */
    3535#include "UIMachineView.h"
    3636
     37/** UIMachineView subclass used as scaled machine view implementation. */
    3738class UIMachineViewScale : public UIMachineView
    3839{
    3940    Q_OBJECT;
    4041
    41 protected:
     42public:
    4243
    4344    /* Scale machine-view constructor: */
     
    6768    QSize calculateMaxGuestSize() const;
    6869    void updateSliders();
    69 
    70     /* Friend classes: */
    71     friend class UIMachineView;
    7270};
    7371
    7472#endif /* !FEQT_INCLUDED_SRC_runtime_scale_UIMachineViewScale_h */
    75 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.h

    r96407 r98039  
    3535#include "UIMachineWindow.h"
    3636
    37 /** UIMachineWindow reimplementation,
    38   * providing GUI with machine-window for the scale mode. */
     37/** UIMachineWindow subclass used as scaled machine window implementation. */
    3938class UIMachineWindowScale : public UIMachineWindow
    4039{
    4140    Q_OBJECT;
    4241
    43 protected:
     42public:
    4443
    4544    /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
     
    8786    /** Holds the geometry save timer ID. */
    8887    int  m_iGeometrySaveTimerId;
    89 
    90     /** Factory support. */
    91     friend class UIMachineWindow;
    9288};
    9389
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIKeyboardHandlerSeamless.cpp

    r96407 r98039  
    9090}
    9191#endif /* !VBOX_WS_MAC */
    92 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIKeyboardHandlerSeamless.h

    r96407 r98039  
    4141    Q_OBJECT;
    4242
    43 protected:
     43public:
    4444
    4545    /** Seamless keyboard-handler constructor. */
     
    5454    bool eventFilter(QObject *pWatched, QEvent *pEvent);
    5555#endif /* !VBOX_WS_MAC */
    56 
    57     /* Friend class: */
    58     friend class UIKeyboardHandler;
    5956};
    6057
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp

    r97514 r98039  
    6666}
    6767
     68int UIMachineLogicSeamless::hostScreenForGuestScreen(int iScreenId) const
     69{
     70    return m_pScreenLayout->hostScreenForGuestScreen(iScreenId);
     71}
     72
     73bool UIMachineLogicSeamless::hasHostScreenForGuestScreen(int iScreenId) const
     74{
     75    return m_pScreenLayout->hasHostScreenForGuestScreen(iScreenId);
     76}
     77
    6878bool UIMachineLogicSeamless::checkAvailability()
    6979{
     
    102112    foreach (UIMachineWindow *pMachineWindow, machineWindows())
    103113        pMachineWindow->showInNecessaryMode();
    104 }
    105 
    106 int UIMachineLogicSeamless::hostScreenForGuestScreen(int iScreenId) const
    107 {
    108     return m_pScreenLayout->hostScreenForGuestScreen(iScreenId);
    109 }
    110 
    111 bool UIMachineLogicSeamless::hasHostScreenForGuestScreen(int iScreenId) const
    112 {
    113     return m_pScreenLayout->hasHostScreenForGuestScreen(iScreenId);
    114114}
    115115
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.h

    r97512 r98039  
    3232#endif
    3333
    34 /* Local includes: */
     34/* GUI includes: */
    3535#include "UIMachineLogic.h"
    3636
     
    3838class UIMultiScreenLayout;
    3939
    40 /* Seamless machine logic implementation: */
     40/** UIMachineLogic subclass used as seamless machine logic implementation. */
    4141class UIMachineLogicSeamless : public UIMachineLogic
    4242{
    4343    Q_OBJECT;
    4444
     45public:
     46
     47    /** Constructs seamless logic passing @a pParent to the base-class.
     48      * @param  pSession  Brings the session UI reference. */
     49    UIMachineLogicSeamless(QObject *pParent, UISession *pSession);
     50    /** Destructs seamless logic. */
     51    virtual ~UIMachineLogicSeamless() RT_OVERRIDE;
     52
     53    /** Returns an index of host-screen for guest-screen with @a iScreenId specified. */
     54    int hostScreenForGuestScreen(int iScreenId) const;
     55    /** Returns whether there is a host-screen for guest-screen with @a iScreenId specified. */
     56    bool hasHostScreenForGuestScreen(int iScreenId) const;
     57
    4558protected:
    46 
    47     /* Constructor/destructor: */
    48     UIMachineLogicSeamless(QObject *pParent, UISession *pSession);
    49     ~UIMachineLogicSeamless();
    5059
    5160    /* Check if this logic is available: */
     
    5766    /** Adjusts machine-window geometry if necessary for 'Seamless'. */
    5867    virtual void adjustMachineWindowsGeometry();
    59 
    60     /* Helpers: Multi-screen stuff: */
    61     int hostScreenForGuestScreen(int iScreenId) const;
    62     bool hasHostScreenForGuestScreen(int iScreenId) const;
    6368
    6469private slots:
     
    110115    QMenu *m_pPopupMenu;
    111116#endif /* !RT_OS_DARWIN */
    112 
    113     /* Friend classes: */
    114     friend class UIMachineLogic;
    115     friend class UIMachineWindowSeamless;
    116     friend class UIMachineViewSeamless;
    117117};
    118118
    119119#endif /* !FEQT_INCLUDED_SRC_runtime_seamless_UIMachineLogicSeamless_h */
    120 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h

    r96407 r98039  
    3232#endif
    3333
    34 /* Local includes */
     34/* GUI includes: */
    3535#include "UIMachineView.h"
    3636
     37/** UIMachineView subclass used as seamless machine view implementation. */
    3738class UIMachineViewSeamless : public UIMachineView
    3839{
    3940    Q_OBJECT;
    4041
    41 protected:
     42public:
    4243
    4344    /* Seamless machine-view constructor: */
     
    7778    QRect workingArea() const;
    7879    QSize calculateMaxGuestSize() const;
    79 
    80     /* Friend classes: */
    81     friend class UIMachineView;
    8280};
    8381
    8482#endif /* !FEQT_INCLUDED_SRC_runtime_seamless_UIMachineViewSeamless_h */
    85 
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.h

    r96407 r98039  
    4040#endif /* VBOX_WS_WIN || VBOX_WS_X11 */
    4141
    42 /** UIMachineWindow reimplementation,
    43   * providing GUI with machine-window for the seamless mode. */
     42/** UIMachineWindow subclass used as seamless machine window implementation. */
    4443class UIMachineWindowSeamless : public UIMachineWindow
    4544{
    4645    Q_OBJECT;
    4746
    48 protected:
     47public:
    4948
    5049    /** Constructor, passes @a pMachineLogic and @a uScreenId to the UIMachineWindow constructor. */
     
    132131    bool m_fIsMinimized;
    133132#endif
    134 
    135     /** Factory support. */
    136     friend class UIMachineWindow;
    137133};
    138134
    139135#endif /* !FEQT_INCLUDED_SRC_runtime_seamless_UIMachineWindowSeamless_h */
    140 
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