/* $Id$ */
/** @file
* VBox Qt GUI - UIMachineViewNormal 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.
*/
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
# include <QApplication>
# include <QDesktopWidget>
# include <QMainWindow>
# include <QMenuBar>
# include <QScrollBar>
# include <QTimer>
/* GUI includes: */
# include "VBoxGlobal.h"
# include "UISession.h"
# include "UIActionPoolRuntime.h"
# include "UIMachineLogic.h"
# include "UIMachineWindow.h"
# include "UIMachineViewNormal.h"
# include "UIExtraDataManager.h"
# include "UIFrameBuffer.h"
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
#ifdef VBOX_WITH_VIDEOHWACCEL
, bool bAccelerate2DVideo
#endif
)
#ifdef VBOX_WITH_VIDEOHWACCEL
#endif
)
, m_bIsGuestAutoresizeEnabled(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize)->isChecked())
{
/* Resend the last resize hint if necessary: */
}
{
/* Save machine view settings: */
/* Cleanup frame buffer: */
}
{
}
{
{
{
{
/* Recalculate max guest size: */
/* And resize guest to current window size: */
break;
}
default:
break;
}
}
}
{
/* Base class common settings: */
/* Setup size-policy: */
/* Maximum size to sizehint: */
}
{
/* Base class filters: */
#ifdef Q_WS_WIN
/* Install menu-bar event-filter: */
#endif /* Q_WS_WIN */
}
{
/* Base class connections: */
/* Guest additions state-change updater: */
connect(uisession(), SIGNAL(sigAdditionsStateActualChange()), this, SLOT(sltAdditionsStateChanged()));
}
{
/* If guest screen-still visible => store it's size-hint: */
}
{
if (m_bIsGuestAutoresizeEnabled != fEnabled)
{
}
}
{
{
/* Send guest-screen size-hint if needed to reverse a transition to fullscreen or seamless: */
{
LogRel(("UIMachineViewNormal::maybeResendSizeHint: "
"Restoring guest size-hint for screen %d to %dx%d\n",
/* Temporarily restrict the size to prevent a brief resize to the
* framebuffer dimensions (see @a UIMachineView::sizeHint()) before
* the following resize() is acted upon. */
}
}
}
{
/* Acquire central-widget size: */
/* Acquire frame-buffer size: */
/* Take the scale-factor(s) into account: */
/* Check if we should adjust guest-screen to new size: */
if (frameBufferSize != centralWidgetSize)
}
{
}
{
/* 1) The calculation below is not reliable on some (X11) platforms until we
* have been visible for a fraction of a second, so do the best we can
* otherwise.
* 2) We also get called early before "machineWindow" has been fully
* initialised, at which time we can't perform the calculation. */
if (!isVisible())
/* The area taken up by the machine window on the desktop, including window
* frame, title, menu bar and status bar. */
/* The window shouldn't be allowed to expand beyond the working area
* unless it already does. In that case the guest shouldn't expand it
* any further though. */
/* The current size of the machine display. */
/* To work out how big the guest display can get without the window going
* over the maximum size we calculated above, we work out how much space
* the other parts of the window (frame, menu bar, status bar and so on)
* take up and subtract that space from the maximum window size. The
* central widget shouldn't be bigger than the window, but we bound it for
* sanity (or insanity) reasons. */
}