UIMachineLogicFullscreen.cpp revision 16ac7a7560ee6ba89cf330dd2a45436e58f099c8
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIMachineLogicFullscreen class implementation
*/
/*
* Copyright (C) 2010-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/* Qt includes: */
#include <QDesktopWidget>
/* GUI includes: */
#include "VBoxGlobal.h"
#include "UIMessageCenter.h"
#include "UISession.h"
#include "UIActionPoolRuntime.h"
#include "UIMachineLogicFullscreen.h"
#include "UIMachineWindowFullscreen.h"
#include "UIMultiScreenLayout.h"
#ifdef Q_WS_MAC
# include "UIExtraDataEventHandler.h"
# include "VBoxUtils.h"
#endif /* Q_WS_MAC */
{
/* Create multiscreen layout: */
m_pScreenLayout = new UIMultiScreenLayout(this);
}
{
/* Delete multiscreen layout: */
delete m_pScreenLayout;
}
{
/* Temporary get a machine object: */
#if 0
/* Check that there are enough physical screens are connected: */
if (cHostScreens < cGuestScreens)
{
return false;
}
#endif
/* Check if there is enough physical memory to enter fullscreen: */
if (uisession()->isGuestAdditionsActive())
{
{
return false;
}
}
/* Take the toggle hot key from the menu item.
* Since VBoxGlobal::extractKeyFromActionText gets exactly
* the linked key without the 'Host+' part we are adding it here. */
.arg(VBoxGlobal::extractKeyFromActionText(gActionPool->action(UIActionIndexRuntime_Toggle_Fullscreen)->text()));
/* Show the info message. */
return false;
return true;
}
void UIMachineLogicFullscreen::prepare()
{
/* Call to base-class: */
#ifdef Q_WS_MAC
/* Prepare fullscreen connections: */
#endif /* Q_WS_MAC */
}
{
}
{
}
#ifdef Q_WS_MAC
{
setPresentationModeEnabled(true);
}
{
setPresentationModeEnabled(true);
}
#endif /* Q_WS_MAC */
void UIMachineLogicFullscreen::sltGuestMonitorChange(KGuestMonitorChangedEventType changeType, ulong uScreenId, QRect screenGeo)
{
/* Update multi-screen layout before any window update: */
/* Call to base-class: */
}
{
/* Update multi-screen layout before any window update: */
/* Call to base-class: */
}
{
/* Call to base-class: */
/* Adjust-window action isn't allowed in fullscreen: */
/* Add the view menu: */
pMenu->setVisible(true);
}
{
/* Do not create window(s) if they created already: */
if (isMachineWindowsCreated())
return;
#ifdef Q_WS_MAC // TODO: Is that "darwinSetFrontMostProcess" really need here?
/* We have to make sure that we are getting the front most process.
* This is necessary for Qt versions > 4.3.3: */
#endif /* Q_WS_MAC */
/* Update the multi screen layout: */
/* Create machine window(s): */
/* Connect screen-layout change handler: */
for (int i = 0; i < machineWindows().size(); ++i)
#ifdef Q_WS_MAC
/* If the user change the screen, we have to decide again if the
* presentation mode should be changed. */
this, SLOT(sltScreenLayoutChanged()));
/* Note: Presentation mode has to be set *after* the windows are created. */
setPresentationModeEnabled(true);
#endif /* Q_WS_MAC */
/* Remember what machine window(s) created: */
setMachineWindowsCreated(true);
}
#ifdef Q_WS_MAC
{
/* Presentation mode connection: */
this, SLOT(sltChangePresentationMode(bool)));
}
#endif /* Q_WS_MAC */
{
/* Do not cleanup machine window(s) if not present: */
if (!isMachineWindowsCreated())
return;
/* Cleanup machine window(s): */
#ifdef Q_WS_MAC
setPresentationModeEnabled(false);
#endif/* Q_WS_MAC */
}
{
/* Call to base-class: */
/* Reenable adjust-window action: */
}
#ifdef Q_WS_MAC
{
/* First check if we are on a screen which contains the Dock or the
* Menubar (which hasn't to be the same), only than the
* presentation mode have to be changed. */
if ( fEnabled
{
/* Default to false if it is an empty value */
else
}
else
}
#endif /* Q_WS_MAC */