screen.c revision e64031e20c39650a7bc902a3e1aba613b9415dee
/******************************Module*Header*******************************\
*
* Copyright (C) 2006-2007 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.
*/
/*
* Based in part on Microsoft DDK sample code
*
* *******************
* * GDI SAMPLE CODE *
* *******************
*
* Module Name: screen.c
*
* Initializes the GDIINFO and DEVINFO structures for DrvEnablePDEV.
*
* Copyright (c) 1992-1998 Microsoft Corporation
\**************************************************************************/
#include "driver.h"
#define SYSTM_LOGFONT {16,7,0,0,700,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,VARIABLE_PITCH | FF_DONTCARE,L"System"}
#define HELVE_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,VARIABLE_PITCH | FF_DONTCARE,L"MS Sans Serif"}
#define COURI_LOGFONT {12,9,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_STROKE_PRECIS,PROOF_QUALITY,FIXED_PITCH | FF_DONTCARE, L"Courier"}
// This is the basic devinfo for a default driver. This is used as a base and customized based
// on information passed back from the miniport driver.
const DEVINFO gDevInfoFrameBuffer = {
), /* Graphics capabilities */
SYSTM_LOGFONT, /* Default font description */
HELVE_LOGFONT, /* ANSI variable font description */
COURI_LOGFONT, /* ANSI fixed font description */
0, /* Count of device fonts */
0, /* Preferred DIB format */
8, /* Width of color dither */
8, /* Height of color dither */
0 /* Default palette to use for this device */
};
// This is default palette from Win 3.1
#define NUMPALCOLORS 256
#define NUMPALRESERVED 20
{
{ 0, 0, 0, 0 }, // 0
{ 0x80,0, 0, 0 }, // 1
{ 0, 0x80,0, 0 }, // 2
{ 0x80,0x80,0, 0 }, // 3
{ 0, 0, 0x80,0 }, // 4
{ 0x80,0, 0x80,0 }, // 5
{ 0, 0x80,0x80,0 }, // 6
{ 0xC0,0xC0,0xC0,0 }, // 7
{ 192, 220, 192, 0 }, // 8
{ 166, 202, 240, 0 }, // 9
{ 255, 251, 240, 0 }, // 10
{ 160, 160, 164, 0 }, // 11
{ 0x80,0x80,0x80,0 }, // 12
{ 0xFF,0, 0, 0 }, // 13
{ 0, 0xFF,0, 0 }, // 14
{ 0xFF,0xFF,0, 0 }, // 15
{ 0, 0, 0xFF,0 }, // 16
{ 0xFF,0, 0xFF,0 }, // 17
{ 0, 0xFF,0xFF,0 }, // 18
{ 0xFF,0xFF,0xFF,0 } // 19
};
/******************************Public*Routine******************************\
* bInitPDEV
*
* Determine the mode we should be in based on the DEVMODE passed in.
* For mirrored devices we don't bother querying the miniport.
*
\**************************************************************************/
{
INT i;
//
// Fill in the GDIINFO data structure with the information returned from
// the kernel driver.
//
ppdev->lDeltaScreen = 0;
pGdiInfo->ulHorzSize = 0;
pGdiInfo->ulVertSize = 0;
pGdiInfo->ulPanningHorzRes = 0;
pGdiInfo->ulPanningVertRes = 0;
// to-screen blts, and any
// window alignment is okay
pGdiInfo->ptlPhysOffset.x = 0;
pGdiInfo->ptlPhysOffset.y = 0;
// RGB and CMY color info.
// No dye correction for raster displays.
// Note: this should be modified later to take into account the size
// of the display and the resolution.
// Fill in the basic devinfo structure
// Fill in the rest of the devinfo and GdiInfo structures.
{
// It is Palette Managed.
// Assuming palette is orthogonal - all colors are same size.
}
else
{
pGdiInfo->ulNumPalReg = 0;
{
}
{
}
else
{
}
}
// create remaining palette entries, simple loop to create uniformly
// distributed color values.
for (i = NUMPALRESERVED; i < NUMPALCOLORS; i++) {
palColors[i][3] = 0;
if (!(red += 32))
if (!(green += 32))
blue += 64;
}
{
NUMPALCOLORS, // cColors
0,
0,
0); // flRed, flGreen, flBlue [not used]
}
else
{
}
DISPDBG((0,"bInitPDEV OK\n"));
return(TRUE);
}