UIMachineViewFullscreen.cpp revision 4429cc47d1e3ca88d6237e5ee7a876dc409cdc24
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIMachineViewFullscreen class implementation
*/
/*
* Copyright (C) 2010-2012 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.
*/
/* Global includes */
#include <QApplication>
#include <QDesktopWidget>
#include <QMainWindow>
#include <QTimer>
#ifdef Q_WS_MAC
#include <QMenuBar>
#endif
#ifdef Q_WS_X11
#include <limits.h>
#endif
/* Local includes */
#include "VBoxGlobal.h"
#include "UISession.h"
#include "UIActionPoolRuntime.h"
#include "UIMachineLogicFullscreen.h"
#include "UIMachineWindow.h"
#include "UIMachineViewFullscreen.h"
#include "UIFrameBuffer.h"
#ifdef VBOX_WITH_VIDEOHWACCEL
, bool bAccelerate2DVideo
#endif
)
#ifdef VBOX_WITH_VIDEOHWACCEL
#endif
)
, m_bIsGuestAutoresizeEnabled(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)->isChecked())
{
}
{
/* Cleanup frame buffer: */
}
{
}
{
{
{
{
/* Send guest-resize hint only if top window resizing to required dimension: */
break;
/* Recalculate max guest size: */
/* And resize guest to that size: */
break;
}
default:
break;
}
}
}
void UIMachineViewFullscreen::prepareCommon()
{
/* Base class common settings: */
/* Setup size-policy: */
/* Maximum size to sizehint: */
/* Minimum size is ignored: */
setMinimumSize(0, 0);
/* No scrollbars: */
}
{
/* Base class filters: */
}
{
/* Base class connections: */
/* Guest additions state-change updater: */
}
{
if (m_bIsGuestAutoresizeEnabled != fEnabled)
{
if (uisession()->isGuestSupportsGraphics())
}
}
/** Adjusts guest screen size to correspond current <i>working area</i> size. */
{
/* Check if we should adjust guest to new size: */
if (frameBuffer()->isAutoEnabled() ||
if (m_bIsGuestAutoresizeEnabled &&
uisession()->isGuestSupportsGraphics() &&
{
frameBuffer()->setAutoEnabled(false);
}
}
{
/* Get corresponding screen: */
int iScreen = static_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(screenId());
/* Return available geometry for that screen: */
}
{
return workingArea().size();
}