VMControl.cpp revision bd8e360cd1db83dcb2694ea9122ce3bc5bae678a
/** @file
*
* VBox frontends: Basic Frontend (BFE):
* VBoxBFE VM control routines
*
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 "DisplayImpl.h"
#include "ConsoleImpl.h"
#include "VBoxBFE.h"
#include "VMControl.h"
/**
* Fullscreen / Windowed toggle.
*/
int
VMCtrlToggleFullscreen(void)
{
/* not allowed */
if (!gfAllowFullscreenToggle)
return VERR_ACCESS_DENIED;
/*
* screen repaint, just to be sure.
*/
return VINF_SUCCESS;
}
/**
* Pause the VM.
*/
int
VMCtrlPause(void)
{
if (machineState != VMSTATE_RUNNING)
return VERR_VM_INVALID_VM_STATE;
if (gConsole->inputGrabbed())
gConsole->inputGrabEnd();
if (VBOX_SUCCESS(rcVBox))
{
}
return VINF_SUCCESS;
}
/**
* Resume the VM.
*/
int
VMCtrlResume(void)
{
if (machineState != VMSTATE_SUSPENDED)
return VERR_VM_INVALID_VM_STATE;
if (VBOX_SUCCESS(rcVBox))
{
}
return VINF_SUCCESS;
}
/**
* Reset the VM
*/
int
VMCtrlReset(void)
{
if (VBOX_SUCCESS(rcVBox))
{
}
return VINF_SUCCESS;
}
/**
* Send ACPI power button press event
*/
int
VMCtrlACPIButton(void)
{
if (VBOX_SUCCESS (vrc))
{
}
return VINF_SUCCESS;
}
/**
* Worker thread while saving the VM
*/
{
int rc;
startProgressInfo("Saving");
if (VBOX_SUCCESS(rc))
{
}
pfnQuit();
return 0;
}
/*
* Save the machine's state
*/
int
VMCtrlSave(void (*pfnQuit)(void))
{
int rc;
if (!g_pszStateFile || !*g_pszStateFile)
return VERR_INVALID_PARAMETER;
if (gConsole->inputGrabbed())
gConsole->inputGrabEnd();
if (machineState == VMSTATE_RUNNING)
{
if (VBOX_SUCCESS(rc))
{
}
}
RTTHREADTYPE_MAIN_WORKER, 0, "Save");
if (VBOX_FAILURE(rc))
{
return rc;
}
return VINF_SUCCESS;
}