DisplayUtils.cpp revision c7814cf6e1240a519cbec0441e033d0e2470ed00
/* $Id$ */
/** @file
* Implementation of IDisplay helpers.
*/
/*
* 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 <DisplayUtils.h>
#include <VBox/VBoxVideo.h>
int readSavedDisplayScreenshot(const Utf8Str &strStateFilePath, uint32_t u32Type, uint8_t **ppu8Data, uint32_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height)
{
/* @todo cache read data */
if (strStateFilePath.isEmpty())
{
/* No saved state data. */
return VERR_NOT_SUPPORTED;
}
if (RT_SUCCESS(vrc))
{
if (RT_SUCCESS(vrc))
{
if (uVersion == sSSMDisplayScreenshotVer)
{
{
if (typeOfBlock == u32Type)
{
{
{
break;
}
}
else
{
/* No saved state data. */
}
break;
}
else
{
/* displaySSMSaveScreenshot did not write any data, if
* cbBlock was == 2 * sizeof (uint32_t).
*/
{
}
}
}
}
else
{
}
}
}
if (RT_SUCCESS(vrc))
{
{
/* Bitmap is 32bpp, so data is invalid. */
}
}
if (RT_SUCCESS(vrc))
{
*pu32Height = u32Height;
}
return vrc;
}
{
/* @todo not necessary when caching is implemented. */
}
{
/* @todo cache read data */
if (strStateFilePath.isEmpty())
{
/* No saved state data. */
return VERR_NOT_SUPPORTED;
}
if (RT_SUCCESS(vrc))
{
if (RT_SUCCESS(vrc))
{
if ( uVersion == sSSMDisplayVer2
|| uVersion == sSSMDisplayVer3)
{
if (u32ScreenId > cMonitors)
{
}
else
{
if (uVersion == sSSMDisplayVer2)
{
/* Skip all previous monitors, each 5 uint32_t, and the first 3 uint32_t entries. */
*pu32OriginX = 0;
*pu32OriginY = 0;
}
else
{
/* Skip all previous monitors, each 8 uint32_t, and the first 3 uint32_t entries. */
}
}
}
else
{
}
}
}
return vrc;
}