/* $Id$ */
/** @file
* VBox XPDM Display driver, palette related functions
*/
/*
* Copyright (C) 2011 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 "VBoxDisp.h"
#include "VBoxDispMini.h"
/* 10 default palette colors with it's complementors which are used for window decoration colors*/
{
{0, 0, 0, 0},
{0x80, 0, 0, 0},
{0, 0x80, 0, 0},
{0x80, 0x80, 0, 0},
{0, 0, 0x80, 0},
{0x80, 0, 0x80, 0},
{0, 0x80, 0x80, 0},
{0xC0, 0xC0, 0xC0, 0},
{0xC0, 0xDC, 0xC0, 0},
{0xA6, 0xCA, 0xF0, 0},
};
{
{0xFF, 0xFF, 0xFF, 0},
{0, 0xFF, 0xFF, 0},
{0xFF, 0, 0xFF, 0},
{0, 0, 0xFF, 0},
{0xFF, 0xFF, 0, 0},
{0, 0xFF, 0, 0},
{0xFF, 0, 0, 0},
{0x80, 0x80, 0x80, 0},
{0xA0, 0xA0, 0xA4, 0},
{0xFF, 0xFB, 0xF0, 0},
};
/* Creates default device palette */
{
{
if (!pDev->hDefaultPalette)
{
WARN(("EngCreatePalette failed"));
return VERR_GENERAL_FAILURE;
}
return VINF_SUCCESS;
}
/* Create driver managed palette.
* First entry should be black (0,0,0), last should be while (255, 255, 255).
* Note: Other entries should be set in similar way, so that entries with complementing indicies
* have quite contrast colors stored.
*/
{
WARN(("not enough memory!"));
return VERR_NO_MEMORY;
}
BYTE r=0, g=0, b=0;
for (ULONG i=0; i<256; ++i)
{
r += 32;
if (!r)
{
g += 32;
if (!g)
{
b += 64;
}
}
}
/* Now overwrite window decoration colors by common ones */
{
}
/* Sanity check in case we'd change palette filling */
Assert(pDev->pPalette[255].peRed==255 && pDev->pPalette[255].peGreen==255 && pDev->pPalette[255].peBlue==255);
if (!pDev->hDefaultPalette)
{
WARN(("EngCreatePalette failed"));
return VERR_GENERAL_FAILURE;
}
return VINF_SUCCESS;
}
{
if (pDev->hDefaultPalette)
{
pDev->hDefaultPalette = 0;
}
{
}
}
{
{
return VERR_NOT_SUPPORTED;
}
/* Prepare palette info to pass to miniport */
pClut->FirstEntry = 0;
{
}
}
/*
* Display driver callbacks.
*/
BOOL APIENTRY VBoxDispDrvSetPalette(DHPDEV dhpdev, PALOBJ *ppalo, FLONG fl, ULONG iStart, ULONG cColors)
{
int rc;
LOGF_ENTER();
/* Copy PALOBJ colors to PVIDEO_CLUT */
{
WARN(("PALOBJ_cGetColors failed"));
return FALSE;
}
/* Set reserved bytes to 0 and perform shifting if needed */
{
{
}
}
LOGF_LEAVE();
return TRUE;
}