UIMachineView.h revision cfa82602cc477153717a0875667946520e6fee76
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIMachineView class declaration
*/
/*
* Copyright (C) 2010 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.
*/
#ifndef ___UIMachineView_h___
#define ___UIMachineView_h___
/* Global includes */
#include <QAbstractScrollArea>
#include <QEventLoop>
/* Local includes */
#include "COMDefs.h"
#include "UIMachineDefs.h"
#ifdef Q_WS_MAC
# include <CoreFoundation/CFBase.h>
#endif /* Q_WS_MAC */
/* Local forwards */
{
/* Desktop geometry types: */
/* Factory function to create machine-view: */
#ifdef VBOX_WITH_VIDEOHWACCEL
, bool bAccelerate2DVideo
#endif /* VBOX_WITH_VIDEOHWACCEL */
);
/* Factory function to destroy required machine-view: */
/* Public setters: */
/* Public members: */
/* Utility signals: */
void resizeHintDone();
/* Console callback handlers: */
virtual void sltMachineStateChanged();
/* Machine-view constructor: */
#ifdef VBOX_WITH_VIDEOHWACCEL
, bool bAccelerate2DVideo
#endif /* VBOX_WITH_VIDEOHWACCEL */
);
/* Machine-view destructor: */
virtual ~UIMachineView();
/* Prepare routines: */
virtual void prepareFrameBuffer();
virtual void prepareCommon();
virtual void prepareFilters();
virtual void prepareConsoleConnections();
virtual void loadMachineViewSettings();
/* Cleanup routines: */
//virtual void saveMachineViewSettings() {}
//virtual void cleanupConsoleConnections() {}
//virtual void cleanupFilters() {}
//virtual void cleanupCommon() {}
virtual void cleanupFrameBuffer();
/* Protected getters: */
UIMachineLogic* machineLogic() const;
int contentsX() const;
int contentsY() const;
int contentsWidth() const;
int contentsHeight() const;
int visibleWidth() const;
int visibleHeight() const;
bool isMachineWindowResizeIgnored() const { return m_bIsMachineWindowResizeIgnored; }
QSize desktopGeometry() const;
/* Protected setters: */
void setMachineWindowResizeIgnored(bool fIgnore = true) { m_bIsMachineWindowResizeIgnored = fIgnore; }
/* Protected helpers: */
virtual void calculateDesktopGeometry() = 0;
virtual void maybeRestrictMinimumSize() = 0;
virtual void updateSliders();
#ifdef VBOX_WITH_VIDEOHWACCEL
#endif /* VBOX_WITH_VIDEOHWACCEL */
#ifdef Q_WS_MAC
void updateDockIcon();
#endif /* Q_WS_MAC */
/* Cross-platforms event processors: */
/* Platform specific event processors: */
#if defined(Q_WS_WIN)
#endif
/* Private members: */
bool m_bIsMachineWindowResizeIgnored : 1;
#ifdef VBOX_WITH_VIDEOHWACCEL
bool m_fAccelerate2DVideo : 1;
#endif /* VBOX_WITH_VIDEOHWACCEL */
/* Friend classes: */
};
/* This maintenance class is a part of future roll-back mechanism.
* It allows to block main GUI thread until specific event received.
* Later it will become more abstract but now its just used to help
* fullscreen & seamless modes to restore normal guest size hint. */
{
: QEventLoop(0)
, m_iTimerId(0)
{
/* Also start timer to unlock pool in case of
* required condition doesn't happens by some reason: */
}
{
/* Kill the timer: */
}
{
/* If that timer event occurs => it seems
* guest resize event doesn't comes in time,
* shame on it, but we just unlocking 'this': */
exit();
}
int m_iTimerId;
};
#endif // !___UIMachineView_h___