VirtualBox

Changeset 30677 in vbox


Ignore:
Timestamp:
Jul 6, 2010 4:39:25 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Use new IEvent interface. Massive cleanup of the event handling in the GUI.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
8 added
20 edited

Legend:

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

    r30637 r30677  
    252252        src/VBoxVMInformationDlg.h \
    253253        src/UIVMListView.h \
     254        src/UIVirtualBoxEventHandler.h \
    254255        src/VBoxVMLogViewer.h \
    255256        src/globals/VBoxGlobal.h \
    256257        src/globals/VBoxProblemReporter.h \
    257258        src/globals/VBoxUtils.h \
     259        src/globals/UIMainEventListener.h \
     260        src/globals/UIExtraDataEventHandler.h \
    258261        src/extensions/QIAdvancedSlider.h \
    259262        src/extensions/QIArrowButtonPress.h \
     
    332335        src/runtime/UIMachineView.h \
    333336        src/runtime/UIMultiScreenLayout.h \
     337        src/runtime/UIConsoleEventHandler.h \
    334338        src/runtime/normal/UIKeyboardHandlerNormal.h \
    335339        src/runtime/normal/UIMachineLogicNormal.h \
     
    360364        src/runtime/UIMachineLogic.cpp \
    361365        src/extensions/QISplitter.cpp \
     366        src/globals/UIExtraDataEventHandler.cpp
    362367
    363368ifdef VBOX_WITH_XPCOM
     
    390395        src/VBoxVMInformationDlg.cpp \
    391396        src/UIVMListView.cpp \
     397        src/UIVirtualBoxEventHandler.cpp \
    392398        src/VBoxVMLogViewer.cpp \
    393399        src/globals/COMDefs.cpp \
     
    396402        src/globals/VBoxProblemReporter.cpp \
    397403        src/globals/UIIconPool.cpp \
     404        src/globals/UIMainEventListener.cpp \
     405        src/globals/UIExtraDataEventHandler.cpp \
    398406        src/extensions/QIAdvancedSlider.cpp \
    399407        src/extensions/QIArrowButtonPress.cpp \
     
    476484        src/runtime/UIMachineMenuBar.cpp \
    477485        src/runtime/UIMultiScreenLayout.cpp \
     486        src/runtime/UIConsoleEventHandler.cpp \
    478487        src/runtime/normal/UIKeyboardHandlerNormal.cpp \
    479488        src/runtime/normal/UIMachineLogicNormal.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.h

    r28800 r30677  
    2424/* Qt includes */
    2525#include <QObject>
     26#include <QRect>
    2627
    2728class CVirtualBox;
     
    7677        return *this;
    7778    }
     79
     80    static void writeExtraDataString(CVirtualBox &vbox, const QString &key, const QString &data);
     81    static QString readExtraDataString(CVirtualBox &vbox, const QString &key);
     82    static void writeExtraDataBool(CVirtualBox &vbox, const QString &key, bool data);
     83    static bool readExtraDataBool(CVirtualBox &vbox, const QString &key);
     84    static void writeExtraDataRect(CVirtualBox &vbox, const QString &key, const QRect &data);
     85    static QRect readExtraDataRect(CVirtualBox &vbox, const QString &key);
     86    static void writeExtraDataStringList(CVirtualBox &vbox, const QString &key, const QStringList &data);
     87    static QStringList readExtraDataStringList(CVirtualBox &vbox, const QString &key);
     88    static void writeExtraDataIntList(CVirtualBox &vbox, const QString &key, const QList<int> &data);
     89    static QList<int> readExtraDataIntList(CVirtualBox &vbox, const QString &key);
    7890
    7991    // Properties
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxHelpActions.cpp

    r30206 r30677  
    2525#include "VBoxProblemReporter.h"
    2626#include "UIIconPool.h"
     27#include "UIExtraDataEventHandler.h"
    2728
    2829/* Qt includes */
     
    6768                      &vboxProblem(), SLOT (showHelpAboutDialog()));
    6869
    69     QObject::connect (&vboxGlobal(), SIGNAL (canShowRegDlg (bool)),
    70                       registerAction, SLOT (setEnabled (bool)));
    71     QObject::connect (&vboxGlobal(), SIGNAL (canShowUpdDlg (bool)),
    72                       updateAction, SLOT (setEnabled (bool)));
     70    QObject::connect (gEDataEvents, SIGNAL(sigCanShowRegistrationDlg(bool)),
     71                      registerAction, SLOT(setEnabled(bool)));
     72    QObject::connect (gEDataEvents, SIGNAL(sigCanShowUpdateDlg(bool)),
     73                      updateAction, SLOT(setEnabled(bool)));
    7374}
    7475
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp

    r30192 r30677  
    4343#include "QILabel.h"
    4444#include "UIIconPool.h"
     45#include "UIVirtualBoxEventHandler.h"
    4546#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4647
     
    517518        /// @todo refreshAll() may be slow, so it may be better to analyze
    518519        //  event details and update only what is changed */
    519         connect (&vboxGlobal(), SIGNAL (machineDataChanged (const VBoxMachineDataChangeEvent &)),
    520                  mModelessDialog, SLOT (refreshAll()));
    521         connect (&vboxGlobal(), SIGNAL (machineRegistered (const VBoxMachineRegisteredEvent &)),
    522                  mModelessDialog, SLOT (refreshAll()));
    523         connect (&vboxGlobal(), SIGNAL (snapshotChanged (const VBoxSnapshotEvent &)),
    524                  mModelessDialog, SLOT (refreshAll()));
     520        connect (gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),
     521                 mModelessDialog, SLOT(refreshAll()));
     522        connect (gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)),
     523                 mModelessDialog, SLOT(refreshAll()));
     524        connect (gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)),
     525                 mModelessDialog, SLOT(refreshAll()));
    525526    }
    526527
     
    14431444}
    14441445
    1445 void VBoxMediaManagerDlg::machineStateChanged (const VBoxMachineStateChangeEvent &aEvent)
    1446 {
    1447     switch (aEvent.state)
     1446void VBoxMediaManagerDlg::machineStateChanged(QString /* strId */, KMachineState state)
     1447{
     1448    switch (state)
    14481449    {
    14491450        case KMachineState_PoweredOff:
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.h

    r28800 r30677  
    9595    void showContextMenu (const QPoint &aPos);
    9696
    97     void machineStateChanged (const VBoxMachineStateChangeEvent &aEvent);
     97    void machineStateChanged(QString strId, KMachineState state);
    9898
    9999    void makeRequestForAdjustTable();
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp

    r30357 r30677  
    3838#include "VBoxUtils.h"
    3939#include "VBoxVMLogViewer.h"
     40#include "UIVirtualBoxEventHandler.h"
    4041
    4142#include "UIDownloaderUserManual.h"
     
    515516#endif /* MAC_LEOPARD_STYLE */
    516517
    517     /* VM tab widget containing details and snapshots tabs */
     518     /* VM tab widget containing details and snapshots tabs */
    518519    mVmTabWidget = new QITabWidget();
    519520    pSplitter->addWidget (mVmTabWidget);
     
    722723
    723724    connect (mVmDetailsView, SIGNAL (linkClicked (const QString &)),
    724             this, SLOT (vmSettings (const QString &)));
     725             this, SLOT(vmSettings(const QString &)));
    725726
    726727    /* listen to media enumeration signals */
     
    730731             this, SLOT (mediumEnumFinished (const VBoxMediaList &)));
    731732
    732     /* connect VirtualBox callback events */
    733     connect (&vboxGlobal(), SIGNAL (machineStateChanged (const VBoxMachineStateChangeEvent &)),
    734              this, SLOT (machineStateChanged (const VBoxMachineStateChangeEvent &)));
    735     connect (&vboxGlobal(), SIGNAL (machineDataChanged (const VBoxMachineDataChangeEvent &)),
    736              this, SLOT (machineDataChanged (const VBoxMachineDataChangeEvent &)));
    737     connect (&vboxGlobal(), SIGNAL (machineRegistered (const VBoxMachineRegisteredEvent &)),
    738              this, SLOT (machineRegistered (const VBoxMachineRegisteredEvent &)));
    739     connect (&vboxGlobal(), SIGNAL (sessionStateChanged (const VBoxSessionStateChangeEvent &)),
    740              this, SLOT (sessionStateChanged (const VBoxSessionStateChangeEvent &)));
    741     connect (&vboxGlobal(), SIGNAL (snapshotChanged (const VBoxSnapshotEvent &)),
    742              this, SLOT (snapshotChanged (const VBoxSnapshotEvent &)));
     733    /* connect VirtualBox events */
     734    connect (gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
     735             this, SLOT(machineStateChanged(QString, KMachineState)));
     736    connect (gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),
     737             this, SLOT(machineDataChanged(QString)));
     738    connect (gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)),
     739             this, SLOT(machineRegistered(QString, bool)));
     740    connect (gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)),
     741             this, SLOT(sessionStateChanged(QString, KSessionState)));
     742    connect (gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)),
     743             this, SLOT(snapshotChanged(QString, QString)));
    743744#ifdef VBOX_GUI_WITH_SYSTRAY
    744     connect (&vboxGlobal(), SIGNAL (mainWindowCountChanged (const VBoxMainWindowCountChangeEvent &)),
    745              this, SLOT (mainWindowCountChanged (const VBoxMainWindowCountChangeEvent &)));
    746     connect (&vboxGlobal(), SIGNAL (trayIconCanShow (const VBoxCanShowTrayIconEvent &)),
    747              this, SLOT (trayIconCanShow (const VBoxCanShowTrayIconEvent &)));
    748     connect (&vboxGlobal(), SIGNAL (trayIconShow (const VBoxShowTrayIconEvent &)),
    749              this, SLOT (trayIconShow (const VBoxShowTrayIconEvent &)));
    750     connect (&vboxGlobal(), SIGNAL (trayIconChanged (const VBoxChangeTrayIconEvent &)),
    751              this, SLOT (trayIconChanged (const VBoxChangeTrayIconEvent &)));
     745    connect (gEDataEvents, SIGNAL(sigMainWindowCountChange(int)),
     746             this, SLOT(mainWindowCountChanged(int)));
     747    connect (gEDataEvents, SIGNAL(sigCanShowTrayIcon(bool)),
     748             this, SLOT(trayIconCanShow(bool)));
     749    connect (gEDataEvents, SIGNAL(sigTrayIconChange(bool)),
     750             this, SLOT(trayIconChanged(bool)));
     751    connect (&vboxGlobal(), SIGNAL(sigTrayIconShow(bool)),
     752             this, SLOT(trayIconShow(bool)));
    752753#endif
    753754
     
    761762VBoxSelectorWnd::~VBoxSelectorWnd()
    762763{
     764    /* Destroy our event handlers */
     765    UIVirtualBoxEventHandler::destroy();
     766
    763767    CVirtualBox vbox = vboxGlobal().virtualBox();
    764768
     
    17241728}
    17251729
    1726 void VBoxSelectorWnd::machineStateChanged (const VBoxMachineStateChangeEvent &e)
     1730void VBoxSelectorWnd::machineStateChanged(QString strId, KMachineState /* state */)
    17271731{
    17281732#ifdef VBOX_GUI_WITH_SYSTRAY
     
    17391743#endif
    17401744
    1741     refreshVMItem (e.id,
     1745    refreshVMItem (strId,
    17421746                   false /* aDetails */,
    17431747                   false /* aSnapshots */,
     
    17481752}
    17491753
    1750 void VBoxSelectorWnd::machineDataChanged (const VBoxMachineDataChangeEvent &e)
    1751 {
    1752     refreshVMItem (e.id,
     1754void VBoxSelectorWnd::machineDataChanged(QString strId)
     1755{
     1756    refreshVMItem (strId,
    17531757                   true  /* aDetails */,
    17541758                   false /* aSnapshots */,
     
    17561760}
    17571761
    1758 void VBoxSelectorWnd::machineRegistered (const VBoxMachineRegisteredEvent &e)
    1759 {
    1760     if (e.registered)
     1762void VBoxSelectorWnd::machineRegistered(QString strId, bool fRegistered)
     1763{
     1764    if (fRegistered)
    17611765    {
    17621766        CVirtualBox vbox = vboxGlobal().virtualBox();
    1763         CMachine m = vbox.GetMachine (e.id);
     1767        CMachine m = vbox.GetMachine (strId);
    17641768        if (!m.isNull())
    17651769        {
     
    17771781    else
    17781782    {
    1779         UIVMItem *item = mVMModel->itemById (e.id);
     1783        UIVMItem *item = mVMModel->itemById (strId);
    17801784        if (item)
    17811785        {
     
    17911795}
    17921796
    1793 void VBoxSelectorWnd::sessionStateChanged (const VBoxSessionStateChangeEvent &e)
    1794 {
    1795     refreshVMItem (e.id,
     1797void VBoxSelectorWnd::sessionStateChanged(QString strId, KSessionState /* state */)
     1798{
     1799    refreshVMItem (strId,
    17961800                   true  /* aDetails */,
    17971801                   false /* aSnapshots */,
     
    18021806}
    18031807
    1804 void VBoxSelectorWnd::snapshotChanged (const VBoxSnapshotEvent &aEvent)
    1805 {
    1806     refreshVMItem (aEvent.machineId,
     1808void VBoxSelectorWnd::snapshotChanged(QString strId, QString /* strSnapshotId */)
     1809{
     1810    refreshVMItem (strId,
    18071811                   false /* aDetails */,
    18081812                   true  /* aSnapshot */,
     
    18121816#ifdef VBOX_GUI_WITH_SYSTRAY
    18131817
    1814 void VBoxSelectorWnd::mainWindowCountChanged (const VBoxMainWindowCountChangeEvent &aEvent)
    1815 {
    1816     if (vboxGlobal().isTrayMenu() && aEvent.mCount <= 1)
     1818void VBoxSelectorWnd::mainWindowCountChanged(int count)
     1819{
     1820    if (vboxGlobal().isTrayMenu() && count <= 1)
    18171821        fileExit();
    18181822}
    18191823
    1820 void VBoxSelectorWnd::trayIconCanShow (const VBoxCanShowTrayIconEvent &aEvent)
    1821 {
    1822     emit trayIconChanged (VBoxChangeTrayIconEvent (vboxGlobal().settings().trayIconEnabled()));
    1823 }
    1824 
    1825 void VBoxSelectorWnd::trayIconShow (const VBoxShowTrayIconEvent &aEvent)
     1824void VBoxSelectorWnd::trayIconCanShow(bool fEnabled)
     1825{
     1826    emit trayIconChanged(VBoxChangeTrayIconEvent (vboxGlobal().settings().trayIconEnabled()));
     1827}
     1828
     1829void VBoxSelectorWnd::trayIconShow(bool fEnabled)
    18261830{
    18271831    if (vboxGlobal().isTrayMenu() && mTrayIcon)
    1828         mTrayIcon->trayIconShow (aEvent.mShow);
    1829 }
    1830 
    1831 void VBoxSelectorWnd::trayIconChanged (const VBoxChangeTrayIconEvent &aEvent)
     1832        mTrayIcon->trayIconShow(fEnabled);
     1833}
     1834
     1835void VBoxSelectorWnd::trayIconChanged(bool fEnabled)
    18321836{
    18331837    /* Not used yet. */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.h

    r30022 r30677  
    3434#endif
    3535
     36/* Local forward declarations */
     37class QITabWidget;
     38class UIVMItem;
     39class UIVMItemModel;
     40class UIVMListView;
    3641class VBoxSnapshotsWgt;
     42class VBoxToolBar;
     43class VBoxTrayIcon;
     44class VBoxVMDescriptionPage;
    3745class VBoxVMDetailsView;
    38 class VBoxVMDescriptionPage;
    3946class VBoxVMLogViewer;
    40 class UIVMListView;
    41 class UIVMItemModel;
    42 class UIVMItem;
    43 class VBoxTrayIcon;
    44 class VBoxToolBar;
    45 class UIOSDMenu;
    46 class QITabWidget;
    47 
     47
     48/* Global forward declarations */
     49class QEvent;
    4850class QListView;
    49 class QEvent;
    5051
    5152class VBoxSelectorWnd : public QIWithRetranslateUI2 <QMainWindow>
     
    126127    /* VirtualBox callback events we're interested in */
    127128
    128     void machineStateChanged (const VBoxMachineStateChangeEvent &e);
    129     void machineDataChanged (const VBoxMachineDataChangeEvent &e);
    130     void machineRegistered (const VBoxMachineRegisteredEvent &e);
    131     void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
    132     void snapshotChanged (const VBoxSnapshotEvent &e);
    133 #ifdef VBOX_GUI_WITH_SYSTRAY
    134     void mainWindowCountChanged (const VBoxMainWindowCountChangeEvent &aEvent);
    135     void trayIconCanShow (const VBoxCanShowTrayIconEvent &e);
    136     void trayIconShow (const VBoxShowTrayIconEvent &e);
    137     void trayIconChanged (const VBoxChangeTrayIconEvent &e);
     129    void machineStateChanged(QString strId, KMachineState state);
     130    void machineDataChanged(QString strId);
     131    void machineRegistered(QString strID, bool fRegistered);
     132    void sessionStateChanged(QString strId, KSessionState state);
     133    void snapshotChanged(QString strId, QString strSnapshotId);
     134#ifdef VBOX_GUI_WITH_SYSTRAY
     135    void mainWindowCountChanged(int count);
     136    void trayIconCanShow(bool fEnabled);
     137    void trayIconShow(bool fEnabled);
     138    void trayIconChanged(bool fEnabled);
    138139#endif
    139140
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp

    r30192 r30677  
    2828#include "VBoxTakeSnapshotDlg.h"
    2929#include "VBoxToolBar.h"
     30#include "UIVirtualBoxEventHandler.h"
    3031
    3132/* Global includes */
     
    400401    connect (mTakeSnapshotAction, SIGNAL (triggered()), this, SLOT (takeSnapshot()));
    401402
    402     connect (&vboxGlobal(), SIGNAL (machineDataChanged (const VBoxMachineDataChangeEvent&)),
    403              this, SLOT (machineDataChanged (const VBoxMachineDataChangeEvent&)));
    404     connect (&vboxGlobal(), SIGNAL (machineStateChanged (const VBoxMachineStateChangeEvent&)),
    405              this, SLOT (machineStateChanged (const VBoxMachineStateChangeEvent&)));
    406     connect (&vboxGlobal(), SIGNAL (sessionStateChanged (const VBoxSessionStateChangeEvent&)),
    407              this, SLOT (sessionStateChanged (const VBoxSessionStateChangeEvent&)));
     403    connect (gVBoxEvents, SIGNAL(sigMachineDataChange(QString)),
     404             this, SLOT(machineDataChanged(QString)));
     405    connect (gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
     406             this, SLOT(machineStateChanged(QString, KMachineState)));
     407    connect (gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)),
     408             this, SLOT(sessionStateChanged(QString, KSessionState)));
    408409
    409410    connect (&mAgeUpdateTimer, SIGNAL (timeout()), this, SLOT (updateSnapshotsAge()));
     
    665666
    666667
    667 void VBoxSnapshotsWgt::machineDataChanged (const VBoxMachineDataChangeEvent &aEvent)
     668void VBoxSnapshotsWgt::machineDataChanged(QString strId)
    668669{
    669670    SnapshotEditBlocker guardBlock (mEditProtector);
    670671
    671     if (aEvent.id != mMachineId)
     672    if (strId != mMachineId)
    672673        return;
    673674
     
    675676}
    676677
    677 void VBoxSnapshotsWgt::machineStateChanged (const VBoxMachineStateChangeEvent &aEvent)
     678void VBoxSnapshotsWgt::machineStateChanged(QString strId, KMachineState state)
    678679{
    679680    SnapshotEditBlocker guardBlock (mEditProtector);
    680681
    681     if (aEvent.id != mMachineId)
     682    if (strId != mMachineId)
    682683        return;
    683684
    684685    curStateItem()->recache();
    685     curStateItem()->updateCurrentState (aEvent.state);
    686 }
    687 
    688 void VBoxSnapshotsWgt::sessionStateChanged (const VBoxSessionStateChangeEvent &aEvent)
     686    curStateItem()->updateCurrentState(state);
     687}
     688
     689void VBoxSnapshotsWgt::sessionStateChanged(QString strId, KSessionState state)
    689690{
    690691    SnapshotEditBlocker guardBlock (mEditProtector);
    691692
    692     if (aEvent.id != mMachineId)
    693         return;
    694 
    695     mSessionState = aEvent.state;
     693    if (strId != mMachineId)
     694        return;
     695
     696    mSessionState = state;
    696697    onCurrentChanged (mTreeWidget->currentItem());
    697698}
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.h

    r28800 r30677  
    6666    void takeSnapshot();
    6767
    68     void machineDataChanged (const VBoxMachineDataChangeEvent &aEvent);
    69     void machineStateChanged (const VBoxMachineStateChangeEvent &aEvent);
    70     void sessionStateChanged (const VBoxSessionStateChangeEvent &aEvent);
     68    void machineDataChanged(QString strId);
     69    void machineStateChanged(QString strId, KMachineState state);
     70    void sessionStateChanged(QString strId, KSessionState state);
    7171
    7272    void updateSnapshotsAge();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.cpp

    r30288 r30677  
    4040const char* VBoxDefs::GUI_SuppressMessages = "GUI/SuppressMessages";
    4141const char* VBoxDefs::GUI_PermanentSharedFoldersAtRuntime = "GUI/PermanentSharedFoldersAtRuntime";
     42const char* VBoxDefs::GUI_LanguageId = "GUI/LanguageID";
    4243#ifdef Q_WS_X11
    4344const char* VBoxDefs::GUI_LicenseKey = "GUI/LicenseAgreed";
     
    5354#ifdef VBOX_GUI_WITH_SYSTRAY
    5455const char* VBoxDefs::GUI_TrayIconWinID = "GUI/TrayIcon/WinID";
     56const char* VBoxDefs::GUI_TrayIconEnabled = "GUI/TrayIcon/Enabled";
    5557const char* VBoxDefs::GUI_MainWindowCount = "GUI/MainWindowCount";
    5658#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxDefs.h

    r30288 r30677  
    7676        , RepaintEventType
    7777        , SetRegionEventType
    78         , MouseCapabilityEventType
    79         , MousePointerChangeEventType
    80         , MachineStateChangeEventType
    81         , AdditionsStateChangeEventType
    82         , MediaDriveChangeEventType
    83         , MachineDataChangeEventType
    84         , MachineRegisteredEventType
    85         , SessionStateChangeEventType
    86         , SnapshotEventType
    87         , CanShowRegDlgEventType
    88         , CanShowUpdDlgEventType
    89         , NetworkAdapterChangeEventType
    90         , USBCtlStateChangeEventType
    91         , USBDeviceStateChangeEventType
    92         , SharedFolderChangeEventType
    93         , RuntimeErrorEventType
    9478        , ModifierKeyChangeEventType
    9579        , MediaEnumEventType
     
    9781        , ShellExecuteEventType
    9882#endif
    99         , ActivateMenuEventType /* remove when new core is active */
    100         , ActivateActionEventType /* New name for new core */
     83        , ActivateActionEventType
    10184#if defined (Q_WS_MAC)
    10285        , ShowWindowEventType
    10386#endif
    104         , ChangeGUILanguageEventType
    105 #if defined (VBOX_GUI_WITH_SYSTRAY)
    106         , CanShowTrayIconEventType
    107         , ShowTrayIconEventType
    108         , TrayIconChangeEventType
    109         , MainWindowCountChangeEventType
    110 #endif
    11187        , AddVDMUrlsEventType
    112         , ChangeDockIconUpdateEventType
    113         , ChangePresentationmodeEventType
    11488#ifdef VBOX_GUI_USE_QGL
    11589        , VHWACommandProcessType
     
    144118    static const char* GUI_SuppressMessages;
    145119    static const char* GUI_PermanentSharedFoldersAtRuntime;
     120    static const char* GUI_LanguageId;
    146121#ifdef Q_WS_X11
    147122    static const char* GUI_LicenseKey;
     
    157132#ifdef VBOX_GUI_WITH_SYSTRAY
    158133    static const char* GUI_TrayIconWinID;
     134    static const char* GUI_TrayIconEnabled;
    159135    static const char* GUI_MainWindowCount;
    160136#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r30208 r30677  
    2929#include "QIDialogButtonBox.h"
    3030#include "UIIconPool.h"
     31#include "UIExtraDataEventHandler.h"
    3132
    3233#include "UIMachine.h"
     
    103104#include <iprt/ldr.h>
    104105#include <iprt/system.h>
     106#include <iprt/stream.h>
    105107
    106108#ifdef VBOX_GUI_WITH_SYSTRAY
     
    157159    const bool mLast;
    158160};
    159 
    160 // VirtualBox callback class
    161 /////////////////////////////////////////////////////////////////////////////
    162 
    163 class VBoxCallback : VBOX_SCRIPTABLE_IMPL(IVirtualBoxCallback)
    164 {
    165 public:
    166 
    167     VBoxCallback (VBoxGlobal &aGlobal)
    168         : mGlobal (aGlobal)
    169         , mIsRegDlgOwner (false)
    170         , mIsUpdDlgOwner (false)
    171 #ifdef VBOX_GUI_WITH_SYSTRAY
    172         , mIsTrayIconOwner (false)
    173 #endif
    174     {
    175 #if defined (Q_OS_WIN32)
    176         refcnt = 0;
    177 #endif
    178     }
    179 
    180     virtual ~VBoxCallback() {}
    181 
    182     NS_DECL_ISUPPORTS
    183 
    184 #if defined (Q_OS_WIN32)
    185     STDMETHOD_(ULONG, AddRef)()
    186     {
    187         return ::InterlockedIncrement (&refcnt);
    188     }
    189     STDMETHOD_(ULONG, Release)()
    190     {
    191         long cnt = ::InterlockedDecrement (&refcnt);
    192         if (cnt == 0)
    193             delete this;
    194         return cnt;
    195     }
    196 #endif
    197     VBOX_SCRIPTABLE_DISPATCH_IMPL(IVirtualBoxCallback)
    198 
    199     // IVirtualBoxCallback methods
    200 
    201     // Note: we need to post custom events to the GUI event queue
    202     // instead of doing what we need directly from here because on Win32
    203     // these callback methods are never called on the main GUI thread.
    204     // Another reason to handle events asynchronously is that internally
    205     // most callback interface methods are called from under the initiator
    206     // object's lock, so accessing the initiator object (for example, reading
    207     // some property) directly from the callback method will definitely cause
    208     // a deadlock.
    209 
    210     STDMETHOD(OnMachineStateChange) (IN_BSTR id, MachineState_T state)
    211     {
    212         postEvent (new VBoxMachineStateChangeEvent (QString::fromUtf16(id),
    213                                                     (KMachineState) state));
    214         return S_OK;
    215     }
    216 
    217     STDMETHOD(OnMachineDataChange) (IN_BSTR id)
    218     {
    219         postEvent (new VBoxMachineDataChangeEvent (QString::fromUtf16(id)));
    220         return S_OK;
    221     }
    222 
    223     STDMETHOD(OnExtraDataCanChange)(IN_BSTR id,
    224                                     IN_BSTR key, IN_BSTR value,
    225                                     BSTR *error, BOOL *allowChange)
    226     {
    227         if (!error || !allowChange)
    228             return E_INVALIDARG;
    229 
    230         if (com::asGuidStr(id).isEmpty())
    231         {
    232             /* it's a global extra data key someone wants to change */
    233             QString sKey = QString::fromUtf16 (key);
    234             QString sVal = QString::fromUtf16 (value);
    235             if (sKey.startsWith ("GUI/"))
    236             {
    237                 if (sKey == VBoxDefs::GUI_RegistrationDlgWinID)
    238                 {
    239                     if (mIsRegDlgOwner)
    240                     {
    241                         if (sVal.isEmpty() ||
    242                             sVal == QString ("%1")
    243                                 .arg ((qulonglong) vboxGlobal().mainWindow()->winId()))
    244                             *allowChange = TRUE;
    245                         else
    246                             *allowChange = FALSE;
    247                     }
    248                     else
    249                         *allowChange = TRUE;
    250                     return S_OK;
    251                 }
    252 
    253                 if (sKey == VBoxDefs::GUI_UpdateDlgWinID)
    254                 {
    255                     if (mIsUpdDlgOwner)
    256                     {
    257                         if (sVal.isEmpty() ||
    258                             sVal == QString ("%1")
    259                                 .arg ((qulonglong) vboxGlobal().mainWindow()->winId()))
    260                             *allowChange = TRUE;
    261                         else
    262                             *allowChange = FALSE;
    263                     }
    264                     else
    265                         *allowChange = TRUE;
    266                     return S_OK;
    267                 }
    268 #ifdef VBOX_GUI_WITH_SYSTRAY
    269                 if (sKey == VBoxDefs::GUI_TrayIconWinID)
    270                 {
    271                     if (mIsTrayIconOwner)
    272                     {
    273                         if (sVal.isEmpty() ||
    274                             sVal == QString ("%1")
    275                                 .arg ((qulonglong) vboxGlobal().mainWindow()->winId()))
    276                             *allowChange = TRUE;
    277                         else
    278                             *allowChange = FALSE;
    279                     }
    280                     else
    281                         *allowChange = TRUE;
    282                     return S_OK;
    283                 }
    284 #endif
    285                 /* try to set the global setting to check its syntax */
    286                 VBoxGlobalSettings gs (false /* non-null */);
    287                 if (gs.setPublicProperty (sKey, sVal))
    288                 {
    289                     /* this is a known GUI property key */
    290                     if (!gs)
    291                     {
    292                         /* disallow the change when there is an error*/
    293                         *error = SysAllocString ((const OLECHAR *)
    294                             (gs.lastError().isNull() ? 0 : gs.lastError().utf16()));
    295                         *allowChange = FALSE;
    296                     }
    297                     else
    298                         *allowChange = TRUE;
    299                     return S_OK;
    300                 }
    301             }
    302         }
    303 
    304         /* not interested in this key -- never disagree */
    305         *allowChange = TRUE;
    306         return S_OK;
    307     }
    308 
    309     STDMETHOD(OnExtraDataChange) (IN_BSTR id,
    310                                   IN_BSTR key, IN_BSTR value)
    311     {
    312         if (com::asGuidStr(id).isEmpty())
    313         {
    314             QString sKey = QString::fromUtf16 (key);
    315             QString sVal = QString::fromUtf16 (value);
    316             if (sKey.startsWith ("GUI/"))
    317             {
    318                 if (sKey == VBoxDefs::GUI_RegistrationDlgWinID)
    319                 {
    320                     if (sVal.isEmpty())
    321                     {
    322                         mIsRegDlgOwner = false;
    323                         QApplication::postEvent (&mGlobal, new VBoxCanShowRegDlgEvent (true));
    324                     }
    325                     else if (sVal == QString ("%1")
    326                              .arg ((qulonglong) vboxGlobal().mainWindow()->winId()))
    327                     {
    328                         mIsRegDlgOwner = true;
    329                         QApplication::postEvent (&mGlobal, new VBoxCanShowRegDlgEvent (true));
    330                     }
    331                     else
    332                         QApplication::postEvent (&mGlobal, new VBoxCanShowRegDlgEvent (false));
    333                 }
    334                 if (sKey == VBoxDefs::GUI_UpdateDlgWinID)
    335                 {
    336                     if (sVal.isEmpty())
    337                     {
    338                         mIsUpdDlgOwner = false;
    339                         QApplication::postEvent (&mGlobal, new VBoxCanShowUpdDlgEvent (true));
    340                     }
    341                     else if (sVal == QString ("%1")
    342                              .arg ((qulonglong) vboxGlobal().mainWindow()->winId()))
    343                     {
    344                         mIsUpdDlgOwner = true;
    345                         QApplication::postEvent (&mGlobal, new VBoxCanShowUpdDlgEvent (true));
    346                     }
    347                     else
    348                         QApplication::postEvent (&mGlobal, new VBoxCanShowUpdDlgEvent (false));
    349                 }
    350                 if (sKey == "GUI/LanguageID")
    351                     QApplication::postEvent (&mGlobal, new VBoxChangeGUILanguageEvent (sVal));
    352 #ifdef VBOX_GUI_WITH_SYSTRAY
    353                 if (sKey == "GUI/MainWindowCount")
    354                     QApplication::postEvent (&mGlobal, new VBoxMainWindowCountChangeEvent (sVal.toInt()));
    355                 if (sKey == VBoxDefs::GUI_TrayIconWinID)
    356                 {
    357                     if (sVal.isEmpty())
    358                     {
    359                         mIsTrayIconOwner = false;
    360                         QApplication::postEvent (&mGlobal, new VBoxCanShowTrayIconEvent (true));
    361                     }
    362                     else if (sVal == QString ("%1")
    363                              .arg ((qulonglong) vboxGlobal().mainWindow()->winId()))
    364                     {
    365                         mIsTrayIconOwner = true;
    366                         QApplication::postEvent (&mGlobal, new VBoxCanShowTrayIconEvent (true));
    367                     }
    368                     else
    369                         QApplication::postEvent (&mGlobal, new VBoxCanShowTrayIconEvent (false));
    370                 }
    371                 if (sKey == "GUI/TrayIcon/Enabled")
    372                     QApplication::postEvent (&mGlobal, new VBoxChangeTrayIconEvent ((sVal.toLower() == "true") ? true : false));
    373 #endif
    374 #ifdef Q_WS_MAC
    375                 if (sKey == VBoxDefs::GUI_PresentationModeEnabled)
    376                 {
    377                     /* Default to true if it is an empty value */
    378                     QString testStr = sVal.toLower();
    379                     bool f = (testStr.isEmpty() || testStr == "false");
    380                     QApplication::postEvent (&mGlobal, new VBoxChangePresentationModeEvent (f));
    381                 }
    382 #endif
    383 
    384                 mMutex.lock();
    385                 mGlobal.gset.setPublicProperty (sKey, sVal);
    386                 mMutex.unlock();
    387                 Assert (!!mGlobal.gset);
    388             }
    389         }
    390 #ifdef Q_WS_MAC
    391         else if (mGlobal.isVMConsoleProcess())
    392         {
    393             /* Check for the currently running machine */
    394             if (QString::fromUtf16(id) == mGlobal.vmUuid)
    395             {
    396                 QString strKey = QString::fromUtf16(key);
    397                 QString strVal = QString::fromUtf16(value);
    398                 // TODO_NEW_CORE: we should cleanup
    399                 // VBoxChangeDockIconUpdateEvent to have no parameters. So it
    400                 // could really be use for both events and the consumer should
    401                 // ask per GetExtraData how the current values are.
    402                 if (   strKey == VBoxDefs::GUI_RealtimeDockIconUpdateEnabled
    403                     || strKey == VBoxDefs::GUI_RealtimeDockIconUpdateMonitor)
    404                 {
    405                     /* Default to true if it is an empty value */
    406                     bool f = strVal.toLower() == "false" ? false : true;
    407                     QApplication::postEvent(&mGlobal, new VBoxChangeDockIconUpdateEvent(f));
    408                 }
    409             }
    410         }
    411 #endif /* Q_WS_MAC */
    412         return S_OK;
    413     }
    414 
    415     STDMETHOD(OnMediumRegistered) (IN_BSTR id, DeviceType_T type,
    416                                    BOOL registered)
    417     {
    418         /** @todo */
    419         Q_UNUSED (id);
    420         Q_UNUSED (type);
    421         Q_UNUSED (registered);
    422         return VBOX_E_DONT_CALL_AGAIN;
    423     }
    424 
    425     STDMETHOD(OnMachineRegistered) (IN_BSTR id, BOOL registered)
    426     {
    427         postEvent (new VBoxMachineRegisteredEvent (QString::fromUtf16(id),
    428                                                    registered));
    429         return S_OK;
    430     }
    431 
    432     STDMETHOD(OnSessionStateChange) (IN_BSTR id, SessionState_T state)
    433     {
    434         postEvent (new VBoxSessionStateChangeEvent (QString::fromUtf16(id),
    435                                                     (KSessionState) state));
    436         return S_OK;
    437     }
    438 
    439     STDMETHOD(OnSnapshotTaken) (IN_BSTR aMachineId, IN_BSTR aSnapshotId)
    440     {
    441         postEvent (new VBoxSnapshotEvent (QString::fromUtf16(aMachineId),
    442                                           QString::fromUtf16(aSnapshotId),
    443                                           VBoxSnapshotEvent::Taken));
    444         return S_OK;
    445     }
    446 
    447     STDMETHOD(OnSnapshotDeleted) (IN_BSTR aMachineId, IN_BSTR aSnapshotId)
    448     {
    449         postEvent (new VBoxSnapshotEvent (QString::fromUtf16(aMachineId),
    450                                           QString::fromUtf16(aSnapshotId),
    451                                           VBoxSnapshotEvent::Deleted));
    452         return S_OK;
    453     }
    454 
    455     STDMETHOD(OnSnapshotChange) (IN_BSTR aMachineId, IN_BSTR aSnapshotId)
    456     {
    457         postEvent (new VBoxSnapshotEvent (QString::fromUtf16(aMachineId),
    458                                           QString::fromUtf16(aSnapshotId),
    459                                           VBoxSnapshotEvent::Changed));
    460         return S_OK;
    461     }
    462 
    463     STDMETHOD(OnGuestPropertyChange) (IN_BSTR /* id */,
    464                                       IN_BSTR /* key */,
    465                                       IN_BSTR /* value */,
    466                                       IN_BSTR /* flags */)
    467     {
    468         return VBOX_E_DONT_CALL_AGAIN;
    469     }
    470 
    471 private:
    472 
    473     void postEvent (QEvent *e)
    474     {
    475         // currently, we don't post events if we are in the VM execution
    476         // console mode, to save some CPU ticks (so far, there was no need
    477         // to handle VirtualBox callback events in the execution console mode)
    478         if (!mGlobal.isVMConsoleProcess())
    479             QApplication::postEvent (&mGlobal, e);
    480     }
    481 
    482     VBoxGlobal &mGlobal;
    483 
    484     /** protects #OnExtraDataChange() */
    485     QMutex mMutex;
    486 
    487     bool mIsRegDlgOwner;
    488     bool mIsUpdDlgOwner;
    489 #ifdef VBOX_GUI_WITH_SYSTRAY
    490     bool mIsTrayIconOwner;
    491 #endif
    492 
    493 #if defined (Q_OS_WIN32)
    494 private:
    495     long refcnt;
    496 #endif
    497 };
    498 
    499 #if !defined (Q_OS_WIN32)
    500 NS_DECL_CLASSINFO (VBoxCallback)
    501 NS_IMPL_THREADSAFE_ISUPPORTS1_CI (VBoxCallback, IVirtualBoxCallback)
    502 #endif
    503161
    504162// VBoxGlobal
     
    703361 *  Sets the new global settings and saves them to the VirtualBox server.
    704362 */
    705 bool VBoxGlobal::setSettings (const VBoxGlobalSettings &gs)
     363bool VBoxGlobal::setSettings (VBoxGlobalSettings &gs)
    706364{
    707365    gs.save (mVBox);
     
    910568        if (mVBox.isOk())
    911569        {
    912             emit trayIconShow (*(new VBoxShowTrayIconEvent (true)));
     570            emit sigTrayIconShow(true);
    913571            return true;
    914572        }
     
    46604318}
    46614319
     4320void VBoxGlobal::sltGUILanguageChange(QString strLang)
     4321{
     4322    loadLanguage(strLang);
     4323}
     4324
    46624325// Protected members
    46634326////////////////////////////////////////////////////////////////////////////////
     
    47004363        }
    47014364
    4702         /* VirtualBox callback events */
    4703 
    4704         case VBoxDefs::MachineStateChangeEventType:
    4705         {
    4706             emit machineStateChanged (*(VBoxMachineStateChangeEvent *) e);
    4707             return true;
    4708         }
    4709         case VBoxDefs::MachineDataChangeEventType:
    4710         {
    4711             emit machineDataChanged (*(VBoxMachineDataChangeEvent *) e);
    4712             return true;
    4713         }
    4714         case VBoxDefs::MachineRegisteredEventType:
    4715         {
    4716             emit machineRegistered (*(VBoxMachineRegisteredEvent *) e);
    4717             return true;
    4718         }
    4719         case VBoxDefs::SessionStateChangeEventType:
    4720         {
    4721             emit sessionStateChanged (*(VBoxSessionStateChangeEvent *) e);
    4722             return true;
    4723         }
    4724         case VBoxDefs::SnapshotEventType:
    4725         {
    4726             emit snapshotChanged (*(VBoxSnapshotEvent *) e);
    4727             return true;
    4728         }
    4729         case VBoxDefs::CanShowRegDlgEventType:
    4730         {
    4731             emit canShowRegDlg (((VBoxCanShowRegDlgEvent *) e)->mCanShow);
    4732             return true;
    4733         }
    4734         case VBoxDefs::CanShowUpdDlgEventType:
    4735         {
    4736             emit canShowUpdDlg (((VBoxCanShowUpdDlgEvent *) e)->mCanShow);
    4737             return true;
    4738         }
    4739         case VBoxDefs::ChangeGUILanguageEventType:
    4740         {
    4741             loadLanguage (static_cast<VBoxChangeGUILanguageEvent*> (e)->mLangId);
    4742             return true;
    4743         }
    4744 #ifdef VBOX_GUI_WITH_SYSTRAY
    4745         case VBoxDefs::MainWindowCountChangeEventType:
    4746 
    4747             emit mainWindowCountChanged (*(VBoxMainWindowCountChangeEvent *) e);
    4748             return true;
    4749 
    4750         case VBoxDefs::CanShowTrayIconEventType:
    4751         {
    4752             emit trayIconCanShow (*(VBoxCanShowTrayIconEvent *) e);
    4753             return true;
    4754         }
    4755         case VBoxDefs::ShowTrayIconEventType:
    4756         {
    4757             emit trayIconShow (*(VBoxShowTrayIconEvent *) e);
    4758             return true;
    4759         }
    4760         case VBoxDefs::TrayIconChangeEventType:
    4761         {
    4762             emit trayIconChanged (*(VBoxChangeTrayIconEvent *) e);
    4763             return true;
    4764         }
    4765 #endif
    4766 #if defined(Q_WS_MAC)
    4767         case VBoxDefs::ChangeDockIconUpdateEventType:
    4768         {
    4769             emit dockIconUpdateChanged (*(VBoxChangeDockIconUpdateEvent *) e);
    4770             return true;
    4771         }
    4772         case VBoxDefs::ChangePresentationmodeEventType:
    4773         {
    4774             emit presentationModeChanged (*(VBoxChangePresentationModeEvent *) e);
    4775             return true;
    4776         }
    4777 #endif
    47784365        default:
    47794366            break;
     
    48494436
    48504437    retranslateUi();
     4438
     4439    connect(gEDataEvents, SIGNAL(sigGUILanguageChange(QString)),
     4440            this, SLOT(sltGUILanguageChange(QString)));
    48514441
    48524442#ifdef VBOX_GUI_WITH_SYSTRAY
     
    51844774    vm_render_mode = vboxGetRenderMode (vm_render_mode_str);
    51854775
    5186     /* setup the callback */
    5187     callback = CVirtualBoxCallback (new VBoxCallback (*this));
    5188     mVBox.RegisterCallback (callback);
    5189     AssertWrapperOk (mVBox);
    5190     if (!mVBox.isOk())
    5191         return;
    5192 
    51934776#ifdef VBOX_WITH_DEBUGGER_GUI
    51944777    /* setup the debugger gui. */
     
    52444827#endif
    52454828
    5246     if (!callback.isNull())
    5247     {
    5248         mVBox.UnregisterCallback (callback);
    5249         AssertWrapperOk (mVBox);
    5250         callback.detach();
    5251     }
     4829    /* Destroy our event handlers */
     4830    UIExtraDataEventHandler::destroy();
    52524831
    52534832    if (mMediaEnumThread)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r30192 r30677  
    4242class QToolButton;
    4343class UIMachine;
    44 
    45 // VirtualBox callback events
    46 ////////////////////////////////////////////////////////////////////////////////
    47 
    48 class VBoxMachineStateChangeEvent : public QEvent
    49 {
    50 public:
    51     VBoxMachineStateChangeEvent (const QString &aId, KMachineState aState)
    52         : QEvent ((QEvent::Type) VBoxDefs::MachineStateChangeEventType)
    53         , id (aId), state (aState)
    54         {}
    55 
    56     const QString id;
    57     const KMachineState state;
    58 };
    59 
    60 class VBoxMachineDataChangeEvent : public QEvent
    61 {
    62 public:
    63     VBoxMachineDataChangeEvent (const QString &aId)
    64         : QEvent ((QEvent::Type) VBoxDefs::MachineDataChangeEventType)
    65         , id (aId)
    66         {}
    67 
    68     const QString id;
    69 };
    70 
    71 class VBoxMachineRegisteredEvent : public QEvent
    72 {
    73 public:
    74     VBoxMachineRegisteredEvent (const QString &aId, bool aRegistered)
    75         : QEvent ((QEvent::Type) VBoxDefs::MachineRegisteredEventType)
    76         , id (aId), registered (aRegistered)
    77         {}
    78 
    79     const QString id;
    80     const bool registered;
    81 };
    82 
    83 class VBoxSessionStateChangeEvent : public QEvent
    84 {
    85 public:
    86     VBoxSessionStateChangeEvent (const QString &aId, KSessionState aState)
    87         : QEvent ((QEvent::Type) VBoxDefs::SessionStateChangeEventType)
    88         , id (aId), state (aState)
    89         {}
    90 
    91     const QString id;
    92     const KSessionState state;
    93 };
    94 
    95 class VBoxSnapshotEvent : public QEvent
    96 {
    97 public:
    98 
    99     enum What { Taken, Deleted, Changed };
    100 
    101     VBoxSnapshotEvent (const QString &aMachineId, const QString &aSnapshotId,
    102                        What aWhat)
    103         : QEvent ((QEvent::Type) VBoxDefs::SnapshotEventType)
    104         , what (aWhat)
    105         , machineId (aMachineId), snapshotId (aSnapshotId)
    106         {}
    107 
    108     const What what;
    109 
    110     const QString machineId;
    111     const QString snapshotId;
    112 };
    113 
    114 class VBoxCanShowRegDlgEvent : public QEvent
    115 {
    116 public:
    117     VBoxCanShowRegDlgEvent (bool aCanShow)
    118         : QEvent ((QEvent::Type) VBoxDefs::CanShowRegDlgEventType)
    119         , mCanShow (aCanShow)
    120         {}
    121 
    122     const bool mCanShow;
    123 };
    124 
    125 class VBoxCanShowUpdDlgEvent : public QEvent
    126 {
    127 public:
    128     VBoxCanShowUpdDlgEvent (bool aCanShow)
    129         : QEvent ((QEvent::Type) VBoxDefs::CanShowUpdDlgEventType)
    130         , mCanShow (aCanShow)
    131         {}
    132 
    133     const bool mCanShow;
    134 };
    135 
    136 class VBoxChangeGUILanguageEvent : public QEvent
    137 {
    138 public:
    139     VBoxChangeGUILanguageEvent (QString aLangId)
    140         : QEvent ((QEvent::Type) VBoxDefs::ChangeGUILanguageEventType)
    141         , mLangId (aLangId)
    142         {}
    143 
    144     const QString mLangId;
    145 };
    146 
    147 #ifdef VBOX_GUI_WITH_SYSTRAY
    148 class VBoxMainWindowCountChangeEvent : public QEvent
    149 {
    150 public:
    151     VBoxMainWindowCountChangeEvent (int aCount)
    152         : QEvent ((QEvent::Type) VBoxDefs::MainWindowCountChangeEventType)
    153         , mCount (aCount)
    154         {}
    155 
    156     const int mCount;
    157 };
    158 
    159 class VBoxCanShowTrayIconEvent : public QEvent
    160 {
    161 public:
    162     VBoxCanShowTrayIconEvent (bool aCanShow)
    163         : QEvent ((QEvent::Type) VBoxDefs::CanShowTrayIconEventType)
    164         , mCanShow (aCanShow)
    165         {}
    166 
    167     const bool mCanShow;
    168 };
    169 
    170 class VBoxShowTrayIconEvent : public QEvent
    171 {
    172 public:
    173     VBoxShowTrayIconEvent (bool aShow)
    174         : QEvent ((QEvent::Type) VBoxDefs::ShowTrayIconEventType)
    175         , mShow (aShow)
    176         {}
    177 
    178     const bool mShow;
    179 };
    180 
    181 class VBoxChangeTrayIconEvent : public QEvent
    182 {
    183 public:
    184     VBoxChangeTrayIconEvent (bool aChanged)
    185         : QEvent ((QEvent::Type) VBoxDefs::TrayIconChangeEventType)
    186         , mChanged (aChanged)
    187         {}
    188 
    189     const bool mChanged;
    190 };
    191 #endif
    192 
    193 class VBoxChangeDockIconUpdateEvent : public QEvent
    194 {
    195 public:
    196     VBoxChangeDockIconUpdateEvent (bool aChanged)
    197         : QEvent ((QEvent::Type) VBoxDefs::ChangeDockIconUpdateEventType)
    198         , mChanged (aChanged)
    199         {}
    200 
    201     const bool mChanged;
    202 };
    203 
    204 class VBoxChangePresentationModeEvent : public QEvent
    205 {
    206 public:
    207     VBoxChangePresentationModeEvent (bool aChanged)
    208         : QEvent ((QEvent::Type) VBoxDefs::ChangePresentationmodeEventType)
    209         , mChanged (aChanged)
    210         {}
    211 
    212     const bool mChanged;
    213 };
    21444
    21545class Process : public QProcess
     
    301131    CVirtualBox virtualBox() const { return mVBox; }
    302132
    303     const VBoxGlobalSettings &settings() const { return gset; }
    304     bool setSettings (const VBoxGlobalSettings &gs);
     133    VBoxGlobalSettings &settings() { return gset; }
     134    bool setSettings (VBoxGlobalSettings &gs);
    305135
    306136    VBoxSelectorWnd &selectorWnd();
     
    839669    void mediumRemoved (VBoxDefs::MediumType, const QString &);
    840670
    841     /* signals emitted when the VirtualBox callback is called by the server
    842      * (note that currently these signals are emitted only when the application
    843      * is the in the VM selector mode) */
    844 
    845     void machineStateChanged (const VBoxMachineStateChangeEvent &e);
    846     void machineDataChanged (const VBoxMachineDataChangeEvent &e);
    847     void machineRegistered (const VBoxMachineRegisteredEvent &e);
    848     void sessionStateChanged (const VBoxSessionStateChangeEvent &e);
    849     void snapshotChanged (const VBoxSnapshotEvent &e);
    850671#ifdef VBOX_GUI_WITH_SYSTRAY
    851     void mainWindowCountChanged (const VBoxMainWindowCountChangeEvent &e);
    852     void trayIconCanShow (const VBoxCanShowTrayIconEvent &e);
    853     void trayIconShow (const VBoxShowTrayIconEvent &e);
    854     void trayIconChanged (const VBoxChangeTrayIconEvent &e);
    855 #endif
    856     void dockIconUpdateChanged (const VBoxChangeDockIconUpdateEvent &e);
    857     void presentationModeChanged (const VBoxChangePresentationModeEvent &e);
    858 
    859     void canShowRegDlg (bool aCanShow);
    860     void canShowUpdDlg (bool aCanShow);
     672    void sigTrayIconShow(bool fEnabled);
     673#endif
    861674
    862675public slots:
     
    867680    void showUpdateDialog (bool aForce = true);
    868681    void perDayNewVersionNotifier();
     682    void sltGUILanguageChange(QString strLang);
    869683
    870684protected:
     
    935749#endif
    936750
    937     CVirtualBoxCallback callback;
    938 
    939751    QString mVerString;
    940752    QString mBrandingConfig;
     
    977789
    978790    friend VBoxGlobal &vboxGlobal();
    979     friend class VBoxCallback;
    980791};
    981792
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r30637 r30677  
    4141#ifdef Q_WS_MAC
    4242# include "DockIconPreview.h"
     43# include "UIExtraDataEventHandler.h"
    4344#endif /* Q_WS_MAC */
    4445
     
    592593    connect(pDockPreviewModeGroup, SIGNAL(triggered(QAction*)),
    593594            this, SLOT(sltDockPreviewModeChanged(QAction*)));
    594     connect(&vboxGlobal(), SIGNAL(dockIconUpdateChanged(const VBoxChangeDockIconUpdateEvent &)),
    595             this, SLOT(sltChangeDockIconUpdate(const VBoxChangeDockIconUpdateEvent &)));
     595    connect(gEDataEvents, SIGNAL(sigDockIconAppearanceChange(bool)),
     596            this, SLOT(sltChangeDockIconUpdate(bool)));
    596597
    597598    /* Monitor selection if there are more than one monitor */
     
    15691570}
    15701571
    1571 void UIMachineLogic::sltChangeDockIconUpdate(const VBoxChangeDockIconUpdateEvent &event)
     1572void UIMachineLogic::sltChangeDockIconUpdate(bool fEnabled)
    15721573{
    15731574    if (isMachineWindowsCreated())
    15741575    {
    1575         setDockIconPreviewEnabled(event.mChanged);
     1576        setDockIconPreviewEnabled(fEnabled);
    15761577        if (m_pDockPreviewSelectMonitorGroup)
    15771578        {
    1578             m_pDockPreviewSelectMonitorGroup->setEnabled(event.mChanged);
     1579            m_pDockPreviewSelectMonitorGroup->setEnabled(fEnabled);
    15791580            CMachine machine = session().GetMachine();
    15801581            m_DockIconPreviewMonitor = qMin(machine.GetExtraData(VBoxDefs::GUI_RealtimeDockIconUpdateMonitor).toInt(), (int)machine.GetMonitorCount() - 1);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r30637 r30677  
    4444class UIMachineView;
    4545class UIDockIconPreview;
    46 class VBoxChangeDockIconUpdateEvent;
    4746
    4847class UIMachineLogic : public QIWithRetranslateUI3<QObject>
     
    186185    void sltDockPreviewModeChanged(QAction *pAction);
    187186    void sltDockPreviewMonitorChanged(QAction *pAction);
    188     void sltChangeDockIconUpdate(const VBoxChangeDockIconUpdateEvent &event);
     187    void sltChangeDockIconUpdate(bool fEnabled);
    189188#endif /* RT_OS_DARWIN */
    190189
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp

    r28800 r30677  
    2424#include "VBoxGlobal.h"
    2525#include "VBoxProblemReporter.h"
     26#include "UIExtraDataEventHandler.h"
    2627
    2728/* Global includes */
     
    248249
    249250#ifdef VBOX_WITH_REGISTRATION
    250         VBoxGlobal::connect(&vboxGlobal(), SIGNAL (canShowRegDlg (bool)),
     251        VBoxGlobal::connect(gEDataEvents, SIGNAL(sigCanShowRegistrationDlg(bool)),
    251252                            pActionsPool->action(UIActionIndex_Simple_Register), SLOT(setEnabled(bool)));
    252253#endif /* VBOX_WITH_REGISTRATION */
    253         VBoxGlobal::connect(&vboxGlobal(), SIGNAL (canShowUpdDlg (bool)),
     254        VBoxGlobal::connect(gEDataEvents, SIGNAL(sigCanShowUpdateDlg(bool)),
    254255                            pActionsPool->action(UIActionIndex_Simple_Update), SLOT(setEnabled(bool)));
    255256
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r30525 r30677  
    3232#include "VBoxProblemReporter.h"
    3333#include "UIFirstRunWzd.h"
     34#include "UIConsoleEventHandler.h"
    3435#ifdef VBOX_WITH_VIDEOHWACCEL
    3536# include "VBoxFBOverlay.h"
     
    4647#endif
    4748
    48 #if defined (Q_WS_MAC)
    49 # include "VBoxUtils.h"
    50 #endif
    51 
    52 /* Guest mouse pointer shape change event: */
    53 class UIMousePointerShapeChangeEvent : public QEvent
    54 {
    55 public:
    56 
    57     UIMousePointerShapeChangeEvent(bool bIsVisible, bool bIsAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, const QVector<uint8_t>& shape)
    58         : QEvent((QEvent::Type)UIConsoleEventType_MousePointerShapeChange)
    59         , m_bIsVisible(bIsVisible), m_bIsAlpha(bIsAlpha), m_uXHot(uXHot), m_uYHot(uYHot), m_uWidth(uWidth), m_uHeight(uHeight), m_shape(shape)
    60     {
    61     }
    62 
    63     virtual ~UIMousePointerShapeChangeEvent()
    64     {
    65     }
    66 
    67     bool isVisible() const { return m_bIsVisible; }
    68     bool hasAlpha() const { return m_bIsAlpha; }
    69     uint xHot() const { return m_uXHot; }
    70     uint yHot() const { return m_uYHot; }
    71     uint width() const { return m_uWidth; }
    72     uint height() const { return m_uHeight; }
    73     const uchar *shapeData() const { return m_shape.size() > 0 ? m_shape.data() : NULL; }
    74 
    75 private:
    76 
    77     bool m_bIsVisible, m_bIsAlpha;
    78     uint m_uXHot, m_uYHot, m_uWidth, m_uHeight;
    79     QVector<uint8_t> m_shape;
    80 };
    81 
    82 /* Guest mouse absolute positioning capability change event: */
    83 class UIMouseCapabilityChangeEvent : public QEvent
    84 {
    85 public:
    86 
    87     UIMouseCapabilityChangeEvent(bool bSupportsAbsolute, bool bSupportsRelative, bool bNeedsHostCursor)
    88         : QEvent((QEvent::Type)UIConsoleEventType_MouseCapabilityChange)
    89         , m_bSupportsAbsolute(bSupportsAbsolute), m_bSupportsRelative(bSupportsRelative), m_bNeedsHostCursor(bNeedsHostCursor) {}
    90 
    91     bool supportsAbsolute() const { return m_bSupportsAbsolute; }
    92     bool supportsRelative() const { return m_bSupportsRelative; }
    93     bool needsHostCursor() const { return m_bNeedsHostCursor; }
    94 
    95 private:
    96 
    97     bool m_bSupportsAbsolute;
    98     bool m_bSupportsRelative;
    99     bool m_bNeedsHostCursor;
    100 };
    101 
    102 /* Keyboard LEDs change event: */
    103 class UIKeyboardLedsChangeEvent : public QEvent
    104 {
    105 public:
    106 
    107     UIKeyboardLedsChangeEvent(bool bNumLock, bool bCapsLock, bool bScrollLock)
    108         : QEvent((QEvent::Type)UIConsoleEventType_KeyboardLedsChange)
    109         , m_bNumLock(bNumLock), m_bCapsLock(bCapsLock), m_bScrollLock(bScrollLock) {}
    110 
    111     bool numLock() const { return m_bNumLock; }
    112     bool capsLock() const { return m_bCapsLock; }
    113     bool scrollLock() const { return m_bScrollLock; }
    114 
    115 private:
    116 
    117     bool m_bNumLock;
    118     bool m_bCapsLock;
    119     bool m_bScrollLock;
    120 };
    121 
    122 /* Machine state change event: */
    123 class UIStateChangeEvent : public QEvent
    124 {
    125 public:
    126 
    127     UIStateChangeEvent(KMachineState machineState)
    128         : QEvent((QEvent::Type)UIConsoleEventType_StateChange)
    129         , m_machineState(machineState) {}
    130 
    131     KMachineState machineState() const { return m_machineState; }
    132 
    133 private:
    134 
    135     KMachineState m_machineState;
    136 };
    137 
    138 /* Guest Additions state change event: */
    139 class UIAdditionsStateChangeEvent : public QEvent
    140 {
    141 public:
    142 
    143     UIAdditionsStateChangeEvent()
    144         : QEvent((QEvent::Type)UIConsoleEventType_AdditionsStateChange) {}
    145 };
    146 
    147 /* Network adapter change event: */
    148 class UINetworkAdapterChangeEvent : public QEvent
    149 {
    150 public:
    151 
    152     UINetworkAdapterChangeEvent(const CNetworkAdapter &networkAdapter)
    153         : QEvent((QEvent::Type)UIConsoleEventType_NetworkAdapterChange)
    154         , m_networkAdapter(networkAdapter) {}
    155 
    156     const CNetworkAdapter& networkAdapter() { return m_networkAdapter; }
    157 
    158 private:
    159 
    160     const CNetworkAdapter m_networkAdapter;
    161 };
    162 
    163 /* Serial port change event: */
    164 /* Not used:
    165 class UISerialPortChangeEvent : public QEvent
    166 {
    167 public:
    168 
    169     UISerialPortChangeEvent(const CSerialPort &serialPort)
    170         : QEvent((QEvent::Type)UIConsoleEventType_SerialPortChange)
    171         , m_serialPort(serialPort) {}
    172 
    173     const CSerialPort& serialPort() { return m_serialPort; }
    174 
    175 private:
    176 
    177     const CSerialPort m_serialPort;
    178 };
    179 */
    180 
    181 /* Parallel port change event: */
    182 /* Not used:
    183 class UIParallelPortChangeEvent : public QEvent
    184 {
    185 public:
    186 
    187     UIParallelPortChangeEvent(const CParallelPort &parallelPort)
    188         : QEvent((QEvent::Type)UIConsoleEventType_ParallelPortChange)
    189         , m_parallelPort(parallelPort) {}
    190 
    191     const CParallelPort& parallelPort() { return m_parallelPort; }
    192 
    193 private:
    194 
    195     const CParallelPort m_parallelPort;
    196 };
    197 */
    198 
    199 /* Storage controller change event: */
    200 /* Not used:
    201 class UIStorageControllerChangeEvent : public QEvent
    202 {
    203 public:
    204 
    205     UIStorageControllerChangeEvent()
    206         : QEvent((QEvent::Type)UIConsoleEventType_StorageControllerChange) {}
    207 };
    208 */
    209 
    210 /* Storage medium change event: */
    211 class UIMediumChangeEvent : public QEvent
    212 {
    213 public:
    214 
    215     UIMediumChangeEvent(const CMediumAttachment &mediumAttachment)
    216         : QEvent((QEvent::Type)UIConsoleEventType_MediumChange)
    217         , m_mediumAttachment(mediumAttachment) {}
    218     const CMediumAttachment& mediumAttachment() { return m_mediumAttachment; }
    219 
    220 private:
    221 
    222     const CMediumAttachment m_mediumAttachment;
    223 };
    224 
    225 /* CPU change event: */
    226 /* Not used:
    227 class UICPUChangeEvent : public QEvent
    228 {
    229 public:
    230 
    231     UICPUChangeEvent(ulong uCPU, bool bRemove)
    232         : QEvent((QEvent::Type)UIConsoleEventType_CPUChange)
    233         , m_uCPU(uCPU), m_bRemove(bRemove) {}
    234 
    235     ulong cpu() const { return m_uCPU; }
    236     bool remove() const { return m_bRemove; }
    237 
    238 private:
    239 
    240     ulong m_uCPU;
    241     bool m_bRemove;
    242 };
    243 */
    244 
    245 /* VRDP server change event: */
    246 /* Not used:
    247 class UIVRDPServerChangeEvent : public QEvent
    248 {
    249 public:
    250 
    251     UIVRDPServerChangeEvent()
    252         : QEvent((QEvent::Type)UIConsoleEventType_VRDPServerChange) {}
    253 };
    254 */
    255 
    256 /* Remote display info change event: */
    257 /* Not used:
    258 class UIRemoteDisplayInfoChangeEvent : public QEvent
    259 {
    260 public:
    261 
    262     UIRemoteDisplayInfoChangeEvent()
    263         : QEvent((QEvent::Type)UIConsoleEventType_RemoteDisplayInfoChange) {}
    264 };
    265 */
    266 
    267 /* USB controller change event: */
    268 class UIUSBControllerChangeEvent : public QEvent
    269 {
    270 public:
    271 
    272     UIUSBControllerChangeEvent()
    273         : QEvent((QEvent::Type)UIConsoleEventType_USBControllerChange) {}
    274 };
    275 
    276 /* USB device state change event: */
    277 class UIUSBDeviceUIStateChangeEvent : public QEvent
    278 {
    279 public:
    280 
    281     UIUSBDeviceUIStateChangeEvent(const CUSBDevice &device, bool bAttached, const CVirtualBoxErrorInfo &error)
    282         : QEvent((QEvent::Type)UIConsoleEventType_USBDeviceStateChange)
    283         , m_device(device), m_bAttached(bAttached), m_error(error) {}
    284 
    285     const CUSBDevice& device() const { return m_device; }
    286     bool attached() const { return m_bAttached; }
    287     const CVirtualBoxErrorInfo& error() const { return m_error; }
    288 
    289 private:
    290 
    291     const CUSBDevice m_device;
    292     bool m_bAttached;
    293     const CVirtualBoxErrorInfo m_error;
    294 };
    295 
    296 /* Shared folder change event: */
    297 class UISharedFolderChangeEvent : public QEvent
    298 {
    299 public:
    300 
    301     UISharedFolderChangeEvent()
    302         : QEvent((QEvent::Type)UIConsoleEventType_SharedFolderChange) {}
    303 };
    304 
    305 /* VM Runtime error event: */
    306 class UIRuntimeErrorEvent : public QEvent
    307 {
    308 public:
    309 
    310     UIRuntimeErrorEvent(bool bFatal, const QString &strErrorID, const QString &strMessage)
    311         : QEvent((QEvent::Type)UIConsoleEventType_RuntimeError)
    312         , m_bFatal(bFatal), m_strErrorID(strErrorID), m_strMessage(strMessage) {}
    313 
    314     bool fatal() const { return m_bFatal; }
    315     QString errorID() const { return m_strErrorID; }
    316     QString message() const { return m_strMessage; }
    317 
    318 private:
    319 
    320     bool m_bFatal;
    321     QString m_strErrorID;
    322     QString m_strMessage;
    323 };
    324 
    325 /* Can show window event: */
    326 /* Not used:
    327 class UICanUIShowWindowEvent : public QEvent
    328 {
    329 public:
    330 
    331     UICanUIShowWindowEvent()
    332         : QEvent((QEvent::Type)UIConsoleEventType_CanShowWindow) {}
    333 };
    334 */
    335 
    336 /* Show window event: */
    337 #ifdef Q_WS_MAC
    338 class UIShowWindowEvent : public QEvent
    339 {
    340 public:
    341 
    342     UIShowWindowEvent()
    343         : QEvent((QEvent::Type)UIConsoleEventType_ShowWindow) {}
    344 };
    345 #endif /* Q_WS_MAC */
    346 
    347 class UIConsoleCallback : VBOX_SCRIPTABLE_IMPL(IConsoleCallback)
    348 {
    349 public:
    350 
    351     UIConsoleCallback(UISession *pEventHandler)
    352         : m_pEventHandler(pEventHandler)
    353 #if defined (Q_WS_WIN)
    354         , m_iRefCount(0)
    355 #endif
    356     {
    357     }
    358 
    359     virtual ~UIConsoleCallback()
    360     {
    361     }
    362 
    363     NS_DECL_ISUPPORTS
    364 
    365 #if defined (Q_WS_WIN)
    366     STDMETHOD_(ULONG, AddRef)()
    367     {
    368         return ::InterlockedIncrement(&m_iRefCount);
    369     }
    370     STDMETHOD_(ULONG, Release)()
    371     {
    372         long iCount = ::InterlockedDecrement(&m_iRefCount);
    373         if (iCount == 0)
    374             delete this;
    375         return iCount;
    376     }
    377 #endif
    378 
    379     VBOX_SCRIPTABLE_DISPATCH_IMPL(IConsoleCallback)
    380 
    381     STDMETHOD(OnMousePointerShapeChange)(BOOL bIsVisible, BOOL bAlpha, ULONG uXHot, ULONG uYHot, ULONG uWidth, ULONG uHeight, ComSafeArrayIn(BYTE, pShape))
    382     {
    383         com::SafeArray<BYTE> aShape(ComSafeArrayInArg(pShape));
    384         QVector<uint8_t> shapeVec(static_cast<int>(aShape.size()));
    385         for (int i = 0; i < shapeVec.size(); ++i)
    386             shapeVec[i] = aShape[i];
    387         QApplication::postEvent(m_pEventHandler, new UIMousePointerShapeChangeEvent(bIsVisible, bAlpha, uXHot, uYHot, uWidth, uHeight, shapeVec));
    388         return S_OK;
    389     }
    390 
    391     STDMETHOD(OnMouseCapabilityChange)(BOOL bSupportsAbsolute, BOOL bSupportsRelative, BOOL bNeedHostCursor)
    392     {
    393         QApplication::postEvent(m_pEventHandler, new UIMouseCapabilityChangeEvent(bSupportsAbsolute, bSupportsRelative, bNeedHostCursor));
    394         return S_OK;
    395     }
    396 
    397     STDMETHOD(OnKeyboardLedsChange)(BOOL bNumLock, BOOL bCapsLock, BOOL bScrollLock)
    398     {
    399         QApplication::postEvent(m_pEventHandler, new UIKeyboardLedsChangeEvent(bNumLock, bCapsLock, bScrollLock));
    400         return S_OK;
    401     }
    402 
    403     STDMETHOD(OnStateChange)(MachineState_T machineState)
    404     {
    405         QApplication::postEvent(m_pEventHandler, new UIStateChangeEvent((KMachineState)machineState));
    406         return S_OK;
    407     }
    408 
    409     STDMETHOD(OnAdditionsStateChange)()
    410     {
    411         QApplication::postEvent(m_pEventHandler, new UIAdditionsStateChangeEvent);
    412         return S_OK;
    413     }
    414 
    415     STDMETHOD(OnNetworkAdapterChange)(INetworkAdapter *pNetworkAdapter)
    416     {
    417         QApplication::postEvent(m_pEventHandler, new UINetworkAdapterChangeEvent(CNetworkAdapter(pNetworkAdapter)));
    418         return S_OK;
    419     }
    420 
    421     STDMETHOD(OnSerialPortChange)(ISerialPort * /* pSerialPort */)
    422     {
    423         /* Not used: QApplication::postEvent(m_pEventHandler, new UISerialPortChangeEvent(CSerialPort(pSerialPort))); */
    424         return VBOX_E_DONT_CALL_AGAIN;
    425     }
    426 
    427     STDMETHOD(OnParallelPortChange)(IParallelPort * /* pParallelPort */)
    428     {
    429         /* Not used: QApplication::postEvent(m_pEventHandler, new UIParallelPortChangeEvent(CParallelPort(pParallelPort))); */
    430         return VBOX_E_DONT_CALL_AGAIN;
    431     }
    432 
    433     STDMETHOD(OnStorageControllerChange)()
    434     {
    435         /* Not used: QApplication::postEvent(m_pEventHandler, new UIStorageControllerChangeEvent); */
    436         return VBOX_E_DONT_CALL_AGAIN;
    437     }
    438 
    439     STDMETHOD(OnMediumChange)(IMediumAttachment *pMediumAttachment)
    440     {
    441         QApplication::postEvent(m_pEventHandler, new UIMediumChangeEvent(CMediumAttachment(pMediumAttachment)));
    442         return S_OK;
    443     }
    444 
    445     STDMETHOD(OnCPUChange)(ULONG /* uCPU */, BOOL /* bRemove */)
    446     {
    447         /* Not used: QApplication::postEvent(m_pEventHandler, new UICPUChangeEvent(uCPU, bRemove)); */
    448         return VBOX_E_DONT_CALL_AGAIN;
    449     }
    450 
    451     STDMETHOD(OnVRDPServerChange)()
    452     {
    453         /* Not used: QApplication::postEvent(m_pEventHandler, new UIVRDPServerChangeEvent); */
    454         return VBOX_E_DONT_CALL_AGAIN;
    455     }
    456 
    457     STDMETHOD(OnRemoteDisplayInfoChange)()
    458     {
    459         /* Not used: QApplication::postEvent(m_pEventHandler, new UIRemoteDisplayInfoChangeEvent); */
    460         return VBOX_E_DONT_CALL_AGAIN;
    461     }
    462 
    463     STDMETHOD(OnUSBControllerChange)()
    464     {
    465         QApplication::postEvent(m_pEventHandler, new UIUSBControllerChangeEvent);
    466         return S_OK;
    467     }
    468 
    469     STDMETHOD(OnUSBDeviceStateChange)(IUSBDevice *pDevice, BOOL bAttached, IVirtualBoxErrorInfo *pError)
    470     {
    471         QApplication::postEvent(m_pEventHandler, new UIUSBDeviceUIStateChangeEvent(CUSBDevice(pDevice), bAttached, CVirtualBoxErrorInfo(pError)));
    472         return S_OK;
    473     }
    474 
    475     STDMETHOD(OnSharedFolderChange)(Scope_T scope)
    476     {
    477         NOREF(scope);
    478         QApplication::postEvent(m_pEventHandler, new UISharedFolderChangeEvent);
    479         return S_OK;
    480     }
    481 
    482     STDMETHOD(OnRuntimeError)(BOOL bFatal, IN_BSTR strId, IN_BSTR strMessage)
    483     {
    484         QApplication::postEvent(m_pEventHandler, new UIRuntimeErrorEvent(bFatal, QString::fromUtf16(strId), QString::fromUtf16(strMessage)));
    485         return S_OK;
    486     }
    487 
    488     STDMETHOD(OnCanShowWindow)(BOOL *pbCanShow)
    489     {
    490         if (!pbCanShow)
    491             return E_POINTER;
    492 
    493         *pbCanShow = TRUE;
    494         return S_OK;
    495     }
    496 
    497     STDMETHOD(OnShowWindow)(ULONG64 *puWinId)
    498     {
    499         if (!puWinId)
    500             return E_POINTER;
    501 
    502 #ifdef Q_WS_MAC
    503         /* Let's try the simple approach first - grab the focus.
    504          * Getting a window out of the dock (minimized or whatever it's called)
    505          * needs to be done on the GUI thread, so post it a note: */
    506         *puWinId = 0;
    507         if (!m_pEventHandler)
    508             return S_OK;
    509 
    510         if (::darwinSetFrontMostProcess())
    511             QApplication::postEvent(m_pEventHandler, new UIShowWindowEvent);
    512         else
    513         {
    514             /* It failed for some reason, send the other process our PSN so it can try.
    515              * (This is just a precaution should Mac OS X start imposing the same sensible
    516              * focus stealing restrictions that other window managers implement). */
    517             *puWinId = ::darwinGetCurrentProcessId();
    518         }
    519 #else /* Q_WS_MAC */
    520         /* Return the ID of the top-level console window. */
    521         *puWinId = (ULONG64)m_pEventHandler->winId();
    522 #endif /* !Q_WS_MAC */
    523 
    524         return S_OK;
    525     }
    526 
    527 private:
    528 
    529     UISession *m_pEventHandler;
    530 
    531 #if defined (Q_WS_WIN)
    532     long m_iRefCount;
    533 #endif
    534 };
    535 
    536 #if !defined (Q_WS_WIN)
    537 NS_DECL_CLASSINFO(UIConsoleCallback)
    538 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(UIConsoleCallback, IConsoleCallback)
    539 #endif
    540 
    54149UISession::UISession(UIMachine *pMachine, CSession &sessionReference)
    54250    : QObject(pMachine)
     
    54452    , m_pMachine(pMachine)
    54553    , m_session(sessionReference)
    546     , m_callback(CConsoleCallback(new UIConsoleCallback(this)))
    54754    /* Common variables: */
    54855    , m_pMenuPool(0)
     
    57986    , m_fIsHidingHostPointer(true)
    58087{
    581     /* Register console callback: */
    582     session().GetConsole().RegisterCallback(m_callback);
     88    /* Explicit initialize the console event handler */
     89    UIConsoleEventHandler::instance(this);
     90
     91    /* Add console event connections */
     92    connect(gConsoleEvents, SIGNAL(sigMousePointerShapeChange(bool, bool, QPoint, QSize, QVector<uint8_t>)),
     93            this, SLOT(sltMousePointerShapeChange(bool, bool, QPoint, QSize, QVector<uint8_t>)));
     94
     95    connect(gConsoleEvents, SIGNAL(sigMouseCapabilityChange(bool, bool, bool)),
     96            this, SLOT(sltMouseCapabilityChange(bool, bool, bool)));
     97
     98    connect(gConsoleEvents, SIGNAL(sigKeyboardLedsChangeEvent(bool, bool, bool)),
     99            this, SLOT(sltKeyboardLedsChangeEvent(bool, bool, bool)));
     100
     101    connect(gConsoleEvents, SIGNAL(sigStateChange(KMachineState)),
     102            this, SLOT(sltStateChange(KMachineState)));
     103
     104    connect(gConsoleEvents, SIGNAL(sigAdditionsChange()),
     105            this, SLOT(sltAdditionsChange()));
     106
     107    connect(gConsoleEvents, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter)),
     108            this, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter)));
     109
     110    connect(gConsoleEvents, SIGNAL(sigMediumChange(CMediumAttachment)),
     111            this, SIGNAL(sigMediumChange(CMediumAttachment)));
     112
     113    connect(gConsoleEvents, SIGNAL(sigUSBControllerChange()),
     114            this, SIGNAL(sigUSBControllerChange()));
     115
     116    connect(gConsoleEvents, SIGNAL(sigUSBDeviceStateChange(CUSBDevice, bool, CVirtualBoxErrorInfo)),
     117            this, SIGNAL(sigUSBDeviceStateChange(CUSBDevice, bool, CVirtualBoxErrorInfo)));
     118
     119    connect(gConsoleEvents, SIGNAL(sigSharedFolderChange(Scope_T)),
     120            this, SLOT(sltSharedFolderChange(Scope_T)));
     121
     122    connect(gConsoleEvents, SIGNAL(sigRuntimeError(bool, QString, QString)),
     123            this, SIGNAL(sigRuntimeError(bool, QString, QString)));
     124
     125#ifdef Q_WS_MAC
     126    connect(gConsoleEvents, SIGNAL(sigShowWindow()),
     127            this, SIGNAL(sigShowWindows()),
     128            Qt::QueuedConnection);
     129#endif /* Q_WS_MAC */
    583130
    584131    /* Prepare main menu: */
     
    597144    cleanupMenuPool();
    598145
    599     /* Unregister console callback: */
    600     session().GetConsole().UnregisterCallback(m_callback);
     146    /* Destroy the console event handler */
     147    UIConsoleEventHandler::destroy();
    601148
    602149#if defined(Q_WS_WIN)
     
    922469}
    923470
    924 bool UISession::event(QEvent *pEvent)
    925 {
    926     switch (pEvent->type())
    927     {
    928         case UIConsoleEventType_MousePointerShapeChange:
    929         {
    930             /* Convert to mouse shape change event: */
    931             UIMousePointerShapeChangeEvent *pConsoleEvent = static_cast<UIMousePointerShapeChangeEvent*>(pEvent);
    932 
    933             /* In case of shape data is present: */
    934             if (pConsoleEvent->shapeData())
    935             {
    936                 /* We are ignoring visibility flag: */
    937                 m_fIsHidingHostPointer = false;
    938 
    939                 /* And updating current cursor shape: */
    940                 setPointerShape(pConsoleEvent->shapeData(), pConsoleEvent->hasAlpha(),
    941                                 pConsoleEvent->xHot(), pConsoleEvent->yHot(),
    942                                 pConsoleEvent->width(), pConsoleEvent->height());
    943             }
    944             /* In case of shape data is NOT present: */
    945             else
    946             {
    947                 /* Remember if we should hide the cursor: */
    948                 m_fIsHidingHostPointer = !pConsoleEvent->isVisible();
    949             }
    950 
    951             /* Notify listeners about mouse capability changed: */
    952             emit sigMousePointerShapeChange();
    953 
    954             /* Accept event: */
    955             pEvent->accept();
    956             return true;
    957         }
    958 
    959         case UIConsoleEventType_MouseCapabilityChange:
    960         {
    961             /* Convert to mouse capability event: */
    962             UIMouseCapabilityChangeEvent *pConsoleEvent = static_cast<UIMouseCapabilityChangeEvent*>(pEvent);
    963 
    964             /* Check if something had changed: */
    965             if (m_fIsMouseSupportsAbsolute != pConsoleEvent->supportsAbsolute() ||
    966                 m_fIsMouseSupportsRelative != pConsoleEvent->supportsRelative() ||
    967                 m_fIsMouseHostCursorNeeded != pConsoleEvent->needsHostCursor())
    968             {
    969                 /* Store new data: */
    970                 m_fIsMouseSupportsAbsolute = pConsoleEvent->supportsAbsolute();
    971                 m_fIsMouseSupportsRelative = pConsoleEvent->supportsRelative();
    972                 m_fIsMouseHostCursorNeeded = pConsoleEvent->needsHostCursor();
    973 
    974                 /* Notify listeners about mouse capability changed: */
    975                 emit sigMouseCapabilityChange();
    976             }
    977 
    978             /* Accept event: */
    979             pEvent->accept();
    980             return true;
    981         }
    982 
    983         case UIConsoleEventType_KeyboardLedsChange:
    984         {
    985             /* Convert to keyboard LEDs change event: */
    986             UIKeyboardLedsChangeEvent *pConsoleEvent = static_cast<UIKeyboardLedsChangeEvent*>(pEvent);
    987 
    988             /* Check if something had changed: */
    989             if (m_fNumLock != pConsoleEvent->numLock() ||
    990                 m_fCapsLock != pConsoleEvent->capsLock() ||
    991                 m_fScrollLock != pConsoleEvent->scrollLock())
    992             {
    993                 /* Store new num lock data: */
    994                 if (m_fNumLock != pConsoleEvent->numLock())
    995                 {
    996                     m_fNumLock = pConsoleEvent->numLock();
    997                     m_uNumLockAdaptionCnt = 2;
    998                 }
    999 
    1000                 /* Store new caps lock data: */
    1001                 if (m_fCapsLock != pConsoleEvent->capsLock())
    1002                 {
    1003                     m_fCapsLock = pConsoleEvent->capsLock();
    1004                     m_uCapsLockAdaptionCnt = 2;
    1005                 }
    1006 
    1007                 /* Store new scroll lock data: */
    1008                 if (m_fScrollLock != pConsoleEvent->scrollLock())
    1009                 {
    1010                     m_fScrollLock = pConsoleEvent->scrollLock();
    1011                 }
    1012 
    1013                 /* Notify listeners about mouse capability changed: */
    1014                 emit sigKeyboardLedsChange();
    1015             }
    1016 
    1017             /* Accept event: */
    1018             pEvent->accept();
    1019             return true;
    1020         }
    1021 
    1022         case UIConsoleEventType_StateChange:
    1023         {
    1024             /* Convert to machine state event: */
    1025             UIStateChangeEvent *pConsoleEvent = static_cast<UIStateChangeEvent*>(pEvent);
    1026 
    1027             /* Check if something had changed: */
    1028             if (m_machineState != pConsoleEvent->machineState())
    1029             {
    1030                 /* Store new data: */
    1031                 m_machineState = pConsoleEvent->machineState();
    1032 
    1033                 /* Notify listeners about machine state changed: */
    1034                 emit sigMachineStateChange();
    1035             }
    1036 
    1037             /* Accept event: */
    1038             pEvent->accept();
    1039             return true;
    1040         }
    1041 
    1042         case UIConsoleEventType_AdditionsStateChange:
    1043         {
    1044             /* Get our guest: */
    1045             CGuest guest = session().GetConsole().GetGuest();
    1046 
    1047             /* Variable flags: */
    1048             bool fIsGuestAdditionsActive = guest.GetAdditionsActive();
    1049             bool fIsGuestSupportsGraphics = guest.GetSupportsGraphics();
    1050             bool fIsGuestSupportsSeamless = guest.GetSupportsSeamless();
    1051 
    1052             /* Check if something had changed: */
    1053             if (m_fIsGuestAdditionsActive != fIsGuestAdditionsActive ||
    1054                 m_fIsGuestSupportsGraphics != fIsGuestSupportsGraphics ||
    1055                 m_fIsGuestSupportsSeamless != fIsGuestSupportsSeamless)
    1056             {
    1057                 /* Store new data: */
    1058                 m_fIsGuestAdditionsActive = fIsGuestAdditionsActive;
    1059                 m_fIsGuestSupportsGraphics = fIsGuestSupportsGraphics;
    1060                 m_fIsGuestSupportsSeamless = fIsGuestSupportsSeamless;
    1061 
    1062                 /* Notify listeners about guest additions state changed: */
    1063                 emit sigAdditionsStateChange();
    1064             }
    1065 
    1066             /* Accept event: */
    1067             pEvent->accept();
    1068             return true;
    1069         }
    1070 
    1071         case UIConsoleEventType_NetworkAdapterChange:
    1072         {
    1073             UINetworkAdapterChangeEvent *pConsoleEvent = static_cast<UINetworkAdapterChangeEvent*>(pEvent);
    1074             emit sigNetworkAdapterChange(pConsoleEvent->networkAdapter());
    1075             return true;
    1076         }
    1077 
    1078         /* Not used:
    1079         case UIConsoleEventType_SerialPortChange:
    1080         {
    1081             UISerialPortChangeEvent *pConsoleEvent = static_cast<UISerialPortChangeEvent*>(pEvent);
    1082             emit sigSerialPortChange(pConsoleEvent->serialPort());
    1083             return true;
    1084         }
    1085         */
    1086 
    1087         /* Not used:
    1088         case UIConsoleEventType_ParallelPortChange:
    1089         {
    1090             UIParallelPortChangeEvent *pConsoleEvent = static_cast<UIParallelPortChangeEvent*>(pEvent);
    1091             emit sigParallelPortChange(pConsoleEvent->parallelPort());
    1092             return true;
    1093         }
    1094         */
    1095 
    1096         /* Not used:
    1097         case UIConsoleEventType_StorageControllerChange:
    1098         {
    1099             emit sigStorageControllerChange();
    1100             return true;
    1101         }
    1102         */
    1103 
    1104         case UIConsoleEventType_MediumChange:
    1105         {
    1106             UIMediumChangeEvent *pConsoleEvent = static_cast<UIMediumChangeEvent*>(pEvent);
    1107             emit sigMediumChange(pConsoleEvent->mediumAttachment());
    1108             return true;
    1109         }
    1110 
    1111         /* Not used:
    1112         case UIConsoleEventType_CPUChange:
    1113         {
    1114             UICPUChangeEvent *pConsoleEvent = static_cast<UICPUChangeEvent*>(pEvent);
    1115             emit sigCPUChange(pConsoleEvent->cpu(), pConsoleEvent->remove());
    1116             return true;
    1117         }
    1118         */
    1119 
    1120         /* Not used:
    1121         case UIConsoleEventType_VRDPServerChange:
    1122         {
    1123             emit sigVRDPServerChange();
    1124             return true;
    1125         }
    1126         */
    1127 
    1128         /* Not used:
    1129         case UIConsoleEventType_RemoteDisplayInfoChange:
    1130         {
    1131             emit sigRemoteDisplayInfoChange();
    1132             return true;
    1133         }
    1134         */
    1135 
    1136         case UIConsoleEventType_USBControllerChange:
    1137         {
    1138             emit sigUSBControllerChange();
    1139             return true;
    1140         }
    1141 
    1142         case UIConsoleEventType_USBDeviceStateChange:
    1143         {
    1144             UIUSBDeviceUIStateChangeEvent *pConsoleEvent = static_cast<UIUSBDeviceUIStateChangeEvent*>(pEvent);
    1145             emit sigUSBDeviceStateChange(pConsoleEvent->device(), pConsoleEvent->attached(), pConsoleEvent->error());
    1146             return true;
    1147         }
    1148 
    1149         case UIConsoleEventType_SharedFolderChange:
    1150         {
    1151             emit sigSharedFolderChange();
    1152             return true;
    1153         }
    1154 
    1155         case UIConsoleEventType_RuntimeError:
    1156         {
    1157             UIRuntimeErrorEvent *pConsoleEvent = static_cast<UIRuntimeErrorEvent*>(pEvent);
    1158             emit sigRuntimeError(pConsoleEvent->fatal(), pConsoleEvent->errorID(), pConsoleEvent->message());
    1159             return true;
    1160         }
    1161 
    1162 #ifdef Q_WS_MAC
    1163         case UIConsoleEventType_ShowWindow:
    1164         {
    1165             emit sigShowWindows();
    1166             /* Accept event: */
    1167             pEvent->accept();
    1168             return true;
    1169         }
    1170 #endif
    1171 
    1172         default:
    1173             break;
    1174     }
    1175     return QObject::event(pEvent);
     471void UISession::sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape)
     472{
     473    /* In case of shape data is present: */
     474    if (shape.size() > 0)
     475    {
     476        /* We are ignoring visibility flag: */
     477        m_fIsHidingHostPointer = false;
     478
     479        /* And updating current cursor shape: */
     480        setPointerShape(shape.data(), fAlpha,
     481                        hotCorner.x(), hotCorner.y(),
     482                        size.width(), size.height());
     483    }
     484    /* In case of shape data is NOT present: */
     485    else
     486    {
     487        /* Remember if we should hide the cursor: */
     488        m_fIsHidingHostPointer = !fVisible;
     489    }
     490
     491    /* Notify listeners about mouse capability changed: */
     492    emit sigMousePointerShapeChange();
     493
     494}
     495
     496void UISession::sltMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative, bool fNeedsHostCursor)
     497{
     498    /* Check if something had changed: */
     499    if (   m_fIsMouseSupportsAbsolute != fSupportsAbsolute
     500        || m_fIsMouseSupportsRelative != fSupportsRelative
     501        || m_fIsMouseHostCursorNeeded != fNeedsHostCursor)
     502    {
     503        /* Store new data: */
     504        m_fIsMouseSupportsAbsolute = fSupportsAbsolute;
     505        m_fIsMouseSupportsRelative = fSupportsRelative;
     506        m_fIsMouseHostCursorNeeded = fNeedsHostCursor;
     507
     508        /* Notify listeners about mouse capability changed: */
     509        emit sigMouseCapabilityChange();
     510    }
     511}
     512
     513void UISession::sltKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock)
     514{
     515    /* Check if something had changed: */
     516    if (   m_fNumLock != fNumLock
     517        || m_fCapsLock != fCapsLock
     518        || m_fScrollLock != fScrollLock)
     519    {
     520        /* Store new num lock data: */
     521        if (m_fNumLock != fNumLock)
     522        {
     523            m_fNumLock = fNumLock;
     524            m_uNumLockAdaptionCnt = 2;
     525        }
     526
     527        /* Store new caps lock data: */
     528        if (m_fCapsLock != fCapsLock)
     529        {
     530            m_fCapsLock = fCapsLock;
     531            m_uCapsLockAdaptionCnt = 2;
     532        }
     533
     534        /* Store new scroll lock data: */
     535        if (m_fScrollLock != fScrollLock)
     536        {
     537            m_fScrollLock = fScrollLock;
     538        }
     539
     540        /* Notify listeners about mouse capability changed: */
     541        emit sigKeyboardLedsChange();
     542    }
     543}
     544
     545void UISession::sltStateChange(KMachineState state)
     546{
     547    /* Check if something had changed: */
     548    if (m_machineState != state)
     549    {
     550        /* Store new data: */
     551        m_machineState = state;
     552
     553        /* Notify listeners about machine state changed: */
     554        emit sigMachineStateChange();
     555    }
     556}
     557
     558void UISession::sltAdditionsChange()
     559{
     560    /* Get our guest: */
     561    CGuest guest = session().GetConsole().GetGuest();
     562
     563    /* Variable flags: */
     564    bool fIsGuestAdditionsActive = guest.GetAdditionsActive();
     565    bool fIsGuestSupportsGraphics = guest.GetSupportsGraphics();
     566    bool fIsGuestSupportsSeamless = guest.GetSupportsSeamless();
     567
     568    /* Check if something had changed: */
     569    if (m_fIsGuestAdditionsActive != fIsGuestAdditionsActive ||
     570        m_fIsGuestSupportsGraphics != fIsGuestSupportsGraphics ||
     571        m_fIsGuestSupportsSeamless != fIsGuestSupportsSeamless)
     572    {
     573        /* Store new data: */
     574        m_fIsGuestAdditionsActive = fIsGuestAdditionsActive;
     575        m_fIsGuestSupportsGraphics = fIsGuestSupportsGraphics;
     576        m_fIsGuestSupportsSeamless = fIsGuestSupportsSeamless;
     577
     578        /* Notify listeners about guest additions state changed: */
     579        emit sigAdditionsStateChange();
     580    }
     581}
     582
     583void UISession::sltSharedFolderChange(Scope_T /* scope */)
     584{
     585    emit sigSharedFolderChange();
    1176586}
    1177587
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r30408 r30677  
    159159    void sigAdditionsStateChange();
    160160    void sigNetworkAdapterChange(const CNetworkAdapter &networkAdapter);
    161     /* Not used: void sigSerialPortChange(const CSerialPort &serialPort); */
    162     /* Not used: void sigParallelPortChange(const CParallelPort &parallelPort); */
    163     /* Not used: void sigStorageControllerChange(); */
    164161    void sigMediumChange(const CMediumAttachment &mediumAttachment);
    165     /* Not used: void sigCPUChange(ulong uCPU, bool bRemove); */
    166     /* Not used: void sigVRDPServerChange(); */
    167     /* Not used: void sigRemoteDisplayInfoChange(); */
    168162    void sigUSBControllerChange();
    169163    void sigUSBDeviceStateChange(const CUSBDevice &device, bool bIsAttached, const CVirtualBoxErrorInfo &error);
     
    186180    void sltCloseVirtualSession();
    187181
     182    /* Console events slots */
     183    void sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape);
     184    void sltMouseCapabilityChange(bool fSupportsAbsolute, bool fSupportsRelative, bool fNeedsHostCursor);
     185    void sltKeyboardLedsChangeEvent(bool fNumLock, bool fCapsLock, bool fScrollLock);
     186    void sltStateChange(KMachineState state);
     187    void sltAdditionsChange();
     188    void sltSharedFolderChange(Scope_T scope);
     189
    188190private:
    189191
    190192    /* Private getters: */
    191193    UIMachine* uimachine() const { return m_pMachine; }
    192 
    193     /* Event handlers: */
    194     bool event(QEvent *pEvent);
    195194
    196195    /* Prepare helpers: */
     
    259258
    260259    /* Friend classes: */
    261     friend class UIConsoleCallback;
     260    friend class UIConsoleEventHandler;
    262261};
    263262
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r30542 r30677  
    3434#include "UISession.h"
    3535
    36 
    37 #ifdef Q_WS_MAC
     36#ifdef Q_WS_MAC
     37# include "UIExtraDataEventHandler.h"
    3838# include "VBoxUtils.h"
    3939# include <Carbon/Carbon.h>
     
    168168{
    169169    /* Presentation mode connection */
    170     connect (&vboxGlobal(), SIGNAL(presentationModeChanged(const VBoxChangePresentationModeEvent &)),
    171              this, SLOT(sltChangePresentationMode(const VBoxChangePresentationModeEvent &)));
     170    connect(gEDataEvents, SIGNAL(sigPresentationModeChange(bool)),
     171            this, SLOT(sltChangePresentationMode(bool)));
    172172}
    173173#endif /* Q_WS_MAC */
     
    245245
    246246#ifdef Q_WS_MAC
    247 void UIMachineLogicFullscreen::sltChangePresentationMode(const VBoxChangePresentationModeEvent & /* event */)
     247void UIMachineLogicFullscreen::sltChangePresentationMode(bool /* fEnabled */)
    248248{
    249249    setPresentationModeEnabled(true);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.h

    r29069 r30677  
    2626class UIActionsPool;
    2727class UIMultiScreenLayout;
    28 class VBoxChangePresentationModeEvent;
    2928
    3029class UIMachineLogicFullscreen : public UIMachineLogic
     
    4847
    4948#ifdef RT_OS_DARWIN
    50     void sltChangePresentationMode(const VBoxChangePresentationModeEvent &event);
     49    void sltChangePresentationMode(bool fEnabled);
    5150    void sltScreenLayoutChanged();
    5251#endif /* RT_OS_DARWIN */
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